/* KLOO Hub — Direction A ("Round tiles"), locked in by Adam 2026-09-26.
   Restyled straight onto the kloo-design tokens (skills/kloo-design/colors_and_type.css),
   Claude Design skipped. Layout spec: docs/kloo-hub/stitch/a-round-tiles/ (home.png,
   cs.png, home.html). Fonts are self-hosted in /fonts (copied from kloo-design). */

@font-face { font-family: 'Prompt'; src: url('/fonts/Prompt-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Prompt'; src: url('/fonts/Prompt-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Prompt'; src: url('/fonts/Prompt-SemiBold.ttf') format('truetype'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'Prompt'; src: url('/fonts/Prompt-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }

:root {
  /* brand (kloo-design) */
  --kloo-lavender: #9395dd;
  --kloo-lavender-50: #f3f3fb;
  --kloo-lavender-100: #e6e7f6;
  --kloo-lavender-200: #c8caee;
  --kloo-lavender-600: #6f72c3;
  --kloo-lavender-800: #3c3f7a;
  --kloo-mint: #1ceaab;
  --kloo-mint-50: #e7fff5;
  --kloo-mint-600: #14b884;
  --kloo-cream: #f9f8ee;
  --kloo-paper: #fefdf9;
  --kloo-ink: #121212;
  --kloo-ink-3: #5a5963;
  --kloo-ink-4: #8a8993;
  --kloo-rule: #e3e0d6;

  /* semantic (status dots) */
  --status-green: #14b884;
  --status-amber: #f0a020;
  --status-red: #e0445a;
  --status-unknown: #b9b8c0;

  /* roles */
  --bg: var(--kloo-cream);
  --surface: var(--kloo-paper);
  --text: var(--kloo-ink);
  --muted: var(--kloo-ink-3);
  --faint: var(--kloo-ink-4);
  --accent: var(--kloo-lavender);
  --accent-strong: var(--kloo-lavender-600);
  --cta: var(--kloo-mint);
  --line: var(--kloo-rule);

  --font-display: 'Prompt', system-ui, sans-serif;
  --font-body: 'Prompt', system-ui, sans-serif;  /* Futura Cyrillic lacks Polish diacritics */
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(22, 21, 26, 0.04);
  --shadow-2: 0 4px 14px rgba(22, 21, 26, 0.06);
  --nav-h: 68px;
  --gutter: 16px;
  --track: .12em;
  --track-wide: .16em;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; margin: 0; }
a { color: var(--accent-strong); }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px; border: 0; border-radius: 999px;
  background: var(--cta); color: var(--kloo-ink);
  font-family: var(--font-display); font-weight: 600; font-size: 16px; text-decoration: none;
}
.btn.secondary { background: var(--kloo-lavender-100); color: var(--kloo-lavender-800); }
.btn.ghost { background: transparent; color: var(--accent-strong); border: 1.5px solid var(--kloo-lavender-200); }
.btn.danger { background: #fde8eb; color: #9b1c2e; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }

.eyebrow {
  font-family: var(--font-display); font-weight: 500; font-size: 11px;
  letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--faint);
}

.muted { color: var(--muted); }
.small { font-size: 14px; }
.error { color: #b3261e; }
.center { text-align: center; }

/* ---------- app shell ---------- */
.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding: calc(env(safe-area-inset-top) + 16px) var(--gutter) calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px); }
.view { animation: fade 0.18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.signin { min-height: 80dvh; display: flex; flex-direction: column; justify-content: center; gap: 20px; text-align: center; }
.signin .logo { width: 140px; margin: 0 auto 12px; }
.signin h1 { font-size: 28px; }

/* ---------- home header ---------- */
.app-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.app-header .wordmark { display: flex; align-items: center; gap: 8px; }
.app-header .wordmark img { height: 15px; display: block; }
.app-header .wordmark .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cta); }
.app-header .icon-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.avatar { background: var(--kloo-lavender-50); color: var(--accent-strong); font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: 0; }

.greeting { font-size: 24px; margin: 10px 0 2px; }
.eyebrow-date { margin: 0 0 18px; }
.demo-banner { background: var(--kloo-mint-50); color: #0d7654; border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }

/* ---------- hero card ---------- */
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%;
  text-align: left; border: 0; background: var(--accent); color: var(--text);
  border-radius: var(--radius); padding: 18px 18px; box-shadow: var(--shadow-2); margin-bottom: 26px;
}
.hero .copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hero .eyebrow { color: rgba(18, 18, 18, 0.62); }
.hero .t { font-family: var(--font-display); font-weight: 500; font-size: 17px; line-height: 1.25; color: var(--text); }
.hero .cta {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--cta); color: var(--kloo-ink); font-family: var(--font-display); font-weight: 600;
  font-size: 14px; padding: 10px 18px; border-radius: 999px; white-space: nowrap;
}
.hero.calm { background: var(--kloo-lavender-100); }
.hero.calm .eyebrow { color: var(--kloo-lavender-800); opacity: .75; }
.hero.calm .t { color: var(--kloo-lavender-800); }
.hero.calm .cta { background: var(--surface); color: var(--accent-strong); border: 1px solid var(--kloo-lavender-200); }

/* ---------- key metrics section ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.section-head .eyebrow { color: var(--muted); }
.section-head .updated { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 10px; }
.tile { background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text); min-width: 0; }
.tile .circle {
  position: relative; width: 76px; height: 76px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--accent-strong);
}
.tile .circle svg { width: 28px; height: 28px; }
.tile .dot { position: absolute; top: 4px; right: 4px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--bg); }
.dot.green { background: var(--status-green); }
.dot.amber { background: var(--status-amber); }
.dot.red { background: var(--status-red); }
.dot.unknown { background: var(--status-unknown); }
.tile .title { font-family: var(--font-display); font-weight: 500; font-size: 10.5px; letter-spacing: var(--track); text-transform: uppercase; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tile .value { font-family: var(--font-display); font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-variant-numeric: tabular-nums; }
.tile .value.locked, .tile .value.none { color: var(--faint); font-weight: 400; font-size: 13px; font-style: italic; }
.tile .secondary { font-size: 12px; line-height: 16px; height: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; text-align: center; font-variant-numeric: tabular-nums; }
.tile .badge { position: absolute; bottom: -2px; right: -2px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--status-red); color: #fff; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }

.skeleton .circle { background: var(--kloo-lavender-50); border-color: transparent; }

/* ---------- bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.nav button { border: 0; background: none; color: var(--faint); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-family: var(--font-display); font-weight: 500; font-size: 10.5px; letter-spacing: var(--track); text-transform: uppercase; }
.nav button svg { width: 22px; height: 22px; }
.nav button[aria-current='page'] { color: var(--accent-strong); font-weight: 600; }

.soon { text-align: center; padding: 64px 12px; }
.soon .pill { display: inline-block; background: var(--kloo-mint-50); color: #0d7654; padding: 4px 12px; border-radius: 999px; font-size: 13px; margin-bottom: 12px; }

/* ---------- profile ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card h2 { font-size: 12px; letter-spacing: var(--track); text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--kloo-lavender-100); color: var(--kloo-lavender-800); font-size: 13px; margin: 2px 4px 2px 0; }
.linkbox { word-break: break-all; background: var(--kloo-lavender-50); border-radius: var(--radius-sm); padding: 10px; font-size: 13px; margin: 8px 0; user-select: all; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- bottom sheet (the hero's waiting list) ---------- */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px;
  border-radius: 24px 24px 0 0; background: var(--surface); color: var(--text);
  max-height: 90dvh;
}
dialog.sheet::backdrop { background: rgba(18, 18, 18, 0.35); }
.sheet-body { padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet h2 { font-size: 19px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.sheet h2 svg { width: 20px; height: 20px; color: var(--accent-strong); }
.sheet .actions { display: flex; flex-direction: column; gap: 10px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px); transform: translateX(-50%); background: var(--kloo-ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 10; max-width: calc(100% - 32px); }

@media (min-width: 420px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 26px 16px; }
  .tile .circle { width: 84px; height: 84px; }
}

/* One-time "add to Home Screen" tip (browser tab only) */
.install-card { display: flex; gap: 12px; align-items: flex-start; background: var(--kloo-paper); border: 1px solid var(--kloo-rule, #e3e0d6); border-radius: var(--radius-lg, 20px); padding: 14px 16px; margin-bottom: 16px; }
.install-ico { color: var(--kloo-lavender-600, #6f72c3); flex: 0 0 auto; margin-top: 2px; }
.install-title { font-weight: 500; margin-bottom: 4px; }
.install-body { font-size: 14px; color: var(--kloo-ink-3, #5a5963); }
.install-actions { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.install-actions .linkish { background: none; border: 0; padding: 0; color: var(--kloo-ink-3, #5a5963); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }

.wordmark-img { height: 18px; width: auto; display: block; }

/* ---------- tile detail page (docs/kloo-hub/detail/BLOCKS.md) ----------
   Stitch mobile Simple look on Direction A: lavender hero card, paper cards with a
   rule outline, uppercase tracked labels, mint accents. */
a.tile { text-decoration: none; }
.d-header { margin: 0 0 16px; }
.d-back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text);
  font-family: var(--font-display); font-weight: 500; font-size: 14px; margin-bottom: 14px;
}
.d-back-arrow { font-size: 16px; line-height: 1; color: var(--accent-strong); }
.d-h1 { font-size: 26px; font-weight: 600; line-height: 1.15; }
.d-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.d-status { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; font-size: 14px; }
.d-status .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }

.d-eyebrow { font-family: var(--font-display); font-weight: 600; font-size: 10.5px; letter-spacing: var(--track); text-transform: uppercase; color: var(--muted); line-height: 1.3; }

.d-hero { background: var(--kloo-lavender-600); color: #fff; border-radius: var(--radius); padding: 18px 20px 20px; margin-bottom: 12px; box-shadow: var(--shadow-2); }
.d-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.d-hero .d-eyebrow { color: rgba(255, 255, 255, 0.9); padding-top: 4px; }
.d-hero-value { font-family: var(--font-display); font-weight: 700; font-size: 38px; line-height: 1.1; margin-top: 10px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.d-hero-sub { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.28); font-size: 13.5px; color: rgba(255, 255, 255, 0.92); }

.d-chip { display: inline-flex; align-items: center; flex: none; padding: 3px 10px; border-radius: 999px; font-family: var(--font-display); font-weight: 600; font-size: 11.5px; white-space: nowrap; line-height: 1.4; }
.d-chip.good { background: var(--kloo-mint); color: var(--kloo-ink); }
.d-chip.bad { background: #fde8eb; color: #9b1c2e; }
.d-chip.warn { background: #fff1d6; color: #8a5300; }
.d-chip.neutral { background: var(--kloo-lavender-100); color: var(--kloo-lavender-800); }
.d-hero .d-chip.neutral { background: rgba(255, 255, 255, 0.92); color: var(--kloo-lavender-800); }

.d-kpis { display: grid; gap: 10px; margin-bottom: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.d-kpis.n1 { grid-template-columns: 1fr; }
.d-kpis.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.d-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px 13px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.d-kpi .d-eyebrow { font-size: 9.5px; letter-spacing: .08em; min-height: 2.6em; }
.d-kpi-value { font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.d-kpis.n3 .d-kpi-value { font-size: 17px; }
.d-kpis.n2 .d-kpi-value, .d-kpis.n1 .d-kpi-value { font-size: 22px; }
.d-kpi-note { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.d-kpi.good .d-kpi-value { color: var(--kloo-mint-600); }
.d-kpi.bad .d-kpi-value { color: #c42b41; }
.d-kpi.warn .d-kpi-value { color: #b86e00; }

.d-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; margin-bottom: 12px; }
.d-title { font-family: var(--font-display); font-weight: 600; font-size: 16px; line-height: 1.25; margin: 0 0 12px; }

.d-bar { padding: 9px 0; border-top: 1px solid var(--line); }
.d-title + .d-bar { border-top: 0; padding-top: 0; }
.d-bar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.d-bar-label { font-weight: 500; font-size: 14.5px; min-width: 0; overflow-wrap: anywhere; }
.d-bar-value { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.d-bar-track { height: 7px; background: #efede4; border-radius: 4px; overflow: hidden; }
.d-bar-fill { display: block; height: 100%; border-radius: 4px; background: var(--kloo-lavender-600); }
.d-bar-fill.good { background: var(--kloo-mint-600); }
.d-bar-fill.bad { background: var(--status-red); }
.d-bar-fill.warn { background: var(--status-amber); }
.d-bar-share { font-size: 12px; color: var(--muted); margin-top: 5px; }

.d-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -4px 0 8px; font-size: 12.5px; color: var(--muted); }
.d-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.d-legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.d-chart { display: block; width: 100%; height: auto; overflow: visible; }
.d-chart .grid { stroke: #ebe8de; stroke-width: 1; stroke-dasharray: 3 3; }
.d-chart .axis { stroke: #d6d3c8; stroke-width: 1; }
.d-chart .marker { stroke: var(--kloo-lavender-600); stroke-width: 1.2; stroke-dasharray: 3 3; }
.d-chart text { font-family: var(--font-body); fill: var(--kloo-ink-4); font-size: 10px; }
.d-chart .xlab.now { fill: var(--kloo-lavender-600); font-weight: 600; }
.d-chart .val { fill: var(--kloo-ink-3); font-size: 9.5px; font-weight: 500; }
.d-chart-note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.d-spark-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.d-spark-head .d-title { margin: 0; }
.d-spark-value { font-family: var(--font-display); font-weight: 700; font-size: 20px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.d-spark-svg .line { fill: none; stroke: var(--kloo-lavender-600); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.d-spark-svg .area { fill: var(--kloo-lavender-100); opacity: .7; }
.d-spark-svg .last { fill: var(--kloo-mint); stroke: var(--surface); stroke-width: 2; }

.d-rows { list-style: none; margin: 0; padding: 0; }
.d-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.d-row:first-child { border-top: 0; padding-top: 0; }
.d-row-main { min-width: 0; }
.d-row-title { font-weight: 500; font-size: 14.5px; line-height: 1.3; overflow-wrap: anywhere; }
.d-row-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; overflow-wrap: anywhere; }
.d-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; max-width: 45%; }
.d-row-value { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.d-alert { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; font-size: 14px; line-height: 1.4; border: 1px solid transparent; }
.d-alert-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; }
.d-alert.red { background: #fdecef; border-color: #f6c9d0; color: #7d1626; }
.d-alert.red .d-alert-dot { background: var(--status-red); }
.d-alert.amber { background: #fff4df; border-color: #f5dcaa; color: #6b4200; }
.d-alert.amber .d-alert-dot { background: var(--status-amber); }
.d-alert.info { background: var(--kloo-lavender-50); border-color: var(--kloo-lavender-100); color: var(--kloo-lavender-800); }
.d-alert.info .d-alert-dot { background: var(--kloo-lavender-600); }

.d-note { font-size: 12px; line-height: 1.45; color: var(--faint); margin: 4px 4px 14px; }
.d-footer { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.d-error { text-align: center; }
.d-error p { margin: 4px 0 14px; color: var(--muted); }

.d-skeleton .sk { background: var(--kloo-lavender-50); border-radius: var(--radius); animation: pulse 1.2s ease-in-out infinite alternate; }
.d-skeleton .sk-hero { height: 150px; margin-bottom: 12px; background: var(--kloo-lavender-100); }
.d-skeleton .sk-kpi { height: 96px; border-radius: 16px; }
.d-skeleton .sk-card { height: 190px; margin-bottom: 12px; }
.d-skeleton .sk-card.short { height: 120px; }
@keyframes pulse { from { opacity: 1; } to { opacity: .55; } }

/* ---------- app lock ---------- */
.lock { min-height: 82dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 0 8px; }
.lock-logo { width: 110px; margin-bottom: 18px; }
.lock-circle { width: 84px; height: 84px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--accent-strong); display: flex; align-items: center; justify-content: center; }
.lock-circle svg { width: 32px; height: 32px; }
.lock h1 { font-size: 24px; margin-top: 6px; }
.lock p { margin: 0; max-width: 320px; }
.lock-btn { min-height: 58px; font-size: 18px; margin-top: 14px; max-width: 360px; }
.lock-btn svg { width: 20px; height: 20px; }
.lock .linkish { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 14px; padding: 8px; }
