/* ============================================================
   Indie Stack — tool pages + checker
   Editorial, not dashboard. One bordered block per screen: the
   verdict. Everything else is type on the page background.
   ============================================================ */

.tp {
  position: relative; z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 72px;
}

/* ---- breadcrumb ---- */
.tp-crumb {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px; color: var(--dim-2);
  margin-bottom: 30px;
}
.tp-crumb a { color: var(--dim-2); transition: color .14s; }
.tp-crumb a:hover { color: var(--text); }
.tp-crumb [aria-current] { color: var(--dim); }

/* ---- hero ---- */
.tp-hero { margin-bottom: 34px; }
.tp-pills { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tp-hero h1 {
  font-size: 36px; line-height: 1.06; letter-spacing: -0.035em;
  font-weight: 600; margin: 0 0 8px; max-width: 22ch;
  text-wrap: balance;
}
.tp-repo {
  font-family: var(--mono); font-size: 12px; color: var(--dim-2);
  margin: 0 0 20px; word-break: break-word;
}
.tp-note {
  font-size: 20px; line-height: 1.5; color: var(--dim);
  margin: 0; max-width: 58ch; text-wrap: pretty;
}

/* ---- verdict: the product ---- */
.tp-verdict {
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 26px 26px 6px;
  margin: 0 0 40px;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
/* a 2px rule in the family colour, not a wash */
.tp-verdict::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--tone);
}
.tp-label {
  font-family: var(--mono); font-size: 12px; letter-spacing: .11em;
  text-transform: uppercase; color: var(--dim-2); margin: 0 0 10px;
}
.tp-verdict h2 {
  font-size: 24px; line-height: 1.2; letter-spacing: -0.025em;
  font-weight: 600; margin: 0 0 8px; color: var(--tone-text);
}
.tp-verdict__text {
  font-size: 16px; line-height: 1.6; color: var(--dim);
  margin: 0 0 24px; max-width: 64ch;
}

.tp-grid3 {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}
.tp-grid3 > div { padding: 18px 18px 18px 0; }
.tp-grid3 > div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.tp-grid3 h3 {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  margin: 0 0 10px; color: var(--dim-2);
}
.tp-grid3 > div:nth-child(1) h3 { color: var(--safe); }
.tp-grid3 > div:nth-child(2) h3 { color: var(--copy); }
.tp-grid3 > div:nth-child(3) h3 { color: var(--restrict); }
.tp-grid3 ul { margin: 0; padding: 0; list-style: none; }
.tp-grid3 li {
  position: relative; padding-left: 15px; margin-bottom: 9px;
  font-size: 14px; line-height: 1.5; color: var(--dim);
}
.tp-grid3 li::before {
  content: ""; position: absolute; left: 0; top: .52em;
  width: 5px; height: 1px; background: var(--line-2);
}
.tp-grid3 li:last-child { margin-bottom: 0; }

/* family tone for the verdict panel */
.tone-safe     { --tone: var(--safe);     --tone-text: var(--safe); }
.tone-notice   { --tone: var(--notice);   --tone-text: var(--notice); }
.tone-copy     { --tone: var(--copy);     --tone-text: var(--copy); }
.tone-verify   { --tone: var(--verify);   --tone-text: var(--verify); }
.tone-restrict { --tone: var(--restrict); --tone-text: var(--restrict); }

/* ---- body + facts rail ---- */
.tp-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 56px;
  align-items: start;
}
.tp-main { min-width: 0; }
.tp-h2 {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--dim-2);
  margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.tp-main > p {
  font-size: 16px; line-height: 1.68; color: var(--dim);
  margin: 0 0 34px; max-width: 62ch;
}

