:root {
    color-scheme: light;
    --ink: #24224f;
    --ink-soft: #555474;
    --muted: #77778d;
    --violet: #6458c8;
    --violet-dark: #5145b1;
    --accent: #c18c48;
    --canvas: #f6f6f9;
    --surface: #fff;
    --line: #e6e6ed;
    --line-strong: #d4d4df;
    --success: #257555;
    --success-bg: #eff8f2;
    --warning: #946524;
    --warning-bg: #fff9ef;
    --danger: #a33d48;
    --danger-bg: #fff2f2;
    --text-xs: .6875rem;
    --text-sm: .75rem;
    --text-base: .875rem;
    --text-lg: 1.0625rem;
    --text-xl: 1.5625rem;
    --text-2xl: 2rem;
    --space-1: .25rem;
    --space-2: .5rem;
    --space-3: .75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --radius: 12px;
    --shadow: 0 12px 32px rgb(36 34 79 / 7%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; background: var(--canvas); font-size: var(--text-base); line-height: 1.55; }
/* Element defaults are wrapped in :where() (zero specificity) so any mc-/pc-
   component class wins: button:hover used to beat .mc-button and paint white
   text on light hover backgrounds, and input sizing blew up radios. */
:where(a) { color: var(--violet-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:where(a:hover) { color: var(--ink); }
:where(button, input, select) { font: inherit; }
:where(button, .button) { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; gap: var(--space-2); padding: 9px 14px; border: 1px solid var(--violet); border-radius: 8px; background: var(--violet); color: #fff; font-weight: 650; text-decoration: none; cursor: pointer; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
:where(button:hover, .button:hover) { border-color: var(--violet-dark); background: var(--violet-dark); color: #fff; }
:where(button:active, .button:active) { transform: translateY(1px); }
:where(button.secondary, .button.secondary) { border-color: var(--line-strong); background: var(--surface); color: var(--ink-soft); }
:where(button.secondary:hover, .button.secondary:hover) { border-color: var(--violet); color: var(--violet-dark); }
:where(button.danger) { border-color: #ead1d3; background: var(--surface); color: var(--danger); }
:where(button.danger:hover) { border-color: var(--danger); background: var(--danger-bg); }
:where(:focus-visible) { outline: 3px solid #b4aff0; outline-offset: 3px; }
.skip-link { position: fixed; z-index: 10; top: 12px; left: 12px; padding: 10px 14px; transform: translateY(-160%); border-radius: 8px; background: var(--ink); color: #fff; }
.skip-link:focus { transform: translateY(0); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 2; display: flex; width: 248px; flex-direction: column; padding: 26px 17px 18px; border-right: 1px solid var(--line); background: var(--surface); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; width: fit-content; margin: 0 0 42px 8px; color: var(--ink); font-size: 18px; font-weight: 750; letter-spacing: -.7px; text-decoration: none; }
.wordmark-mark { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: var(--ink); color: white; font-size: 18px; font-weight: 750; letter-spacing: -1px; }
.sidebar-label, .eyebrow { margin: 0 0 12px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-label { padding: 0 11px; }
.sidebar-nav, .sidebar-bottom { display: grid; gap: var(--space-1); }
.sidebar-nav a, .sidebar-bottom > a, .nav-button { position: relative; display: flex; min-height: 42px; align-items: center; gap: 11px; padding: 9px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); font-weight: 560; text-align: left; text-decoration: none; }
.sidebar-nav a:hover, .sidebar-bottom > a:hover, .nav-button:hover { background: #f7f6fc; color: var(--ink); }
.sidebar-nav a.is-active, .sidebar-bottom > a.is-active { background: #f3f2fb; color: var(--ink); font-weight: 700; }
.sidebar-nav a.is-active::before, .sidebar-bottom > a.is-active::before { position: absolute; inset: 9px auto 9px -17px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); content: ""; }
.nav-icon { width: 19px; color: #85839f; font-size: 16px; text-align: center; }
.sidebar-bottom { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.sidebar-bottom form { margin: 0; }
.add-domain-form { margin-top: 12px; }
.subscription-form { margin: 0 0 12px; }
.nav-button { width: 100%; cursor: pointer; font-weight: 560; }
.app-main { min-height: 100vh; margin-left: 248px; }
.topbar { display: flex; min-height: 68px; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 4vw, 54px); border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 85%); }
.topbar-context { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.language-switch { display: flex; align-items: center; gap: 8px; color: #b2b1c0; font-size: 12px; }
.language-switch a { color: var(--muted); text-decoration: none; }
.language-switch a:hover, .language-switch a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.page-content { width: min(100%, 1260px); margin: 0 auto; padding: clamp(25px, 4vw, 48px) clamp(22px, 4vw, 54px) 64px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-heading h1, .auth-card h1 { margin: 0; color: var(--ink); font-size: clamp(var(--text-xl), 3vw, var(--text-2xl)); font-weight: 710; letter-spacing: -1.1px; line-height: 1.2; }
.page-heading .eyebrow { position: relative; width: fit-content; margin-bottom: 10px; padding-left: 12px; }
.page-heading .eyebrow::before { position: absolute; top: 2px; bottom: 2px; left: 0; width: 2px; background: var(--accent); content: ""; }
.page-description { margin: 8px 0 0; color: var(--muted); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
:where(h2) { margin: 0; color: var(--ink); font-size: var(--text-lg); font-weight: 700; letter-spacing: -.35px; }
:where(h3) { margin: 0; color: var(--ink); font-size: 14px; font-weight: 700; }
.stack { display: grid; gap: 22px; }
.panel, .metric-card { min-width: 0; padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 2px 7px rgb(36 34 79 / 2%); }
.panel + .panel { margin-top: 20px; }
.panel-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) 18px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
:where(label, legend) { color: var(--ink-soft); font-size: 12px; font-weight: 650; }
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select) { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink); }
:where(input)::placeholder { color: #a4a3b2; }
:where(input:focus, select:focus) { border-color: var(--violet); outline: 3px solid #d8d5f5; outline-offset: 1px; }
.field-error { color: var(--danger); font-size: 12px; }
.field-error:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 17px; }
.inline-form { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; }
.inline-form select { min-width: 170px; }
.notice { margin: 0 0 20px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 9px; }
.notice-success { border-color: #d2e8d9; background: var(--success-bg); color: var(--success); }
.notice-error { border-color: #efd4d6; background: var(--danger-bg); color: var(--danger); }
.notice ul { margin: 5px 0 0; padding-left: 20px; }
.table-wrap { overflow-x: auto; margin: 0 -3px; border: 1px solid var(--line); border-radius: 9px; }
:where(table) { width: 100%; border-collapse: collapse; text-align: left; }
:where(th) { padding: 11px 14px; background: var(--canvas); color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
:where(td) { padding: 13px 14px; border-top: 1px solid var(--line); color: var(--ink-soft); vertical-align: middle; }
:where(tbody tr:hover) { background: var(--canvas); }
.primary-text { color: var(--ink); font-weight: 650; }
.cell-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.cell-actions form { margin: 0; }
.cell-actions button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.confirm-disclosure { max-width: 280px; }
.confirm-disclosure summary { display: inline-flex; min-height: 34px; align-items: center; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink-soft); font-size: 12px; font-weight: 650; cursor: pointer; list-style: none; }
.confirm-disclosure summary::-webkit-details-marker { display: none; }
.confirm-disclosure summary::after { margin-left: 8px; color: var(--muted); content: "+"; }
.confirm-disclosure[open] summary::after { content: "−"; }
.confirm-disclosure form { margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.confirm-disclosure form p { margin: 0 0 8px; color: var(--ink-soft); font-size: 12px; }
.status-pill { display: inline-flex; min-height: 24px; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 99px; background: #f6f6f9; color: var(--ink-soft); font-size: 11px; font-weight: 650; white-space: nowrap; }
.status-pill::before { width: 6px; height: 6px; border-radius: 50%; background: #9998a8; content: ""; }
.status-pill.is-active, .status-pill.is-paid, .status-pill.is-healthy { border-color: #d4e9dc; background: #f1f8f3; color: var(--success); }
.status-pill.is-active::before, .status-pill.is-paid::before, .status-pill.is-healthy::before { background: #3a9a67; }
.status-pill.is-suspended, .status-pill.is-past_due, .status-pill.is-unpaid, .status-pill.is-unhealthy { border-color: #f0d5d6; background: #fff4f4; color: var(--danger); }
.status-pill.is-suspended::before, .status-pill.is-past_due::before, .status-pill.is-unpaid::before, .status-pill.is-unhealthy::before { background: #c45b62; }
.status-pill.is-pending, .status-pill.is-open, .status-pill.is-trialing { border-color: #efdfc8; background: var(--warning-bg); color: var(--warning); }
.status-pill.is-pending::before, .status-pill.is-open::before, .status-pill.is-trialing::before { background: var(--accent); }
.empty-state { padding: 28px 18px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 3px; color: var(--ink-soft); }
.table-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; color: var(--muted); font-size: 12px; }
.table-meta nav { display: flex; gap: 8px; }
.table-meta nav a, .table-meta nav span { padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
.table-meta nav span { color: #aaa; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.metric-card { padding: 17px 19px; }
.metric-label { display: block; color: var(--muted); font-size: 11px; font-weight: 650; }
.metric-value { display: block; margin-top: 7px; color: var(--ink); font-size: 25px; font-weight: 720; letter-spacing: -.8px; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.detail-list div { display: flex; justify-content: space-between; gap: 18px; padding: 13px 5px; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; color: var(--ink); font-weight: 650; text-align: right; }
.checkout-link { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.checkout-link a { overflow-wrap: anywhere; }
.extension-card { padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.extension-card + .extension-card { margin-top: 12px; }
.extension-meta { margin: 7px 0 15px; color: var(--muted); font-size: 12px; }
.activation-list { display: grid; gap: 8px; }
.activation-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
fieldset { min-width: 0; margin: 0; padding: 13px; border: 1px solid var(--line-strong); border-radius: 8px; }
.check-list { display: flex; flex-wrap: wrap; gap: 9px 18px; padding-top: 9px; }
.check-list label { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--violet); }
.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 28px 16px; background: #f1f0f8; }
.auth-wrap { width: min(100%, 420px); }
.auth-wordmark { display: flex; justify-content: center; margin: 0 auto 23px; }
.auth-card { position: relative; padding: 32px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.auth-language { justify-content: flex-end; margin-bottom: 22px; }
.auth-card h1 { margin-bottom: 8px; font-size: 25px; }
.auth-card .page-description { margin-bottom: 23px; }
.auth-card .form-grid { grid-template-columns: 1fr; }
.auth-card .form-actions button { width: 100%; }
.auth-caption { margin: 18px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.impersonation-banner { margin-bottom: 19px; padding: 12px 15px; border: 1px solid #eadcc7; border-radius: 8px; background: #fff9ef; color: #755522; }
.impersonation-banner form { display: inline; margin-left: 8px; }

@media (max-width: 1060px) {
    .sidebar { width: 214px; }
    .app-main { margin-left: 214px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .table-card-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
    .table-card-table tbody, .table-card-table tr, .table-card-table td { display: block; }
    .table-card-table tr { padding: 8px 13px; border-top: 1px solid var(--line); }
    .table-card-table td { display: grid; grid-template-columns: minmax(100px, .7fr) 1fr; gap: 12px; padding: 6px 0; border: 0; }
    .table-card-table td::before { color: var(--muted); content: attr(data-label); font-size: 11px; font-weight: 650; }
}
@media (max-width: 720px) {
    .sidebar { position: static; width: auto; min-height: 0; padding: 13px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
    .wordmark { margin: 0 0 12px 4px; }
    .sidebar-label { display: none; }
    .sidebar-nav { display: flex; overflow-x: auto; gap: 3px; padding-bottom: 2px; }
    .sidebar-nav a { min-height: 37px; flex: 0 0 auto; padding: 7px 9px; font-size: 12px; }
    .sidebar-nav a.is-active::before { inset: auto 10px -3px; width: auto; height: 2px; }
    .sidebar-bottom { display: flex; flex-direction: row; gap: 4px; margin-top: 9px; padding-top: 8px; }
    .sidebar-bottom > a, .sidebar-bottom .nav-button { min-height: 34px; padding: 6px 9px; font-size: 12px; }
    .nav-icon { width: auto; }
    .app-main { margin-left: 0; }
    .topbar { min-height: 54px; padding: 0 18px; }
    .page-content { padding: 27px 16px 42px; }
    .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 21px; }
    .panel { padding: 17px; }
    .form-grid, .panel-grid, .detail-list { grid-template-columns: 1fr; }
    .field.full { grid-column: auto; }
    .metric-grid { gap: 8px; }
    .metric-card { padding: 13px; }
    .metric-value { font-size: 21px; }
    .activation-row { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 460px) {
    .topbar-context { font-size: 10px; }
    .language-switch { gap: 5px; font-size: 11px; }
    .metric-grid { grid-template-columns: 1fr 1fr; }
    .auth-card { padding: 24px 19px; }
    .table-card-table td { grid-template-columns: 95px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
