/* MarketplaceHub Admin UI
   Stage 3.0.2: central content fills available screen width.
   Sidebar stays fixed; content has no max-width cap. */

:root {
  --bg: #f5f7fb;
  --surface: #fff;
  --surface-2: #f8fafc;
  --text: #182230;
  --muted: #65758b;
  --line: #e4e9f0;
  --primary: #4454d9;
  --primary-dark: #3442b8;
  --success: #16865a;
  --warning: #b66b0a;
  --error: #c83c4d;
  --sidebar: #172033;
  --sidebar-width: 260px;
  --topbar-height: 56px;
  --content-pad-x: 24px;
  --shadow: 0 8px 30px rgba(24, 34, 48, 0.07);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* ----- Shell / sidebar / topbar ----- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: var(--sidebar);
  color: #fff;
  padding: 20px 14px;
  z-index: 20;
  transition: transform 0.2s;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 10px 24px;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6f7cff, #8892ff);
  color: #fff;
  font-weight: 800;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  color: #bcc7da;
  border-radius: 8px;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.nav-icon {
  font-size: 22px;
}

.app-shell {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: calc(100% - var(--sidebar-width));
  max-width: none;
}

.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--content-pad-x);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
}

.topbar-user,
.topbar-user form {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-button,
.link-button {
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
}

.icon-button {
  font-size: 22px;
  display: none;
}

.link-button {
  color: var(--primary);
  padding: 0;
}

/* Full-bleed content: no max-width cap; fills available shell width */
.content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px var(--content-pad-x) 48px;
  flex: 1 1 auto;
  min-width: 0;
}

.breadcrumbs {
  display: flex;
  gap: 9px;
  color: var(--muted);
  margin-bottom: 14px;
}

.breadcrumbs > * + *:before {
  content: "/";
  margin-right: 9px;
  color: #a8b1bf;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: 26px;
  line-height: 1.25;
  margin: 0 0 5px;
}

.page-header p {
  margin: 0;
  color: var(--muted);
}

/* ----- Cards / stats / grids ----- */

.card,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  width: 100%;
  min-width: 0;
}

.card {
  padding: 20px;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card h2,
.card-header h2 {
  font-size: 17px;
  margin: 0 0 14px;
}

.card-header h2 {
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  width: 100%;
}

.stat-card {
  padding: 18px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 24px;
}

.two-columns {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  width: 100%;
  align-items: start;
}

.two-columns > * {
  min-width: 0;
}

.table-wrap {
  overflow-x: auto;
  padding: 0;
  width: 100%;
}

table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  text-align: left;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: var(--surface-2);
}

th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td small,
td strong {
  display: block;
}

.row-actions {
  white-space: nowrap;
}

.row-actions a,
.row-actions .inline-form {
  margin-right: 10px;
}

.row-actions .inline-form {
  display: inline;
}

.button-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent, #4f46e5);
  cursor: pointer;
  font: inherit;
}

.button-link.danger {
  color: #b42318;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 30px;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf0f5;
  color: #4d5b70;
  font-size: 12px;
  margin: 2px;
}

.badge-success {
  background: #e6f6ef;
  color: var(--success);
}

.badge-info {
  background: #e9edff;
  color: var(--primary);
}

.badge-warning {
  background: #fff2dc;
  color: var(--warning);
}

.badge-error {
  background: #fdebed;
  color: var(--error);
}

.badge-muted {
  background: #edf0f5;
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  text-decoration: none;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--primary-dark);
}

.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.button.danger {
  background: var(--error);
  color: #fff;
}

.button.danger:hover {
  background: #a82f3e;
  color: #fff;
}

