:root {
  --bg: #0a0908;
  --fg: #f5f0e8;
  --mute: #9b9288;
  --line: rgba(255, 255, 255, 0.1);
  --card: #141210;
  --accent: #e8b84a;
  --ink: #1a1408;
  --danger: #f07178;
  --ok: #7fd99a;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.app-shell {
  min-height: 100dvh;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding:
    calc(0.75rem + var(--safe-t))
    calc(0.75rem + var(--safe-r))
    calc(0.75rem + var(--safe-b))
    calc(0.75rem + var(--safe-l));
  gap: 0.75rem;
}
.surface {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  min-height: 0;
}
.surface.fill { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; padding: 1.25rem; }
@media (min-width: 768px) {
  .surface.fill { padding: 2rem; }
  .app-shell { padding: 1rem 1.25rem; gap: 1rem; }
}
.eyebrow { font-size: 0.75rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--mute); margin: 0; }
h1 { margin: 0.5rem 0 0; font-size: clamp(1.8rem, 5vw, 3rem); letter-spacing: -0.02em; }
.lead { color: var(--mute); max-width: 40rem; line-height: 1.55; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0.7rem 1.15rem; border-radius: 999px;
  border: none; font-weight: 600; cursor: pointer;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn.sm { min-height: 40px; padding: 0.4rem 0.85rem; font-size: 0.85rem; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.brand { font-weight: 600; }
.panel-grid {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 1fr; gap: 0.75rem;
}
@media (min-width: 900px) {
  .panel-grid { grid-template-columns: minmax(220px, 28%) 1fr; gap: 1rem; }
}
.col { display: flex; flex-direction: column; min-height: 40dvh; }
@media (min-width: 900px) { .col { min-height: 0; } }
.section { margin: 0; font-size: 0.85rem; color: var(--mute); letter-spacing: 0.04em; }
.field {
  width: 100%; border: 1px solid var(--line); background: rgba(0,0,0,.35);
  color: var(--fg); border-radius: 0.75rem; padding: 0.7rem 0.85rem; outline: none;
}
.field:focus { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea.field { resize: none; min-height: 140px; }
.grow { flex: 1; }
.scroll { overflow: auto; -webkit-overflow-scrolling: touch; flex: 1; min-height: 0; }
.list button {
  width: 100%; text-align: left; background: transparent; border: 0; color: var(--fg);
  border-radius: 0.75rem; padding: 0.8rem 0.75rem; cursor: pointer;
}
.list button:hover { background: rgba(255,255,255,.05); }
.list button.active { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.list .sub { display: block; margin-top: 0.2rem; font-size: 0.75rem; color: var(--mute); }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap { gap: 0.5rem; }
.wrap { flex-wrap: wrap; gap: 0.75rem; }
.mb { margin-bottom: 0.75rem; }
.mt { margin-top: 0.75rem; }
.mute { color: var(--mute); font-size: 0.85rem; }
.label { display: block; font-size: 0.75rem; color: var(--mute); margin-bottom: 0.35rem; }
.link { font-size: 0.75rem; color: var(--accent); }
.banner { border-radius: 0.75rem; padding: 0.7rem 0.85rem; font-size: 0.9rem; }
.banner.danger { border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.banner.ok { border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.hidden { display: none !important; }
footer { border-top: 1px solid var(--line); padding-top: 0.9rem; color: var(--mute); font-size: 0.75rem; }
@media (max-width: 640px) { .hide-sm { display: none; } }
