/* ==========================================================================
   T-Slot Marketing Toolbox — shared design system
   Brand-neutral. Swap the palette tokens below for your brand colors.
   ========================================================================== */

:root {
  /* ---- Brand tokens (EDIT THESE) ---- */
  --brand:        #0b5fff;
  --brand-dark:   #0847c4;
  --brand-tint:   #e8efff;
  --accent:       #f5820b;   /* safety amber */
  --accent-tint:  #fff2e0;

  /* ---- Neutrals ---- */
  --ink:          #10151c;
  --ink-2:        #38424f;
  --ink-3:        #6b7686;
  --line:         #dde3ea;
  --line-2:       #eef1f5;
  --surface:      #ffffff;
  --surface-2:    #f6f8fa;
  --surface-3:    #eef1f5;

  /* ---- Semantic ---- */
  --good:         #1a7f4b;
  --good-tint:    #e6f5ed;
  --warn:         #a06400;
  --warn-tint:    #fdf3e0;
  --bad:          #b3261e;
  --bad-tint:     #fdeceb;

  --radius:       10px;
  --radius-sm:    6px;
  --shadow:       0 1px 2px rgba(16,21,28,.06), 0 8px 24px rgba(16,21,28,.06);
  --shadow-sm:    0 1px 2px rgba(16,21,28,.08);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;

  --maxw: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand:      #6d9bff;
    --brand-dark: #8fb3ff;
    --brand-tint: #16233d;
    --accent:     #ffa640;
    --accent-tint:#2e2210;
    --ink:        #eef2f7;
    --ink-2:      #b9c3d0;
    --ink-3:      #8a95a4;
    --line:       #2a323d;
    --line-2:     #222932;
    --surface:    #141922;
    --surface-2:  #1a212b;
    --surface-3:  #222a35;
    --good-tint:  #102a1d;
    --warn-tint:  #2c2210;
    --bad-tint:   #2e1614;
    --shadow:     0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    --shadow-sm:  0 1px 2px rgba(0,0,0,.5);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.02rem; }
p  { margin: 0 0 1em; }
a  { color: var(--brand); }

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

/* ---------- Site header ---------- */
.site-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.site-head .wrap { display: flex; align-items: center; gap: 16px; height: 62px; }
.logo { font-weight: 750; letter-spacing: -.02em; font-size: 1.05rem; text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 9px; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 5px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  position: relative;
}
.logo-mark::after {
  content: ""; position: absolute; inset: 8px 4px; border-radius: 1px;
  background: var(--surface); opacity: .85;
  clip-path: polygon(0 0,100% 0,100% 35%,60% 35%,60% 100%,40% 100%,40% 35%,0 35%);
}
.site-nav { margin-left: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-2); text-decoration: none; font-size: .875rem; font-weight: 500;
  padding: 7px 11px; border-radius: var(--radius-sm);
}
.site-nav a:hover { background: var(--surface-3); color: var(--ink); }
.site-nav a.active { background: var(--brand-tint); color: var(--brand-dark); }
.nav-current {
  font-size: .875rem; font-weight: 600; color: var(--ink-3); padding: 7px 4px 7px 12px;
  border-left: 1px solid var(--line); margin-left: 8px;
}
@media (max-width: 700px) { .nav-current { display: none; } }

/* Repeatable row builders (risk register, maintenance matrix) */
.rows { display: grid; gap: 10px; }
.row-item {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px;
  background: var(--surface-2); position: relative;
}
.row-item .row-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.row-item .row-n {
  font-size: .7rem; font-weight: 750; letter-spacing: .06em; color: var(--ink-3);
  background: var(--surface-3); border-radius: 4px; padding: 2px 7px;
}
.row-item .row-del {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--ink-3); font-size: 1.1rem; line-height: 1; padding: 2px 6px; border-radius: 4px;
}
.row-item .row-del:hover { background: var(--bad-tint); color: var(--bad); }
.row-item .field { margin-bottom: 10px; }
.empty-state {
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  padding: 22px; text-align: center; color: var(--ink-3); font-size: .875rem;
}

