:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b6862;
  --border: #e3e0d9;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: #fdeee6;
  --danger: #b42318;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141311;
    --surface: #1d1c19;
    --text: #edebe6;
    --muted: #a19d94;
    --border: #33312c;
    --accent: #f97316;
    --accent-ink: #141311;
    --accent-soft: #2c1d13;
    --danger: #f97066;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { font-weight: 700; text-decoration: none; color: var(--text); letter-spacing: -0.01em; }
.logo span { color: var(--accent); }
.site-header nav { display: flex; gap: 18px; font-size: 15px; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a[aria-current="page"], .site-header nav a:hover { color: var(--text); }

.hero { padding: 64px 0 32px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 14px; max-width: 18ch; }
.hero p { color: var(--muted); font-size: 18px; max-width: 56ch; margin: 0; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; padding-bottom: 64px; }
.tool-card {
  display: block; padding: 24px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); text-decoration: none;
  transition: border-color 0.15s;
}
.tool-card:hover { border-color: var(--accent); }
.tool-card h2 { margin: 10px 0 6px; font-size: 20px; }
.tool-card p { margin: 0; color: var(--muted); }
.tool-card .soon { opacity: 0.6; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

.page-head { padding: 40px 0 20px; }
.page-head h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: -0.01em; }
.page-head p { margin: 0; color: var(--muted); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field > label, .field > legend { font-weight: 600; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; font-weight: 400; }
fieldset { border: 0; padding: 0; margin: 0; }
input[type="text"], input[type="url"], input[type="email"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
}
textarea { min-height: 160px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.checks label { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; }
.or { text-align: center; color: var(--muted); font-size: 13px; margin: -6px 0; }
.steps { counter-reset: step; display: grid; gap: 22px; }
.step { counter-increment: step; }
.step > h2 { font-size: 16px; margin: 0 0 10px; }
.step > h2::before { content: counter(step); display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; }

button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; border: 1px solid transparent;
  border-radius: 8px; padding: 10px 18px; background: var(--accent); color: var(--accent-ink);
}
button:disabled { opacity: 0.6; cursor: progress; }
button.ghost { background: transparent; color: var(--text); border-color: var(--border); padding: 6px 12px; font-size: 14px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.error { color: var(--danger); font-size: 14px; }
.status { color: var(--muted); font-size: 14px; }

.results { display: grid; gap: 16px; margin: 24px 0 64px; }
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.result-head h2 { font-size: 18px; margin: 0; }
.tweet { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; white-space: pre-wrap; }
.tweet small { display: block; color: var(--muted); margin-top: 6px; font-size: 12px; }
.prose { white-space: pre-wrap; }
.beat { display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.beat:first-of-type { border-top: 0; }
.beat .t { color: var(--muted); font-size: 13px; }
.overlay { display: inline-block; margin-top: 4px; font-size: 13px; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }

.doc { line-height: 1.65; }
.doc h1 { font-size: 26px; margin: 28px 0 8px; }
.doc h1:first-child { margin-top: 0; }
.doc h2 { font-size: 19px; margin: 22px 0 6px; }
.doc h3 { font-size: 16px; }
.notice { font-size: 13px; color: var(--muted); background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; }

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; padding: 20px 0 40px; }
.doc hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }
.doc ul { padding-left: 22px; }
.doc li { margin: 4px 0; }
mark.placeholder { background: #fde68a; color: #1c1b19; border-radius: 4px; padding: 0 3px; }

/* ---------- shared bits for the newer tools ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 64px; }
@media (max-width: 860px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
.two-col > *, .two-col > * > * { min-width: 0; }
.sticky { position: sticky; top: 16px; }
@media (max-width: 860px) { .sticky { position: static; } }
.panel h2 { font-size: 18px; margin: 0 0 12px; }
.counter { font-size: 12px; color: var(--muted); font-weight: 400; }
.counter.over { color: var(--danger); font-weight: 600; }
.section-label { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 8px 0 12px; }

table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { font-size: 13px; color: var(--muted); font-weight: 600; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }

pre.code { margin: 0; padding: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
.mono { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }

.big-price { font-size: 44px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; margin: 6px 0; }
.price-range { color: var(--muted); }
.factors { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }

.issues { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; font-size: 14px; }
.issues li { padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); }
.issues li.error { color: var(--danger); }
.issues li.ok { background: transparent; border: 1px solid var(--border); color: var(--muted); }

/* social previews: always light, like the real sites */
.preview { border: 1px solid #dadce0; border-radius: 12px; overflow: hidden; background: #fff; color: #202124; margin-bottom: 16px; }
.preview-label { font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.preview .img { aspect-ratio: 1200 / 630; background: #e8eaed center / cover no-repeat; display: grid; place-items: center; color: #80868b; font-size: 13px; }
.preview .body { padding: 10px 14px 12px; }
.google { padding: 14px 16px; font-family: arial, sans-serif; }
.google .site { font-size: 14px; color: #202124; }
.google .crumb { font-size: 12px; color: #4d5156; }
.google .title { font-size: 20px; color: #1a0dab; margin: 4px 0 3px; line-height: 1.3; }
.google .desc { font-size: 14px; color: #4d5156; line-height: 1.58; }
.x-card .domain { font-size: 13px; color: #536471; }
.x-card .title { font-size: 15px; color: #0f1419; }
.li-card { background: #f3f6f8; }
.li-card .title { font-weight: 600; font-size: 14px; color: #000000e6; }
.li-card .domain { font-size: 12px; color: #00000099; margin-top: 2px; }

/* invoice */
.items-table input { padding: 7px 8px; }
.items-table td { padding: 6px 4px; }
.items-table .qty { width: 64px; }
@media (max-width: 520px) { .items-table .qty { width: 52px; } .items-table .price { width: 84px; } .invoice { padding: 20px; } .invoice .parties { grid-template-columns: 1fr; } }
.items-table .price { width: 110px; }
.icon-btn { background: transparent; color: var(--muted); border: 0; padding: 4px 8px; font-size: 18px; }
.icon-btn:hover { color: var(--danger); }
.invoice { background: #fff; color: #1c1b19; border-radius: var(--radius); border: 1px solid var(--border); padding: 36px; font-size: 14px; }
.invoice h1 { font-size: 28px; margin: 0; letter-spacing: 0.04em; }
.invoice .inv-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.invoice .meta-grid { display: grid; grid-template-columns: auto auto; gap: 2px 14px; font-size: 13px; }
.invoice .meta-grid dt { color: #6b6862; }
.invoice .meta-grid dd { margin: 0; text-align: right; }
.invoice .parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.invoice .label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #6b6862; margin-bottom: 4px; }
.invoice .addr { white-space: pre-line; }
.invoice table.data th, .invoice table.data td { border-color: #e3e0d9; }
.invoice table.data th { color: #6b6862; }
.invoice .totals { margin-left: auto; width: min(100%, 280px); margin-top: 14px; }
.invoice .totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.invoice .totals .grand { border-top: 2px solid #1c1b19; margin-top: 6px; padding-top: 8px; font-size: 18px; font-weight: 800; }
.invoice .notes { margin-top: 28px; white-space: pre-line; color: #3d3b37; }

@media print {
  body { background: #fff; }
  .no-print, .site-header, .site-footer, .page-head { display: none !important; }
  .two-col { display: block; margin: 0; }
  .wrap { max-width: none; padding: 0; }
  .sticky { position: static; }
  .invoice { border: 0; padding: 0; }
}

/* transcript */
.video-head { display: flex; gap: 14px; align-items: center; }
.video-head img { border-radius: 8px; object-fit: cover; flex: none; background: var(--border); }
@media (max-width: 520px) { .video-head { flex-direction: column; align-items: flex-start; } .video-head img { width: 100%; height: auto; } }
.toggle { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.transcript { max-height: 70vh; overflow-y: auto; border-top: 1px solid var(--border); padding-top: 12px; line-height: 1.7; }
.transcript p { margin: 0 0 14px; }
.transcript .line { padding: 2px 0; }
.transcript .ts { font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent); text-decoration: none; margin-right: 6px; }
.transcript .ts:hover { text-decoration: underline; }
