:root {
  --paper: #eef1f5;
  --paper-raised: #f8fafc;
  --ink: #17223a;
  --ink-muted: #566177;
  --blue: #1746d1;
  --blue-soft: #dce5ff;
  --coral: #b9362c;
  --line: #cfd5df;
  --telegram-bg: var(--tg-theme-bg-color, #eef1f5);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--telegram-bg);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { max-width: 100%; background: var(--paper); overflow: hidden; }
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(23, 70, 209, .35); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
  height: 100dvh;
  background: var(--paper-raised);
}
.workspace[hidden] { display: none; }

.inbox {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-right: 1px solid var(--line);
}

.topbar {
  min-height: 108px;
  padding: 22px 22px 18px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  background: var(--blue);
  color: white;
  box-shadow: 0 10px 28px rgba(23, 70, 209, .18);
}
.brand { margin: 0 0 3px; font-size: 12px; font-weight: 700; opacity: .76; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 34px; line-height: 1; letter-spacing: -.025em; }
.agent { align-self: flex-start; max-width: 135px; padding-top: 3px; text-align: right; font-size: 12px; line-height: 1.3; opacity: .85; }

.queue-tools { padding: 16px 16px 13px; background: var(--paper); }
.search { position: relative; display: block; }
.search svg { position: absolute; left: 13px; top: 50%; width: 18px; fill: none; stroke: var(--ink-muted); stroke-width: 1.8; transform: translateY(-50%); }
.search input {
  width: 100%; height: 44px; padding: 0 14px 0 41px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper-raised); color: var(--ink);
}
.search input::placeholder { color: #5e687d; }
.filters { display: flex; gap: 4px; margin-top: 11px; }
.filter { min-height: 34px; padding: 0 13px; border: 0; border-radius: 9px; background: transparent; font-size: 13px; font-weight: 650; cursor: pointer; }
.filter:hover { background: #e3e7ed; }
.filter.is-active { background: var(--ink); color: white; }
.queue-heading { display: flex; justify-content: space-between; padding: 7px 19px 9px; color: var(--ink-muted); font-size: 12px; font-weight: 750; }
.queue-heading strong { min-width: 24px; text-align: right; color: var(--blue); }

.ticket-list { min-height: 0; overflow-y: auto; padding: 0 9px 18px; }
.ticket {
  position: relative; width: 100%; padding: 15px 13px 16px; display: grid; grid-template-columns: 46px minmax(0,1fr) auto;
  gap: 12px; border: 0; border-bottom: 1px dashed #bcc4d1; background: transparent; text-align: left; cursor: pointer;
}
.ticket::after { content: ""; position: absolute; right: -9px; bottom: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--paper); }
.ticket:hover { background: rgba(255,255,255,.54); }
.ticket.is-active { background: var(--paper-raised); box-shadow: 3px 5px 16px rgba(27,38,62,.08); }
.avatar { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--blue-soft); color: var(--blue); font-family: Georgia, serif; font-size: 18px; font-weight: 700; }
.ticket-main { min-width: 0; }
.ticket-name { display: flex; align-items: center; gap: 7px; font-weight: 760; }
.ticket-id { color: var(--ink-muted); font-size: 11px; font-weight: 600; }
.ticket-preview { margin: 5px 0 0; color: var(--ink-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-side { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; color: var(--ink-muted); font-size: 11px; }
.new-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--coral); box-shadow: 0 2px 7px rgba(217,78,63,.4); }

