/* ============ Solari design system ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

.solari {
  /* accent (hue-driven, set inline) */
  --bh: 250;
  --rs: 1;
  --font: 'Hanken Grotesk', system-ui, sans-serif;

  --blue:        oklch(0.62 0.13 var(--bh));
  --blue-strong: oklch(0.55 0.145 var(--bh));
  --blue-soft:   oklch(0.95 0.035 var(--bh));
  --blue-soft2:  oklch(0.91 0.05 var(--bh));
  --blue-ink:    oklch(0.46 0.13 var(--bh));

  --bg:        oklch(0.985 0.004 var(--bh));
  --surface:   #ffffff;
  --surface-2: oklch(0.975 0.006 var(--bh));
  --ink:    oklch(0.27 0.028 var(--bh));
  --ink-2:  oklch(0.50 0.02 var(--bh));
  --ink-3:  oklch(0.66 0.014 var(--bh));
  --line:   oklch(0.915 0.007 var(--bh));
  --line-2: oklch(0.95 0.006 var(--bh));
  --good:   oklch(0.62 0.13 158);
  --star:   oklch(0.78 0.13 80);

  --r-xl: calc(26px * var(--rs));
  --r-lg: calc(20px * var(--rs));
  --r-md: calc(14px * var(--rs));
  --r-sm: calc(10px * var(--rs));
  --r-pill: 999px;

  --sh-1: 0 1px 2px oklch(0.5 0.03 var(--bh) / .06), 0 1px 1px oklch(0.5 0.03 var(--bh) / .04);
  --sh-2: 0 2px 6px oklch(0.5 0.03 var(--bh) / .06), 0 12px 28px -16px oklch(0.45 0.06 var(--bh) / .28);
  --sh-3: 0 8px 24px -8px oklch(0.45 0.06 var(--bh) / .22), 0 30px 60px -28px oklch(0.45 0.08 var(--bh) / .34);

  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.006em;
}
html, body, #root { height: 100%; }
body { margin: 0; }
.solari button { font-family: inherit; cursor: pointer; color: inherit; }
.solari input, .solari textarea { font-family: inherit; }
.ic { display: block; flex: 0 0 auto; }

/* ============ Top bar ============ */
.topbar {
  height: 68px; flex: 0 0 auto;
  display: flex; align-items: center; gap: 24px;
  padding: 0 28px;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(150deg, var(--blue), var(--blue-strong));
  display: grid; place-items: center; box-shadow: var(--sh-1);
}
.brand-dot { width: 13px; height: 13px; border-radius: 50%; background: #ffffff;
  box-shadow: inset 0 0 0 3.5px var(--blue); }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; }

.topnav { display: flex; gap: 4px; }
.topnav-link {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border: 0; background: none; border-radius: var(--r-md);
  font-size: 15px; font-weight: 600; color: var(--ink-2); transition: .15s;
}
.topnav-link:hover { background: var(--surface-2); color: var(--ink); }
.topnav-link.is-on { background: var(--blue-soft); color: var(--blue-ink); }
.nav-badge, .bn-badge { background: var(--blue); color: #ffffff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topsearch {
  display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 16px 0 13px;
  border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink-3); font-size: 14px; font-weight: 500; min-width: 220px; transition: .15s;
}
.topsearch:hover { border-color: var(--blue-soft2); background: #ffffff; color: var(--ink-2); }
.me { background: none; border: 0; padding: 0; border-radius: 50%; }
.me:hover { box-shadow: 0 0 0 3px var(--blue-soft); }

.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-md); border: 0; background: none;
  display: grid; place-items: center; color: var(--ink-2); transition: .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.is-active { color: oklch(0.6 0.18 18); background: oklch(0.96 0.04 18); }

/* ============ Stage / scroll ============ */
.stage { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
.stage-inner { max-width: 1180px; margin: 0 auto; padding: 36px 32px 40px; }
.footer-space { height: 24px; }
.solari.focus .stage-inner { max-width: 760px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--r-md); font-weight: 700; letter-spacing: -0.01em;
  white-space: nowrap; transition: transform .12s, background .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: var(--r-sm); }
