/* Kaizen Board: calm indigo on warm paper, liquid-glass panels over the shader gradient (fx.js). System fonts only.
   Every color is a variable set from DESIGN.colors in app.js (light and dark); no color values live here. */
:root {
  --radius: 18px;
  --font: "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font: 17px/1.55 var(--font); color: var(--text); background: var(--bg);
  overflow-x: hidden; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .4em; }
h2 { font-size: 1.4rem; } h3 { font-size: 1.12rem; }
p { margin: 0 0 .8em; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 10; background: var(--surface); color: var(--text);
  padding: 8px 12px; border-radius: 10px; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* top bar: brand and effects toggle on the first row, the eight routes wrap below */
.topbar { position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); background: var(--surface); }
.top-in { max-width: 980px; margin: 0 auto; padding: 8px 16px; display: flex; gap: 6px 12px; align-items: center;
  flex-wrap: wrap; }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; font-weight: 700; font-family: var(--serif);
  font-size: 1.1rem; margin-right: auto; }
.brand img { border-radius: 8px; }
.topbar nav { display: flex; gap: 2px 4px; flex-wrap: wrap; width: 100%; }
.topbar nav a { text-decoration: none; padding: 5px 10px; border-radius: 999px; font-size: .95rem; min-height: 34px;
  display: inline-flex; align-items: center; }
.topbar nav a[aria-current="page"] { background: var(--primary); color: var(--primary-ink); }
.fx-toggle { font: inherit; font-size: .82rem; color: inherit; background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; cursor: pointer; min-height: 34px; }

main { max-width: 980px; margin: 0 auto; padding: 18px 16px 40px; outline: none; }
#banners { max-width: 980px; margin: 0 auto; padding: 12px 16px 0; }
#banners:empty { display: none; }
.banner { margin: 0 0 8px; padding: 10px 14px; border-radius: 14px; background: var(--surface); color: var(--text);
  border: 2px dashed var(--accent); font-size: .95rem; }
.banner.warn { border-style: solid; border-color: var(--red); }
footer.site { max-width: 980px; margin: 0 auto; padding: 0 16px 28px; font-size: .88rem; color: var(--muted); }
footer.site p { margin-bottom: .5em; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  margin: 0 0 16px; min-width: 0; }
.card.note { font-size: .98rem; }
.card.calm { border: 2px solid var(--accent); }
.big-text { font-size: 1.25rem; font-family: var(--serif); }
.btn { font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: 11px 20px; cursor: pointer;
  background: var(--primary); color: var(--primary-ink); min-height: 44px; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; }
.btn.secondary { background: transparent; color: inherit; border: 1px solid var(--line); }
.btn.danger { background: var(--red); color: var(--surface); }
.btn.small { padding: 6px 14px; min-height: 38px; font-size: .9rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.msg { margin: 10px 0 0; font-weight: 600; min-height: 1.5em; }
.result { font-family: var(--serif); font-size: 1.2rem; }
.label { font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .05em; font-size: .78rem;
  margin: 0 0 4px; font-family: var(--font); }
.hint { font-weight: 400; color: var(--muted); font-size: .88rem; }

/* forms */
form, fieldset { margin: 0; }
label.field, div.field { display: grid; gap: 4px; font-weight: 600; font-size: .95rem; margin: 0 0 14px; }
label.field.narrow { max-width: 260px; }
input[type=number], input[type=text], input[type=date], input[type=search], input[type=file], select, textarea {
  font: inherit; font-weight: 400; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); min-height: 44px; width: 100%; max-width: 100%; }
textarea { resize: vertical; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; cursor: pointer; }
.check input { margin-top: 4px; width: 22px; height: 22px; flex: none; accent-color: var(--primary); }
/* the "Kaizen step done" switch: a real checkbox, styled */
.switch { display: flex; align-items: center; gap: 12px; font-weight: 700; margin: 4px 0 16px; cursor: pointer;
  position: relative; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 56px; height: 32px; margin: 0; cursor: pointer; }
.switch .track { width: 56px; height: 32px; border-radius: 99px; background: var(--line); position: relative; flex: none;
  transition: background .2s ease; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 4px var(--shadow); transition: transform .2s ease; }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(24px); }
.switch input:focus-visible + .track { outline: 3px solid var(--accent); outline-offset: 2px; }
ul.entries { list-style: none; padding: 0; margin: 0; }
ul.entries li { padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }

/* 84-day strip and grid */
.cell { display: inline-block; width: 100%; aspect-ratio: 1; border-radius: 4px; border: 1px solid var(--line);
  background: var(--future); }
