/* kraft — design mode, in the Beeons language of the work tools (hive, comb, swarm): sidebar of the 8 parts (icon rail
   between 900 and 1199px), a tab bar on phones, glass top bar, panels with hairlines, white pill primary buttons,
   round icon buttons, Plus Jakarta Sans headings (gradient on the big ones), Jost text, Plex Mono labels.
   Overflow rule: every grid/flex child that holds text gets min-width: 0; long titles truncate with a title tooltip. */

:root { --sidebar-w: 236px; --rail-w: 62px; --topbar-h: 54px; --tabbar-h: 62px; }

.gui-app h1, .gui-app h2, .gui-app h3, .gui-auth h1 { font-family: var(--head); line-height: 1.2; margin: 0 0 .5em; color: var(--fg); }
.gui-app h2 { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
.gui-app h3 { font-size: .9375rem; font-weight: 600; }
.display, .gui-auth h1 { font-weight: 800; letter-spacing: -.035em; padding-bottom: .06em;
  background: linear-gradient(180deg, var(--fg) 35%, var(--heading-end)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); } .small { font-size: .8125rem; } .mono { font-family: var(--mono); }
.ellipsis { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); font-size: .875rem; margin: 0; padding: 4px 0; }
.inline { margin: 0; display: flex; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 19px; padding: 0 6px; border-radius: 999px;
  font: 500 .68rem/1 var(--mono); background: rgba(var(--tint), .1); color: var(--muted); flex-shrink: 0; }

/* ---------- App layout ---------- */
.gui-app { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; isolation: isolate; }
/* Faint brand glow in the top right corner */
.gui-app::before { content: ""; position: fixed; z-index: -1; pointer-events: none; top: -35vh; right: -25vw; width: 80vw; height: 85vh;
  background: radial-gradient(40% 42% at 62% 42%, var(--glow-a), transparent 70%), radial-gradient(36% 38% at 36% 56%, var(--glow-b), transparent 70%),
    radial-gradient(22% 24% at 52% 82%, var(--glow-c), transparent 70%); }
.main { min-width: 0; display: flex; flex-direction: column; }
.content { width: 100%; max-width: 1200px; padding: 18px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); min-width: 0; outline: 0; }
@media (min-width: 720px) { .content { padding: 26px 30px calc(var(--tabbar-h) + 40px); } }
@media (min-width: 900px) { .content { padding-bottom: 64px; } }

/* Sidebar: from 900px only (the tab bar replaces it on smaller screens) */
.sidebar { display: none; }
.logo { display: flex; align-items: center; gap: 10px; min-height: 40px; color: var(--fg); text-decoration: none; font: 800 1.3rem/1 var(--head);
  letter-spacing: -.035em; min-width: 0; }
.logo:hover { color: var(--fg); }
.logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: var(--fg); color: var(--on-fg); box-shadow: 0 6px 18px -6px rgba(10, 101, 231, .7), 0 4px 14px -6px rgba(138, 42, 227, .6); }
.logo-mark .ico { width: 19px; height: 19px; stroke-width: 2.1; }
.nav { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 10px; border-radius: 10px; color: var(--muted);
  text-decoration: none; font-size: .875rem; min-width: 0; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(var(--tint), .06); color: var(--fg); }
