:root {
  --bg: #0a0e14;
  --panel: #070b10;
  --line: #1b2430;
  --fg: #e6edf3;
  --muted: #7d8aa0;
  --accent: #00e5ff;
}
* { box-sizing: border-box; }
/* Make the `hidden` attribute authoritative — class `display:flex` was overriding it,
   which left the sign-in gate (.gate) and code step visible when they should be hidden. */
[hidden] { display: none !important; }

/* Native frame: strict full-height, no page scroll, no double-scroll. */
html, body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  -webkit-font-smoothing: antialiased;
}
code { color: var(--accent); }

/* ── Sign-in gate ── */
.gate {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 24px;
}
.brand-lg { font-size: 28px; letter-spacing: 4px; color: var(--accent); }
.muted { color: var(--muted); font-size: 13px; }

/* Custom magic-link form — minimalist dark, neon accents, no widget bloat. */
.magic-form { display: flex; flex-direction: column; gap: 12px; width: 320px; max-width: 86vw; }
.magic-form input {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  padding: 13px 15px;
  outline: none;
  text-align: center;
}
.magic-form input::placeholder { color: var(--muted); }
.magic-form input:focus { border-color: var(--accent); }
.magic-form button {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.magic-form button:hover { background: var(--accent); color: var(--bg); }
.magic-form button:disabled { opacity: 0.5; cursor: default; }

/* ── App = ONE unified screen ── */
.app { height: 100vh; overflow: hidden; }
.terminal { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

.bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
/* Clear the native macOS window pills (Close/Minimize/Zoom) in the hidden-inset titlebar. */
.bar .brand { color: var(--accent); letter-spacing: 3px; font-size: 14px; padding-left: 80px; }
.bar .title { font-size: 13px; color: var(--muted); }
.pill {
  margin-left: auto;
  font-size: 11px;
  color: var(--accent);
  border: 1px solid #16313c;
  border-radius: 999px;
  padding: 3px 10px;
  text-transform: lowercase;
}
.userbox {
  color: var(--muted);
  font-size: 12px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.signout {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.signout:hover { border-color: var(--accent); color: var(--accent); }

/* Permanent transparency disclosure — fixed flex row between header and feed, so it
   is always visible and never scrolls away. Minimalist, low-emphasis amber note. */
.disclosure {
  flex: 0 0 auto;
  padding: 6px 18px;
  font-size: 11px;
  line-height: 1.4;
  color: #ffb000;
  background: rgba(255, 176, 0, 0.06);
  border-bottom: 1px solid var(--line);
  letter-spacing: 0.2px;
}

/* Feed = the ONLY scrollable region. */
.feed {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.msg-author { font-size: 11px; color: var(--accent); margin-bottom: 3px; letter-spacing: 0.3px; }
.msg-body { font-size: 14px; line-height: 1.5; color: var(--fg); white-space: pre-wrap; }

/* ── Freemium paywall: blur premium content + lock badge ── */
.msg.locked { position: relative; }
.msg-body.blurred { filter: blur(6px); user-select: none; pointer-events: none; opacity: 0.85; }
.lock-badge {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  max-width: 92%;
  background: #0d1b24;
  color: var(--accent);
  border: 1px solid #16313c;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.55);
}
.lock-badge:hover { background: #10222e; }

/* Inline pasted/uploaded chart images in the feed. */
.msg-img {
  display: block;
  margin-top: 6px;
  max-width: min(420px, 100%);
  max-height: 300px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* ── Composer ── */
.composer { flex: 0 0 auto; border-top: 1px solid var(--line); padding: 12px 18px; display: flex; align-items: center; gap: 10px; }
.composer #composer-input {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  padding: 11px 14px;
  outline: none;
}
.composer #composer-input:focus { border-color: #16313c; }
#attach-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  padding: 8px 11px;
  border-radius: 10px;
  cursor: pointer;
}
#attach-btn:hover { border-color: var(--accent); color: var(--accent); }