.cell.done { background: var(--done); border-color: var(--done); }
.cell.missed { background: var(--missed); }
.cell.today { border: 2px solid var(--today-ring); }
.strip { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; max-width: 520px; }
.strip-week { display: grid; gap: 3px; padding: 2px; border-radius: 6px; }
.strip-week.now { background: var(--soft); }
.strip-axis { display: flex; justify-content: space-between; max-width: 520px; font-size: .8rem; color: var(--muted); margin-top: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--muted); margin: 10px 0 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .cell { width: 14px; height: 14px; }
.grid84 { display: grid; gap: 4px; margin: 10px 0 4px; }
.g-row { display: grid; grid-template-columns: 4.8em 1fr 3.6em; gap: 8px; align-items: center; padding: 2px 4px;
  border-radius: 8px; font-size: .9rem; }
.g-row.now { background: var(--soft); font-weight: 700; }
.g-cells { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 320px; }
.g-tot { text-align: right; color: var(--muted); }

/* board */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stat { margin: 0; display: grid; }
.stat b { font-family: var(--serif); font-size: 1.6rem; line-height: 1.2; }
.stat span { font-size: .85rem; color: var(--muted); }
form.add { display: flex; gap: 8px; padding: 12px; }
form.add input { flex: 1; min-width: 0; }
.board-msg { margin: -6px 0 10px; }
.board-msg:empty { display: none; }
.kanban { display: grid; gap: 0 16px; }
@media (min-width: 760px) { .kanban { grid-template-columns: repeat(3, 1fr); align-items: start; } }
.kcol { padding: 14px; }
.kcol.drop { outline: 3px dashed var(--accent); outline-offset: -3px; }
.kcol h2 { font-size: 1.2rem; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.kcol .count { font-family: var(--font); font-size: .85rem; font-weight: 700; color: var(--muted); }
.kcol.full .count { color: var(--accent); }
ul.kcards { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.kcard { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); outline: none; }
.kcard:focus-visible { outline: 3px solid var(--accent); }
.kcard[draggable="true"] { cursor: grab; }
.kcard.dragging { opacity: .5; }
.ktext { margin: 0 0 8px; overflow-wrap: anywhere; font-weight: 600; }
.kcol[data-col="2"] .ktext { font-weight: 400; color: var(--muted); }
.kbtns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.confirm { font-weight: 700; margin-right: 4px; }
.done-date { display: block; color: var(--ok); font-weight: 600; font-size: .82rem; }
.empty-col { font-size: .92rem; padding: 6px 2px; }
.older { margin-top: 10px; }
.older summary, details > summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.older .kcards { margin-top: 8px; }
.print-row { justify-content: center; }
.print-only { display: none; }

/* review */
nav.weeks { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 0 0 16px; }
@media (min-width: 640px) { nav.weeks { grid-template-columns: repeat(12, 1fr); } }
nav.weeks a { text-decoration: none; text-align: center; padding: 8px 0; border-radius: 12px; font-weight: 700;
  background: var(--surface); border: 1px solid var(--line); min-height: 44px; display: flex; align-items: center;
  justify-content: center; position: relative; }
nav.weeks a.has::after { content: ""; position: absolute; top: 5px; right: 6px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); }
nav.weeks a[aria-current="page"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.kct { display: grid; gap: 0 12px; }
@media (min-width: 760px) { .kct { grid-template-columns: repeat(3, 1fr); } }
details p { margin: .5em 0; }

/* chart and tables */
.chart { width: 100%; max-width: 680px; height: auto; display: block; margin: 6px 0 8px; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--line); stroke-width: 1.5; }
.chart .tick { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart .empty { fill: var(--muted); font-size: 13px; font-family: var(--font); }
.chart-note { font-size: .85rem; }
.chart .bar-m { fill: var(--chart); }
.chart .nowcol { fill: var(--soft); }
.table-wrap { overflow-x: auto; }
table.totals { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.totals th, table.totals td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); }
table.totals tr.now { background: var(--soft); }

