/* Concept pages (/app/concepts/*). Own `cx-` namespace on top of the app's dark tokens. */
.cx-root { min-height: 100vh; background: var(--bg, #0a0a0a); color: var(--text-primary, #f2f4f7); font-family: inherit; --cx-accent: #6d8cff; --cx-accent-soft: #6d8cff26; --cx-ok: #3fb97f; --cx-warn: #d99a3d; --cx-bad: #d95c5c; --cx-card: var(--bg-4, #1b1d21); --cx-line: var(--line, #22262d); --cx-muted: var(--text-secondary, #aeb4be); }
.cx-root * { box-sizing: border-box; }
.cx-nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px; padding: 10px 16px; overflow-x: auto; background: var(--bg-deep, #101216); border-bottom: 1px solid var(--cx-line); }
.cx-nav__title { font-weight: 700; margin-right: 8px; color: var(--cx-muted); }
.cx-nav__link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; color: var(--cx-muted); text-decoration: none; white-space: nowrap; font-size: 14px; }
.cx-nav__link b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--cx-card); font-size: 12px; }
.cx-nav__link:hover, .cx-nav__link[aria-current] { color: var(--text-primary, #fff); background: var(--cx-accent-soft); }
.cx-nav__back { margin-left: auto; color: var(--cx-muted); font-size: 13px; text-decoration: none; white-space: nowrap; }
.cx-page { padding: 20px 16px 60px; max-width: 1400px; margin: 0 auto; }
.cx-head h1 { margin: 0 0 4px; font-size: 22px; }
.cx-head p { margin: 0 0 18px; color: var(--cx-muted); font-size: 14px; }

/* controls */
.cx-btn { border: 1px solid var(--cx-line); background: var(--cx-card); color: inherit; border-radius: 8px; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.cx-btn:hover { border-color: var(--cx-accent); }
.cx-btn:disabled { opacity: .45; cursor: not-allowed; }
.cx-btn--primary { background: var(--cx-accent); border-color: var(--cx-accent); color: #0a0a0a; font-weight: 600; }
.cx-btn--danger { color: var(--cx-bad); }
.cx-btn--sm { padding: 4px 10px; font-size: 13px; }
.cx-icon-btn { border: 0; background: none; color: var(--cx-muted); cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 6px; }
.cx-icon-btn:hover { background: var(--cx-accent-soft); color: #fff; }
.cx-chip { border: 1px solid var(--cx-line); background: var(--cx-card); color: inherit; border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
.cx-chip--on, .cx-chip:hover { border-color: var(--cx-accent); background: var(--cx-accent-soft); }
.cx-spacer { flex: 1; }
.cx-empty { color: var(--cx-muted); font-size: 14px; padding: 16px 4px; }
.cx-error { color: var(--cx-bad); font-size: 13px; min-height: 1em; margin: 0; }
.cx-hint { color: var(--cx-muted); font-size: 12px; margin: 0; }
.cx-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--cx-accent-soft); color: #b9c7ff; font-size: 12px; }
.cx-tag--none { background: var(--cx-card); color: var(--cx-muted); }
.cx-planfact { color: var(--cx-muted); font-size: 12px; }
.cx-over { color: var(--cx-warn); }
.cx-nofact { color: var(--cx-muted); font-style: italic; }
.cx-check { width: 22px; height: 22px; flex: none; border-radius: 6px; border: 1.5px solid var(--cx-muted); background: none; color: #0a0a0a; font-size: 14px; line-height: 1; cursor: pointer; display: inline-grid; place-items: center; padding: 0; }
.cx-check--on { background: var(--cx-ok); border-color: var(--cx-ok); }

/* ring / bar */
.cx-ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.cx-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cx-ring__bg { fill: none; stroke: var(--cx-line); stroke-width: 5; }
.cx-ring__fg { fill: none; stroke: var(--cx-accent); stroke-width: 5; stroke-linecap: round; }
.cx-ring b { font-size: 11px; position: relative; }
.cx-bar { display: block; height: 6px; border-radius: 3px; background: var(--cx-line); overflow: hidden; min-width: 80px; }
.cx-bar i { display: block; height: 100%; background: var(--cx-accent); }

/* lists */
.cx-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cx-item { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--cx-line); border-radius: 10px; background: var(--cx-card); cursor: pointer; }
.cx-item:hover { border-color: #3a4152; }
.cx-item--on { border-color: var(--cx-accent); background: var(--cx-accent-soft); }
.cx-item__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cx-item__main small { color: var(--cx-muted); font-size: 12px; }
.cx-cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cx-col { border: 1px solid var(--cx-line); border-radius: 12px; padding: 12px; background: var(--bg-1, #111315); min-height: 300px; }
.cx-col__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cx-col__head h2 { margin: 0; font-size: 15px; }
.cx-card { border: 1px solid var(--cx-line); border-radius: 12px; padding: 14px; background: var(--cx-card); }

/* tabs & tables */
.cx-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--cx-line); flex-wrap: wrap; padding-bottom: 8px; }
.cx-tab { border: 0; background: none; color: var(--cx-muted); padding: 8px 12px; font: inherit; cursor: pointer; border-radius: 8px; }
.cx-tab--on { color: #fff; background: var(--cx-accent-soft); }
.cx-tab__n { margin-left: 6px; font-size: 12px; color: var(--cx-muted); }
.cx-table-wrap { overflow-x: auto; border: 1px solid var(--cx-line); border-radius: 12px; }
.cx-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cx-table th { text-align: left; font-weight: 500; color: var(--cx-muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--cx-line); white-space: nowrap; }
.cx-table td { padding: 10px 12px; border-bottom: 1px solid var(--cx-line); vertical-align: middle; }
.cx-table tr:last-child td { border-bottom: 0; }
.cx-table small { color: var(--cx-muted); }
.cx-td-bar { min-width: 140px; }

/* editor host */
.cx-host--modal, .cx-host--drawer { position: fixed; inset: 0; z-index: 50; display: flex; }
.cx-host--modal { align-items: center; justify-content: center; padding: 16px; }
.cx-host--drawer { justify-content: flex-end; }
.cx-scrim { position: absolute; inset: 0; border: 0; background: #000a; cursor: default; }
.cx-sheet { position: relative; background: var(--bg-2, #141414); border: 1px solid var(--cx-line); border-radius: 14px; padding: 16px; width: 100%; max-width: 480px; max-height: 92vh; overflow: auto; }
.cx-host--drawer .cx-sheet { max-width: 420px; height: 100%; max-height: none; border-radius: 14px 0 0 14px; }
.cx-host--panel .cx-sheet { max-width: none; }
.cx-sheet__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cx-sheet__head h3 { margin: 0; font-size: 16px; }
.cx-form { display: flex; flex-direction: column; gap: 12px; }
.cx-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.cx-field__label { font-size: 12px; color: var(--cx-muted); }
.cx-input { width: 100%; background: var(--bg-1, #111315); color: inherit; border: 1px solid var(--cx-line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; }
.cx-input:focus { outline: 2px solid var(--cx-accent); outline-offset: -1px; }
.cx-row { display: flex; gap: 8px; }
.cx-quick { display: flex; gap: 6px; }
.cx-seg { display: flex; border: 1px solid var(--cx-line); border-radius: 8px; overflow: hidden; }
.cx-seg__btn { flex: 1; border: 0; background: none; color: var(--cx-muted); padding: 7px 4px; font: inherit; font-size: 13px; cursor: pointer; }
.cx-seg__btn--on { background: var(--cx-accent-soft); color: #fff; }
.cx-form__actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .cx-cols3 { grid-template-columns: 1fr; }
  .cx-host--drawer .cx-sheet { border-radius: 14px; }
}

/* kanban */
.cx-kcard { display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.cx-kcard__top { display: flex; justify-content: space-between; align-items: center; }
.cx-kcard small { color: var(--cx-muted); }
.cx-kcard__actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.cx-chipgroup { display: inline-flex; align-items: center; }
.cx-chips-wrap { display: flex; flex-wrap: wrap; gap: 6px; }

/* tree + split layout */
.cx-split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.cx-sticky { position: sticky; top: 64px; }
.cx-tree, .cx-tree__children { list-style: none; margin: 0; padding: 0; }
.cx-tree__children { margin-left: 22px; border-left: 1px dashed var(--cx-line); padding-left: 10px; }
.cx-tree__node { margin: 4px 0; }
.cx-tree__node--goal > .cx-tree__row { background: var(--cx-card); border-radius: 10px; }
.cx-tree__row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; }
.cx-tree__row:hover { background: var(--cx-accent-soft); }
.cx-tree__row--act { font-size: 13px; color: var(--cx-muted); }
.cx-tree__label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cx-tree__label small { color: var(--cx-muted); }
@media (max-width: 900px) { .cx-split { grid-template-columns: 1fr; } .cx-sticky { position: static; } }

/* generic helpers */
.cx-h2 { margin: 0; font-size: 15px; }
.cx-stack { display: flex; flex-direction: column; gap: 16px; }
.cx-split--wide { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.cx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.cx-goalcard { display: flex; align-items: center; gap: 14px; cursor: pointer; text-align: left; color: inherit; font: inherit; }
.cx-goalcard--on { border-color: var(--cx-accent); background: var(--cx-accent-soft); }
.cx-goalcard--new { justify-content: center; border-style: dashed; color: var(--cx-muted); min-height: 96px; }
.cx-stackitem { list-style: none; }
.cx-subpanel { margin: 4px 0 8px 34px; padding: 8px; border-left: 2px solid var(--cx-line); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }

/* day timeline */
.cx-timeline { position: relative; display: grid; grid-template-columns: 56px 1fr 1fr; height: 720px; border: 1px solid var(--cx-line); border-radius: 12px; background: var(--bg-1, #111315); overflow: hidden; }
.cx-timeline__hours { display: flex; flex-direction: column; }
.cx-timeline__hour { flex: 1; border-top: 1px solid var(--cx-line); font-size: 11px; color: var(--cx-muted); padding: 2px 6px; }
.cx-timeline__hour:first-child { border-top: 0; }
.cx-timeline__lane { position: relative; border-left: 1px solid var(--cx-line); }
.cx-timeline__cap { position: absolute; top: 2px; right: 6px; color: var(--cx-muted); font-size: 11px; z-index: 2; }
.cx-block { position: absolute; left: 6px; right: 6px; overflow: hidden; border-radius: 8px; padding: 4px 8px; text-align: left; font: inherit; font-size: 12px; color: #fff; cursor: pointer; display: flex; flex-direction: column; border: 1px solid transparent; }
.cx-block b { font-weight: 600; }
.cx-block small { opacity: .8; }
.cx-block--plan { background: #6d8cff26; border-color: #6d8cff66; }
.cx-block--fact { background: var(--cx-accent); color: #0a0a0a; }
.cx-block--live { background: var(--cx-ok); }

/* live tracker */
.cx-now { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.cx-now__task { margin: 0; font-size: 20px; }
.cx-now__time { font-size: 44px; font-variant-numeric: tabular-nums; font-weight: 700; }
.cx-live { color: var(--cx-ok); font-weight: 700; letter-spacing: .06em; }
@media (max-width: 900px) { .cx-split--wide { grid-template-columns: 1fr; } .cx-timeline { height: 560px; } }

/* quick add */
.cx-quickbar { display: flex; gap: 8px; }
.cx-quickbar__input { font-size: 16px; padding: 12px 14px; }
.cx-quickbar__preview { margin: 8px 2px 4px; }

/* week */
.cx-split--rail { grid-template-columns: 260px minmax(0, 1fr); }
.cx-week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.cx-day { border: 1px solid var(--cx-line); border-radius: 12px; background: var(--bg-1, #111315); padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 320px; }
.cx-day--today { border-color: var(--cx-accent); }
.cx-day__head { display: flex; align-items: center; justify-content: space-between; }
.cx-day__head small { color: var(--cx-muted); }
.cx-wtask { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 10px; background: var(--cx-card); border: 1px solid var(--cx-line); cursor: pointer; font-size: 13px; }
.cx-wtask small { color: var(--cx-muted); }
.cx-wtask--done b { text-decoration: line-through; opacity: .6; }
.cx-chip--fact { background: #3fb97f26; border-color: #3fb97f66; padding: 2px 8px; font-size: 12px; }
@media (max-width: 900px) { .cx-split--rail { grid-template-columns: 1fr; } }

/* wizard */
.cx-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.cx-step { display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--cx-line); background: var(--cx-card); color: inherit; font: inherit; cursor: pointer; }
.cx-step:disabled { opacity: .45; cursor: not-allowed; }
.cx-step b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--cx-line); flex: none; }
.cx-step span { display: flex; flex-direction: column; }
.cx-step small { color: var(--cx-muted); }
.cx-step--on { border-color: var(--cx-accent); background: var(--cx-accent-soft); }
.cx-step--on b { background: var(--cx-accent); color: #0a0a0a; }
.cx-step--done b { background: var(--cx-ok); color: #0a0a0a; }
