:root {
  color-scheme: dark;
  --bg: #080909;
  --surface: #141515;
  --elevated: #1c1d1c;
  --border: #30302b;
  --text: #f6f0e6;
  --muted: #aba7a0;
  --gold: #e3ac5a;
  --good: #8ac4a0;
  --bad: #e8a094;
  --sidebar-width: 240px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

/* Staging session gate shares the existing dark/gold system. */
.auth-gate { min-height: 100dvh; display: grid; place-items: center; padding: 30px 18px; }
.auth-card { width: min(100%, 510px); padding: 34px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.auth-card > .brand-wordmark { display: inline-block; margin: 0 18px 28px 0; }
.auth-card h1 { font-size: 25px; margin-bottom: 12px; }
.auth-card .field { margin: 16px 0; }
.auth-card form > .button { width: 100%; margin: 5px 0 12px; }
.auth-card p { overflow-wrap: anywhere; }
.auth-card #config-status { color: var(--muted); font-size: 12px; }
.auth-card #gate-message { color: var(--muted); }
.staging-target { padding: 9px 12px; border: 1px solid var(--border); border-radius: 5px; }
.gate-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.session-details { display: grid; grid-template-columns: minmax(90px, .5fr) minmax(0, 1fr); gap: 12px; margin: 20px 0; }
.session-details dt { color: var(--muted); }
.session-details dd { margin: 0; overflow-wrap: anywhere; }
.capability-list { list-style: none; padding: 0; margin: 16px 0 24px; }
.capability-list li { display: flex; gap: 12px; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.capability-list li small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; overflow-wrap: anywhere; }
.capability-list .granted { color: var(--good); }
.read-description { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 14px; }
.staging-write-warning { margin: 0 0 20px; padding: 15px 18px; border: 1px solid #8c6836; border-left: 4px solid var(--gold); border-radius: 6px; background: #292116; color: #f1ce94; font-size: 13px; overflow-wrap: anywhere; }
.staging-write-warning p:last-child { margin-bottom: 0; }
#category-confirm-values { padding: 14px; border: 1px solid var(--border); border-radius: 5px; background: var(--bg); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
#category-confirm-status { color: var(--gold); font-size: 13px; }
button[disabled], input[disabled] { cursor: not-allowed; }
.permission-list:disabled input { opacity: .75; }
@media(max-width: 520px) {
  .auth-card { padding: 24px 20px; }
  .auth-card h1 { font-size: 22px; }
  .topbar-actions { flex-wrap: wrap; }
  .session-details { grid-template-columns: 1fr; gap: 5px; }
  .session-details dd { margin-bottom: 12px; }
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; scrollbar-color: #504b40 var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
body:has(dialog[open]) { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
button svg, .nav-link svg { width: 19px; height: 19px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.25; font-weight: 600; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin-bottom: 12px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
::selection { color: var(--bg); background: var(--gold); }
.muted, .subtle, .help-text { color: var(--muted); }
.help-text { margin: 6px 0 0; font-size: 12px; line-height: 1.6; }
.subtle { font-size: 12px; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.app-shell, #workspace-wrapper { min-height: 100dvh; }
.skip-link {
  position: fixed; top: 12px; left: 16px; z-index: 100;
  padding: 12px 18px; border-radius: 5px; background: var(--gold);
  color: var(--bg); transform: translateY(-160%); font-weight: 600;
}
.skip-link:focus { transform: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; }

/* Navigation stays separate from the customer's menu styles. */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  display: flex; flex-direction: column; width: var(--sidebar-width);
  padding: 28px 16px 18px; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 13px; margin: 0 12px 34px; text-decoration: none; }
.brand-wordmark { color: var(--gold); font: italic 39px/1 Georgia, "Times New Roman", serif; letter-spacing: -2px; }
.brand-caption { display: block; max-width: 100px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.sidebar-caption { margin: 0 15px 12px; color: var(--muted); font-size: 11px; }
.sidebar nav { display: grid; gap: 5px; }
.nav-link {
  display: flex; align-items: center; gap: 13px; min-height: 48px;
  padding: 11px 15px; border: 1px solid transparent; border-radius: 7px;
  color: var(--muted); text-decoration: none; font-weight: 500;
  transition: background-color 160ms, color 160ms, border-color 160ms;
}
.nav-link:hover { background: var(--elevated); color: var(--text); }
.nav-link[aria-current="page"] { color: var(--gold); border-color: #5b4528; background: #282218; }
.sidebar-foot { display: flex; align-items: center; gap: 12px; margin-top: auto; padding: 22px 10px 0; }
.sidebar-foot > div { min-width: 0; }
.sidebar-foot strong { font-size: 12px; font-weight: 500; }
.sidebar-foot > div > span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.sidebar-foot .button { justify-content: flex-start; width: 100%; }
.sidebar-foot p { margin-bottom: 0; }
.avatar {
  display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 1px solid #665032; border-radius: 50%;
  background: #2a241b; color: var(--gold); font-weight: 600; font-size: 13px;
}
#nav-scrim { display: none; }
.workspace { min-width: 0; margin-left: var(--sidebar-width); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex;
  align-items: center; justify-content: space-between; gap: 18px;
  min-height: 82px; padding: 16px 32px; border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; font-weight: 500; }
.topbar-title h2, .topbar-title p { margin: 0; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.topbar .menu-button, .topbar .mobile-menu { display: none; }
.icon-button {
  display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center;
  width: 44px; min-height: 44px; padding: 10px; border: 1px solid var(--border);
  border-radius: 7px; background: transparent; color: var(--text);
}
.icon-button:hover { border-color: #716044; background: var(--elevated); }
.demo-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 29px; padding: 4px 10px; border: 1px solid #5b4528; border-radius: 30px; color: var(--gold); font-size: 11px; font-weight: 600; white-space: nowrap; }
.demo-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.content { width: 100%; max-width: 1600px; margin: 0 auto; padding: 28px 32px 48px; }
.demo-banner { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 28px; padding: 12px 16px; border: 1px solid #554124; border-radius: 7px; background: #1c1913; color: #d9be93; font-size: 12px; line-height: 1.6; }
.demo-banner p { margin: 0; }
.demo-banner svg { width: 17px; height: 17px; margin-top: 2px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin-bottom: 26px; }
.page-heading h1 { margin: 0 0 6px; font-size: clamp(25px, 2.5vw, 31px); letter-spacing: -.7px; }
.page-heading p { margin: 0; color: var(--muted); }
.page-heading-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* Buttons and form controls share comfortable keyboard and touch targets. */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 10px 17px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--elevated); color: var(--text);
  text-decoration: none; font-weight: 600; font-size: 13px; line-height: 1.5;
  transition: background-color 150ms, border-color 150ms, transform 150ms;
}
.button:not(:disabled):hover { background: #292a26; border-color: #6b604d; }
.button:not(:disabled):active, .icon-button:not(:disabled):active { transform: translateY(1px); }
.button.primary { background: var(--gold); border-color: var(--gold); color: #21190e; }
.button.primary:not(:disabled):hover { background: #efbd76; border-color: #efbd76; }
.button.secondary { background: transparent; }
.button.danger { background: #2c1d1b; border-color: #6a4039; color: #f2b6ab; }
.button.danger:not(:disabled):hover { background: #3b2420; border-color: var(--bad); }
.button.small { min-height: 44px; padding: 8px 12px; font-size: 12px; }
button:disabled, input:disabled, select:disabled, textarea:disabled { opacity: .72; cursor: not-allowed; }
label { display: block; margin-bottom: 7px; color: #d7d2c9; font-size: 12px; font-weight: 500; }
input:not([type="checkbox"]):not([type="radio"]), textarea, select {
  display: block; width: 100%; min-width: 0; min-height: 44px; padding: 11px 12px;
  border: 1px solid #48473e; border-radius: 5px; background: #101110; color: var(--text);
  line-height: 1.5; transition: border-color 150ms;
}
input::placeholder, textarea::placeholder { color: #98948b; opacity: 1; }
input:not([type="checkbox"]):focus, textarea:focus, select:focus { border-color: var(--gold); }
textarea { min-height: 105px; resize: vertical; }
select { padding-right: 32px; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--gold); cursor: pointer; flex-shrink: 0; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.translations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.translations > * { min-width: 0; }
.translations .field + .field { margin-top: 14px; }
.language-label { display: block; margin-bottom: 12px; color: var(--gold); font-size: 12px; font-weight: 600; }
.switch, label.switch { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; font-size: 13px; }
.switch label { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; }
.form-error { margin: 12px 0; padding: 10px 12px; border-left: 2px solid var(--bad); background: #2c1d1b; color: #f2b6ab; font-size: 13px; }
.mock-note { padding: 12px 14px; border: 1px dashed #645335; border-radius: 5px; background: #1d1a14; color: #d9be93; font-size: 12px; line-height: 1.65; }

/* Overview and shared panels. */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 26px; }
.stat-card { min-width: 0; padding: 21px 23px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.stat-label svg { width: 18px; height: 18px; color: var(--gold); }
.stat-value { display: block; margin: 0 0 5px; font-size: 32px; font-weight: 600; line-height: 1.15; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.stat-note { margin: 0; color: var(--muted); font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; gap: 24px; }
.dashboard-grid > *, .settings-grid > * { min-width: 0; }
.panel { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.panel + .panel { margin-top: 22px; }
.dashboard-grid > .panel + .panel { margin-top: 0; }
.panel-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; min-height: 66px; padding: 17px 22px; border-bottom: 1px solid var(--border); }
.panel-header h2, .panel-header h3, .panel-header p { margin: 0; }
.panel-body { padding: 22px; }
.panel-body > :last-child { margin-bottom: 0; }
.toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.search-field { flex: 1 1 220px; min-width: 0; }
.search-field label, .filter-field label { color: var(--muted); }
.filter-field { flex: 0 1 180px; min-width: 135px; }
.search-field input { width: 100%; }
.activity-list, .readiness-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.activity-item { display: flex; align-items: flex-start; gap: 13px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.activity-item:first-child { padding-top: 0; }
.activity-item:last-child { padding-bottom: 0; border-bottom: 0; }
.activity-item p { margin: 0 0 3px; font-size: 13px; }
.activity-item time, .activity-item small { color: var(--muted); font-size: 11px; }
.activity-dot { flex-shrink: 0; width: 7px; height: 7px; margin-top: 7px; border-radius: 50%; background: var(--gold); }
.readiness-list li { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; color: var(--muted); font-size: 13px; }
.readiness-list svg { width: 18px; height: 18px; color: var(--good); }
.quick-actions { display: grid; gap: 10px; }
.quick-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 6px; background: var(--elevated); color: var(--text); text-align: left; text-decoration: none; }
.quick-action:hover { border-color: #716044; }
.quick-action svg { width: 19px; height: 19px; color: var(--gold); }

/* Tables scroll within their panel instead of widening the page. */
.table-scroll { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.data-table th { padding: 13px 20px; border-bottom: 1px solid var(--border); background: #181918; color: var(--muted); font-size: 11px; font-weight: 500; white-space: nowrap; }
.data-table td { padding: 16px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #1a1b18; }
.data-table td:first-child { min-width: 210px; }
.data-table .row-actions { flex-wrap: nowrap; }
.product-cell { display: flex; align-items: center; gap: 13px; min-width: 0; }
.thumb, img.thumb { flex-shrink: 0; width: 54px; height: 44px; border: 1px solid var(--border); border-radius: 6px; object-fit: cover; background: var(--elevated); }
.cell-title { display: block; color: var(--text); font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.cell-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.status { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 4px 9px; border: 1px solid var(--border); border-radius: 30px; color: var(--muted); font-size: 10px; font-weight: 600; white-space: nowrap; }
.status.available { background: #192a21; border-color: #315240; color: var(--good); }
.status.unavailable { background: #2b201e; border-color: #5c3d36; color: var(--bad); }
.status.draft { background: #292419; border-color: #5a4b2f; color: var(--gold); }
.row-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 8px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--gold); text-decoration: none; font-size: 12px; }
.text-button:hover { border-color: #55472f; background: #272219; }
.text-button.danger { color: var(--bad); }
.text-button.danger:hover { border-color: #6a4039; background: #2c1d1b; }
.empty-state { padding: 52px 24px; text-align: center; color: var(--muted); }
.empty-state svg { width: 34px; height: 34px; margin: 0 auto 16px; color: var(--gold); }
.empty-state h2, .empty-state h3 { margin-bottom: 8px; color: var(--text); }
.empty-state p { max-width: 46ch; margin: 0 auto 18px; }

/* Categories, images, people, and settings use the same quiet hierarchy. */
.category-grid, .staff-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.category-card, .staff-card { min-width: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.category-card header, .staff-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.category-card h2, .category-card h3, .staff-card h2, .staff-card h3 { margin: 0 0 5px; overflow-wrap: anywhere; }
.category-card header > svg { width: 26px; height: 26px; color: var(--gold); }
.category-card .row-actions { justify-content: space-between; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.category-card p, .staff-card p { color: var(--muted); font-size: 12px; }
.order-controls { display: inline-flex; align-items: center; gap: 4px; }
.order-controls .icon-button { width: 44px; min-height: 44px; padding: 10px; }
.order-controls span { min-width: 26px; color: var(--muted); text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.image-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.image-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.image-preview { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--elevated); border-bottom: 1px solid var(--border); }
.image-body { padding: 17px; }
.image-body h3 { margin-bottom: 6px; overflow-wrap: anywhere; }
.image-body .row-actions { justify-content: flex-start; margin-top: 12px; }
.image-body .cell-meta { overflow-wrap: anywhere; }
.permission-list { display: grid; gap: 4px; margin-top: 16px; }
.permission-list label { display: flex; align-items: center; gap: 11px; min-height: 44px; margin: 0; padding: 8px 0; font-size: 13px; }
.permission-list input { accent-color: var(--gold); }
.staff-card .row-actions { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 24px; }
.settings-grid .panel + .panel { margin-top: 0; }
.settings-grid .field + .field { margin-top: 18px; }
.settings-grid .form-grid .field + .field { margin-top: 0; }

/* Native dialogs retain browser focus trapping and Escape handling. */
.editor-dialog, .confirm-dialog {
  width: min(900px, calc(100% - 40px)); max-width: 900px;
  max-height: calc(100dvh - 48px); margin: auto; padding: 0;
  overflow: auto; overscroll-behavior: contain;
  border: 1px solid #5b513e; border-radius: 10px; background: var(--surface);
  color: var(--text); box-shadow: 0 24px 90px #0008;
}
.confirm-dialog { width: min(460px, calc(100% - 40px)); max-width: 460px; }
.editor-dialog::backdrop, .confirm-dialog::backdrop { background: #000b; }
.editor-dialog[open], .confirm-dialog[open] { animation: dialog-enter 160ms ease-out; }
.dialog-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.dialog-header h2, .dialog-header h3, .dialog-header p { margin: 0; }
.dialog-body { padding: 24px; }
.dialog-body > .form-grid + *, .dialog-body > .translations + * { margin-top: 22px; }
.dialog-body > :last-child { margin-bottom: 0; }
.dialog-footer { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface); }
.notification, #notificationtoast {
  position: fixed; inset: auto 26px 26px auto; z-index: 80;
  width: max-content; max-width: min(430px, calc(100vw - 32px));
  padding: 14px 18px; border: 1px solid #6a5434; border-radius: 7px;
  background: #282219; color: var(--text); box-shadow: 0 8px 35px #0006;
  opacity: 0; transform: translateY(10px); visibility: hidden; pointer-events: none;
  transition: opacity 160ms, transform 160ms, visibility 160ms;
}
.notification.show, #notificationtoast.show { opacity: 1; transform: none; visibility: visible; }
.signed-out, #signed-out { min-height: 100dvh; padding: 24px; }
.signed-out { display: grid; place-items: center; }
.signed-out-card { width: min(100%, 430px); margin: auto; padding: 40px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); text-align: center; }
.signed-out-card .brand { justify-content: center; margin: 0 0 28px; }
.signed-out-card h1 { font-size: 25px; letter-spacing: -.5px; }
.signed-out-card p { color: var(--muted); }
.signed-out-card .button { width: 100%; margin-top: 12px; }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* Generated views retain the shared panel structure, with no doubled spacing. */
.category-grid > .panel + .panel,
.image-grid > .panel + .panel,
.staff-grid > .panel + .panel { margin-top: 0; }
.dashboard-grid + .dashboard-grid { margin-top: 24px; }
.panel-header > div > p { margin-top: 4px; font-size: 11px; }
.panel > .activity-list, .panel > .readiness-list { padding: 22px; }
.activity-item strong { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 500; }
.activity-item p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.quick-actions { padding: 18px; }
.quick-action > span { flex: 1; min-width: 0; }
.quick-action strong { display: block; font-size: 13px; font-weight: 500; }
.quick-action small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.quick-action > svg:last-child { width: 16px; height: 16px; color: var(--muted); }
.search-field { position: relative; }
.search-field > .icon { position: absolute; bottom: 13px; left: 13px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-field input[type="search"] { padding-left: 40px; }
.results-meta { padding: 12px 22px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.empty-actions { display: flex; justify-content: center; margin-top: -24px; padding: 0 24px 32px; }
.danger-text { color: var(--bad); }
.icon-button.danger-text:hover { border-color: #6a4039; background: #2c1d1b; }
.category-icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #584328; border-radius: 8px; background: #282218; color: var(--gold); }
.category-count { margin: 18px 0 0; font-weight: 500; }
.category-card .order-controls { display: block; margin-top: 20px; }
.category-card .order-controls > div { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.category-card .order-controls input[type="number"] { flex: 0 0 56px; width: 56px; padding: 8px 4px; text-align: center; appearance: textfield; }
.order-controls input::-webkit-inner-spin-button { margin: 0; appearance: none; }
.storage-note { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 24px; }
.storage-note > .icon { margin-top: 2px; }
.storage-note strong { font-size: 13px; font-weight: 500; }
.storage-note p { margin: 4px 0 0; }
.image-body h2 { margin-bottom: 6px; font-size: 15px; }
.image-path { margin: 14px 0; color: var(--muted); font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.staff-card .panel-header { align-items: center; flex-wrap: nowrap; gap: 10px; }
.staff-heading { display: flex; align-items: center; gap: 11px; min-width: 0; }
.staff-heading > div { min-width: 0; }
.staff-heading h2 { font-size: 14px; }
.staff-heading .avatar { width: 34px; height: 34px; font-size: 11px; }
.staff-card .permission-list { margin: 0 0 20px; }
.permission-list legend { margin-bottom: 10px; color: var(--muted); font-size: 11px; }
.permission-list .permission-option { justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.permission-option > span { min-width: 0; }
.permission-option strong { display: block; font-size: 12px; font-weight: 500; }
.permission-option small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.staff-card .panel-body > form > .button { width: 100%; }
.staff-status-action { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.staff-status-action > .button { width: 100%; }
.staff-status-action .help-text { margin-top: 10px; font-size: 11px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 14px; }
.settings-grid form > .button { margin-top: 20px; }

/* Independent metadata, price, visibility, and image forms remain legible. */
.dialog-header > div { min-width: 0; }
.dialog-header h2 { overflow-wrap: anywhere; }
.dialog-header p.muted { max-width: 65ch; margin-top: 5px; font-size: 11px; line-height: 1.6; }
.dialog-body h3 { margin: 0 0 16px; font-size: 14px; }
.translations fieldset { padding: 15px; border: 1px solid var(--border); border-radius: 6px; background: #111211; }
.translations legend { padding: 0 7px; color: var(--gold); font-size: 12px; }
.translations + .form-grid { margin-top: 22px; }
.field-label { display: block; margin-bottom: 7px; color: #d7d2c9; font-size: 12px; font-weight: 500; }
.field-label + p { min-height: 44px; margin: 0; padding: 11px 12px; border: 1px solid var(--border); border-radius: 5px; background: var(--elevated); font-size: 13px; }
.dialog-section-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.dialog-body > form + .mock-note { margin-top: 24px; }
.product-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.product-controls > * { display: flex; flex-direction: column; min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: 6px; background: #111211; }
.product-controls .help-text { margin-bottom: 16px; font-size: 11px; }
.product-controls button { align-self: flex-start; margin-top: auto; }
.product-controls .image-path { margin-top: 0; }
.editor-thumbnail { width: 160px; height: 100px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--elevated); object-fit: cover; }
.check-label { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 0 4px; font-size: 13px; cursor: pointer; }
.separated-form { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--border); }
.separated-form > .button { margin-top: 18px; }
.image-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 24px; }
.image-editor > * { min-width: 0; }
.image-editor .image-preview { border: 1px solid var(--border); border-radius: 6px; }
.image-editor label[for="local-image"] { margin-top: 18px; }
.image-editor input[type="file"] { padding: 8px; font-size: 11px; }
.image-editor input::file-selector-button { min-height: 44px; margin-right: 10px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 4px; background: var(--elevated); color: var(--text); font: inherit; cursor: pointer; }
.image-editor .mock-note { margin-top: 20px; }
.editor-notice {
  position: sticky; bottom: 0; z-index: 3; margin: 0; padding: 16px 24px;
  border-top: 1px solid #466953; background: #18251d; color: #c2dbc9;
  font-size: 12px; line-height: 1.6; overflow-wrap: anywhere;
}

@media (max-width: 1250px) {
  .category-grid, .staff-grid, .image-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { gap: 12px; }
  .stat-card { padding: 19px 17px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; }
  .data-table th, .data-table td { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 1050px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-grid > .panel + .panel { margin-top: 0; }
  .translations { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

@media (max-width: 900px) {
  .sidebar { width: min(280px, calc(100vw - 60px)); transform: translateX(-100%); transition: transform 180ms ease; }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open #nav-scrim { position: fixed; inset: 0; z-index: 35; display: block; width: 100%; height: 100dvh; padding: 0; border: 0; background: #000a; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 74px; padding: 14px 24px; }
  .topbar .menu-button, .topbar .mobile-menu { display: inline-flex; }
  .content { padding: 24px 24px 40px; }
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .topbar { min-height: 72px; gap: 10px; padding: 12px 16px; }
  .topbar-title { gap: 10px; font-size: 13px; }
  .topbar-title h2 { font-size: 14px; }
  .topbar-actions { gap: 8px; }
  .topbar-actions .button { padding: 9px 11px; font-size: 11px; white-space: nowrap; }
  .demo-pill { padding: 4px 8px; font-size: 10px; }
  .content { padding: 20px 16px 36px; }
  .demo-banner { margin-bottom: 24px; padding: 12px; font-size: 11px; }
  .page-heading { align-items: flex-start; gap: 16px; margin-bottom: 22px; }
  .page-heading h1 { font-size: 26px; }
  .page-heading p { font-size: 12px; }
  .page-heading-actions { width: 100%; }
  .page-heading-actions .button { flex: 1; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 20px; }
  .stat-card { padding: 17px 15px; }
  .stat-label { margin-bottom: 15px; font-size: 11px; }
  .stat-value { font-size: 29px; }
  .stat-note { font-size: 10px; }
  .dashboard-grid, .settings-grid { gap: 18px; }
  .panel-header { min-height: 60px; padding: 15px 17px; }
  .panel-body { padding: 18px 17px; }
  .toolbar { align-items: stretch; gap: 12px; padding: 16px 17px; }
  .search-field { flex-basis: 100%; }
  .filter-field { flex: 1 1 120px; min-width: 0; }
  .data-table { min-width: 680px; }
  .data-table th, .data-table td { padding: 13px 16px; }
  .category-grid, .staff-grid, .image-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .quick-actions { padding: 16px; }
  .panel > .activity-list, .panel > .readiness-list { padding: 18px 17px; }
  .results-meta { padding-inline: 17px; }
  .product-controls, .image-editor { grid-template-columns: minmax(0, 1fr); }
  .product-controls { gap: 15px; }
  .dialog-section-actions .button { flex: 1; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .editor-dialog, .confirm-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); border-radius: 8px; }
  .dialog-header { padding: 15px 17px; }
  .dialog-body { padding: 20px 17px; }
  .editor-notice { padding: 14px 17px; }
  .dialog-footer { padding: 14px 17px; }
  .dialog-footer .button { flex: 1; }
  .notification, #notificationtoast { right: 16px; bottom: 16px; left: 16px; width: auto; max-width: none; }
  .signed-out-card { padding: 30px 23px; }
}

@media (max-width: 520px) {
  .topbar-actions .demo-pill { display: none; }
  .topbar-title > span { white-space: nowrap; }
}

@media (max-width: 380px) {
  .topbar-actions .button { gap: 5px; padding-inline: 9px; }
  .topbar-actions .button svg { width: 15px; height: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.catalog-action-select { width: auto; min-width: 145px; max-width: 200px; padding: 8px 28px 8px 10px; font-size: .8rem; }
.category-card .row-actions { flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.refresh-status-slot { min-height: 22px; margin-top: -12px; margin-bottom: 8px; }
.refresh-status { color: var(--gold); font-size: 12px; }
.refresh-status::before { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 7px 1px 0; border-radius: 50%; background: currentColor; }
.language-switcher { display: inline-flex; flex-shrink: 0; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); }
.language-switcher button { border: 0; border-radius: 3px; padding: 6px 8px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; }
.language-switcher button[aria-pressed="true"] { background: var(--gold); color: var(--bg); }
.auth-card > .language-switcher, .signed-out-card > .language-switcher { float: right; margin-bottom: 12px; }
#editor-content > .language-switcher { margin: 14px 22px 0; }
.dialog-header { flex-wrap: wrap; }
.topbar { flex-wrap: wrap; gap: 8px; }
.button, .text-button, .page-heading h1, .panel h2 { overflow-wrap: anywhere; }
.localized-description { white-space: pre-wrap; }
@media (max-width: 700px) { .topbar-actions { margin-left: auto; } .topbar-title > span { display: none; } .language-switcher button { padding: 6px; } }
