:root {
  font-family: system-ui, "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: #182740;
  background: #f3f6fb;
  font-size: 14px;
  line-height: 1.5;
  --surface: #fff;
  --line: #e0e7f0;
  --faint-line: #e9eef5;
  --text: #182740;
  --muted: #53657d;
  --blue: #245ccb;
  --blue-dark: #194eaf;
  --blue-soft: #eaf1ff;
  --red: #a72c3e;
  --radius: 14px;
  --ease: cubic-bezier(.22,1,.36,1);
}
*, *::before, *::after { box-sizing: border-box }
body { margin: 0; min-width: 0 }
[hidden] { display: none !important }
p, h1, h2 { margin: 0 }
button, input, textarea { color: inherit; font: inherit }
button { cursor: pointer; -webkit-tap-highlight-color: transparent }
:focus-visible { outline: 2px solid #2e6de0; outline-offset: 3px }
svg { display: block; width: 1em; height: 1em; flex: none }
[data-icon] { display: inline-grid; place-items: center; flex: none; font-size: 16px }
.shell { width: min(1056px, 100% - 56px); margin-inline: auto }
.skip { position: fixed; top: 8px; left: 12px; transform: translateY(-150%); z-index: 10; padding: 8px 12px; background: white; border-radius: 8px; color: var(--blue) }
.skip:focus { transform: none }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line) }
.top-inner { min-height: 61px; display: flex; align-items: center; gap: 26px }
.brand { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 730; white-space: nowrap }
.brand img { flex: none }
.rail { display: inline-flex; position: relative; isolation: isolate; align-items: stretch; flex: none; touch-action: pan-y }
.rail button {
  display: flex; align-items: center; justify-content: center; gap: 6px; position: relative;
  padding: 0 12px; white-space: nowrap; border: 0; background: none; color: var(--muted); font-weight: 560;
  user-select: none; -webkit-user-select: none; border-radius: 8px; transition: color 130ms ease;
}
.rail button:hover { color: var(--blue-dark) }
.rail button[aria-current], .rail button[aria-pressed="true"] { color: var(--blue-dark); font-weight: 660 }
.rail-mark { position: absolute; z-index: -1; left: 0; pointer-events: none; width: 0; height: 34px; top: calc(50% - 17px); border-radius: 8px; background: var(--blue-soft) }
.navigation { gap: 3px; min-height: 44px; font-size: 13px }
.local { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; white-space: nowrap; color: var(--muted); font-size: 12px }
.local [data-icon] { font-size: 15px }
.workspace { margin-block: 30px 28px; outline: none }
.heading { display: flex; align-items: end; justify-content: space-between; gap: 12px 18px; margin-bottom: 17px }
h1 { font-size: 27px; line-height: 1.25; font-weight: 750; letter-spacing: -.025em }
.heading p { margin-top: 5px; color: var(--muted); font-size: 13px }
.btn {
  --face: transparent; --edge: transparent; --ink: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
  position: relative; isolation: isolate; min-height: 36px; min-width: 0; padding: 0 12px;
  background: transparent; border: 0; border-radius: 9px; color: var(--ink); font-weight: 620; font-size: 13px;
  transition: color 130ms ease;
}
.btn::before { content: ""; position: absolute; z-index: -1; inset: 0; border: 1px solid var(--edge); border-radius: inherit; background: var(--face); transition: background-color 130ms ease, border-color 130ms ease, scale 120ms var(--ease) }
.btn:active::before { scale: .97 }
.primary { --face: var(--blue); --edge: var(--blue); --ink: white }
.primary:hover { --face: var(--blue-dark); --edge: var(--blue-dark) }
.secondary { --face: white; --edge: #d6e0ee; --ink: #384d68 }
.secondary:hover { --face: #f3f7ff; --edge: #bdcfea }
.soft { --face: #eef4ff; --edge: #e3ecff; --ink: var(--blue-dark) }
.soft:hover { --face: #e3edff; --edge: #cedeff }
.ghost:hover { --face: #edf2fa; --ink: #253b58 }
.danger { --face: #ae3043; --edge: #ae3043; --ink: white }
.danger:hover { --face: #952536; --edge: #952536 }
.danger-text { --ink: var(--red); padding-inline: 8px }
.danger-text:hover { --face: #fff0f2 }
.small { min-height: 30px; padding-inline: 9px; font-size: 12px; border-radius: 8px }
.small [data-icon] { font-size: 14px }
.icon-button { width: 36px; padding: 0; aspect-ratio: 1 }
.btn:disabled { opacity: .6; cursor: not-allowed }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-block-end: 17px; box-shadow: 0 1px 2px #253b5e05 }
.stat { display: flex; align-items: center; gap: 12px; padding: 15px 19px; min-width: 0 }
.stat + .stat { border-inline-start: 1px solid var(--faint-line) }
.stat-icon { width: 38px; height: 38px; border-radius: 9px; color: var(--blue); background: var(--blue-soft); font-size: 19px }
.attention .stat-icon { color: #975817; background: #fdf2e3 }
.stat-label { color: var(--muted); font-size: 12px; display: block }
.stat strong { display: block; font-size: 22px; font-weight: 720; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px #253b5e06; min-width: 0 }
.panel-top, .filter-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 12px 16px 0 }
.panel-top { min-height: 46px }
.history-top { padding-bottom: 12px }
.panel-heading { display: flex; gap: 8px; align-items: baseline; min-width: 0 }
h2 { font-size: 16px; font-weight: 710; line-height: 1.35 }
.count { white-space: nowrap; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums }
.search { display: flex; align-items: center; gap: 8px; width: min(240px, 100%); min-height: 32px; background: var(--surface); border: 1px solid #d6e0ed; border-radius: 8px; padding: 0 9px; color: #61738b; cursor: text }
.search:focus-within { border-color: #79a0ee; box-shadow: 0 0 0 2px #225cca16 }
.search input { border: 0; appearance: none; background: transparent; outline: none; font-size: 13px; line-height: 1.5; width: 100%; min-width: 0; padding: 4px 0; color: var(--text) }
::placeholder { color: #687a91; opacity: 1 }
.filter-row { padding-top: 7px; padding-bottom: 10px }
.filter { background: #f1f4f9; border-radius: 8px; min-height: 33px; padding: 3px; gap: 2px; font-size: 12px }
.filter button { padding-inline: 10px; border-radius: 6px }
.filter .rail-mark { height: 27px; top: calc(50% - 13.5px); background: white; box-shadow: 0 1px 2px #243e6615, 0 0 0 1px #223d5b08; border-radius: 6px }
.threshold-hint { font-size: 12px; color: var(--muted); text-align: end }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; text-align: start; font-size: 13px }
.data-table th { padding: 8px 11px; text-align: start; background: #f6f8fc; border-block: 1px solid var(--faint-line); color: #50617a; font-size: 12px; font-weight: 630 }
.data-table td { padding: 9px 11px; vertical-align: middle; border-bottom: 1px solid var(--faint-line); overflow-wrap: anywhere }
.data-table tbody tr:last-child td { border-bottom: 0 }
.data-table :is(th,td):first-child { padding-inline-start: 16px }
.data-table :is(th,td):last-child { padding-inline-end: 16px }
.inventory-table :is(th,td):last-child { text-align: end }
.data-table tbody tr { background: transparent; transition: background-color 130ms ease }
@media (hover:hover) { .data-table tbody tr:hover { background: #f8faff } }
.data-table tbody tr:last-child td:first-child { border-end-start-radius: var(--radius) }
.data-table tbody tr:last-child td:last-child { border-end-end-radius: var(--radius) }
.product { display: flex; align-items: center; gap: 10px; min-width: 0 }
.product-icon { display: grid; place-items: center; flex: none; background: #f0f4fa; color: #5c7393; border: 1px solid #e6edf7; border-radius: 8px; width: 33px; height: 33px; font-size: 16px }
.product-name { display: block; font-weight: 640; overflow-wrap: anywhere }
.product-code { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; overflow-wrap: anywhere }
.num { font-variant-numeric: tabular-nums }
.stock { font-weight: 650 }
.low-number { color: #a34819 }
.added { color: #226442; font-weight: 700 }
.badge { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 620 }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .8 }
.badge.out { background: #fcecee; color: #9b2d3f }
.badge.low { background: #fff2de; color: #855013 }
.badge.ok { background: #eaf6ee; color: #276546 }
.row-actions { display: flex; justify-content: flex-end; gap: 5px }
.mobile-label { display: none }
.log-note { white-space: pre-wrap; color: var(--muted) }
.log-time { color: var(--muted) }
.empty { padding: 26px 16px; min-height: 182px; border-top: 1px solid var(--faint-line); display: grid; place-content: center; justify-items: center; text-align: center; gap: 5px }
.empty-icon { background: #eef4ff; border: 1px solid #e1ebfd; border-radius: 11px; width: 42px; height: 42px; color: #4e74b0; font-size: 21px; display: grid; place-items: center; margin-bottom: 4px }
.empty strong { font-size: 14px; font-weight: 680 }
.empty p { color: var(--muted); font-size: 12px }
.empty .btn { margin-top: 6px }
.footnote { display: flex; align-items: flex-start; gap: 7px; margin-top: 14px; color: var(--muted); font-size: 12px }
.footnote [data-icon] { font-size: 14px; margin-top: 2px }
dialog {
  width: min(422px, 100% - 28px); max-width: none; max-height: calc(100dvh - 28px);
  padding: 0; border: 1px solid #dbe5f2; border-radius: 16px; color: var(--text); background: var(--surface);
  box-shadow: 0 12px 36px #142a4b24; overflow: hidden;
}
dialog[open] { display: flex }
dialog::backdrop { background: #142a4b55; opacity: 1; transition: opacity 140ms ease }
dialog.motion-start::backdrop, dialog.closing::backdrop { opacity: 0 }
#editor-form { display: flex; flex-direction: column; width: 100%; min-height: 0 }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px 9px 16px; border-bottom: 1px solid var(--faint-line) }
.dialog-body { padding: 14px 16px 15px; overflow: auto; overscroll-behavior: contain; min-height: 0 }
.dialog-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 10px 14px; border-top: 1px solid var(--faint-line) }
#dialog-extra { margin-inline-end: auto }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12px; font-weight: 620 }
.field .optional { color: var(--muted); font-weight: 450 }
.field.wide { grid-column: 1 / -1 }
.field :is(input,textarea) { min-height: 37px; min-width: 0; width: 100%; appearance: none; border: 1px solid #d6e0ed; border-radius: 8px; padding: 7px 9px; background: white; font-size: 14px; font-weight: 450; outline: none }
.field textarea { resize: vertical; min-height: 57px; max-height: 180px }
.field :is(input,textarea):focus { border-color: #7097e5; box-shadow: 0 0 0 2px #225cca16 }
.field [aria-invalid="true"] { border-color: #cc6475 }
.field-hint { font-size: 12px; line-height: 1.45; font-weight: 450; color: var(--muted) }
.form-error { margin-top: 9px; font-size: 12px; color: var(--red); overflow-wrap: anywhere }
.restock-context { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 5px 9px; padding: 9px 10px; background: #f3f6fb; border-radius: 8px; margin-bottom: 11px; font-size: 12px; overflow-wrap: anywhere }
.restock-context strong { font-size: 13px }
.restock-context span { color: var(--muted) }
.delete-copy { color: #485e7b; overflow-wrap: anywhere }
.toasts { position: fixed; width: max-content; max-width: calc(100% - 24px); right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 4; display: grid; gap: 6px; justify-items: end; pointer-events: none }
.toast { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 3px 14px #253b5e18; font-size: 13px; max-width: 100%; overflow-wrap: anywhere; pointer-events: auto }
.toast svg { font-size: 16px; color: #287349 }
.toast.error svg { color: var(--red) }
@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 560px) }
  .top-inner { min-height: 53px; gap: 12px }
  .brand { font-size: 15px; gap: 6px }
  .brand img { width: 29px; height: 29px }
  .navigation { margin-inline-start: auto; font-size: 12px; gap: 1px }
  .navigation button { padding-inline: 9px; gap: 4px }
  .navigation button [data-icon] { font-size: 14px }
  .local { display: none }
  .workspace { margin-block-start: 18px }
  .heading { margin-bottom: 12px; align-items: center; gap: 7px }
  h1 { font-size: 23px }
  .heading p { font-size: 12px; margin-top: 3px }
  .btn { min-height: 44px }
  .btn::before { inset-block: 5px }
  .btn.small { padding-inline: 6px }
  .btn.small::before { inset-block: 8px }
  .icon-button { width: 44px }
  .icon-button::before { inset: 5px }
  .stats { margin-bottom: 12px }
  .stat { padding: 9px 7px; gap: 5px; align-items: start }
  .stat-icon { width: 25px; height: 25px; border-radius: 6px; font-size: 14px; margin-top: 4px }
  .stat-label { font-size: 11px }
  .stat strong { font-size: 16px }
  .panel-top { padding: 8px 10px 0; gap: 5px 9px }
  .history-top { padding-bottom: 7px }
  .panel-heading { gap: 5px; flex-wrap: wrap }
  .panel-heading h2 { font-size: 14px }
  .count { font-size: 11px }
  .search { position: relative; isolation: isolate; width: min(51%, 210px); min-height: 44px; padding-inline: 8px; border: 0; background: transparent; gap: 8px }
  .search::before { content: ""; position: absolute; inset: 4px 0; z-index: -1; border: 1px solid #d6e0ed; border-radius: 8px; background: var(--surface) }
  .search:focus-within { box-shadow: none }
  .search:focus-within::before { border-color: #79a0ee; box-shadow: 0 0 0 2px #225cca16 }
  .search input { font-size: 12px; min-height: 44px }
  .filter-row { padding: 3px 10px 4px; gap: 4px 6px }
  .filter { padding: 0 2px; gap: 1px; min-height: 44px; background: transparent }
  .filter::before { position: absolute; content: ""; inset: 7px 0; border-radius: 8px; background: #f1f4f9; z-index: -2 }
  .filter button { padding-inline: 7px }
  .threshold-hint { font-size: 11px }
  .data-table, .data-table tbody { display: block }
  .data-table colgroup { display: none }
  .data-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap }
  .data-table tbody tr { display: grid; border-top: 1px solid var(--faint-line); padding: 6px 10px 2px; gap: 0 7px; align-items: center }
  .data-table tbody tr:last-child { border-end-end-radius: var(--radius); border-end-start-radius: var(--radius) }
  .data-table tbody tr > td { padding: 0; border: 0; min-width: 0 }
  .data-table td:first-child, .data-table td:last-child { padding-inline: 0 }
  .inventory-table tbody tr { grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto }
  .inventory-table .identity { grid-column: 1 / 3; grid-row: 1 }
  .inventory-table .status { grid-column: 3; grid-row: 1; justify-self: end }
  .inventory-table .stock { grid-column: 1; grid-row: 2 }
  .inventory-table .threshold { grid-column: 2; grid-row: 2 }
  .inventory-table .actions-cell { grid-column: 3; grid-row: 2 }
  .product { gap: 6px }
  .product-icon { width: 28px; height: 28px; font-size: 14px; border-radius: 7px }
  .product-code { font-size: 10px }
  .row-actions { gap: 2px }
  .row-actions .btn { gap: 3px }
  .mobile-label { display: inline; font-size: 11px; color: var(--muted); margin-inline-end: 3px; font-weight: 500 }
  .history-table tbody tr { grid-template-columns: minmax(0,1fr) auto; padding-bottom: 7px; gap: 4px 9px; font-size: 12px }
  .history-table .added { justify-self: end }
  .history-table .log-time { justify-self: end; text-align: end }
  .history-table .log-note { grid-column: 1 / -1 }
  .history-table .without-note { display: none }
  .empty { min-height: 162px; padding-block: 20px }
  .empty .btn { margin-top: 1px }
  .footnote { margin-top: 10px }
  .dialog-head, .dialog-footer { padding-block: 5px }
}
@media (max-width: 345px) {
  .top-inner { gap: 4px }
  .navigation button { padding-inline: 7px }
  .stat-icon { display: none }
  .stat { padding-inline: 10px }
  .heading .btn { padding-inline: 8px }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .btn::before, .rail button, .data-table tbody tr, dialog::backdrop { transition: none }
}


.badge.unbound, .badge.unverified { background: #eef2f7; color: #52647d }
.target-origin { flex-basis: 100%; overflow-wrap: anywhere }
.editor-note, .batch-ref { margin: 8px 0; overflow-wrap: anywhere }
.btn.working { color: transparent; opacity: 1 }
.btn.working::after { content: ""; width: 15px; height: 15px; border: 2px solid #ffffff69; border-top-color: #fff; border-radius: 50%; position: absolute; animation: stock-spin .8s linear infinite }
@keyframes stock-spin { to { transform: rotate(360deg) } }
@media (prefers-reduced-motion: reduce) { .btn.working::after { animation: none } }
@media (max-width: 680px) {
  .inventory-table tbody tr { grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto }
  .inventory-table .stock { grid-column: 1; grid-row: 2 }
  .inventory-table .threshold { grid-column: 2; grid-row: 2 }
  .inventory-table .actions-cell { grid-column: 3; grid-row: 2; justify-self: end }
  .inventory-table tr:has([data-action="check"]) .actions-cell { grid-column: 1 / -1; grid-row: 3; margin-top: -4px }
  .inventory-table tr:has([data-action="check"]) { padding-bottom: 0 }
  .history-table .record-state { grid-column: 1 }
  .history-table .log-action { grid-column: 1 / -1 }
}

.binding-list { border-top: 1px solid var(--faint-line) }
.binding-list .empty { border-top: 0 }
.binding-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 16px }
.binding-row + .binding-row { border-top: 1px solid var(--faint-line) }
.binding-info { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; min-width: 0 }
.binding-options { color: var(--muted); font-size: 12px; overflow-wrap: anywhere }
.stock-options { min-width: 0; margin: 10px 0 0; padding: 6px 0 0; border: 0; border-top: 1px solid var(--faint-line) }
.stock-options legend { padding: 0 8px 0 0; font-size: 12px; font-weight: 650 }
.check-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0 16px }
.check-option { display: inline-flex; align-items: center; min-height: 29px; gap: 7px; position: relative; font-size: 13px; cursor: pointer }
.check-option input { position: absolute; width: 16px; height: 16px; margin: 0; opacity: 0 }
.check-mark { display: grid; place-items: center; width: 16px; height: 16px; flex: none; border: 1px solid #8a9ab0; border-radius: 4px; background: var(--surface); color: white; transition: border-color 130ms, background-color 130ms }
.check-mark svg { width: 12px; height: 12px; display: none }
.check-option input:is(:checked,:indeterminate) + .check-mark { border-color: var(--blue); background: var(--blue) }
.check-option input:checked:not(:indeterminate) + .check-mark svg:not(.check-dash), .check-option input:indeterminate + .check-mark .check-dash { display: block }
.check-option input:focus-visible + .check-mark { outline: 2px solid #2e6de0; outline-offset: 2px }
.check-option:has(input:disabled) { opacity: .55; cursor: default }
@media (prefers-reduced-motion: reduce) { .check-mark { transition: none } }
@media (max-width: 680px) {
  .binding-row { padding: 6px 10px }
  .binding-info { column-gap: 7px }
  .check-option { min-height: 44px }
}
@media (max-width: 370px) {
  .navigation button { padding-inline: 6px; gap: 3px }
  .navigation button [data-icon] { font-size: 12px }
}

/* Home restock form and product picker */
.restock-layout { display: grid; grid-template-columns: minmax(0, 1.13fr) minmax(0, 1fr); gap: 14px; align-items: start }
.restock-empty { border-top: 0 }
#restock-content { padding: 15px 16px 12px }
.target-field { position: relative }
.target-label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 620 }
.target-face, .target-choice {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-width: 0; min-height: 46px; padding: 5px 9px;
  border: 1px solid #d6e0ed; border-radius: 8px; background: var(--surface); text-align: start;
}
#restock-single { background: #f8faff }
#restock-trigger:is(:hover,[aria-expanded="true"]):not(:disabled) { border-color: #90aee7; background: #f7faff }
#restock-trigger:disabled { cursor: default; color: var(--muted) }
#restock-trigger [data-icon="chevron"] { font-size: 15px; color: var(--muted); transition: transform 140ms var(--ease) }
#restock-trigger[aria-expanded="true"] [data-icon="chevron"] { transform: rotate(180deg) }
.target-item { display: grid; min-width: 0; gap: 1px; overflow-wrap: anywhere }
.target-item strong { font-size: 13px; font-weight: 660 }
.target-item > span { font-size: 11px; color: var(--muted) }
.target-choices {
  position: absolute; z-index: 2; inset-inline: 0; top: calc(100% + 5px);
  max-height: min(236px, 46dvh); overflow: auto; overscroll-behavior: contain;
  padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  box-shadow: 0 6px 18px #203d6a17; opacity: 0; visibility: hidden; transform: translateY(-3px);
  transition: opacity 135ms var(--ease), transform 135ms var(--ease), visibility 0s linear 135ms;
}
#restock-trigger[aria-expanded="true"] + .target-choices {
  opacity: 1; visibility: visible; transform: none; transition-delay: 0s;
}
.target-choice { border: 0; min-height: 39px; padding: 4px 8px }
.target-choice + .target-choice { margin-top: 2px }
.target-choice:hover { background: #f3f6fb }
.target-choice[aria-pressed="true"] { color: var(--blue-dark); background: var(--blue-soft) }
.target-choice:focus-visible { outline-offset: -2px }
.target-choice:not([aria-pressed="true"]) > [data-icon] { visibility: hidden }
.target-hint { margin-top: 5px }
.restock-options { margin-top: 10px; padding-top: 0 }
#restock-fields { margin-top: 9px }
#restock-fields textarea { min-height: 104px }
.restock-footer { display: flex; justify-content: flex-end; margin-top: 10px }
.restock-blocked { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; margin-top: 10px; padding: 6px 8px 6px 10px; border: 1px solid #f4e3c7; border-radius: 9px; background: #fff9ed; color: #775120; font-size: 12px }
.restock-blocked p { flex: 1 1 180px }
@media (max-width: 680px) {
  #restock-content { padding: 11px 11px 8px }
  .target-choice { min-height: 44px }
  .restock-blocked { padding-block: 2px }
  .restock-footer { margin-top: 5px }
}
@media (prefers-reduced-motion: reduce) {
  .target-choices, #restock-trigger [data-icon="chevron"] { transition: none }
}

/* Home insights use the same local batch data as the full history. */
.restock-insights { display: grid; gap: 12px; min-width: 0 }
.insight-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 3px 10px; padding: 10px 13px }
.insight-head h2 { font-size: 15px; font-weight: 680 }
.insight-head p { color: var(--muted); font-size: 11px; margin-top: 2px }
.insight-head > .small { margin-inline-end: -4px }
.insight-head [data-icon="right"] { font-size: 13px }
.insight-empty { border-top: 1px solid var(--faint-line); padding: 14px 13px; color: var(--muted); font-size: 12px }

.trend-readout { white-space: nowrap; color: var(--text); background: #edf3ff; padding: 3px 7px; border-radius: 7px; font-size: 11px; font-weight: 620; font-variant-numeric: tabular-nums }
.trend-body:has(.trend-plot) {
  --elui-chart-1: #2468e8;
  display: grid; grid-template: 106px auto / max-content minmax(0, 1fr); gap: 8px 7px;
  padding: 5px 13px 10px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums;
}
.trend-axis-y { position: relative; min-width: 10px; text-align: end }
.trend-axis-y span { display: block; transform: translateY(-50%) }
.trend-axis-y span:nth-child(2), .trend-axis-y span:last-child { position: absolute; right: 0 }
.trend-axis-y span:nth-child(2) { top: 50% }
.trend-axis-y span:last-child { top: 100% }
.trend-plot, .trend-axis-x { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); text-align: center; position: relative }
.trend-axis-x { grid-column: 2; white-space: nowrap }
.trend-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; pointer-events: none; stroke: var(--elui-chart-1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round }
.trend-grid { stroke: var(--line); stroke-width: 1 }
.trend-point { position: relative; border: 0; background: transparent; padding: 0; min-width: 0 }
.trend-point::before {
  content: ""; position: absolute; left: 50%; top: var(--point-y); translate: -50% -50%;
  width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--elui-chart-1); background: white;
  transition: background-color 110ms, scale 110ms;
}
.trend-point[aria-pressed="true"]::before { scale: 1.35; background: var(--elui-chart-1) }
.trend-point:focus-visible { outline: none }
.trend-point:focus-visible::before { outline: 2px solid var(--blue-dark); outline-offset: 2px }
.recent-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--faint-line) }
.recent-list li + li { border-top: 1px solid var(--faint-line) }
.recent-row {
  display: flex; align-items: center; gap: 7px; text-align: start; width: 100%;
  min-height: 48px; padding: 5px 13px; background: transparent; border: 0;
}
.recent-row > [data-icon] { color: var(--muted); font-size: 13px }
.recent-row > .badge { flex: none }
.recent-row:focus-visible { outline-offset: -3px; border-radius: 8px }
@media (hover:hover) { button.recent-row:hover { background: #f7faff } }
.recent-list li:last-child .recent-row { border-end-start-radius: var(--radius); border-end-end-radius: var(--radius) }
.recent-main { display: grid; gap: 1px; flex: 1; min-width: 0 }
.recent-main strong { font-size: 13px; font-weight: 650; overflow-wrap: anywhere }
.recent-main > span { font-size: 11px; color: var(--muted); overflow-wrap: anywhere }
@media (max-width: 780px) {
  .restock-layout { grid-template-columns: minmax(0, 1fr); gap: 11px }
  .restock-insights { gap: 11px }
}
@media (max-width: 680px) {
  .insight-head { padding: 4px 11px }
  .insight-head:has(#trend-title) { padding-block: 8px }
  .insight-empty { padding: 11px }
  .connect-note { padding-block: 0 }
  .recent-row, .trend-body:has(.trend-plot) { padding-inline: 11px }
}
@media (prefers-reduced-motion: reduce) { .trend-point::before { transition: none } }

.cloud-state { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 5px 12px; padding: 10px 14px; font-size: 13px }
.cloud-actions { display: flex; flex-wrap: wrap; gap: 6px }
.batch-options { display: block; margin-top: 4px; color: var(--muted) }
.access-shell { width: min(100% - 28px, 480px); margin: clamp(32px, 12vh, 110px) auto 24px }
.access-card { padding: 24px; }
.access-brand { display:flex; align-items:center; gap:9px; color:var(--blue-dark); font-size:14px; font-weight:700; margin-bottom:18px }
.access-card h1 { font-size:23px; }
#access-intro { color:var(--muted); margin:5px 0 16px; overflow-wrap:anywhere }
.settings-actions { display:flex; align-items:center; gap:6px; flex-wrap:wrap; justify-content:end }
@media (max-width:680px) {
  .access-card { padding:17px; }
}
.col-w12 { width:12% } .col-w13 { width:13% } .col-w14 { width:14% }
.col-w17 { width:17% } .col-w19 { width:19% } .col-w23 { width:23% }
.col-w29 { width:29% } .col-w32 { width:32% }
