/* InkQuota. app shell — production tokens */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600;700&family=Newsreader:opsz,wght@6..72,400;6..72,500;6..72,600;6..72,700&display=swap');

:root {
  --bg: #07090c;
  --bg-elev: #0c1117;
  --panel: #121821;
  --border: #1e2a38;
  --text: #eef3f8;
  --muted: #8b9aab;
  --faint: #5d6b7a;
  --accent: #7eb6e0;
  --accent2: #3f9a78;
  --danger: #d26666;
  --paper: #f4efe6;
  --ink: #1a1814;
  --radius: 12px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --header-h: 64px;
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.preset:focus-visible,
.nav-toggle:focus-visible,
.faq-q:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.wrap { max-width: 980px; margin: 0 auto; padding: 1.5rem 1.25rem; width: 100%; }
main.wrap { flex: 1; }
body.is-marketing main.wrap {
  max-width: none;
  padding: 0;
  width: 100%;
}
body.is-marketing main.wrap > .error,
body.is-marketing main.wrap > .ok {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* —— Header —— */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  min-height: var(--header-h);
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg-elev) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  flex-wrap: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.top.is-scrolled {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
}
.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  font-size: 1.15rem;
  flex-shrink: 0;
}
.brand span { color: var(--accent); }
.brand:hover { text-decoration: none; }

.nav-toggle {
  display: none;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font-weight: 600;
  cursor: pointer;
}
.top nav.row {
  gap: 0.35rem 0.85rem;
}
.top nav.row a {
  margin-right: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}
.top nav.row a:hover { color: var(--text); text-decoration: none; }
.top nav.row a.btn { color: #0b1220; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.85rem; }
.nav-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .top nav.row {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1.25rem 1rem;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    gap: 0.75rem;
  }
  .top.is-open nav.row { display: flex; }
  .nav-links, .nav-cta { flex-direction: column; align-items: stretch; width: 100%; }
  .nav-cta .btn, .nav-cta form { width: 100%; }
  .nav-cta button, .nav-cta .btn { width: 100%; text-align: center; }
}

/* —— Cards / grid —— */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
}
.grid { display: grid; gap: 1rem; }
@media (min-width: 800px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .doc-layout { grid-template-columns: 1.35fr 1fr; }
}

label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; font-weight: 500; }
input, textarea, select, button, .btn {
  font: inherit; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); padding: 0.55rem 0.75rem;
}
input, textarea, select { width: 100%; margin-bottom: 0.75rem; }
textarea { min-height: 120px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--faint); }

button, .btn {
  cursor: pointer;
  background: var(--accent);
  color: #0b1220;
  border: none;
  font-weight: 600;
  padding: 0.55rem 1rem;
  display: inline-block;
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.15s ease;
}
button:hover, .btn:hover { filter: brightness(1.06); text-decoration: none; }
button.secondary, .btn.secondary { background: var(--border); color: var(--text); }
button.good, .btn.good { background: var(--accent2); color: #fff; }
button.danger, .btn.danger { background: var(--danger); color: #fff; }
button:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.inline { display: inline; margin: 0; }
.muted { color: var(--muted); font-size: 0.9rem; }
.error { color: #ffb4b4; font-size: 0.95rem; margin: 0.5rem 0; }
.ok { color: #9ddeb8; font-size: 0.95rem; margin: 0.5rem 0; }

.list { list-style: none; padding: 0; margin: 0; }
.list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.list li:last-child { border-bottom: none; }

.badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--border);
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.badge.credits {
  background: color-mix(in srgb, var(--accent2) 22%, var(--panel));
  color: #9ddeb8;
  border: 1px solid color-mix(in srgb, var(--accent2) 35%, transparent);
}

pre.result {
  white-space: pre-wrap;
  background: var(--bg);
  padding: 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.88rem;
  font-family: var(--font-mono);
  margin-top: 0.5rem;
  max-height: 320px;
  overflow: auto;
}

.hero { padding: 3rem 0.5rem; text-align: center; }
.hero h1 { font-size: clamp(2rem, 4vw, 2.6rem); margin-bottom: 0.5rem; font-family: var(--font-display); font-weight: 600; }
.auth-card { max-width: 420px; margin: 1.5rem auto; }
.auth-card h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }
.auth-card > .muted.lead { margin-top: -0.35rem; margin-bottom: 1.25rem; }

.job-item { padding: 0.85rem 0; border-bottom: 1px solid var(--border); }
.job-item:last-child { border-bottom: none; }

blockquote {
  margin: 0 0 0.35rem;
  padding: 0.45rem 0.7rem;
  border-left: 3px solid var(--accent);
  background: var(--bg);
  font-size: 0.9rem;
}

.footer {
  border-top: 1px solid var(--border);
  margin-top: auto;
  padding: 1.5rem 0;
  background: var(--bg-elev);
}
.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0.75rem 1.15rem; }
.footer-links a { color: var(--muted); font-size: 0.88rem; }
.footer-links a:hover { color: var(--text); }

code {
  font-size: 0.85em;
  font-family: var(--font-mono);
  background: var(--bg);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
h1, h2, h3 { margin-top: 0; line-height: 1.25; }
h1 { letter-spacing: -0.02em; }
h2 { font-size: 1.2rem; font-weight: 600; }
.empty-state {
  text-align: center;
  padding: 1.75rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 60%, var(--panel));
}
.empty-state p { margin: 0.35rem 0; }
.page-head { margin-bottom: 1.25rem; }
.legal-card { max-width: 720px; margin: 0 auto; }
.legal-card h1 { font-family: var(--font-display); }
.legal-card ul { color: var(--muted); padding-left: 1.2rem; }
.legal-card li { margin-bottom: 0.45rem; }

/* Presets (settings) */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin: 8px 0 16px;
}
.preset {
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  width: 100%;
}
.preset strong { display: block; margin-bottom: 4px; }
.preset span { display: block; color: var(--muted); font-size: 0.8rem; line-height: 1.35; font-weight: 400; }
.preset.active, .preset:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}
.preset.active {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
}

img, svg { max-width: 100%; height: auto; }

/* —— Subscription bridge —— */
.bridge-panel .bridge-microcopy {
  margin: 0.35rem 0 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--bg));
  color: var(--text);
  font-size: 0.92rem;
}
.bridge-prompt,
textarea.bridge-prompt {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  width: 100%;
  border-radius: 8px;
  padding: 0.75rem;
}
.bridge-providers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}
.bridge-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  text-decoration: none;
}
.bridge-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.bridge-actions { align-items: center; gap: 0.65rem; }
.bridge-workspace h3 { margin-top: 0; }
.bridge-prepare select {
  width: 100%;
  margin-top: 0.25rem;
}
