:root {
  color-scheme: light dark;
  --bg: #f6f7fb;
  --surface: #fff;
  --ink: #19203a;
  --muted: #56617d;
  --line: #dfe3ed;
  --accent: #4c37c6;
  --accent-ink: #fff;
  --soft: #ece9ff;
  --good: #dff4e9;
  --good-ink: #13623b;
  --bad: #fce7ec;
  --bad-ink: #982043;
  --warn: #fff0d6;
  --warn-ink: #764900;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121624;
    --surface: #1c2235;
    --ink: #eef0ff;
    --muted: #aeb9d5;
    --line: #343e5a;
    --accent: #b7aaff;
    --accent-ink: #1c104f;
    --soft: #312650;
    --good: #163e32;
    --good-ink: #a7efc8;
    --bad: #501f32;
    --bad-ink: #ffbbcf;
    --warn: #462f17;
    --warn-ink: #ffe2a5;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
    --bg: #121624;
    --surface: #1c2235;
    --ink: #eef0ff;
    --muted: #aeb9d5;
    --line: #343e5a;
    --accent: #b7aaff;
    --accent-ink: #1c104f;
    --soft: #312650;
    --good: #163e32;
    --good-ink: #a7efc8;
    --bad: #501f32;
    --bad-ink: #ffbbcf;
    --warn: #462f17;
    --warn-ink: #ffe2a5;
  }

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--accent); text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.shell { width: min(100% - 2rem, 1120px); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.top { display: flex; align-items: center; min-height: 66px; gap: 14px; }
.brand { color: var(--ink); font-weight: 780; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand-mark { background: var(--accent); color: var(--accent-ink); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; }
.demo { background: var(--warn); color: var(--warn-ink); border-radius: 6px; padding: .25rem .45rem; font-size: .72rem; font-weight: 760; letter-spacing: .06em; }
.exit { margin-left: auto; }
.quiet { background: transparent; color: var(--muted); border: 0; min-height: 44px; padding: 0 7px; }
.nav, .tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.nav { margin-top: 18px; }
.nav a, .tabs a { text-decoration: none; color: var(--muted); min-height: 44px; padding: 11px 14px; font-weight: 610; border-radius: 8px; }
.nav a[aria-current], .tabs a[aria-current] { background: var(--soft); color: var(--accent); }
.content { padding: clamp(24px, 4vw, 45px) 0 64px; }
h1, h2, h3, p { margin: 0 0 .6em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); line-height: 1.14; letter-spacing: -.035em; overflow-wrap: anywhere; }
h2 { font-size: 1.23rem; }
h3 { font-size: 1.04rem; }
small, .muted, .eyebrow { color: var(--muted); }
small { display: block; font-size: .83rem; overflow-wrap: anywhere; }
.eyebrow { font-size: .85rem; font-weight: 650; }
.page-title { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 18px; }
.page-title h1, .page-title p:last-child { margin-bottom: 0; }
.button { display: inline-flex; min-height: 44px; align-items: center; padding: 8px 15px; border: 1px solid transparent; border-radius: 8px; font-weight: 680; text-decoration: none; }
.primary { background: var(--accent); color: var(--accent-ink); }
.secondary { border-color: var(--line); background: var(--surface); color: var(--ink); }
.back { display: inline-block; margin-bottom: 20px; }
.section { margin-top: 28px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.card, .summary { padding: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-width: 0; overflow-wrap: anywhere; }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; padding: 20px; }
.summary div { display: grid; gap: 5px; }
.summary span { color: var(--muted); font-size: .87rem; }
.summary strong, .task strong, .amount { font-size: 1.65rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.alert { color: var(--bad-ink); }
.task { text-decoration: none; color: var(--ink); display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.task strong { grid-row: 2; }
.arrow { grid-row: 2; color: var(--accent); align-self: end; }
.finance-link { display: block; width: fit-content; }
.order-list { display: grid; gap: 8px; margin-top: 14px; }
.order-row, .debt-row { display: grid; grid-template-columns: 1.15fr 1fr .8fr; gap: 12px; align-items: center; }
.debt-row + .debt-row, .audit-row + .audit-row { margin-top: 8px; }
.debt-row a { justify-self: start; }
.row-title { font-weight: 750; }
.row-status { display: grid; justify-items: start; gap: 5px; }
.status { font-size: .81rem; font-weight: 720; padding: 4px 8px; border-radius: 6px; background: var(--soft); color: var(--accent); }
.status.buy, .status.awaiting_return, .status.unmapped { background: var(--warn); color: var(--warn-ink); }
.status.sold, .status.shipped, .status.returned { background: var(--good); color: var(--good-ink); }
.status.cancelled { background: var(--bg); color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 15px 0; }
.filters label { display: grid; gap: 4px; flex: 1 1 175px; max-width: 350px; }
.filters select, .filters input { max-width: 100%; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px; }
dl { display: grid; grid-template-columns: 1fr auto; gap: .45rem 1rem; margin: 1rem 0 0; }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; }
input:not([type=checkbox]):not([type=hidden]), select, textarea {
  width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 8px;
  color: var(--ink); background: var(--surface);
}
input[type=checkbox] { width: 1.1rem; height: 1.1rem; vertical-align: middle; accent-color: var(--accent); }
form p { margin-bottom: 12px; }
form p label:not([for=id_accepted]) { display: block; margin-bottom: 4px; }
.form-card { max-width: 490px; }
.login { margin: 6vh auto 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.flash, .errorlist { padding: 10px 13px; border-radius: 7px; background: var(--good); color: var(--good-ink); }
.flash.error, .errorlist { background: var(--bad); color: var(--bad-ink); }
.errorlist { margin: 10px 0; padding-left: 29px; }
.helptext { display: block; color: var(--muted); font-size: .82rem; }
.list { padding-left: 1.2rem; }
.list li + li { margin-top: 8px; }
summary { cursor: pointer; font-weight: 650; }
.pager { display: flex; gap: 15px; align-items: center; margin: 14px 0; }
@media (max-width: 620px) {
  .shell { width: calc(100% - 1.5rem); }
  .summary, .order-row { grid-template-columns: 1fr 1fr; }
  .row-status { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
  .detail-grid, .debt-row { grid-template-columns: minmax(0, 1fr); }
  .nav a, .tabs a { padding-inline: 9px; }
}

.hero {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem; padding: clamp(1rem, 3vw, 2rem);
  background: var(--soft); border: 1px solid var(--line); border-radius: 16px;
}
.hero h1 { margin-bottom: 0; }
.theme { margin-left: auto; font-size: .85rem; }
.theme + .exit { margin-left: 0; }
.scanner-controls video { max-width: 100%; max-height: 18rem; border-radius: 10px; margin: .7rem 0; }
.scan-note { margin-top: .5rem; }
.print-grid { display: flex; flex-wrap: wrap; gap: 6mm; }
.print-label { width: 76mm; min-height: 49mm; padding: 4mm; text-align: center; border: 1px solid currentColor; }
.print-label svg { width: 28mm; height: 28mm; background: white; }
@media print {
  :root { color-scheme: light; }
  body { background: white; color: black; }
  .site-header, .nav, .screen-only { display: none !important; }
  .shell { width: 100%; padding: 0; margin: 0; }
  .print-label { break-inside: avoid; }
}
.live-card { margin-bottom: 1rem; }
.live-card li p { margin: .4rem 0; }
.chat-message { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.preserve-lines { white-space: pre-line; }

.dashboard-actions { margin-bottom: .75rem; }
.balance strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.balance h3 { margin: .25rem 0 .5rem; }
.action-groups { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.action-groups details { padding: .65rem .7rem; border-radius: 8px; background: var(--bg); }

/* Shared application shell */
.app-shell { width: min(100% - 32px, 1450px); margin-inline: auto; display: grid; grid-template-columns: 180px minmax(0,1fr); gap: clamp(20px, 3vw, 44px); }
.app-shell .content { width: 100%; min-width: 0; }
.site-header .top { width: min(100% - 32px, 1450px); }
.header-link { margin-left: auto; display: inline-flex; align-items: center; font-size: .86rem; text-decoration: none; }
.top .theme { margin-left: auto; }
.header-link + .theme { margin-left: 0; }
.main-nav { position: sticky; top: 16px; align-self: start; flex-direction: column; padding: 0; margin: 32px 0 0; gap: 4px; }
.main-nav a { display: flex; gap: 10px; align-items: center; padding: 8px 11px; }
.main-nav a span { width: 24px; text-align: center; font-size: 1.24rem; line-height: 1; }
.main-nav a:hover, .agent-tile:hover { background: var(--soft); }
.summary a, .summary details { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-decoration: none; min-width: 0; }
.summary a:hover { border-color: var(--accent); }
.summary details summary { cursor: pointer; list-style: none; }
.summary details summary::-webkit-details-marker { display: none; }
.summary details summary span::after { content: ' ⓘ'; }
.summary details small { margin-top: 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: .9rem; }
.owner-work .task strong { font-size: 1.65rem; }
.key-values { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); margin: 0; gap: 12px; }
.key-values dt, .key-values dd { margin: 0; overflow-wrap: anywhere; }
.key-values dd { text-align: right; font-weight: 650; }
.key-values dd span { display: block; }
.chart-scroll { max-height: 260px; overflow-y: auto; }
.chart-row { display: grid; grid-template-columns: 3.2rem minmax(3rem, 1fr) minmax(4rem, auto); gap: 8px; align-items: center; margin-block: 10px; }
.chart-row time { font-size: .83rem; color: var(--muted); }
.chart-row small { text-align: right; font-variant-numeric: tabular-nums; }
.chart-row meter { display: block; width: 100%; height: 11px; }
.chart-row meter::-webkit-meter-bar { background: var(--bg); border: 0; }
.chart-sales::-webkit-meter-optimum-value { background: var(--accent); }
.chart-profit::-webkit-meter-optimum-value { background: #26946a; }
.chart-profit.negative::-webkit-meter-optimum-value { background: #cc496e; }
.chart-legend { display: flex; gap: 13px; font-size: .83rem; color: var(--muted); }
.chart-legend span::before { content: '●'; margin-right: 4px; color: var(--accent); }
.chart-legend span + span::before { color: #26946a; }
.agent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.agent-tile { color: var(--ink); text-decoration: none; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
.agent-tile h3, .agent-tile p { margin-bottom: 5px; }
.agent-tile p { font-size: .86rem; }
.agent-tile .status { display: inline-block; max-width: 100%; white-space: normal; }
.director-tile { grid-column: 1/-1; border-color: var(--accent); }
.tile-icon { width: 38px; height: 38px; display: grid; place-items: center; background: var(--soft); color: var(--accent); border-radius: 9px; font-size: 1.3rem; }
.status.running { background: var(--good); color: var(--good-ink); }
.status.failed { background: var(--bad); color: var(--bad-ink); }
.status.queued { background: var(--warn); color: var(--warn-ink); }
.setting-row { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.setting-row .actions { align-items: center; }
.back { display: inline-block; margin: 0 0 12px; }
@media (max-width: 1040px) { .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .app-shell { display: block; }
  .app-shell .content { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .top .header-link { display: none; }
  .main-nav { position: fixed; inset: auto 0 0; margin: 0; flex-direction: row; gap: 0; z-index: 5;
    background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px max(5px, env(safe-area-inset-bottom)); }
  .main-nav a { flex: 1; min-width: 0; padding: 3px 1px; min-height: 49px; justify-content: center;
    flex-direction: column; gap: 2px; font-size: clamp(.66rem, 3vw, .79rem); }
  .main-nav .desktop-nav { display: none; }
  .chart-row { grid-template-columns: 2.6rem minmax(1.5rem,1fr) minmax(4rem,auto); }
}
@media (max-width: 410px) {
  .agent-tile { padding: 11px; gap: 6px; }
  .tile-icon { width: 28px; height: 28px; font-size: 1rem; }
  .agent-tile:not(.director-tile) { grid-template-columns: 1fr; }
}

.summary > a, .summary details > summary { display: grid; gap: 5px; }
.tabbar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; }
.tabbar a { padding: 9px 12px; white-space: nowrap; border: 1px solid var(--line); border-radius: 8px; }
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, .56fr); gap: 16px; align-items: start; }
.chat-question { width: fit-content; max-width: 100%; margin: 0 0 7px auto; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; font-size: .98rem; }
.chat-layout .chat-message { margin: 0 0 13px; padding: 0; border: 0; }
.chat-layout .chat-message p { margin-bottom: 0; }
.chat-form .quiet { text-align: left; }
@media (max-width: 680px) {
  .chat-layout { display: flex; flex-direction: column-reverse; }
  .chat-layout > section { width: 100%; min-width: 0; }
}
.filters [hidden] { display: none; }
.agent-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.agent-summary > div { padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
@media (max-width: 680px) {
  .agent-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; }
  [data-period-form] > label { flex-basis: 140px; }
}

.order-product { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.order-product img, .product-photo img { border-radius: 9px; border: 1px solid var(--line); object-fit: cover; flex: none; }
.product-photo { float: right; margin: 0 0 8px 12px; }
.product-photo figcaption { text-align: center; font-size: .75rem; color: var(--muted); }
@media (max-width: 680px) {
  .order-product img { width: 36px; height: 36px; }
  .product-photo img { width: 92px; height: 92px; }
}

/* Dense workspace layouts with a mobile navigation row outside the scroll area. */
.card, .summary, h1, small { overflow-wrap: break-word; }
dl { grid-template-columns: minmax(0, 1fr) minmax(0, 1.22fr); }
dl > * { min-width: 0; overflow-wrap: break-word; }
.key-values { grid-template-columns: minmax(0, 1fr) minmax(0, 1.24fr); gap: 6px 12px; }
.key-values dt, .key-values dd { overflow-wrap: break-word; }
.money-value, .imei-value { white-space: nowrap; font-variant-numeric: tabular-nums; }
.product-photo { float: none; display: inline-flex; flex-direction: column; margin: 0 0 8px; }
.compact-heading { margin-bottom: 8px; }
.compact-heading p { margin-top: 4px; }
.filter-panel { border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface); margin: 8px 0; }
.filter-panel summary { min-height: 44px; line-height: 1.3; padding-block: 12px; }
.filter-panel summary span { margin-inline-start: 7px; color: var(--muted); font-weight: 500; }
.filter-panel form { margin: 0 0 10px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.metric { display: grid; align-content: start; gap: 3px; padding: 10px 12px; color: var(--ink); text-decoration: none; }
.metric:hover, .metric:focus-within { border-color: var(--accent); }
.metric > span, .metric-label { color: var(--muted); font-weight: 670; }
.metric strong { font-size: 1.26rem; }
.metric-alert { display: flex; justify-content: space-between; align-items: center; line-height: 1.2; gap: 6px; min-height: 30px; }
.compact-disclosure { margin-block: 8px; }
.compact-disclosure > summary { min-height: 36px; padding-block: 7px; }
.compact-disclosure dl { margin: 0 0 6px; }
.owner-work { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.owner-work .task { align-items: center; padding: 8px 10px; min-height: 48px; }
.owner-work .task strong { grid-row: 1; grid-column: 2; font-size: 1.2rem; }
.owner-work .arrow { display: none; }
.compact-table { width: 100%; table-layout: auto; border-collapse: separate; border-spacing: 0; margin-block: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.compact-table th, .compact-table td { text-align: left; vertical-align: top; padding: 10px; }
.compact-table th { color: var(--muted); font-size: .86rem; }
.compact-table tr + tr td, .compact-table thead + tbody tr:first-child td { border-top: 1px solid var(--line); }
.compact-table td small { margin-top: 2px; }
.audit-heading, .audit-line > summary { display: grid; grid-template-columns: 10em 1fr 1.1fr 2fr; gap: 10px; align-items: start; }
.audit-heading { color: var(--muted); padding: 0 10px; font-size: .85rem; }
.audit-line > summary { list-style: none; }
.audit-line > summary::-webkit-details-marker { display: none; }
.audit-line .audit-action::after { content: ' ⌄'; color: var(--accent); }
.audit-line[open] .audit-action::after { content: ' ⌃'; }
.audit-line[open] > summary { margin-bottom: 8px; }
.audit-line { padding: 10px; }
@media (max-width: 720px) {
  body:has(.main-nav) { display: grid; grid-template-rows: auto minmax(0, 1fr); height: var(--device-viewport, 100dvh); overflow: hidden; }
  .top { min-height: 48px; gap: 8px; }
  .brand { gap: 6px; }
  .brand-mark { height: 27px; width: 27px; }
  .app-shell { width: 100%; min-height: 0; display: grid; grid-template: minmax(0,1fr) auto / minmax(0,1fr); }
  .app-shell .content { grid-row: 1; width: 100%; margin: 0; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain;
    padding: 10px 12px 18px; scroll-padding-block: 10px; }
  .main-nav { grid-row: 2; position: static; min-height: 0; }
  :root[data-keyboard] .main-nav { display: none; }
  .page-title, .hero { gap: 8px; margin-bottom: 8px; }
  .hero { padding: 10px 12px; }
  .section { margin-top: 14px; }
  .card { padding: 10px 12px; }
  .detail-grid { gap: 9px; }
  h1 { font-size: 1.55rem; }
  .back { margin-bottom: 6px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .metric { padding: 8px; }
  .metric > strong { font-size: 1.08rem; }
  .metric-alert { min-height: 44px; }
  .owner-work .task { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .compact-table { display: block; border: 0; background: transparent; }
  .compact-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .compact-table tbody { display: grid; gap: 7px; }
  .compact-table tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 5px 10px;
    padding: 9px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
  .compact-table tr td { display: block; min-width: 0; padding: 0; border: 0 !important; overflow-wrap: break-word; }
  .compact-table td:first-child, .compact-table td[data-wide] { grid-column: 1/-1; }
  .compact-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: .8rem; }
  .audit-heading { display: none; }
  .audit-line > summary { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 2px 8px; min-height: 44px; }
  .audit-line .audit-action { grid-column: 1/-1; grid-row: 1; }
  .audit-line .audit-scope { grid-column: 1/-1; }
}
@media (max-width: 510px) {
  .owner-work { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  body:has(.main-nav), .app-shell { display: block; height: auto; overflow: visible; }
  .app-shell .content { overflow: visible; }
}
.cell-details summary { font-size: .86rem; min-height: 36px; padding-block: 6px; }
.compact-table td > .status { display: inline-block; }
@media (max-width: 720px) {
  .compact-table tr td.hide-empty { display: none; }
}
.finance-quick { gap: 6px; margin-bottom: 6px; }
.finance-quick .button { padding-inline: 10px; }
.tabbar a[aria-current] { background: var(--soft); color: var(--accent); border-color: var(--accent); }
.agent-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; align-items: center; }
.agent-counts > * { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
  padding: 7px 10px; display: inline-flex; align-items: center; gap: 5px; }
.agent-counts a { min-height: 44px; }
.agent-filter { display: inline-flex; align-items: center; gap: 8px; }
.agent-filter select { width: auto; }
.agent-tile[hidden] { display: none; }
.agent-tile p[data-agent-result] { margin-top: 5px; color: var(--ink); }
.agent-tile [data-agent-warning]:empty { display: none; }
@media (max-width: 720px) { .agent-tile:not(.director-tile) { grid-template-columns: 1fr; } }

.chat-layout { display: grid; grid-template: minmax(0,1fr) auto / minmax(0,1fr); gap: 7px; align-items: stretch; min-height: 0; }
.chat-thread { overflow: auto; min-height: 0; max-height: 56vh; padding: 3px; }
.chat-scope, .chat-input { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 7px; }
.chat-input { grid-template-columns: minmax(0,1fr) auto; align-items: end; }
.chat-input textarea { display: block; resize: vertical; }
.chat-scope label, .chat-question-field { color: var(--muted); font-size: .86rem; min-width: 0; }
.chat-examples { margin-bottom: 3px; }
.chat-examples summary { min-height: 35px; padding: 4px; }
.chat-examples button { border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 720px) {
  .app-shell .content:has(.chat-layout) { display: flex; flex-direction: column; }
  .chat-layout { flex: 1; }
  .chat-thread { max-height: unset; }
  .chat-form { padding: 7px; }
  .chat-input textarea, .chat-scope select { font-size: 16px; }
}
.batch-edit-row { display: grid; grid-template-columns: 1.2fr .8fr 1fr auto; gap: 8px; align-items: end; margin-bottom: 8px; }
.batch-edit-row label { min-width: 0; }
@media (max-width: 720px) {
  .batch-edit-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .batch-edit-row label:first-child { grid-column: 1/-1; }
}
@media (max-width: 720px) {
  .compact-disclosure > summary, .chat-examples summary { min-height: 44px; }
}
