/* Shared shell: one navigation for every module page. */
:root { --nav-w: 188px; --nav-bg: #0f1d36; --nav-fg: #cbd5e1; --nav-active: #5eead4; --dim-health: #0f766e; --dim-wealth: #7c3aed; --dim-cognition: #0369a1; --dim-career: #b45309; --dim-relations: #be185d; --dim-mind: #4338ca; --dim-appearance: #db2777; }
body.has-shell { padding-left: var(--nav-w); }
.lc-nav { position: fixed; inset: 0 auto 0 0; width: var(--nav-w); background: var(--nav-bg); color: var(--nav-fg); display: flex; flex-direction: column; padding: 18px 10px; gap: 2px; z-index: 50; }
.lc-brand { color: white; font-weight: 800; font-size: 17px; padding: 4px 10px 16px; letter-spacing: .04em; text-decoration: none; }
.lc-brand small { display: block; color: #64748b; font-weight: 400; font-size: 11px; margin-top: 3px; letter-spacing: 0; }
.lc-nav a.lc-link { display: flex; align-items: center; gap: 10px; color: var(--nav-fg); text-decoration: none; padding: 9px 10px; border-radius: 9px; font-size: 14px; }
.lc-nav a.lc-link:hover { background: #ffffff10; color: white; }
.lc-nav a.lc-link.active { background: #5eead41a; color: var(--nav-active); font-weight: 700; }
.lc-ico { width: 20px; text-align: center; font-size: 15px; }
.lc-sep { height: 1px; background: #ffffff14; margin: 8px 10px; }
.lc-nav-foot { margin-top: auto; display: grid; gap: 6px; padding: 0 6px; }
.lc-nav-foot button { background: #ffffff12; color: var(--nav-fg); font-size: 12px; padding: 7px 9px; text-align: left; }
.lc-status { font-size: 11px; color: #64748b; padding: 0 4px; line-height: 1.4; }
.lc-status.ok::before { content: '● '; color: #34d399; } .lc-status.warn::before { content: '● '; color: #f59e0b; }
.lc-banner { background: #fef3c7; color: #92400e; padding: 10px 16px; font-size: 13px; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.lc-banner button { padding: 6px 10px; font-size: 12px; background: #92400e; }
/* Module pages keep their own header; token entry and back links now live in the shell. */
body.has-shell .header-tools #token, body.has-shell .header-tools #saveToken, body.has-shell .back-link { display: none; }
.lc-dialog { border: 0; border-radius: 14px; padding: 20px; width: min(380px, calc(100vw - 32px)); box-shadow: 0 20px 60px #0f172a55; }
.lc-dialog::backdrop { background: #0f172a88; }
.lc-dialog h3 { margin: 0 0 6px; } .lc-dialog p { color: #64748b; font-size: 13px; margin: 0 0 12px; line-height: 1.5; }
.lc-dialog .row { justify-content: flex-end; }

@media (max-width: 900px) {
  body.has-shell { padding-left: 0; padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .lc-nav { inset: auto 0 0 0; width: auto; height: calc(60px + env(safe-area-inset-bottom)); flex-direction: row; padding: 4px 4px env(safe-area-inset-bottom); gap: 0; overflow-x: auto; scrollbar-width: none; border-top: 1px solid #ffffff14; }
  .lc-nav::-webkit-scrollbar { display: none; }
  .lc-brand, .lc-sep, .lc-status { display: none; }
  .lc-nav a.lc-link { flex: 1 0 58px; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 11px; justify-content: center; border-radius: 8px; }
  .lc-ico { font-size: 18px; width: auto; }
  .lc-nav-foot { margin: 0; padding: 0; display: flex; }
  .lc-nav-foot button { flex: 1 0 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: transparent; font-size: 11px; padding: 6px 2px; }
  .lc-nav-foot button .lc-ico { font-size: 18px; }
}

/* ---- shared compass page parts ---- */
.dim-chip { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 700; color: white; background: #64748b; }
.dim-health { background: var(--dim-health); } .dim-wealth { background: var(--dim-wealth); } .dim-cognition { background: var(--dim-cognition); } .dim-career { background: var(--dim-career); } .dim-relations { background: var(--dim-relations); } .dim-mind { background: var(--dim-mind); } .dim-appearance { background: var(--dim-appearance); }
.compass-hero { background: linear-gradient(135deg, #0f1d36, #134e4a); color: white; }
.compass-hero .eyebrow { color: #5eead4; } .compass-hero h2 { font-size: 26px; margin: 6px 0 4px; } .compass-hero p { color: #cbd5e1; line-height: 1.55; }
.compass-hero a { color: #5eead4; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.stat-row div { background: #ffffff12; border-radius: 10px; padding: 10px 12px; font-size: 12px; color: #cbd5e1; }
.stat-row strong { display: block; font-size: 22px; color: white; margin-top: 3px; }
.dim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.dim-card { display: block; text-decoration: none; color: inherit; background: white; border-radius: 12px; padding: 14px; box-shadow: 0 4px 18px #182b4d12; border-top: 4px solid #94a3b8; }
.dim-card:hover { box-shadow: 0 6px 22px #182b4d22; }
.dim-card h4 { margin: 0; font-size: 16px; display: flex; justify-content: space-between; align-items: baseline; }
.dim-card h4 small { color: #94a3b8; font-weight: 400; font-size: 11px; }
.dim-card .dim-signal { color: #334155; font-size: 13px; margin: 8px 0 6px; min-height: 18px; }
.dim-card .dim-meta { color: #64748b; font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.bar { height: 6px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-top: 8px; } .bar > span { display: block; height: 100%; background: currentColor; }
.due-list { display: grid; gap: 7px; } .due-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: #fffbeb; text-decoration: none; color: inherit; }
.due-item strong { font-size: 14px; } .due-item p { margin: 3px 0 0; color: #64748b; font-size: 12px; }
.score-pick { display: flex; gap: 4px; margin-top: 5px; } .score-pick button { flex: 1; padding: 7px 0; background: #f1f5f9; color: #334155; }
.score-pick button.on { background: #0f766e; color: white; }
.empty { color: #94a3b8; font-size: 13px; padding: 8px 0; }
.item-card { border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px; background: white; }
.item-card + .item-card { margin-top: 10px; }
.item-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.item-head h4 { margin: 0 0 4px; font-size: 16px; }
.item-meta { color: #64748b; font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.item-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; } .item-actions button { padding: 6px 10px; font-size: 12px; }
.status-pill { border-radius: 999px; padding: 2px 8px; font-size: 11px; background: #e2e8f0; color: #334155; }
.status-pill.thinking { background: #e0e7ff; color: #3730a3; } .status-pill.decided { background: #fef3c7; color: #92400e; } .status-pill.reviewed { background: #dcfce7; color: #166534; }
.status-pill.overdue { background: #fee2e2; color: #991b1b; }
.prose { white-space: pre-wrap; line-height: 1.6; font-size: 14px; color: #334155; background: #f8fafc; border-radius: 9px; padding: 10px 12px; margin-top: 8px; }
.evo-table { width: 100%; border-collapse: collapse; font-size: 12px; } .evo-table th, .evo-table td { padding: 7px 6px; border-bottom: 1px solid #e2e8f0; text-align: center; white-space: nowrap; } .evo-table th:first-child, .evo-table td:first-child { text-align: left; }
.table-scroll { overflow-x: auto; max-width: 100%; }
body.has-shell main > * { min-width: 0; }
@media (max-width: 700px) { .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- to-do board (Microsoft To Do style) ---- */
.todo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.todo-full { grid-template-columns: 210px minmax(0, 1fr); }
.todo-full.detail-open { grid-template-columns: 210px minmax(0, 1fr) 320px; }
.todo-myday.detail-open { grid-template-columns: minmax(0, 1fr) 320px; }
.todo-side { background: white; border-radius: 14px; padding: 10px; box-shadow: 0 4px 18px #182b4d12; position: sticky; top: 12px; }
.todo-view { display: flex; align-items: center; gap: 9px; width: 100%; background: transparent; color: #1e293b; padding: 8px 10px; border-radius: 8px; text-align: left; font-size: 14px; }
.todo-view span { width: 18px; text-align: center; color: #64748b; }
.todo-view b { margin-left: auto; font-weight: 400; color: #64748b; font-size: 12px; }
.todo-view:hover { background: #f1f5f9; } .todo-view.on { background: #e0f2fe; color: #0c4a6e; font-weight: 700; }
.todo-lists { border-top: 1px solid #e2e8f0; margin-top: 6px; padding-top: 6px; }
.todo-newlist input { margin: 6px 0 0; border: 0; background: #f8fafc; font-size: 13px; }
.todo-main { background: white; border-radius: 14px; padding: 16px; box-shadow: 0 4px 18px #182b4d12; min-width: 0; }
.todo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.todo-title { margin: 0; font-size: 20px; color: #0c4a6e; } .todo-sub { margin: 3px 0 0; color: #64748b; font-size: 13px; }
.todo-head-tools { display: flex; gap: 6px; } .todo-head-tools button { padding: 6px 10px; font-size: 13px; flex: 0 0 auto; }
.todo-add { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; padding: 4px 12px; border-radius: 10px; background: #f8fafc; border: 1px solid #e2e8f0; }
.todo-add input { border: 0; background: transparent; margin: 0; padding: 9px 0; }
.todo-add input:focus { outline: none; } .todo-plus { color: #2563eb; font-size: 18px; }
.todo-warn { background: #fffbeb; color: #92400e; border-radius: 8px; padding: 8px 10px; font-size: 12px; margin: 6px 0; }
.todo-items { display: grid; gap: 4px; }
.todo-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; background: #fff; border: 1px solid #eef2f7; }
.todo-item:hover { background: #f8fafc; } .todo-item.active { border-color: #93c5fd; background: #eff6ff; }
.todo-check { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; border: 2px solid #94a3b8; background: white; padding: 0; color: white; font-size: 12px; line-height: 1; }
.todo-check.small { width: 18px; height: 18px; flex-basis: 18px; font-size: 10px; }
.todo-check:hover { border-color: #2563eb; }
.todo-item.done .todo-check, .todo-check.on, .td-step.done .todo-check { background: #2563eb; border-color: #2563eb; }
.todo-text { flex: 1; min-width: 0; cursor: pointer; }
.todo-name { font-size: 14px; overflow-wrap: anywhere; } .todo-item.done .todo-name { text-decoration: line-through; color: #94a3b8; }
.todo-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; color: #64748b; font-size: 11px; margin-top: 3px; }
.todo-meta i { font-style: normal; color: #cbd5e1; } .todo-meta .overdue { color: #dc2626; font-weight: 700; }
.todo-meta .dim-chip { font-size: 10px; padding: 1px 6px; }
.todo-star { background: transparent; color: #94a3b8; font-size: 18px; padding: 2px 4px; flex: 0 0 auto; } .todo-star.on { color: #2563eb; }
.todo-group { font-size: 12px; font-weight: 700; color: #475569; margin: 10px 2px 2px; }
.todo-done-toggle { background: transparent; color: #475569; font-size: 13px; font-weight: 700; padding: 10px 2px 4px; text-align: left; }
.todo-empty { color: #94a3b8; font-size: 13px; padding: 12px 4px; }
.todo-suggest { background: #f8fafc; border-radius: 10px; padding: 6px 10px 10px; margin-top: 10px; }
.todo-sg { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid #e2e8f0; font-size: 13px; }
.todo-sg small { display: block; color: #64748b; font-size: 11px; } .todo-sg button { padding: 5px 9px; font-size: 12px; flex: 0 0 auto; }
.todo-detail[hidden], .todo-suggest[hidden], .todo-warn[hidden], .todo-add[hidden] { display: none; }
.todo-detail { background: #f8fafc; border-radius: 14px; padding: 14px; box-shadow: 0 4px 18px #182b4d12; display: grid; gap: 8px; position: sticky; top: 12px; }
.td-top { display: flex; gap: 8px; align-items: flex-start; background: white; border-radius: 10px; padding: 10px; }
.td-title { border: 0; min-height: 0; padding: 0; font-weight: 700; font-size: 16px; resize: none; }
.td-steps { background: white; border-radius: 10px; padding: 6px 10px; }
.td-step { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.td-step.done span { text-decoration: line-through; color: #94a3b8; } .td-step span { flex: 1; }
.td-x { background: transparent; color: #94a3b8; padding: 0 4px; font-size: 16px; }
.td-addstep input { border: 0; margin: 0; padding: 8px 0; font-size: 13px; color: #2563eb; }
.td-row { background: white; color: #1e293b; text-align: left; border-radius: 10px; font-size: 13px; } .td-row.on { color: #2563eb; font-weight: 700; }
.td-field { background: white; border-radius: 10px; padding: 8px 10px; font-size: 12px; font-weight: 400; color: #475569; margin: 0; }
.td-field input, .td-field select, .td-field textarea { margin-top: 4px; font-size: 13px; }
.td-notes textarea { min-height: 80px; }
.td-hint { margin: 0; color: #64748b; font-size: 11px; min-height: 0; }
.td-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: #94a3b8; font-size: 11px; }
.td-foot button { padding: 6px 10px; font-size: 12px; flex: 0 0 auto; } .td-del { background: #fee2e2; color: #b91c1c; }
.tips-list { display: grid; gap: 8px; }
.tip { border-radius: 10px; padding: 10px 12px; background: #eef2ff; border-left: 3px solid #4f46e5; }
.tip strong { font-size: 14px; } .tip p { margin: 4px 0 0; color: #475569; font-size: 12px; line-height: 1.5; } .tip small { color: #4f46e5; font-size: 11px; }
.logic-doc { line-height: 1.7; font-size: 14px; color: #1e293b; }
.logic-doc h1 { font-size: 20px; margin: 0 0 8px; } .logic-doc h2 { font-size: 16px; margin: 18px 0 6px; color: #0c4a6e; } .logic-doc h3 { font-size: 14px; margin: 12px 0 4px; }
.logic-doc p, .logic-doc ul, .logic-doc ol { margin: 6px 0; } .logic-doc blockquote { margin: 6px 0; padding: 8px 12px; background: #f8fafc; border-left: 3px solid #94a3b8; color: #475569; }
.logic-doc table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0; } .logic-doc th, .logic-doc td { border-bottom: 1px solid #e2e8f0; padding: 6px; text-align: left; vertical-align: top; }
@media (max-width: 1100px) {
  .todo-full.detail-open, .todo-myday.detail-open { grid-template-columns: 210px minmax(0, 1fr); }
  .todo-myday.detail-open { grid-template-columns: minmax(0, 1fr); }
  .todo-detail { position: fixed; inset: 0 0 0 auto; width: min(380px, 100vw); z-index: 60; border-radius: 0; overflow-y: auto; align-content: start; box-shadow: -10px 0 30px #0f172a33; }
}
@media (max-width: 760px) {
  .todo-full, .todo-full.detail-open { grid-template-columns: minmax(0, 1fr); }
  .todo-side { position: static; display: flex; flex-direction: column; }
  .todo-views, .todo-lists { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .todo-view { flex: 0 0 auto; width: auto; padding: 7px 10px; } .todo-view b { margin-left: 4px; }
  .todo-lists { border-top: 0; margin-top: 2px; padding-top: 0; }
  .todo-detail { width: 100vw; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}
