/* main.css — Asuntokaupat v2 utility + component styles.
 * Reads tokens from tokens.css. Scope is everything inside <body class="v2">.
 *
 * Naming: `ak-` prefix for components, BEM-ish for variants.
 * Avoids global resets that would interfere with the legacy Tailwind site
 * still served at ?ui=v1.
 */

/* ── Reset (scoped to v2 body) ───────────────────────────────────────────── */
body.v2 {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.v2 *, body.v2 *::before, body.v2 *::after { box-sizing: border-box; }
body.v2 a { color: inherit; }
body.v2 button { font: inherit; }
/* Components that explicitly use display:flex etc. can otherwise win over the
   user-agent [hidden] rule. Force the HTML hidden attribute to actually hide. */
body.v2 [hidden] { display: none !important; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.ak-container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.ak-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247,247,245,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-rule);
}
.ak-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px var(--pad-x);
  max-width: var(--maxw);
  margin: 0 auto;
}
.ak-nav-left  { display: flex; align-items: center; gap: 36px; }
.ak-nav-links { display: flex; gap: 22px; font-size: 13.5px; font-weight: 500; }
.ak-nav-links a {
  color: var(--c-muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
}
.ak-nav-links a.active {
  color: var(--c-ink);
  border-bottom-color: var(--c-ink);
}
.ak-nav-actions { display: flex; align-items: center; gap: 14px; font-size: 13.5px; }
.ak-nav-lang {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--c-muted);
  padding: 0;
}
.ak-nav-lang .on  { color: var(--c-ink); font-weight: 600; }
.ak-nav-lang .off { color: var(--c-dim); font-weight: 600; }
.ak-btn-text  { color: var(--c-muted); font-weight: 500; text-decoration: none; }
.ak-btn-solid {
  background: var(--c-ink);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--r-md);
  font-weight: 500;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.ak-nav-burger {
  display: none;
  background: transparent;
  border: 0;
  padding: 6px;
  cursor: pointer;
  color: var(--c-ink);
}

/* ── Logo ────────────────────────────────────────────────────────────────── */
.ak-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.ak-logo-mark {
  width: 26px; height: 26px;
  background: var(--c-ink);
  border-radius: 7px;
  position: relative;
}
.ak-logo-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  background: var(--c-accent);
  border-radius: 3px;
}
.ak-logo-text { font-size: 15px; font-weight: 600; letter-spacing: -0.3px; color: var(--c-ink); }
.ak-logo-text .tld { color: var(--c-muted); font-weight: 500; }

/* ── Buttons / pills ─────────────────────────────────────────────────────── */
.ak-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1px;
  border: 1px solid var(--c-rule);
  background: var(--c-bg2);
  color: var(--c-ink2);
}
.ak-pill--accent { background: var(--c-accent-soft); color: var(--c-accent); border-color: transparent; }
.ak-pill--warn   { background: var(--c-warn-soft);   color: var(--c-warn);   border-color: transparent; }
.ak-pill--bad    { background: var(--c-bad-soft);    color: var(--c-bad);    border-color: transparent; }

/* ── Eyebrow + headings ──────────────────────────────────────────────────── */
.ak-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--c-muted);
  font-weight: 600;
}
.ak-eyebrow--accent { color: var(--c-accent); }

/* ── Cards / surfaces ────────────────────────────────────────────────────── */
.ak-card {
  background: var(--c-panel);
  border: 1px solid var(--c-rule);
  border-radius: var(--r-2xl);
}
.ak-callout {
  border-radius: var(--r-lg);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.6;
  background: var(--c-bg2);
  border: 1px solid var(--c-rule);
}
.ak-callout--accent { background: var(--c-accent-soft); border-color: rgba(59,90,64,0.33); }
.ak-callout--warn   { background: var(--c-warn-soft);   border-color: rgba(176,122,44,0.33); }

