:root {
  color-scheme: light;
  --ink: #242128;
  --muted: #6c6470;
  --pink: #efcddd;
  --paper: #f7f5f7;
  --surface: #fff;
  --surface-subtle: #faf8fa;
  --input: #fff;
  --line: #e6e0e6;
  --field-line: #d9d1d9;
  --dark: #1d1a21;
  --primary: #1d1a21;
  --primary-ink: #fff;
  --primary-hover: #3b303b;
  --tone: #854568;
  --focus: #a65382;
  --hover: #f1e8ee;
  --badge: #f4e3ee;
  --pill: #f3edf3;
  --notice: #fbecf4;
  --notice-line: #d8b9cb;
  --danger: #a31c3b;
  --error: #fff2f5;
  --error-line: #eab7c3;
  --image: #f0eaf0;
  --auth-start: #f4e1eb;
  --auth-end: #f8f7f9;
  --card-shadow: 0 16px 60px #3222350c;
  --menu-shadow: 0 10px 30px #3222351f;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --ink: #f3edf4;
  --muted: #b9afbf;
  --paper: #151218;
  --surface: #211c25;
  --surface-subtle: #28212d;
  --input: #1b171f;
  --line: #403647;
  --field-line: #5a4c63;
  --primary: #efcddd;
  --primary-ink: #281e26;
  --primary-hover: #f7ddec;
  --tone: #efbdd8;
  --focus: #e9acd0;
  --hover: #382d3e;
  --badge: #402d3b;
  --pill: #352a3b;
  --notice: #352330;
  --notice-line: #73566b;
  --danger: #ffa5b8;
  --error: #3e222e;
  --error-line: #8b4b61;
  --image: #302835;
  --auth-start: #302030;
  --auth-end: #17131b;
  --card-shadow: 0 16px 60px #0004;
  --menu-shadow: 0 10px 30px #0006;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; color: var(--ink); background: var(--paper); }
a { color: inherit; }
button, .button { border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .button:hover { border-color: var(--tone); }
button:focus-visible, .button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .55; }
.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--field-line); border-radius: 7px; background: var(--input); font: inherit; color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--tone); }
input[type=file]::file-selector-button { margin-right: 12px; padding: 6px 10px; border: 1px solid var(--field-line); border-radius: 5px; background: var(--surface-subtle); color: var(--ink); font: inherit; cursor: pointer; }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
form p { margin: 0 0 18px; }
.errorlist { color: var(--danger); padding-left: 20px; font-size: 13px; }
.helptext, .muted { color: var(--muted); }
.small { font-size: 12px; }
.eyebrow { font-size: 10px; letter-spacing: .16em; font-weight: 700; color: var(--muted); }
.wordmark { font-weight: 900; font-size: 22px; letter-spacing: -.7px; text-decoration: none; }
h1 { font-size: 34px; line-height: 1.2; letter-spacing: -1px; margin: 8px 0 10px; }
h2 { font-size: 18px; margin: 0 0 18px; }
p { margin: 0 0 18px; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 90px 0 40px; background: linear-gradient(135deg, var(--auth-start), var(--auth-end) 60%); }
.auth-card { background: var(--surface); width: min(440px, calc(100% - 40px)); padding: 42px; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--card-shadow); }
.auth-card h1 { font-size: 28px; margin-top: 32px; }
.auth-card button { width: 100%; margin-bottom: 18px; }
.auth-card .small { margin: 28px 0 0; }
.sidebar { width: 235px; background: var(--dark); color: #f6ebf1; position: fixed; inset: 0 auto 0 0; padding: 30px 22px; display: flex; flex-direction: column; }
.sidebar .wordmark { color: var(--pink); font-size: 20px; }
.sidebar .eyebrow { color: #aaa0ae; font-size: 9px; margin-top: 5px; }
.sidebar nav { margin: 28px -8px; display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a { padding: 10px 14px; border-radius: 7px; text-decoration: none; color: #d9d0de; font-size: 14px; }
.sidebar nav a:hover { background: #ffffff12; color: #fff; }
.sidebar nav span { font-size: 9px; letter-spacing: .14em; color: #b1a5b6; padding: 24px 14px 8px; }
.sidebar > form { margin-top: auto; }
.quiet { background: transparent; color: inherit; border: 0; }
.app-main { margin-left: 235px; }
.topbar { min-height: 66px; border-bottom: 1px solid var(--line); background: var(--surface); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding: 10px 36px; font-size: 12px; color: var(--muted); }
.topbar-account { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 16px; min-width: 0; margin-left: auto; }
.topbar-account > span { min-width: 0; overflow-wrap: anywhere; }
.page { max-width: 1450px; padding: 36px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; margin: 24px 0; }
.grid-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); padding: 14px 0; }
.list-row p { font-size: 12px; color: var(--muted); margin: 5px 0; }
.badge { padding: 4px 8px; border-radius: 5px; background: var(--badge); font-size: 11px; }
.notice { border: 1px solid var(--notice-line); background: var(--notice); padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; }
.page-heading, .section-title { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.page-heading > div { min-width: 0; }
.search { display: flex; gap: 10px; max-width: 560px; margin: 24px 0; }
.table-panel { overflow: auto; padding: 0; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; text-transform: uppercase; letter-spacing: .05em; font-size: 10px; color: var(--muted); background: var(--surface-subtle); }
th, td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
td a { font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px 24px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 20px; margin-top: 24px; }
.product-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; }
.product-image { height: 220px; background: var(--image); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.product-image img { width: 100%; height: 100%; object-fit: contain; }
.product-meta { padding: 20px; }
.product-meta p { margin: 6px 0; }
.color-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; gap: 12px; margin-bottom: 12px; }
.brand-crop { display: block; width: 190px; height: 44px; overflow: hidden; position: relative; }
.brand-crop img { position: absolute; width: 226px; max-width: none; left: -18px; top: -197px; }
.field { margin-bottom: 18px; }
details { margin: 16px 0; }
summary { cursor: pointer; font-weight: 600; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 45px; text-align: center; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 24px 0; }
.metric { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; }
.metric strong { display: block; font-size: 25px; margin: 8px 0; }
.danger { color: var(--danger); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.error { border-color: var(--error-line); background: var(--error); }
.pill { padding: 4px 9px; border-radius: 999px; background: var(--pill); font-size: 11px; white-space: nowrap; }

/* Controls adapted from @thehappieco/shell; see static/vendor/shell/NOTICE. */
.site-controls { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; }
.theme-toggle, .language-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; min-width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.theme-toggle { width: 44px; }
.language-toggle { gap: 4px; padding: 0 7px 0 10px; }
.theme-toggle:hover, .language-toggle:hover, .language-toggle[aria-expanded='true'] { background: var(--hover); color: var(--ink); }
.theme-toggle:focus-visible, .language-toggle:focus-visible, .language-option:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.theme-icon { display: none; width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon .theme-fill { fill: currentColor; }
html:not([data-theme-preference]) .theme-icon[data-icon='system'],
html[data-theme-preference='system'] .theme-icon[data-icon='system'],
html[data-theme-preference='light'] .theme-icon[data-icon='light'],
html[data-theme-preference='dark'] .theme-icon[data-icon='dark'] { display: block; }
.language-control { position: relative; display: inline-flex; flex: 0 0 auto; max-width: 100%; }
.language-flag { display: inline-flex; flex: 0 0 auto; width: 22px; height: 17px; align-items: center; justify-content: center; }
.language-flag svg { display: block; width: 22px; height: 17px; }
.control-chevron, .control-check { width: 14px; height: 14px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.control-chevron { transition: transform 160ms ease; }
.language-toggle[aria-expanded='true'] .control-chevron { transform: rotate(180deg); }
.language-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; display: flex; flex-direction: column; gap: 2px; width: 13.5rem; max-width: calc(100vw - 32px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--menu-shadow); transform-origin: top right; }
.language-menu li, .language-menu form { margin: 0; padding: 0; }
.language-option { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; margin: 0; padding: 6px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 550; line-height: 1.3; text-align: left; cursor: pointer; }
.language-option:hover, .language-option:focus { background: var(--hover); }
.language-option[aria-checked='true'] { color: var(--tone); font-weight: 650; }
.language-option .control-check { margin-left: auto; }
.language-option[aria-checked='false'] .control-check { visibility: hidden; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.auth-controls { position: absolute; top: 22px; right: 28px; }

@media (min-width: 900px) {
  .theme-toggle { width: 36px; }
  .theme-toggle, .language-toggle { height: 36px; min-width: 36px; }
  .language-option { min-height: 36px; }
}
@media (max-width: 1100px) and (min-width: 801px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .sidebar { position: static; width: auto; padding: 18px; }
  .sidebar nav { flex-direction: row; overflow: auto; margin: 12px 0; }
  .sidebar nav span { display: none; }
  .sidebar nav a { white-space: nowrap; }
  .sidebar > form { position: absolute; right: 18px; top: 14px; }
  .app-main { margin-left: 0; }
  .topbar { padding: 8px 18px; min-height: 60px; }
  .page { padding: 24px 18px; }
  .grid-two { grid-template-columns: minmax(0, 1fr); gap: 0; }
  h1 { font-size: 28px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .page-heading { align-items: flex-start; flex-wrap: wrap; }
  .page-heading h1 { font-size: 25px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-crop { width: 190px; }
  th, td { padding: 12px; }
  .color-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .auth-controls { top: 16px; right: 18px; }
}
@media (max-width: 480px) {
  .topbar-account { width: 100%; justify-content: space-between; gap: 8px; }
  .topbar-account > span { flex: 1; }
  .auth-card { padding: 28px; }
  .metric { padding: 16px; }
  .metric strong { font-size: 22px; }
  .list-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .control-chevron { transition: none; }
}
@media (forced-colors: active) {
  .language-option[aria-checked='true'] { outline: 2px solid Highlight; outline-offset: -2px; }
}