/* ---- alternatives ---- */
.tp-alt { margin: 0 0 34px; }
.tp-sub { font-size: 14px; color: var(--dim-2); margin: 0 0 14px; max-width: 56ch; }
.altlist { list-style: none; margin: 0; padding: 0; }
.altlist li { border-top: 1px solid var(--line); }
/* no bottom rule on the last row: the CTA below already draws one */
.altlist li:last-child .alt { padding-bottom: 14px; }
.alt {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 2px; color: inherit;
  transition: padding .14s, color .14s;
}
.alt:hover { padding-left: 6px; }
.alt:hover .alt__name { color: var(--text); }
.alt:hover .alt__go { color: var(--text); transform: translateX(2px); }
.alt__dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--tone); }
.alt__body { flex: 1; min-width: 0; }
.alt__name { display: block; font-size: 14px; font-weight: 500; color: var(--text); transition: color .14s; }
.alt__lic { display: block; font-family: var(--mono); font-size: 12px; color: var(--dim-2); }
.alt__go { color: var(--dim-2); font-size: 14px; transition: color .14s, transform .14s; }

/* ---- cta ---- */
.tp-cta {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.tp-cta p:not(.tp-label) {
  font-size: 14px; line-height: 1.6; color: var(--dim);
  margin: 0 0 14px; max-width: 54ch;
}
.tp-cta__row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- facts ---- */
.tp-facts { position: sticky; top: 88px; }
.tp-facts dl { margin: 0 0 16px; }
.fact { border-top: 1px solid var(--line); padding: 9px 0; }
.fact:last-of-type { border-bottom: 1px solid var(--line); }
.fact dt {
  font-family: var(--mono); font-size: 12px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--dim-2); margin-bottom: 2px;
}
.fact dd { margin: 0; font-size: 14px; color: var(--text); font-weight: 500; }
.fact dd.is-stale { color: var(--copy); }
.tp-facts .btn { width: 100%; justify-content: center; margin-bottom: 8px; }
.tp-gh { font-size: 12px; }

/* ---- footer ---- */
.tp-foot {
  margin-top: 56px; padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px; color: var(--dim-2);
}
.tp-foot p { margin: 0; }
.tp-foot a { color: var(--dim); text-decoration: underline; text-decoration-color: var(--line-2); }
.tp-foot a:hover { color: var(--text); text-decoration-color: currentColor; }
/* inline links in prose carry an underline: colour alone is not a cue */
.tp-main p a, .tp-note a, .tp-sub a, .ck-lede a, .ck-foot a { text-decoration: underline; text-underline-offset: 2px; }


/* ---- licence-drift capture ---- */
.ck-mail {
  margin: 26px 0 0; padding: 18px 0 0;
  border-top: 1px solid var(--line);
}
.ck-mail > label {
  display: block; font-size: 14px; font-weight: 600; color: var(--text);
  margin-bottom: 10px;
}
.ck-mail__row { display: flex; gap: 8px; flex-wrap: wrap; }
.ck-mail__row input {
  flex: 1 1 220px; min-width: 0;
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 9px 12px;
}
.ck-mail__row input:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.ck-mail__note { font-size: 12.5px; color: var(--dim-2); margin: 8px 0 0; }

/* a licence-file link inside the facts rail */
.fact dd a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }
.fact dd a:hover { text-decoration-color: currentColor; }

/* ---- long-form pages: about, method ---- */
.doc { max-width: 68ch; }
.doc p { font-size: 16px; line-height: 1.7; color: var(--dim); margin: 0 0 16px; }
.doc .lead { font-size: 19px; line-height: 1.55; color: var(--text); margin: 0 0 26px; letter-spacing: -0.008em; }
.doc h2 {
  font-size: 21px; font-weight: 600; letter-spacing: -0.015em; color: var(--text);
  margin: 40px 0 12px;
}
.doc h3 { font-size: 15px; font-weight: 600; color: var(--text); margin: 22px 0 6px; }
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 20px; color: var(--dim); font-size: 15.5px; line-height: 1.7; }
.doc li { margin-bottom: 7px; }
.doc a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-2); }
.doc a:hover { text-decoration-color: currentColor; }
.doc code { font-family: var(--mono); font-size: 13px; color: var(--text); }
.doc__meta { font-family: var(--mono); font-size: 12px; color: var(--dim-2); margin: 0 0 30px; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 38px 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 14.5px; }
.doc th {
  text-align: left; font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .09em; text-transform: uppercase; color: var(--dim-2);
  padding: 0 12px 8px 0; border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
.doc td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); color: var(--dim); vertical-align: top; }
.doc td:first-child { color: var(--text); font-weight: 500; white-space: nowrap; }
.doc__note {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 14px 0; margin: 26px 0; color: var(--dim);
}
.doc__note strong { color: var(--text); }