/* ── Info-page layout (privacy / terms / about) ──────────────────────────── */
.ak-info-hero {
  border-bottom: 1px solid var(--c-rule);
  background: var(--c-panel);
}
.ak-info-hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px var(--pad-x);
}
.ak-info-hero h1 {
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -1.5px;
  line-height: 1.05;
  margin: 10px 0 14px;
  max-width: 720px;
}
.ak-info-lede {
  font-size: 16px;
  color: var(--c-muted);
  line-height: 1.55;
  margin: 0;
  max-width: 680px;
}
.ak-info-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 48px var(--pad-x) 80px;
}
.ak-info-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: flex-start;
}
.ak-info-toc {
  position: sticky;
  top: 88px;
}
.ak-info-toc-label {
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--c-muted);
  font-family: var(--font-mono);
  font-weight: 600;
  margin-bottom: 14px;
}
.ak-info-toc nav { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.ak-info-toc nav a {
  padding: 8px 12px 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--c-muted);
  border-left: 2px solid transparent;
}
.ak-info-toc nav a.active {
  color: var(--c-ink);
  font-weight: 500;
  background: var(--c-bg2);
  border-left-color: var(--c-accent);
}
.ak-info-body {
  min-width: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--c-ink2);
}
.ak-info-body h2 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.7px;
  margin: 48px 0 16px;
  scroll-margin-top: 100px;
  color: var(--c-ink);
}
.ak-info-body h2:first-child { margin-top: 0; }
.ak-info-body h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 28px 0 10px;
  color: var(--c-ink);
}
.ak-info-body p { margin: 12px 0; text-wrap: pretty; }
.ak-info-body ul { margin: 12px 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.ak-info-body a { color: var(--c-accent); font-weight: 500; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.ak-footer { background: var(--c-panel); border-top: 1px solid var(--c-rule); margin-top: 0; }
.ak-foot-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px var(--pad-x) 32px;
  display: grid;
  grid-template-columns: minmax(0,1.4fr) repeat(3, minmax(0,1fr));
  gap: 48px;
}
.ak-foot-tagline {
  font-size: 13.5px;
  color: var(--c-muted);
  line-height: 1.6;
  margin-top: 16px;
  max-width: 320px;
}
.ak-foot-meta {
  margin-top: 18px;
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--c-muted);
  font-family: var(--font-mono);
}
.ak-foot-col h4 {
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--c-muted);
  font-weight: 600;
  margin: 0 0 14px;
}
.ak-foot-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ak-foot-col a { font-size: 13.5px; color: var(--c-ink2); text-decoration: none; }
.ak-foot-bottom {
  border-top: 1px solid var(--c-rule);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px var(--pad-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--c-muted);
  font-family: var(--font-mono);
}

/* ── Finder page ─────────────────────────────────────────────────────────── */
.ak-fnd-header {
  border-bottom: 1px solid var(--c-rule); background: var(--c-bg);
  padding: 32px var(--pad-x) 28px;
}
.ak-fnd-header-inner { max-width: var(--maxw); margin: 0 auto; }
.ak-fnd-header h1 {
  font-size: clamp(32px, 4vw, 44px); font-weight: 600; letter-spacing: -1.2px;
  margin: 0; line-height: 1.05;
}
.ak-fnd-header p.lede {
  font-size: 15px; color: var(--c-muted); margin: 10px 0 0; max-width: 620px; line-height: 1.55;
}

.ak-fnd-body {
  max-width: var(--maxw); margin: 0 auto; padding: 28px var(--pad-x) 80px;
}
.ak-fnd-grid {
  display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 28px;
}

/* Filter sidebar */
.ak-fnd-side {
  background: var(--c-panel); border: 1px solid var(--c-rule); border-radius: 14px;
  overflow: hidden; position: sticky; top: 80px; align-self: start;
}
.ak-fnd-side-head {
  padding: 18px 20px 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.ak-fnd-side-head .title { font-size: 15px; font-weight: 600; }
.ak-fnd-side-head .count { font-size: 11.5px; color: var(--c-muted); margin-top: 3px; }
.ak-fnd-reset {
  background: transparent; border: 0; font-size: 12px; color: var(--c-muted);
  cursor: pointer; padding: 4px; text-decoration: underline; text-underline-offset: 3px;
}
.ak-fnd-suggested-btn {
  width: 100%; padding: 9px 12px; margin: 0 20px 14px;
  background: var(--c-accent-soft); border: 1px solid rgba(59,90,64,0.2);
  border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--c-accent);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: inherit;
  width: calc(100% - 40px);
}

