@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400..650&family=Inter:wght@400..700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
    color-scheme: light;
    --bg: #f5f4ee;
    --panel: #faf9f4;
    --soft: #ece9df;
    --text: #2b2925;
    --strong: #141413;
    --muted: #6b6557;
    --line: #d9d4c4;
    --coral: #cc785c;
    --accent: #9a462e;
    --primary: #141413;
    --primary-ink: #f5f4ee;
    --focus: #b85b3f;
    --tint: #efece1;
    --good: #4a5d3a;
    --good-bg: #e8ebdd;
    --warn: #774b27;
    --warn-bg: #f6e8d6;
    --bad: #884837;
    --bad-bg: #f6e8e1;
    --shadow: 0 12px 40px -12px #14141340;
    --display: "Fraunces", Georgia, serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;
    --topbar-height: 68px;
    --sidebar-width: 228px;
    font: 100%/1.55 "Inter", system-ui, sans-serif;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #151513;
    --panel: #1c1b18;
    --soft: #292722;
    --text: #e8e4d9;
    --strong: #f5f4ee;
    --muted: #bcb5a7;
    --line: #3d392f;
    --accent: #efb59f;
    --primary: #f5f4ee;
    --primary-ink: #141413;
    --focus: #efb59f;
    --tint: #30251f;
    --good: #c4d3ae;
    --good-bg: #2c3825;
    --warn: #f5c790;
    --warn-bg: #413021;
    --bad: #f0b09b;
    --bad-bg: #442b23;
    --shadow: 0 12px 40px -12px #000a;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; background: var(--bg); color: var(--text); }
