@font-face {
    font-family:Vazirmatn;
    src:url(vazirmatn.woff2) format('woff2');
    font-weight:100 900;
    font-display:swap;
}

@font-face {
    font-family:Inter;
    src:url(inter.woff2) format('woff2');
    font-weight:100 900;
    font-display:swap;
}

:root {
    color-scheme:light;
    --bg:#f8fafc;
    --surface:#fff;
    --raised:#fff;
    --text:#18181b;
    --muted:#62626e;
    --border:#e4e4e7;
    --tint:#f4f4f6;
    --red:#d32231;
    --hover:#b91c2b;
    --brand-ink:#a51625;
    --brand-bg:#fcebed;
    --good:#047857;
    --green-bg:#e7f8ef;
    --warn:#865400;
    --amber-bg:#fff3d9;
    --bad:#b3222e;
    --bad-bg:#feecee;
    --info:#225abb;
    --blue-bg:#e9f1ff;
    --curve:14px;
    --radius:10px;
    --header:65px;
    --side:238px;
    --shadow:0 9px 35px #14142313;
    --paper:var(--bg);
    --ink:var(--text);
    --line:var(--border);
    --card:var(--surface);
    --accent:var(--red);
}

:root[data-theme=dark] {
    color-scheme:dark;
    --bg:#09090b;
    --surface:#18181b;
    --raised:#1e1e22;
    --text:#fafafa;
    --muted:#adadb9;
    --border:#323237;
    --tint:#242429;
    --brand-ink:#ffabb4;
    --brand-bg:#47242c;
    --good:#70e7b3;
    --green-bg:#183c2f;
    --warn:#f8cf80;
    --amber-bg:#48351e;
    --bad:#ffadb4;
    --bad-bg:#4f2930;
    --info:#a1c4ff;
    --blue-bg:#243951;
    --shadow:0 8px 36px #0007;
}

@media(prefers-color-scheme:dark) {
    :root:not([data-theme]) {
        color-scheme:dark;
        --bg:#09090b;
        --surface:#18181b;
        --raised:#1e1e22;
        --text:#fafafa;
        --muted:#adadb9;
        --border:#323237;
        --tint:#242429;
        --brand-ink:#ffabb4;
        --brand-bg:#47242c;
        --good:#70e7b3;
        --green-bg:#183c2f;
        --warn:#f8cf80;
        --amber-bg:#48351e;
        --bad:#ffadb4;
        --bad-bg:#4f2930;
        --info:#a1c4ff;
        --blue-bg:#243951;
    }
}

*,*:before,*:after {
    box-sizing:border-box;
}

[hidden] {
    display:none!important;
}

body {
    margin:0;
    background:var(--bg);
    color:var(--text);
    font:400 14px/1.75 Inter,Vazirmatn,system-ui,sans-serif;
    font-variant-numeric:tabular-nums;
}

h1,h2,h3,p {
    margin:0;
}

h1 {
    font-size:clamp(24px,3vw,34px);
    line-height:1.45;
    font-weight:800;
    letter-spacing:-.04em;
}

h2 {
    font-size:16px;
    font-weight:750;
}

h3 {
    font-size:14px;
    font-weight:700;
}

a {
    color:var(--brand-ink);
    text-decoration:none;
}

a:hover {
    text-decoration:underline;
}

button,a,input,textarea,select,summary {
    touch-action:manipulation;
}

button,input,textarea,select {
    font:inherit;
    color:inherit;
}

button {
    cursor:pointer;
}

button[disabled] {
    opacity:.52;
    cursor:default;
}

input,textarea,select {
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:9px 12px;
    background:var(--surface);
    min-width:0;
}

textarea {
    width:100%;
    resize:vertical;
}

input:disabled {
    opacity:.65;
}

input[type=checkbox] {
    width:16px;
    height:16px;
    accent-color:var(--red);
    flex:none;
}

:focus-visible {
    outline:2px solid var(--info);
    outline-offset:3px;
}

fieldset {
    min-width:0;
    border:0;
    padding:0;
    margin:0;
}

legend {
    font-weight:700;
    padding:0;
}

label {
    min-width:0;
}