.conversation { min-width: 0; position: relative; background-color: #e7ebf1; background-image: radial-gradient(#c9ced8 0.7px, transparent 0.7px); background-size: 17px 17px; }
.empty-chat { height: 100%; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--ink-muted); }
.empty-mark { width: 64px; height: 64px; display: grid; place-items: center; border: 1px dashed #aeb7c6; border-radius: 16px; color: var(--blue); font: 38px Georgia, serif; transform: rotate(-3deg); }
.empty-chat h2 { margin: 18px 0 6px; color: var(--ink); font: 700 25px Georgia, serif; }
.empty-chat p { margin: 0; font-size: 14px; }
.chat-shell { height: 100%; display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.chat-header { min-height: 76px; padding: 13px 22px; display: flex; align-items: center; gap: 12px; background: rgba(248,250,252,.96); border-bottom: 1px solid var(--line); }
.chat-person { min-width: 0; display: flex; flex-direction: column; }
.chat-person strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-person span { margin-top: 3px; color: var(--ink-muted); font-size: 12px; }
.status-stamp { margin-left: auto; padding: 5px 9px 4px; border: 1px solid currentColor; border-radius: 7px; color: var(--coral); font-size: 11px; font-weight: 800; transform: rotate(-2deg); }
.status-stamp.closed { color: #24765a; transform: rotate(1deg); }
.back { display: none; width: 38px; height: 38px; border: 0; background: transparent; font-size: 24px; cursor: pointer; }
.messages { min-height: 0; overflow-y: auto; padding: 28px clamp(18px, 5vw, 70px); }
.day-marker { width: fit-content; margin: 0 auto 20px; padding: 5px 10px; border-radius: 8px; background: rgba(255,255,255,.8); color: var(--ink-muted); font-size: 11px; }
.message { max-width: min(610px, 82%); margin-bottom: 10px; padding: 12px 14px 10px; border-radius: 15px 15px 15px 4px; background: var(--paper-raised); box-shadow: 2px 5px 14px rgba(24,37,63,.08); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.support { margin-left: auto; border-radius: 15px 15px 4px 15px; background: var(--blue); color: white; box-shadow: 2px 6px 16px rgba(23,70,209,.19); }
.message time { display: block; margin-top: 5px; color: var(--ink-muted); font-size: 10px; text-align: right; }
.message.support time { color: #cbd7ff; }
.composer { padding: 14px 18px calc(12px + var(--safe-bottom)); display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; background: var(--paper-raised); border-top: 1px solid var(--line); }
.composer textarea { min-height: 46px; max-height: 130px; resize: none; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); line-height: 1.35; }
.composer button { align-self: end; min-height: 46px; padding: 0 17px; border: 0; border-radius: 12px; background: var(--blue); color: white; font-weight: 760; cursor: pointer; box-shadow: 2px 5px 13px rgba(23,70,209,.25); }
.composer button:hover { background: #123bb5; }
.composer button:disabled { opacity: .55; cursor: wait; }
.composer-note { grid-column: 1 / -1; margin: -2px 2px 0; color: var(--ink-muted); font-size: 10px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + var(--safe-bottom)); z-index: 10; padding: 11px 15px; border-radius: 11px; background: var(--ink); color: white; font-size: 13px; box-shadow: 3px 8px 20px rgba(12,20,38,.22); transform: translate(-50%, 130px); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.toast.show { transform: translate(-50%, 0); }
.empty-list { padding: 44px 20px; text-align: center; color: var(--ink-muted); font-size: 14px; }
.skeleton { height: 78px; margin: 4px 7px; border-radius: 12px; background: linear-gradient(100deg,#e3e6eb 30%,#f4f6f8 48%,#e3e6eb 66%); background-size: 220% 100%; animation: load 1.2s infinite; }
@keyframes load { to { background-position-x: -220%; } }

.client-view {
  width: min(100%, 760px); max-width: 100%; min-width: 0; height: 100dvh; margin: 0 auto;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background-color: #e7ebf1;
  background-image: radial-gradient(#c9ced8 0.7px, transparent 0.7px);
  background-size: 17px 17px;
  box-shadow: 0 0 40px rgba(24, 37, 63, .12);
}
.client-view[hidden] { display: none; }
.client-header {
  min-height: 82px; padding: calc(12px + env(safe-area-inset-top, 0px)) 17px 12px;
  display: flex; align-items: center; gap: 12px; color: white; background: var(--blue);
  box-shadow: 0 10px 28px rgba(23, 70, 209, .18);
}
.support-avatar { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 14px; background: white; color: var(--blue); font: 700 18px Georgia, serif; }
.client-header h1 { font-size: 24px; }
.client-header p { margin: 5px 0 0; font-size: 11px; color: #dce5ff; }
.client-header p i { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: #6ee7a6; }
.client-history { min-height: 0; overflow-y: auto; padding: 24px clamp(12px, 5vw, 42px); }
.client-history .message { max-width: 84%; }
.client-history .message.client { margin-left: auto; color: white; background: var(--blue); border-radius: 15px 15px 4px 15px; box-shadow: 2px 6px 16px rgba(23,70,209,.19); }
.client-history .message.client time { color: #cbd7ff; }
.client-history .message.support { margin-left: 0; color: var(--ink); background: var(--paper-raised); border-radius: 15px 15px 15px 4px; box-shadow: 2px 5px 14px rgba(24,37,63,.08); }
.client-history .message.support time { color: var(--ink-muted); }
.client-welcome { max-width: 430px; margin: 12vh auto 0; padding: 21px; border-radius: 15px; background: var(--paper-raised); box-shadow: 2px 5px 14px rgba(24,37,63,.08); text-align: center; }
.client-welcome strong { display: block; margin-bottom: 6px; font: 700 22px Georgia, serif; }
.client-welcome p { margin: 0; color: var(--ink-muted); font-size: 13px; line-height: 1.45; }
.client-composer {
  padding: 12px 12px calc(10px + var(--safe-bottom)); display: grid; grid-template-columns: minmax(0,1fr) 48px; gap: 8px;
  background: var(--paper-raised); border-top: 1px solid var(--line);
}
.client-composer textarea { width: 100%; min-width: 0; min-height: 48px; max-height: 130px; resize: none; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); }
.client-composer button { width: 48px; height: 48px; border: 0; border-radius: 12px; background: var(--blue); color: white; font-size: 22px; cursor: pointer; box-shadow: 2px 5px 13px rgba(23,70,209,.25); }
.client-composer button:disabled { opacity: .55; cursor: wait; }
.client-composer p { grid-column: 1/-1; margin: -1px 3px 0; color: var(--ink-muted); font-size: 10px; }

.admin-view { height: 100dvh; background: var(--paper); overflow: hidden; }
.admin-view[hidden] { display: none; }
.admin-header { min-width: 0; min-height: 104px; padding: 21px clamp(18px,4vw,48px); display: flex; align-items: center; justify-content: space-between; gap: 18px; background: var(--ink); color: white; }
.admin-header > div { min-width: 0; }
.admin-header h1 { font-size: clamp(28px,4vw,42px); }
.admin-header button { min-height: 42px; padding: 0 14px; border: 1px solid #8893ab; border-radius: 12px; background: transparent; color: white; cursor: pointer; }
.admin-scroll { min-width: 0; height: calc(100dvh - 104px); overflow: auto; overflow-x: hidden; padding: 24px clamp(14px,4vw,48px) 50px; }
.report-bar { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.report-bar h2,.roles-panel h2,.section-title h2 { margin: 0; font: 700 24px Georgia,serif; }
.report-bar p,.roles-panel p { margin: 5px 0 0; color: var(--ink-muted); font-size: 13px; }
#stats-form { display: flex; align-items: end; gap: 8px; }
#stats-form label,.role-form label { display: grid; gap: 5px; color: var(--ink-muted); font-size: 11px; font-weight: 700; }
#stats-form input,.role-form input { height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); }
#stats-form button,.role-form button { min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--blue); color: white; font-weight: 700; cursor: pointer; }
.metric-strip { display: grid; grid-template-columns: repeat(5,1fr); margin-top: 22px; border-block: 1px solid var(--line); }
.metric-strip div { padding: 18px 16px; border-right: 1px dashed var(--line); }
.metric-strip div:last-child { border: 0; }
.metric-strip span { display: block; color: var(--ink-muted); font-size: 11px; }
.metric-strip strong { display: block; margin-top: 6px; font: 700 28px Georgia,serif; }
.admin-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(280px,.6fr); gap: 18px; margin-top: 22px; }
.ledger,.roles-panel { padding: 20px; border-radius: 15px; background: var(--paper-raised); box-shadow: 3px 7px 20px rgba(24,37,63,.08); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title span { color: var(--ink-muted); font-size: 11px; }
.bars { min-height: 210px; margin-top: 18px; display: flex; align-items: end; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.bar { min-width: 28px; flex: 1; max-width: 54px; display: grid; align-items: end; gap: 6px; }
.bar i { display: block; min-height: 3px; border-radius: 5px 5px 0 0; background: var(--blue); }
.bar span { padding-bottom: 5px; color: var(--ink-muted); font-size: 9px; text-align: center; }
.product-stats { margin-top: 13px; }
.product-row { padding: 11px 0; display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.product-row strong { color: var(--blue); }
.roles-panel { margin-top: 18px; display: grid; grid-template-columns: minmax(220px,1fr) repeat(2,minmax(230px,.7fr)); gap: 18px; align-items: end; }
.role-form { display: grid; grid-template-columns: 1fr; gap: 8px; }

@media (max-width: 850px) {
  .report-bar,.roles-panel { align-items: stretch; flex-direction: column; }
  .report-bar { display: grid; }
  #stats-form { display: grid; grid-template-columns: 1fr 1fr; }
  #stats-form button { grid-column: 1/-1; }
  .metric-strip { grid-template-columns: repeat(2,1fr); }
  .metric-strip div { border-bottom: 1px dashed var(--line); }
  .admin-grid { grid-template-columns: 1fr; }
  .roles-panel { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .workspace { display: block; position: relative; overflow: hidden; }
  .inbox, .conversation { position: absolute; inset: 0; transition: transform .32s cubic-bezier(.2,.8,.2,1); }
  .conversation { transform: translateX(100%); }
  .workspace[data-view="chat"] .inbox { transform: translateX(-26%); }
  .workspace[data-view="chat"] .conversation { transform: translateX(0); }
  .topbar { min-height: 96px; padding-top: calc(18px + env(safe-area-inset-top, 0px)); }
  .topbar > div:first-child { min-width: 0; }
  .agent { flex: 0 0 106px; max-width: 106px; font-size: 11px; overflow-wrap: anywhere; }
  h1 { font-size: 28px; }
  .back { display: block; }
  .chat-header { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  .messages { padding: 20px 12px; }
  .message { max-width: 88%; }
  .composer { padding-inline: 10px; }
  .composer button { width: 48px; padding: 0; font-size: 0; }
  .composer button span { font-size: 21px; }
  .admin-header { min-height: 92px; padding-top: calc(15px + env(safe-area-inset-top,0px)); }
  .admin-header h1 { font-size: 24px; overflow-wrap: anywhere; }
  .admin-header button { display: none; }
  .admin-scroll { height: calc(100dvh - 92px); padding-top: 18px; }
  .metric-strip strong { font-size: 24px; }
}

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

/* Lucifer Store — obsidian salon */
:root {
  --paper: #0d090c;
  --paper-raised: #261c23;
  --ink: #f2ece4;
  --ink-muted: #aca0a4;
  --blue: #721b2a;
  --blue-soft: #2b1d24;
  --coral: #a83245;
  --line: #3b2b34;
  --gold: #c8a35b;
  --gold-soft: #ead8a7;
  --obsidian: #151015;
  color-scheme: dark;
  color: var(--ink);
  background: var(--paper);
}

body { background: var(--paper); }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline-color: var(--gold); }
.workspace { grid-template-columns: minmax(320px, 400px) minmax(0,1fr); background: var(--obsidian); }
.inbox { background: var(--obsidian); border-color: var(--line); }

.topbar, .client-header, .admin-header {
  position: relative; overflow: hidden;
  background: radial-gradient(circle at 12% -45%, rgba(157,41,59,.5), transparent 50%), var(--obsidian);
  color: var(--ink); border-bottom: 1px solid rgba(200,163,91,.35);
  box-shadow: 0 10px 28px rgba(0,0,0,.3);
}
.topbar::after, .client-header::after, .admin-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,163,91,.5), transparent);
}
.topbar { min-height: 116px; align-items: center; gap: 14px; padding: 22px 20px 18px; }
.topbar > div:nth-child(2) { min-width: 0; }
.brand { color: var(--gold); font-size: 11px; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; opacity: 1; }
h1 { font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif; }
.agent { margin-left: auto; color: var(--ink-muted); }
.brand-sigil, .support-avatar {
  position: relative; width: 50px; height: 50px; flex: 0 0 50px; display: grid; place-items: center;
  border: 1px solid rgba(200,163,91,.65); border-radius: 50%; background: transparent; color: var(--gold-soft);
  box-shadow: 3px 6px 20px rgba(0,0,0,.32), inset 0 0 0 5px var(--obsidian);
}
.brand-sigil::before, .support-avatar::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(200,163,91,.28); border-radius: 50%; }
.brand-sigil span, .support-avatar span { position: relative; font: 19px Georgia, serif; transform: translateY(-1px); }

.queue-tools { background: var(--obsidian); }
.search input, .composer textarea, .client-composer textarea, #stats-form input, .role-form input {
  border-color: var(--line); background: #1d161c; color: var(--ink); caret-color: var(--gold);
}
.search input::placeholder, textarea::placeholder { color: #92868b; }
.filter { color: var(--ink-muted); }
.filter:hover { background: #21191f; color: var(--ink); }
.filter.is-active { background: var(--blue); color: #fff8f2; }
.queue-heading { color: var(--ink-muted); letter-spacing: .05em; }
.queue-heading strong { color: var(--gold); }
.ticket { border-bottom-style: solid; border-color: var(--line); color: var(--ink); }
.ticket::after { display: none; }
.ticket:hover { background: rgba(255,255,255,.025); }
.ticket.is-active { background: var(--paper-raised); box-shadow: 3px 7px 18px rgba(0,0,0,.24); }
.ticket.is-active::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 1px; background: var(--gold); }
.avatar { border: 1px solid #4b343e; background: #1d161c; color: var(--gold-soft); font-family: "Palatino Linotype", Georgia, serif; }
.ticket-id, .ticket-preview, .ticket-side { color: var(--ink-muted); }
.new-dot { background: var(--coral); box-shadow: 0 3px 8px rgba(157,41,59,.4); }

.conversation, .client-view {
  background-color: var(--paper);
  background-image: radial-gradient(circle at 50% 120%, rgba(114,27,42,.18), transparent 52%);
}
.conversation::before, .client-view::before {
  content: ""; pointer-events: none; position: absolute; inset: 0; opacity: .15;
  background-image: radial-gradient(rgba(200,163,91,.25) .55px, transparent .7px); background-size: 24px 24px;
}
.empty-chat { position: relative; color: var(--ink-muted); }
.empty-mark { width: 72px; height: 72px; border-style: solid; border-color: rgba(200,163,91,.55); border-radius: 50%; color: var(--gold); font-family: "Palatino Linotype", Georgia, serif; transform: none; box-shadow: inset 0 0 0 7px var(--paper), inset 0 0 0 8px rgba(200,163,91,.15); }
.empty-chat h2 { color: var(--ink); font-family: "Palatino Linotype", Georgia, serif; }
.chat-shell { position: relative; }
.chat-header { background: rgba(21,16,21,.96); border-color: var(--line); }
.chat-person span { color: var(--ink-muted); }
.status-stamp { color: #cf6473; transform: none; letter-spacing: .06em; text-transform: uppercase; }
.status-stamp.closed { color: #74a88b; transform: none; }
.back { color: var(--gold); }
.day-marker { border: 1px solid var(--line); background: var(--obsidian); color: var(--ink-muted); }
.message { background: var(--paper-raised); color: var(--ink); box-shadow: 2px 6px 16px rgba(0,0,0,.22); }
.message.support, .client-history .message.client { background: var(--blue); color: #fff8f2; box-shadow: 2px 7px 18px rgba(74,12,24,.3); }
.message time, .client-history .message.support time { color: var(--ink-muted); }
.message.support time, .client-history .message.client time { color: #ddb7bd; }
.composer, .client-composer { position: relative; background: var(--obsidian); border-color: var(--line); }
.composer button, .client-composer button, #stats-form button, .role-form button { background: var(--blue); color: #fff8f2; box-shadow: 2px 6px 14px rgba(74,12,24,.28); }
.composer button:hover, .client-composer button:hover, #stats-form button:hover, .role-form button:hover { background: #9d293b; }
.composer-note, .client-composer p { color: var(--ink-muted); }
.toast { border: 1px solid rgba(200,163,91,.3); background: var(--paper-raised); color: var(--ink); box-shadow: 3px 9px 22px rgba(0,0,0,.36); }
.empty-list { color: var(--ink-muted); }
.skeleton { background: linear-gradient(100deg,#1b151a 30%,#2b2028 48%,#1b151a 66%); background-size: 220% 100%; }

.client-view { position: relative; box-shadow: 0 0 50px rgba(0,0,0,.42); }
.client-header { min-height: 94px; padding: calc(16px + env(safe-area-inset-top,0px)) 18px 15px; }
.client-header p { color: var(--ink-muted); }
.client-header p i { background: #74a88b; }
.client-history { position: relative; }
.client-history .message.support { background: var(--paper-raised); color: var(--ink); }
.client-welcome { border: 1px solid var(--line); background: #1d161c; box-shadow: 3px 8px 22px rgba(0,0,0,.24); }
.client-welcome strong { color: var(--gold-soft); font-family: "Palatino Linotype", Georgia, serif; }
.client-welcome p { color: var(--ink-muted); }

.admin-view { background: var(--paper); }
.admin-header { min-height: 108px; }
.admin-title { min-width: 0; display: flex; align-items: center; gap: 15px; }
.admin-title > div:last-child { min-width: 0; }
.admin-header h1 { font-family: "Palatino Linotype", Georgia, serif; }
.admin-header button { border-color: rgba(200,163,91,.45); color: var(--gold-soft); }
.admin-scroll { height: calc(100dvh - 108px); }
.report-bar h2, .roles-panel h2, .section-title h2 { color: var(--gold-soft); font-family: "Palatino Linotype", Georgia, serif; }
.report-bar p, .roles-panel p, #stats-form label, .role-form label, .metric-strip span, .section-title span, .bar span { color: var(--ink-muted); }
#stats-form input, .role-form input { color-scheme: dark; }
.metric-strip { border-color: var(--line); }
.metric-strip div { border-color: var(--line); }
.metric-strip strong { color: var(--ink); font-family: "Palatino Linotype", Georgia, serif; }
.ledger, .roles-panel { border: 1px solid var(--line); background: #1d161c; box-shadow: 3px 8px 22px rgba(0,0,0,.2); }
.bars, .product-row { border-color: var(--line); }
.bar i { background: #9d293b; }
.product-row strong { color: var(--gold); }

@media (max-width: 720px) {
  .topbar .brand-sigil { width: 44px; height: 44px; flex-basis: 44px; }
  .admin-title .brand-sigil { display: none; }
  .admin-header button { display: grid; place-items: center; width: 42px; min-width: 42px; padding: 0; font-size: 0; }
  .admin-header button::before { content: "↗"; font-size: 20px; }
  .admin-header { min-height: 96px; }
  .admin-scroll { height: calc(100dvh - 96px); }
}