.nav a.active { color: var(--fg); background: rgba(var(--tint), .07); box-shadow: inset 0 0 0 1px var(--line); }
.nav a.active::before, .tabbar a.active::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(90% 160% at 0% 50%, rgba(10, 101, 231, var(--nav-glow)), transparent 65%), radial-gradient(70% 140% at 100% 50%, rgba(138, 42, 227, calc(var(--nav-glow) * .6)), transparent 70%); }
.nav a.soon { opacity: .75; }
.nav-label { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-meta { font: 500 .66rem/1 var(--mono); color: var(--faint); flex-shrink: 0; }
.nav a.active .nav-meta { color: var(--muted); }
.nav-title { margin: 14px 0 4px; padding: 0 10px; font: 500 .66rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.sidebar-foot { padding-top: 10px; border-top: 1px solid var(--line); }

@media (min-width: 900px) {
  .gui-app { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; background: var(--ink);
    border-right: 1px solid var(--line); overflow-x: hidden; overflow-y: auto; }
  .sidebar .logo { justify-content: center; padding: 4px 0 12px; }
  .sidebar .logo-word, .sidebar .nav-label, .sidebar .nav-meta, .sidebar .nav-title { position: absolute !important; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sidebar .nav a { justify-content: center; padding: 6px 0; }
  .sidebar-nav { flex: 1; min-height: 0; }
  .sidebar-foot .btn { width: 40px; padding: 0; margin: 0 auto; font-size: 0; gap: 0; }
  .logo-top { display: none !important; }
  .tabbar { display: none !important; }
}
@media (min-width: 1200px) {
  .gui-app { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .sidebar { padding: 14px 10px; }
  .sidebar .logo { justify-content: flex-start; padding: 4px 10px 14px; }
  .sidebar .logo-word, .sidebar .nav-label, .sidebar .nav-meta, .sidebar .nav-title { position: static !important; width: auto; height: auto; overflow: hidden; clip: auto; }
  .sidebar .nav-label { flex: 1; }
  .sidebar .nav-title { overflow: visible; }
  .sidebar .nav a { justify-content: flex-start; padding: 6px 10px; }
  .sidebar-foot .btn { width: 100%; font-size: .8438rem; gap: 6px; padding: 0 14px; }
}

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: var(--topbar-h); padding: 0 12px 0 16px;
  background: var(--header-bg); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--line); min-width: 0; }
@media (min-width: 720px) { .topbar { padding: 0 30px; } }
.logo-top { font-size: 1.15rem; flex-shrink: 0; }
.logo-top .logo-mark { width: 28px; height: 28px; }
.topbar-title { margin: 0; flex: 1; min-width: 0; font: 600 .9rem/1.2 var(--head); color: var(--muted); }
@media (max-width: 899.98px) { .topbar-title { padding-left: 10px; border-left: 1px solid var(--line); } }
.topbar-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
@media (max-width: 479.98px) {
  .hide-sm { display: none !important; }
  .btn-console { width: 34px; padding: 0 !important; }
  .btn-console .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .topbar { gap: 8px; }
  .topbar-tools { gap: 6px; }
}

/* Tab bar (phones, tablets): Overview + the 8 parts, scrolls sideways */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--header-bg); border-top: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); padding-bottom: env(safe-area-inset-bottom); }
.tabbar ul { list-style: none; margin: 0; padding: 6px 6px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.tabbar ul::-webkit-scrollbar { display: none; }
.tabbar li { flex: 1 0 62px; min-width: 0; scroll-snap-align: center; }
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: calc(var(--tabbar-h) - 12px);
  padding: 0 4px; border-radius: 12px; color: var(--muted); text-decoration: none; font: 500 .66rem/1 var(--body); min-width: 0; }
.tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar a .ico { width: 20px; height: 20px; }
.tabbar a.active { color: var(--fg); background: rgba(var(--tint), .07); box-shadow: inset 0 0 0 1px var(--line); }
.tabbar a.soon { opacity: .75; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: rgba(var(--tint), .07); color: var(--text); font: 500 .8438rem/1 var(--body);
  text-decoration: none; cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: background .15s, box-shadow .15s, border-color .15s, color .15s; }
.btn:hover { background: rgba(var(--tint), .15); color: var(--fg); }
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--fg); color: var(--on-fg); border-color: var(--fg); }
.btn-primary:hover { background: var(--fg-hover); color: var(--on-fg); box-shadow: 0 0 0 4px rgba(var(--tint), .1); }
.btn-sm { min-height: 30px; padding: 0 11px; font-size: .8125rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; flex-shrink: 0; border-radius: 999px;
  border: 1px solid var(--line-strong); background: rgba(var(--tint), .06); color: var(--text); cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s; }
.icon-btn:hover { background: rgba(var(--tint), .14); color: var(--fg); }
.icon-btn .ico { width: 16px; height: 16px; }
.icon-btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.icon-btn-ghost:hover { color: var(--fg); }