/* ---- nav in the topbar ---- */
.tp-nav { display: flex; gap: 2px; align-items: center; }
.tp-nav .tab { display: inline-flex; align-items: center; }

/* ============================================================
   Checker
   ============================================================ */
.ck {
  position: relative; z-index: 1;
  max-width: 660px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}
.ck h1 {
  font-size: 36px; line-height: 1.1; letter-spacing: -0.032em;
  font-weight: 600; margin: 0 0 12px; text-wrap: balance;
}
.ck-lede {
  font-size: 16px; line-height: 1.6; color: var(--dim);
  margin: 0 0 28px; max-width: 52ch;
}

.ck-form { margin: 0 0 10px; }

/* segmented control: one repo, or a whole stack */
.ck-mode {
  display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
}
.ck-mode button {
  border: 0; background: transparent; color: var(--dim);
  font: inherit; font-size: 12px; font-weight: 500;
  padding: 5px 11px; border-radius: 8px; cursor: pointer;
  transition: background .12s, color .12s;
}
.ck-mode button:hover { color: var(--text); }
.ck-mode button.is-on { background: var(--surface-3); color: var(--text); }

.ck-list textarea {
  display: block; width: 100%; resize: vertical;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 8px;
  font-family: var(--mono); font-size: 14px; line-height: 1.7;
  padding: 12px 14px; outline: none;
  transition: border-color .14s;
}
.ck-list textarea:focus { border-color: var(--text); }
.ck-list textarea::placeholder { color: var(--dim-2); }
.ck-list__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 10px; flex-wrap: wrap;
}
.ck-list__count {
  font-family: var(--mono); font-size: 12px; color: var(--dim-2);
}

/* bulk result table */
.ck-table { width: 100%; border-collapse: collapse; margin: 18px 0 0; font-size: 14px; }
.ck-table th {
  text-align: left; font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .09em; text-transform: uppercase; color: var(--dim-2);
  padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line-2);
}
.ck-table td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ck-table td:last-child, .ck-table th:last-child { text-align: right; padding-right: 0; }
.ck-table tr:last-child td { border-bottom: 0; }
.ck-table a { font-weight: 500; color: var(--text); }
.ck-table a:hover { text-decoration: underline; text-underline-offset: 2px; }
.ck-table .lic { font-family: var(--mono); font-size: 12px; color: var(--dim-2); display: block; }
.ck-table .rowverdict {
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; white-space: nowrap;
}
.ck-table .rowverdict.is-safe     { color: var(--safe); }
.ck-table .rowverdict.is-notice   { color: var(--notice); }
.ck-table .rowverdict.is-copy     { color: var(--copy); }
.ck-table .rowverdict.is-verify   { color: var(--verify); }
.ck-table .rowverdict.is-restrict { color: var(--restrict); }
.ck-table .rowverdict.is-pending  { color: var(--dim-2); }
.ck-table .rowverdict.is-err      { color: var(--restrict); }
.ck-field {
  display: flex; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 5px 5px 5px 12px;
  align-items: center;
  transition: border-color .14s, background .14s;
}
.ck-field:focus-within { border-color: var(--text); }
.ck-field svg { width: 15px; height: 15px; color: var(--dim-2); flex-shrink: 0; }
.ck-field input {
  flex: 1; min-width: 0;
  border: 0; background: none; outline: none;
  color: var(--text); font-family: var(--mono); font-size: 14px;
  padding: 7px 0;
}
.ck-field input::placeholder { color: var(--dim-2); }
.ck-field .btn { flex-shrink: 0; }

/* the checker column is 660px wide, so the three-column split never has room:
   same stacked treatment the tool page uses below 900px, scoped to this panel */
