/* Krewbase shared styles - vendor-neutral tools hub */
/* Krewbase palette: Slate & Signal Blue (light only, intentional) */
:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --border: #e4e8ee;
  --text: #16202e;
  --text-soft: #64748b;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --accent: #f59e0b;
  --accent-soft: #fef6e7;
  --good: #2e8b57;
  --shadow: 0 1px 2px rgba(20, 30, 45, 0.05), 0 4px 16px rgba(20, 30, 45, 0.06);
  --radius: 12px;
  --maxw: 880px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 17px;
}

a { color: var(--primary); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}
/* Baseline wordmark logo */
.brand {
  display: inline-block;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
  line-height: 1;
  border-bottom: 3px solid var(--primary);
  padding-bottom: 3px;
}
.brand .accent { color: var(--primary); }
.nav-link { color: var(--text-soft); text-decoration: none; font-size: 15px; font-weight: 600; }
.nav-link:hover { color: var(--text); }

/* Hero */
.hero { padding: 46px 0 30px; }
.hero h1 {
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}
.hero p { font-size: 19px; color: var(--text-soft); margin: 0; max-width: 620px; }

/* Cards grid */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 8px 0 40px; }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: 0 2px 4px rgba(20,30,45,0.08), 0 10px 28px rgba(20,30,45,0.12); }
.card .emoji { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px;
  border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); font-size: 23px; }
.card h3 { margin: 10px 0 6px; font-size: 19px; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--text-soft); font-size: 15px; }

/* Tool page layout */
.tool { padding: 32px 0 8px; }
.tool h1 { font-size: clamp(26px, 4.5vw, 34px); letter-spacing: -0.03em; margin: 0 0 8px; line-height: 1.15; }
.tool .lede { color: var(--text-soft); font-size: 18px; margin: 0 0 24px; max-width: 640px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
}
.panel h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  margin: 0 0 16px;
  font-weight: 700;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 12.5px; color: var(--text-soft); font-weight: 400; }
input[type="number"], select {
  width: 100%;
  padding: 11px 12px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235a6675' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
input:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button {
  border: 0; background: transparent; color: var(--text-soft);
  padding: 8px 14px; font-size: 14px; font-weight: 600; border-radius: 7px; cursor: pointer;
}
.seg button.active { background: var(--primary); color: #fff; }

/* Result readout */
.readout { text-align: center; padding: 8px 0 4px; }
.readout .big { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; color: var(--primary-strong); line-height: 1; }
.readout .unit { font-size: 16px; color: var(--text-soft); font-weight: 600; margin-top: 6px; }

.dose-list { margin: 0; padding: 0; list-style: none; }
.dose-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 13px 0; border-top: 1px solid var(--border);
}
.dose-list li:first-child { border-top: 0; }
.dose-name { font-weight: 600; }
.dose-name small { display: block; font-weight: 400; color: var(--text-soft); font-size: 12.5px; }
.dose-amt { font-weight: 700; color: var(--primary-strong); font-size: 17px; text-align: right; white-space: nowrap; }
.dose-amt.none { color: var(--text-soft); font-weight: 500; }

.callout {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text);
}
.callout strong { color: var(--accent); }

/* Prose / SEO body */
.prose { margin: 34px 0; }
.prose h2 { font-size: 24px; letter-spacing: -0.02em; margin: 30px 0 10px; }
.prose h3 { font-size: 19px; margin: 22px 0 6px; }
.prose p, .prose li { color: var(--text); }
.prose .muted { color: var(--text-soft); }

/* CTA */
.cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 36px 0;
  box-shadow: var(--shadow);
}
.cta h3 { margin: 0 0 6px; font-size: 20px; letter-spacing: -0.02em; }
.cta p { margin: 0 0 14px; color: var(--text-soft); }
.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: 9px;
  font-size: 15px;
}
.btn:hover { background: var(--primary-strong); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 26px 0;
  color: var(--text-soft);
  font-size: 14px;
}
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.site-footer a { color: var(--text-soft); }