/* ---------- Meters: progress (solid) and pride (notched, violet light) ---------- */
.meter { position: relative; display: inline-block; height: 6px; min-width: 48px; flex: 1 1 auto; border-radius: 999px; background: rgba(var(--tint), .1); overflow: hidden; vertical-align: middle; }
.meter-fill { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); border-radius: 999px; background: var(--fg); box-shadow: 0 0 10px var(--bar-glow); }
.meter-pride { height: 8px; border-radius: 2px;
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(10% - 2px), transparent calc(10% - 2px) 10%);
  mask: repeating-linear-gradient(90deg, #000 0 calc(10% - 2px), transparent calc(10% - 2px) 10%); }
.meter-pride .meter-fill { border-radius: 0; }
.pride-key { display: inline-block; width: 26px; height: 8px; margin-right: 6px; vertical-align: 0; border-radius: 2px; box-shadow: 0 0 10px var(--pride-glow);
  background: repeating-linear-gradient(90deg, var(--fg) 0 6px, transparent 6px 8px); }

/* ---------- Dashboard ---------- */
.hero { margin: 6px 0 20px; max-width: 760px; }
.kicker { margin: 0 0 8px; font: 500 .7rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.hero .display { font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.05; margin-bottom: 12px; }
.lead { color: var(--muted); font-size: 1.02rem; margin: 0; max-width: 62ch; overflow-wrap: anywhere; }
.kpis { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1000px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { display: flex; align-items: flex-start; gap: 12px; padding: 14px; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(var(--tint), .035), rgba(var(--tint), .01)); }
.kpi-ico, .tile { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px;
  background: linear-gradient(180deg, var(--tile-top), var(--tile-bottom)); border: 1px solid var(--line-strong); color: var(--fg);
  box-shadow: inset 0 1px 0 rgba(var(--tint), .12), 0 12px 26px -14px rgba(138, 42, 227, .55), 0 8px 20px -12px rgba(10, 101, 231, .55); }
.kpi-ico .ico, .tile .ico { width: 19px; height: 19px; }
.kpi-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.kpi-label { font: 500 .66rem/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi strong { font: 800 1.45rem/1 var(--head); color: var(--fg); letter-spacing: -.02em; }
.kpi strong small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.kpi-sub { display: flex; align-items: center; gap: 8px; font-size: .72rem; color: var(--muted); min-width: 0; }
.kpi-sub .mono { white-space: nowrap; }
@media (max-width: 419.98px) { .kpi { flex-direction: column; gap: 8px; } }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin: 0 0 12px; }
.section-head h2 { margin: 0; font-size: 1.1rem; }
.section-head p { margin: 0; min-width: 0; }
.section-head b { color: var(--text); font-weight: 600; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cards > li { min-width: 0; display: flex; }
.card { position: relative; display: flex; flex-direction: column; gap: 12px; width: 100%; min-width: 0; padding: 16px; border-radius: 18px; text-decoration: none;
  color: var(--text); border: 1px solid var(--line); background: linear-gradient(180deg, rgba(var(--tint), .04), rgba(var(--tint), .01));
  transition: border-color .2s, transform .2s, box-shadow .2s; }
.card:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow), 0 0 50px -24px var(--bar-glow); }
.card-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.card-name strong { font: 700 1rem/1.25 var(--head); color: var(--fg); }
.card-go { color: var(--faint); transition: transform .2s, color .2s; }
.card:hover .card-go { color: var(--fg); transform: translateX(2px); }
.card-metric { display: flex; align-items: center; gap: 10px; min-width: 0; }
.metric-label { display: inline-flex; align-items: center; gap: 6px; width: 72px; flex-shrink: 0; font: 500 .66rem/1 var(--mono); letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); }
.metric-label .ico { width: 13px; height: 13px; }
.metric-value { font: 500 .78rem/1 var(--mono); color: var(--fg); min-width: 38px; text-align: right; white-space: nowrap; }
.metric-none { font-size: .8125rem; color: var(--muted); }
.card-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); min-height: 34px; }
.count-chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 999px; font: 500 .7rem/1 var(--mono);
  color: var(--muted); background: rgba(var(--tint), .05); border: 1px solid var(--line); }
.count-chip .ico { width: 13px; height: 13px; }
.card-soon { border-style: dashed; background: transparent; }
.card-soon .tile { color: var(--muted); }
.card-soon-text { margin-top: auto; }

