/* VOLA Task — responsive styles (phone first adjustments at the bottom) */
:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --surface-3: #e9ecf1;
  --line: #e2e5ea;
  --line-2: #d3d8df;
  --text: #1a1d21;
  --text-2: #464c55;
  --muted: #6b7280;
  --accent: #2a78d6;
  --accent-2: #1c5cab;
  --accent-soft: #e6f0fc;
  --good: #13865c;
  --good-soft: #e3f4ec;
  --bad: #c9302f;
  --bad-soft: #fdeceb;
  --warn: #a86b00;
  --warn-soft: #fdf3dc;
  --sun: #f5a524;
  --sun-soft: #fff4dd;
  --track: #e8ebf0;
  --series-1: #2a78d6;
  --heat-0: #ebedf0;
  --heat-1: #b7d3f6;
  --heat-2: #6da7ec;
  --heat-3: #2a78d6;
  --heat-4: #184f95;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 4px 12px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --r: 10px;
  --r-sm: 7px;
  --sidebar: 248px;
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, "Segoe UI", sans-serif;
  --tl-left: 260px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111316;
    --surface: #1a1d21;
    --surface-2: #22262b;
    --surface-3: #2a2f35;
    --line: #2d3238;
    --line-2: #3a4048;
    --text: #eceef1;
    --text-2: #c4c9d0;
    --muted: #949ca7;
    --accent: #4a92ea;
    --accent-2: #86b6ef;
    --accent-soft: #1b2c42;
    --good: #2fb37f;
    --good-soft: #15302a;
    --bad: #ef6b6a;
    --bad-soft: #3a1d1e;
    --warn: #e0a73a;
    --warn-soft: #3a2e14;
    --sun: #f5b545;
    --sun-soft: #3a2f17;
    --track: #2d3238;
    --series-1: #3987e5;
    --heat-0: #262a30;
    --heat-1: #184f95;
    --heat-2: #256abf;
    --heat-3: #3987e5;
    --heat-4: #86b6ef;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 4px 12px rgba(0, 0, 0, .3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111316; --surface: #1a1d21; --surface-2: #22262b; --surface-3: #2a2f35; --line: #2d3238; --line-2: #3a4048;
  --text: #eceef1; --text-2: #c4c9d0; --muted: #949ca7; --accent: #4a92ea; --accent-2: #86b6ef; --accent-soft: #1b2c42;
  --good: #2fb37f; --good-soft: #15302a; --bad: #ef6b6a; --bad-soft: #3a1d1e; --warn: #e0a73a; --warn-soft: #3a2e14;
  --sun: #f5b545; --sun-soft: #3a2f17; --track: #2d3238; --series-1: #3987e5;
  --heat-0: #262a30; --heat-1: #184f95; --heat-2: #256abf; --heat-3: #3987e5; --heat-4: #86b6ef;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: .01em; }