.btn-md { height: 44px; padding: 0 18px; font-size: 15px; }
.btn-lg { height: 54px; padding: 0 24px; font-size: 16.5px; }
.btn-full { width: 100%; }
.btn-primary { background: var(--blue); color: #ffffff; box-shadow: 0 2px 6px oklch(0.55 0.14 var(--bh) / .35); }
.btn-primary:hover { background: var(--blue-strong); box-shadow: 0 4px 14px oklch(0.55 0.14 var(--bh) / .42); }
.btn-soft { background: var(--blue-soft); color: var(--blue-ink); }
.btn-soft:hover { background: var(--blue-soft2); }
.btn-ghost { background: var(--surface-2); color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }

/* ============ Tags / pills / stars / avatar ============ */
.tag { display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; color: var(--blue-ink);
  background: var(--blue-soft); padding: 5px 11px; border-radius: var(--r-pill); }
.tag.editable { gap: 4px; padding-right: 6px; }
.tag.editable button { display: grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 50%;
  background: oklch(0.85 0.05 var(--bh) / .6); color: var(--blue-ink); }
.tag.editable button:hover { background: oklch(0.8 0.07 var(--bh)); }

.stars { display: inline-flex; gap: 1.5px; color: var(--star); }
.star-wrap { position: relative; display: inline-block; line-height: 0; }
.star-bg { color: oklch(0.9 0.02 80); }
.star-fg { position: absolute; inset: 0; overflow: hidden; color: var(--star); }

.avatar { user-select: none; }

/* ============ Generic card ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--sh-1); transition: transform .16s, box-shadow .16s, border-color .16s; cursor: pointer; }
.card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--blue-soft2); }
.card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card-grid.three { grid-template-columns: repeat(3, 1fr); }

/* checklist card */
.card-cover { position: relative; }
.card-cover-cat { position: absolute; left: 12px; top: 12px; display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(6px); padding: 5px 11px 5px 9px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 700; box-shadow: var(--sh-1); }
.card-fav { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.9); backdrop-filter: blur(6px); display: grid; place-items: center;
  color: var(--ink-2); box-shadow: var(--sh-1); transition: .15s; }
.card-fav:hover { color: oklch(0.6 0.18 18); transform: scale(1.08); }
.card-fav.is-fav { color: oklch(0.6 0.19 18); }
.card-fav.floating { position: absolute; right: 12px; top: 12px; }
.card-fav.inline { position: static; width: 38px; height: 38px; background: none; box-shadow: none; }

.card-body { padding: 15px 16px 16px; }
.card-title { font-size: 17px; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; text-wrap: pretty; }
.card-meta { display: flex; align-items: center; gap: 7px; margin-top: 9px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.card-meta-num { color: var(--ink); }
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); flex: 0 0 auto; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px;
  padding-top: 13px; border-top: 1px solid var(--line-2); }
.card-author { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.card-author span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-count { font-size: 12.5px; font-weight: 700; color: var(--ink-3); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }

/* ============ Placeholder imagery ============ */
.placeholder { position: relative; width: 100%; overflow: hidden;
  background:
    repeating-linear-gradient(135deg, oklch(0.95 0.04 var(--ph-hue)) 0 14px, oklch(0.92 0.05 var(--ph-hue)) 14px 28px);
  display: grid; place-items: center; }
.placeholder::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px oklch(0.86 0.05 var(--ph-hue) / .5); }
.ph-label { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 11px; font-weight: 500;
  letter-spacing: 0.02em; color: oklch(0.46 0.1 var(--ph-hue)); background: rgba(255,255,255,.72);
  padding: 4px 10px; border-radius: var(--r-pill); text-align: center; max-width: 80%; }

/* ============ Home / hero ============ */
.block { margin-top: 44px; }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.block-title { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; display: flex; align-items: center; gap: 9px; }
.title-ic { color: var(--blue); }
.see-all { display: inline-flex; align-items: center; gap: 2px; background: none; border: 0; color: var(--blue-ink);
  font-size: 14.5px; font-weight: 700; padding: 6px 8px; border-radius: var(--r-sm); }
.see-all:hover { background: var(--blue-soft); }

