/* LLM Cost & Routing Workbook - styles. System fonts only, no external assets. */

:root {
  --text: #1b1b1b;
  --muted: #4d4d4d;
  --bg: #ffffff;
  --panel: #f4f6f8;
  --line: #c9d1d9;
  --field-border: #6b7480;
  --accent: #5a2b8a;
  --accent-dark: #421f66;
  --focus: #a14e00;
  --note-bg: #fff8e1;
  --note-line: #8a6100;
}

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

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

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

.wrap {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  padding-top: 1.5rem;
  padding-bottom: 1rem;
}

h1,
h2,
h3 {
  line-height: 1.25;
}

h1 {
  font-size: 1.9rem;
  margin: 0.25rem 0 0.75rem;
}

h2 {
  font-size: 1.4rem;
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1.15rem;
  margin: 1.25rem 0 0.5rem;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-dark);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--bg);
  color: var(--accent);
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--accent);
  z-index: 10;
}

.skip-link:focus {
  top: 0.5rem;
}

.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 0 1rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.lede {
  font-size: 1.1rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem;
  margin: 0 0 1rem;
}

fieldset.card {
  min-width: 0;
}

legend {
  font-weight: 700;
  padding: 0 0.25rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

label {
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: block;
}

input,
select {
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--field-border);
  border-radius: 4px;
  padding: 0.45rem 0.5rem;
  width: 100%;
  max-width: 100%;
}

select option:disabled {
  color: #595959;
}

.hint,
.model-info {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.25rem 0 0;
}

.add-row {
  margin: 0 0 1rem;
}

button,
.btn {
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 4px;
  padding: 0.55rem 1rem;
  display: inline-block;
  text-decoration: none;
  line-height: 1.3;
}

.btn {
  background: var(--accent);
  color: #ffffff;
  border: 2px solid var(--accent);
  font-weight: 700;
}

.btn:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #ffffff;
}

.btn-secondary {
  background: var(--bg);
  color: var(--accent);
  border: 2px solid var(--accent);
  font-weight: 600;
}

.btn-secondary:hover {
  background: #e8f0f8;
}

.btn-secondary:disabled {
  color: #595959;
  border-color: #8c8c8c;
  background: #ececec;
  cursor: not-allowed;
}

.btn-small {
  font-size: 0.95rem;
  padding: 0.35rem 0.75rem;
  margin-top: 0.5rem;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 0.75rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  font-size: 0.95rem;
}

caption {
  text-align: left;
  font-weight: 600;
  padding: 0.25rem 0;
}

th,
td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  background: #e6ebf0;
}

tfoot th,
tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--text);
}

.num {
  text-align: right;
  white-space: nowrap;
}

.difference {
  font-weight: 700;
  font-size: 1.05rem;
}

.disclaimer,
.notice {
  background: var(--note-bg);
  border-left: 4px solid var(--note-line);
  padding: 0.6rem 0.75rem;
}

.note,
.footnote {
  font-size: 0.92rem;
  color: var(--muted);
}

.formula {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.75rem;
  overflow-x: auto;
}

.formula code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.provider {
  margin-bottom: 1.25rem;
}

.provider .source {
  font-size: 0.92rem;
  margin: 0 0 0.25rem;
  word-break: break-word;
}

.paid {
  border: 2px solid var(--accent);
  background: var(--bg);
}

blockquote {
  margin: 0.5rem 0 1rem;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 4px solid var(--line);
  color: var(--text);
}

.files li {
  margin-bottom: 0.5rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding: 1rem 0 2rem;
  background: var(--panel);
}

@media (max-width: 30rem) {
  h1 {
    font-size: 1.6rem;
  }

  .card {
    padding: 0.75rem;
  }

  th,
  td {
    padding: 0.4rem 0.35rem;
  }
}

/* Additions for this product */
.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; padding: 1rem 0 2rem; color: var(--muted); }
.big { font-size: 1.6rem; font-weight: 800; margin: 0.1rem 0; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 0.75rem; }
.stat p { margin: 0; }
.stat .label { color: var(--muted); font-size: 0.9rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.75rem; margin: 0.75rem 0; }
.good { color: #0a6b2d; }
.bad { color: #a11a1a; }
.warn { color: #8a5a00; }
textarea { font: inherit; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9rem; width: 100%; min-height: 8rem; border: 1px solid var(--field-border); border-radius: 4px; padding: 0.5rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 1rem; }
td input { min-width: 5rem; padding: 0.3rem; }
td input.wide { min-width: 9rem; }
.buy { text-align: center; margin: 1rem 0 0.5rem; }
.buy .btn { font-size: 1.15rem; padding: 0.75rem 1.5rem; }
.checklist li { margin-bottom: 0.4rem; }
.flag { font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
@media print { .site-header, .site-footer, .no-print, .skip-link { display: none !important; } .print-only { display: block !important; } body { font-size: 11pt; } }
.print-only { display: none; }
td.url { word-break: break-all; min-width: 12rem; }
details summary { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.cell-sub { display: block; color: var(--muted); font-size: 0.85rem; }
@media (max-width: 30rem) { .grid { grid-template-columns: 1fr; } }
blockquote.dot { background: var(--panel); }
.verdict { font-size: 1.15rem; font-weight: 700; }
pre.letter { white-space: pre-wrap; background: var(--panel); border: 1px solid var(--line); padding: 0.75rem; border-radius: 4px; font-family: inherit; }
.q { margin-bottom: 1rem; }
.q label { font-weight: 400; display: flex; gap: 0.4rem; align-items: flex-start; margin: 0.2rem 0; }
.q legend { font-weight: 700; }
input[type=radio] { width: auto; margin-right: 0.35rem; }
.results-list { list-style: none; padding-left: 0; }
.results-list li { margin: 0.3rem 0; font-weight: 600; }
.src { font-size: 0.9rem; color: #555; }
.fit-gpu { background: #e3f2e3; } .fit-offload, .fit-cpu { background: #fdf3d8; } .fit-no { background: #f8e1e1; color: #6b1d1d; }
pre.cmd { white-space: pre-wrap; word-break: break-all; background: #f4f4f1; padding: 0.6rem; border-radius: 6px; }