h1, h2, h3, p { margin-block: 0 12px; }
h1, h2, h3 { color: var(--strong); line-height: 1.18; }
h1, h2 { font-family: var(--display); font-weight: 500; letter-spacing: -.025em; }
::selection { background: var(--coral); color: #141413; }
h1 { font-size: clamp(2.3rem, 4.5vw, 3.45rem); }
h2 { font-size: clamp(1.45rem, 2.25vw, 1.8rem); }
h3 { font-size: 1.06rem; }
p { max-width: 68ch; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, .button, select { min-height: 40px; }
button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel);
    color: var(--strong);
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}
button:hover, .button:hover { border-color: var(--accent); text-decoration: none; }
button:disabled { opacity: .64; cursor: wait; }
.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); border-radius: 999px; }
.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--primary-ink); }
.quiet { background: transparent; color: var(--accent); }
.danger { color: var(--bad); }
input, select, textarea {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel);
    color: var(--strong);
}
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); }
textarea { resize: vertical; min-height: 88px; }
label { display: grid; gap: 5px; color: var(--strong); font-size: .88rem; font-weight: 650; min-width: 0; }
label.check { display: flex; align-items: center; gap: 8px; }
small, .muted { color: var(--muted); }
kbd { font: .675rem var(--mono); border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; color: var(--muted); }
code { font-family: var(--mono); font-size: .88em; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.skip { position: fixed; z-index: 12; inset: 8px auto auto 8px; padding: 12px; background: var(--panel); transform: translateY(-160%); }
.skip:not(:focus) { clip-path: inset(50%); }
.skip:focus { transform: none; }
.wrap { width: min(1240px, 100% - 48px); margin-inline: auto; }
.topbar {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
    gap: 12px 20px; min-height: 68px; padding: 12px max(24px, calc((100vw - 1240px) / 2));
    background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand {
    display: inline-flex; gap: 8px; align-items: center; text-decoration: none;
    font: 500 1.375rem/1 var(--display); letter-spacing: -.01em; color: var(--strong); white-space: nowrap;
}
.brand-mark {
    flex: 0 0 23px; height: 23px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #cc785c, #b85b3f 60%, #141413);
}
.brand-product {
    margin-left: 3px; padding-left: 11px; border-left: 1px solid var(--line);
    font: 500 .89rem/1.65 "Inter", system-ui, sans-serif; letter-spacing: 0;
}
.row, .actions, .badges, .top-actions, .identity { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.top-actions, .identity { gap: 10px; }
.top-actions a:not(.button) { font-size: .93rem; color: var(--muted); }
.eyebrow {
    color: var(--muted); font: 500 .6875rem/1.65 var(--mono);
    letter-spacing: .12em; text-transform: uppercase;
}
.menu { position: relative; }
.menu summary { cursor: pointer; padding: 8px; border-radius: 8px; font-size: .85rem; font-weight: 600; }
.menu nav {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 10; min-width: 184px;
    display: grid; gap: 8px; box-shadow: var(--shadow);
}
.auth-main {
    min-height: calc(100svh - 68px); display: grid; align-content: center; justify-items: center;
    padding: 32px 16px 64px;
    background: radial-gradient(700px 550px at 76% 28%, #cc785c22, transparent 64%),
        radial-gradient(650px 420px at 24% 80%, #4a5d3a24, transparent 64%);
}
.auth-panel { width: min(100%, 440px); }
.auth-panel.panel { padding: clamp(24px, 5vw, 40px); border-radius: 22px; box-shadow: var(--shadow); }
.auth-panel .lede { margin-bottom: 24px; }
.auth-primary { width: 100%; min-height: 46px; }
.password-option { margin-top: 20px; }
.password-option summary { width: fit-content; cursor: pointer; color: var(--muted); font-size: .875rem; }
.password-option[open] summary { margin-bottom: 16px; }
.auth-registration { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 22px; font-size: .875rem; }
.main { padding-block: 36px 56px; }
.section { margin-block: 28px; }
.section + .section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; }
.section-head h2, .section-head p { margin: 0; }
.lede { color: var(--muted); font-size: 1.05rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 238px), 1fr)); gap: 12px; }
.tile, .panel, .empty {
    min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px;
    background: var(--panel); overflow-wrap: anywhere;
}
.tile h3 { margin-block: 0 9px; }
.tile h3 a { color: var(--strong); text-decoration: none; }
.tile h3 a:hover { color: var(--accent); text-decoration: underline; }
.tile .actions { margin-top: 12px; }
.tile-link { color: var(--strong); text-decoration: none; }
.tile-link:hover { border-color: var(--accent); }
.tile-link strong { display: block; margin-bottom: 3px; }
.empty { border-style: dashed; color: var(--muted); }
.empty p, .panel p:last-child { margin-bottom: 0; }
.badge {
    display: inline-flex; align-items: center; gap: 5px; width: fit-content;
    padding: 3px 8px; border-radius: 999px; background: var(--soft); color: var(--muted);
    font-size: .75rem; font-weight: 600;
}
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 5px 8px; margin-bottom: 17px; font-size: .88rem; color: var(--muted); }
.filters { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); gap: 12px; margin-block: 18px; }
.form { display: grid; gap: 12px; }
.form .actions { margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; align-items: end; }
.narrow { max-width: 530px; margin-inline: auto; }
.stack { display: grid; gap: 10px; }
.console-topbar {
    position: fixed; z-index: 8; inset: 0 0 auto; height: var(--topbar-height);
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; padding: 0 24px;
    background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px);
}
.console-topbar .identity, .console-topbar .top-actions { flex-wrap: nowrap; }
.console-context { display: flex; align-items: center; justify-content: center; gap: 16px; min-width: 0; }
.org-label, .org-picker {
    margin: 0; width: auto; max-width: 240px; min-width: 0; color: var(--text);
    font-size: .875rem; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
}
.org-picker { min-height: 34px; }
.search-trigger {
    flex: 1 1 130px; max-width: 350px; min-width: 0; min-height: 38px;
    justify-content: flex-start; border-radius: 999px; background: var(--soft); color: var(--muted);
    font-size: .875rem; font-weight: 500;
}
.search-trigger kbd { margin-left: auto; white-space: nowrap; }
.search-icon {
    position: relative; flex: 0 0 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 50%;
    margin-right: 3px;
}
.search-icon::after {
    content: ""; width: 5px; height: 1.5px; background: currentColor;
    position: absolute; right: -4px; bottom: -2px; transform: rotate(45deg);
}
.top-utility, .nav-toggle { border-radius: 999px; background: transparent; min-height: 36px; font-size: .84rem; }
.console-topbar .top-actions .button { color: var(--strong); }
.nav-toggle { width: 36px; padding: 0; }
.menu-icon { width: 14px; height: 10px; position: relative; border-block: 1.5px solid currentColor; }
.menu-icon::after { content: ""; position: absolute; inset: calc(50% - .75px) 0 auto; height: 1.5px; background: currentColor; }
.menu-notifications { display: none; }