label:not(.theme-picker):not(.shop-control):not(.check):not(.grp) {
    display:grid;
    gap:5px;
}

.icon {
    width:19px;
    height:19px;
    flex:none;
    vertical-align:middle;
}

.small {
    font-size:12px;
}

.muted,.empty {
    color:var(--muted);
}

.strong {
    font-weight:700;
}

.number,bdi,time,.monospace {
    font-variant-numeric:tabular-nums;
}

.monospace {
    font-size:12px;
    overflow-wrap:anywhere;
    direction:ltr;
    unicode-bidi:isolate;
}

.sr {
    position:absolute;
    inline-size:1px;
    block-size:1px;
    clip-path:inset(50%);
    overflow:hidden;
}

.skip {
    position:fixed;
    inset-inline-start:12px;
    top:-80px;
    z-index:10;
    background:var(--surface);
    padding:8px;
}

.skip:focus {
    top:8px;
}

.button,.text-button,.icon-button {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    min-height:40px;
    border:1px solid transparent;
    border-radius:var(--radius);
    padding:7px 13px;
    font-weight:650;
    white-space:nowrap;
    background:transparent;
    text-decoration:none;
    transition:background 160ms,border-color 160ms,color 160ms;
}

.button:hover,.profile a:hover {
    text-decoration:none;
}

.primary {
    background:var(--red);
    color:#fff;
}

.primary:hover {
    background:var(--hover);
}

.secondary,.ghost,.command-trigger {
    background:var(--surface);
    border-color:var(--border);
    color:var(--text);
}

.secondary:hover,.ghost:hover,.icon-button:hover,.text-button:hover,.quiet:hover,.command-trigger:hover {
    background:var(--tint);
}

.text-button {
    color:var(--brand-ink);
    padding-inline:7px;
}

.icon-button {
    width:42px;
    padding:0;
}

.wide {
    width:100%;
}

.actions {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px;
}

.actions.compact {
    gap:3px;
}

.compact .text-button {
    min-height:32px;
}

.danger {
    color:var(--bad);
}

.workspace {
    min-height:100dvh;
    display:grid;
    grid-template-columns:var(--side) minmax(0,1fr);
    transition:grid-template-columns 180ms;
}

.workspace.collapsed {
    --side:75px;
}

.sidebar {
    background:var(--surface);
    border-inline-end:1px solid var(--border);
    position:sticky;
    top:0;
    height:100dvh;
    display:flex;
    flex-direction:column;
    gap:14px;
    padding:22px 13px 14px;
    z-index:4;
    overflow-y:auto;
}

.sidebar-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 8px;
    min-height:47px;
}

.brand {
    display:flex;
    align-items:center;
    gap:10px;
    color:var(--text);
    white-space:nowrap;
}

.brand-mark {
    width:39px;
    height:39px;
    background:var(--red);
    border-radius:12px;
    display:grid;
    place-items:center;
    color:white;
    flex:none;
}

.brand-mark>.icon {
    width:23px;
    height:23px;
}

.brand strong,.brand small {
    display:block;
    line-height:1.35;
}

.brand strong {
    font-size:17px;
    font-weight:800;
}

.brand small {
    color:var(--muted);
    font-size:11px;
}

.nav-caption {
    color:var(--muted);
    font-size:11px;
    padding:8px 11px 0;
}

.sidebar nav {
    display:grid;
    gap:3px;
}

.sidebar nav a,.sidebar-footer :is(a,button) {
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:11px;
    color:var(--muted);
    padding:9px 11px;
    border-radius:8px;
    min-height:42px;
    font-size:13px;
    white-space:nowrap;
    text-decoration:none;
}

.sidebar a:hover,.sidebar-footer button:hover {
    background:var(--tint);
    text-decoration:none;
}

.sidebar nav a[aria-current=page],.bottom-nav a[aria-current=page] {
    background:var(--brand-bg);
    color:var(--brand-ink);
    font-weight:750;
}

.sidebar-footer {
    margin-top:auto;
    border-top:1px solid var(--border);
    padding-top:10px;
    display:grid;
}

.collapsed :is(.sidebar .brand>div,.nav-caption,.sidebar nav span,.sidebar-footer span) {
    display:none;
}