/* ---------- Part page ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: .78rem; color: var(--muted); margin: 0 0 12px; min-width: 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--fg); text-decoration: underline; }
.crumbs .sep { opacity: .5; }
.part-head { display: flex; align-items: center; gap: 16px; margin: 0 0 10px; min-width: 0; scroll-margin-top: calc(var(--topbar-h) + 16px); }
.tile-lg { width: 56px; height: 56px; border-radius: 16px; }
.tile-lg .ico { width: 26px; height: 26px; }
.part-title { min-width: 0; flex: 1; }
.part-lead { margin: 0 0 18px; }
.part-title .display { font-size: clamp(1.8rem, 4.4vw, 2.6rem); line-height: 1.08; margin: 0; overflow-wrap: anywhere; }
@media (max-width: 479.98px) { .part-head { gap: 12px; } .tile-lg { width: 44px; height: 44px; border-radius: 13px; } .tile-lg .ico { width: 21px; height: 21px; } }

.facts { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
@media (max-width: 599.98px) { .fact-pride { grid-column: 1 / -1; } }
.fact { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; min-width: 0; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, rgba(var(--tint), .035), rgba(var(--tint), .01)); }
.fact-pride { box-shadow: inset 0 0 0 1px rgba(138, 42, 227, .14), 0 0 40px -26px var(--pride-glow); }
.fact-label { display: flex; align-items: center; gap: 6px; font: 500 .66rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fact-label .ico { width: 13px; height: 13px; }
.fact-value { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fact-value strong { font: 800 1.2rem/1 var(--head); color: var(--fg); letter-spacing: -.02em; white-space: nowrap; }
.fact-note { font-size: .75rem; color: var(--muted); }
.definition { position: relative; display: flex; gap: 12px; margin: 0 0 18px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(var(--tint), .025); color: var(--text); font-size: 1rem; font-style: italic; }
.definition .ico { width: 20px; height: 20px; color: var(--muted); }
.definition p { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Section tabs: sticky under the top bar, scroll sideways */
.section-tabs { position: sticky; top: var(--topbar-h); z-index: 20; display: flex; gap: 4px; margin: 0 -16px 16px; padding: 8px 16px; overflow-x: auto;
  scrollbar-width: none; background: var(--header-bg); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line); }
.section-tabs::-webkit-scrollbar { display: none; }
@media (min-width: 720px) { .section-tabs { margin: 0 -30px 18px; padding: 8px 30px; } }
.section-tab { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px 0 12px; border-radius: 999px; flex-shrink: 0;
  color: var(--muted); text-decoration: none; font-size: .8438rem; border: 1px solid transparent; transition: background .15s, color .15s; }
.section-tab .ico { width: 15px; height: 15px; }
.section-tab:hover { color: var(--fg); background: rgba(var(--tint), .06); }
.section-tab.active { color: var(--fg); background: rgba(var(--tint), .08); border-color: var(--line-strong); box-shadow: 0 0 22px -10px var(--bar-glow); }
.section-tab.is-empty .count { opacity: .6; }

/* Panels */
.panel { position: relative; min-width: 0; background: linear-gradient(180deg, rgba(var(--tint), .035), rgba(var(--tint), .01)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
@media (min-width: 720px) { .panel { padding: 18px 20px; } }
.section { scroll-margin-top: calc(var(--topbar-h) + 64px); }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-width: 0; }
.panel-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; }
.panel-head h2 .ico { width: 17px; height: 17px; color: var(--muted); }
.empty-state { display: flex; align-items: center; gap: 14px; padding: 22px; }
.empty-state p { margin: 0; color: var(--muted); }