/* ---------- Tool header ---------- */
.tool-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 30px 0 26px; }
.eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px;
}
.tool-head p.lede { color: var(--ink-2); max-width: 68ch; margin: 0; font-size: 1.03rem; }

main { padding: 26px 0 70px; }

/* ---------- Cards / panels ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .hint { font-size: .8rem; color: var(--ink-3); margin-left: auto; }

.grid-2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.layout { display: grid; grid-template-columns: minmax(0,1fr) 400px; gap: 20px; align-items: start; }
.sticky { position: sticky; top: 86px; }

@media (max-width: 940px) {
  .layout { grid-template-columns: minmax(0,1fr); }
  .grid-3 { grid-template-columns: minmax(0,1fr); }
  .sticky { position: static; }
}
@media (max-width: 620px) {
  .grid-2 { grid-template-columns: minmax(0,1fr); }
  h1 { font-size: 1.5rem; }
}

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
label, .label {
  display: block; font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 5px;
}
.label-row { display: flex; align-items: baseline; gap: 8px; }
.label-row .val { margin-left: auto; font-family: var(--mono); font-size: .82rem; color: var(--brand-dark); font-weight: 650; }
.help { font-size: .765rem; color: var(--ink-3); margin-top: 4px; line-height: 1.45; }

input[type="text"], input[type="number"], input[type="email"], select, textarea {
  width: 100%; padding: 9px 11px; font: inherit; font-size: .92rem;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 78px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint);
}
input[type="range"] { width: 100%; accent-color: var(--brand); }

.input-affix { position: relative; }
.input-affix > span {
  position: absolute; top: 50%; transform: translateY(-50%); left: 11px;
  color: var(--ink-3); font-size: .9rem; pointer-events: none;
}
.input-affix.pre input { padding-left: 26px; }
.input-affix > span.suf { left: auto; right: 11px; }
.input-affix.suf input { padding-right: 46px; }

/* Option cards (radio / checkbox tiles) */
.opts { display: grid; gap: 8px; }
.opts.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.opts.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 620px) { .opts.two, .opts.three { grid-template-columns: minmax(0,1fr); } }