/* Filter sections */
.ak-fnd-sect { border-top: 1px solid var(--c-rule); }
.ak-fnd-sect[data-locked] { opacity: 0.55; }
.ak-fnd-sect-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: transparent; border: 0; cursor: pointer; text-align: left;
}
.ak-fnd-sect-title { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: var(--c-ink); }
.ak-fnd-sect[data-locked] .ak-fnd-sect-title { color: var(--c-muted); }
.ak-fnd-sect-count {
  font-size: 11px; color: var(--c-accent); background: var(--c-accent-soft);
  padding: 2px 8px; border-radius: 999px; font-weight: 600;
}
.ak-fnd-sect-body { padding: 0 20px 20px; }
.ak-fnd-sect[data-locked] .ak-fnd-sect-body { pointer-events: none; }
.ak-fnd-sect[data-collapsed] .ak-fnd-sect-body { display: none; }

.ak-fnd-field { margin-bottom: 14px; }
.ak-fnd-field-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; font-weight: 600; color: var(--c-ink2); margin-bottom: 7px;
}
.ak-fnd-field-hint { font-size: 11px; color: var(--c-dim); font-family: var(--font-mono); }
.ak-fnd-field input[type="number"],
.ak-fnd-field input[type="text"],
.ak-fnd-field select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--c-rule); border-radius: 8px;
  font-size: 13px; font-family: inherit; color: var(--c-ink); background: var(--c-panel);
}
.ak-fnd-field input:focus, .ak-fnd-field select:focus {
  outline: 0; border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft);
}
.ak-fnd-pair {
  display: flex; gap: 0; border: 1px solid var(--c-rule); border-radius: 8px;
  background: var(--c-panel); overflow: hidden;
}
.ak-fnd-pair input {
  flex: 1; min-width: 0; padding: 10px 12px;
  border: 0; outline: 0; background: transparent;
  font-size: 13.5px; font-family: var(--font-mono); color: var(--c-ink);
}
.ak-fnd-pair .sep { align-self: center; padding: 0 6px; font-size: 12px; color: var(--c-dim); font-family: var(--font-mono); }
.ak-fnd-pair .suffix { align-self: center; padding: 0 12px 0 6px; font-size: 12px; color: var(--c-muted); font-family: var(--font-mono); }
.ak-fnd-segments {
  display: flex; gap: 0; border: 1px solid var(--c-rule);
  border-radius: 8px; padding: 3px; background: var(--c-bg);
}
.ak-fnd-segments button {
  flex: 1; padding: 7px 10px; background: transparent; border: 0; border-radius: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--c-muted); cursor: pointer; font-family: inherit;
}
.ak-fnd-segments button[aria-pressed="true"] {
  background: var(--c-panel); color: var(--c-ink); font-weight: 600;
  box-shadow: 0 1px 0 rgba(14,18,19,0.04);
}
.ak-fnd-checks { display: flex; flex-direction: column; gap: 6px; }
.ak-fnd-checks label {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: 12.5px; color: var(--c-ink2);
}
.ak-fnd-amenities { display: flex; flex-direction: column; gap: 8px; }
.ak-fnd-amenities label {
  display: flex; align-items: center; justify-content: space-between; cursor: pointer;
  font-size: 12.5px; color: var(--c-ink2);
}
.ak-switch { position: relative; display: inline-block; width: 32px; height: 18px; }
.ak-switch input { opacity: 0; width: 0; height: 0; }
.ak-switch .track { position: absolute; inset: 0; cursor: pointer; background: var(--c-rule); border-radius: 999px; transition: background .15s; }
.ak-switch .track::before {
  content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px;
  background: #fff; border-radius: 999px; box-shadow: 0 1px 2px rgba(0,0,0,.15);
  transition: transform .15s;
}
.ak-switch input:checked + .track { background: var(--c-accent); }
.ak-switch input:checked + .track::before { transform: translateX(14px); }