.warning {
  background: #fff2dc;
  color: #8f5306;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.orders-sync {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

.orders-sync label {
  flex: 1 1 280px;
  max-width: 480px;
}

.orders-sync .actions {
  flex: 0 0 auto;
}

.orders-sync select,
.orders-sync .button {
  min-height: 42px;
  box-sizing: border-box;
}

.shop-form.marketplace-no-wb .wb-field {
  display: none !important;
}

.full {
  grid-column: 1 / -1;
}

/* Intentionally limited width for single-purpose forms (login-adjacent) */
.narrow {
  max-width: 650px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: #344054;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 78px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #667085;
  cursor: pointer;
  line-height: 1;
  font-size: 12px;
  font-weight: 600;
  padding: 0 8px;
  width: auto;
}

.password-toggle:hover,
.password-toggle[aria-pressed="true"] {
  background: #eef2f7;
  color: #344054;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd7e3;
  border-radius: 8px;
  background: #fff;
  padding: 9px 11px;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(68, 84, 217, 0.12);
}

input[readonly] {
  background: #f1f4f8;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input {
  width: auto;
}

.check-grid,
.permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.permission {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.permission input {
  width: auto;
  margin-top: 4px;
}

.permission small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}

.inline-form,
.filters {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-form label,
.filters label {
  min-width: 160px;
}

.filters {
  margin-bottom: 15px;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
}

.schedule-grid section {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  min-width: 0;
}

.event-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.event-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.event-list small {
  color: var(--muted);
}

.details {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 16px;
  margin: 0;
  width: 100%;
}

.details dt {
  color: var(--muted);
}

.details dd {
  margin: 0;
  word-break: break-word;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-2);
  padding: 12px;
  border-radius: 8px;
  max-height: 400px;
  overflow: auto;
}

.alert {
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 15px;
}

.alert-success {
  background: #e6f6ef;
  color: #086b45;
}

.alert-info {
  background: #e9edff;
  color: #3442b8;
}

.alert-warning {
  background: #fff2dc;
  color: #8f5306;
}

.alert-error {
  background: #fdebed;
  color: #9f2435;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
}

.tabs {
  display: flex;
  gap: 4px;
  background: #e9edf4;
  padding: 4px;
  border-radius: 9px;
}

.tabs a {
  padding: 7px 10px;
  color: var(--muted);
  border-radius: 6px;
  white-space: nowrap;
}

.tabs a.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.orders-subnav {
  margin: 0 0 16px;
  width: fit-content;
}

.chart-wrap {
  position: relative;
  width: 100%;
  min-height: 360px;
  height: 360px;
}

.chart-wrap-tall {
  height: auto;
  min-height: 480px;
}

.chart-wrap:has(.chart-panel) {
  height: auto;
  min-height: 0;
}

.chart-panel + .chart-panel {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color, #e5e7eb);
}

.chart-panel-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 600;
}

.chart-panel {
  position: relative;
  width: 100%;
  min-height: 300px;
  height: 300px;
}

.chart-wrap canvas,
.chart-panel canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-data-table {
  margin-top: 12px;
  max-height: 360px;
  overflow: auto;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at top, #eef0ff, #f5f7fb 50%);
}

.auth-card {
  width: min(420px, 100%);
  background: #fff;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(24, 34, 48, 0.12);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand h1 {
  font-size: 22px;
  margin: 0;
}

.muted {
  color: var(--muted);
}

.modal {
  border: 0;
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.25);
}

.modal::backdrop {
  background: rgba(23, 32, 51, 0.55);
}

.modal-card {
  padding: 24px;
  min-width: 340px;
}

.error-page {
  text-align: center;
  padding: 70px 20px;
}

.error-page > strong {
  font-size: 72px;
  color: var(--primary);
}

body.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
}

body.sidebar-collapsed .app-shell {
  margin-left: 0;
  width: 100%;
}

/* ----- Responsive breakpoints (Stage 3.0.2) ----- */

/* Laptop: 1200–1599px — 4 cards, 2 columns, 20px horizontal padding */
@media (max-width: 1599px) {
  :root {
    --content-pad-x: 20px;
  }
}

/* ≤1199px — 16px padding; tablet stack starts at 991 below */
@media (max-width: 1199px) {
  :root {
    --content-pad-x: 16px;
  }
}

/* Tablet: 992–1199px — cards 2×2, blocks single column */
@media (max-width: 1199px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-columns {
    grid-template-columns: 1fr;
  }

  .check-grid,
  .permission-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile / small tablet: ≤991px — full-width content, hamburger sidebar */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.2);
  }

  .sidebar.open {
    transform: none;
  }

  .app-shell {
    margin-left: 0;
    width: 100%;
  }

  .icon-button {
    display: block;
  }

  .content {
    width: 100%;
  }
}

/* Narrow phones */
@media (max-width: 650px) {
  .page-header {
    display: grid;
  }

  .stats-grid,
  .form-grid,
  .check-grid,
  .permission-grid,
  .schedule-grid {
    grid-template-columns: 1fr;
  }

  .details {
    grid-template-columns: 1fr;
  }

  .details dd {
    margin-bottom: 8px;
  }

  .topbar-user > span {
    display: none;
  }

  .tabs {
    overflow-x: auto;
  }

  .inline-form > * {
    width: 100%;
  }
}