.hero { text-align: center; padding: 26px 0 8px; position: relative; }
.hero-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700;
  color: var(--blue-ink); background: var(--blue-soft); padding: 7px 15px; border-radius: var(--r-pill); }
.hero-title { font-size: 58px; font-weight: 800; line-height: 1.02; letter-spacing: -0.045em; margin-top: 20px; }
.hero-sub { font-size: 18px; color: var(--ink-2); max-width: 560px; margin: 16px auto 0; line-height: 1.5; font-weight: 500; text-wrap: pretty; }

.search-big { display: flex; align-items: center; gap: 10px; max-width: 660px; margin: 30px auto 0;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-pill);
  padding: 8px 8px 8px 22px; box-shadow: var(--sh-2); transition: .18s; }
.search-big:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft), var(--sh-2); }
.search-ic { color: var(--ink-3); flex: 0 0 auto; }
.search-input { flex: 1 1 auto; border: 0; outline: 0; background: none; font-size: 17px; font-weight: 500; color: var(--ink); min-width: 0; }
.search-input::placeholder { color: var(--ink-3); }
.search-go { flex: 0 0 auto; }

.hero-examples { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; }
.ex-label { font-size: 13.5px; color: var(--ink-3); font-weight: 600; }
.ex-chip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 7px 15px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: .15s; }
.ex-chip:hover { border-color: var(--blue-soft2); background: var(--blue-soft); color: var(--blue-ink); }

/* category grid */
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.cat-card { display: flex; align-items: center; gap: 13px; padding: 13px 15px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); text-align: left; transition: .15s; box-shadow: var(--sh-1); }
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--blue-soft2); }
.cat-name { font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; }
.cat-tile { box-shadow: inset 0 0 0 1px oklch(0.5 0.05 var(--bh) / .04); }

/* ============ Search results ============ */
.search-bar2 { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-pill); padding: 11px 16px; box-shadow: var(--sh-1); margin-bottom: 22px; }
.search-bar2:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.search-clear { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; }
.search-clear:hover { background: var(--line); }
.results-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 16px; }
.results-title { font-size: 27px; font-weight: 800; letter-spacing: -0.035em; }
.results-count { font-size: 15px; color: var(--ink-3); font-weight: 600; }
.cat-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.cat-pill { padding: 8px 15px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface);
  font-size: 14px; font-weight: 600; color: var(--ink-2); transition: .15s; }
.cat-pill:hover { border-color: var(--blue-soft2); color: var(--ink); }
.cat-pill.is-on { background: var(--ink); color: #ffffff; border-color: var(--ink); }

.empty { text-align: center; padding: 70px 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.empty-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-ink); display: grid; place-items: center; }
.empty p { color: var(--ink-2); font-size: 16px; font-weight: 500; }

/* ============ Detail ============ */
.back-link { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; color: var(--ink-2);
  font-size: 14.5px; font-weight: 700; padding: 7px 10px 7px 6px; border-radius: var(--r-sm); margin-bottom: 16px; }
.back-link:hover { background: var(--surface-2); color: var(--ink); }
.detail-grid { display: grid; grid-template-columns: 1fr 332px; gap: 36px; align-items: start; }
.detail-cover { margin-bottom: 22px; }
.detail-catrow { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.detail-cat { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 700; }
.detail-updated { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-3); font-weight: 600; }
.detail-title { font-size: 40px; font-weight: 800; line-height: 1.06; letter-spacing: -0.04em; text-wrap: balance; }
.detail-byline { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 14.5px; color: var(--ink-2); font-weight: 500; }
.detail-byline strong { color: var(--ink); font-weight: 700; }
.byline-forks { display: inline-flex; align-items: center; gap: 5px; }
.detail-blurb { font-size: 17.5px; line-height: 1.6; color: var(--ink-2); margin-top: 20px; font-weight: 500; max-width: 62ch; text-wrap: pretty; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

.preview { margin-top: 34px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 26px 28px; box-shadow: var(--sh-1); }
.preview-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line-2); }
.preview-title { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; }
.preview-count { font-size: 13.5px; color: var(--ink-3); font-weight: 600; }
.prev-sec { margin-top: 22px; }
.prev-sec:first-of-type { margin-top: 0; }
.prev-sec-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: var(--blue-ink); margin-bottom: 12px; }
.prev-item { display: flex; align-items: center; gap: 13px; padding: 7px 0; font-size: 16px; color: var(--ink); font-weight: 500; }
.prev-box { width: 21px; height: 21px; border-radius: 7px; border: 2px solid var(--line); flex: 0 0 auto; }
.related { margin-top: 38px; }
.related .block-title { margin-bottom: 18px; }

