/* luzmcp — public site. No inline styles anywhere (CSP style-src 'self'). */

:root {
  color-scheme: light dark;
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-2: #f0efe9;
  --text: #1b1c1e;
  --muted: #55585e;
  --border: #d9d8d0;
  --accent: #b25000;        /* amber, AA on white */
  --accent-strong: #8a3d00;
  --accent-contrast: #ffffff;
  --link: #0b5cad;
  --ok: #17703a;
  --ok-bg: #e3f4e8;
  --bad: #a3231b;
  --bad-bg: #fbe7e5;
  --warn: #7a5200;
  --warn-bg: #fff3d6;
  --info-bg: #e7f0fb;
  --green: #1e6b34;
  --green-bg: #e1f2e5;
  --focus: #0b5cad;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 2px 8px rgb(0 0 0 / 4%);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141518;
    --surface: #1c1e22;
    --surface-2: #24272c;
    --text: #ebebea;
    --muted: #a9adb4;
    --border: #363a41;
    --accent: #ffad5c;
    --accent-strong: #ffc285;
    --accent-contrast: #1b1c1e;
    --link: #8cc4ff;
    --ok: #7fd99a;
    --ok-bg: #173322;
    --bad: #ff9b92;
    --bad-bg: #3a1c1a;
    --warn: #ffd27a;
    --warn-bg: #3a2e12;
    --info-bg: #1b2a3c;
    --green: #8fdca3;
    --green-bg: #183020;
    --focus: #8cc4ff;
    --shadow: none;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

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

h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

code, pre, kbd { font-family: var(--mono); font-size: .9em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; overflow-wrap: anywhere; }
pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  overflow-x: auto;
  line-height: 1.45;
  margin: 0 0 1rem;
}
pre code { background: none; padding: 0; overflow-wrap: normal; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.skip-link:focus { left: .5rem; top: .5rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.wrap { width: min(1100px, 100%); margin: 0 auto; padding: 0 1rem; }
.narrow { width: min(720px, 100%); }

/* ------------------------------------------------------------------ header / footer */

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; padding-block: .7rem; }
.brand { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; }
.site-nav a { display: block; padding: .35rem .65rem; border-radius: 6px; color: var(--text); text-decoration: none; }
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="page"] { background: var(--surface-2); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }

.site-footer { margin-top: 3rem; border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .9rem; }
.site-footer .wrap { padding-block: 1.5rem; display: grid; gap: .6rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }

/* ------------------------------------------------------------------ hero */

.hero { padding: 2.5rem 0 1.5rem; }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.features { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.features li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; }
.features strong { display: block; margin-bottom: .2rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }

/* ------------------------------------------------------------------ cards & panels */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
  margin: 0 0 1.5rem;
}
.panel > h2:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* ------------------------------------------------------------------ forms */

fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem 1rem; margin: 0 0 1rem; min-width: 0; }
legend { font-weight: 650; padding: 0 .35rem; }
label { display: block; font-weight: 550; margin-bottom: .25rem; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .88rem; margin-top: .15rem; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .55rem .65rem;
  min-height: 44px;
}
input[type="file"] { padding: .45rem; }
input:invalid:not(:placeholder-shown) { border-color: var(--bad); }
input[readonly] { background: var(--surface-2); }

.field { margin-bottom: .85rem; }
.grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid-2 { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.choice { display: flex; align-items: flex-start; gap: .5rem; font-weight: 450; margin: .3rem 0; cursor: pointer; }
.choice input { width: 1.15rem; height: 1.15rem; margin: .2rem 0 0; flex: none; accent-color: var(--accent); }
.choices-inline { display: flex; flex-wrap: wrap; gap: .2rem 1.4rem; margin-bottom: .6rem; }

.input-with-button { display: flex; gap: .5rem; }
.input-with-button input { flex: 1; min-width: 0; }

button,
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600;
  min-height: 44px; padding: .5rem 1.1rem;
  border-radius: 8px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-contrast);
  text-decoration: none; cursor: pointer;
}
button:hover, .button:hover { background: var(--accent-strong); }
button:disabled { opacity: .6; cursor: progress; }
button.secondary, .button.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
button.secondary:hover, .button.secondary:hover { background: var(--surface-2); }
button.link { background: none; border: 0; color: var(--link); padding: 0 .2rem; min-height: 0; text-decoration: underline; font-weight: 500; }

.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .4rem; }

details.help { background: var(--info-bg); border-radius: 8px; padding: .5rem .8rem; margin: 0 0 .9rem; }
details.help summary { cursor: pointer; font-weight: 600; }
details.help[open] summary { margin-bottom: .5rem; }

/* ------------------------------------------------------------------ messages */

