/* Shared visual rhythm, navigation, feedback and restrained motion. */
:root {
  --ui-surface: #110e14;
  --ui-line: #51313f;
  --ui-success: #87dcb0;
  --ui-warning: #e8c384;
  --ui-error: #ee91a5;
}
:is(.panel, .card, .license-center, .error-help, .announcement-directory, .changelog-directory, .reseller-directory) {
  border-radius: 16px !important;
  border-color: var(--ui-line) !important;
  padding: clamp(20px, 2.2vw, 30px);
}
:is(.panel, .card, .license-center, .error-help, .announcement-directory, .changelog-directory, .reseller-directory):hover {
  border-color: #745061 !important;
  box-shadow: none !important;
}
:is(.card, .license-center, .error-help, .changelog-card)::before,
:is(.card, .license-center, .error-help, .changelog-card)::after { display:none !important; }
:is(.metric, .tool-card, .data-action, .permission-group, .account-edit, .password-edit, .license-edit, .security-locks) {
  border-color: #412b38 !important;
  border-radius: 12px !important;
}
main > .panel + .panel,
main > :is(.license-center, .announcement-directory, .bottom-grid, .error-help) { margin-top:24px; }
.form-grid { row-gap:18px; }
.panel-heading { margin-bottom:22px; }
.panel-heading p, .intro, .notice { line-height:1.6; }
:is(.panel, .card, .announcement-directory) h3 { line-height:1.35; }
:is(.petals, .tsumi-petals) { opacity:.3; }
:is(.card, .license-center, .error-help, .announcement-directory) {
  animation: ui-card-enter .32s ease-out both !important;
}
@keyframes ui-card-enter {
  from { opacity:0; transform:translateY(6px); }
  to { opacity:1; transform:translateY(0); }
}
/* A full pink border marks the active page without changing button geometry. */
:is(header, #tsumi-header-theme) a:is([aria-current="page"], [aria-current="location"], .ui-active-section) {
  box-shadow: none !important;
  border-color: #f3a1bc !important;
  box-shadow: inset 0 0 0 1px #f3a1bc !important;
}
header :is(.account-menu, .admin-menu):focus-within :is(.account-popover, .admin-popover) { display:grid; }
.table-wrap { max-height:70vh; overflow:auto; scrollbar-color:#785063 #110e14; }
table { border-collapse:separate; border-spacing:0; }
thead th { position:sticky; top:0; z-index:3; background:#1b141d; }
tbody td { border-bottom-color:#392632 !important; transition:background-color .15s ease; }
tbody tr:hover td, tbody tr:focus-within td { background-color:#251925 !important; }
:is(.user-status.active, .active-status, .message.success, .notice.success) { color:var(--ui-success) !important; }
:is(.user-status.suspended, .user-status.expired, .message.warning, .notice.warning) { color:var(--ui-warning) !important; }
:is(.user-status.banned, .message.error, .notice.error, .is-locked) { color:var(--ui-error) !important; }
/* One consistent feedback position, above fixed save bars and mobile safe areas. */
#ui-feedback {
  position:fixed; right:24px; bottom:calc(100px + env(safe-area-inset-bottom)); z-index:10000;
  width:max-content; max-width:min(440px, calc(100vw - 32px));
  display:flex; align-items:center; gap:12px; padding:14px 18px;
  border:1px solid #745061; border-radius:12px; background:#19111b;
  color:#fff5f8; box-shadow:0 10px 30px #0006; font:14px/1.5 Arial,sans-serif;
  opacity:0; transform:translateY(8px); pointer-events:none;
  transition:opacity .18s ease, transform .18s ease;
}
#ui-feedback.show { opacity:1; transform:translateY(0); }
#ui-feedback[data-kind="success"] { border-color:#467b61; }
#ui-feedback[data-kind="error"] { border-color:#b75b74; }
#ui-feedback[data-kind="warning"] { border-color:#a08251; }
#ui-feedback-symbol { color:#e2b6c5; font-weight:700; }
#ui-feedback[data-kind="success"] #ui-feedback-symbol { color:var(--ui-success); }
#ui-feedback[data-kind="error"] #ui-feedback-symbol { color:var(--ui-error); }
#ui-feedback[data-kind="warning"] #ui-feedback-symbol { color:var(--ui-warning); }
@media(max-width:650px) {
  #ui-feedback { right:16px; bottom:calc(150px + env(safe-area-inset-bottom)); }
  .form-grid { row-gap:16px; }
}
@media(prefers-reduced-motion:reduce) {
  :is(.card, .license-center, .error-help, .announcement-directory) { animation:none !important; }
  #ui-feedback, tbody td { transition:none; }
}

/* Match the header palette specificity so the active-page border remains visible. */
:is(header, #tsumi-header-theme) :is(a, #tsumi-header-control):is([aria-current="page"], [aria-current="location"], .ui-active-section) {
  box-shadow: none !important;
  border-color: #f3a1bc !important;
  box-shadow: inset 0 0 0 1px #f3a1bc !important;
}
@media (max-width:900px) {
  body > header, body > header.dashboard-header {
    height:auto !important;
    min-height:72px;
    flex-wrap:wrap;
    padding:12px 20px !important;
  }
  body > header .brand { flex-shrink:0; }
  body > header .brand :is(h1, p) { white-space:nowrap; }
  body > header .header-actions { flex-wrap:wrap !important; gap:8px !important; }
}
/* Opaque sticky cells keep scrolled rows from showing through the heading. */
.table-wrap thead th { background:#1b141d !important; }
@media (min-width:651px) and (max-width:900px) {
  body > header .header-actions > a.nav-button { display:inline-flex !important; }
  body > header .switch-label { display:inline !important; }
}