h2 { font-size: 15px; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
input, select, textarea { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 10px; outline: none; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
textarea { resize: vertical; width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.bad { color: var(--bad); }
.good { color: var(--good); }
.warn-text { color: var(--warn); }
.strike { text-decoration: line-through; color: var(--muted); }
kbd { font: 11px/1 var(--font); padding: 2px 5px; border-radius: 4px; background: rgba(255, 255, 255, .22); margin-left: auto; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600; }
.badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 600; margin-left: 6px; vertical-align: middle; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid transparent; background: var(--surface-2); font-weight: 600; white-space: nowrap; text-decoration: none !important; color: var(--text); transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn.subtle { width: 28px; height: 28px; color: var(--muted); }
.icon-btn.add { color: var(--accent); background: var(--accent-soft); width: 30px; height: 30px; }
.link-btn { border: 0; background: none; color: var(--accent); padding: 0; font-weight: 600; font-size: inherit; }
.link { font-size: 13px; font-weight: 600; }
.field-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 13px; max-width: 100%; }
.field-btn:hover { border-color: var(--line-2); background: var(--surface-2); }
.field-btn.set { color: var(--text); }
.field-btn.danger { color: var(--bad); border-color: var(--bad); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px; margin-bottom: 14px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-weight: 600; color: var(--muted); font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg.sm { margin: 0; }
.seg.sm button { padding: 4px 10px; font-size: 12px; }
.check-line { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin: 4px 0 12px; }

/* boot / auth */
.boot { min-height: 100vh; display: grid; place-items: center; }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; font-weight: 800; font-size: 17px; flex: none; }
.boot .logo { width: 56px; height: 56px; font-size: 30px; border-radius: 16px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 30px 28px; }
.auth-card h1 { margin: 18px 0 14px; font-size: 20px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.form { display: grid; gap: 14px; }
.lbl { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.lbl input, .lbl select, .lbl textarea { font-weight: 400; color: var(--text); width: 100%; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* shell */
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 12px; z-index: 40; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; font-weight: 800; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-btn { margin-bottom: 12px; }
.nav { display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-weight: 600; border: 0; background: none; width: 100%; text-align: left; font-size: 14px; }
.nav-item:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav-item.on { background: var(--accent-soft); color: var(--accent); }
.nav-count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--sun); color: #3a2700; border-radius: 10px; padding: 1px 7px; }
.nav-count.hot { background: var(--bad); color: #fff; }
.nav-section { display: flex; align-items: center; justify-content: space-between; margin: 18px 4px 4px 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.nav-projects { display: grid; gap: 1px; }
.nav-proj { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 7px; color: var(--text-2); font-size: 13px; }
.nav-proj span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-proj:hover { background: var(--surface-2); text-decoration: none; }
.nav-proj.on { background: var(--surface-2); color: var(--text); font-weight: 600; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 6px; }
.me-link { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; flex: 1; min-width: 0; color: var(--text); }
.me-link:hover { background: var(--surface-2); text-decoration: none; }
.me-link span { display: grid; min-width: 0; }
.me-link b, .me-link small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-link small { color: var(--muted); font-size: 11px; }
.main-wrap { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { display: none; }
.bottomnav, .fab, .drawer-backdrop { display: none; }
#main { outline: none; }
.page { max-width: 1180px; margin: 0 auto; padding: 26px 28px 80px; }
body.wide .page { max-width: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.eyebrow { color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 2px; }

/* cards & layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.col-main, .col-side { min-width: 0; }
.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow-sm); min-width: 0; }
.profile .kpi { box-shadow: none; background: var(--surface-2); border-color: transparent; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 28px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi-value small { font-size: 16px; color: var(--muted); font-weight: 600; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.tone-bad .kpi-value { color: var(--bad); }
.kpi-ring { display: flex; align-items: center; gap: 12px; }
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; }
.ring-label { position: relative; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.mini-kpis div { display: grid; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.mini-kpis span { font-size: 11px; font-weight: 600; }
.mini-kpis b { font-size: 20px; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty-icon { width: 54px; height: 54px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-2); color: var(--accent); margin-bottom: 10px; }
.empty-title { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.empty-sub { font-size: 13px; margin-bottom: 12px; }
.empty-mini { color: var(--muted); font-size: 13px; padding: 8px 0; }
.empty-line { color: var(--muted); font-size: 12px; padding: 6px 12px 6px 40px; }
.section-label { font-size: 12px; font-weight: 700; color: var(--muted); margin: 20px 0 8px; display: flex; gap: 8px; align-items: center; }

/* avatars, chips, pills */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex: none; line-height: 1; letter-spacing: -.02em; overflow: hidden; white-space: nowrap; }
.avatar.empty { background: var(--surface-3); color: var(--muted); border: 1px dashed var(--line-2); }
.avatar.ring { box-shadow: 0 0 0 2px var(--surface); }
.avatars { display: flex; }
.avatars .avatar + .avatar { margin-left: -6px; }
.more-av { font-size: 12px; color: var(--muted); margin-left: 6px; align-self: center; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); max-width: 180px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chip.muted { color: var(--muted); }
.chip:hover { text-decoration: none; color: var(--text); }
.pill { border: 0; color: #fff; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 3px 10px; white-space: nowrap; min-width: 72px; }
.pill.big { padding: 6px 14px; font-size: 13px; }
.pill:hover { filter: brightness(1.08); }
.prio { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; flex: none; }
.prio-0 { color: var(--muted); } .prio-1 { color: #6b7280; } .prio-2 { color: var(--accent); } .prio-3 { color: #d9591f; } .prio-4 { color: var(--bad); }
.prio-4 .ic { fill: currentColor; }
.due { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.due.overdue { color: var(--bad); font-weight: 700; }
.due.due-today { color: var(--warn); font-weight: 700; }
.due.due-soon { color: var(--text-2); }
.meta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.status-dot { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--c); }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.reason { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.reason.bad { background: var(--bad-soft); color: var(--bad); }
.reason.warn { background: var(--warn-soft); color: var(--warn); }
.tag-done { color: var(--good); font-weight: 700; }
.tag-status { color: var(--c); font-weight: 700; }
.quote { color: var(--muted); }

/* progress */
.pbar { position: relative; display: inline-block; width: 100%; height: 8px; border-radius: 6px; background: var(--track); overflow: hidden; vertical-align: middle; }
.pbar.thin { height: 5px; }
.pbar-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 6px; transition: width .3s; }
.pbar-label { font-size: 12px; font-weight: 700; margin-left: 6px; }
.stack { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; margin-bottom: 10px; }
.stack-seg { min-width: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }

/* task rows */
.tlist { display: grid; }
.trow { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 8px; cursor: pointer; border-bottom: 1px solid var(--line); min-width: 0; }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--surface-2); }
.trow.compact { padding: 7px 4px; }
.trow-main { flex: 1; min-width: 0; }
.trow-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow.is-done .trow-title { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.trow-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 2px; min-width: 0; }
.mini-prog .pbar { width: 40px; }
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); display: inline-grid; place-items: center; color: transparent; flex: none; padding: 0; transition: all .15s; }
.check:hover { border-color: var(--good); color: var(--good); }
.is-done > .check, .is-done .check, .check.on { background: var(--good); border-color: var(--good); color: #fff; }
.check.sm { width: 18px; height: 18px; }
.check.big { width: 30px; height: 30px; }
.late-note { font-size: 12px; color: var(--warn); padding: 0 8px 8px 40px; margin-top: -4px; }

/* groups (my tasks) */
.group { margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; }
.group-head { display: flex; align-items: center; justify-content: space-between; }
.group-toggle { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 8px 4px; flex: 1; text-align: left; }
.group-toggle .ic { transition: transform .15s; color: var(--muted); }
.group.collapsed .group-toggle .ic { transform: rotate(-90deg); }
.group.collapsed .tlist { display: none; }
.group-toggle h2.bad { color: var(--bad); }

/* home */
.mtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.mtable th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mtable td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.mtable tr:last-child td { border-bottom: 0; }
.mtable tr[data-href] { cursor: pointer; }
.mtable tbody tr:hover { background: var(--surface-2); }
.mtable .num { text-align: right; font-variant-numeric: tabular-nums; }
.mtable tr.inactive { opacity: .5; }
.table-wrap { overflow-x: auto; margin: 0 -6px; }
.who { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 140px; }
.who:hover { text-decoration: none; }
.who span { display: grid; line-height: 1.3; }
.who small { color: var(--muted); font-size: 11px; }
.today-cell { min-width: 110px; }
.today-cell .pbar { width: 60px; margin-right: 6px; }
.th-sort { border: 0; background: none; color: inherit; font-weight: 600; padding: 0; font-size: 12px; }
.th-sort.on { color: var(--accent); }
.th-sort.on::after { content: " ↓"; }
.foot-note { margin: 10px 0 0; }
.plist { display: grid; gap: 4px; }
.prow { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; color: var(--text); }
.prow:hover { background: var(--surface-2); text-decoration: none; }
.picon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; font-size: 18px; flex: none; }
.picon.lg { width: 46px; height: 46px; font-size: 24px; border-radius: 12px; }
.prow-main { flex: 1; min-width: 0; display: grid; }
.prow-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow-meta { font-size: 12px; color: var(--muted); }
.prow-prog { display: flex; align-items: center; gap: 8px; width: 150px; flex: none; font-size: 13px; }
.feed { display: grid; gap: 12px; }
.feed-row { display: flex; gap: 10px; }
.feed-body { min-width: 0; }
.feed-text { font-size: 13px; line-height: 1.5; word-break: break-word; }
.feed-time { font-size: 11px; color: var(--muted); }

/* my day */
.hero-sun { background: linear-gradient(135deg, var(--sun-soft), var(--surface)); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; align-items: center; }
.hero-left { display: flex; align-items: center; gap: 16px; }
.inline-add { display: flex; align-items: center; gap: 10px; padding: 4px 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; color: var(--accent); }
.inline-add input { border: 0; flex: 1; padding: 8px 0; background: transparent; box-shadow: none !important; }
.all-done { text-align: center; padding: 14px; font-weight: 700; color: var(--good); background: var(--good-soft); border-radius: 8px; margin-top: 8px; }
.moods { display: flex; gap: 8px; margin-bottom: 10px; }
.mood { width: 42px; height: 42px; border-radius: 50%; border: 2px solid transparent; background: var(--surface-2); font-size: 22px; filter: grayscale(.6); opacity: .7; }
.mood.on { border-color: var(--sun); filter: none; opacity: 1; background: var(--sun-soft); }
.note { min-height: 80px; }
.sugg { display: grid; gap: 2px; }
.sugg-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 4px; border-radius: 8px; }
.sugg-row:hover { background: var(--surface-2); }
.sugg-main { flex: 1; min-width: 0; cursor: pointer; }
.sugg-title { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ritual { min-height: 360px; display: grid; }
.ritual-intro { text-align: center; padding: 28px 24px; display: grid; gap: 8px; align-content: center; }
.ritual-intro p { margin: 0; }
.ritual-sun { font-size: 52px; line-height: 1; }
.ritual-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.ritual-list { text-align: left; max-height: 220px; overflow: auto; background: var(--surface-2); border-radius: 10px; padding: 10px 14px; display: grid; gap: 4px; margin-top: 6px; }
.ritual-step { padding: 22px 24px; display: grid; gap: 14px; align-content: start; }
.ritual-count { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.ritual-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; }
.ritual-bar span { display: block; height: 100%; background: var(--sun); transition: width .25s; }
.ritual-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 8px; justify-items: start; background: var(--surface-2); }
.ritual-title { font-size: 18px; font-weight: 700; }
.ritual-q { text-align: center; font-weight: 700; margin-top: 4px; }
.ritual-choices { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
.choice { height: 52px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 700; font-size: 14px; }
.choice.yes { background: var(--sun); border-color: var(--sun); color: #3a2700; }
.choice:hover { filter: brightness(.97); }
.ritual-picked { text-align: center; font-size: 12px; color: var(--muted); min-height: 18px; }
.ritual-step .link-btn { justify-self: center; font-size: 13px; color: var(--muted); }

/* projects */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; color: var(--text); box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s; }
.pcard:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-1px); }
.pcard.archived { opacity: .6; }
.pcard-top { display: flex; gap: 12px; align-items: center; }
.pcard-name { font-weight: 700; font-size: 15px; }
.pcard-prog, .proj-prog { display: flex; align-items: center; gap: 10px; }
.pcard-stats { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.proj-head { align-items: center; }
.proj-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.proj-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proj-prog { width: 180px; font-size: 13px; }
.proj-desc { color: var(--text-2); margin: -8px 0 16px; white-space: pre-wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 9px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { margin-left: 2px; height: 18px; min-width: 18px; font-size: 11px; }
.card .tabs { margin: -4px -4px 8px; }

/* project table (monday style) */
.ptable { display: grid; gap: 14px; }
.ptable-head, .prow-t { display: grid; grid-template-columns: minmax(220px, 1fr) 150px 110px 80px 110px 120px; align-items: center; gap: 0; }
.ptable-head { font-size: 12px; color: var(--muted); font-weight: 600; padding: 0 0 0 10px; }
.ptable-head span { padding: 0 8px; }
.pgroup { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--g); border-radius: var(--r); overflow: hidden; }
.pgroup-head { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 10px 12px; width: 100%; text-align: left; color: var(--g); }
.pgroup-head b { font-size: 14px; }
.prow-t { border-top: 1px solid var(--line); min-height: 42px; cursor: pointer; }
.prow-t:hover { background: var(--surface-2); }
.prow-t > span { padding: 4px 8px; min-width: 0; display: flex; align-items: center; gap: 6px; border-left: 1px solid var(--line); height: 100%; }
.prow-t > span:first-child { border-left: 0; padding-left: 12px; }
.prow-t .ttl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.prow-t.is-done .ttl { text-decoration: line-through; color: var(--muted); }
.c-status { justify-content: center; }
.c-status .pill { width: 100%; border-radius: 0; height: 100%; min-height: 34px; }
.c-prog .pbar { flex: 1; }
.c-prog small { width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.cell-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 2px; border-radius: 6px; min-width: 0; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.cell-btn:hover { background: var(--surface-3); }
.prow-add { display: flex; align-items: center; gap: 8px; padding: 4px 12px; border-top: 1px solid var(--line); color: var(--muted); }
.prow-add input { border: 0; flex: 1; background: transparent; padding: 7px 0; box-shadow: none !important; }

/* board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.bcol { background: var(--surface-2); border-radius: var(--r); padding: 8px; display: grid; gap: 8px; min-height: 120px; }
.bcol-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-bottom: 3px solid var(--g); padding-bottom: 8px; }
.bcol-head .count { margin-left: auto; }
.bcol-body { display: grid; gap: 8px; min-height: 40px; border-radius: 8px; transition: background .12s; align-content: start; }
.bcol-body.drop-hover { background: var(--accent-soft); }
.bcard { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; box-shadow: var(--shadow-sm); cursor: grab; display: grid; gap: 6px; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.bcard:hover { border-color: var(--line-2); }
.bcard.overdue { border-left: 3px solid var(--bad); }
.bcard-title { font-weight: 600; }
.bcard-foot { display: flex; align-items: center; gap: 10px; }
.bcard.placeholder { opacity: .35; }
.bcard.lift { box-shadow: var(--shadow-lg); transform: scale(1.02); }
.bghost { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; box-shadow: var(--shadow-lg); opacity: .95; }
.bcol-add input { width: 100%; border: 1px dashed var(--line-2); background: transparent; }

/* calendar */
.cal-page { padding-top: 18px; }
.cal-toolbar, .rv-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-nav, .cal-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cal-title { font-size: 19px; margin-left: 8px; display: flex; align-items: center; gap: 6px; }
.cal-summary { font-size: 13px; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.placing-bar { position: sticky; top: 0; z-index: 20; background: var(--sun); color: #3a2700; font-weight: 700; padding: 10px 14px; border-radius: 10px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cal-layout { display: flex; gap: 14px; align-items: stretch; }
.cal-inbox { width: 250px; flex: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; max-height: calc(100vh - 150px); overflow-y: auto; position: sticky; top: 12px; align-self: flex-start; }
.cal-inbox.drop-hover { background: var(--accent-soft); }
.cal-inbox-head { display: flex; align-items: center; justify-content: space-between; }
.cal-inbox-hint { margin: 4px 0 8px; }
.inbox-group { margin-bottom: 10px; }
.inbox-label { font-size: 11px; font-weight: 700; color: var(--muted); margin: 6px 0 4px; }
.inbox-label.bad { color: var(--bad); }
.inbox-item { display: grid; gap: 2px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); border-left: 3px solid var(--c); margin-bottom: 6px; cursor: grab; background: var(--surface); font-size: 13px; user-select: none; }
.inbox-item:hover { box-shadow: var(--shadow-sm); border-color: var(--line-2); }
.inbox-title { font-weight: 600; }
.inbox-meta { display: flex; gap: 8px; font-size: 11px; }
.cal-grid { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.cal-head, .cal-allday { display: grid; grid-template-columns: 52px repeat(var(--days), minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.cal-gutter { font-size: 11px; display: flex; align-items: center; justify-content: center; }
.cal-dayhead { padding: 6px 4px; text-align: center; border-left: 1px solid var(--line); display: grid; justify-items: center; gap: 2px; }
.cal-dayhead .link-btn { display: grid; justify-items: center; color: var(--text); line-height: 1.2; }
.cal-dayhead .dw { font-size: 11px; color: var(--muted); font-weight: 600; }
.cal-dayhead .dn { font-size: 20px; font-weight: 700; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; }
.cal-dayhead.today .dn { background: var(--accent); color: #fff; }
.cal-dayhead.past .dn { color: var(--muted); }
.cal-dayhead.weekend .dw { color: var(--bad); }
.day-score { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 8px; background: var(--surface-3); color: var(--text-2); }
.day-score.good { background: var(--good-soft); color: var(--good); }
.day-score.bad { background: var(--bad-soft); color: var(--bad); }
.cal-allday-cell { border-left: 1px solid var(--line); padding: 4px; display: grid; gap: 3px; align-content: start; min-height: 34px; max-height: 110px; overflow-y: auto; }
.cal-allday-cell.drop-hover, .month-cell.drop-hover { background: var(--accent-soft); }
.cal-chip { font-size: 12px; padding: 2px 6px; border-radius: 5px; background: color-mix(in srgb, var(--c) 16%, var(--surface)); border-left: 3px solid var(--c); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; display: flex; align-items: center; gap: 3px; user-select: none; }
.cal-chip span { overflow: hidden; text-overflow: ellipsis; }
.cal-chip.done { opacity: .6; text-decoration: line-through; }
.cal-chip.done .ic { color: var(--good); }
.cal-chip.missed { border-left-color: var(--bad); background: var(--bad-soft); }
.cal-scroll { overflow-y: auto; height: calc(100vh - 250px); min-height: 360px; position: relative; overscroll-behavior: contain; }
.cal-body { display: grid; grid-template-columns: 52px 1fr; position: relative; }
.cal-gutter.hours { position: relative; display: block; }
.cal-gutter.hours span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 11px; color: var(--muted); }
.cal-cols { display: grid; grid-template-columns: repeat(var(--days), minmax(0, 1fr)); position: relative; }
.cal-col { position: relative; border-left: 1px solid var(--line); cursor: copy; }
.cal-col.past { background: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--surface-2) 60%, transparent) 8px 9px); }
.cal-col.today { background: color-mix(in srgb, var(--accent-soft) 35%, transparent); }
.cal-hour { position: absolute; left: 0; right: 0; height: 48px; border-top: 1px solid var(--line); }
.cal-hour::after { content: ""; position: absolute; left: 0; right: 0; top: 24px; border-top: 1px dashed color-mix(in srgb, var(--line) 60%, transparent); }
.now-line { position: absolute; left: -1px; right: 0; height: 2px; background: var(--bad); z-index: 3; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.cal-block { position: absolute; z-index: 2; border-radius: 6px; padding: 3px 7px; overflow: hidden; cursor: pointer; background: color-mix(in srgb, var(--c) 20%, var(--surface)); border-left: 3px solid var(--c); font-size: 12px; box-shadow: var(--shadow-sm); user-select: none; }
.cal-block:hover { box-shadow: var(--shadow); z-index: 4; }
.cal-block.done { opacity: .6; }
.cal-block.done .cb-title { text-decoration: line-through; }
.cal-block.done .ic { color: var(--good); }
.cal-block.missed { border-left-color: var(--bad); background: var(--bad-soft); }
.cal-block.missed::after { content: "未達"; position: absolute; right: 4px; top: 3px; font-size: 10px; font-weight: 700; color: var(--bad); }
.cal-block.short { padding-top: 0; padding-bottom: 0; }
.cb-title { font-weight: 700; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 3px; }
.cb-time { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.cal-block.drag-src, .inbox-item.drag-src, .cal-chip.drag-src { opacity: .4; }
.cal-ghost { position: absolute; left: 2px; right: 2px; z-index: 5; border-radius: 6px; background: color-mix(in srgb, var(--accent) 25%, transparent); border: 2px dashed var(--accent); font-size: 12px; font-weight: 700; padding: 2px 6px; overflow: hidden; pointer-events: none; color: var(--text); }
.cal-month { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.month-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); padding: 6px 0; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(108px, auto); }
.month-cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: grid; gap: 3px; align-content: start; min-width: 0; }
.month-cell:nth-child(7n) { border-right: 0; }
.month-cell.out { background: var(--surface-2); }
.month-cell.out .month-date .link-btn { color: var(--muted); }
.month-cell.today .month-date .link-btn { background: var(--accent); color: #fff; }
.month-date { display: flex; align-items: center; justify-content: space-between; }
.month-date .link-btn { color: var(--text); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; }
.link-btn.more { font-size: 11px; text-align: left; }

/* timeline */
.tl-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.tl-toolbar .check-line { margin: 0; }
.tl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; max-height: calc(100vh - 210px); position: relative; overscroll-behavior: contain; }
.tl-inner { position: relative; min-width: 100%; }
.tl-header { position: sticky; top: 0; z-index: 6; display: flex; background: var(--surface); border-bottom: 1px solid var(--line); }
.tl-left { position: sticky; left: 0; z-index: 4; width: var(--tl-left); flex: none; background: var(--surface); border-right: 1px solid var(--line); }
.tl-corner { z-index: 7; display: flex; align-items: flex-end; padding: 8px 12px; font-size: 12px; font-weight: 700; color: var(--muted); }
.tl-scale { position: relative; height: 50px; flex: none; }
.tl-months { position: relative; height: 22px; }
.tl-months span { position: absolute; top: 4px; font-size: 12px; font-weight: 700; padding-left: 6px; border-left: 1px solid var(--line-2); white-space: nowrap; }
.tl-ticks { position: relative; height: 28px; }
.tl-ticks span { position: absolute; top: 2px; font-size: 11px; color: var(--text-2); text-align: center; line-height: 1.1; display: grid; white-space: nowrap; }
.tl-ticks span small { font-size: 9px; color: var(--muted); }
.tl-ticks span.we { color: var(--bad); }
.tl-ticks span.today { color: #fff; background: var(--accent); border-radius: 5px; }
.tl-ticks span.today small { color: #fff; }
.tl-rows { position: relative; }
.tl-bg { position: absolute; top: 0; bottom: 0; left: var(--tl-left); pointer-events: none; z-index: 0; }
.tl-we { position: absolute; top: 0; bottom: 0; background: var(--surface-2); }
.tl-mline { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); opacity: .7; }
.tl-row { display: flex; height: 38px; border-bottom: 1px solid var(--line); position: relative; }
.tl-row:hover .tl-left { background: var(--surface-2); }
.tl-group { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.tl-group .tl-left { background: var(--surface-2); border: 0; border-right: 1px solid var(--line); display: flex; align-items: center; gap: 8px; padding: 0 10px; text-align: left; font-size: 13px; min-width: 0; }
.tl-group .tl-left b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-group .tl-left small { color: var(--muted); font-size: 11px; }
.tl-group .count { margin-left: auto; }
.tl-name { display: flex; align-items: center; gap: 8px; padding: 0 10px 0 26px; cursor: pointer; font-size: 13px; min-width: 0; }
.tl-tname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex: none; }
.tl-dot.done { background: var(--good); }
.tl-track { position: relative; flex: none; width: calc(100% - var(--tl-left)); z-index: 1; }
.tl-bar { position: absolute; top: 7px; height: 24px; border-radius: 6px; background: color-mix(in srgb, var(--c) 30%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 70%, transparent); overflow: hidden; cursor: pointer; display: flex; align-items: center; user-select: none; }
.tl-bar:hover { box-shadow: var(--shadow); }
.tl-prog { position: absolute; inset: 0 auto 0 0; background: var(--c); opacity: .75; }
.tl-bar.done { opacity: .55; }
.tl-bar.overdue { border: 2px solid var(--bad); }
.tl-label { position: relative; font-size: 12px; font-weight: 700; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface); }
.tl-outlabel { position: absolute; top: 10px; font-size: 12px; white-space: nowrap; color: var(--text-2); pointer-events: none; }
.tl-handle { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 2; }
.tl-handle.l { left: 0; } .tl-handle.r { right: 0; }
.tl-span { position: absolute; top: 13px; height: 12px; border-radius: 6px; background: color-mix(in srgb, var(--c) 22%, transparent); overflow: hidden; }
.tl-span span { display: block; height: 100%; background: var(--c); border-radius: 6px; }
.tl-empty { padding: 30px; text-align: center; color: var(--muted); }

/* org & member */
.org-section { margin-bottom: 22px; }
.org-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; color: var(--text-2); }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; color: var(--text); display: grid; gap: 12px; box-shadow: var(--shadow-sm); transition: box-shadow .15s; }
.mcard:hover { text-decoration: none; box-shadow: var(--shadow); }
.mgrid.exec .mcard { border-top: 3px solid var(--sun); }
.mcard-top { display: flex; align-items: center; gap: 12px; position: relative; }
.mcard-id { display: grid; flex: 1; min-width: 0; line-height: 1.35; }
.mcard-id b { font-size: 15px; }
.mtitle { font-size: 13px; color: var(--accent); font-weight: 700; }
.online { position: absolute; left: 34px; top: 34px; width: 12px; height: 12px; border-radius: 50%; background: var(--good); border: 2px solid var(--surface); }
.online-text { font-size: 12px; color: var(--good); font-weight: 600; margin-left: 10px; vertical-align: middle; }
.mcard-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.mcard-stats div { background: var(--surface-2); border-radius: 8px; padding: 6px 4px; display: grid; }
.mcard-stats b { font-size: 18px; font-variant-numeric: tabular-nums; }
.mcard-stats span { font-size: 11px; color: var(--muted); }
.mcard-today { display: flex; align-items: center; gap: 8px; }
.mcard-today .pbar { flex: 1; }
.profile-main { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 16px; flex-wrap: wrap; }
.profile-id { flex: 1; min-width: 200px; }
.profile-id h1 { font-size: 24px; }
.profile-title { font-weight: 700; color: var(--accent); margin: 2px 0 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.profile-bio { margin: 0 0 6px; color: var(--text-2); white-space: pre-wrap; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile .grid-kpi { margin-bottom: 0; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.plan-days { display: grid; gap: 4px; }
.plan-day { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 3px 0; }
.plan-day.today { font-weight: 700; }
.pd-date { width: 70px; flex: none; }
.pd-bar { flex: 1; }
.pd-n { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pd-none { flex: 1; }
.note-row { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.note-row:last-child { border-bottom: 0; }
.rank-list { display: grid; gap: 2px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; color: var(--text); font-size: 13px; }
.rank-row:hover { background: var(--surface-2); text-decoration: none; }
.rank-name { flex: 1; display: grid; line-height: 1.3; min-width: 0; }
.rank-name small { color: var(--muted); font-size: 11px; }
.rank-n { white-space: nowrap; font-size: 12px; }

/* charts */
.bars { display: flex; align-items: stretch; gap: 4px; padding-top: 18px; }
.bar-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bar-track { flex: 1; display: flex; align-items: flex-end; }
.bar { width: 100%; max-width: 34px; margin: 0 auto; border-radius: 4px 4px 0 0; min-height: 2px; position: relative; transition: height .3s; }
.bar-val { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--text-2); }
.bar-label { font-size: 10px; color: var(--muted); text-align: center; margin-top: 4px; white-space: nowrap; overflow: hidden; height: 15px; }
.bar-label.strong { color: var(--text); font-weight: 700; }
.bar-col:hover .bar { filter: brightness(1.12); }
.heatmap-wrap { overflow-x: auto; padding-bottom: 4px; }
.hm-months { position: relative; height: 16px; font-size: 10px; color: var(--muted); }
.hm-months span { position: absolute; }
.heatmap { display: flex; gap: 3px; }
.hm-col { display: grid; gap: 3px; }
.hm-cell { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.hm-cell.blank { background: transparent; }
.hm-legend { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); margin-top: 8px; justify-content: flex-end; }

/* review */
.rv-toolbar h2.cal-title { font-size: 18px; }

/* settings */
.settings .card { max-width: 860px; }
.color-pick, .icon-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.color-pick input, .icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.color-pick span { display: block; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); }
.color-pick input:checked + span { box-shadow: 0 0 0 2px var(--text); }
.icon-pick span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--surface-2); font-size: 18px; cursor: pointer; border: 2px solid transparent; }
.icon-pick input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.color-pick label, .icon-pick label { position: relative; }
.teams { display: grid; gap: 8px; }
.team-row { display: flex; align-items: center; gap: 8px; }
.team-row input { flex: 1; }
.team-add { display: flex; gap: 8px; margin-top: 4px; }
.team-add input { flex: 1; }
.invites { display: grid; gap: 6px; }
.invite-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.invite-row > span:first-child { flex: 1; }
.invite-row.invalid { opacity: .55; }
.link-box { display: flex; gap: 8px; }
.link-box input { flex: 1; font-size: 13px; }
.danger-zone { display: flex; gap: 8px; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; flex-wrap: wrap; }

/* panel */
#panel { display: none; }
#panel.open { display: block; }
.panel-backdrop { position: fixed; inset: 0; background: rgba(10, 14, 20, .18); z-index: 60; }
.panel-card { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); z-index: 61; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slidein .18s ease-out; }
@keyframes slidein { from { transform: translateX(30px); opacity: .5; } }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.panel-crumb { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-body { flex: 1; overflow-y: auto; padding: 18px 22px 40px; overscroll-behavior: contain; }
.panel-title-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.title-edit { font-size: 20px; font-weight: 700; border: 1px solid transparent; padding: 2px 6px; resize: none; overflow: hidden; line-height: 1.4; background: transparent; }
.title-edit:hover { border-color: var(--line); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.field { display: grid; gap: 4px; min-width: 0; justify-items: start; }
.field.wide { grid-column: 1 / -1; justify-items: stretch; }
.flabel { font-size: 12px; font-weight: 600; color: var(--muted); }
.sched-edit, .prog-edit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sched-edit input { flex: 1; min-width: 180px; }
.prog-edit input[type=range] { flex: 1; accent-color: var(--accent); }
.prog-edit .pbar { flex: 1; }
.desc-edit { min-height: 90px; resize: none; overflow: hidden; }
.subtasks { display: grid; gap: 2px; }
.subtask { display: flex; align-items: center; gap: 10px; padding: 5px 4px; border-radius: 6px; }
.subtask:hover { background: var(--surface-2); }
.subtask-title { flex: 1; min-width: 0; word-break: break-word; }
.subtask.is-done .subtask-title { text-decoration: line-through; color: var(--muted); }
.subtask-add { display: flex; align-items: center; gap: 10px; padding: 4px; color: var(--muted); }
.subtask-add input { flex: 1; border: 0; background: transparent; padding: 6px 0; box-shadow: none !important; }
.comments { display: grid; gap: 14px; }
.comment { display: flex; gap: 10px; }
.comment-body { flex: 1; min-width: 0; background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
.comment-head { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.comment-head .link-btn { margin-left: auto; font-size: 11px; color: var(--muted); }
.comment-text { white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.comment-add { display: flex; gap: 10px; align-items: flex-end; }
.comment-add textarea { flex: 1; resize: none; min-height: 38px; }
.history { margin-top: 20px; font-size: 12px; }
.history summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.hist-row { padding: 4px 0; }
.panel-foot { margin-top: 24px; font-size: 12px; }

/* popover, modal, toasts */
#pop .pop-backdrop { position: fixed; inset: 0; z-index: 90; }
.pop-card { position: fixed; z-index: 91; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 200px; max-width: calc(100vw - 16px); max-height: 70vh; overflow-y: auto; padding: 6px; }
.menu-list { display: grid; }
.menu-item { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 8px 10px; border-radius: 7px; text-align: left; width: 100%; font-size: 14px; }
.menu-item:hover, .menu-item:focus { background: var(--surface-2); outline: none; }
.menu-item.active { font-weight: 700; }
.menu-item span { display: grid; line-height: 1.3; }
.menu-item small { font-size: 11px; color: var(--muted); }
.menu-item .right { margin-left: auto; }
.menu-check { margin-left: auto; color: var(--accent); }
.menu-icon { width: 20px; text-align: center; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.menu-title { font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 10px; display: flex; gap: 6px; align-items: center; }
.menu-search { padding: 4px; }
.menu-search input, .menu-foot input { width: 100%; }
.menu-foot { border-top: 1px solid var(--line); padding: 8px 4px 2px; margin-top: 4px; }
.notif-list { display: grid; gap: 2px; max-height: 420px; overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 8px; border-radius: 8px; font-size: 13px; }
.notif.new { background: var(--accent-soft); }
#modal { display: none; }
#modal.open { display: grid; position: fixed; inset: 0; z-index: 80; place-items: center; padding: 16px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 14, 20, .42); }
.modal-card { position: relative; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; animation: pop .16s ease-out; }
.modal-card.wide { max-width: 760px; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px 0; }
.modal-head h2 { font-size: 17px; display: flex; align-items: center; gap: 10px; }
.modal-body { padding: 16px 20px; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }
.confirm-msg { white-space: pre-wrap; margin: 6px 0 0; font-size: 15px; }
.qa-input { width: 100%; font-size: 17px; padding: 12px 14px; }
.qa-hint { font-size: 12px; color: var(--muted); margin-top: -6px; }
.qa-fields { display: flex; flex-wrap: wrap; gap: 8px; }
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: #23272e; color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); animation: toastin .2s ease-out; transition: opacity .3s, transform .3s; }
.toast-success { background: #13865c; }
.toast-error { background: #c9302f; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }

.show-mobile { display: none !important; }

/* ------------------------------------------------------------ tablet */
@media (max-width: 1100px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .ptable-head, .prow-t { grid-template-columns: minmax(180px, 1fr) 120px 100px 64px 96px 100px; }
  .hide-sm { display: none; }
}

/* ------------------------------------------------------------ phone */
@media (max-width: 760px) {
  :root { --tl-left: 132px; }
  body { font-size: 15px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; width: min(300px, 86vw); box-shadow: var(--shadow-lg); padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  body.drawer-open .sidebar { transform: none; }
  body.drawer-open .drawer-backdrop { display: block; position: fixed; inset: 0; background: rgba(10, 14, 20, .4); z-index: 39; }
  .sidebar .add-btn kbd { display: none; }
  .main-wrap { margin-left: 0; padding-bottom: calc(70px + var(--safe-b)); }
  .topbar { display: flex; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: calc(6px + env(safe-area-inset-top, 0px)) 8px 6px; }
  .topbar-title { flex: 1; font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bell { position: relative; }
  .bell.has::after { content: ""; position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
  .top-avatar { display: inline-flex; padding: 2px; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: color-mix(in srgb, var(--surface) 95%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
  .bn-item { display: grid; justify-items: center; gap: 1px; padding: 7px 0 6px; font-size: 10px; font-weight: 600; color: var(--muted); border: 0; background: none; position: relative; }
  .bn-item:hover { text-decoration: none; }
  .bn-item.on { color: var(--accent); }
  .bn-dot { position: absolute; top: 3px; left: calc(50% + 6px); background: var(--sun); color: #3a2700; font-size: 10px; font-weight: 800; border-radius: 8px; padding: 0 5px; line-height: 15px; }
  .bn-dot.hot { background: var(--bad); color: #fff; }
  .fab { display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(74px + var(--safe-b)); z-index: 36; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(42, 120, 214, .45); }
  body.panel-open .fab { display: none; }
  .page { padding: 14px 16px 30px; }
  .page-head { margin-bottom: 14px; align-items: flex-start; }
  .page-head h1 { font-size: 20px; }
  .card { padding: 14px; border-radius: 12px; }
  .grid-kpi { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 24px; }
  .row2 { grid-template-columns: 1fr; }
  .trow { padding: 10px 4px; }
  .trow-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .check { width: 26px; height: 26px; }
  .prow-prog { width: 96px; }
  .hero-sun { padding: 14px; }
  .hero-sun .btn { width: 100%; }
  .ritual-choices { grid-template-columns: 1fr; }
  .choice { height: 50px; }
  .show-mobile { display: inline-flex !important; }
  .hide-xs { display: none; }
  /* panel → full screen sheet */
  .panel-card { width: 100vw; animation: sheetin .2s ease-out; padding-top: env(safe-area-inset-top, 0px); }
  @keyframes sheetin { from { transform: translateY(40px); opacity: .4; } }
  .panel-body { padding: 14px 16px calc(40px + var(--safe-b)); }
  .fields { grid-template-columns: 1fr 1fr; gap: 10px; }
  .title-edit { font-size: 18px; }
  /* popovers become bottom sheets */
  .pop-card.sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100% !important; max-width: none; border-radius: 16px 16px 0 0; padding: 10px 10px calc(14px + var(--safe-b)); max-height: 75vh; animation: sheetin .18s ease-out; }
  #pop.open .pop-backdrop { background: rgba(10, 14, 20, .35); }
  .menu-item { padding: 12px; font-size: 15px; }
  #modal.open { place-items: end center; padding: 0; }
  .modal-card { border-radius: 16px 16px 0 0; max-height: 92vh; padding-bottom: var(--safe-b); animation: sheetin .2s ease-out; }
  #toasts { bottom: calc(140px + var(--safe-b)); }
  /* project table → cards */
  .ptable-head { display: none; }
  .prow-t { grid-template-columns: 1fr auto; grid-template-areas: "title status" "meta meta"; padding: 8px 10px; gap: 6px; }
  .prow-t > span { border: 0; padding: 0; height: auto; }
  .prow-t > span:first-child { padding-left: 0; }
  .c-title { grid-area: title; }
  .c-status { grid-area: status; }
  .c-status .pill { border-radius: 6px; min-height: 0; height: auto; }
  .c-who, .c-prio, .c-due, .c-prog { grid-row: 2; }
  .prow-t .c-who { grid-column: 1; }
  .prow-t { grid-template-areas: none; grid-template-columns: auto auto auto 1fr auto; }
  .prow-t .c-title { grid-column: 1 / 5; grid-row: 1; }
  .prow-t .c-status { grid-column: 5; grid-row: 1; }
  .prow-t .c-who { grid-column: 1; grid-row: 2; }
  .prow-t .c-prio { grid-column: 2; grid-row: 2; }
  .prow-t .c-due { grid-column: 3; grid-row: 2; }
  .prow-t .c-prog { grid-column: 4 / 6; grid-row: 2; }
  .board { grid-auto-columns: 82vw; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 12px; }
  .bcol { scroll-snap-align: center; }
  /* calendar */
  .cal-layout { display: block; }
  .cal-inbox { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 70vh; z-index: 70; border-radius: 16px 16px 0 0; box-shadow: var(--shadow-lg); transform: translateY(105%); transition: transform .2s; padding-bottom: calc(16px + var(--safe-b)); }
  body.inbox-open .cal-inbox { transform: none; }
  .cal-scroll { height: calc(100vh - 290px); }
  .cal-head, .cal-allday { grid-template-columns: 40px repeat(var(--days), minmax(0, 1fr)); }
  .cal-body { grid-template-columns: 40px 1fr; }
  .cal-gutter.hours span { font-size: 10px; right: 4px; }
  .cal-title { font-size: 16px; }
  .cal-toolbar { gap: 8px; }
  .month-grid { grid-auto-rows: minmax(72px, auto); }
  .month-cell { padding: 2px; }
  .month-cell .cal-chip { font-size: 10px; padding: 1px 3px; }
  .month-cell .day-score { display: none; }
  .tl { max-height: calc(100vh - 230px); }
  .tl-name { padding-left: 10px; }
  .tl-name .avatar { display: none; }
  .tl-group .tl-left small { display: none; }
  .proj-prog { width: 120px; }
  .proj-actions { width: 100%; }
  .mgrid { grid-template-columns: 1fr; }
  .profile-main { gap: 12px; }
  .profile-id h1 { font-size: 20px; }
  .seg { max-width: 100%; }
  #toasts { max-width: calc(100vw - 32px); }
}
@media (max-width: 380px) {
  .grid-kpi { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 21px; }
  .fields { grid-template-columns: 1fr; }
}
@media (hover: none) {
  .trow:hover, .sugg-row:hover, .prow-t:hover { background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