/* --- Shared components (tools 2-5) --- */
.back { display: inline-block; margin: 6px 0 4px; color: var(--text-soft); text-decoration: none; font-size: 14px; font-weight: 600; }
.back:hover { color: var(--text); }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.btn.small { padding: 9px 15px; font-size: 14px; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.link-btn { background: none; border: 0; color: var(--primary); font-weight: 600; cursor: pointer; padding: 0; font-size: 14px; }
.link-btn:hover { text-decoration: underline; }

/* Stat readout grid */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; text-align: center; }
.stat .v { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--primary-strong); line-height: 1.1; }
.stat .k { font-size: 12.5px; color: var(--text-soft); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 5px; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.tbl th { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-soft); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.badge.red { background: #fdecea; color: #c0392b; }
.badge.amber { background: #fef1e0; color: #b9740f; }
.badge.yellow { background: #faf5dd; color: #8a760c; }
.badge.green { background: #e6f5ec; color: #1f7a44; }
.badge.gray { background: var(--surface-2); color: var(--text-soft); }

/* Line item rows (estimate) */
.lirow { display: grid; grid-template-columns: 1fr 66px 104px 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
.lirow input { margin: 0; }
.remove { background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--text-soft); cursor: pointer; height: 42px; font-size: 18px; line-height: 1; }
.remove:hover { color: #c0392b; border-color: #c0392b; }
@media (max-width: 520px) { .lirow { grid-template-columns: 1fr 52px 84px 40px; } }

/* Document preview (estimate/invoice) */
.doc { background: #ffffff; color: #14181f; border: 1px solid var(--border); border-radius: 10px; padding: 36px; box-shadow: var(--shadow); }
.doc * { color: #14181f; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.doc-title { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; text-transform: uppercase; }
.doc-biz { text-align: right; font-size: 14px; line-height: 1.5; }
.doc-biz .name { font-weight: 800; font-size: 17px; }
.doc-meta { display: flex; gap: 40px; flex-wrap: wrap; margin-bottom: 20px; font-size: 14px; }
.doc-meta .lbl { text-transform: uppercase; font-size: 11px; letter-spacing: 0.05em; color: #6a7280 !important; font-weight: 700; margin-bottom: 3px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc table th { text-align: left; border-bottom: 2px solid #14181f; padding: 8px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.doc table td { padding: 9px 6px; border-bottom: 1px solid #e2e6ec; }
.doc table td.num, .doc table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.doc-totals { margin-left: auto; width: 260px; margin-top: 14px; font-size: 14px; }
.doc-totals .row { display: flex; justify-content: space-between; padding: 5px 0; }
.doc-totals .grand { border-top: 2px solid #14181f; margin-top: 4px; padding-top: 8px; font-size: 18px; font-weight: 800; }
.doc-notes { margin-top: 24px; font-size: 13px; color: #4a5260 !important; border-top: 1px solid #e2e6ec; padding-top: 12px; white-space: pre-wrap; }

/* Notice / disclaimer */
.notice { font-size: 13.5px; color: var(--text-soft); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 15px; }

/* State list (license hub) */
.state-cols { columns: 3 210px; column-gap: 24px; margin: 8px 0 30px; }
.state-cols a { display: block; padding: 7px 0; text-decoration: none; color: var(--primary); font-weight: 600; break-inside: avoid; }
.state-cols a:hover { text-decoration: underline; }

/* Empty state */
.empty { text-align: center; color: var(--text-soft); padding: 24px 0; font-size: 15px; }

@media print {
  .no-print, .site-header, .site-footer, .cta, .prose, .callout, .back { display: none !important; }
  body { background: #fff; font-size: 13px; }
  .tool { padding: 0; }
  .doc { border: 0; box-shadow: none; padding: 0; border-radius: 0; }
  .panel { border: 0; box-shadow: none; padding: 0; }
}

/* --- Homepage sections --- */
.section-head { display: flex; align-items: baseline; gap: 10px; margin: 40px 0 14px; }
.section-head h2 { font-size: 22px; letter-spacing: -0.02em; margin: 0; }
.section-head .count { color: var(--text-soft); font-size: 14px; font-weight: 600; }
.grid.tight { margin-bottom: 8px; }

/* Featured knowledge-base block */
.feature { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.feature .kicker { text-transform: uppercase; letter-spacing: 0.06em; font-size: 12px; font-weight: 700; color: var(--accent); }
.feature h3 { margin: 8px 0 8px; font-size: 24px; letter-spacing: -0.02em; }
.feature p { margin: 0 0 18px; color: var(--text-soft); max-width: 640px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chips a { display: inline-block; padding: 7px 13px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; }
.chips a:hover { border-color: var(--primary); color: var(--primary); }
.chips a.more { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Positioning band */
.why { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 44px 0 8px; }
@media (max-width: 640px) { .why { grid-template-columns: 1fr; } }
.why .item { border-top: 2px solid var(--accent); padding-top: 12px; }
.why .item h4 { margin: 0 0 5px; font-size: 16px; }
.why .item p { margin: 0; color: var(--text-soft); font-size: 14.5px; }

/* Rich footer */
.footer-rich { border-top: 1px solid var(--border); margin-top: 48px; padding: 36px 0 30px; }
.footer-rich .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 26px; }
@media (max-width: 640px) { .footer-rich .cols { grid-template-columns: 1fr; gap: 22px; } }
.footer-rich h5 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-soft); margin: 0 0 10px; }
.footer-rich a { display: block; color: var(--text); text-decoration: none; font-size: 14.5px; padding: 3px 0; }
.footer-rich a:hover { color: var(--primary); }
.footer-rich .brandline { color: var(--text-soft); font-size: 14px; margin-top: 14px; max-width: 380px; }