.ak-fnd-actions {
  border-top: 1px solid var(--c-rule); padding: 14px 20px; background: var(--c-bg);
  display: flex; flex-direction: column; gap: 8px;
}
.ak-fnd-apply {
  width: 100%; padding: 12px 16px; background: var(--c-ink); color: #fff;
  border: 0; border-radius: 8px; font-size: 13.5px; font-weight: 500; cursor: pointer; font-family: inherit;
}

/* Results column */
.ak-fnd-main { min-width: 0; }
.ak-fnd-sortbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; gap: 10px; flex-wrap: wrap;
}
.ak-fnd-sortbar .left { display: flex; align-items: center; gap: 12px; }
.ak-fnd-sortbar select { padding: 7px 12px; border: 1px solid var(--c-rule); border-radius: 6px; background: var(--c-panel); font-size: 13px; color: var(--c-ink); font-weight: 500; }
.ak-fnd-sortbar .right { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--c-muted); font-family: var(--font-mono); }

.ak-fnd-kpi {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border: 1px solid var(--c-rule); border-radius: 12px; background: var(--c-panel); overflow: hidden;
}
.ak-fnd-kpi-cell { padding: 16px 20px; border-right: 1px solid var(--c-rule); }
.ak-fnd-kpi-cell:last-child { border-right: 0; }
.ak-fnd-kpi-label { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--c-muted); font-family: var(--font-mono); font-weight: 600; }
.ak-fnd-kpi-value { font-size: 24px; font-weight: 600; letter-spacing: -0.6px; margin-top: 4px; color: var(--c-ink); }
.ak-fnd-kpi-value.accent { color: var(--c-accent); }
.ak-fnd-kpi-sub { font-size: 12px; color: var(--c-muted); margin-top: 2px; }

.ak-fnd-banner {
  margin-top: 14px; padding: 12px 16px;
  background: #FBF6E8; border: 1px solid #ECDDB0; color: #7A5C16;
  border-radius: 10px; font-size: 13.5px; line-height: 1.5;
  display: flex; gap: 10px; align-items: flex-start;
}

