:root {
  --ink: #27232b;
  --muted: #655d69;
  --paper: #f8f7f9;
  --white: #fff;
  --line: #e3dfe6;
  --field: #c5bdc9;
  --wine: #653751;
  --wine-dark: #4d283e;
  --wash: #f3edf2;
  --green: #245c47;
  --amber: #775020;
  --red: #86382f;
  --radius: .65rem;
  color: var(--ink);
  background: var(--paper);
  font: 1rem/1.48 "Segoe UI", Aptos, system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { opacity: .58; cursor: default; }
:focus-visible { outline: 3px solid #9f6594; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 3vw, 2.65rem); line-height: 1.15; letter-spacing: -.045em; font-weight: 690; }
h2 { font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.25; letter-spacing: -.025em; }
h3 { font-size: 1rem; line-height: 1.3; font-weight: 690; }

.topbar { position: sticky; top: 0; z-index: 5; background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-inner, main { width: min(1232px, calc(100% - 64px)); margin-inline: auto; }
.topbar-inner { display: flex; align-items: stretch; justify-content: space-between; min-height: 68px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .75rem; }
.brand-name { color: var(--wine); font: 1.85rem/1 Georgia, serif; letter-spacing: -.04em; }
.brand-name + span { border-left: 1px solid var(--line); padding-left: .75rem; color: var(--muted); font-size: .88rem; }
nav { display: flex; gap: .15rem; }
nav form { display: flex; }
nav button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 0;
  border-bottom: 2px solid transparent; background: transparent; color: var(--muted);
  padding: .5rem .85rem; font-size: .9rem; font-weight: 620; }
nav button:hover { background: var(--paper); color: var(--wine); }
nav button[aria-current="page"] { border-bottom-color: var(--wine); color: var(--wine); background: var(--wash); }
.nav-count { border-radius: 1rem; padding: .04rem .36rem; background: var(--wash); color: var(--wine); font-size: .75rem; }
nav button[aria-current="page"] .nav-count { background: var(--white); }
.logout-button { border-left: 1px solid var(--line); margin-left: .3rem; }
main { padding-block: 2.3rem 4rem; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: .8rem 1.4rem; margin-bottom: 1.25rem; }
.back-button::before { content: '‹'; font-size: 1.2em; line-height: 1; }
.import-button::before { content: '+'; font-size: 1.2em; line-height: 1; }

.primary, .ghost, .quiet { min-height: 42px; display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; border-radius: .47rem; padding: .48rem .85rem; font-size: .9rem; font-weight: 660; line-height: 1.22; }
.primary { border: 1px solid var(--wine); background: var(--wine); color: white; }
.primary:hover:not(:disabled) { background: var(--wine-dark); border-color: var(--wine-dark); }
.ghost { border: 1px solid var(--field); background: var(--white); color: var(--wine); text-decoration: none; }
.ghost:hover:not(:disabled), .quiet:hover { background: var(--wash); }
.quiet { border: 1px solid transparent; color: var(--wine); background: transparent; }
.small { display: block; color: var(--muted); font-size: .82rem; font-weight: 400; line-height: 1.35; }
#notice { padding: .7rem 1rem; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--wash); color: var(--wine); }
#notice.error { color: var(--red); background: #fcefed; border-color: #ead1cc; }
.form-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
input:not([type="file"]), select, textarea { min-height: 42px; min-width: 0; background: var(--white); color: var(--ink);
  border: 1px solid var(--field); border-radius: .43rem; padding: .46rem .65rem; }
select:disabled, textarea:disabled { background: var(--paper); }
textarea { resize: vertical; }

.catalog-panel, .details, .conversation-empty, .settings-layout > *, .ai-settings {
  min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
}
.product-toolbar, .pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
.product-toolbar { padding: .85rem 1.15rem; }
.product-toolbar label { display: flex; gap: .65rem; align-items: center; font-size: .9rem; font-weight: 620; }
.product-toolbar select { max-width: min(58vw, 17rem); font-weight: 400; }
.table-area { overflow-x: auto; border-block: 1px solid var(--line); }
table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: left; }
th, td { padding: .8rem .75rem; vertical-align: middle; overflow-wrap: anywhere; }
th { background: var(--paper); color: var(--muted); font-size: .81rem; font-weight: 650; padding-block: .65rem; }
th:first-child, td:first-child { padding-left: 1.15rem; }
th:last-child, td:last-child { padding-right: 1.15rem; }
th:nth-child(1) { width: 25%; }
th:nth-child(2) { width: 13%; }
th:nth-child(3) { width: 18%; }
th:nth-child(4) { width: 15%; }
th.tokens-col { width: 9%; }
th:last-child { text-align: right; }
tbody tr + tr { border-top: 1px solid var(--line); }
.product-name { display: flex; align-items: center; text-align: left; gap: .8rem; width: 100%; padding: 0;
  border: 0; color: var(--ink); background: none; font-size: .95rem; font-weight: 690; line-height: 1.35; }
.product-name:hover { color: var(--wine); }
.product-name .small, .summary-cell .small { margin-top: .26rem; }
.product-thumb { flex: 0 0 54px; height: 64px; overflow: hidden; border-radius: .38rem; background: var(--wash); }
.product-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.category-button { max-width: 100%; min-height: 38px; border: 0; background: transparent; color: var(--wine); padding: .25rem 0;
  text-decoration: underline; text-decoration-color: var(--field); text-underline-offset: .22rem;
  text-align: left; font-size: .88rem; overflow-wrap: anywhere; }
.category-button:hover { text-decoration-color: currentColor; }
.token-link { font-variant-numeric: tabular-nums; }
.summary-cell { color: var(--muted); font-size: .88rem; }
.status { display: inline-flex; align-items: baseline; gap: .35rem; max-width: 100%; border-radius: .35rem; padding: .24rem .48rem;
  background: #f0eef1; color: #504753; font-size: .79rem; line-height: 1.25; font-weight: 650; }
.status::before { content: ''; flex: 0 0 .38rem; height: .38rem; align-self: center; border-radius: 50%; background: currentColor; }
.status.approval { background: #fcf0dc; color: var(--amber); }
.status.done { background: #e9f4ed; color: var(--green); }
.status.blocked, .status.error { background: #fcefed; color: var(--red); }
.status.running, .status.queued { background: var(--wash); color: var(--wine); }
.row-progress { display: grid; gap: .25rem; margin-top: .5rem; }
.stage-activity { margin-top: .38rem; }
.row-progress progress { width: min(100%, 6.2rem); height: 5px; border: none; border-radius: 8px; overflow: hidden;
  appearance: none; background: var(--wash); color: var(--green); }
.row-progress progress::-webkit-progress-bar { background: var(--wash); }
.row-progress progress::-webkit-progress-value { background: var(--green); }
.row-progress progress::-moz-progress-bar { background: var(--green); }
.row-actions { display: flex; flex-direction: column; gap: .14rem; align-items: flex-end; }
.row-photos { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.row-photos .quiet { font-size: .8rem; padding-inline: .42rem; }
.pagination { padding: .65rem 1.15rem; font-size: .85rem; color: var(--muted); }
.pagination button { min-height: 38px; }
.empty { min-height: 185px; display: grid; align-content: center; gap: .42rem; padding: 1.35rem; }
.empty p { color: var(--muted); }

.conversation-list { display: flex; gap: .45rem; overflow-x: auto; padding: .18rem .2rem .65rem; }
.conversation-tab { flex: 0 0 auto; display: inline-flex; align-items: stretch; max-width: min(95%, 24rem);
  background: var(--white); border: 1px solid var(--line); border-radius: .48rem; }
.conversation-tab:has([aria-pressed="true"]) { border-color: var(--wine); background: var(--wash); color: var(--wine); }
.conversation-tab button { min-width: 0; min-height: 42px; border: 0; background: transparent; color: inherit; }
.conversation-tab button:first-child { padding: .4rem .65rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.conversation-tab button:last-child { min-width: 40px; padding-inline: .5rem; font-size: 1.1rem; }
.conversation-tab button:hover { background: var(--wash); }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1rem;
  padding: 1.05rem 1.25rem; border-bottom: 1px solid var(--line); }
.detail-head h2 { overflow-wrap: anywhere; }
.detail-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem; }
.detail-head p, .photo-note { color: var(--muted); margin-top: .4rem; white-space: pre-line; overflow-wrap: anywhere; font-size: .9rem; }
.photo-note { padding-left: 1.2rem; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.detail-layout.needs-approval { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-layout > div { padding: 1.1rem 1.25rem; min-width: 0; }
.detail-layout > div + div { border-left: 1px solid var(--line); }
.visual-section + .visual-section, .visual-section + .briefing-summary { margin-top: 1.25rem; }
.visual-section h3, .conversation h3 { margin-bottom: .65rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .62rem; }
.photo-grid figure { margin: 0; min-width: 0; }
.photo-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--paper);
  border: 1px solid var(--line); border-radius: .45rem; }
figcaption { margin-top: .25rem; color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.calibration-image { display: block; width: min(100%, 380px); margin-bottom: .7rem;
  border: 1px solid var(--line); border-radius: .45rem; }
.approval-section { padding: .85rem; background: #fffbf4; border: 1px solid #ecdfc7; border-radius: var(--radius); }
.calibration-actions, .reply { display: grid; gap: .55rem; margin-top: .7rem; }
.calibration-actions label, .reply label { font-size: .85rem; font-weight: 620; }
.briefing-summary { font-size: .87rem; color: var(--muted); }
.briefing-summary summary { width: fit-content; color: var(--wine); font-weight: 650; }
.briefing-summary dl { margin: .65rem 0 0; }
.briefing-summary dl > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: .4rem; padding-block: .25rem; }
.briefing-summary dd { margin: 0; overflow-wrap: anywhere; }
.usage-summary { margin-top: 1.15rem; }
.usage-summary > p { margin-top: .45rem; }
.usage-summary .token-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.25rem), 1fr)); gap: .45rem; }
.usage-summary .token-metrics > div { display: block; border: 1px solid var(--line); border-radius: .4rem; padding: .55rem .6rem; }
.token-metrics dd { color: var(--ink); font-size: 1rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.token-groups { list-style: none; padding: 0; margin: .7rem 0 0; }
.token-groups li { display: flex; justify-content: space-between; gap: .35rem .8rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.token-groups strong { color: var(--ink); overflow-wrap: anywhere; }
.token-group-count { text-align: right; font-variant-numeric: tabular-nums; }
.messages { display: flex; flex-direction: column; align-items: flex-start; gap: .65rem; padding: 0 .18rem .35rem;
  min-height: 95px; max-height: min(55dvh, 32rem); overflow: auto; }
.message { padding: .63rem .76rem; border-radius: .55rem; background: var(--paper); max-width: 92%; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user { align-self: flex-end; background: var(--wash); }
.message.system { padding-block: .28rem; border-left: 2px solid #b49aaf; border-radius: 0; background: transparent; color: var(--muted); }
.message strong { display: block; margin-bottom: .2rem; font-size: .8rem; }
.reply button { justify-self: end; }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 1.1rem; align-items: start; }
.settings-layout > *, .ai-settings { padding: 1.15rem; }
.preset-group { margin-top: .95rem; }
.preset-group > ul { list-style: none; padding: 0; margin: .35rem 0 0; }
.preset-group li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; padding: .63rem 0; border-top: 1px solid var(--line); }
.preset-group p { color: var(--muted); font-size: .875rem; margin-top: .2rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.preset-form { display: grid; gap: .85rem; }
.preset-form label, .setup-fields label { display: grid; gap: .3rem; min-width: 0; font-size: .88rem; font-weight: 620; }
.ai-settings { margin-top: 1.1rem; }
.ai-settings > p { margin-top: .35rem; color: var(--muted); }
#aiProfiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1rem; margin-block: 1rem; }
#aiProfiles fieldset { display: grid; gap: .55rem; min-width: 0; padding: .8rem; border: 1px solid var(--line); border-radius: .5rem; }
#aiProfiles legend { font-weight: 650; }
#aiProfiles label { display: grid; gap: .25rem; }

dialog { width: min(100% - 32px, 460px); max-height: calc(100dvh - 32px); margin: auto; padding: 0;
  border: 1px solid var(--line); border-radius: .78rem; color: var(--ink); background: var(--white); }
dialog::backdrop { background: rgb(32 26 34 / 54%); }
.category-dialog { padding: 1.15rem; }
.category-dialog form > p { overflow-wrap: anywhere; }
.category-error { color: var(--red); font-size: .9rem; }
.setup-dialog { width: min(100% - 32px, 680px); }
.setup-head, .setup-foot { padding: .95rem 1.2rem; }
.setup-head p { margin-top: .3rem; color: var(--muted); overflow-wrap: anywhere; }
.setup-body { padding: .15rem 1.2rem .95rem; }
.setup-section { min-width: 0; border: 0; padding: 0; margin: .15rem 0 .95rem; }
.setup-section + .setup-section { border-top: 1px solid var(--line); padding-top: .6rem; }
.setup-section legend { padding: 0 .4rem 0 0; font-weight: 690; font-size: .95rem; }
.setup-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-block: .45rem; }
.setup-fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.setup-fields.counts { max-width: 19rem; }
.setup-foot { border-top: 1px solid var(--line); justify-content: flex-end; background: var(--paper); }
.delivery-dialog { width: min(100% - 32px, 940px); background: var(--paper); }
.delivery-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: .65rem 1rem;
  padding: 1rem 1.15rem; border-bottom: 1px solid var(--line); background: var(--white); }
.delivery-head p { margin-top: .25rem; color: var(--muted); font-size: .87rem; overflow-wrap: anywhere; }
.delivery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: .75rem; padding: .95rem 1.15rem; }
.delivery-tile { display: grid; align-content: start; min-width: 0; gap: .4rem; border: 1px solid var(--line);
  border-radius: .48rem; background: var(--white); color: var(--ink); padding: .38rem; text-align: left; }
.delivery-tile:hover { border-color: var(--wine); }
.delivery-tile img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: .24rem; background: var(--wash); }
.delivery-tile span { padding: 0 .14rem .13rem; color: var(--muted); font-size: .83rem; overflow-wrap: anywhere; }
.delivery-viewer { padding: .85rem 1.15rem 1rem; }
.delivery-viewer > img { display: block; width: 100%; max-height: 70dvh; object-fit: contain; margin: .7rem 0; background: var(--white); }
.viewer-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }
.tiny-review-dialog { width: min(100% - 32px, 1030px); background: var(--paper); }
.tiny-review-dialog > .delivery-head { flex-wrap: nowrap; }
.tiny-review-dialog > .delivery-head button { flex: 0 0 auto; }
.tiny-review-body { padding: 1rem 1.15rem; }
.tiny-review-groups { display: flex; gap: .4rem; overflow-x: auto; padding: .18rem .15rem .65rem; }
.tiny-review-groups button { flex: 0 0 auto; }
.tiny-review-groups button[aria-pressed="true"] { border-color: var(--wine); color: var(--wine); background: var(--wash); }
.tiny-review-meta { display: flex; align-items: baseline; justify-content: space-between; gap: .35rem .75rem;
  flex-wrap: wrap; margin: .45rem 0 .7rem; }
