:root {
  --ink: #111827;
  --ink-soft: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --paper: #fbfaf7;
  --card: #ffffff;
  --accent: #b42318;
  --accent-dark: #8f1b12;
  --accent-soft: #fff1ee;
  --gold: #b7791f;
  --green: #047857;
  --green-soft: #ecfdf5;
  --blue: #1d4ed8;
  --blue-soft: #eff4ff;
  --amber-soft: #fffaeb;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 12px 32px rgba(16, 24, 40, .06);
  --radius: 14px;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, "Noto Sans", sans-serif;
  --serif: "Georgia", "Noto Serif", "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  font-size: 15px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
small { font-size: .82rem; }

.wrap { width: min(1180px, 92vw); margin: 0 auto; }
.narrow { width: min(760px, 92vw); margin: 0 auto; }
.row { display: flex; gap: 14px; align-items: center; }
.between { justify-content: space-between; }
.wrap-row { flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
.mb-0 { margin-bottom: 0; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 250, 247, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 700; font-size: 1.08rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-family: var(--sans); font-size: .78rem; font-weight: 800; letter-spacing: .04em;
}
.brand span.tag { font-family: var(--sans); font-size: .66rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); border: 1px solid #f3c9c2; padding: 2px 6px; border-radius: 999px; background: var(--accent-soft); }
.nav-links { display: flex; gap: 22px; align-items: center; font-size: .9rem; }
.nav-links a { color: var(--ink-soft); }
.nav-links a:hover { color: var(--accent); text-decoration: none; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  padding: 10px 16px; font: inherit; font-weight: 600; font-size: .92rem;
  background: var(--ink); color: #fff; transition: .15s ease;
  white-space: nowrap;
}
.btn:hover { background: #000; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { background: #fff; color: var(--ink); }
.btn-soft { background: var(--accent-soft); color: var(--accent-dark); border-color: #f6d5cf; }
.btn-soft:hover { background: #ffe6e0; }
.btn-sm { padding: 7px 11px; font-size: .82rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-danger { background: #fff; color: #b42318; border-color: #f3c9c2; }
.btn-danger:hover { background: var(--accent-soft); }

/* forms */
label.field { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); font: inherit; font-size: .93rem;
}
.input:focus, select:focus, textarea:focus { outline: 2px solid #f6d5cf; border-color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card-flat { box-shadow: none; }
.card h2, .card h3 { margin-top: 0; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; padding: 3px 8px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--gold); }
.badge.red { background: var(--accent-soft); color: var(--accent-dark); }
.badge.grey { background: #f3f4f6; color: #4b5563; }

/* landing */
.hero { padding: clamp(48px, 8vw, 96px) 0 48px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--accent); display: inline-block; }
.hero h1 { max-width: 18ch; }
.hero .lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 56ch; margin-bottom: 26px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; gap: 30px; } }
.hero-note { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: 16px; }
.hero-note span { display: inline-flex; gap: 6px; align-items: center; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; }

.mock { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 60px rgba(17, 24, 39, .13); overflow: hidden; }
.mock-bar { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafafa; }
.mock-bar i { width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; display: block; }
.mock-body { padding: 18px; }
.mock-line { height: 8px; border-radius: 4px; background: #eef0f3; margin-bottom: 9px; }
.mock-line.w60 { width: 60%; } .mock-line.w80 { width: 80%; } .mock-line.w40 { width: 40%; }
.mock-title { font-family: var(--serif); font-weight: 700; font-size: 1.02rem; margin-bottom: 10px; }
.mock-tag { display: inline-block; font-size: .68rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 2px 6px; margin-bottom: 8px; }

.section { padding: clamp(40px, 6vw, 72px) 0; }
.section.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 60ch; margin-bottom: 32px; }
.section-head p { color: var(--muted); }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feature h3 { font-size: 1.05rem; margin-bottom: 6px; }
.feature p { margin: 0; color: var(--muted); font-size: .9rem; }
.feature .ico { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; margin-bottom: 12px; font-size: .9rem; }

.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
@media (max-width: 860px) { .price-grid { grid-template-columns: 1fr; } }
.price-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; }
.price-card.featured { border: 2px solid var(--ink); box-shadow: 0 18px 40px rgba(17, 24, 39, .1); }
.price-card .amount { font-family: var(--serif); font-size: 2.1rem; font-weight: 700; line-height: 1; margin: 10px 0 4px; }
.price-card ul { list-style: none; padding: 0; margin: 16px 0 22px; font-size: .9rem; color: var(--ink-soft); }
.price-card li { padding: 6px 0 6px 22px; position: relative; }
.price-card li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }

.site-footer { border-top: 1px solid var(--line); background: #fff; padding: 28px 0; font-size: .85rem; color: var(--muted); }
.site-footer .wrap { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; align-items: center; }

/* auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; background: radial-gradient(1200px 600px at 10% 0%, #fff 0, var(--paper) 55%); }
.auth-card { width: min(430px, 100%); }
.tabs { display: flex; gap: 6px; background: #f3f4f6; padding: 4px; border-radius: 10px; margin-bottom: 20px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 7px; font: inherit; font-weight: 600; font-size: .9rem; color: var(--muted); cursor: pointer; }
.tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.form-stack > * + * { margin-top: 14px; }
.error-box { background: var(--accent-soft); color: var(--accent-dark); border: 1px solid #f3c9c2; padding: 10px 12px; border-radius: 9px; font-size: .86rem; }
.notice { background: var(--amber-soft); border: 1px solid #fde68a; color: #92400e; padding: 10px 12px; border-radius: 9px; font-size: .84rem; }

/* studio */
body.studio { background: #f6f5f1; }
.studio-shell { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; padding: 18px 0 40px; }
@media (max-width: 1080px) { .studio-shell { grid-template-columns: 1fr; } }
.side { display: grid; gap: 14px; position: sticky; top: 80px; }
@media (max-width: 1080px) { .side { position: static; } }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel h3 { font-family: var(--sans); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.drop {
  border: 1.5px dashed #d8d5cc; border-radius: 12px; padding: 22px 14px; text-align: center;
  background: #fcfbf8; cursor: pointer; transition: .15s ease;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .big { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.drop .hint { font-size: .78rem; color: var(--muted); }
.drop input { display: none; }
.file-pill { display: flex; align-items: center; gap: 8px; background: var(--blue-soft); border: 1px solid #dbe4ff; border-radius: 9px; padding: 8px 10px; font-size: .82rem; margin-top: 10px; }
.link-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.divider-text { display: flex; align-items: center; gap: 10px; font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 14px 0; }
.divider-text::before, .divider-text::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.progress { height: 6px; background: #ecebe6; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #e07a5f); transition: width .4s ease; }
.stage-line { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; color: var(--muted); margin-top: 8px; }

.workspace { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); min-height: 560px; display: flex; flex-direction: column; overflow: hidden; }
.ws-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: #fff; }
.ws-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.ws-tab { border: 1px solid transparent; background: transparent; padding: 7px 11px; border-radius: 8px; font: inherit; font-size: .86rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.ws-tab.active { background: #f3f2ee; color: var(--ink); }
.ws-tab:disabled { opacity: .4; cursor: default; }
.ws-body { padding: 20px; flex: 1; overflow: auto; max-height: 66vh; }
.content h1, .content h2, .content h3 { font-family: var(--serif); }
.doc { font-family: var(--serif); font-size: 1.02rem; line-height: 1.75; white-space: pre-wrap; word-wrap: break-word; }
.doc.transcript { font-family: var(--sans); font-size: .92rem; line-height: 1.7; white-space: pre-wrap; }
.empty { display: grid; place-items: center; text-align: center; min-height: 380px; color: var(--muted); padding: 30px; }
.empty .big { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); margin-bottom: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--line); background: #fcfbf8; }
.joblist { display: grid; gap: 6px; max-height: 300px; overflow: auto; }
.jobitem { text-align: left; border: 1px solid transparent; background: #faf9f6; border-radius: 9px; padding: 8px 10px; cursor: pointer; font: inherit; font-size: .82rem; }
.jobitem:hover { border-color: var(--line); background: #fff; }
.jobitem.active { border-color: var(--accent); background: var(--accent-soft); }
.jobitem .t { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jobitem .s { color: var(--muted); font-size: .74rem; }
.usage-bar { display: grid; gap: 8px; font-size: .8rem; }
.usage-row { display: flex; justify-content: space-between; gap: 8px; }
.usage-row b { font-weight: 600; }

.claims-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.claims-table th, .claims-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.claims-table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.risk-high { color: var(--accent-dark); font-weight: 700; }
.risk-medium { color: var(--gold); font-weight: 700; }
.risk-low { color: var(--green); font-weight: 700; }
.pack-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .pack-grid { grid-template-columns: 1fr; } }
.pack-block { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fdfdfb; }
.pack-block h4 { margin: 0 0 8px; font-family: var(--sans); font-size: .76rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.pack-block ul { margin: 0; padding-left: 18px; font-size: .88rem; }
.pack-block li { margin-bottom: 5px; }
.kv { font-size: .86rem; }
.kv div { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.copyable { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: .85rem; white-space: pre-wrap; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(17, 24, 39, .45); display: grid; place-items: center; z-index: 90; padding: 20px; }
.modal { background: #fff; border-radius: 16px; max-width: 520px; width: 100%; padding: 24px; max-height: 88vh; overflow: auto; }
.modal h2 { margin-bottom: 4px; }

/* toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 120; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; font-size: .85rem; box-shadow: var(--shadow); max-width: 340px; }
.toast.err { background: var(--accent-dark); }
.toast.ok { background: #065f46; }

/* admin */
table.data { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.data th { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; background: #fafaf9; }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:hover td { background: #fbfaf7; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.stat .v { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; line-height: 1.2; margin-top: 4px; }

@media print {
  .site-header, .side, .toolbar, .ws-head, .toasts { display: none !important; }
  body, .workspace, .ws-body { background: #fff !important; box-shadow: none; border: 0; max-height: none; overflow: visible; }
  .studio-shell { display: block; padding: 0; }
}