.collapsed .sidebar-footer a {
    font-size:0;
}

.collapsed .sidebar-head {
    padding:0;
    justify-content:center;
}

.collapsed .sidebar :is(nav a,.sidebar-footer button,.sidebar-footer a) {
    justify-content:center;
    padding-inline:0;
}

.collapsed .sidebar-footer button {
    font-size:0;
}

.surface {
    min-width:0;
}

.app-header {
    position:sticky;
    top:0;
    z-index:3;
    height:var(--header);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:0 clamp(14px,3vw,34px);
    border-bottom:1px solid var(--border);
    background:var(--surface);
}

.breadcrumb,.header-actions {
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
}

.breadcrumb {
    font-weight:650;
}

.breadcrumb .icon {
    width:14px;
}

.breadcrumb-root {
    color:var(--muted);
    white-space:nowrap;
}

#breadcrumb-current {
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.theme-picker {
    display:flex;
    align-items:center;
    gap:3px;
    color:var(--muted);
    flex:none;
}

.theme-picker select {
    padding:5px 3px;
    min-height:40px;
    font-size:12px;
}

.theme-picker svg {
    width:16px;
}

.command-trigger {
    gap:10px;
    color:var(--muted);
    font-size:12px;
}

kbd {
    padding:1px 5px;
    background:var(--tint);
    border:1px solid var(--border);
    border-radius:5px;
    direction:ltr;
    font:11px Inter,sans-serif;
}

.profile {
    position:relative;
    flex:none;
}

.profile>summary {
    list-style:none;
    width:39px;
    height:39px;
    display:grid;
    place-items:center;
    border-radius:50%;
    background:var(--tint);
    cursor:pointer;
    border:1px solid var(--border);
}

.profile>summary::-webkit-details-marker {
    display:none;
}

.popover {
    position:absolute;
    inset-inline-end:0;
    top:calc(100% + 8px);
    width:max-content;
    min-width:140px;
    background:var(--raised);
    border:1px solid var(--border);
    border-radius:var(--curve);
    padding:10px;
    box-shadow:var(--shadow);
    display:grid;
    gap:8px;
}

.popover>span {
    font-weight:700;
    padding-inline:8px;
}

#content {
    max-width:1580px;
    margin:0 auto;
    padding:clamp(16px,3vw,34px);
}

.page-heading {
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:12px;
    margin:4px 0 23px;
}

.page-heading p {
    color:var(--muted);
    margin-block-start:4px;
}

.page-actions {
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.card,.metric,.table-card,.search-banner {
    padding:clamp(14px,2vw,23px);
    border:1px solid var(--border);
    border-radius:var(--curve);
    background:var(--surface);
    min-width:0;
}

.card+.card {
    margin-block-start:16px;
}

.card h2 {
    margin-block-end:14px;
}

.grid-2 {
    display:grid;
    grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);
    gap:16px;
    margin-block:16px;
}

.grid-2>.card {
    margin:0;
}

.metric-grid {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:13px;
    margin-block-end:20px;
}

.metric {
    display:grid;
    gap:4px;
    align-content:start;
}

.metric-top {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:5px;
    color:var(--muted);
    font-weight:650;
}

.metric .number {
    font-size:30px;
    line-height:1.45;
    font-weight:780;
    letter-spacing:-.03em;
}

.metric small {
    color:var(--muted);
}

.metric-icon,.search-banner-icon {
    width:34px;
    height:34px;
    display:grid;
    place-items:center;
    border-radius:9px;
    background:var(--brand-bg);
    color:var(--brand-ink);
    flex:none;
}

.metric-icon>.icon {
    width:17px;
}

.search-banner {
    display:flex;
    align-items:center;
    gap:15px;
    margin-bottom:18px;
    color:var(--text);
    text-decoration:none;
    transition:border-color 180ms;
}

.search-banner:hover {
    border-color:var(--red);
    text-decoration:none;
}

.search-banner-icon {
    width:45px;
    height:45px;
}

.search-banner>span:nth-child(2) {
    flex:1;
}

.search-banner strong,.search-banner small {
    display:block;
}