.console-layout { padding-top: var(--topbar-height); min-height: 100dvh; }
.sidebar {
    position: fixed; z-index: 7; inset: var(--topbar-height) auto 0 0; width: var(--sidebar-width);
    overflow-y: auto; overscroll-behavior: contain; padding: 24px 12px;
    border-right: 1px solid var(--line); background: var(--bg);
}
.sidebar:not([hidden]) ~ .console-content { margin-left: var(--sidebar-width); }
.sidebar nav { display: grid; gap: 2px; }
.sidebar a, .sidebar-admin summary {
    display: block; color: var(--text); padding: 7px 12px; border-radius: 8px;
    text-decoration: none; font-size: .875rem; font-weight: 550;
}
.sidebar a:hover, .sidebar a[aria-current="page"], .sidebar-admin summary:hover { color: var(--accent); background: var(--tint); }
.sidebar a[aria-current="page"] { box-shadow: inset 2px 0 var(--coral); font-weight: 650; }
.sidebar-suites, .sidebar-group, .sidebar-admin { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.sidebar-suites .eyebrow { margin: 2px 12px 5px; }
.sidebar-admin summary { display: list-item; cursor: pointer; }
.sidebar-admin a { margin-left: 10px; }
.sidebar-suites .sidebar-admin { border-top: 0; padding-top: 0; margin-top: 0; }
.nav-backdrop { position: fixed; inset: var(--topbar-height) 0 0; z-index: 6; width: 100%; background: #14141366; border: 0; border-radius: 0; }
.console-content { min-width: 0; min-height: calc(100dvh - var(--topbar-height)); padding: 36px clamp(24px, 4.4vw, 64px) 56px; }
.workspace-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.workspace-heading h1 { margin: 0; overflow-wrap: anywhere; }
.workspace-heading .eyebrow { margin-bottom: 6px; }
.workspace-heading .button { border-radius: 999px; }
.product-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 16px; }
.product-tile { padding: 20px; display: flex; flex-direction: column; align-items: start; }
.product-tile h3 { font: 500 1.33rem/1.15 var(--display); margin-bottom: 6px; }
.product-tile .tile-description {
    width: 100%; margin-bottom: 16px; font-size: .875rem; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
}
.product-tile .badges { margin-top: auto; }
.product-tile .actions { margin-top: 16px; }
.product-tile .actions .button { min-height: 36px; padding-inline: 16px; font-size: .875rem; }
.catalog-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(150px, 1fr); gap: 16px; max-width: 620px; }
.catalog-status { margin-block: 12px 8px; font-size: .875rem; }
.catalog-suite > summary, .catalog-category > summary { list-style-position: inside; padding-inline: 4px; }
.catalog-category { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--bg); }
.catalog-category .product-grid { margin-block: 12px 4px; }
.catalog-category > button { margin-block: 8px 4px; }
.group-count { float: right; font: .75rem/1.8 var(--mono); color: var(--muted); }
.accordion { margin-block: 8px; }
.accordion summary { cursor: pointer; padding-block: 4px; font-weight: 650; }
.accordion > .grid, .accordion > .accordion { margin-top: 10px; }
.activity { margin: 0; padding: 0; list-style: none; }
.activity li { padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.activity li:last-child { border: 0; }
.group-title { margin-block: 4px 6px; }
.inline-error { padding: 10px 12px; border-radius: 6px; background: var(--bad-bg); color: var(--bad); }
.estate-product header p { margin-bottom: 8px; }
.estate-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); gap: 8px 16px; }
.estate-meta dt { color: var(--muted); font-size: .875rem; }
.estate-meta dd { margin: 0; }
.estate-meta .estate-paths { grid-column: 1 / -1; }
.estate-paths code { display: block; }
.control-output {
    max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
    padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg);
}
.toast { position: fixed; z-index: 9; inset: auto 16px 16px auto; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; color: var(--strong); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.toast:empty { display: none; }
dialog {
    width: min(628px, calc(100% - 28px)); max-height: min(650px, calc(100% - 32px));
    overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--panel); color: var(--text); box-shadow: var(--shadow);
}
dialog::backdrop { background: #141413a6; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.dialog-head h2 { margin: 0; }
.palette-list { list-style: none; padding: 0; margin-block: 8px 0; }
.palette-list a { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 9px; border-radius: 6px; text-decoration: none; color: var(--strong); }
.palette-list [aria-selected="true"] a { background: var(--tint); }
.palette-list .result-name { flex: 1 0 45%; font-weight: 650; min-width: 0; overflow-wrap: anywhere; }
.form-note { font-size: .87rem; }
.footer { padding: 20px 0; border-top: 1px solid var(--line); }
@media (max-width: 900px) {
    .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
    .top-notifications { display: none; }
    .menu-notifications { display: block; }
}
@media (max-width: 780px) {
    :root { --topbar-height: 104px; }
    .wrap { width: calc(100% - 32px); }
    .topbar { padding-inline: 16px; gap: 8px 12px; }
    .console-topbar {
        grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 44px 38px;
        align-content: center; padding-inline: 12px;
    }
    .console-topbar .identity { gap: 7px; }
    .console-topbar .top-actions { gap: 3px; }
    .console-topbar .top-utility { padding-inline: 8px; }
    .console-context { order: 1; grid-column: 1 / -1; justify-content: start; gap: 10px; }
    .org-label, .org-picker { max-width: min(50%, 240px); }
    .search-trigger { max-width: none; }
    .sidebar { width: min(300px, 82vw); padding-top: 16px; }
    .sidebar:not([hidden]) ~ .console-content { margin-left: 0; }
    .console-content { padding: 24px 16px 42px; }
}
@media (max-width: 420px) {
    .console-topbar .brand { gap: 6px; font-size: 1.19rem; }
    .console-topbar .brand-mark { flex-basis: 19px; height: 19px; }
    .console-topbar .brand-product { padding-left: 7px; font-size: .8rem; }
    .console-topbar .nav-toggle { width: 32px; min-height: 32px; }
    .console-topbar .menu summary { padding-inline: 5px; }
    .console-topbar .top-utility, .console-topbar .menu summary { font-size: .75rem; }
    .catalog-filters { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.product-status { padding-block: 48px; }

.billing-nav {
    display: flex; flex-wrap: wrap; gap: 4px 9px; margin-bottom: 24px;
    padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.billing-nav a {
    padding: 7px 11px; border-radius: 7px; color: var(--text); text-decoration: none;
    font-size: .87rem; font-weight: 550;
}
.billing-nav a[aria-current], .billing-nav a:hover { color: var(--accent); background: var(--tint); }
.billing-content, .billing-content > * { min-width: 0; overflow-wrap: anywhere; }
.billing-period { margin: 0 0 12px; }
.billing-metrics { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.billing-metric p { margin: 0 0 5px; font-size: .88rem; font-weight: 600; }
.billing-metric strong, .billing-invoice-total { display: block; margin-bottom: 4px; font: 550 1.6rem/1.25 var(--display); color: var(--strong); }
.billing-metric small { color: var(--muted); }
.billing-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.billing-between { justify-content: space-between; align-items: baseline; }
.billing-note { margin-block: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--tint); }
.billing-note[hidden] { display: none; }
.billing-number { font-variant-numeric: tabular-nums; }
.billing-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.billing-filters > *, .billing-filters select { min-width: 0; }
.billing-total { margin-top: 12px; }
.billing-cost-table, .billing-cost-table thead, .billing-cost-table tbody { display: block; }
.billing-cost-table th { text-align: start; }
.billing-cost-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding-block: 9px; border-bottom: 1px solid var(--line); }
.billing-cost-table tbody .billing-cost-row:last-child { border: 0; }
.billing-cost-head, .billing-cell-label { font-size: .8rem; font-weight: 650; color: var(--muted); }
.billing-cell-label { display: none; }
.billing-invoice h2 { margin: 0; }
.billing-settings { max-width: 680px; }
@media (max-width: 780px) {
    .billing-split { grid-template-columns: minmax(0, 1fr); }
    .billing-nav { gap: 2px 4px; margin-bottom: 16px; }
    .billing-nav a { padding: 6px 8px; }
    .billing-cost-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .billing-cost-head { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
    .billing-cell-label { display: block; }
}

.terms-check, .pricing-fields { display: grid; gap: var(--space-2, 8px); }
.terms-check label, .check-line { display: flex; align-items: flex-start; gap: 8px; }
.terms-check input, .check-line input { flex: 0 0 auto; margin-top: 0.25em; width: auto; }
.terms-check .row { flex-wrap: wrap; }
.pricing-fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 176px), 1fr)); }
.pricing-meters .row { align-items: baseline; flex-wrap: wrap; }
.pricing-summary { font-weight: 650; }

