:root {
  color-scheme: dark;
  --bg: #080808;
  --panel: #0d0c0a;
  --panel-raised: #15110a;
  --panel-locked: #121314;
  --border: #5a4630;
  --bronze: #c49f6c;
  --gold: #eeae4d;
  --gold-soft: #fdcd6c;
  --gold-path: #ffd063;
  --text: #fffbe6;
  --text-soft: #d1c7b5;
  --muted: #908e85;
  --ok: #7fb069;
  --danger: #c0574a;
  --stripe-main: #8f5918;
  --stripe-create: #106404;
  --stripe-done: #87715a;
  --font-title: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-body: "Segoe UI", system-ui, sans-serif;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-size: 16px;
  line-height: 1.5;
  background: radial-gradient(ellipse at 50% 25%, var(--bg) 30%, #000 100%);
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-title); line-height: 1.25; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
img, svg { max-width: 100%; vertical-align: middle; }
[hidden] { display: none !important; }
a { color: var(--gold-soft); text-underline-offset: .2em; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
::selection { color: var(--bg); background: var(--gold-soft); }

.panel {
  position: relative;
  min-width: 0;
  border: 1px solid var(--bronze);
  background: linear-gradient(180deg, rgb(255 255 255 / 3%), transparent), linear-gradient(180deg, var(--panel), #0b0b0b);
  box-shadow: inset 0 0 12px rgb(0 0 0 / 45%);
  border-radius: 3px;
}
.panel::before, .panel::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
  border-color: var(--bronze);
  border-style: solid;
}
.panel::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.panel::after { right: -1px; bottom: -1px; border-width: 0 2px 2px 0; }
.panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid var(--stripe-color, var(--stripe-main));
  font-family: var(--font-title);
}
.panel__head h2, .panel__head h3, .panel__title {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.panel__head small { color: var(--muted); font-family: var(--font-body); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--bronze);
  border-radius: 3px;
  background: transparent;
  color: var(--gold);
  text-decoration: none;
  line-height: 1.3;
}
.btn:hover:not(:disabled):not([aria-disabled="true"]) { background: rgb(196 159 108 / 12%); }
.btn--primary { background: linear-gradient(180deg, #c8903e, #8f5918); color: #080808; font-weight: 700; }
.btn--primary:hover:not(:disabled):not([aria-disabled="true"]) { background: linear-gradient(180deg, #e1ae5e, #ae7328); color: #080808; }
.btn--ghost { border-color: transparent; color: var(--text-soft); }
.btn--icon { padding: 9px; flex-shrink: 0; }
.btn--icon svg { width: 24px; height: 24px; }
.btn[aria-disabled="true"] { opacity: .5; cursor: default; }
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text-soft);
  background: var(--panel);
  white-space: nowrap;
}
.chip[aria-pressed="true"], .chip.is-active { border-color: var(--bronze); background: var(--panel-raised); color: var(--gold-soft); }
.field { display: grid; gap: 6px; min-width: 0; color: var(--text-soft); }
.field input, .field textarea, .field select,
input.field, textarea.field, select.field {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  background: #090909;
}
.field textarea, textarea.field { min-height: 112px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus,
input.field:focus, textarea.field:focus, select.field:focus { border-color: var(--gold); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.muted { color: var(--muted); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 3px; color: var(--text-soft); font-size: .8125rem; }
.badge--warn { border-color: var(--bronze); color: var(--gold-soft); background: var(--panel-raised); }
.error-banner { padding: 14px 16px; border: 1px solid var(--danger); border-radius: 3px; background: #21120f; color: var(--text); }
.spinner { display: inline-block; width: 24px; height: 24px; border: 2px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border: 1px solid var(--bronze);
  border-radius: 3px;
  background: var(--panel-raised);
  color: var(--text);
  box-shadow: 0 8px 30px #000;
}
* { scrollbar-width: thin; scrollbar-color: var(--border) var(--bg); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
