/* One shared visual style: indigo. */
:root {
  --c-primary: #455fc0; --c-primary-d: #354b9d; --c-bg: #f3f5fa; --c-text: #28344b;
  --c-sub: #68758c; --c-border: #dfe4ee; --c-soft: #edf0fb; --c-surface: #f7f8fc;
  --c-side: #202d4b; --c-side-text: #e5eaf7; --c-side-sub: #abb9d7; --c-side-active: #35476e; --c-accent: #b9c8ff;
  --c-card: #fff; --c-ok: #28734f; --c-warn: #95621b; --c-err: #ba4444;
  --radius: .85rem; --side-w: 15rem;
  --shadow-card: 0 2px 5px #243b3403, 0 8px 24px #243b3403;
}
html { scroll-padding-top: 5rem; }
body { -webkit-font-smoothing: antialiased; line-height: 1.6; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 3px; }
.icon { width: 1.3em; height: 1.3em; flex-shrink: 0; vertical-align: middle; }
.side { background: var(--c-side); color: var(--c-side-text); padding: 1.75rem .875rem 0; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: .65rem; padding: 0 .35rem; color: var(--c-side-text); font-size: 1.08rem; letter-spacing: .02em; }
.brand-symbol { display: grid; place-items: center; padding: .5rem; border: 1px solid var(--c-side-sub); border-radius: .65rem; color: var(--c-accent); }
.brand small { display: block; margin-top: .25rem; color: var(--c-side-sub); font-size: .6rem; font-weight: 400; letter-spacing: .04em; }
.side .company { margin: 1.7rem .35rem 1.4rem; padding: .65rem .65rem; border: 1px solid var(--c-side-sub); border-radius: .5rem; color: var(--c-side-text); font-size: .8rem; overflow-wrap: anywhere; }
.company span { display: block; font-size: .65rem; color: var(--c-side-sub); }
.nav-label { padding: 0 .75rem .7rem; color: var(--c-side-sub); font-size: .65rem; letter-spacing: .12em; }
.side nav { display: grid; gap: .4rem; }
.side nav a { padding: .75rem .85rem; gap: .75rem; color: var(--c-side-text); border-radius: .6rem; font-size: .9rem; }
.side nav a:hover, .side nav a.on { background: var(--c-side-active); color: var(--c-side-text); }
.side nav a.on { box-shadow: inset 3px 0 var(--c-accent); font-weight: 600; }
.side nav a:last-child { margin-top: 1.5rem; }
.side .foot { padding: .8rem .2rem; color: var(--c-side-sub); position: relative; border-top: 1px solid #ffffff12; }
.account-toggle { border: 0; padding: .65rem .4rem; border-radius: .6rem; width: 100%; background: transparent; display: flex; align-items: center; gap: .65rem; cursor: pointer; text-align: left; color: var(--c-side-text); font-size: .8rem; overflow-wrap: anywhere; }
.account-toggle:hover, .account-toggle.on { background: var(--c-side-active); }
.account-name { flex: 1; min-width: 0; }
.account-chevron { width: 1rem; transform: rotate(-90deg); transition: transform .18s ease; }
.account-toggle.on .account-chevron { transform: rotate(90deg); }
.account-toggle small { display: block; color: var(--c-side-sub); font-size: .65rem; }
.avatar { display: grid; place-items: center; width: 2rem; height: 2rem; flex-shrink: 0; border-radius: 50%; background: var(--c-side-active); }
.side .user-menu { margin: .3rem 0 .6rem; padding: .4rem; background: #293959; border: 1px solid #ffffff12; border-radius: .7rem; box-shadow: 0 8px 24px #101a2f26; }
.user-menu-heading { padding: .5rem .55rem; font-size: .65rem; color: var(--c-side-sub); }
.side .user-menu a, .side .user-menu button { display: flex; align-items: center; gap: .6rem; width: 100%; border: 0; border-radius: .4rem; background: transparent; padding: .65rem .55rem; text-align: left; color: var(--c-side-text); font: inherit; font-size: .78rem; cursor: pointer; }
.side .user-menu a:hover, .side .user-menu button:hover { background: var(--c-side-active); }
.side .user-menu a > span { flex: 1; }
.side .user-menu small { display: block; color: var(--c-side-sub); font-size: .6rem; margin-top: .15rem; }
.side .user-menu a > .icon:last-child { width: .8rem; color: var(--c-side-sub); }
.side .user-menu .logout-action { color: #efb5b5; }
.side :focus-visible { outline-color: var(--c-accent); }
.sidebar-toggle { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .6rem .85rem; margin-top: .4rem; border: 0; border-radius: .5rem; background: transparent; color: var(--c-side-sub); cursor: pointer; font-size: .75rem; }
.sidebar-toggle:hover { background: var(--c-side-active); color: var(--c-side-text); }
.side-collapsed { --side-w: 4.5rem; }
.side-collapsed .side { padding: 1.1rem .5rem 0; }
.side-collapsed .brand { justify-content: center; padding: 0; }
.side-collapsed .brand-text, .side-collapsed .company, .side-collapsed .nav-label, .side-collapsed .nav-text { display: none; }
.side-collapsed .sidebar-toggle { justify-content: center; padding: .6rem 0; margin-bottom: 0; }
.side-collapsed .side nav { margin-top: 1.75rem; }
.side-collapsed .account-name, .side-collapsed .account-chevron { display: none; }
.side-collapsed .account-toggle { justify-content: center; padding-inline: 0; }
.side-collapsed .user-menu { position: fixed; left: calc(var(--side-w) + .5rem); bottom: 1rem; width: 15rem; }
.side, .main { transition: width .2s ease, margin-left .2s ease; }
.side-collapsed .side nav a { justify-content: center; padding: .85rem 0; position: relative; }
.side-collapsed .side .badge { position: absolute; top: .1rem; right: 0; font-size: .55rem; min-width: 1rem; padding: 0 .2rem; }
.collapsed-account { display: grid; place-items: center; color: var(--c-side-text); padding: .75rem 0; border-radius: .5rem; background: var(--c-side-active); }
.main { padding: 1rem 2rem 2.5rem; container-type: inline-size; }
h1.page { font-size: 1.5rem; font-weight: 650; letter-spacing: -.025em; margin-bottom: 1.25rem; }
h2 { font-size: 1.05rem; font-weight: 600; margin: 0; }
h3 { font-weight: 600; }
.card, .stat { box-shadow: var(--shadow-card); padding: 1.15rem; }
.card { margin-bottom: 1.1rem; }
.grid { gap: 1rem; }
.grid > *, .row > *, .bench > *, .settings-page, .section-heading > * { min-width: 0; }
.stat .k { font-size: .8rem; }
.stat .v { margin: .5rem 0 .25rem; font-size: 1.85rem; letter-spacing: -.04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat .s { font-size: .75rem; }
.btn { min-height: 2.6rem; border-radius: .55rem; padding: .5rem .95rem; font-size: .9rem; line-height: 1.5; max-width: 100%; white-space: normal; }
.btn.sm { min-height: 2.1rem; padding: .3rem .65rem; font-size: .8rem; border-radius: .45rem; }
.btn.lg { min-height: 2.9rem; font-size: 1rem; padding: .65rem 1.15rem; }
.btn.primary { box-shadow: 0 2px 3px #00000008; }
.input, select.input, textarea.input { border-radius: .5rem; padding: .55rem .7rem; line-height: 1.5; max-width: 100%; min-height: 2.5em; }
.input { width: 100%; min-width: 0; }
.combo, .suggest-input, label.f { width: 100%; min-width: 0; }
.fluid-input-row { flex-wrap: nowrap; }
.fluid-input-row > .input { flex: 1 1 0; width: 0; }
.fluid-input-row > .btn { flex: 0 0 auto; }
.row > .fluid-select { flex: 1 1 0; width: auto; min-width: min(100%, 8rem); }
.allocation-cell, .role-cell { width: 20%; min-width: 6rem; }
.allocation-cell .input, .role-cell .input { width: 100%; padding: .3rem .45rem; }
.date-range { display: flex; align-items: center; flex: 1 1 0; gap: .6rem; flex-wrap: wrap; min-width: 0; width: 100%; }
.date-inputs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: .4rem; align-items: center; flex: 1 1 20rem; min-width: 0; }
.date-inputs .input { width: 100%; min-width: 0; padding-inline: .4rem; }
.date-range > .chips { flex: 1 1 24rem; }
.input:focus { box-shadow: 0 0 0 3px var(--c-soft); }
.input[readonly] { background: var(--c-surface); }
label.f > span { white-space: normal; overflow-wrap: anywhere; }
.filters { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: .8rem; }
.chip { font-size: .8rem; padding: .3rem .7rem; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.chip.on { background: var(--c-soft); }
.tag { font-size: .75rem; line-height: 1.6; padding: .12rem .45rem; border-radius: .3rem; max-width: 100%; overflow-wrap: anywhere; }
.tag.blue, .filter-token, .step.active { background: var(--c-soft); color: var(--c-primary); }
.badge, .kbd { line-height: 1.5; }
.badge { min-width: 1.15rem; font-size: .7rem; }
.tbl-wrap { max-width: 100%; min-width: 0; overscroll-behavior-x: contain; }
.tbl th { background: var(--c-surface); font-size: .8rem; padding: .8rem .85rem; }
.tbl td { padding: .75rem .85rem; font-size: .85rem; }
.tbl tfoot td { background: var(--c-soft); }
.tbl tr.click:hover td { background: var(--c-surface); }
.totals, .artifact .ah { background: var(--c-surface); }
.totals { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: .5rem .8rem; overflow-wrap: anywhere; }
.smart-search { border-color: var(--c-border); background: var(--c-card); padding: .7rem; }
.smart-search:focus-within { box-shadow: 0 0 0 3px var(--c-soft); }
.filter-token { font-size: .8rem; }
.suggest-menu button.hi, .suggest-menu button:hover, .suggest-menu button:focus-visible, .combo .opt.hi { background: var(--c-soft); }
.suggest-menu .suggest-submit { color: var(--c-primary); }
.detail-field:not(:disabled):hover, .detail-field.on, .detail-item.on { background: var(--c-soft); border-color: var(--c-primary); }
.drop { border: 1px dashed var(--c-sub); background: var(--c-surface); }
.drop.over { background: var(--c-soft); }
.queue .qi { width: 6.5rem; }
.receipt-viewer .receipt-tools { gap: .3rem; padding: .4rem .55rem; align-items: center; border-bottom: 1px solid #ffffff12; }
.viewer-tool { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-width: 2.2rem; min-height: 2.2rem; padding: .4rem .55rem; border: 1px solid transparent; border-radius: .4rem; background: transparent; color: #dce3f2; font-size: .8rem; cursor: pointer; }
.viewer-tool:hover { background: #ffffff10; border-color: #ffffff18; color: #fff; }
.viewer-tool[aria-pressed="true"] { background: #ffffff18; color: #fff; }
.viewer-tool:focus-visible { outline-color: #b9c8ff; }
.viewer-tool:disabled { opacity: .35; cursor: not-allowed; }
.viewer-tool .icon { width: 1.15rem; height: 1.15rem; }
.viewer-scale { color: #aab5cb; font-size: .7rem; min-width: 3.2em; font-variant-numeric: tabular-nums; text-align: center; }
.viewer-empty { margin: auto; padding: 1.25rem; color: #aab5cb; font-size: .85rem; text-align: center; }
.receipt-stage { overflow-anchor: none; overscroll-behavior: contain; }
.bench { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bench > div { min-width: 0; }
.review-form { container-type: inline-size; }
.itemrow { position: relative; padding-left: .75rem; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, .7fr) minmax(0, 1fr) minmax(0, 1fr) auto auto; }
.itemrow > .dot { position: absolute; left: 0; top: .8rem; }
.itemrow > .input { width: 100%; min-width: 0; }
.overview-charts { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.more-menu { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); }
.table-workspace.with-agent { grid-template-columns: minmax(0, 1fr) minmax(20rem, 38%); }
.agent-panel { background: var(--c-surface); padding: 1rem; border-radius: var(--radius); }
.chat { height: calc(100dvh - 9rem); min-height: 20rem; }
.chat .composer { align-items: flex-end; }
.chat .composer .btn { flex-shrink: 0; }
.artifact .ah, .pager { flex-wrap: wrap; }
.artifact pre { overflow-wrap: anywhere; }
.msg .bubble { max-width: 100%; }
.drawer .tabs { flex-wrap: wrap; }
.drawer .db { min-width: 0; container-type: size; }
.drawer .receipt-viewer { display: flex; flex-direction: column; height: 100cqh; }
.drawer .receipt-tools, .drawer .receipt-thumbs { flex-shrink: 0; }
.drawer .receipt-canvas { flex: 1; min-height: 0; }
.drawer .receipt-stage { height: 100%; min-height: 0; }
.drawer.ticket-page { width: 100%; box-shadow: none; }
.drawer .db > .grid { container-type: inline-size; }
.confirm-sum { grid-template-columns: minmax(0, auto) minmax(0, 1fr); overflow-wrap: anywhere; }
.modal { max-height: 90dvh; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 1.25rem; }
.message-dialog { color: var(--c-text); width: min(28rem, calc(100vw - 2rem)); margin: auto; box-shadow: 0 1rem 4rem #202d4b30; }
.message-dialog::backdrop { background: rgba(20, 29, 48, .42); }
.message-dialog h3 { margin: 0 0 .75rem; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 1.25rem; line-height: 1.7; }
.message-actions { justify-content: flex-end; margin-top: 1.5rem; }
.login .card { width: 25rem; padding: 2rem; }
.login { background: var(--c-bg); }
.font-size-control { white-space: normal; gap: .7rem; color: var(--c-text); }
.font-size-control select { flex: 1 1 0; width: 100%; min-width: 0; }
.font-size-control { flex: 0 1 12rem; width: 100%; }
.settings-page { max-width: 76rem; margin: 0 auto; }
.settings-heading { display: flex; justify-content: space-between; gap: 1.25rem; align-items: center; flex-wrap: wrap; margin: .5rem 0 2rem; }
.eyebrow { display: block; font-size: .68rem; letter-spacing: .1em; color: var(--c-sub); margin-bottom: .6rem; }
.settings-heading h1 { margin: 0; font-size: 1.9rem; }
.settings-heading p { margin: .6rem 0 0; font-size: .9rem; }
.settings-scope { display: flex; align-items: center; gap: .45rem; color: var(--c-sub); font-size: .75rem; }
.settings-section { margin-bottom: 1.7rem; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.section-heading p { margin: .35rem 0 0; }
.typography-card { padding: 1.35rem; }
.type-preview { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.25rem; background: var(--c-surface); border: 1px solid var(--c-border); padding: 1.35rem; border-radius: .6rem; }
.type-preview > * { min-width: 0; }
.type-preview h3 { font-size: 1.2rem; margin: 0; }
.type-preview p { font-size: .85rem; margin: .5rem 0 1rem; }
.preview-amount { display: flex; flex-direction: column; gap: .35rem; }
.preview-amount strong { font-size: 1.85rem; line-height: 1.2; letter-spacing: -.04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.settings-note { margin: .85rem 0 0; }
.settings-account { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.settings-account p { margin: .35rem 0 0; }
.settings-list > h2 { padding: .15rem .5rem .9rem; }
.settings-row { display: flex; align-items: center; gap: .9rem; padding: 1rem .5rem; border-top: 1px solid var(--c-border); color: var(--c-text); border-radius: .4rem; }
.settings-row:hover { background: var(--c-surface); }
.setting-icon { display: grid; place-items: center; flex: 0 0 2.6rem; height: 2.6rem; border-radius: .7rem; color: var(--c-primary); background: var(--c-soft); }
.settings-row > span:nth-child(2) { flex: 1; min-width: 0; }
.settings-row b { font-size: .9rem; font-weight: 550; }
.settings-row small, .member-identity small { display: block; margin-top: .2rem; font-size: .75rem; color: var(--c-sub); }
.settings-row > .icon { width: 1rem; color: var(--c-sub); }
.preference-note, .account-profile { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.preference-note > div, .account-profile > div { flex: 1; min-width: min(100%, 10rem); }
.preference-note p, .account-profile p { margin: .35rem 0 0; }
.account-signout, .member-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.member-card.card { padding: 0; overflow: hidden; }
.member-heading { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--c-border); }
.member-identity { display: flex; align-items: center; gap: .65rem; }
.member-identity .avatar { background: var(--c-soft); color: var(--c-primary); }
.member-actions { flex-wrap: nowrap; }
.export-menu.dm { width: 21rem; min-width: 0; max-width: calc(100vw - 2rem); padding: .4rem; }
.export-menu button { display: block; width: 100%; padding: .8rem; border: 0; border-radius: .5rem; background: transparent; color: var(--c-text); text-align: left; cursor: pointer; }
.export-menu button:hover { background: var(--c-soft); }
.export-menu b { display: block; font-size: .85rem; font-weight: 600; }
.export-menu small { display: block; margin-top: .25rem; font-size: .7rem; color: var(--c-sub); }

/* Search tokens and free text share one input surface. */
.table-layout .main { padding: .85rem 1.25rem 1.5rem; }
.table-heading.page { font-size: 1.2rem; margin: 0 0 .6rem; gap: .5rem; }
.table-controls.card { padding: .55rem .7rem; margin-bottom: .6rem; }
.table-controls .smart-search { padding: 0; border: 0; border-radius: 0; display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: .5rem; }
.table-controls .smart-search:focus-within { box-shadow: none; }
.table-controls .search-tokens { flex: 0 1 52rem; width: 0; border: 1px solid var(--c-border); border-radius: .65rem; padding: .55rem .65rem; gap: .35rem; min-height: 3.5rem; }
.table-controls .search-tokens:focus-within { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-soft); }
.table-controls .search-tokens > .suggest-input { flex: 1 1 24rem; width: auto; }
.table-controls .search-tokens > .suggest-input > input { border: 0; padding: .35rem .3rem; box-shadow: none; min-height: 2.4rem; }
.table-controls .search-actions { flex: 0 0 auto; width: auto; gap: .35rem; }
.table-controls .search-actions .btn { min-height: 2.2rem; padding: .35rem .65rem; font-size: .8rem; }
.search-examples { display: flex; align-items: center; flex-wrap: wrap; gap: .15rem 1rem; margin-top: .4rem; color: var(--c-sub); font-size: .75rem; }
.search-examples .filter-link { font-size: inherit; text-align: left; }
.search-examples .filter-link:disabled { opacity: .5; cursor: wait; }
.time-filter .filter-label { margin-bottom: .3rem; color: var(--c-sub); font-size: .75rem; }
.table-filters { padding-top: .65rem; margin-top: .5rem; border-top: 1px solid var(--c-border); }
.table-filters .filters { margin-top: .6rem; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .55rem; }
.table-filters .basic-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
.table-filters label.f { font-size: .75rem; gap: .2rem; }
.table-filters .input { padding: .4rem .5rem; }
.filter-actions { justify-content: flex-start; gap: 1.25rem; margin-top: .55rem; }
.filter-link { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; border: 0; background: transparent; color: var(--c-primary); cursor: pointer; padding: .35rem 0; font: inherit; font-size: .8rem; }
.filter-link:hover { color: #2844b6; }
.filter-link:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 3px; border-radius: .25rem; }
.filter-chevron { width: 1rem; height: 1rem; transform: rotate(90deg); }
.filter-chevron.open { transform: rotate(-90deg); }
.filter-reset { color: var(--c-sub); }
.filter-fold { display: flex; justify-content: center; margin-top: .25rem; }
.filter-fold .filter-link { min-width: 4rem; min-height: 1.75rem; padding: .15rem 1rem; }
.table-summary { gap: .4rem .75rem; margin-bottom: .6rem; }
.table-summary .seg { flex: 0 0 auto; }
.table-summary .seg a { padding: .35rem .65rem; font-size: .8rem; }
.table-summary > .small { font-size: .75rem; }
.table-main { container-type: inline-size; }
.table-main .tbl td { padding-block: .55rem; }
.group-toggle { display: flex; align-items: center; gap: .5rem; border: 0; padding: .1rem 0; background: transparent; cursor: pointer; color: inherit; text-align: left; }
.group-toggle .icon { flex: 0 0 auto; transition: transform .15s; }
.group-toggle .open { transform: rotate(90deg); }
.group-toggle:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 4px; border-radius: 3px; }
.group-summary.is-open > td { background: var(--c-soft); }
.table-main .group-details > td { padding: 0; white-space: normal; }
.group-detail-panel { width: 0; min-width: 100%; padding: .75rem 1rem 1rem; background: var(--c-bg); border-left: 3px solid var(--c-primary); }
.group-detail-title { display: flex; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; margin-bottom: .65rem; }
.group-detail-panel .card { margin-bottom: 0; }
.group-detail-panel .pager { margin-bottom: 0; }

/* Container widths respond to both the viewport and the account's chosen font size. */
@container (max-width: 60rem) {
  .table-workspace.with-agent { grid-template-columns: minmax(0, 1fr); }
  .agent-panel { position: static; height: 65dvh; border: 1px solid var(--c-border); }
}
@container (max-width: 48rem) {
  .bench, .overview-charts, .drawer-ticket-grid { grid-template-columns: minmax(0, 1fr); }
  .receipt-viewer { position: static; }
  .receipt-viewer .receipt-stage { height: 52dvh; min-height: 16rem; }
  .drawer .receipt-viewer { height: min(52dvh, 100cqh); min-height: 16rem; }
  .drawer .receipt-stage { height: 100%; min-height: 0; }
}
@container (max-width: 38rem) {
  .table-filters .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .itemrow { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .itemrow .item-name, .itemrow .item-part { grid-column: 1 / -1; }
  .itemrow .item-qty { grid-column: span 2; }
  .itemrow .item-amount { grid-column: span 4; }
  .itemrow .item-kind { grid-column: span 3; }
  .itemrow > .score { grid-column: span 2; justify-self: start; }
  .itemrow > .btn { justify-self: end; }
  .smart-search { flex-wrap: wrap; }
  .search-actions { margin-left: auto; }
}
@container (max-width: 26rem) {
  .table-filters .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-controls .smart-search { flex-wrap: wrap; }
  .table-controls .search-tokens { flex-basis: 100%; }
  .table-controls .search-actions { justify-content: flex-end; width: 100%; }
  .settings-heading { margin-bottom: 1.5rem; }
}
@media (max-width: 900px) {
  .group-detail-panel { width: calc(100cqw - 2px); min-width: 0; max-width: 100%; padding: .65rem; }
  .main { padding: calc(4.5rem + env(safe-area-inset-top)) .85rem calc(6.5rem + env(safe-area-inset-bottom)); }
  .table-layout .main { padding: calc(4rem + env(safe-area-inset-top)) .65rem calc(6rem + env(safe-area-inset-bottom)); }
  .topbar { height: calc(3.5rem + env(safe-area-inset-top)); padding: env(safe-area-inset-top) .85rem 0; background: var(--c-side); color: var(--c-side-text); }
  .topbar > .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
  .tabbar a { min-width: 0; font-size: .7rem; padding: .55rem .15rem .4rem; }
  .tabbar a .ti { display: grid; place-items: center; font-size: 1.1rem; line-height: 1.5; height: 1.7rem; }
  .tabbar a.cam .ti { width: 2.65rem; height: 2.65rem; margin: -1.25rem auto .3rem; box-shadow: 0 3px 10px #00000018; line-height: 1; }
  .tabbar .icon { width: 1.25rem; height: 1.25rem; }
  .chat { height: calc(100dvh - 10rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .drawer .db { padding: .75rem .65rem calc(1.5rem + env(safe-area-inset-bottom)); }
  .drawer .dh { padding-top: calc(.75rem + env(safe-area-inset-top)); }
  .drawer .tabs a { padding: .65rem .8rem; font-size: .85rem; }
  .drawer-ticket-grid { grid-template-columns: minmax(0, 1fr); }
  .stat .v { font-size: 1.65rem; }
  .card, .stat { padding: 1rem; }
  .settings-heading h1 { font-size: 1.65rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; }
}