.ak-fnd-table-wrap { background: var(--c-panel); border: 1px solid var(--c-rule); border-radius: 14px; margin-top: 18px; overflow: hidden; }
.ak-fnd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ak-fnd-table thead { background: var(--c-bg); }
.ak-fnd-table th {
  text-align: left; padding: 11px 16px; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--c-muted); font-family: var(--font-mono); font-weight: 600;
  border-bottom: 1px solid var(--c-rule); white-space: nowrap;
}
.ak-fnd-table th.right, .ak-fnd-table td.right { text-align: right; }
.ak-fnd-table td { padding: 16px; border-bottom: 1px solid var(--c-rule3); vertical-align: top; }
.ak-fnd-row-postcode { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.ak-fnd-row-area { font-size: 12px; color: var(--c-muted); }
.ak-fnd-row-street { font-size: 14px; color: var(--c-ink); margin-top: 4px; font-weight: 500; letter-spacing: -0.1px; }
.ak-fnd-row-meta { font-size: 12px; color: var(--c-muted); margin-top: 2px; font-family: var(--font-mono); }
.ak-fnd-row-price { font-size: 15px; font-weight: 600; font-family: var(--font-mono); letter-spacing: -0.3px; }
.ak-fnd-row-ppm { font-size: 12px; color: var(--c-muted); font-family: var(--font-mono); margin-top: 2px; }
.ak-fnd-row-pred { font-size: 15px; font-weight: 600; color: var(--c-accent); font-family: var(--font-mono); letter-spacing: -0.3px; }
.ak-fnd-uv-pill {
  display: inline-flex; padding: 4px 10px; border-radius: 6px;
  font-size: 13px; font-weight: 600; font-family: var(--font-mono);
}
.ak-fnd-uv-pill.high { background: var(--c-accent); color: #fff; }
.ak-fnd-uv-pill.mid  { background: var(--c-accent-soft); color: var(--c-accent); }
.ak-fnd-status-online  { background: var(--c-status-online-bg);  color: var(--c-status-online-fg); }
.ak-fnd-status-offline { background: var(--c-status-offline-bg); color: var(--c-status-offline-fg); }
.ak-fnd-status-error   { background: var(--c-status-error-bg);   color: var(--c-status-error-fg); }
.ak-fnd-status-unknown { background: var(--c-status-unknown-bg); color: var(--c-status-unknown-fg); }
.ak-fnd-status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; font-family: var(--font-mono); letter-spacing: 0.3px;
}
.ak-fnd-status-pill .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

.ak-fnd-loading { padding: 60px 20px; text-align: center; color: var(--c-muted); font-family: var(--font-mono); font-size: 13px; }
.ak-fnd-empty { padding: 60px 20px; text-align: center; color: var(--c-muted); }
.ak-fnd-empty h3 { color: var(--c-ink); font-size: 18px; font-weight: 600; margin: 0 0 8px; }

@media (max-width: 960px) {
  .ak-fnd-grid { grid-template-columns: 1fr; }
  .ak-fnd-side { position: static; }
  .ak-fnd-kpi { grid-template-columns: 1fr 1fr; }
  .ak-fnd-kpi-cell:nth-child(2) { border-right: 0; }
  .ak-fnd-kpi-cell:nth-child(1), .ak-fnd-kpi-cell:nth-child(2) { border-bottom: 1px solid var(--c-rule); }
}

/* ── Homepage ────────────────────────────────────────────────────────────── */
.ak-hero { background: var(--c-bg); padding-bottom: 80px; }
.ak-hero-grid {
  max-width: var(--maxw); margin: 0 auto;
  padding: 72px var(--pad-x) 0;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px; align-items: start;
}
.ak-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px;
  background: var(--c-accent-soft); border: 1px solid rgba(59,90,64,0.13);
  border-radius: 999px; font-size: 12px; color: var(--c-accent);
  font-weight: 500; margin-bottom: 26px;
}
.ak-hero-badge .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--c-accent); }
.ak-hero h1 {
  font-size: clamp(40px, 5.2vw, 68px);
  line-height: 1; font-weight: 500;
  letter-spacing: -2px; margin: 0; color: var(--c-ink);
  text-wrap: balance;
}
.ak-hero p.lede {
  font-size: 18px; line-height: 1.55; color: var(--c-muted);
  margin-top: 22px; max-width: 520px;
}
.ak-hero-form {
  margin-top: 32px;
  background: var(--c-panel); border: 1px solid var(--c-rule); border-radius: 14px;
  padding: 8px; box-shadow: var(--shadow-card);
  max-width: 540px;
  display: flex; align-items: center; gap: 6px;
}
.ak-hero-form .ak-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; flex: 1;
}
.ak-hero-form input {
  border: 0; outline: 0; background: transparent;
  font-size: 16px; flex: 1; font-family: inherit; color: var(--c-ink);
}
.ak-hero-form button {
  padding: 11px 18px; background: var(--c-ink); color: #fff;
  border-radius: 8px; font-size: 13px; font-weight: 500;
  border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.ak-hero-or {
  margin-top: 18px; display: flex; gap: 14px; align-items: center;
}
.ak-hero-or .label { font-size: 13px; color: var(--c-muted); font-weight: 500; }
.ak-hero-or a {
  padding: 8px 14px; background: var(--c-panel);
  border: 1px solid var(--c-rule); border-radius: 8px;
  font-size: 13px; color: var(--c-ink); font-weight: 500;
  text-decoration: none;
}

.ak-section { padding: 88px 0; }
.ak-section--alt { background: var(--c-panel); border-top: 1px solid var(--c-rule); border-bottom: 1px solid var(--c-rule); }
.ak-section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 32px; gap: 16px; flex-wrap: wrap;
}
.ak-section-head h2 { font-size: 36px; font-weight: 600; letter-spacing: -1.2px; margin: 0; }
.ak-section-head .sub { font-size: 15px; color: var(--c-muted); margin: 8px 0 0; }
.ak-section-head .source { font-size: 12px; color: var(--c-muted); font-family: var(--font-mono); text-align: right; }