.search-banner strong {
    font-size:17px;
}

.search-banner small {
    color:var(--muted);
}

.status-list,.list {
    margin:0;
    padding:0;
    list-style:none;
    display:grid;
    gap:0;
}

.status-list li,.list li {
    display:flex;
    justify-content:space-between;
    gap:8px;
    align-items:center;
    padding:10px 0;
    border-bottom:1px solid var(--border);
}

.list li:last-child,.status-list li:last-child {
    border:0;
}

.pill,.chip,.badge {
    display:inline-flex;
    gap:6px;
    align-items:center;
    white-space:nowrap;
    padding:3px 9px;
    border-radius:100px;
    font-size:12px;
    font-weight:650;
    background:var(--tint);
    color:var(--muted);
}

.pill:before {
    content:"";
    width:6px;
    height:6px;
    border-radius:50%;
    background:currentColor;
}

.pill.good,.badge.exact,.notice.ok {
    color:var(--good);
    background:var(--green-bg);
}

.pill.warn,.badge.close,.notice {
    color:var(--warn);
    background:var(--amber-bg);
}

.pill.bad,.chip.bad,.badge.out {
    color:var(--bad);
    background:var(--bad-bg);
}

.pill.info,.chip.active {
    color:var(--info);
    background:var(--blue-bg);
}

.table-card {
    padding:0;
    margin-block:0 16px;
}

.table-toolbar,.table-footer {
    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:wrap;
    gap:9px;
    padding:12px 16px;
}

.table-toolbar input {
    flex:1;
    min-width:min(10rem,100%);
    max-width:21rem;
}

.table-footer {
    color:var(--muted);
    border-top:1px solid var(--border);
}

.table-scroll {
    overflow:auto;
    max-width:100%;
}

.table-scroll:focus-visible {
    outline-offset:-2px;
}

table {
    width:100%;
    border-collapse:collapse;
    text-align:start;
    min-width:38rem;
}

th,td {
    padding:12px 15px;
    text-align:start;
    border-bottom:1px solid var(--border);
    vertical-align:middle;
}

.table-card tbody tr:last-child td {
    border-bottom:0;
}

th {
    background:var(--tint);
    font-weight:650;
    color:var(--muted);
    font-size:12px;
    white-space:nowrap;
}

td {
    overflow-wrap:anywhere;
}

tr:hover td {
    background:var(--bg);
}

th button {
    padding:0;
    min-height:unset;
    color:inherit;
}

.cell-sub {
    display:block;
    color:var(--muted);
    font-size:12px;
}

.empty-state {
    color:var(--muted);
    padding:24px 14px;
    text-align:center;
}

.table-card .empty-state {
    margin:0;
}

.source-grid {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
}

.source-card {
    display:grid;
    gap:8px;
}

.source-grid .source-card {
    margin:0;
}

.source-title {
    display:flex;
    align-items:center;
    gap:8px;
}

.source-title>strong {
    flex:1;
}

.facts {
    display:grid;
    grid-template-columns:minmax(100px,1fr) minmax(0,1.35fr);
    row-gap:6px;
    margin:0;
}

.facts dt {
    color:var(--muted);
}

.facts dd {
    margin:0;
    overflow-wrap:anywhere;
}

.chart-list {
    list-style:none;
    padding:0;
    margin:8px 0 0;
    display:grid;
    gap:9px;
}

.chart-list li {
    display:grid;
    grid-template-columns:minmax(5.5rem,1fr) minmax(0,2fr) auto;
    gap:9px;
    align-items:center;
}

.chart-list progress {
    height:8px;
}

.chart-list b {
    min-width:20px;
    text-align:end;
}

.search-card {
    display:grid;
    gap:15px;
}

.search-card>label {
    font-weight:700;
}

.search-card textarea {
    min-height:94px;
}

.category-strip {
    display:flex;
    flex-wrap:wrap;
    gap:7px;
}

.category-strip .button {
    font-size:12px;
    min-height:34px;
    border-color:var(--border);
}

.shops {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:7px;
    margin-top:8px;
}

.shops label,.check {
    display:flex;
    align-items:center;
    gap:7px;
    border:1px solid var(--border);
    padding:7px 9px;
    border-radius:8px;
    min-height:42px;
}