.detail-rail { position: sticky; top: 24px; }
.rail-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 22px; box-shadow: var(--sh-2); }
.rail-stats { display: flex; align-items: stretch; gap: 4px; margin-bottom: 20px; }
.rail-stat { flex: 1; text-align: center; }
.rail-stat-top { display: flex; justify-content: center; margin-bottom: 6px; }
.rail-stat-num { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.rail-stat-num.big { color: var(--blue-ink); }
.rail-stat-label { font-size: 12.5px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }
.rail-div { width: 1px; background: var(--line); margin: 4px 0; }
.rail-inlib { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--good); font-weight: 700;
  font-size: 15px; margin-bottom: 12px; background: oklch(0.95 0.05 158); padding: 11px; border-radius: var(--r-md); }
.rail-actions { display: flex; gap: 8px; margin-top: 14px; justify-content: center; }
.rail-actions .icon-btn { border: 1px solid var(--line); flex: 1; }
.rail-actions .icon-btn:hover { border-color: var(--blue-soft2); }
.rail-note { font-size: 12.5px; color: var(--ink-3); text-align: center; margin-top: 16px; line-height: 1.5; }

/* ============ Library ============ */
.lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.page-title { font-size: 34px; font-weight: 800; letter-spacing: -0.04em; }
.page-sub { font-size: 15.5px; color: var(--ink-2); margin-top: 6px; font-weight: 500; }
.lib-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.lib-tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--r-md); }
.lib-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border: 0; background: none; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 700; color: var(--ink-2); transition: .15s; }
.lib-tab:hover { color: var(--ink); }
.lib-tab.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.tab-n { font-size: 11.5px; background: var(--blue-soft); color: var(--blue-ink); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; }
.lib-tools { display: flex; align-items: center; gap: 10px; }
.lib-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 9px 14px; }
.lib-search input { border: 0; outline: 0; background: none; font-size: 14px; width: 130px; }
.view-toggle { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.view-toggle button { width: 40px; height: 40px; border: 0; background: none; display: grid; place-items: center; color: var(--ink-3); }
.view-toggle button.is-on { background: var(--blue-soft); color: var(--blue-ink); }

.lib-card { display: flex; flex-direction: column; }
.libcard-top { position: relative; padding: 18px; display: flex; align-items: flex-start; }
.done-chip { position: absolute; left: 18px; bottom: 14px; display: inline-flex; align-items: center; gap: 4px; background: var(--good); color: #ffffff;
  font-size: 11.5px; font-weight: 800; padding: 4px 9px; border-radius: var(--r-pill); }
.libcard-prog { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.mini-track { flex: 1; height: 7px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.mini-fill { height: 100%; border-radius: 4px; background: var(--blue); transition: width .4s; }
.mini-label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.card-open { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 700; color: var(--blue-ink); }

.lib-list { display: flex; flex-direction: column; gap: 10px; }
.lib-row { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--sh-1); cursor: pointer; transition: .15s; }
.lib-row:hover { border-color: var(--blue-soft2); box-shadow: var(--sh-2); transform: translateY(-1px); }
.lib-row-main { flex: 1; min-width: 0; }
.lib-row-title { font-size: 16.5px; font-weight: 700; letter-spacing: -0.02em; }
.lib-row-sub { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.lib-row-prog { display: flex; align-items: center; gap: 10px; width: 160px; flex: 0 0 auto; }
.lib-row-chev { color: var(--ink-3); }
.saved-block { margin-top: 50px; padding-top: 40px; border-top: 1px solid var(--line); }

/* ============ Execute ============ */
.exec-top { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.exec-top .back-link { margin-bottom: 0; }
.exec-offline { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--good);
  background: oklch(0.96 0.04 158); padding: 6px 12px; border-radius: var(--r-pill); white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px oklch(0.62 0.13 158 / .2); }
.exec-header { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.exec-header-txt { flex: 1 1 auto; min-width: 0; }
.exec-title { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.12; text-wrap: balance; }
.exec-cat { display: block; margin-top: 3px; font-size: 14px; color: var(--ink-3); font-weight: 600; }

/* split-flap journey board */
.exec-board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 20px 24px 24px; box-shadow: var(--sh-1); position: sticky; top: 12px; z-index: 5; }
.exec-board-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.exec-board-txt { display: flex; flex-direction: column; gap: 7px; }
.exec-board-sub { font-size: 14.5px; color: var(--ink-2); font-weight: 600; }

/* journey track */
.journey { position: relative; padding: 2px 8px 0; }
.journey-rail { position: relative; height: 8px; border-radius: 4px; background: var(--line-2);
  box-shadow: inset 0 0 0 1px var(--line); }
.journey-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--blue), var(--blue-strong)); transform-origin: left center;
  transform: scaleX(0); }