/* ----- User Stock UI (Stage 3.5) ----- */
.stocks-header { align-items: flex-end; }
.stocks-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat-small { font-size: 14px; font-weight: 600; word-break: break-word; }
.meta-row { display: flex; flex-wrap: wrap; gap: 16px 24px; margin-bottom: 16px; }
.shop-picker { padding: 14px 18px; }
.stocks-filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}
.stocks-filters .actions { grid-column: 1 / -1; }
.filters-collapse > summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  list-style: none;
  user-select: none;
}
.filters-collapse > summary::-webkit-details-marker { display: none; }
.filters-collapse > summary::before {
  content: "▸";
  display: inline-block;
  transition: transform 0.15s ease;
  color: var(--muted);
}
.filters-collapse[open] > summary::before { transform: rotate(90deg); }
.filters-collapse[open] > summary { margin-bottom: 14px; }
.filters-collapse > .stocks-filters { margin-top: 4px; }
.view-toggle { margin-top: 14px; display: inline-flex; }
.stocks-table-card { padding: 0; overflow-x: auto; width: 100%; }
.stocks-table { width: 100%; table-layout: auto; }
.stocks-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.product-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: #e8edf5;
  display: inline-block;
}
.product-thumb.placeholder {
  background: linear-gradient(135deg, #e8edf5, #d5dde8);
}
.product-photo { width: 100%; max-width: 320px; border-radius: 12px; display: block; }
.product-photo.placeholder {
  height: 240px;
  background: linear-gradient(135deg, #e8edf5, #d5dde8);
}
.qty-zero { color: var(--muted); }
.qty-low { color: var(--warning); font-weight: 700; }
.expand-btn { display: inline-block; font-size: 16px; padding: 4px 8px; }
.expand-panel { padding: 8px 12px 16px; background: var(--surface-2); }
.expand-row > td { padding: 0; border-bottom: 0; }
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state h2 { margin: 0 0 8px; }
.stale-banner.compact { padding: 8px 12px; }
.stock-drop-alert { border-left: 4px solid #c0392b; }
.stock-drop-alert p { margin: 6px 0 10px; font-size: 0.93em; }
.stock-drop-table { margin-top: 6px; font-size: 0.88em; background: rgba(255,255,255,0.6); border-radius: 6px; }
.stock-drop-table th, .stock-drop-table td { padding: 4px 10px; text-align: left; }
.commercial-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
  align-items: end;
}
.commercial-form h2,
.commercial-form .actions {
  grid-column: 1 / -1;
}
.commercial-stats {
  margin-top: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.flat-notes {
  margin: 8px 0 0;
  padding-left: 18px;
}
.danger { color: #b42318; }
.data-table tr.is-selected td { background: rgba(47, 111, 237, 0.08); }
.data-table tr.is-gone td {
  background: #fdebed;
  color: #5c1520;
}
.data-table tr.is-written-off td {
  background: #fff6e8;
  color: #5c3d10;
}
.data-table td.col-status {
  white-space: normal;
  min-width: 11rem;
}
.data-table td.col-our-article {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.export-form { gap: 8px; }
.filters-card { margin-bottom: 16px; }

@media (max-width: 1599px) {
  .stocks-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1199px) {
  .stocks-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
  .stocks-stats { grid-template-columns: 1fr 1fr; }
  .product-hero { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .stocks-stats { grid-template-columns: 1fr; }
}

.conflict-block + .conflict-block { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.conflict-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 12px 0; }
.conflict-actions { display: flex; gap: 20px; flex-wrap: wrap; }
.kv-list { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 0; }
.kv-list dt { color: var(--muted); margin: 0; }
.kv-list dd { margin: 0; }

@media (max-width: 991px) {
  .conflict-grid { grid-template-columns: 1fr; }
}

.mapping-filters { align-items: end; }
.filter-toggles { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.filter-toggle {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  background: var(--surface);
  color: var(--text);
}
.filter-toggle.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--primary);
}
.filter-toggle input { display: none; }

.status-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.sync-stage {
  color: var(--muted);
  font-size: 14px;
}

.sync-progress {
  margin: 0 0 16px;
}

.sync-progress-track {
  height: 10px;
  border-radius: 999px;
  background: #e8edf5;
  overflow: hidden;
}

.sync-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  transition: width 0.35s ease;
}

.sync-progress.is-indeterminate .sync-progress-bar {
  width: 35% !important;
  animation: sync-progress-slide 1.4s ease-in-out infinite;
}

.sync-progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  margin-top: 8px;
  font-size: 13px;
}

.sync-progress-meta strong {
  font-variant-numeric: tabular-nums;
}

.sync-progress-compact {
  min-width: 140px;
  margin: 0;
}

.sync-progress-compact .sync-progress-track {
  height: 6px;
  margin-bottom: 4px;
}

.sync-progress-compact span {
  font-size: 12px;
  color: var(--muted);
}

.sync-progress-cell {
  min-width: 160px;
}

@keyframes sync-progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.chooser-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f7f9fc;
}

.chooser-topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.chooser-brand {
  padding: 0;
  color: var(--text);
  font-size: 16px;
}

.chooser-brand:hover {
  text-decoration: none;
}

.chooser-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 24px 48px;
}

.mode-chooser-page {
  width: min(860px, 100%);
  margin: 24px auto 0;
  text-align: center;
}

.mode-back {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 28px;
}

.mode-chooser-title {
  margin: 0 0 36px;
  font-size: 32px;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: #152033;
}

.mode-chooser {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.mode-chooser form {
  margin: 0;
}

.mode-pick {
  position: relative;
  appearance: none;
  width: 100%;
  min-height: 320px;
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e6edf5;
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(21, 32, 51, 0.06);
  cursor: pointer;
  text-align: center;
  color: inherit;
}

.mode-pick:hover {
  border-color: #c9d7ff;
  box-shadow: 0 18px 44px rgba(68, 84, 217, 0.12);
  transform: translateY(-2px);
}

.mode-pick-arrow {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #e6edf5;
  display: grid;
  place-items: center;
  color: #98a2b3;
  font-size: 22px;
  line-height: 1;
}

.mode-pick-art {
  width: 180px;
  height: 140px;
  display: grid;
  place-items: center;
}

.mode-pick-art svg {
  width: 180px;
  height: 140px;
}

.mode-pick strong {
  font-size: 28px;
  letter-spacing: -0.03em;
  color: #152033;
}

.mode-pick span:last-child {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e9edff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.scan-input,
.scan-form .scan-input {
  font-size: 20px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.scan-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

.scan-row label {
  flex: 1 1 280px;
}

.scan-row .button {
  min-height: 42px;
}

.scan-captured {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px 14px;
  background: #f6f8fc;
  border-radius: 10px;
}

.scan-captured > div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: baseline;
}

.scan-captured dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.scan-captured dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.scan-captured dd.is-filled {
  color: var(--text);
  font-weight: 600;
}

.sticker-preview {
  max-width: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.label-grid {
  display: grid;
  gap: 16px;
}

.sticker-block .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.order-details > div {
  grid-template-columns: 110px 1fr;
}

#accept-workspace + .card .table-wrap,
#accept-lines {
  scroll-margin: 0;
}

#accept-lines-wrap {
  max-height: min(60vh, 640px);
  overflow: auto;
}

@media print {
  body * {
    visibility: hidden;
  }
  body[data-print-label="sticker-card-trbx"] #sticker-card-trbx,
  body[data-print-label="sticker-card-trbx"] #sticker-card-trbx *,
  body[data-print-label="sticker-card-supply"] #sticker-card-supply,
  body[data-print-label="sticker-card-supply"] #sticker-card-supply *,
  body:not([data-print-label="sticker-card-trbx"]):not([data-print-label="sticker-card-supply"]) #sticker-card-order,
  body:not([data-print-label="sticker-card-trbx"]):not([data-print-label="sticker-card-supply"]) #sticker-card-order *,
  #sticker-card,
  #sticker-card * {
    visibility: visible;
  }
  #sticker-card-order,
  #sticker-card-trbx,
  #sticker-card-supply,
  #sticker-card {
    position: absolute;
    left: 0;
    top: 0;
    box-shadow: none;
    border: 0;
    padding: 0;
    margin: 0;
  }
  .sticker-block .card-header,
  .sticker-block .muted,
  .sticker-print,
  #sticker-print,
  .no-print {
    display: none !important;
  }
  .sticker-preview {
    max-width: none;
    width: 58mm;
    height: 40mm;
    border: 0;
    border-radius: 0;
  }
}

.mono {
  font-family: ui-monospace, Consolas, monospace;
  word-break: break-all;
}

.hidden {
  display: none !important;
}

#accept-lines tr.is-current {
  background: #eef2ff;
}

#accept-save-hint {
  margin-left: 8px;
}

@media (max-width: 800px) {
  .mode-chooser {
    grid-template-columns: 1fr;
  }

  .mode-chooser-title {
    font-size: 24px;
  }
}