/* Why not: themes of chips */
.themes { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .themes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.theme { min-width: 0; }
.theme h3 { font: 500 .7rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { max-width: 100%; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(var(--tint), .045); font-size: .8125rem;
  overflow-wrap: anywhere; }

/* Practices and plans: small cards */
.grid-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid-cards-wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.mini-card { min-width: 0; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(var(--tint), .025); }
.mini-card h3 { margin: 0 0 8px; overflow-wrap: anywhere; }
.mini-card .text { margin: 8px 0 0; color: var(--text); overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; min-width: 0; }
.tag { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; height: 22px; padding: 0 8px; border-radius: 999px; font: 500 .68rem/1 var(--mono);
  color: var(--muted); background: rgba(var(--tint), .06); border: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.tag .ico { width: 12px; height: 12px; }
.tag-code { max-width: 160px; display: inline-block; line-height: 20px; }
.more { margin-top: 10px; }
.more summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font: 500 .72rem/1 var(--mono); letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); padding: 4px 0; border-radius: 6px; }
.more summary::-webkit-details-marker { display: none; }
.more summary .ico { width: 13px; height: 13px; transition: transform .15s; }
.more[open] summary .ico { transform: rotate(90deg); }
.more summary:hover { color: var(--fg); }
.steps { margin: 8px 0 0; padding-left: 20px; font-size: .8438rem; display: grid; gap: 4px; }
.steps li { overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 12px 0 0; padding: 0 0 0 14px; border-left: 1px solid var(--line-strong); display: grid; gap: 10px; }
.timeline li { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.timeline li::before { content: ""; position: absolute; left: -19px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--fg);
  box-shadow: 0 0 10px var(--bar-glow); }
.timeline strong { font-weight: 600; font-size: .875rem; color: var(--fg); }
.dump { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(var(--tint), .04); border: 1px solid var(--line); font: 400 .75rem/1.55 var(--mono);
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; }

/* Goals */
.period + .period { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.period-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 10px; min-width: 0; }
.period-head h3 { display: flex; align-items: center; gap: 7px; margin: 0; font: 700 .95rem/1.2 var(--head); }
.period-head h3 .ico { width: 15px; height: 15px; color: var(--muted); }
.period-stat { font-size: .8125rem; color: var(--muted); }
.period-stat .mono { color: var(--ok); font-weight: 500; }
.period-bar { display: flex; align-items: center; gap: 8px; flex: 1 1 160px; max-width: 280px; margin-left: auto; font-size: .75rem; color: var(--muted); min-width: 0; }
.owner { margin-top: 10px; }
.owner-name { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font: 500 .72rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
.owner-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg); }
.owner-me { box-shadow: 0 0 8px 1px rgba(10, 101, 231, .8); }
.owner-partner { box-shadow: 0 0 8px 1px rgba(138, 42, 227, .8); }
.owner-shared { box-shadow: 0 0 8px 1px rgba(255, 214, 0, .8); }
.goal-list { list-style: none; margin: 0; padding: 0; }
.goal-section { margin: 10px 0 2px; padding: 0 4px; font-size: .75rem; color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.goal summary { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto minmax(110px, 170px); align-items: center; gap: 10px; padding: 7px 6px;
  border-top: 1px solid var(--line); cursor: pointer; list-style: none; border-radius: 8px; min-width: 0; }
.goal summary::-webkit-details-marker { display: none; }
.goal summary:hover { background: rgba(var(--tint), .035); }
.goal-list > li:first-child .goal summary, .goal-section + li .goal summary { border-top-color: transparent; }
.goal-state { display: inline-flex; color: var(--muted); }
.goal-state .ico { width: 18px; height: 18px; }
.goal.is-done .goal-state { color: var(--ok); }
.goal-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; }
.goal.is-done .goal-title { color: var(--muted); }
.goal-tags { display: flex; gap: 4px; min-width: 0; }
.goal-progress { display: flex; align-items: center; gap: 8px; min-width: 0; }
.goal-progress .mono { font-size: .75rem; min-width: 38px; text-align: right; color: var(--fg); white-space: nowrap; }
.goal-body { padding: 4px 6px 10px 36px; color: var(--text); overflow-wrap: anywhere; }
.goal-body p { margin: 0 0 4px; }
.goal-all-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px !important; }
@media (max-width: 899.98px) {
  .goal-tags { display: none; }
  .goal summary { grid-template-columns: 20px minmax(0, 1fr) minmax(84px, 120px); }
}
@media (max-width: 419.98px) {
  .goal summary { grid-template-columns: 20px minmax(0, 1fr) auto; }
  .goal-progress .meter { display: none; }
}