.msg { border-radius: 8px; padding: .75rem 1rem; margin: 0 0 1rem; border: 1px solid transparent; }
.msg > :last-child { margin-bottom: 0; }
.msg ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.msg-error { background: var(--bad-bg); color: var(--bad); border-color: currentcolor; }
.msg-ok { background: var(--ok-bg); color: var(--ok); border-color: currentcolor; }
.msg-warn { background: var(--warn-bg); color: var(--warn); border-color: currentcolor; }
.msg-info { background: var(--info-bg); }
.msg-error a, .msg-warn a, .msg-ok a { color: inherit; font-weight: 600; }

.loading::after {
  content: ""; display: inline-block; width: 1em; height: 1em; margin-left: .5em; vertical-align: -.15em;
  border: 2px solid currentcolor; border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading::after { animation: none; } }

/* ------------------------------------------------------------------ key box */

.keybox { border-left: 4px solid var(--accent); }
.keybox .status { font-size: .9rem; margin: .4rem 0 0; }

.secret {
  font-family: var(--mono); font-size: 1rem; word-break: break-all;
  background: var(--surface-2); border: 1px dashed var(--accent); border-radius: 8px; padding: .8rem;
}

/* ------------------------------------------------------------------ results */

.summary-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 1rem; }
.stat { background: var(--surface-2); border-radius: 8px; padding: .6rem .8rem; }
.stat .label { display: block; color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.offers { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.offer {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; display: grid; gap: .5rem; box-shadow: var(--shadow);
}
.offer.best { border-color: var(--ok); border-width: 2px; }
.offer.current { border-style: dashed; }
.offer-head { display: flex; gap: .8rem; align-items: flex-start; }
.rank {
  flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700;
  background: var(--surface-2); font-variant-numeric: tabular-nums;
}
.offer.best .rank { background: var(--ok); color: var(--surface); }
.offer-title { flex: 1; min-width: 0; }
.offer-title h3 { margin: 0; overflow-wrap: anywhere; }
.offer-title .retailer { color: var(--muted); font-size: .95rem; }
.offer-total { text-align: right; flex: none; }
.offer-total .amount { font-size: 1.4rem; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.offer-total .per { display: block; color: var(--muted); font-size: .82rem; }
.savings { font-weight: 650; font-variant-numeric: tabular-nums; }
.savings.pos { color: var(--ok); }
.savings.neg { color: var(--bad); }

.badges { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.badge {
  display: inline-block; font-size: .8rem; font-weight: 600; line-height: 1.3;
  padding: .15rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
}
.badge-promo { background: var(--warn-bg); color: var(--warn); border-color: currentcolor; }
.badge-perm { background: var(--bad-bg); color: var(--bad); border-color: currentcolor; }
.badge-green { background: var(--green-bg); color: var(--green); border-color: currentcolor; }
.badge-stale { background: var(--warn-bg); color: var(--warn); border-style: dashed; }
.badge-req { background: var(--info-bg); }

.breakdown summary { cursor: pointer; color: var(--link); font-weight: 550; }
.breakdown table { margin-top: .5rem; }

table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.total td, tr.total th { font-weight: 750; border-top: 2px solid var(--text); border-bottom: 0; }
tr.sub td, tr.sub th { color: var(--muted); }
.table-scroll { overflow-x: auto; }

.excluded li { margin-bottom: .4rem; }
.disclaimers { font-size: .9rem; color: var(--muted); }
.disclaimers p { margin-bottom: .5rem; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0 0 1rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ catalogue */

.plans { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); list-style: none; margin: 0; padding: 0; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.plan h3 { margin: 0; overflow-wrap: anywhere; }
.plan dl.kv { margin: 0; font-size: .92rem; }
.plan .notes { font-size: .88rem; color: var(--muted); margin: 0; }
.plan .foot { margin-top: auto; font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem; }
.toolbar { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }

/* ------------------------------------------------------------------ docs */

.docs-layout { display: grid; gap: 2rem; }
.toc { font-size: .95rem; }
.toc ol { padding-left: 1.2rem; margin: 0; }
.toc li { margin: .2rem 0; }
.docs section { scroll-margin-top: 1rem; margin-bottom: 2.2rem; }
.endpoint { display: inline-block; font-family: var(--mono); font-weight: 600; background: var(--surface-2); padding: .1rem .45rem; border-radius: 6px; }
.method { color: var(--accent); }

@media (min-width: 900px) {
  .docs-layout { grid-template-columns: 220px 1fr; }
  .toc { position: sticky; top: 1rem; align-self: start; }
}

/* ------------------------------------------------------------------ small screens */

@media (max-width: 520px) {
  .offer-head { flex-wrap: wrap; }
  .offer-total { text-align: left; width: 100%; padding-left: 3rem; }
  .panel { padding: 1rem .85rem; }
  dl.kv { grid-template-columns: 1fr; gap: 0; }
  dl.kv dd { margin-bottom: .4rem; }
}

[hidden] { display: none !important; }

.toc h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
