:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --canvas: oklch(0.975 0.004 45);
  --bg: oklch(0.995 0.002 45);
  --surface: oklch(0.96 0.006 45);
  --surface-strong: oklch(0.925 0.01 45);
  --ink: oklch(0.22 0.018 35);
  --muted: oklch(0.46 0.018 35);
  --line: oklch(0.88 0.012 45);
  --primary: oklch(0.49 0.145 32);
  --primary-hover: oklch(0.43 0.15 32);
  --primary-soft: oklch(0.94 0.03 32);
  --danger: oklch(0.52 0.18 25);
  --danger-soft: oklch(0.96 0.025 25);
  --success: oklch(0.43 0.13 150);
  --success-soft: oklch(0.95 0.035 150);
  --warning: oklch(0.5 0.12 75);
  --warning-soft: oklch(0.95 0.045 75);
  --focus: oklch(0.6 0.15 32);
  --sidebar-width: 256px;
  --radius: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a,
input,
select {
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease), opacity 180ms var(--ease), transform 180ms var(--ease);
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

h1 {
  margin-bottom: 6px;
  font-size: 1.7rem;
}

h2 {
  margin-bottom: 4px;
  font-size: 1rem;
}

p {
  text-wrap: pretty;
}

small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus,
summary:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

summary:focus:not(:focus-visible) {
  outline: none;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

input:hover,
select:hover,
textarea:hover {
  border-color: oklch(0.72 0.03 270);
}

input::placeholder {
  color: oklch(0.48 0.02 270);
}

label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

[data-commission-field][hidden] {
  display: none;
}

.app-bootstrap {
  width: min(720px, calc(100% - 48px));
  margin: 15vh auto;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.sidebar-head {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  background: var(--primary);
  color: oklch(1 0 0);
  font-weight: 800;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.2;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 550;
}

.sidebar nav {
  display: grid;
  gap: 20px;
  padding: 20px 12px;
  overflow-y: auto;
}

.nav-section {
  display: grid;
  gap: 3px;
}

.nav-section h2 {
  margin: 0 10px 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.sidebar nav a {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.nav-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.sidebar nav a:hover {
  background: var(--surface-strong);
  color: var(--ink);
}

.sidebar nav a[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.sidebar nav a[aria-current="page"] .nav-icon {
  background: var(--primary);
  color: white;
}

.sidebar-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.sidebar-account strong,
.sidebar-account span {
  display: block;
}

.sidebar-account span {
  color: var(--muted);
  font-size: 0.78rem;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.content {
  width: min(1280px, 100%);
  margin-inline: auto;
  padding: 36px 40px 72px;
}

.mobile-bar,
.close-nav,
.nav-backdrop {
  display: none;
}

.page-header {
  display: flex;
  min-height: 58px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-header p {
  max-width: 65ch;
  margin-bottom: 0;
  color: var(--muted);
}

.detail-header {
  align-items: center;
}

.back-link {
  display: inline-block;
  margin-bottom: 9px;
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover,
.text-link:hover {
  color: var(--primary);
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.button:hover:not(:disabled) {
  border-color: oklch(0.72 0.03 270);
  background: var(--surface);
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: oklch(1 0 0);
}

.button-primary:hover:not(:disabled) {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
}

.button-success {
  border-color: var(--success);
  background: var(--success);
  color: oklch(1 0 0);
}

.button-success:hover:not(:disabled) {
  border-color: oklch(0.35 0.12 150);
  background: oklch(0.35 0.12 150);
  color: oklch(1 0 0);
}

.button-danger {
  border-color: var(--danger);
  background: var(--danger);
  color: oklch(1 0 0);
}

.button-danger:hover:not(:disabled) {
  border-color: oklch(0.40 0.16 25);
  background: oklch(0.40 0.16 25);
  color: oklch(1 0 0);
}

.button-quiet {
  min-height: 44px;
  padding: 5px 8px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.button-small {
  min-height: 44px;
  padding: 5px 9px;
  font-size: 0.8rem;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  background: var(--surface-strong);
}

.text-link {
  color: var(--primary-hover);
  font-weight: 650;
  text-decoration: none;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 28px;
  border-block: 1px solid var(--line);
}

.metric {
  display: flex;
  min-height: 92px;
  flex-direction: column;
  justify-content: center;
  padding: 16px 20px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.metric strong {
  font-size: 1.55rem;
  font-variant-numeric: tabular-nums;
}

.section-block,
.detail-section {
  padding-block: 20px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.section-heading p,
.muted,
.quiet-message {
  margin-bottom: 0;
  color: var(--muted);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

tbody tr:hover {
  background: oklch(0.985 0.003 270);
}

.status,
.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 700;
}

.store-status-active {
  background: var(--success-soft);
  color: var(--success);
}

.store-status-inactive {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-large {
  min-height: 30px;
  padding: 4px 11px;
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.badge-test {
  background: var(--warning-soft);
  color: var(--warning);
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 8px;
  margin-bottom: 18px;
  padding: 10px;
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.toolbar label {
  min-width: 170px;
}

.search-field {
  width: min(360px, 100%);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 40px;
}

.span-two {
  grid-column: 1 / -1;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  margin: 14px 0 0;
}

.facts div {
  min-width: 0;
}

.facts dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
}

.facts dd {
  margin: 2px 0 0;
  font-weight: 650;
}

.detail-list {
  display: grid;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.detail-list li {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.detail-list time,
.timeline time {
  color: var(--muted);
  font-size: 0.75rem;
}

.inline-form {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  background: var(--surface);
}

.inline-form label {
  min-width: 210px;
  flex: 1;
}

.form-divider {
  align-self: center;
  color: var(--muted);
  font-size: 0.75rem;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.compact-form {
  max-width: 420px;
  margin-top: 18px;
  padding: 14px;
  background: var(--surface);
}

.data-rights-review-form {
  display: grid;
  min-width: 280px;
  gap: 8px;
}

.data-rights-review-form label {
  min-width: 0;
}

.data-rights-review-form .button {
  justify-self: start;
}

.timeline {
  display: grid;
  gap: 0;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  min-height: 62px;
}

.timeline li::before {
  position: absolute;
  top: 14px;
  bottom: -2px;
  left: 6px;
  width: 1px;
  background: var(--line);
  content: "";
}

.timeline li:last-child::before {
  display: none;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  margin-top: 3px;
  border: 3px solid var(--bg);
  border-radius: 50%;
  background: var(--primary);
  outline: 1px solid var(--primary);
}

.timeline p {
  margin: 2px 0;
  color: var(--muted);
}

.catalog-list {
  min-width: 0;
}

.title-line,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.scene-key {
  display: block;
  margin-top: 6px;
  color: var(--color-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
}

.title-line h2 {
  margin: 0;
}

.catalog-list .validation-note {
  color: var(--warning);
  font-weight: 650;
}

.package-groups {
  display: grid;
  gap: 28px;
}

.package-page .page-header h1 {
  font-size: 1.5rem;
}

.package-page .page-header p {
  font-size: 0.88rem;
}

.package-group {
  min-width: 0;
}

.package-group-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.package-group-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.package-group-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.package-cards {
  display: grid;
  gap: 10px;
}

.package-card {
  display: grid;
  grid-template-columns: minmax(230px, 0.95fr) minmax(250px, 1.15fr) minmax(460px, 1.7fr);
  align-items: center;
  gap: 24px;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.package-card-header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.package-identity {
  min-width: 0;
}

.package-identity h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.package-status {
  flex: 0 0 auto;
  font-size: 0.75rem;
  white-space: nowrap;
}

.package-meta,
.package-service-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.package-meta {
  margin-top: 6px;
}

.package-meta span + span::before,
.package-service-summary span + span::before {
  content: "·";
  margin-right: 12px;
  color: var(--line);
}

.package-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, auto);
  align-items: end;
  gap: 16px;
  min-width: 0;
}

.package-pricing {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  min-width: 0;
}

.package-pricing label {
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 650;
}

.package-pricing input {
  width: 100%;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.package-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 14px;
}

.package-actions .validation-note {
  max-width: 24ch;
  font-size: 0.76rem;
  line-height: 1.35;
}

.package-price-action,
.package-state-control {
  display: grid;
  gap: 6px;
}

.package-actions .button {
  min-width: 76px;
  font-size: 0.82rem;
}

.package-price-action {
  justify-items: end;
}

.package-state-control {
  min-width: 116px;
}

.package-state-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
}

.package-status-switch {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.package-status-switch:hover:not(:disabled) {
  border-color: var(--primary);
}

.package-status-switch:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
  outline-offset: 2px;
}

.package-status-switch:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.package-switch-track {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: var(--surface-strong);
  transition: background-color 160ms ease-out;
}

.package-switch-track span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  transition: transform 160ms ease-out;
}

.package-status-switch[aria-checked="true"] .package-switch-track {
  background: var(--primary);
}

.package-status-switch[aria-checked="true"] .package-switch-track span {
  transform: translateX(14px);
}

.visitor-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; margin-bottom: 24px; }
.visitor-filters label { display: grid; gap: 6px; }
.visitor-filters input[type="date"], .visitor-filters select { min-height: 44px; max-width: 100%; }
.visitor-filters .visitor-checkbox { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.visitor-checkbox input { width: 18px; height: 18px; }
.visitor-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.visitor-pagination > span { margin-right: auto; color: var(--muted); }
.visitor-list td { vertical-align: top; overflow-wrap: anywhere; }
.visitor-list small { display: block; margin-top: 4px; }
.visitor-definition { max-width: 80ch; margin-bottom: 24px; }
.visitor-explanation summary { cursor: pointer; min-height: 44px; color: var(--primary); }
.visitor-explanation p { max-width: 80ch; color: var(--muted); }
@media (max-width: 600px) {
  .visitor-filters > label:not(.visitor-checkbox) { flex: 1 1 140px; min-width: 0; }
  .visitor-filters > .visitor-checkbox { flex-basis: 100%; }
  .visitor-list .data-table, .visitor-list tbody, .visitor-list tr, .visitor-list td { display: block; min-width: 0; width: 100%; }
  .visitor-list thead { display: none; }
  .visitor-list tr { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .visitor-list td { padding: 8px 0; border: 0; white-space: normal; }
  .visitor-list td::before { content: attr(data-label); display: block; color: var(--muted); margin-bottom: 4px; font-size: 12px; }
}

/* Package management: quiet browsing first, focused editing on demand. */
.package-page {
  --package-field-border: color-mix(in srgb, var(--ink) 24%, var(--line));
}

.package-create-panel {
  margin-bottom: 24px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.package-create-panel .section-heading {
  margin: 0;
}

.package-create-panel .section-heading h2,
.package-create-panel .section-heading p {
  margin: 0;
}

.package-create-panel .section-heading p {
  margin-top: 4px;
}

.package-create-drawer {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr minmax(580px, 46vw);
}

.package-create-drawer.hidden {
  display: none;
}

.package-drawer-open {
  overflow: hidden;
}

.package-drawer-backdrop {
  width: 100%;
  min-height: 100%;
  padding: 0;
  border: 0;
  background: oklch(0.25 0.015 30 / 0.42);
  cursor: pointer;
}

.package-drawer-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  height: 100dvh;
  background: var(--bg);
  box-shadow: -16px 0 40px oklch(0.2 0.01 30 / 0.15);
}

.package-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line);
}

.package-drawer-header span {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 750;
}

.package-drawer-header h2,
.package-drawer-header p {
  margin: 0;
}

.package-drawer-header h2 {
  margin-top: 4px;
  font-size: 1.3rem;
}

.package-drawer-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.package-drawer-close {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  font-size: 1.35rem;
  cursor: pointer;
}

.package-create-form {
  overflow-y: auto;
  padding: 22px 28px 0;
}

.package-create-section {
  display: grid;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.package-create-section:first-child {
  padding-top: 0;
}

.package-create-section > header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.package-create-section > header > span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: var(--bg);
  font-size: 0.8rem;
  font-weight: 750;
}

.package-create-section h3,
.package-create-section p {
  margin: 0;
}

.package-create-section h3 {
  font-size: 1rem;
}

.package-create-section header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.package-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.package-create-form input,
.package-create-form select,
.package-toolbar input,
.package-toolbar select,
.package-editor input {
  min-height: 44px;
  border-color: var(--package-field-border);
}

.package-create-balance,
.package-balance {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface);
}

.package-create-balance strong,
.package-balance strong {
  font-variant-numeric: tabular-nums;
}

.package-create-balance small {
  color: var(--muted);
}

.package-create-policy {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 14px;
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.82rem;
}

.package-chibi-notice,
.package-create-form .form-feedback {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.82rem;
}

.package-create-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -28px;
  padding: 16px 28px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  box-shadow: 0 -8px 18px color-mix(in srgb, var(--ink) 6%, transparent);
}

.package-create-footer > span {
  color: var(--muted);
  font-size: 0.8rem;
}

.package-create-footer > div {
  display: flex;
  gap: 8px;
}

.package-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(150px, 0.7fr));
  align-items: end;
  gap: 12px;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.package-toolbar label {
  font-size: 0.78rem;
  font-weight: 700;
}

.package-result-count {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.package-group,
.package-style-group {
  min-width: 0;
}

.package-group[hidden],
.package-style-group[hidden],
.package-card[hidden],
.package-filter-empty[hidden] {
  display: none;
}

.package-group-heading,
.package-style-heading {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.package-group-heading::-webkit-details-marker,
.package-style-heading::-webkit-details-marker {
  display: none;
}

.package-group-heading::before,
.package-style-heading::before {
  content: "›";
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 1.1rem;
  transform: rotate(0deg);
  transition: transform 160ms ease-out;
}

.package-group[open] > .package-group-heading::before,
.package-style-group[open] > .package-style-heading::before {
  transform: rotate(90deg);
}

.package-group-heading > div,
.package-style-heading > div {
  flex: 1;
}

.package-group-heading > span,
.package-style-heading > span {
  color: var(--muted);
  font-size: 0.75rem;
}

.package-style-group {
  margin-top: 10px;
  padding: 0 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.package-cards {
  gap: 8px;
}

.package-card {
  display: block;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
}

.package-compact-summary {
  display: grid;
  grid-template-columns: minmax(250px, 1.3fr) minmax(330px, 1.2fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 92px;
  padding: 15px 18px;
}

.package-card-header {
  align-items: center;
}

.package-money-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 8px;
}

.package-money-summary span {
  display: grid;
  gap: 2px;
}

.package-money-summary small {
  color: var(--muted);
  font-size: 0.7rem;
}

.package-money-summary strong {
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.package-compact-actions {
  display: flex;
  justify-content: flex-end;
}

.package-editor {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.package-editor.hidden {
  display: none;
}

.package-editor .package-service-summary {
  margin-bottom: 12px;
}

.package-editor .package-form {
  grid-template-columns: minmax(420px, 1fr) auto;
}

.package-editor .package-pricing {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.package-status-switch {
  min-height: 44px;
}

.package-filter-empty {
  margin-top: 18px;
}

@media (max-width: 1180px) {
  .package-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .package-compact-summary {
    grid-template-columns: minmax(240px, 1fr) minmax(300px, 1fr) auto;
  }

  .package-editor .package-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .package-create-drawer {
    grid-template-columns: 1fr;
  }

  .package-drawer-backdrop {
    display: none;
  }

  .package-drawer-panel {
    width: 100%;
  }

  .package-toolbar,
  .package-create-grid,
  .package-compact-summary,
  .package-editor .package-pricing {
    grid-template-columns: 1fr;
  }

  .package-compact-summary {
    gap: 12px;
  }

  .package-money-summary {
    padding-block: 10px;
    border-block: 1px solid var(--line);
  }

  .package-compact-actions .button {
    width: 100%;
  }

  .package-editor .package-actions,
  .package-create-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .package-create-footer > div,
  .package-create-footer .button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .package-drawer-header,
  .package-create-form {
    padding-inline: 18px;
  }

  .package-create-footer {
    margin-inline: -18px;
    padding-inline: 18px;
  }

  .package-style-group {
    padding-inline: 10px;
  }

  .package-money-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.package-status-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 18px 50px color-mix(in srgb, var(--ink) 18%, transparent);
}

.package-status-dialog::backdrop {
  background: color-mix(in srgb, var(--ink) 32%, transparent);
}

.package-status-dialog form {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.package-status-dialog h2,
.package-status-dialog p {
  margin: 0;
}

.package-status-dialog h2 {
  font-size: 1.1rem;
}

.package-status-dialog p {
  color: var(--muted);
  line-height: 1.6;
}

.package-status-dialog .row-actions {
  justify-content: flex-end;
  margin-top: 6px;
}

.case-list .table-wrap {
  margin-top: 4px;
}

.qr-result p {
  max-width: 44ch;
  margin: 8px 0;
  overflow-wrap: anywhere;
}

.case-editor {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 20px;
  padding: 16px;
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.case-editor label:nth-of-type(3),
.case-editor label:nth-of-type(4),
.case-editor button {
  grid-column: 1 / -1;
}

.case-editor button {
  justify-self: start;
}

.case-edit-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(240px, 1.3fr) auto;
  align-items: end;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  background: var(--surface);
}

.case-description {
  max-width: 52ch;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.setup-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 28px;
  padding: 0;
  border-block: 1px solid var(--line);
  list-style: none;
}

.setup-progress li {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-right: 1px solid var(--line);
}

.setup-progress li:last-child {
  border-right: 0;
}

.setup-progress li > span {
  color: var(--muted);
  font-size: 1.15rem;
}

.setup-progress .is-complete > span {
  color: var(--success);
}

.setup-progress strong,
.setup-progress small {
  display: block;
}

.setup-section {
  padding-block: 24px;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.package-style-groups {
  display: grid;
  gap: 18px;
}

.package-style-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.package-style-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px 2px;
}

.package-style-heading h3,
.package-style-heading p {
  margin: 0;
}

.package-style-heading h3 {
  font-size: 0.92rem;
}

.package-style-heading p,
.package-style-heading > span {
  color: var(--muted);
  font-size: 0.76rem;
}

.setup-tabs {
  display: flex;
  gap: 4px;
  margin-top: 22px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.setup-tab {
  min-height: 44px;
  flex: 1;
  padding: 8px 16px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.setup-tab:hover {
  color: var(--ink);
  background: var(--bg);
}

.setup-tab.is-active {
  background: var(--bg);
  color: var(--primary);
  box-shadow: 0 1px 4px oklch(0.2 0.01 30 / 0.1);
}

.setup-section[hidden] {
  display: none;
}

.channel-list .data-table {
  min-width: 760px;
  table-layout: fixed;
}

.channel-list .row-actions {
  display: grid;
  min-width: 220px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
}

.channel-list th:nth-child(1) { width: 15%; }
.channel-list th:nth-child(2) { width: 16%; }
.channel-list th:nth-child(3) { width: 27%; }
.channel-list th:nth-child(4) { width: 12%; }
.channel-list th:nth-child(5) { width: 30%; }

.channel-list .row-actions .button {
  width: 100%;
  min-width: 0;
  white-space: normal;
}

.setup-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
}

.setup-form > button {
  justify-self: start;
}

.setup-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.setup-form-compact {
  grid-template-columns: 1fr;
  align-content: start;
}

.setup-form-compact h3 {
  margin-bottom: 2px;
}

.setup-counts {
  margin: 16px 0 0;
  color: var(--muted);
}

.setup-create-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.setup-create-option {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 4px;
}

.setup-create-option .button {
  width: 100%;
}

.setup-create-panels {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.setup-hierarchy-shell {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.setup-scenic-list {
  display: grid;
  gap: 24px;
}

.setup-scenic-group,
.setup-unassigned {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.setup-scenic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.setup-scenic-header h3,
.setup-unassigned > header h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.setup-scenic-header p,
.setup-unassigned > header p {
  margin: 4px 0 0;
}

.scenic-area-routing {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.scenic-area-routing p {
  margin: 0;
  color: var(--muted);
}

.scenic-area-routing strong {
  color: var(--text);
}

.scenic-area-routing .text-link {
  justify-self: start;
}

.setup-unassigned > header {
  margin-bottom: 16px;
}

.setup-store-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.setup-archived-stores {
  margin-top: 16px;
}

.setup-archived-stores > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.setup-archived-stores[open] > summary {
  margin-bottom: 12px;
}

.setup-archived-stores > summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.setup-store-card {
  display: grid;
  min-width: 0;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.setup-store-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.setup-store-card h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.setup-store-card h5 {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.setup-store-header p {
  margin: 4px 0 0;
}

.setup-store-card p,
.setup-store-card li,
.setup-store-card label {
  font-size: 14px;
}

.setup-store-card small {
  font-size: 13px;
}

.store-qr-block,
.store-qr-summary,
.setup-store-action-controls {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.store-qr-summary strong,
.commission-rule-copy {
  overflow-wrap: anywhere;
}

.store-qr-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.store-qr-actions .button,
.setup-store-action-controls > .button {
  width: 100%;
  min-width: 0;
  white-space: normal;
}

.setup-store-action {
  display: grid;
  min-width: 0;
  gap: 10px;
  margin-top: 2px;
}

.store-delete-warning,
.setup-account-warning {
  margin: 0;
  color: var(--danger);
  overflow-wrap: anywhere;
}

.setup-store-action > small {
  color: var(--muted);
}

.setup-section button,
.setup-section input,
.setup-section select {
  min-height: 44px;
}

.setup-section .button {
  min-width: 0;
  white-space: normal;
}

.setup-inline-error {
  grid-column: 1 / -1;
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 650;
}

.setup-create-switcher > *,
.setup-create-panels > *,
.setup-hierarchy-shell > *,
.setup-scenic-list > *,
.setup-store-grid > *,
.setup-store-card > *,
.setup-resource-controls {
  min-width: 0;
}

.setup-resource-action {
  display: flex;
  align-items: center;
  gap: 7px;
}

.setup-resource-action input {
  min-width: 120px;
}

.partner-account {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.partner-account-summary {
  display: grid;
  gap: 3px;
}

.partner-account-summary strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.partner-account-create,
.partner-account-action {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
}

.partner-account-create > button,
.partner-account-action > button {
  justify-self: start;
}

.commission-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 28px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.commission-tab {
  min-height: 48px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.commission-tab:hover {
  color: var(--text);
}

.commission-tab.is-active {
  background: var(--bg);
  color: var(--primary);
  box-shadow: 0 1px 4px oklch(0.2 0.01 30 / 0.1);
}

[data-commission-panel][hidden] {
  display: none;
}

.commission-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.commission-actions h2,
.commission-actions p {
  margin: 0;
}

.commission-actions p {
  margin-top: 6px;
  color: var(--muted);
}

.commission-summary {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.commission-summary .metric-accent {
  background: var(--primary-soft);
}

.commission-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.commission-filters label {
  display: grid;
  gap: 7px;
  min-width: 0;
  font-weight: 650;
}

.commission-filter-empty {
  padding: 28px;
  text-align: center;
}

.commission-table .text-link {
  white-space: nowrap;
}

.settlement-toolbar {
  margin-bottom: 0;
}

.settlement-result {
  min-width: 0;
  min-height: 100px;
}

.settlement-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  align-items: start;
  gap: 20px;
  margin-top: 18px;
}

.settlement-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.settlement-summary .metric {
  min-height: 76px;
}

.settlement-summary .metric strong {
  font-size: 1.2rem;
}

.settlement-candidates,
.settlement-history {
  min-width: 0;
  margin-top: 12px;
  padding: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.settlement-candidates summary,
.settlement-history summary {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  font-weight: 700;
}

.settlement-candidates summary small,
.settlement-history summary small {
  color: var(--muted);
  font-weight: 500;
}

.settlement-form {
  position: sticky;
  top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  min-width: 0;
}

.settlement-form > button {
  justify-self: start;
}

.settlement-form-heading {
  grid-column: 1 / -1;
}

.settlement-form-heading h3,
.settlement-form-heading p {
  margin: 0;
}

.settlement-form-heading p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.settlement-table th:first-child,
.settlement-table td:first-child {
  width: 48px;
  text-align: center;
}

.settlement-table input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  accent-color: var(--primary);
}

.settlement-note {
  grid-column: 1 / -1;
}

@media (max-width: 1180px) {
  .setup-store-grid {
    grid-template-columns: 1fr;
  }

  .setup-create-switcher {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .commission-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settlement-workspace {
    grid-template-columns: 1fr;
  }

  .settlement-form {
    position: static;
  }
}

@media (max-width: 760px) {
  .partner-account-create,
  .partner-account-action,
  .settlement-form {
    grid-template-columns: 1fr;
  }

  .settlement-note {
    grid-column: auto;
  }

  .settlement-summary {
    grid-template-columns: 1fr;
  }

  .settlement-summary .metric {
    min-height: 64px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .settlement-summary .metric:last-child {
    border-bottom: 0;
  }

  .commission-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .commission-actions .button {
    align-self: flex-start;
  }

  .commission-filters {
    grid-template-columns: 1fr;
  }
}

.setup-staff-list {
  margin-top: 18px;
}

.staff-update-row select,
.staff-update-row input {
  min-width: 150px;
}

.setup-active-toggle {
  display: flex;
  grid-column: auto;
  grid-template-columns: auto 1fr;
  align-items: center;
  margin-top: 6px;
  font-weight: 500;
}

.setup-active-toggle input {
  width: auto;
  min-width: 0;
  min-height: auto;
}

.error-state {
  display: grid;
  min-height: 260px;
  place-items: start;
  align-content: center;
  justify-content: center;
  padding: 32px;
  border-block: 1px solid var(--line);
  text-align: center;
}

.error-state p {
  max-width: 52ch;
  color: var(--muted);
}

.error-state .button {
  justify-self: center;
}

.compact-error {
  min-height: 180px;
}

.feedback,
.toast {
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
}

.feedback {
  margin-bottom: 16px;
}

.feedback-info,
.toast-info {
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.feedback-error,
.toast-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.feedback-success,
.toast-success {
  background: var(--success-soft);
  color: var(--success);
}

.toast-region {
  position: fixed;
  z-index: 60;
  right: 18px;
  bottom: 18px;
  width: min(420px, calc(100vw - 36px));
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid currentColor;
}

.empty-state {
  display: grid;
  min-height: 240px;
  place-items: center;
  align-content: center;
  padding: 36px;
  border-block: 1px solid var(--line);
  text-align: center;
}

.empty-state h2 {
  margin: 8px 0 4px;
}

.empty-state p {
  max-width: 48ch;
  margin-bottom: 0;
  color: var(--muted);
}

.empty-symbol {
  color: var(--primary);
  font-size: 2rem;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--surface);
}

.login-panel {
  display: grid;
  width: min(430px, 100%);
  gap: 28px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.login-panel h1 {
  margin-bottom: 6px;
}

.login-panel p {
  color: var(--muted);
}

.sso-login {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.emergency-login {
  border-top: 1px solid var(--line);
}

.emergency-login summary {
  padding-top: 20px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
}

.emergency-login .form-stack {
  margin-top: 20px;
}

.login-note {
  margin-bottom: 0;
  font-size: 0.8rem;
}

.form-error {
  min-height: 21px;
  margin: -6px 0 0;
  color: var(--danger);
  font-weight: 650;
}

.skeleton-stack {
  display: grid;
  gap: 12px;
  padding: 20px 0;
}

.skeleton {
  display: block;
  border-radius: 6px;
  background: var(--surface-strong);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-line {
  width: 100%;
  height: 18px;
}

.skeleton-line-short {
  width: 58%;
}

.skeleton-title {
  width: 180px;
  height: 32px;
  margin-bottom: 10px;
}

.section-stack {
  margin-top: 28px;
}

.section-stack + .section-stack {
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.direct-quote-create {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}

.direct-quote-create > summary {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.direct-quote-create > summary::-webkit-details-marker {
  display: none;
}

.direct-quote-create > summary:hover,
.direct-quote-create > summary:focus-visible {
  background: var(--primary-soft);
}

.direct-quote-create > summary span:first-child {
  display: grid;
  gap: 3px;
}

.direct-quote-create > summary strong {
  color: var(--primary-hover);
  font-size: 18px;
}

.direct-quote-create > summary small {
  color: var(--muted);
}

.direct-quote-create > summary span:last-child {
  color: var(--primary);
  font-size: 24px;
  transition: transform 160ms ease;
}

.direct-quote-create[open] > summary span:last-child {
  transform: rotate(45deg);
}

.direct-quote-create-body {
  display: grid;
  gap: 18px;
  padding: 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.direct-quote-create-body .feedback {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
}

.direct-custom-quote-form {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.quote-workbench {
  display: grid;
  grid-template-columns: minmax(250px, 0.34fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}

.quote-request-list {
  max-height: 720px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
  scrollbar-color: var(--surface-strong) transparent;
  scrollbar-width: thin;
}

.quote-request-item {
  display: grid;
  width: 100%;
  gap: 10px;
  padding: 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.quote-request-item:hover {
  background: var(--bg);
}

.quote-request-item[aria-pressed="true"] {
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}

.quote-request-item span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.quote-request-item strong,
.quote-request-item small {
  overflow-wrap: anywhere;
}

.quote-editor {
  min-width: 0;
}

.quote-editor-panel {
  padding: 22px 24px 26px;
}

.quote-editor-heading {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.quote-request-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 16px;
  margin-bottom: 20px;
  color: var(--muted);
}

.quote-request-note strong {
  grid-row: 1 / 3;
  color: var(--ink);
}

.custom-quote-create-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}

.quote-selection-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 16px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
}

.quote-selection-fields legend {
  padding: 0 4px;
  font-weight: 750;
}

.quote-selection-fields small {
  margin-top: 2px;
}

.quote-selection-change {
  margin: 0;
}

.stacked-actions {
  display: grid;
  gap: 8px;
  min-width: 250px;
}

.stacked-actions .inline-form {
  margin-top: 0;
}

.quote-history-actions summary {
  width: fit-content;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--primary-hover);
  font-weight: 700;
  cursor: pointer;
  list-style-position: inside;
}

.quote-history-actions[open] summary {
  margin-bottom: 8px;
  background: var(--primary-soft);
}

@media (max-width: 1120px) {
  .quote-workbench {
    grid-template-columns: 1fr;
  }

  .quote-request-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 300px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .quote-request-item:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  .quote-selection-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@keyframes skeleton-pulse {
  50% {
    opacity: 0.48;
  }
}

@media (max-width: 1280px) {
  .package-card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px 20px;
  }

  .package-form {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: min(290px, 86vw);
    transform: translateX(-101%);
    visibility: hidden;
  }

  .nav-open .sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: block;
    background: oklch(0.2 0.02 270 / 0.3);
    opacity: 0;
    visibility: hidden;
  }

  .nav-open .nav-backdrop {
    opacity: 1;
    visibility: visible;
  }

  .close-nav {
    display: inline-grid;
    place-items: center;
  }

  .workspace {
    margin-left: 0;
  }

  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    min-height: 54px;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    font-weight: 750;
  }

  .content {
    padding: 22px 20px 56px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .span-two {
    grid-column: auto;
  }

  .package-card {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .package-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .package-actions {
    align-items: stretch;
  }

  .case-editor {
    grid-template-columns: 1fr;
  }

  .setup-progress,
  .setup-columns {
    grid-template-columns: 1fr 1fr;
  }

  .setup-progress li:nth-child(2) {
    border-right: 0;
  }

  .setup-progress li:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .case-edit-form {
    grid-template-columns: 1fr;
  }

  .case-editor label,
  .case-editor label:nth-of-type(3),
  .case-editor label:nth-of-type(4),
  .case-editor button {
    grid-column: auto;
  }

}

@media (max-width: 700px) {
  .quote-request-list,
  .quote-selection-fields,
  .custom-quote-create-form {
    grid-template-columns: 1fr;
  }

  .quote-request-item:nth-child(odd) {
    border-right: 0;
  }

  .quote-editor-panel {
    padding: 18px 16px 22px;
  }

  .quote-request-note {
    grid-template-columns: 1fr;
  }

  .quote-request-note strong {
    grid-row: auto;
  }

  .quote-editor-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .setup-create-switcher {
    grid-template-columns: 1fr;
  }

  .setup-scenic-header,
  .setup-store-header,
  .setup-store-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .setup-store-card {
    padding: 16px;
  }

  .setup-resource-action,
  .store-qr-actions,
  .partner-account-action,
  .partner-account-create {
    grid-template-columns: 1fr;
  }

  .setup-resource-action {
    display: grid;
  }

  .setup-store-action .row-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .setup-resource-controls > .button {
    width: 100%;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .page-header > .button {
    align-self: flex-start;
  }

  .metrics-strip {
    grid-template-columns: 1fr 1fr;
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .toolbar,
  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar label,
  .inline-form label {
    width: 100%;
    min-width: 0;
  }

  .form-divider {
    align-self: flex-start;
  }

  .facts,
  .package-form,
  .setup-form,
  .setup-columns,
  .setup-progress {
    grid-template-columns: 1fr;
  }

  .setup-progress li {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .setup-progress li:last-child {
    border-bottom: 0;
  }

  .package-form .row-actions {
    grid-column: auto;
  }

  .package-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .package-price-action {
    justify-items: stretch;
  }

  .package-card {
    padding: 0;
  }

  .package-actions {
    justify-items: stretch;
  }

  .package-actions .validation-note {
    max-width: none;
    text-align: left;
  }

  .package-actions .row-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .package-actions .button {
    width: 100%;
  }

  .table-wrap {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .table-wrap table {
    min-width: 720px;
  }

  .detail-list li {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

.create-panel {
  margin-bottom: 22px;
}

#create-scene-form {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.form-intro h2,
.form-intro p {
  margin-bottom: 4px;
}

.form-intro p,
.scene-summary p,
.media-slot span {
  color: var(--muted);
}

.scene-summary-list {
  display: grid;
  gap: 12px;
}

.scene-summary {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.scene-cover {
  display: grid;
  height: 96px;
  overflow: hidden;
  place-items: center;
  border-radius: 8px;
  background: var(--surface);
  color: var(--primary);
  font-size: 1.8rem;
  font-weight: 800;
}

.scene-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.scene-cover-preview {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.scene-summary-body {
  min-width: 0;
}

.scene-summary-body h2 {
  margin: 0;
}

.scene-summary-body p {
  margin: 6px 0 10px;
}

.scene-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 0.78rem;
}

.scene-editor {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(840px, calc(100vw - 48px));
  align-items: stretch;
}

.scene-readiness {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
}

.scene-readiness strong {
  color: var(--primary);
}

.scene-readiness.is-ready {
  border-left-color: #2f7754;
}

.scene-readiness.is-ready strong {
  color: #2f7754;
}

.scene-drawer-open {
  overflow: hidden;
}

.scene-drawer-backdrop {
  grid-area: 1 / 1 / 2 / 3;
  border: 0;
  background: rgb(35 24 20 / 38%);
  cursor: default;
}

.scene-drawer-panel {
  position: relative;
  grid-area: 1 / 2;
  display: grid;
  min-width: 0;
  height: 100vh;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--bg);
  box-shadow: -18px 0 46px rgb(35 24 20 / 16%);
}

.scene-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px 18px;
}

.scene-drawer-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 750;
}

.scene-drawer-header h2,
.scene-drawer-header p {
  margin: 0;
}

.scene-drawer-header h2 {
  font-size: 1.35rem;
}

.scene-drawer-header p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.scene-drawer-close {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.scene-drawer-close:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.scene-editor-tabs {
  display: flex;
  gap: 24px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
}

.scene-editor-tab {
  position: relative;
  padding: 12px 2px 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.scene-editor-tab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
  content: "";
}

.scene-editor-tab.is-selected {
  color: var(--primary);
}

.scene-editor-tab.is-selected::after {
  background: var(--primary);
}

.scene-drawer-content {
  min-height: 0;
  overflow-y: auto;
}

.scene-editor-panel {
  min-height: 100%;
  padding: 26px 28px 0;
}

.scene-settings-form {
  display: grid;
  min-height: 100%;
  align-content: space-between;
}

.scene-settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.scene-system-info {
  grid-column: 1 / -1;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.scene-system-info summary {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.scene-system-info[open] summary {
  margin-bottom: 14px;
}

.scene-visibility-switch {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.scene-visibility-switch > span:first-child {
  display: grid;
  gap: 4px;
}

.scene-visibility-switch small {
  color: var(--muted);
  font-weight: 500;
}

.scene-toggle-control {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
}

.scene-toggle-control input {
  position: absolute;
  opacity: 0;
}

.scene-toggle-control span {
  width: 100%;
  border-radius: 999px;
  background: var(--line);
  transition: background 160ms ease;
}

.scene-toggle-control span::after {
  display: block;
  width: 20px;
  height: 20px;
  margin: 3px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 1px 4px rgb(35 24 20 / 22%);
  content: "";
  transition: transform 160ms ease;
}

.scene-toggle-control input:checked + span {
  background: var(--primary);
}

.scene-toggle-control input:checked + span::after {
  transform: translateX(20px);
}

.scene-toggle-control input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--primary) 25%, transparent);
  outline-offset: 2px;
}

.scene-drawer-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 30px -28px 0;
  padding: 16px 28px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px);
}

.scene-drawer-footer > div {
  display: flex;
  gap: 10px;
}

.scene-save-state {
  color: var(--muted);
  font-size: 0.78rem;
}

.scene-save-state.is-dirty {
  color: var(--primary);
}

.scene-save-state.is-saved {
  color: #27734f;
}

.product-style-editor {
  display: grid;
  gap: 18px;
}

.product-style-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.product-style-option {
  display: grid;
  min-width: 0;
  min-height: 64px;
  align-content: center;
  gap: 3px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.product-style-option span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.product-style-option:hover {
  border-color: var(--primary);
}

.product-style-option:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 25%, transparent);
  outline-offset: 2px;
}

.product-style-option.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.product-style-panel {
  display: grid;
  gap: 16px;
}

.style-subsection {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.style-subsection h4,
.style-subsection p {
  margin: 0;
}

.media-slot-inherited {
  align-content: start;
  border-style: dashed;
  background: var(--canvas);
}

.media-slot-inherited p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.media-slot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.media-slot {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.media-slot > div {
  display: grid;
  gap: 2px;
}

.media-slot-preview {
  position: relative;
  display: grid;
  min-height: 150px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.media-slot-preview img {
  width: 100%;
  height: 150px;
  object-fit: contain;
}

.media-preview-fallback {
  padding: 14px;
  color: var(--muted);
  text-align: center;
}

.span-2 {
  grid-column: span 2;
}

@media (max-width: 760px) {
  .scene-summary {
    grid-template-columns: 92px 1fr;
  }

  .scene-summary > .button {
    grid-column: 1 / -1;
  }

  .scene-cover {
    height: 78px;
  }

  .span-2 {
    grid-column: auto;
  }

  .scene-editor {
    grid-template-columns: 1fr;
  }

  .scene-drawer-backdrop {
    display: none;
  }

  .scene-drawer-panel {
    grid-column: 1;
    border-left: 0;
  }

  .scene-drawer-header,
  .scene-editor-panel {
    padding-right: 18px;
    padding-left: 18px;
  }

  .scene-editor-tabs {
    padding: 0 18px;
  }

  .scene-settings-fields,
  .media-slot-grid {
    grid-template-columns: 1fr;
  }

  .scene-settings-fields .span-2,
  .scene-system-info,
  .scene-visibility-switch {
    grid-column: auto;
  }

  .scene-drawer-footer {
    margin-right: -18px;
    margin-left: -18px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .product-style-switch,
  .package-style-heading {
    grid-template-columns: 1fr;
  }

  .package-style-heading {
    display: grid;
    align-items: start;
  }

  .style-subsection {
    padding: 14px;
  }
}

.dashboard-section {
  margin-bottom: 28px;
}

.overview-panel {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line));
  border-radius: var(--radius);
  background: var(--bg);
}

.overview-head {
  display: grid;
  grid-template-columns: minmax(190px, 0.55fr) minmax(480px, 1.45fr);
  gap: 28px;
  align-items: end;
  padding: 26px;
}

.overview-head > div:first-child { display: grid; gap: 3px; }
.eyebrow { color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.overview-total { font-size: clamp(3rem, 6vw, 5.5rem); line-height: 0.95; font-variant-numeric: tabular-nums; }
.overview-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.overview-summary { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: var(--surface); }
.overview-summary div { display: grid; gap: 2px; padding: 16px 26px; border-right: 1px solid var(--line); }
.overview-summary div:last-child { border-right: 0; }
.overview-summary span { color: var(--muted); font-size: 0.78rem; }
.overview-summary strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }

.task-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stage-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.task-card {
  display: grid;
  min-height: 132px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  text-decoration: none;
}

.task-card:hover {
  border-color: var(--primary);
}

.task-card > span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.task-card strong {
  margin: 4px 0 5px;
  color: var(--ink);
  font-size: 1.85rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(260px, 0.8fr);
  gap: 28px;
  align-items: start;
}

.dashboard-grid-single {
  grid-template-columns: 1fr;
}

.dashboard-orders,
.quick-section {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.dashboard-orders { overflow: hidden; }

.quick-links {
  display: grid;
  gap: 2px;
}

.quick-links a {
  display: grid;
  gap: 2px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.quick-links a:last-child {
  border-bottom: 0;
}

.quick-links span,
.order-link strong {
  color: var(--ink);
  font-weight: 700;
}

.quick-links a:hover span {
  color: var(--primary-hover);
}

.order-link {
  display: grid;
  gap: 2px;
  text-decoration: none;
}

.numeric {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.order-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(150px, 1fr));
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

#orders-result { min-width: 0; max-width: 100%; overflow: hidden; }

.order-table th:first-child {
  min-width: 190px;
}

.order-table th:nth-child(4) {
  min-width: 120px;
}

.order-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  gap: 24px;
  align-items: start;
}

.content:has(.order-detail-page) {
  width: min(1600px, 100%);
}

.order-detail-page {
  width: 100%;
}

.order-main,
.order-aside {
  min-width: 0;
}

.order-aside {
  position: sticky;
  top: 24px;
}

.order-main,
.order-aside {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.order-main .detail-section,
.order-aside .detail-section {
  padding: 22px;
  border-top: 1px solid var(--line);
}

.order-main .detail-section:first-child,
.order-aside .detail-section:first-child {
  border-top: 0;
}

.order-stage-section .material-review-actions,
.order-stage-section .production-actions {
  max-width: 560px;
  margin-top: 16px;
  padding: 16px;
  border-radius: 8px;
  background: var(--surface);
}

.order-workflow {
  display: grid;
  grid-template-columns: repeat(6, minmax(92px, 1fr));
  gap: 0;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.order-workflow-step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.order-workflow-step::before {
  position: absolute;
  top: 15px;
  right: 50%;
  left: -50%;
  height: 2px;
  background: var(--line);
  content: "";
}

.order-workflow-step:first-child::before {
  display: none;
}

.order-workflow-marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
}

.order-workflow-step.is-complete::before,
.order-workflow-step.is-current::before {
  background: var(--primary);
}

.order-workflow-step.is-complete .order-workflow-marker {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.order-workflow-step.is-current {
  color: var(--ink);
}

.order-workflow-step.is-current .order-workflow-marker {
  border-color: var(--primary);
  background: var(--surface);
  color: var(--primary);
}

.current-order-task-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.current-order-task-panel h2,
.current-order-task-panel p {
  margin: 0;
}

.current-order-task-panel p {
  margin-top: 6px;
  color: var(--muted);
}

.current-order-task-panel .material-review-actions,
.current-order-task-panel .production-actions {
  margin-top: 0;
  padding: 0;
  background: transparent;
}

.current-task-actions {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.current-task-actions .inline-form,
.current-task-actions .compact-form,
.current-task-actions .portrait-upload-form {
  width: 100%;
  max-width: none;
  margin-top: 0;
  padding: 0;
  border-top: 0;
  background: transparent;
}

.current-task-actions .material-submit-actions,
.current-task-actions .completion-actions,
.current-task-actions .shipment-actions {
  max-width: 680px;
}

.current-task-owner {
  color: var(--muted);
}

.order-aside .facts {
  grid-template-columns: 1fr;
}

.order-aside .detail-list li {
  align-items: flex-start;
  flex-direction: column;
}

.portrait-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 220px));
  gap: 14px;
  justify-content: start;
}

.portrait-photo-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  max-width: 220px;
}

.portrait-photo-preview {
  display: grid;
  place-items: center;
  width: fit-content;
  max-width: 100%;
  max-height: 220px;
  justify-self: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
}

.portrait-photo-preview img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 220px;
  height: auto;
}

.portrait-photo-meta {
  display: grid;
  gap: 3px;
}

.portrait-photo-meta small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.portrait-photo-card .button {
  justify-self: start;
}

.proof-version-item {
  align-items: stretch;
  flex-direction: column;
  gap: 14px;
}

.proof-version-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.proof-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  width: 100%;
}

.proof-preview-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.proof-image-preview {
  width: fit-content;
  max-height: none;
  min-height: 0;
}

.proof-image-preview img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(70vh, 720px);
  object-fit: contain;
}

.proof-preview-trigger {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: var(--bg);
  color: inherit;
  cursor: zoom-in;
}

.proof-preview-trigger:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.proof-preview-meta {
  display: grid;
  gap: 3px;
}

.proof-preview-meta small {
  color: var(--muted);
}

.proof-preview-card .button {
  justify-self: start;
}

.proof-confirm-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
  width: 100%;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.proof-confirm-form .muted {
  grid-column: 1 / -1;
  margin: 0;
}

.proof-preview-dialog {
  width: min(1100px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100vh - 48px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
}

.proof-preview-dialog::backdrop {
  background: rgb(20 16 14 / 72%);
}

.proof-preview-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.proof-preview-dialog-head h2 {
  margin: 0;
}

.proof-preview-dialog-body {
  display: grid;
  place-items: center;
  height: calc(100vh - 150px);
  padding: 16px;
  overflow: auto;
  background: var(--bg);
}

.proof-preview-dialog-body img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.portrait-upload-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.portrait-upload-form label {
  min-width: 0;
}

.portrait-upload-form label:nth-child(3) {
  grid-column: 1 / -1;
}

.portrait-upload-form input[type="file"] {
  max-width: 100%;
}

.portrait-upload-form .button {
  justify-self: start;
}

.order-timeline-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}

.order-timeline-details summary::-webkit-details-marker {
  display: none;
}

.order-timeline-details summary > span:first-child {
  display: grid;
  gap: 4px;
}

.order-timeline-details summary small {
  color: var(--muted);
  font-weight: 400;
}

.timeline-expand-label {
  color: var(--primary);
  font-weight: 700;
  white-space: nowrap;
}

.order-timeline-details[open] .timeline-expand-label {
  font-size: 0;
}

.order-timeline-details[open] .timeline-expand-label::after {
  content: "收起操作时间线";
  font-size: 14px;
}

.order-timeline-details[open] .timeline {
  margin-top: 20px;
}

@media (max-width: 1080px) {
  .overview-head { grid-template-columns: 1fr; }
  .overview-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .order-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-toolbar label { width: 100%; min-width: 0; }

  .task-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .order-detail-layout {
    grid-template-columns: 1fr;
  }

  .order-aside {
    position: static;
  }

  .order-workflow {
    padding-bottom: 8px;
    overflow-x: auto;
  }

  .current-order-task-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .overview-head { padding: 20px; }
  .overview-filters, .order-toolbar { grid-template-columns: 1fr; }
  .overview-summary div { padding: 14px; }

  .task-grid {
    grid-template-columns: 1fr;
  }

  .task-card {
    min-height: 108px;
  }

  .order-workflow {
    grid-template-columns: repeat(6, minmax(86px, 1fr));
  }

  .portrait-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portrait-photo-card {
    max-width: none;
  }

  .dashboard-orders,
  .quick-section {
    padding: 18px;
  }

  .dashboard-table { min-width: 0 !important; table-layout: fixed; }
  .dashboard-table th:nth-child(2),
  .dashboard-table td:nth-child(2),
  .dashboard-table th:nth-child(4),
  .dashboard-table td:nth-child(4),
  .dashboard-table th:nth-child(5),
  .dashboard-table td:nth-child(5) { display: none; }
  .dashboard-table th:first-child { width: 62%; }

  .order-table { min-width: 0 !important; table-layout: fixed; }
  .order-table th:nth-child(2), .order-table td:nth-child(2),
  .order-table th:nth-child(3), .order-table td:nth-child(3),
  .order-table th:nth-child(5), .order-table td:nth-child(5),
  .order-table th:nth-child(6), .order-table td:nth-child(6) { display: none; }
  .order-table th:first-child { width: 52%; }
  .order-table th:nth-child(4) { width: 30%; }

  .portrait-upload-form {
    grid-template-columns: 1fr;
  }

  .portrait-upload-form label:nth-child(3) {
    grid-column: auto;
  }

  .proof-confirm-form {
    grid-template-columns: 1fr;
  }

  .proof-confirm-form .muted {
    grid-column: auto;
  }

  .proof-preview-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}