/* systems and fixes */
.search-card .field { margin-bottom: 4px; }
.search-card p { margin: 0; }
.area-h { margin: 22px 4px 10px; }
.sys h3 { font-size: 1.2rem; }
.goal-text p { margin-bottom: .5em; }
dl.parts { margin: 10px 0 4px; }
dl.parts dt { font-weight: 700; color: var(--primary); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; margin-top: 10px; }
dl.parts dd { margin: 2px 0 0; }
dl.parts dd p { margin: 0 0 .4em; }
dl.parts ul { margin: 4px 0; padding-left: 1.2em; }
.use-box { margin-top: 12px; }
.use-box p { margin-bottom: 8px; }
details.fix > summary { list-style: none; display: grid; gap: 2px; padding-right: 28px; position: relative; }
details.fix > summary::-webkit-details-marker { display: none; }
details.fix > summary::after { content: "+"; position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; font-weight: 400; color: var(--muted); }
details.fix[open] > summary::after { content: "\2212"; }
.fix-name { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; }
.restart { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--soft); }
.restart p:last-child { margin-bottom: 0; }

/* ---------- shader gradient, liquid glass, liquid logo (fx.js) */
.fx-bg { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; display: block; pointer-events: none; }
.fx-bg.hidden { display: none; }
body.fx-on { background: transparent; }
body.fx-on.fx-nogl { background: radial-gradient(120% 80% at 10% 0%, var(--primary) 0%, transparent 60%),
  radial-gradient(90% 70% at 100% 30%, var(--amber) 0%, transparent 55%), var(--bg); }
body:not(.fx-on) .hero h1 { color: var(--text); }
body.fx-on .card, body.fx-on .topbar, body.fx-on .banner {
  position: relative; background: var(--glass); border-color: var(--edge);
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
  box-shadow: inset 0 1px 0 var(--edge), 0 10px 34px var(--shadow);
}
body.fx-on .card { border-radius: 22px; overflow: hidden; }
body.fx-on .card.calm { border-color: var(--accent); }
body.fx-on .banner { border-color: var(--accent); }
body.fx-on .banner.warn { border-color: var(--red); }
body.fx-on.fx-refract .card.glass-hero { backdrop-filter: url(#fx-liquid) blur(16px) saturate(170%); }
body.fx-on .card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(125deg, var(--sheen) 0%, transparent 38%, transparent 70%, var(--sheen) 100%); opacity: .8; }
body.fx-on .card > * { position: relative; }
body.fx-on .topbar { border-width: 0 0 1px; }
body.fx-on .area-h { color: var(--hero-ink); text-shadow: 0 1px 12px rgba(0, 0, 0, .35); }
body.fx-on nav.weeks a:not([aria-current]) { background: var(--glass); }
.hero { text-align: center; padding: 20px 0 16px; }
.hero h1 { font-size: 2.3rem; letter-spacing: -.02em; }
.hero p { font-size: 1.06rem; max-width: 600px; margin: 0 auto; }
body.fx-on .hero h1 { color: var(--hero-ink); text-shadow: 0 2px 22px rgba(0, 0, 0, .3); }
body.fx-on .hero p { color: var(--hero-ink); opacity: .95; text-shadow: 0 1px 12px rgba(0, 0, 0, .3); }
body.fx-on footer.site { color: var(--hero-ink); opacity: .9; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
.liquid-logo { display: block; width: 104px; height: 104px; margin: 0 auto 10px; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .3)); }
img.liquid-logo { border-radius: 26px; }
@media (max-width: 720px) {
  .hero h1 { font-size: 1.85rem; } .liquid-logo { width: 80px; height: 80px; }
  .topbar nav a { padding: 5px 8px; font-size: .9rem; } .card { padding: 16px; }
}
@media (prefers-color-scheme: dark) { .label, dl.parts dt { color: var(--accent); } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ---------- print: the current page on plain paper */
@media print {
  @page { margin: 16mm; }
  body, body.fx-on { background: #fff !important; color: #000; font-size: 12pt; }
  .fx-bg, .topbar, #banners, .no-print, .hero, .skip, .search-card, .use-box, nav.weeks { display: none !important; }
  .print-only { display: block; }
  .print-only h1 { font-size: 20pt; margin-bottom: 4pt; }
  main { padding: 0; max-width: none; }
  body.fx-on .card, .card { background: #fff !important; color: #000; box-shadow: none !important; backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important; border: 1px solid #999; break-inside: avoid; overflow: visible; }
  body.fx-on .card::before { display: none; }
  .kanban { grid-template-columns: repeat(3, 1fr); }
  .kcard { border-color: #999; break-inside: avoid; }
  textarea, input { border: 1px solid #999 !important; background: #fff !important; color: #000 !important; }
  textarea { resize: none; overflow: visible; }
  details { display: block; } details > summary { list-style: none; }
  .muted, .hint { color: #444; }
  body.fx-on footer.site { color: #000; text-shadow: none; }
}
