:root {
  color-scheme: dark;
  --bg: #0a0e18;
  --panel: #121a2a;
  --panel-2: #182238;
  --line: rgba(166, 190, 235, .18);
  --text: #eef4ff;
  --muted: #a8b7d2;
  --accent: #67d8c2;
  --accent-2: #82a9ff;
  --danger: #ff9e9e;
  --warning: #f5ca78;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at 15% 0%, #1a2946 0, transparent 42%), var(--bg);
  font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
code, pre, textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.auth-shell, .manager-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; }
.auth-card, .panel, .entry-card { background: linear-gradient(145deg, rgba(24,34,56,.97), rgba(15,22,38,.97)); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 60px rgba(0,0,0,.2); }
.auth-card { width: min(460px, 100%); padding: 32px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 8px 0 8px; font-size: clamp(28px, 5vw, 44px); letter-spacing: -.04em; line-height: 1.08; }
h2, h3 { margin: 0; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
pre { overflow: auto; padding: 14px; color: var(--accent); background: #080c14; border: 1px solid var(--line); border-radius: 10px; }
.stack-form, .form-grid { display: grid; gap: 14px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 650; }
input, textarea, select { width: 100%; color: var(--text); background: #0b111f; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
input:focus, textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(130,169,255,.14); }
textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
textarea.raw-editor { min-height: 360px; }
.topbar { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding: 54px 0 26px; }
.topbar h1 { margin-bottom: 5px; }
.topbar p { margin: 0; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.primary, .secondary, .danger, .ghost { border: 1px solid transparent; border-radius: 10px; padding: 10px 15px; font-weight: 750; }
.primary { color: #06221d; background: var(--accent); }
.primary:hover { filter: brightness(1.08); }
.secondary, .ghost { color: var(--text); background: var(--panel-2); border-color: var(--line); }
.danger { color: #2a0909; background: var(--danger); }
.ghost { padding: 7px 10px; font-size: 13px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tab { border: 0; border-bottom: 2px solid transparent; padding: 12px 14px; color: var(--muted); background: transparent; }
.tab.active { color: var(--accent); border-color: var(--accent); }
.editor-root { padding: 22px 0 0; }
.panel { padding: 22px; }
.panel-header { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel-header p { margin: 5px 0 0; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .wide { grid-column: 1 / -1; }
.switch-row { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 9px 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; }
.switch-row input { width: auto; accent-color: var(--accent); }
.entries { display: grid; gap: 14px; margin-top: 20px; }
.entry-card { padding: 17px; }
.entry-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.entry-head h3 { font-size: 16px; }
.entry-actions { display: flex; gap: 7px; }
.section-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
details { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
summary { color: var(--accent-2); cursor: pointer; font-weight: 700; }
.raw-editor { margin-top: 12px; }
.banner { margin: 10px 0; padding: 12px 14px; border: 1px solid rgba(255,158,158,.35); border-radius: 10px; background: rgba(255,158,158,.08); }
.footer-note { padding: 26px 0 50px; font-size: 13px; }
.toast { position: fixed; z-index: 10; right: 18px; bottom: 18px; max-width: min(440px, calc(100% - 36px)); padding: 12px 15px; border: 1px solid var(--line); border-radius: 11px; background: #17243a; color: var(--text); box-shadow: 0 15px 44px rgba(0,0,0,.3); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.bad { border-color: rgba(255,158,158,.45); color: var(--danger); }
@media (max-width: 720px) {
  .topbar { align-items: start; flex-direction: column; }
  .top-actions { justify-content: start; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .panel, .auth-card { padding: 18px; }
}
