/* Ops: the agency administration app. The tokens, the base, the controls and the
   account pages are the staff library's (staff.css), loaded first. */
/* Under the staff bar (44 px), which stays on top. */
.shell { display: flex; min-height: calc(100vh - 44px); }

/* Sidebar */
.sidebar {
    width: 248px;
    flex-shrink: 0;
    background: var(--sidebar);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.brand { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px 16px; }
.brand-name { color: #FFF; font-family: 'Bai Jamjuree', sans-serif; font-weight: 700; font-size: 15px; letter-spacing: .08em; }
.brand-sub { color: #8B9188; font-size: 11px; }

.tenant-switch { margin: 0 8px 12px; }
.tenant-switch select {
    width: 100%;
    padding: 10px 12px;
    background: var(--ink-soft);
    color: #FFF;
    border: none;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    color: #C6CDC1;
    font-size: 14px; font-weight: 500;
}
.nav-link:hover { background: #2C312A; color: #FFF; }
.nav-link.active { background: var(--ink-soft); color: #FFF; }
.nav-sep { height: 1px; background: var(--ink-soft); margin: 10px 8px; }

/* Main */
.main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: 64px; padding: 0 32px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
}
.topbar h1 { font-size: 18px; font-weight: 600; }
.content { padding: 28px 32px; display: flex; flex-direction: column; gap: 24px; }

/* Layout editor */
.module-row[data-off="true"] { opacity: .55; }
.module-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.module-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.module-actions select { padding: 6px 10px; border: 1px solid var(--line); font: inherit; font-size: 13px; }

/* Plan 14 phase 3: the list beside a live preview of the page. */
.layout-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; }
.layout-editor-list { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.module-row { scroll-margin-top: 16px; }
.module-row[data-selected="true"] { box-shadow: 0 0 0 2px var(--andaman); }
.module-row[data-drop="true"] { box-shadow: 0 -3px 0 0 var(--amber); }
.drag-handle { cursor: grab; color: var(--muted); padding-right: 6px; user-select: none; font-size: 18px; line-height: 1; }
.drag-handle:active { cursor: grabbing; }
.preview-pane { position: sticky; top: 60px; display: flex; flex-direction: column; gap: 10px; }
.preview-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preview-frame { border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.preview-frame iframe { border: 0; display: block; }
.preview-frame[data-width="phone"] { width: 390px; height: 760px; }
.preview-frame[data-width="phone"] iframe { width: 390px; height: 760px; }
/* A desktop page at half size: drawn 1280 wide, shown 640. */
.preview-frame[data-width="desktop"] { width: 640px; height: 760px; }
.preview-frame[data-width="desktop"] iframe { width: 1280px; height: 1520px; transform: scale(.5); transform-origin: 0 0; }
/* Plan 14 phase 4: the looks to switch to, and the two arrangements side by side. */
.look-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.look-card { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; border: 1px solid var(--line); padding: 18px 20px; }
.look-card[data-selected="true"] { box-shadow: 0 0 0 2px var(--andaman); }
.look-summary { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 13px; }
.look-summary dt { color: var(--muted); }
.look-summary dd { margin: 0; }
.switch-preview { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
@media (max-width: 1400px) {
    .layout-editor { grid-template-columns: minmax(0, 1fr); }
    .preview-pane { position: static; }
}

.tenant-fixed {
    display: block; padding: 10px 12px;
    background: var(--ink-soft); color: #FFF;
    font-size: 13px; font-weight: 600;
}

/* Brand editor */
.colour-row { display: flex; align-items: center; gap: 10px; }
.colour-row input[type=color] {
    width: 44px; height: 38px; padding: 2px;
    border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.colour-hex { width: 110px; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.colour-pair { display: flex; align-items: center; gap: 10px; }
.colour-dot {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 26px; font-size: 13px; font-weight: 600;
    border: 1px solid var(--line);
}

/* A small standing-in for the public site. Colours come from the resolved palette
   as inline styles, so this preview cannot drift from what the site renders. */
.brand-preview {
    border: 1px solid var(--line);
    font-family: 'Anuphan', 'Segoe UI', system-ui, sans-serif;
    overflow: hidden;
}
.bp-nav { display: flex; align-items: center; gap: 18px; padding: 0 20px; height: 58px; }
.bp-logo { max-height: 34px; width: auto; }
.bp-wordmark {
    font-family: 'Bai Jamjuree', sans-serif; font-weight: 700; font-size: 14px;
    letter-spacing: .14em; display: flex; align-items: baseline; gap: 8px;
}
.bp-thai { font-family: 'Anuphan', sans-serif; font-weight: 500; font-size: 11px; letter-spacing: .04em; }
.bp-links { display: flex; gap: 18px; font-size: 13px; font-weight: 500; margin-left: auto; }
.bp-btn { padding: 8px 16px; font-size: 12px; font-weight: 600; }
.bp-band { display: flex; flex-direction: column; gap: 8px; padding: 28px 20px; }
.bp-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.bp-rule { width: 20px; height: 2px; }
.bp-headline { font-family: 'Bai Jamjuree', sans-serif; font-size: 22px; font-weight: 600; }
.bp-sub { font-size: 13px; }
.bp-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 20px; }
.bp-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px; }
.bp-badge { padding: 4px 10px; font-size: 11px; font-weight: 600; color: #FFF; }
.bp-price { font-family: 'Bai Jamjuree', sans-serif; font-size: 18px; font-weight: 600; }
.bp-meta { font-size: 12px; }
.bp-footer { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.bp-rule-wide { height: 1px; width: 100%; }
.bp-fine { font-size: 11px; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.photo-card { border: 1px solid var(--line); background: var(--surface); }
.photo-card img { width: 100%; height: 120px; object-fit: cover; display: block; }
.photo-card.is-cover { outline: 2px solid var(--andaman); }
.photo-actions { display: flex; gap: 6px; padding: 8px; }

.empty { padding: 32px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-family: 'Bai Jamjuree', sans-serif; font-size: 28px; font-weight: 600; }
.stat-note { font-size: 12px; color: var(--muted); }

#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
    background: var(--garuda); color: #FFF; padding: 12px 20px; font-size: 14px;
}
#blazor-error-ui .reload { color: #FFF; text-decoration: underline; margin-left: 10px; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }

/* ---------- Editors shared between a page and the setup flow ---------- */

.editor-head { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.editor-subhead { font-size: 14px; font-weight: 600; margin: 24px 0 6px; }

/* Languages */
.lang-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.lang-choice {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border: 1px solid var(--line); background: var(--surface); padding: 14px 16px;
}
.lang-choice.is-chosen { border-color: var(--andaman); }
.lang-pick { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.lang-name { font-weight: 600; font-size: 14px; }
.lang-native { font-size: 13px; color: var(--muted); }

/* ---------- Setting a site up ---------- */

.setup { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.setup-aside { position: sticky; top: 68px; display: flex; flex-direction: column; gap: 14px; }
.setup-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.setup-nav { display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--surface); }

.setup-step {
    display: flex; align-items: flex-start; gap: 12px; width: 100%;
    padding: 11px 14px; background: none; border: 0; border-bottom: 1px solid var(--line-soft);
    text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.setup-step:last-child { border-bottom: 0; }
.setup-step:hover { background: var(--line-soft); }
.setup-step.is-current { background: var(--celadon); }
.setup-step:focus-visible { outline: 2px solid var(--andaman); outline-offset: -2px; }

/* The mark is the state; the colour only reinforces it, so it still reads in mono. */
.setup-mark { width: 16px; flex: none; font-size: 13px; color: var(--muted); line-height: 1.5; }
.setup-step.is-done .setup-mark { color: var(--andaman); font-weight: 700; }

.setup-step-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.setup-step-title { font-size: 13.5px; line-height: 1.35; }
.setup-step.is-current .setup-step-title { font-weight: 600; }
.setup-step-note { font-size: 11.5px; color: var(--muted); }
.setup-step-note.is-outstanding { color: var(--amber); }

.setup-tally { font-size: 12.5px; color: var(--muted); line-height: 1.5; padding: 0 2px; }

.setup-actions { display: flex; gap: 12px; justify-content: flex-end; }

.setup-empty {
    padding: 20px; background: var(--line-soft); color: var(--muted);
    font-size: 14px; line-height: 1.55; margin-bottom: 18px;
}
.setup-list { display: flex; flex-direction: column; margin-bottom: 18px; }
.setup-row {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 0; border-bottom: 1px solid var(--line-soft);
}
.setup-row:last-child { border-bottom: 0; }
.setup-row-main { font-weight: 600; font-size: 14px; }
.setup-row-note { font-size: 13px; color: var(--muted); margin-right: auto; }

.setup-count { font-variant-numeric: tabular-nums; }

/* ---------- Confirming something that cannot be taken back ---------- */

.row-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.confirm-row td { background: var(--line-soft); }
.confirm { display: flex; flex-direction: column; gap: 14px; padding: 6px 0; max-width: 620px; }
.confirm p { font-size: 14px; line-height: 1.6; }
.confirm-actions { display: flex; gap: 10px; }

@media (max-width: 900px) {
    .setup { grid-template-columns: minmax(0, 1fr); }
    .setup-aside { position: static; }
}

/* ---------- Bringing an agency's existing stock in ---------- */

/* The import page leads with what goes wrong rather than with the form, so the
   panel that carries that warning is painted rather than left to be skipped. */
.warn-panel { border-left: 3px solid var(--amber); }
.warn-body { padding: 0 20px 20px; max-width: 760px; }
.warn-body p { font-size: 14px; line-height: 1.65; margin: 0 0 12px; }
.warn-body p:last-child { margin-bottom: 0; }

.csv-box {
    min-height: 200px; resize: vertical;
    padding: 12px;
    background: var(--surface); border: 1px solid var(--line);
    font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13px;
    color: var(--ink);
    white-space: pre; overflow-wrap: normal; overflow-x: auto;
}
.csv-box:focus { outline: 2px solid var(--andaman); outline-offset: -1px; }

.stat-row.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.line-no { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; color: var(--muted); }

.col-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.col-name {
    padding: 4px 9px;
    background: var(--line-soft); color: var(--ink-soft);
    font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12px;
}

/* ---------- The photo inbox ---------- */

.assign-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    padding: 0 20px 18px;
}
.assign-count { font-size: 13px; color: var(--muted); margin-right: auto; }
.assign-pick {
    padding: 6px 10px; max-width: 340px;
    background: var(--surface); border: 1px solid var(--line);
    font: inherit; font-size: 13px; color: var(--ink);
}

/* A card is the whole hit area: sorting two hundred photographs is a lot of clicks,
   and aiming at a checkbox for each of them is the wrong ask. */
button.photo-pick {
    display: block; width: 100%; padding: 0;
    text-align: left; font: inherit; color: inherit; cursor: pointer;
}
button.photo-pick:focus-visible { outline: 2px solid var(--andaman); outline-offset: 2px; }
.photo-card.is-picked { outline: 2px solid var(--andaman); outline-offset: -1px; }

.photo-meta { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.photo-tick {
    flex: none; width: 18px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); font-size: 12px; font-weight: 700; line-height: 1;
}
.photo-card.is-picked .photo-tick { background: var(--andaman); border-color: var(--andaman); color: #FFF; }
.photo-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-size { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }

/* What a lead actually asked for — a viewing on a day, a valuation of somewhere.
   Read before the message, so it is laid out as facts rather than prose. */
.lead-facts {
    display: flex; flex-wrap: wrap; gap: 8px 28px;
    margin: 0 0 16px; padding: 12px 16px;
    background: var(--ground);
    border-left: 2px solid var(--andaman);
}
.lead-facts dt { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.lead-facts dd { margin: 0; font-size: 14px; font-weight: 600; }

/* Plan 12 C7: a LINE conversation and its cards, as the simulator and the inbox draw it.
   Close to LINE's look, enough to judge a card by; not a copy of it. */
.chat { display: flex; flex-direction: column; gap: 14px; padding: 20px; background: #8CABD9; min-height: 240px; max-height: 64vh; overflow-y: auto; }
.chat-row { display: flex; flex-direction: column; gap: 4px; max-width: 100%; }
.chat-agent { align-items: flex-end; }
.chat-ours { align-items: flex-start; }
.chat-bubble { padding: 9px 13px; border-radius: 16px; max-width: 420px; font-size: 14px; line-height: 1.4; }
.chat-bubble-agent { background: #A6E36E; }
.chat-bubble-ours { background: #FFF; }
.chat-tap { font-size: 13px; }
.chat-photo { max-width: 220px; max-height: 220px; display: block; border-radius: 8px; }
.chat-meta { display: flex; gap: 6px; align-items: center; font-size: 11px; color: #243A5E; flex-wrap: wrap; }
.flex-carousel { display: flex; gap: 8px; overflow-x: auto; max-width: 100%; padding-bottom: 4px; }
.flex-bubble { background: #FFF; border-radius: 16px; overflow: hidden; width: 300px; flex: none; display: flex; flex-direction: column; }
.flex-hero { width: 100%; aspect-ratio: 20 / 13; object-fit: cover; display: block; }
.flex-body { padding: 16px; }
.flex-footer { padding: 0 12px 12px; }
.flex-box { display: flex; gap: 6px; }
.flex-vertical { flex-direction: column; }
.flex-horizontal, .flex-baseline { flex-direction: row; align-items: baseline; }
.flex-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.flex-size-xs { font-size: 11px; }
.flex-size-sm { font-size: 13px; }
.flex-size-md { font-size: 15px; }
.flex-separator { border: 0; border-top: 1px solid #E5E5E5; margin: 6px 0; width: 100%; }
.flex-image { max-width: 100%; }
.flex-button { height: 40px; border: 0; border-radius: 8px; font: inherit; font-size: 14px; cursor: pointer; }
.flex-button:disabled { cursor: default; opacity: .8; }
.flex-button-primary { background: var(--andaman); color: #FFF; }
.flex-button-secondary { background: #EFEFEF; color: var(--ink); }
.flex-button-link { background: transparent; color: #2A5DB0; }
.sim-panel { display: flex; flex-direction: column; }
.sim-compose { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); align-items: flex-end; }
.sim-compose textarea { flex: 1; min-width: 240px; font: inherit; padding: 8px 10px; border: 1px solid var(--line); }
.sim-quoting { flex-basis: 100%; display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.chat-reading { font-size: 12px; max-width: 520px; background: #FFFFFFCC; padding: 4px 8px; }
.chat-reading pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; max-height: 320px; overflow-y: auto; }
.inbox { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.inbox-item { display: block; width: 100%; text-align: left; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); font: inherit; cursor: pointer; }
.inbox-item.is-open { background: var(--celadon); }
.inbox-item-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.inbox-item-sub { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }

/* ---------- Plan 13 C: the Tracking page, drawn for a phone first ---------- */

.trk { max-width: 720px; }
.trk-month { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; padding: 8px; }
.trk-month h2 { font-size: 18px; font-weight: 600; text-align: center; }
.trk-month p { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.trk-step {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border: 1px solid var(--line); color: var(--ink);
    font-family: 'Bai Jamjuree', sans-serif; font-size: 20px; font-weight: 600; line-height: 1;
}
.trk-step:hover { background: var(--line-soft); color: var(--ink); }
.trk-step.is-off { color: var(--line); border-color: var(--line-soft); }
.trk-lede h2 { font-size: 25px; line-height: 1.22; font-weight: 600; text-wrap: balance; }
.trk-lede p { margin: 8px 0 0; font-size: 15px; color: var(--ink-soft); line-height: 1.45; }
.trk-panel { padding: 16px; }
.trk-panel > h2 { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.trk-note { font-size: 13px; color: var(--muted); margin: 10px 0 0; line-height: 1.45; }
.trk-note a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* A table sized in em so the same rules serve the panel and, one day, a smaller frame. */
.trk-t { font-size: 14px; font-variant-numeric: tabular-nums; }
.trk-t th, .trk-t td { padding: .6em .45em; border-bottom: 1px solid var(--line); text-align: right; vertical-align: baseline; font-weight: 400; font-size: inherit; letter-spacing: 0; text-transform: none; }
.trk-t th:first-child, .trk-t td:first-child { text-align: left; padding-left: 0; }
.trk-t th:last-child, .trk-t td:last-child { padding-right: 0; }
.trk-t thead th { color: var(--muted); font-size: .88em; font-weight: 500; }
.trk-t tbody tr:last-child > * { border-bottom: 0; }
.trk-t tbody tr:hover { background: transparent; }
.trk-t .now { font-family: 'Bai Jamjuree', sans-serif; font-weight: 600; font-size: 20px; }
.trk .code { font-family: 'Bai Jamjuree', sans-serif; font-weight: 600; color: var(--andaman); white-space: nowrap; }
.trk-t th .code { margin-right: .35em; }

.trk-legend { display: flex; flex-wrap: wrap; gap: .3em 1.4em; font-size: 13px; margin-bottom: 12px; }
.trk-legend span { display: inline-flex; align-items: center; gap: .5em; }
.trk-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3em; font-size: 12px; }
.trk-cal .wd { font-size: .92em; color: var(--muted); text-align: center; padding-bottom: .15em; }
.trk-cal .d { min-height: 3.7em; background: var(--ground); padding: .3em .35em; display: flex; flex-wrap: wrap; align-content: flex-start; gap: .22em; }
.trk-cal .d.x { background: transparent; }
.trk-cal .d > span { flex: 0 0 100%; font-size: .92em; color: var(--muted); line-height: 1.2; font-variant-numeric: tabular-nums; }
.trk-cal .d > small { font-size: .8em; color: var(--muted); }
.trk-cal .d.on { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.trk-cal .d.on > span { color: var(--ink); font-weight: 600; }
.trk-q, .trk-l { display: inline-block; width: .85em; height: .85em; flex: 0 0 auto; }
.trk-q { background: var(--andaman); }
.trk-l { background: #06C755; border-radius: 50%; }

.trk-dates { list-style: none; margin: 0; padding: 0; }
.trk-dates li { display: grid; grid-template-columns: 5.6em minmax(0, 1fr) auto; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: baseline; }
.trk-dates li:last-child { border-bottom: 0; }
.trk-dates time { font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.trk-dates .none { color: var(--muted); }

.trk-work { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin: 0; }
.trk-work div { display: flex; flex-direction: column-reverse; }
.trk-work dt { font-size: 13px; color: var(--ink-soft); }
.trk-work dd { margin: 0; font-family: 'Bai Jamjuree', sans-serif; font-size: 22px; font-weight: 600; }

.trk-dl { background: var(--surface); border: 1px solid var(--line); padding: 12px 16px 14px; }
.trk-dl .btn { width: 100%; min-height: 48px; height: auto; font-size: 15px; }
.trk-dl p { font-size: 12px; color: var(--muted); text-align: center; margin: 6px 0 0; }

/* ---------- The shell on a narrow screen (Plan 13 C) ---------- */

.shell-bar { display: none; }

@media (max-width: 700px) {
    .shell { flex-direction: column; }
    .shell-bar {
        position: sticky; top: 44px; z-index: 20;
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        padding: 10px 16px;
        background: var(--sidebar); color: #FFF;
    }
    .shell-bar strong { display: block; font-family: 'Bai Jamjuree', sans-serif; font-size: 15px; font-weight: 600; }
    .shell-bar small { display: block; font-size: 11px; color: #A9B0A5; }
    .shell-menu {
        min-height: 44px; padding: 0 14px;
        background: var(--ink-soft); color: #FFF; border: 0;
        font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
    }

    .sidebar { display: none; width: auto; padding-top: 6px; }
    .sidebar.is-open { display: flex; }
    .sidebar .brand { display: none; }
    .nav-user { margin-top: 10px; }

    .topbar { height: auto; min-height: 56px; padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
    .content { padding: 16px; gap: 16px; }
    .form-grid, .stat-row, .stat-row.is-three, .inbox, .lang-choices { grid-template-columns: minmax(0, 1fr); }
    .trk-dl { position: sticky; bottom: 0; margin: 0 -16px -16px; border-width: 1px 0 0; }
}

/* History panels: the listing editor's and a site's log. */
.history { list-style: none; margin: 0; padding: 0 20px 16px; }
.history-entry { padding: 10px 0; border-top: 1px solid var(--line); }
.history-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.history-line time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; min-width: 150px; }
.history-what { font-weight: 500; }
.history details { margin-top: 6px; }
.history-fields { border-collapse: collapse; margin-top: 6px; font-size: 13px; }
.history-fields th { text-align: left; font-weight: 500; padding: 2px 16px 2px 0; color: var(--muted); white-space: nowrap; vertical-align: top; }
.history-fields td { padding: 2px 16px 2px 0; vertical-align: top; overflow-wrap: anywhere; }
.history-was { text-decoration: line-through; color: var(--muted); }
