  @import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

  :root {
    --bg: #14171c;
    --surface: #1b1f26;
    --surface-raised: #232833;
    --border: #2d333e;
    --accent: #c9a227;
    --accent-dim: #8a721f;
    --text: #e8e6e1;
    --text-muted: #8b92a0;
    --success: #6fcf97;
    --danger: #e5654b;
  }

  * { box-sizing: border-box; }

  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
  }

  h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; margin: 0; }
  code, .mono { font-family: 'IBM Plex Mono', monospace; }

  .shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
  }

  @media (max-width: 780px) {
    .shell { grid-template-columns: 1fr; }
    nav { display: flex; overflow-x: auto; border-right: none !important; border-bottom: 1px solid var(--border); }
    .nav-group-label { display: none; }
  }

  nav {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 28px 0;
  }

  .brand {
    padding: 0 20px 24px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
  }
  .brand .dot { color: var(--accent); }

  .nav-item {
    padding: 11px 20px;
    font-size: 13.5px;
    color: var(--text-muted);
    cursor: pointer;
    border-left: 2px solid transparent;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .nav-item:hover { color: var(--text); }
  .nav-item.active {
    color: var(--text);
    border-left-color: var(--accent);
    background: var(--surface-raised);
  }
  .keyhole { width: 6px; height: 6px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
  .keyhole.on { background: var(--success); box-shadow: 0 0 6px var(--success); }

  .nav-group-label {
    padding: 18px 20px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    opacity: 0.65;
  }

  main { padding: 40px 48px; max-width: 720px; transition: max-width 0.2s ease; }
  main.wide { max-width: 1400px; }

  .panel { display: none; animation: rise 0.25s ease; }
  .panel.active { display: block; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

  .panel-header { margin-bottom: 6px; font-size: 22px; }
  .panel-sub { color: var(--text-muted); font-size: 14px; margin: 6px 0 28px; line-height: 1.5; }

  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px;
    margin-bottom: 18px;
  }

  label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 7px;
  }

  input[type="text"], input[type="number"], input[type="file"], textarea {
    width: 100%;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 6px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    margin-bottom: 16px;
  }
  textarea { min-height: 90px; resize: vertical; }
  input:focus, textarea:focus { outline: 2px solid var(--accent-dim); outline-offset: 1px; }

  .row { display: flex; gap: 14px; }
  .row > div { flex: 1; }

  button {
    background: var(--accent);
    color: #1a1500;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
  }
  button:hover { background: #ddb02f; }
  button:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }
  button.ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
  }
  button.ghost:hover { border-color: var(--accent-dim); }
  button.build-tab-btn.active { border-color: var(--accent); color: var(--accent); }

  .status-line {
    margin-top: 14px;
    font-size: 13px;
    font-family: 'IBM Plex Mono', monospace;
    padding: 10px 12px;
    border-radius: 6px;
    display: none;
  }
  .status-line.show { display: block; }
  .status-line.ok { background: rgba(111,207,151,0.1); color: var(--success); border: 1px solid rgba(111,207,151,0.25); }
  .status-line.err { background: rgba(229,101,75,0.1); color: var(--danger); border: 1px solid rgba(229,101,75,0.25); }
  .status-line.pending { background: rgba(201,162,39,0.08); color: var(--accent); border: 1px solid rgba(201,162,39,0.2); }

  .hint {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 4px;
    margin-bottom: 16px;
    line-height: 1.5;
  }
  /* The negative pull-up only makes sense directly under the input/textarea
     it explains - applied there specifically now instead of as .hint's own
     default, which kept causing the same overlap bug every time .hint got
     reused for something else that follows a status line or other text
     (History dates, backlog meta, a checkbox option list, and now the
     publish-time privacy-policy link) - three separate incidents of the
     identical mistake before this got scoped instead of patched again. */
  input + .hint, textarea + .hint { margin-top: -8px; }

  .security-note {
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 32px;
    padding-top: 16px;
    line-height: 1.6;
  }