.ak-postcode-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.ak-postcode-card {
  background: var(--c-bg); border: 1px solid var(--c-rule); border-radius: 12px; padding: 20px;
}
.ak-postcode-card a { text-decoration: none; color: inherit; }
.ak-postcode-card .code { font-size: 18px; font-weight: 600; font-family: var(--font-mono); letter-spacing: -0.3px; }
.ak-postcode-card .name { font-size: 13px; color: var(--c-muted); margin-top: 2px; }
.ak-postcode-card .change-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px;
}
.ak-postcode-card .change-pill.up   { color: var(--c-accent); background: var(--c-accent-soft); }
.ak-postcode-card .change-pill.down { color: var(--c-warn);   background: var(--c-warn-soft); }
.ak-postcode-card .tx { font-size: 32px; font-weight: 600; letter-spacing: -1px; }
.ak-postcode-card .tx-label { font-size: 13px; color: var(--c-muted); }
.ak-postcode-card .vs { font-size: 12px; color: var(--c-muted); margin-top: 4px; }
.ak-postcode-card .ppm-row {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--c-rule);
  display: flex; justify-content: space-between; font-size: 13px;
}
.ak-postcode-card .ppm-label { color: var(--c-muted); }
.ak-postcode-card .ppm-value { font-weight: 600; font-family: var(--font-mono); }
.ak-postcode-card .view-link {
  margin-top: 14px; font-size: 13px; color: var(--c-ink); font-weight: 500;
  text-decoration: none; display: block;
}

.ak-what-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  max-width: 980px; margin: 0 auto; padding: 0 var(--pad-x);
}
.ak-what-card {
  background: var(--c-panel); border: 1px solid var(--c-rule); border-radius: 14px;
  padding: 28px; text-decoration: none; color: inherit;
}
.ak-what-card .icon-wrap {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; margin-bottom: 18px;
}
.ak-what-card h3 { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: -0.4px; }
.ak-what-card p { font-size: 14px; color: var(--c-muted); line-height: 1.55; margin: 8px 0 18px; }
.ak-what-card .cta { font-size: 13px; color: var(--c-ink); font-weight: 600; }

.ak-howit {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px;
  margin-top: 48px; position: relative;
  max-width: 980px; margin-left: auto; margin-right: auto; padding: 0 var(--pad-x);
}
.ak-howit::before {
  content: ""; position: absolute; top: 22px; left: 16%; right: 16%; height: 1px;
  background: var(--c-rule); z-index: 0;
}
.ak-howit-step { text-align: center; position: relative; z-index: 1; }
.ak-howit-num {
  width: 44px; height: 44px; border-radius: 999px;
  background: var(--c-bg); border: 1px solid var(--c-rule); color: var(--c-accent);
  font-weight: 600; display: grid; place-items: center;
  margin: 0 auto 16px; font-size: 16px;
}
.ak-howit-step h3 { font-size: 16px; font-weight: 600; margin: 0; }
.ak-howit-step p { font-size: 13.5px; color: var(--c-muted); line-height: 1.55; margin: 6px auto 0; max-width: 240px; }

.ak-method-grid {
  max-width: 1080px; margin: 0 auto; padding: 0 var(--pad-x);
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 56px; align-items: start;
}
.ak-method-stats {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--c-rule);
  font-size: 13px; color: var(--c-muted); display: flex; gap: 18px;
}
.ak-method-stats .num { color: var(--c-ink); font-weight: 600; font-size: 18px; font-family: var(--font-mono); }
.ak-method-table {
  background: var(--c-panel); border: 1px solid var(--c-rule); border-radius: 14px; padding: 8px 0;
}
.ak-method-row { padding: 12px 24px; border-bottom: 1px solid var(--c-rule2); }
.ak-method-row:last-child { border-bottom: 0; }
.ak-method-row-head {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px;
}
.ak-method-row .label { font-size: 14px; font-weight: 600; color: var(--c-ink); }
.ak-method-row .sub { font-size: 12.5px; color: var(--c-muted); margin-left: 8px; }
.ak-method-row .pct { font-size: 14px; font-weight: 600; font-family: var(--font-mono); color: var(--c-ink); }
.ak-method-row .bar { height: 4px; background: var(--c-rule); border-radius: 999px; overflow: hidden; }
.ak-method-row .bar > span { display: block; height: 4px; background: var(--c-accent); border-radius: 999px; }