.tiny-review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr));
  gap: .7rem; padding: 0; margin: 0; list-style: none; }
.tiny-main-order { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.tiny-tile { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line);
  border-radius: .5rem; background: var(--white); padding: .43rem; gap: .4rem; }
.tiny-tile:focus-within { border-color: var(--wine); }
.tiny-tile-position { display: flex; align-items: center; justify-content: space-between; min-height: 1.65rem;
  padding-inline: .24rem; font-size: .78rem; font-weight: 640; color: var(--muted); }
.tiny-tile:first-child .tiny-tile-position { color: var(--wine); }
.tiny-tile-handle { cursor: grab; padding: 0 .25rem; color: var(--muted); font-size: 1.2rem; }
.tiny-tile-handle:active { cursor: grabbing; }
.tiny-tile-preview { width: 100%; border: 0; background: var(--wash); padding: 0; border-radius: .3rem; overflow: hidden; }
.tiny-tile-preview img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.tiny-tile-label { display: flex; flex-direction: column; align-items: flex-start; gap: .24rem; color: var(--muted);
  font-size: .8rem; line-height: 1.25; overflow-wrap: anywhere; padding-inline: .1rem; }
.tiny-kind { color: var(--muted); background: var(--paper); padding: .12rem .38rem; border-radius: .25rem; font-weight: 640; }
.tiny-kind.generated { color: var(--green); background: #e9f4ed; }
.tiny-tile-actions { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: auto; padding-top: .2rem; }
.tiny-tile-actions .ghost { min-height: 38px; min-width: 38px; padding: 0; font-size: 1.2rem; }
.tiny-tile-actions .tiny-remove { margin-left: auto; min-height: 38px; padding-inline: .45rem; font-size: .78rem; }
.tiny-review-available { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.tiny-review-available summary { color: var(--wine); width: fit-content; font-weight: 650; }
.tiny-review-available .tiny-review-grid { margin-top: .7rem; }
.tiny-add { margin-top: auto; }
.tiny-review-footer { display: flex; align-items: center; justify-content: space-between; gap: .55rem 1rem;
  background: var(--white); border-top: 1px solid var(--line); padding: .75rem 1.15rem; position: sticky; bottom: 0; }
.tiny-review-footer > button, .tiny-publish-actions { margin-left: auto; }
.tiny-publish-actions button { flex: 0 0 auto; }
.tiny-settings { margin-bottom: 1.2rem; padding: 1rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--white); }
.tiny-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; }
.tiny-settings-grid form { display: grid; gap: .65rem; align-content: start; }
.tiny-settings-grid form button { justify-self: start; }
.tiny-settings p, .tiny-settings small { overflow-wrap: anywhere; }
.tiny-triage-list { border-bottom: 1px solid var(--line); padding: .7rem 0; }
.tiny-triage-list > summary, .tiny-audit details > summary { cursor: pointer; font-weight: 650; }
.tiny-shared-sets, .tiny-shared-targets { padding: .65rem .8rem; margin: .25rem 0 .75rem; background: var(--wash); border-radius: .35rem; }
.tiny-shared-sets p { margin: 0 0 .35rem; }
.tiny-shared-sets ul, .tiny-shared-targets ul { margin: .3rem 0; padding-inline-start: 1.2rem; }
.tiny-shared-targets summary { color: var(--wine); cursor: pointer; }
.tiny-triage-list > label { margin: .6rem 0; max-width: 25rem; }
.tiny-triage-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .6rem; }
.tiny-triage-photos img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--wash); }
.tiny-audit { margin-top: 1.1rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.tiny-audit-heading { display: flex; justify-content: space-between; gap: .55rem; flex-wrap: wrap; align-items: center; }
.tiny-audit details { padding: .55rem .6rem; margin-top: .35rem; background: var(--white); border: 1px solid var(--line); border-radius: .38rem; }
.tiny-audit details summary span { font-weight: 400; margin-inline-start: .5rem; }
.tiny-stock { width: 100%; margin: .55rem 0 .15rem; border-collapse: collapse; text-align: left; table-layout: fixed; }
.tiny-stock th, .tiny-stock td { padding: .4rem .3rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.tiny-stock th:first-child { width: 40%; }
.tiny-stock td small { display: block; }
.tiny-stock tbody tr:first-child { background: var(--wash); }
.tiny-stock .stock-changed { color: var(--wine); font-weight: 650; }
@media (max-width: 650px) { .tiny-settings-grid { grid-template-columns: 1fr; } }
.tiny-preview-dialog::backdrop { background: rgb(32 26 34 / 39%); }
.login-screen { display: grid; min-height: 100dvh; place-items: center; padding-block: 1.4rem; }
.login-card { width: min(100%, 440px); padding: clamp(1.15rem, 4vw, 2rem); background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); }
.login-card h1 { font-size: clamp(1.55rem, 4vw, 2rem); margin-block: 1.1rem .95rem; }
.login-card .primary { margin-top: .15rem; }

@media (max-width: 900px) {
  .topbar-inner, main { width: calc(100% - 36px); }
  th, td { padding-inline: .55rem; }
}

@media (max-width: 720px) {
  main { padding-top: 1.4rem; }
  .topbar-inner { min-height: 0; flex-wrap: wrap; align-items: center; gap: 0; }
  .brand { min-height: 48px; }
  nav { width: 100%; }
  nav button { flex: 1 1 auto; min-width: 0; min-height: 44px; padding-inline: .4rem; font-size: .85rem; }
  .logout-button { margin-left: 0; }
  .detail-layout, .detail-layout.needs-approval, .settings-layout { grid-template-columns: 1fr; }
  .detail-layout > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .detail-head, .detail-layout > div { padding: .95rem; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody, table { display: block; }
  tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .74rem 1rem; padding: .85rem; }
  tbody td, tbody td:first-child, tbody td:last-child { display: block; min-width: 0; padding: 0; }
  tbody td[data-label]::before { content: attr(data-label); display: block; margin-bottom: .2rem; color: var(--muted); font-size: .8rem; }
  .product-cell, .summary-cell, .actions { grid-column: 1 / -1; }
  .summary-cell { grid-row: 3; }
  tbody td.summary-empty { display: none; }
  .row-actions { align-items: flex-start; flex-flow: row wrap; gap: .25rem .4rem; }
  .row-photos { justify-content: flex-start; }
}

@media (max-width: 500px) {
  .topbar-inner, main { width: calc(100% - 28px); }
  .page-heading { flex-wrap: wrap; }
  .product-toolbar, .pagination, .delivery-head, .delivery-grid, .delivery-viewer { padding-inline: .85rem; }
  .product-toolbar .small { margin-left: auto; }
  .delivery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .tiny-review-body, .tiny-review-footer { padding-inline: .75rem; }
  .tiny-publish-actions { margin-left: 0; }
  .tiny-review-groups { flex-wrap: wrap; overflow: visible; }
  .tiny-review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .tiny-review-meta { margin-top: .35rem; }
  .tiny-tile-actions { gap: .23rem; }
  .tiny-tile-actions .tiny-remove { margin-left: 0; }
  .setup-fields.three { grid-template-columns: 1fr; }
}