.shops label:has(input:checked) {
    border-color:var(--red);
    background:var(--brand-bg);
}

.shops label:has(input:disabled) {
    color:var(--muted);
}

.search-actions {
    border-top:1px solid var(--border);
    padding-top:12px;
}

.status {
    color:var(--muted);
    margin:12px 1px;
}

progress {
    width:100%;
    accent-color:var(--red);
}

.run-metrics {
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin:8px 0;
    color:var(--muted);
    font-size:12px;
}

.run-metrics div {
    padding:4px 8px;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
}

.run-metrics strong {
    margin-inline-end:4px;
    color:var(--text);
}

#tables section {
    margin-block:17px;
    border:1px solid var(--border);
    border-radius:var(--curve);
    background:var(--surface);
    padding:14px;
    min-width:0;
}

#tables h2 {
    margin-block-end:9px;
}

.toolbar,.chips,.summary {
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:7px;
    margin-block:8px;
}

.toolbar select,.toolbar button {
    min-height:36px;
    padding:6px 8px;
}

.on {
    background:var(--brand-bg);
    color:var(--brand-ink);
    border-color:var(--border);
}

.grp {
    display:flex;
    align-items:center;
    gap:4px;
}

.summary span {
    padding:5px 8px;
    background:var(--tint);
    border-radius:8px;
}

.note,.evidence {
    font-size:12px;
    color:var(--muted);
}

.note.ok {
    color:var(--good);
}

.note.bad {
    color:var(--bad);
}

.evidence {
    max-width:26rem;
    overflow-wrap:anywhere;
}

.notice {
    padding:7px 9px;
    border-radius:8px;
}

.shophead td {
    background:var(--tint);
    font-weight:700;
}

.source-status {
    margin:10px 0;
}

.sale {
    color:var(--good);
    font-weight:700;
}

dialog {
    border:1px solid var(--border);
    border-radius:var(--curve);
    background:var(--surface);
    color:var(--text);
    padding:20px;
    box-shadow:var(--shadow);
    width:min(570px,calc(100% - 28px));
    max-height:calc(100% - 28px);
    overflow:auto;
    animation:appear 180ms ease-out;
}

dialog::backdrop,.overlay {
    background:#10101792;
}

dialog.drawer {
    margin:0;
    margin-inline-start:auto;
    height:100%;
    max-height:100%;
    width:min(490px,100%);
    border-radius:var(--curve) 0 0 var(--curve);
}

.dialog-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    border-bottom:1px solid var(--border);
    margin-bottom:14px;
    padding-bottom:8px;
}

.dialog-head h2 {
    font-size:18px;
}

dialog #command-search {
    width:100%;
    margin-bottom:10px;
}

#command-items {
    display:grid;
    gap:2px;
}

#command-items a {
    display:flex;
    gap:9px;
    align-items:center;
    color:var(--text);
    padding:8px 10px;
    border-radius:8px;
}

#command-items a:hover {
    background:var(--tint);
}

.form-grid {
    display:grid;
    gap:13px;
}

.form-grid .fields {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
}

.form-grid fieldset {
    display:grid;
    gap:8px;
}

.form-grid .checks {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:6px;
}

.form-grid input:not([type=checkbox]),.form-grid select {
    width:100%;
}

.form-grid .step {
    font-size:12px;
    color:var(--brand-ink);
    font-weight:750;
}

.feedback {
    border:1px solid var(--border);
    background:var(--bad-bg);
    color:var(--bad);
    padding:9px 12px;
    border-radius:8px;
    margin-block:8px;
}

.toast {
    position:fixed;
    z-index:5;
    inset-inline-end:19px;
    bottom:19px;
    min-width:min(250px,calc(100% - 40px));
    max-width:calc(100% - 40px);
    padding:11px 16px;
    border-radius:10px;
    border:1px solid var(--border);
    background:var(--raised);
    box-shadow:var(--shadow);
    animation:appear 180ms ease-out;
}

.toast.bad {
    color:var(--bad);
}

.skeleton {
    display:grid;
    gap:10px;
    padding:14px 0;
}