.journey-node { position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%;
  background: var(--surface); border: 2.5px solid var(--line); transform: translate(-50%, -50%); transition: .3s; z-index: 2; }
.journey-node.state-done { background: var(--blue); border-color: var(--blue); }
.journey-node.state-current { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); background: var(--surface); }
.journey-node.is-end { width: 15px; height: 15px; }
.journey-node.is-end.state-done { background: var(--good); border-color: var(--good); }
.journey-marker { position: absolute; top: 50%; transform: translate(-50%, -50%); z-index: 3;
  width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--sh-2); display: grid; place-items: center; color: var(--blue); }
.journey-labels { position: relative; height: 16px; margin-top: 12px; }
.journey-label { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; font-weight: 700;
  color: var(--ink-3); white-space: nowrap; max-width: 100px; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; }
.journey-label.state-current { color: var(--blue-ink); }
.journey-label:first-child { transform: translateX(0); }
.journey.is-compact .journey-rail { height: 7px; }

/* next action — the "next departure" */
.next-action { display: flex; align-items: center; gap: 18px; margin-top: 18px;
  background: var(--surface); border: 1px solid var(--blue-soft2); border-left: 4px solid var(--blue);
  border-radius: var(--r-lg); padding: 18px 20px 18px 22px; box-shadow: var(--sh-2);
  position: relative; overflow: hidden; }
.next-action::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: var(--line-2); opacity: .7; pointer-events: none; }
.na-flag { position: relative; z-index: 1; }
.na-body { flex: 1 1 auto; min-width: 0; position: relative; z-index: 1; }
.na-label { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink-3); }
.na-text { font-size: 20px; font-weight: 700; letter-spacing: -0.025em; margin-top: 3px; line-height: 1.2; text-wrap: balance; }
.na-sec { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--ink-3); margin-top: 6px; }
.na-do { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; z-index: 1; position: relative;
  background: var(--blue); color: #ffffff; border: 0; border-radius: var(--r-md); height: 50px; padding: 0 20px 0 14px;
  font-size: 15px; font-weight: 700; box-shadow: 0 2px 8px oklch(0.55 0.14 var(--bh) / .4); transition: .15s; }
.na-do:hover { background: var(--blue-strong); }
.na-do-box { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.18); display: grid; place-items: center; }

.exec-celebrate { display: flex; align-items: center; gap: 14px; margin-top: 18px; background: oklch(0.96 0.045 158);
  border: 1px solid oklch(0.85 0.07 158); border-radius: var(--r-lg); padding: 16px 20px; }