@media (max-width: 880px) {
  .ak-hero-grid { grid-template-columns: 1fr; padding: 56px 24px 0; }
  .ak-postcode-cards { grid-template-columns: 1fr 1fr; }
  .ak-what-grid { grid-template-columns: 1fr; }
  .ak-method-grid { grid-template-columns: 1fr; gap: 32px; }
  .ak-howit { grid-template-columns: 1fr; gap: 32px; }
  .ak-howit::before { display: none; }
  .ak-section-head h2 { font-size: 28px; }
}

/* ── Auth pages (login / register / forgot / verify) ─────────────────────── */
.ak-auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.ak-auth-left {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 56px; background: var(--c-bg);
}
.ak-auth-form {
  width: 100%; max-width: 380px; margin: auto;
  display: flex; flex-direction: column;
}
.ak-auth-form h1 {
  font-size: 24px; font-weight: 600; letter-spacing: -0.6px;
  margin: 8px 0 10px; line-height: 1.15;
}
.ak-auth-form p.lede {
  font-size: 14px; color: var(--c-muted); margin: 0 0 22px; line-height: 1.55;
}
.ak-auth-field { margin-bottom: 14px; }
.ak-auth-field label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; font-weight: 500; color: var(--c-ink2); margin-bottom: 6px;
}
.ak-auth-field input {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--c-rule); border-radius: var(--r-md);
  font-size: 14px; font-family: inherit;
  background: var(--c-panel); color: var(--c-ink);
}
.ak-auth-field input:focus {
  outline: 0;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-soft);
}
.ak-auth-error {
  background: var(--c-bad-soft); color: var(--c-bad);
  border-radius: var(--r-md); padding: 10px 14px; font-size: 13px;
  margin-bottom: 14px; line-height: 1.5;
}
.ak-auth-flash {
  background: var(--c-accent-soft); color: var(--c-accent-ink);
  border-radius: var(--r-md); padding: 10px 14px; font-size: 13px;
  margin-bottom: 14px; line-height: 1.5;
}
.ak-auth-flash.warn { background: var(--c-warn-soft); color: var(--c-warn); }
.ak-auth-flash.error { background: var(--c-bad-soft); color: var(--c-bad); }
.ak-auth-submit {
  width: 100%; padding: 12px 16px;
  background: var(--c-ink); color: #fff; border: 0; border-radius: var(--r-md);
  font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit;
}
.ak-auth-submit:hover { background: #1c2326; }
.ak-auth-or {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--c-dim); margin: 18px 0;
  font-family: var(--font-mono); letter-spacing: 1px;
}
.ak-auth-or::before, .ak-auth-or::after {
  content: ""; flex: 1; height: 1px; background: var(--c-rule);
}
.ak-auth-oauth {
  display: flex; gap: 10px;
}
.ak-auth-oauth a {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px; border: 1px solid var(--c-rule); border-radius: var(--r-md);
  background: var(--c-panel); color: var(--c-ink2); font-size: 13px; font-weight: 500;
  text-decoration: none;
}
.ak-auth-oauth a:hover { background: var(--c-bg2); }
.ak-auth-foot {
  margin-top: 22px; font-size: 13px; color: var(--c-muted); text-align: center;
}
.ak-auth-foot a { color: var(--c-ink); font-weight: 500; text-decoration: none; }
.ak-auth-meta {
  margin-top: 40px; font-size: 12px; color: var(--c-muted);
  font-family: var(--font-mono); text-align: center;
}
.ak-auth-meta a { color: inherit; }