.skeleton span {
    height:28px;
    background:var(--tint);
    border-radius:8px;
    animation:pulse 1.6s ease-in-out infinite;
}

.skeleton span:nth-child(2) {
    width:75%;
}

.skeleton span:nth-child(3) {
    width:60%;
}

.auth {
    width:100%;
    min-height:100dvh;
    display:grid;
    grid-template-columns:minmax(0,0.93fr) minmax(0,1.07fr);
}

.auth-story {
    background:#141419;
    color:#f8f7fa;
    padding:clamp(32px,6vw,120px);
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    gap:36px;
    min-height:100dvh;
    position:relative;
    overflow:hidden;
}

.auth-story .brand {
    color:#fff;
}

.auth-story .brand small {
    color:#cac9d1;
}

.auth-copy {
    margin-block:clamp(42px,10vh,125px) 45px;
}

.auth-copy h2 {
    font-size:clamp(29px,4.1vw,56px);
    line-height:1.35;
    letter-spacing:-.04em;
    max-width:10em;
}

.auth-copy p {
    font-size:16px;
    color:#d1cfd7;
    margin-top:16px;
    max-width:29em;
}

.auth-graphic {
    display:flex;
    align-items:center;
    gap:0;
    max-width:385px;
}

.auth-graphic div {
    width:clamp(50px,6vw,78px);
    aspect-ratio:1;
    border-radius:17px;
    background:#222228;
    border:1px solid #41414a;
    display:grid;
    place-items:center;
    color:#ffadb7;
}

.auth-graphic .icon {
    width:30px;
    height:30px;
}

.auth-graphic i {
    flex:1;
    height:1px;
    background:#4b4b54;
}

.auth-foot {
    display:flex;
    gap:12px;
    color:#dddce5;
    font:650 11px Inter,sans-serif;
    letter-spacing:.12em;
    direction:ltr;
    justify-content:flex-end;
}

.auth-foot span {
    color:#9695a2;
}

.auth-panel {
    background:var(--surface);
    display:grid;
    align-content:center;
    justify-items:center;
    padding:25px;
    position:relative;
    min-width:0;
}

.auth-top {
    position:absolute;
    top:24px;
    inset-inline:25px;
    display:flex;
    justify-content:flex-end;
}

.auth-top .brand {
    display:none;
}

.auth-form {
    width:min(100%,385px);
    padding-block:35px;
}

.auth-form>p {
    margin-block:5px 25px;
}

.auth-form form {
    display:grid;
    gap:13px;
}

.auth-form label {
    font-weight:650;
}

.auth-form input {
    min-height:47px;
}

.auth-form .fields,.auth-form #credentials {
    display:grid;
    gap:13px;
}

.input-combo {
    display:flex;
    position:relative;
    align-items:center;
    min-width:0;
}

.input-combo input {
    width:100%;
    padding-inline-end:47px;
}

.password-toggle {
    position:absolute;
    left:4px;
}

.auth-links {
    display:flex;
    justify-content:space-between;
    gap:9px;
    border-top:1px solid var(--border);
    padding-top:15px;
    margin-top:14px;
}

.auth-form .secondary-link {
    justify-self:center;
}

.auth-form #otp-step input {
    letter-spacing:.32em;
}

.access {
    min-height:100dvh;
    display:grid;
    place-items:center;
    padding:18px;
}

.access .card {
    display:grid;
    gap:14px;
    justify-items:start;
}

.mobile-only,.bottom-nav,.overlay {
    display:none;
}

@keyframes appear {
    from {
        opacity:.55;
        transform:translateY(4px);
    }
    to {
        opacity:1;
        transform:none;
    }
}

@keyframes pulse {
    50% {
        opacity:.5;
    }
}