.celebrate-emoji { width: 40px; height: 40px; border-radius: 50%; background: var(--good); color: #ffffff; display: grid; place-items: center; flex: 0 0 auto; }
.exec-celebrate strong { font-size: 16px; }
.exec-celebrate span { color: var(--ink-2); font-size: 14.5px; }
.exec-celebrate .btn { margin-left: auto; flex: 0 0 auto; }

.exec-list { margin-top: 26px; }
.exec-sec { margin-bottom: 14px; }
.exec-sec-head { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 4px; margin-top: 14px; }
.exec-sec-title { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--blue-ink); }
.exec-sec-count { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.check-item { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; margin-bottom: 9px; transition: .15s; }
.check-item:hover { border-color: var(--blue-soft2); box-shadow: var(--sh-1); }
.check-box { width: 30px; height: 30px; border-radius: 9px; border: 2.5px solid var(--line); flex: 0 0 auto; display: grid; place-items: center;
  color: #ffffff; transition: .18s; }
.check-box .ic { opacity: 0; transform: scale(.5); transition: .18s; }
.check-item:hover .check-box { border-color: var(--blue-soft2); }
.check-text { flex: 1 1 auto; font-size: 17px; font-weight: 600; color: var(--ink); transition: .15s; }
.check-status { flex: 0 0 auto; }
.check-item.status-next { border-color: var(--blue-soft2); box-shadow: 0 0 0 3px var(--blue-soft); }
.check-item.status-next .check-box { border-color: var(--blue); }
.check-item.status-done .check-box { background: var(--good); border-color: var(--good); }
.check-item.status-done .check-box .ic { opacity: 1; transform: scale(1); }
.check-item.status-done .check-text { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.check-item.status-done { background: var(--surface-2); }

.exec-notes { margin-top: 30px; }
.notes-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.notes-area { width: 100%; min-height: 110px; resize: vertical; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px 18px; font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--surface); outline: 0; transition: .15s; }
.notes-area:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.notes-area::placeholder { color: var(--ink-3); }

/* ============ Editor ============ */
.editor-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.editor-bar .back-link { margin-bottom: 0; }
.editor-bar-right { display: flex; align-items: center; gap: 10px; }
.save-state { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.history { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; margin-bottom: 20px; box-shadow: var(--sh-1); }
.history-title { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); margin-bottom: 14px; }
.hist-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.hist-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 auto; }
.hist-row.is-cur .hist-dot { background: var(--blue); border-color: var(--blue); }
.hist-when { font-size: 14px; font-weight: 700; }
.hist-what { font-size: 13px; color: var(--ink-3); }
.hist-restore { margin-left: auto; background: var(--surface-2); border: 0; border-radius: var(--r-sm); padding: 6px 12px; font-size: 13px; font-weight: 700; color: var(--blue-ink); }
.hist-restore:hover { background: var(--blue-soft); }

.editor-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 28px 30px; box-shadow: var(--sh-1); }
.editor-cat { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: var(--ink-2); margin-bottom: 16px; }
.editor-title-input { width: 100%; border: 0; outline: 0; font-family: inherit; font-size: 32px; font-weight: 800; letter-spacing: -0.04em; color: var(--ink);
  padding: 4px 0; border-bottom: 2px solid transparent; transition: .15s; }
.editor-title-input:focus { border-color: var(--blue); }
.editor-desc { width: 100%; border: 0; outline: 0; resize: vertical; min-height: 56px; font-size: 16px; line-height: 1.55; color: var(--ink-2); margin-top: 12px; padding: 8px 0; font-weight: 500; }
.editor-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 26px; padding-bottom: 24px; border-bottom: 1px solid var(--line-2); }
.tag-input { border: 1.5px dashed var(--line); border-radius: var(--r-pill); padding: 5px 12px; font-size: 13px; font-weight: 600; outline: 0; width: 80px; color: var(--ink); }
.tag-input:focus { border-color: var(--blue); border-style: solid; }