.opt {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 12px; cursor: pointer; background: var(--surface);
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.opt:hover { border-color: var(--brand); }
.opt input { margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.opt .t { font-weight: 600; font-size: .9rem; display: block; }
.opt .d { font-size: .775rem; color: var(--ink-3); display: block; line-height: 1.4; margin-top: 2px; }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 1px var(--brand); }
.opt:has(input:checked) .d { color: var(--ink-2); }

/* Segmented control */
.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--radius-sm); padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg label {
  margin: 0; padding: 6px 12px; border-radius: 4px; font-size: .82rem; font-weight: 600;
  color: var(--ink-2); cursor: pointer;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--surface); color: var(--brand-dark); box-shadow: var(--shadow-sm); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; font: inherit; font-size: .9rem; font-weight: 620;
  border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  text-decoration: none; transition: background .12s, border-color .12s, opacity .12s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-accent { background: var(--accent); color: #24160a; }
.btn-accent:hover { filter: brightness(.94); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-link { background: none; color: var(--brand); padding: 4px 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-full { width: 100%; }

/* ---------- Result display ---------- */
.stat { padding: 14px 0; }
.stat .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 700; }
.stat .v { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .v.sm { font-size: 1.25rem; }
.stat .s { font-size: .8rem; color: var(--ink-3); }
.stat.good .v { color: var(--good); }
.stat.bad  .v { color: var(--bad); }

.headline-stat {
  background: linear-gradient(135deg, var(--brand-tint), var(--surface));
  border: 1px solid var(--brand); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px;
}
.headline-stat .k { color: var(--brand-dark); }
.headline-stat .v { font-size: 2.35rem; color: var(--ink); }

table.data { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.data th, table.data td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line-2); }
table.data th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: .84rem; }
table.data tr.total td { border-top: 2px solid var(--line); border-bottom: none; font-weight: 700; }
table.data tr.sub td { color: var(--ink-2); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.bar-track { height: 9px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; transition: width .35s ease; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: .7rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}
.badge.good { background: var(--good-tint); color: var(--good); }
.badge.warn { background: var(--warn-tint); color: var(--warn); }
.badge.bad  { background: var(--bad-tint);  color: var(--bad); }
.badge.info { background: var(--brand-tint); color: var(--brand-dark); }
.badge.neutral { background: var(--surface-3); color: var(--ink-2); }

.note {
  border-left: 3px solid var(--accent); background: var(--accent-tint);
  padding: 11px 14px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .84rem; color: var(--ink-2);
}
.note.info { border-color: var(--brand); background: var(--brand-tint); }

/* ---------- Disclosure ---------- */
details.disclose { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
details.disclose > summary {
  cursor: pointer; padding: 10px 13px; font-size: .85rem; font-weight: 620; color: var(--ink-2);
  list-style: none; display: flex; align-items: center; gap: 8px;
}
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary::before { content: "▸"; color: var(--ink-3); font-size: .8em; }
details.disclose[open] > summary::before { content: "▾"; }
details.disclose > .body { padding: 0 13px 13px; border-top: 1px solid var(--line-2); padding-top: 12px; }

/* ---------- Steps / wizard ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.steps .s {
  flex: 1 1 90px; min-width: 90px; padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); font-size: .76rem; color: var(--ink-3);
  cursor: pointer; text-align: left;
}
.steps .s .n { font-weight: 750; display: block; font-size: .68rem; letter-spacing: .06em; }
.steps .s .l { font-weight: 600; color: var(--ink-2); }
.steps .s.active { border-color: var(--brand); background: var(--brand-tint); }
.steps .s.active .l { color: var(--brand-dark); }
.steps .s.done { border-color: var(--good); }
.steps .s.done .n::after { content: " ✓"; color: var(--good); }

.progress { height: 5px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-bottom: 18px; }
.progress > div { height: 100%; background: var(--brand); transition: width .3s ease; }

.step-pane { display: none; }
.step-pane.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Lead capture ---------- */
.lead-box { background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--radius); padding: 16px; }

/* ---------- Chart ---------- */
.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); margin-top: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 5px; }

/* ---------- Toolbox hub cards ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
a.tool-card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; transition: border-color .14s, transform .14s, box-shadow .14s;
}
a.tool-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
a.tool-card h3 { margin: 10px 0 6px; }
a.tool-card p { font-size: .875rem; color: var(--ink-2); margin: 0 0 14px; }
a.tool-card .stage { font-size: .7rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
a.tool-card .go { margin-top: auto; font-size: .84rem; font-weight: 650; color: var(--brand); }
a.tool-card.soon { opacity: .62; pointer-events: none; }

.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 24px 0; font-size: .82rem; color: var(--ink-3); }

.disclaimer { font-size: .75rem; color: var(--ink-3); line-height: 1.5; }

/* ---------- Print / PDF ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .site-head, .site-nav, .no-print, .btn, .steps, .progress, .lead-box, .footer { display: none !important; }
  .layout { display: block; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; page-break-inside: avoid; margin-bottom: 10pt; }
  .print-only { display: block !important; }
  .step-pane { display: block !important; }
  details.disclose { border: none; }
  details.disclose > .body { display: block !important; }
  a[href]::after { content: ""; }
  .headline-stat { background: #f4f4f4 !important; border-color: #999; }
}
.print-only { display: none; }

.print-head { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.print-head .co { font-weight: 750; font-size: 1.1rem; }
.print-head .meta { font-size: .8rem; color: var(--ink-3); }