.ak-auth-right {
  background: var(--c-ink); color: #fff;
  display: flex; flex-direction: column; justify-content: center;
  padding: 56px 64px; position: relative; overflow: hidden;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.02) 0, transparent 50%),
    radial-gradient(circle at 100% 0%, rgba(59,90,64,0.18), transparent 60%);
}
.ak-auth-right .eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.4px;
  text-transform: uppercase; color: rgba(255,255,255,0.5); font-weight: 600; margin-bottom: 16px;
}
.ak-auth-right h2 {
  font-size: 30px; font-weight: 600; letter-spacing: -1px; line-height: 1.1; margin: 0 0 36px;
  max-width: 420px;
}
.ak-mock-card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-xl); padding: 22px;
  max-width: 420px; margin-bottom: 36px;
}
.ak-mock-card .pill {
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  background: var(--c-accent); border-radius: 999px;
  font-family: var(--font-mono);
}
.ak-mock-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 12px;
}
.ak-mock-row .sub {
  font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase;
  color: rgba(255,255,255,0.5); font-family: var(--font-mono); font-weight: 600;
}
.ak-bullets { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.ak-bullets li {
  display: grid; grid-template-columns: 18px 1fr; gap: 12px;
  font-size: 13px; line-height: 1.5; color: rgba(255,255,255,0.85);
}
.ak-bullets li::before {
  content: "✓"; color: var(--c-accent); font-weight: 700;
}
.ak-bullets li b { color: #fff; font-weight: 600; }

@media (max-width: 880px) {
  .ak-auth { grid-template-columns: 1fr; }
  .ak-auth-right { display: none; }
  .ak-auth-left  { padding: 32px 24px; }
}

/* ── Generic modal + analyse button (used by Realised + Finder) ──────────── */
.ak-modal-bg {
  position: fixed; inset: 0; z-index: 100; background: rgba(14,18,19,0.5);
  display: grid; place-items: center; padding: 20px;
}
.ak-modal {
  width: 100%; max-width: 640px; max-height: min(720px, 90vh);
  background: var(--c-bg); border-radius: var(--r-2xl); overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow-pop);
}
.ak-modal-head {
  padding: 18px 22px; background: var(--c-panel); border-bottom: 1px solid var(--c-rule);
  display: flex; justify-content: space-between; align-items: center;
}
.ak-modal-body {
  padding: 22px; overflow-y: auto; font-size: 14px; line-height: 1.6; color: var(--c-ink2);
  white-space: pre-wrap;
}
.ak-modal-body .pending {
  color: var(--c-muted); font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 1px;
}
.ak-analyse-btn {
  padding: 6px 11px; border: 1px solid var(--c-rule); background: var(--c-panel);
  border-radius: var(--r-sm); font-size: 12px; font-weight: 500; color: var(--c-ink2);
  cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px;
}
.ak-analyse-btn:hover { background: var(--c-bg2); }

/* ── Favourite (heart) toggle button ─────────────────────────────────────── */
.ak-fav-btn {
  width: 30px; height: 30px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--c-rule); border-radius: var(--r-sm);
  background: var(--c-panel); color: var(--c-muted);
  cursor: pointer; padding: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.ak-fav-btn:hover { background: var(--c-bg2); color: var(--c-bad); }
.ak-fav-btn[aria-pressed="true"] {
  background: var(--c-bad-soft); color: var(--c-bad);
  border-color: rgba(176,68,68,0.3);
}
.ak-fav-btn[aria-pressed="true"] svg path { fill: currentColor; }
.ak-fav-btn[aria-busy="true"] { opacity: 0.55; pointer-events: none; }

/* ── Sparkline (homepage Top Markets cards) ──────────────────────────────── */
.ak-spark {
  display: block; height: 18px; margin-top: 8px;
  min-height: 18px;  /* prevent layout shift while loading */
}
.ak-spark svg { display: block; }

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .ak-nav-links { display: none; }
  .ak-nav-actions > .ak-btn-text,
  .ak-nav-actions > .ak-btn-solid { display: none; }
  .ak-nav-burger { display: inline-flex; }
  .ak-info-grid { grid-template-columns: 1fr; gap: 28px; }
  .ak-info-toc  { position: static; }
  .ak-foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; padding: 40px 20px 24px; }
  .ak-foot-grid > div:first-child { grid-column: 1 / -1; }
  .ak-info-hero h1 { font-size: 36px; }
}
@media (max-width: 480px) {
  .ak-foot-grid { grid-template-columns: 1fr; }
}