.editor-sec { margin-bottom: 24px; }
.editor-sec-title { width: 100%; border: 0; outline: 0; font-family: inherit; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--blue-ink); padding: 6px 0; margin-bottom: 6px; }
.editor-item { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.drag { color: var(--ink-3); cursor: grab; display: grid; place-items: center; }
.editor-item-input { flex: 1; border: 0; outline: 0; font-family: inherit; font-size: 16px; color: var(--ink); padding: 10px 12px;
  border-radius: var(--r-sm); background: var(--surface-2); transition: .15s; font-weight: 500; }
.editor-item-input:focus { background: #ffffff; box-shadow: inset 0 0 0 1.5px var(--blue); }
.editor-item-actions { display: flex; gap: 2px; opacity: 0; transition: .15s; }
.editor-item:hover .editor-item-actions, .editor-item:focus-within .editor-item-actions { opacity: 1; }
.editor-item-actions button { width: 32px; height: 32px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-3); display: grid; place-items: center; }
.editor-item-actions button:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.editor-item-actions button.del:hover { background: oklch(0.95 0.04 18); color: oklch(0.55 0.18 18); }
.editor-item-actions button:disabled { opacity: .3; }
.add-item { display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; color: var(--blue-ink); font-size: 14.5px; font-weight: 700;
  padding: 9px 12px; margin-top: 4px; border-radius: var(--r-sm); }
.add-item:hover { background: var(--blue-soft); }
.add-section { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; margin-top: 12px;
  border: 1.5px dashed var(--line); background: none; border-radius: var(--r-lg); padding: 16px; font-size: 15px; font-weight: 700; color: var(--ink-2); transition: .15s; }
.add-section:hover { border-color: var(--blue-soft2); color: var(--blue-ink); background: var(--blue-soft); }

/* ============ Bottom nav (mobile) ============ */
.bottomnav { position: absolute; left: 0; right: 0; bottom: 0; height: 66px; display: flex; background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px); border-top: 1px solid var(--line); z-index: 40; padding-bottom: env(safe-area-inset-bottom); }
.bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none;
  color: var(--ink-3); font-size: 11px; font-weight: 700; position: relative; }
.bn-item.is-on { color: var(--blue-ink); }
.bn-badge { position: absolute; top: 8px; left: 50%; margin-left: 6px; }

/* ============ Toast ============ */
.toast { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 12px; background: var(--ink); color: #ffffff;
  padding: 13px 16px 13px 16px; border-radius: var(--r-md); box-shadow: var(--sh-3); font-size: 14.5px; font-weight: 600;
  animation: toast-in .3s cubic-bezier(.2,.9,.2,1); max-width: 90%; }
.toast-ic { width: 24px; height: 24px; border-radius: 50%; background: var(--good); color: #ffffff; display: grid; place-items: center; flex: 0 0 auto; }
.toast-action { margin-left: 6px; background: rgba(255,255,255,.14); border: 0; color: #ffffff; font-weight: 700; font-size: 13.5px; padding: 7px 13px; border-radius: var(--r-sm); }
.toast-action:hover { background: rgba(255,255,255,.24); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px); } }
.solari.compact .toast { bottom: 84px; }

/* ============ Compact / mobile ============ */
.solari.force-mobile { max-width: 430px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); box-shadow: var(--sh-3); }
.solari.compact .topbar { padding: 0 16px; gap: 12px; height: 60px; }
.solari.compact .stage-inner { padding: 22px 16px 30px; }
.solari.compact .stage { padding-bottom: 66px; }
.solari.compact .card-grid, .solari.compact .card-grid.three { grid-template-columns: 1fr 1fr; gap: 13px; }
.solari.compact .cat-grid { grid-template-columns: 1fr 1fr; }
.solari.compact .hero-title { font-size: 38px; }
.solari.compact .hero-sub { font-size: 16px; }
.solari.compact .search-big { flex-wrap: nowrap; padding: 6px 6px 6px 16px; }
.solari.compact .search-go { padding: 0 16px; height: 44px; font-size: 15px; }
.solari.compact .detail-grid { grid-template-columns: 1fr; gap: 0; }
.solari.compact .detail-rail { position: fixed; left: 0; right: 0; bottom: 0; top: auto; padding: 0; z-index: 45; }
.solari.compact .rail-card { border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--sh-3); }
.solari.compact .rail-stats { display: none; }
.solari.compact .rail-note { display: none; }
.solari.compact.focus .detail-rail { position: static; }
.solari.compact .detail-title { font-size: 30px; }
.solari.compact .detail-main { padding-bottom: 90px; }
.solari.compact .page-title { font-size: 28px; }
.solari.compact .lib-toolbar { flex-direction: column; align-items: stretch; }
.solari.compact .lib-tabs { overflow-x: auto; }
.solari.compact .exec-title { font-size: 24px; }
.solari.compact .card-grid.three { grid-template-columns: 1fr; }