@media(max-width:1190px) {
    .metric-grid {
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    .source-grid {
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    .shops {
        grid-template-columns:repeat(3,minmax(0,1fr));
    }
    .command-trigger kbd {
        display:none;
    }
}

@media(max-width:950px) {
    .workspace,.workspace.collapsed {
        display:block;
    }
    .sidebar {
        position:fixed;
        inset-block:0;
        inset-inline-start:0;
        width:min(280px,85vw);
        transform:translateX(105%);
        transition:transform 180ms;
        visibility:hidden;
    }
    .workspace.menu-open .sidebar {
        transform:translateX(0);
        visibility:visible;
    }
    .overlay {
        display:block;
        position:fixed;
        inset:0;
        z-index:3;
        border:0;
    }
    .mobile-only {
        display:inline-flex;
    }
    .sidebar-footer #collapse-menu {
        display:none;
    }
    .collapsed .sidebar nav span,.collapsed .sidebar .brand>div,.collapsed .nav-caption {
        display:initial;
    }
    .collapsed .sidebar nav a,.collapsed .sidebar-footer a {
        justify-content:flex-start;
        padding-inline:11px;
        font-size:13px;
    }
    .collapsed .sidebar-head {
        justify-content:space-between;
        padding-inline:8px;
    }
    .customer-workspace .surface {
        padding-bottom:70px;
    }
    .bottom-nav {
        display:grid;
        grid-template-columns:repeat(5,1fr);
        position:fixed;
        inset:auto 0 0;
        z-index:3;
        background:var(--surface);
        border-top:1px solid var(--border);
        padding:4px 5px max(4px,env(safe-area-inset-bottom));
    }
    .bottom-nav a {
        color:var(--muted);
        font-size:11px;
        display:grid;
        justify-items:center;
        line-height:1.3;
        padding:7px 0;
        gap:4px;
        border-radius:8px;
        text-decoration:none;
        white-space:nowrap;
    }
    .bottom-nav a:nth-child(2) span {
        font-size:10px;
    }
    .customer-workspace .toast {
        bottom:75px;
    }
}

@media(max-width:650px) {
    .auth {
        display:block;
    }
    .auth-story {
        display:none;
    }
    .auth-panel {
        display:block;
        min-height:100dvh;
        padding:23px;
    }
    .auth-top {
        position:static;
        justify-content:space-between;
        margin-bottom:clamp(22px,8vh,65px);
    }
    .auth-top .brand {
        display:flex;
    }
    .auth-form {
        margin:auto;
        padding:0;
    }
    .auth-form button {
        min-height:44px;
    }
    .app-header {
        gap:4px;
        padding-inline:10px;
    }
    .breadcrumb-root,.breadcrumb>.icon,#header-health,.theme-picker svg {
        display:none;
    }
    .header-actions,.breadcrumb {
        gap:3px;
    }
    .command-trigger {
        padding:0;
        width:39px;
    }
    .command-trigger > span {
        position:absolute;
        inline-size:1px;
        block-size:1px;
        clip-path:inset(50%);
        overflow:hidden;
    }
    .app-header .icon-button {
        width:35px;
    }
    #content {
        padding:14px 12px;
    }
    .page-heading {
        align-items:flex-start;
        margin-bottom:15px;
    }
    .page-heading p {
        font-size:12px;
    }
    .page-actions {
        justify-content:flex-end;
    }
    .page-actions .button {
        white-space:normal;
        padding:5px 9px;
        font-size:12px;
    }
    .grid-2 {
        grid-template-columns:minmax(0,1fr);
    }
    .source-grid,.shops {
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    .metric-grid {
        gap:7px;
    }
    .metric {
        padding:11px;
    }
    .metric-icon {
        width:25px;
        height:25px;
    }
    .metric-top {
        font-size:12px;
    }
    .metric .number {
        font-size:24px;
    }
    .source-card {
        padding:9px;
    }
    .source-title {
        flex-wrap:wrap;
    }
    .facts {
        grid-template-columns:1fr 1fr;
        font-size:12px;
    }
    .card,.search-banner {
        padding:13px;
    }
    .toast {
        bottom:72px;
    }
    td,th {
        padding:9px 11px;
    }
    .form-grid .fields {
        grid-template-columns:minmax(0,1fr);
    }
    #tables section {
        padding:9px;
    }
    .category-strip .button {
        min-height:40px;
    }
    .profile .popover {
        z-index:5;
    }
}

@media(prefers-reduced-motion:reduce) {
    *,*::before,*::after {
        animation-duration:.01ms!important;
        transition-duration:.01ms!important;
        scroll-behavior:auto!important;
    }
}