.bank-instructions { white-space: pre-wrap; overflow-wrap: anywhere; }
.billing-content code { overflow-wrap: anywhere; }

/* Product families: modules listed under their parent (lane C1, 2026-11-26) */
.module-list { margin: 0; padding: 0; list-style: none; width: 100%; }
.module-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.module-row:last-child { border-bottom: 0; }
.module-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.module-text small { overflow-wrap: anywhere; }
.module-name { color: var(--strong); font-weight: 500; }
.module-action { display: flex; align-items: center; gap: 6px; flex: none; }
.module-action .button { min-height: 32px; padding-inline: 12px; font-size: .8125rem; }
.module-list.compact .module-row { padding: 6px 0; }
.tile-modules { width: 100%; margin-top: 12px; }
.tile-modules summary { cursor: pointer; color: var(--muted, inherit); font-size: .875rem; }
@media (max-width: 560px) { .module-row { flex-wrap: wrap; } .module-action { width: 100%; } }
.module-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.module-list.compact .module-action small { display: none; }
.module-list.compact .badge { font-size: 0; gap: 0; padding: 6px; }

/* No-access page for a product (proxy.rs → workspace::denied) */
.access-denied { max-width: 680px; }
.access-denied h2 { font-size: 1.05rem; margin-top: 24px; }
.access-denied .access-admins { padding-left: 20px; }
.access-denied .access-admins li { margin: 4px 0; }
.access-denied .actions { margin-block: 20px 12px; align-items: center; }
.access-denied #request-status { min-height: 1.4em; }