.ck .tp-grid3 { grid-template-columns: 1fr; }
.ck .tp-grid3 > div { padding: 16px 0; }
.ck .tp-grid3 > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }

.ck-hint {
  font-size: 12px; color: var(--dim-2); margin: 0 0 22px;
  line-height: 1.5;
}
.ck-hint b { color: var(--dim); font-weight: 500; }

.ck-eg { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 34px; }
.ck-eg__label {
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--dim-2);
}
.ck-eg button {
  font-family: var(--mono); font-size: 12px;
  padding: 4px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--dim); cursor: pointer; transition: all .12s;
}
.ck-eg button:hover { color: var(--text); border-color: var(--line-2); background: var(--surface-3); }

/* result */
.ck-out { margin-top: 8px; scroll-margin-top: 80px; }
.ck-out[hidden] { display: none; }

.ck-status {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; color: var(--dim-2);
  margin-bottom: 14px;
}
.ck-spin {
  width: 11px; height: 11px; border-radius: 50%;
  border: 1.5px solid var(--line-2); border-top-color: var(--dim);
  animation: ckspin .7s linear infinite;
}
@keyframes ckspin { to { transform: rotate(360deg); } }

.ck-repo {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.ck-repo h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.025em; margin: 0; }
.ck-repo__full { font-family: var(--mono); font-size: 12px; color: var(--dim-2); }
.ck-meta {
  font-family: var(--mono); font-size: 12px; color: var(--dim-2);
  margin: 0 0 18px;
}
.ck-meta b { color: var(--dim); font-weight: 500; }

/* a note that hangs under a result: bounded by rules, not by a side tab */
.ck-note {
  font-size: 14px; line-height: 1.6; color: var(--dim);
  margin: 16px 0 0; padding: 13px 0 14px;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line);
}
.ck-note strong { color: var(--text); font-weight: 600; }

.ck-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }

/* error / unknown */
.ck-warn {
  border: 1px solid color-mix(in srgb, var(--copy) 30%, transparent);
  background: color-mix(in srgb, var(--copy) 7%, transparent);
  border-radius: 8px; padding: 14px 16px;
  font-size: 14px; line-height: 1.6;
  color: color-mix(in srgb, var(--copy) 40%, var(--text));
}
.ck-warn strong { display: block; margin-bottom: 4px; color: var(--copy); }

/* licence-only mode reuses the tool verdict block */
.ck .tp-verdict { margin-bottom: 0; }

.ck-foot {
  margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 12px; line-height: 1.6; color: var(--dim-2);
}
.ck-foot a { color: var(--dim); text-decoration: underline; text-underline-offset: 2px; }
.ck-foot a:hover { color: var(--text); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .tp-cols { grid-template-columns: 1fr; gap: 40px; }
  .tp-facts { position: static; }
  .tp-facts dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
  .tp-hero h1 { font-size: 30px; }
  .tp-verdict { padding: 22px 20px 4px; }
  .tp-grid3 { grid-template-columns: 1fr; }
  .tp-grid3 > div { padding: 16px 0; }
  .tp-grid3 > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 640px) {
  .tp { padding: 20px 16px 56px; }
  .tp-note { font-size: 16px; }
  .tp-verdict h2 { font-size: 20px; }
  .tp-verdict__text { font-size: 14px; }
  .tp-crumb { margin-bottom: 22px; }
  .ck { padding: 32px 16px 64px; }
  .ck h1 { font-size: 30px; }
  /* a button nested inside the input's own border reads as a two-row input.
     Stack two real controls instead: one field, one button. */
  .ck-field { flex-wrap: wrap; padding: 0; border: 0; background: none; gap: 10px; }
  .ck-field svg { display: none; }
  .ck-field input {
    order: 1; flex-basis: 100%; padding: 12px 13px;
    border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface);
  }
  .ck-field:focus-within input { border-color: var(--text); }
  .ck-field .btn { order: 2; flex-basis: 100%; justify-content: center; padding: 11px; }
  .tp-facts dl { grid-template-columns: 1fr; }
  .tp-foot { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .ck-spin { animation: none; border-top-color: var(--line-2); }
}