.table-card tbody .button {
    min-height:34px;
    font-size:12px;
}

/* Theme switches take effect in one paint so text and surface keep their contrast. */
.button,.text-button,.icon-button {
    transition:border-color 160ms,transform 160ms;
}

.search-banner {
    transition:border-color 160ms;
}

th .button.text-button {
    color:var(--text);
    font-size:inherit;
}

.button.destructive {
    background:var(--bad);
    color:var(--surface);
}

.sidebar nav a.section-active,.section-tabs a[aria-current=page] {
    background:var(--brand-bg);
    color:var(--brand-ink);
    font-weight:750;
}
.section-tabs {
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    border-bottom:1px solid var(--border);
    margin:4px 0 18px;
}
.section-tabs a {
    display:inline-flex;
    align-items:center;
    padding:6px 13px;
    min-height:42px;
    border-radius:8px 8px 0 0;
    color:var(--muted);
}
.attention-title { margin:20px 0 10px; }
.attention-grid {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
}
.attention-grid .card { min-width:0; }
.attention-grid .card > a { display:inline-block;margin-top:10px; }
.attention-list li,.dossier-list li {
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:6px;
    overflow-wrap:anywhere;
}
.status-disclosure { margin-top:12px; }
.status-disclosure summary,.form-disclosure summary,.source-options summary { cursor:pointer;font-weight:700; }
.status-disclosure[open] summary,.form-disclosure[open] summary { margin-bottom:10px; }
#detail-body > .card + .card { margin-top:10px; }
#detail-body .actions { margin-top:10px; }
#detail-body .facts { grid-template-columns:minmax(94px,1fr) minmax(0,1.35fr); }
#detail-body h2 { margin-bottom:8px; }
.segment {
    display:flex;
    flex-wrap:wrap;
    gap:6px;
}
.segment [aria-pressed=true] {
    color:var(--brand-ink);
    border-color:var(--brand-ink);
    background:var(--brand-bg);
}
.plan-preview:not(:empty) {
    padding:10px;
    border:1px solid var(--border);
    border-radius:var(--radius);
    background:var(--raised);
}
.plan-preview .facts { margin:0; }
.form-disclosure,.source-options {
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:10px 13px;
}
.source-options summary { min-height:27px; }
.source-options .pill { margin-inline-start:5px; }
.source-options[open] fieldset { margin-top:10px; }
.help-field { min-width:0; }
.field-help { margin-top:4px;color:var(--muted);font-size:12px; }
.field-help summary {
    display:inline-grid;
    place-items:center;
    border:1px solid var(--border);
    border-radius:50%;
    width:25px;
    height:25px;
    color:var(--brand-ink);
    font-weight:750;
    margin:0;
}
.field-help summary::-webkit-details-marker { display:none; }
.field-help p {
    margin-top:4px;
    padding:6px 8px;
    border-radius:6px;
    background:var(--raised);
}
.search-card textarea {
    min-height:76px;
    font-size:clamp(16px,2vw,19px);
}
.search-card { gap:10px; }
.search-quota {
    display:flex;
    flex-wrap:wrap;
    gap:6px 16px;
    color:var(--muted);
}
.search-quota strong { color:var(--text); }
.search-quota .quota-warning { color:var(--warn); }
@media(max-width:850px) {
    .attention-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:560px) {
    .attention-grid { grid-template-columns:minmax(0,1fr); }
    .section-tabs { margin-bottom:13px; }
    .help-field input { min-width:0; }
}

.sms-forms form { display:grid; gap:0.75rem; margin-block:0.75rem; }
.sms-forms .actions { flex-wrap:wrap; }
.sms-forms input { width:100%; }

.offline-notice:not([hidden]) {
    position: sticky;
    inset-block-start: 0;
    z-index: 100;
    pointer-events: none;
    padding: .75rem 1rem;
    border-radius: .5rem;
    background: #ffe4a3;
    color: #30230b;
}

.monitor-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 2rem;
    max-width: 28rem;
}
.monitor-bars > span {
    flex: 1;
    background: currentColor;
}