/* Documents */
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); min-width: 0; }
.doc:first-child { border-top: 0; }
.doc-ico { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: rgba(var(--tint), .06); border: 1px solid var(--line); color: var(--fg); }
.doc-ico .ico { width: 17px; height: 17px; }
.doc-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.doc-text strong { font-weight: 600; font-size: .9rem; color: var(--fg); }
@media (max-width: 479.98px) {
  .doc .tag { display: none; }
  .doc .btn { width: 34px; padding: 0; }
  .doc .btn .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Text document dialog */
.doc-dialog { width: min(860px, calc(100vw - 24px)); max-height: min(86vh, 900px); padding: 0; border: 1px solid var(--line-strong); border-radius: 18px;
  background: var(--ink); color: var(--text); box-shadow: var(--shadow); overflow: hidden; }
.doc-dialog[open] { display: flex; flex-direction: column; }
.doc-dialog::backdrop { background: var(--scrim); backdrop-filter: blur(3px); }
.doc-dialog-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line); min-width: 0; }
.doc-dialog-head h2 { flex: 1; margin: 0; font: 700 1rem/1.3 var(--head); color: var(--fg); }
.doc-dialog-body { margin: 0; padding: 16px 18px; overflow: auto; flex: 1; min-height: 0; font: 400 .8125rem/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

.doc a.btn { text-decoration: none; }

/* Spreadsheet viewer (static/js/sheet.js): a workbook as in a spreadsheet app — formula bar, grid, sheet tabs */
.sheet-dialog { --sheet-accent: #107C41; --sheet-sel: rgba(16, 124, 65, .12); --sheet-paper: #FFFFFF; --sheet-ink: #1A1A1A;
  --sheet-grid: #E1E3E6; --sheet-head: #F3F4F6; --sheet-head-ink: #5B6168; --sheet-head-on: #DDEFE5;
  width: min(1280px, calc(100vw - 24px)); height: min(90vh, 960px); max-width: none; max-height: none; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 18px; background: var(--ink); color: var(--text); box-shadow: var(--shadow); overflow: hidden; }
[data-theme="dark"] .sheet-dialog, :root:not([data-theme="light"]) .sheet-dialog { --sheet-accent: #4CC38A; --sheet-sel: rgba(76, 195, 138, .16);
  --sheet-paper: #0D0D0D; --sheet-ink: #EDEFF2; --sheet-grid: #262829; --sheet-head: #151617; --sheet-head-ink: #A1A4A5; --sheet-head-on: #173326; }
[data-theme="light"] .sheet-dialog { --sheet-accent: #107C41; --sheet-sel: rgba(16, 124, 65, .12); --sheet-paper: #FFFFFF; --sheet-ink: #1A1A1A;
  --sheet-grid: #E1E3E6; --sheet-head: #F3F4F6; --sheet-head-ink: #5B6168; --sheet-head-on: #DDEFE5; }
.sheet-dialog[open] { display: flex; flex-direction: column; }
.sheet-dialog::backdrop { background: var(--scrim); backdrop-filter: blur(3px); }
@media (max-width: 599.98px) { .sheet-dialog { width: 100vw; height: 100dvh; border-radius: 0; border: 0; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.sheet-badge { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: var(--sheet-accent); color: #fff; }
.sheet-badge .ico { width: 17px; height: 17px; }
.sheet-head h2 { flex: 1; min-width: 0; margin: 0; font: 700 1rem/1.3 var(--head); color: var(--fg); }
@media (max-width: 479.98px) { .sheet-ro { display: none; } }
.sheet-formula { display: flex; align-items: center; gap: 0; min-width: 0; border-bottom: 1px solid var(--line); background: var(--panel); font-size: .8125rem; }
.sheet-ref { flex: none; width: 76px; padding: 7px 10px; border-right: 1px solid var(--line); color: var(--fg); text-align: center; }
.sheet-fx { flex: none; padding: 7px 10px; border-right: 1px solid var(--line); color: var(--muted); font: italic 600 .8125rem/1 var(--head); }
.sheet-value { flex: 1; min-width: 0; padding: 7px 10px; color: var(--text); }
.sheet-grid { flex: 1; min-height: 0; overflow: auto; background: var(--sheet-paper); overscroll-behavior: contain; outline: none; }
.sheet-grid:focus-visible { box-shadow: inset 0 0 0 2px var(--sheet-accent); }
.sheet-status { margin: 0; padding: 24px; color: var(--muted); }
.sheet-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max-content; color: var(--sheet-ink);
  font: 400 .8125rem/1.25 var(--body); }
.sheet-table td, .sheet-table th { border-right: 1px solid var(--sheet-grid); border-bottom: 1px solid var(--sheet-grid); padding: 2px 6px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; vertical-align: bottom; height: 21px; }
.sheet-table thead th { position: sticky; top: 0; z-index: 2; background: var(--sheet-head); color: var(--sheet-head-ink); font: 500 .72rem/1 var(--mono);
  text-align: center; height: 24px; }
.sheet-table tbody th { position: sticky; left: 0; z-index: 1; background: var(--sheet-head); color: var(--sheet-head-ink); font: 500 .72rem/1 var(--mono);
  text-align: center; width: 44px; min-width: 44px; vertical-align: middle; }
.sheet-table thead th.corner { left: 0; z-index: 3; width: 44px; }
.sheet-table th.is-on { background: var(--sheet-head-on); color: var(--sheet-accent); }
.sheet-table td { cursor: cell; }
.sheet-table .hid { padding: 0; border-right: 0; font-size: 0; color: transparent; }
.sheet-table td.n { text-align: right; font-variant-numeric: tabular-nums; }
.sheet-table td.b { font-weight: 700; } .sheet-table td.i { font-style: italic; } .sheet-table td.u { text-decoration: underline; }
.sheet-table td.al-left { text-align: left; } .sheet-table td.al-center { text-align: center; } .sheet-table td.al-right { text-align: right; }
.sheet-table td.va-middle { vertical-align: middle; } .sheet-table td.va-top { vertical-align: top; }
.sheet-table td.wrap { white-space: normal; overflow-wrap: anywhere; }
.sheet-table td.is-sel { box-shadow: inset 0 0 0 2px var(--sheet-accent); background-image: linear-gradient(var(--sheet-sel), var(--sheet-sel)); }
.sheet-table tr.frozen td, .sheet-table tr.frozen th { position: sticky; z-index: 1; }
.sheet-tabs { display: flex; align-items: stretch; gap: 2px; padding: 0 8px; min-width: 0; overflow-x: auto; border-top: 1px solid var(--line);
  background: var(--panel); scrollbar-width: none; }
.sheet-tabs::-webkit-scrollbar { display: none; }
.sheet-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--muted); font: 500 .8125rem/1 var(--body); cursor: pointer; white-space: nowrap; }
.sheet-tab .ico { width: 14px; height: 14px; }
.sheet-tab:hover { color: var(--fg); background: rgba(var(--tint), .05); }
.sheet-tab[aria-selected="true"] { color: var(--sheet-accent); border-bottom-color: var(--sheet-accent); background: var(--sheet-paper); font-weight: 600; }
.sheet-note { margin: 0; padding: 6px 12px; font-size: .75rem; color: var(--muted); border-top: 1px solid var(--line); }

/* Flash */
.flash { display: flex; align-items: flex-start; gap: 10px; border-radius: 12px; padding: 9px 12px; margin: 0 0 14px; font-size: .875rem; border: 1px solid; color: var(--text); }
.flash::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.flash-ko { --c: var(--ko); background: color-mix(in srgb, var(--ko) 9%, transparent); border-color: color-mix(in srgb, var(--ko) 42%, transparent); }

/* ---------- Login card ---------- */
.gui-auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 72px 16px 24px;
  background: radial-gradient(45% 50% at 85% 5%, var(--glow-a), transparent 70%), radial-gradient(40% 45% at 5% 95%, var(--glow-b), transparent 70%),
    radial-gradient(25% 25% at 50% 0%, var(--glow-c), transparent 70%), var(--ink); }
.gui-corner { position: fixed; top: 14px; right: 14px; z-index: 10; display: flex; gap: 8px; }
.gui-corner .icon-btn { backdrop-filter: blur(8px); }
.auth-box { width: 100%; max-width: 400px; padding: 28px 24px; border: 1px solid var(--line-strong); border-radius: 22px;
  background: color-mix(in srgb, var(--ink) 78%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); }
@media (min-width: 480px) { .auth-box { padding: 32px; } }
.auth-logo { display: flex; align-items: center; gap: 10px; color: var(--fg); font: 800 1.35rem/1 var(--head); letter-spacing: -.035em; margin: 0 0 24px; }
.gui-auth h1 { font-size: 1.75rem; }
.auth-form { display: grid; gap: 14px; margin-top: 18px; }
.field { min-width: 0; }
.gui-auth label { display: block; font-weight: 500; font-size: .8125rem; color: var(--muted); margin-bottom: 6px; }
.gui-auth input { width: 100%; font: inherit; font-size: .9375rem; color: var(--text); background: rgba(var(--tint), .03); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 10px 12px; min-height: 44px; min-width: 0; }
.gui-auth input:hover { border-color: rgba(var(--tint), .28); }
.gui-auth input:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px rgba(var(--tint), .14); }
.gui-auth .btn-block { min-height: 44px; font-size: .9375rem; margin-top: 6px; }
.auth-foot { margin: 18px 0 0; text-align: center; }
.auth-foot a { color: var(--muted); }