/* ============ Split-flap board kit ============ */
.flap { display: inline-flex; gap: 3px; }
.flap-tile { position: relative; display: grid; place-items: center; flex: 0 0 auto;
  background: linear-gradient(180deg, oklch(0.99 0.003 var(--bh)), oklch(0.95 0.006 var(--bh)));
  border: 1px solid var(--line); border-radius: 5px;
  box-shadow: 0 1px 1px oklch(0.5 0.03 var(--bh) / .05), inset 0 1px 0 rgba(255,255,255,.6);
  color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; overflow: hidden; }
.flap-tile::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: oklch(0.4 0.02 var(--bh) / .12); transform: translateY(-0.5px); }
.flap-tile.is-blank { background: oklch(0.96 0.005 var(--bh)); box-shadow: none; }
.flap-char { line-height: 1; display: block; }
.flap-dark .flap-tile { background: linear-gradient(180deg, oklch(0.34 0.025 var(--bh)), oklch(0.27 0.025 var(--bh)));
  border-color: oklch(0.24 0.02 var(--bh)); color: oklch(0.96 0.01 var(--bh));
  box-shadow: 0 1px 2px oklch(0.2 0.03 var(--bh) / .35), inset 0 1px 0 rgba(255,255,255,.08); }
.flap-dark .flap-tile::after { background: oklch(0 0 0 / .38); }
.flap-dark .flap-tile.is-blank { background: oklch(0.30 0.022 var(--bh)); }

.flap-sm .flap-tile { width: 15px; height: 21px; font-size: 12.5px; border-radius: 4px; }
.flap-md .flap-tile { width: 20px; height: 28px; font-size: 16px; }
.flap-lg .flap-tile { width: 25px; height: 35px; font-size: 21px; }
.flap-xl .flap-tile { width: 34px; height: 48px; font-size: 30px; border-radius: 7px; }

/* board tags (monospace status flags) */
.board-tag { display: inline-flex; align-items: center; gap: 4px; font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap; line-height: 1; }
.board-tag.tone-default { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.board-tag.tone-next { background: var(--blue); color: #ffffff; }
.board-tag.tone-todo { background: var(--surface-2); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line); }
.board-tag.tone-done { background: oklch(0.95 0.05 158); color: var(--good); }
.board-tag.tone-live { background: oklch(0.95 0.05 158); color: var(--good); }

/* hero split-flap strip */
.hero-board { display: inline-flex; align-items: center; gap: 16px; margin: 26px auto 0; padding: 12px 14px 12px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); box-shadow: var(--sh-2);
  cursor: pointer; transition: .18s; }
.hero-board:hover { border-color: var(--blue-soft2); transform: translateY(-1px); box-shadow: var(--sh-3); }
.hero-board-kicker { display: inline-flex; align-items: center; gap: 7px; font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.hero-board-go { width: 34px; height: 34px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-ink);
  display: grid; place-items: center; flex: 0 0 auto; transition: .15s; }
.hero-board:hover .hero-board-go { background: var(--blue); color: #ffffff; }

/* library next-action line */
.next-line { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.next-line-txt { font-size: 13.5px; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-line.is-done .next-line-txt { color: var(--ink-3); }
.lib-row-sub .board-tag { transform: translateY(-1px); margin-right: 2px; }

/* compact overrides for board kit */
.solari.compact .exec-board { padding: 16px 16px 20px; }
.solari.compact .next-action { flex-wrap: wrap; gap: 12px; }
.solari.compact .na-do { width: 100%; justify-content: center; }
.solari.compact .na-text { font-size: 18px; }
.solari.compact .hero-board { gap: 10px; padding: 9px 10px; max-width: 100%; }
.solari.compact .hero-board-kicker { display: none; }
.solari.compact .flap { gap: 2px; }
.solari.compact .flap-lg .flap-tile { width: 16px; height: 23px; font-size: 13.5px; border-radius: 4px; }
.solari.compact .flap-xl .flap-tile { width: 28px; height: 40px; font-size: 24px; }
.solari.compact .journey-labels { display: none; }

@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
