/* To-do — black & white, same design system as OSA Hub */
@font-face { font-family: 'Inter'; src: url('../fonts/inter.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #FFFFFF; --canvas: #FAFAFA; --surface: #FFFFFF; --surface-2: #FAFAFA; --hover: #F4F4F5;
  --line: #EBEBEB; --line-2: #DEDEE1; --input: #D4D4D8; --input-hover: #A1A1AA;
  --text: #0A0A0A; --body: #3F3F46; --muted: #71717A; --faint: #A1A1AA;
  --accent: #0A0A0A; --accent-strong: #000000; --accent-soft: #F1F1F2; --accent-line: #C9C9CE; --accent-ink: #FFFFFF;
  --btn: #0A0A0A; --btn-hover: #27272A; --btn-ink: #FFFFFF;
  --warn: #B86D08; --danger: #D93F3F; --ok: #1E8A4A;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.05);
  --overlay: rgba(10,10,10,.28);
  --r-sm: 7px; --r: 10px; --r-lg: 12px;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --dock: 480px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0B0B0C; --canvas: #0F0F11; --surface: #131315; --surface-2: #18181B; --hover: #1E1E22;
  --line: #232326; --line-2: #2E2E33; --input: #3A3A40; --input-hover: #55555D;
  --text: #F4F4F5; --body: #D4D4D8; --muted: #A1A1AA; --faint: #71717A;
  --accent: #F4F4F5; --accent-strong: #FFFFFF; --accent-soft: rgba(255,255,255,.08); --accent-line: rgba(255,255,255,.28); --accent-ink: #0A0A0A;
  --btn: #F4F4F5; --btn-hover: #FFFFFF; --btn-ink: #0A0A0A;
  --warn: #E8A33B; --danger: #F06A6A; --ok: #3DD68C;
  --shadow-xs: none; --shadow: 0 1px 2px rgba(0,0,0,.5);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.04);
  --overlay: rgba(0,0,0,.55); color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #0B0B0C; --canvas: #0F0F11; --surface: #131315; --surface-2: #18181B; --hover: #1E1E22;
  --line: #232326; --line-2: #2E2E33; --input: #3A3A40; --input-hover: #55555D;
  --text: #F4F4F5; --body: #D4D4D8; --muted: #A1A1AA; --faint: #71717A;
  --accent: #F4F4F5; --accent-strong: #FFFFFF; --accent-soft: rgba(255,255,255,.08); --accent-line: rgba(255,255,255,.28); --accent-ink: #0A0A0A;
  --btn: #F4F4F5; --btn-hover: #FFFFFF; --btn-ink: #0A0A0A;
  --warn: #E8A33B; --danger: #F06A6A; --ok: #3DD68C;
  --shadow-xs: none; --shadow: 0 1px 2px rgba(0,0,0,.5);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.04);
  --overlay: rgba(0,0,0,.55); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--body); font: 14px/1.45 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, h4 { margin: 0; color: var(--text); font-weight: 600; letter-spacing: -.012em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent); }
.mono { font-family: var(--mono); font-size: .9em; letter-spacing: -.01em; font-feature-settings: normal; }
.ic { width: 17px; height: 17px; flex: none; display: block; }
.ic-sm { width: 15px; height: 15px; }
.ic-xs { width: 13px; height: 13px; }
.grip .ic circle { fill: currentColor; stroke: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.sp { flex: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.none { color: var(--faint); }
.hint { font-size: 12.5px; color: var(--muted); }
.warn-t { color: var(--warn); font-weight: 600; }
.req, .req-mark { color: var(--danger); }
.req-mark { font-weight: 700; }

/* ── atoms ───────────────────────────── */
.mark { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; color: #fff; font-weight: 800; font-size: 9.5px; letter-spacing: .02em; background: linear-gradient(135deg, #0B2440, #0F4C75 55%, #1A7A8A); }
.sdot, .pdot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--faint)); flex: none; display: inline-block; }
.pdot { border-radius: 3px; }
.ring { width: 14px; height: 14px; border-radius: 50%; flex: none; display: inline-block; position: relative; background: conic-gradient(var(--c) calc(var(--p) * 1%), transparent 0); box-shadow: inset 0 0 0 1.5px var(--c); }
.ring::after { content: ''; position: absolute; inset: 3.5px; border-radius: 50%; background: var(--bg); }
.ring.big { width: 18px; height: 18px; }
.pri { display: inline-flex; align-items: flex-end; gap: 1.5px; height: 12px; flex: none; }
.pri i { width: 3px; border-radius: 1px; background: var(--line-2); }
.pri i:nth-child(1) { height: 5px; } .pri i:nth-child(2) { height: 8px; } .pri i:nth-child(3) { height: 11.5px; }
.pri.l1 i:nth-child(1), .pri.l2 i:nth-child(-n+2), .pri.l3 i { background: var(--muted); }
.pri.hi i { background: var(--warn) !important; }
.pri.l3.hi i:nth-child(n) { background: var(--warn); }
.pri.u { width: 14px; height: 14px; border-radius: 4px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; line-height: 1; }
.av { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-size: 9.5px; font-weight: 700; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2); }
.av.c0 { background: #EEE9FB; color: #4B3A8C; border-color: #DCD3F5; }
.av.c1 { background: #E3F5F1; color: #1E6B5C; border-color: #C7EAE2; }
.av.c2 { background: #FCEFDD; color: #8A5A12; border-color: #F4DDBA; }
.av.c3 { background: #E4EEFA; color: #1F4E85; border-color: #C9DCF3; }
.av.c4 { background: #FBE7EC; color: #8C2F49; border-color: #F3CFD9; }
.av.c5 { background: #EEF2E3; color: #4C5E1F; border-color: #DCE5C3; }
:root[data-theme="dark"] .av.c0 { background: #2A2340; color: #CFC2FF; border-color: #3B3159; }
:root[data-theme="dark"] .av.c1 { background: #16322D; color: #9FF0DF; border-color: #224740; }
:root[data-theme="dark"] .av.c2 { background: #3A2A13; color: #FFD49A; border-color: #523C1C; }
:root[data-theme="dark"] .av.c3 { background: #15283F; color: #AFD3FF; border-color: #213A59; }
:root[data-theme="dark"] .av.c4 { background: #3A1A24; color: #FFB8C9; border-color: #532634; }
:root[data-theme="dark"] .av.c5 { background: #262E14; color: #D6EC9C; border-color: #37421E; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .av.c0 { background: #2A2340; color: #CFC2FF; border-color: #3B3159; }
  :root:not([data-theme="light"]) .av.c1 { background: #16322D; color: #9FF0DF; border-color: #224740; }
  :root:not([data-theme="light"]) .av.c2 { background: #3A2A13; color: #FFD49A; border-color: #523C1C; }
  :root:not([data-theme="light"]) .av.c3 { background: #15283F; color: #AFD3FF; border-color: #213A59; }
  :root:not([data-theme="light"]) .av.c4 { background: #3A1A24; color: #FFB8C9; border-color: #532634; }
  :root:not([data-theme="light"]) .av.c5 { background: #262E14; color: #D6EC9C; border-color: #37421E; } }
.av.empty { color: var(--faint); border-style: dashed; background: transparent; }
.avatars { display: inline-flex; }
.avatars .av + .av { margin-left: -5px; box-shadow: 0 0 0 2px var(--surface); }
.prog { display: inline-flex; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.pb { position: relative; flex: 1; min-width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); overflow: hidden; display: block; }
.pb > i { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: var(--accent); }
.pct { font-size: 11.5px; color: var(--text); min-width: 32px; text-align: right; }
.due { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.due.od { color: var(--danger); font-weight: 600; }
.due.soon { color: var(--warn); font-weight: 600; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--line-2); white-space: nowrap; }
.tag.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.meta-i { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* buttons & controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; border: 1px solid transparent; white-space: nowrap; }
.btn-primary { background: var(--btn); color: var(--btn-ink); }
.btn-primary:hover { background: var(--btn-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line-2); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { border-color: var(--input-hover); }
.btn-block { width: 100%; height: 42px; }
.link-btn { color: var(--accent); font-weight: 500; font-size: 13px; padding: 4px 2px; border-radius: 4px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn.danger { color: var(--danger); }
.icon-btn { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); flex: none; }
.icon-btn:hover { color: var(--text); background: var(--hover); }
.ib { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--body); background: var(--surface); flex: none; }
.x-sm { color: var(--faint); padding: 4px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.x-sm:hover { color: var(--danger); background: var(--hover); }
.seg { display: flex; padding: 2px; gap: 2px; border-radius: 9px; background: var(--hover); border: 1px solid var(--line); }
.seg button { flex: 1 1 0; min-width: 0; height: 30px; padding: 0 10px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg button:disabled { cursor: default; }
.seg.full { width: 100%; }
.inp, .sel, .ta { width: 100%; min-width: 0; height: 38px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.inp:hover, .sel:hover, .ta:hover { border-color: var(--input-hover); }
.inp:focus, .sel:focus, .ta:focus, .prop-in:focus, .title-input:focus, .stage-name:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ta { height: auto; min-height: 88px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .lbl { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 > * { min-width: 0; }

/* ── shared bits ── */
.lwrap { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; box-shadow: var(--shadow-xs); }
.lhead { display: none; }
.grp + .grp { border-top: 1px solid var(--line); }
.grp-head { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 8px 14px; text-align: left; background: var(--surface-2); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.grp-head h3 { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 100%; }
.grp-head .sub { font-size: 12.5px; color: var(--muted); }
.grp-head .chev { color: var(--faint); transition: transform .15s; }
.grp.collapsed .grp-head .chev { transform: rotate(-90deg); }
.grp.collapsed .grp-head { border-bottom: 0; }
.grp.collapsed .grp-body { display: none; }
.empty-state { text-align: center; color: var(--muted); padding: 56px 16px; }
.empty-state .ic { width: 28px; height: 28px; margin: 0 auto 10px; color: var(--faint); }
.empty-state p { margin: 0; }
.grip { width: 20px; display: grid; place-items: center; color: var(--faint); cursor: grab; touch-action: none; flex: none; opacity: .55; }
.card:hover .grip, .stage:hover .grip { opacity: 1; }
@media (hover: hover) and (min-width: 900px) { .card .grip { opacity: 0; } .card:hover .grip { opacity: 1; } }
.grip .ic { width: 15px; height: 15px; }
.card-main { flex: 1; min-width: 0; padding: 10px 12px 10px 0; display: grid; gap: 6px; }
.card-l1 { display: flex; align-items: flex-start; gap: 8px; }
.card-l1 .ring { margin-top: 2px; }
.card-title { flex: 1; min-width: 0; color: var(--text); font-weight: 550; font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
.card-l2 { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); min-width: 0; padding-left: 22px; }
.card-l2 .mono { flex: none; }
.card-l2 .cs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; color: var(--body); }
.card-l2 .k { color: var(--muted); }
.card-l3 { padding-left: 22px; }
.title-input { width: 100%; display: block; resize: none; overflow: hidden; font-size: 20px; font-weight: 650; letter-spacing: -.02em; line-height: 1.3; color: var(--text); padding: 6px 8px; margin: -6px -8px 0; width: calc(100% + 16px); border: 1px solid transparent; border-radius: 8px; background: transparent; }
.title-input:hover { border-color: var(--line-2); }
.menu-user { display: flex; gap: 12px; align-items: center; padding: 0 0 14px; }
.menu-user .av { width: 40px; height: 40px; font-size: 14px; }
.menu-user .name { color: var(--text); font-weight: 600; }
.menu-user .email { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.menu-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 14px; text-align: left; border-top: 1px solid var(--line); color: var(--text); font-weight: 500; }
.menu-item:first-child { border-top: 0; }
.menu-item:hover { background: var(--surface-2); }
.menu-item .ic { color: var(--muted); }
.menu-item .r { margin-left: auto; color: var(--faint); font-size: 12px; font-weight: 500; }
.menu-group-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; margin: 18px 2px 8px; }
.version { text-align: center; font-size: 12px; color: var(--faint); margin-top: 20px; }
.role-tag { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--accent-line); color: var(--accent); margin-left: 4px; vertical-align: 1px; }
.signin { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--canvas); background-image: radial-gradient(circle at 1px 1px, var(--line-2) 1px, transparent 0); background-size: 22px 22px; }
.signin-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px 26px 26px; box-shadow: var(--shadow-lg); text-align: center; }
.signin-card .mark { width: 44px; height: 44px; border-radius: 12px; font-size: 13px; margin: 0 auto 18px; }
.signin-card .eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.signin-card h1 { font-size: 21px; letter-spacing: -.02em; }
.signin-card p { color: var(--muted); margin: 8px 0 22px; }
.ms-btn { width: 100%; height: 42px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--text); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: var(--shadow-xs); }
.ms-btn:hover { border-color: var(--input-hover); }
.ms-logo { display: grid; grid-template-columns: 8px 8px; gap: 2px; }
.ms-logo i { width: 8px; height: 8px; display: block; }
.note { font-size: 12.5px; color: var(--muted); margin-top: 16px; line-height: 1.5; }
.err-box { border: 1px solid color-mix(in srgb, var(--danger) 50%, transparent); color: var(--danger); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); border-radius: 8px; padding: 9px 11px; font-size: 13px; margin-bottom: 14px; text-align: left; }

/* toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 80; background: var(--btn); color: var(--btn-ink); border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 500; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); animation: fade .15s; }
.toast button { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.signin-msg { min-height: 0; margin-top: 10px; font-size: 13px; color: var(--danger); line-height: 1.45; }
.signin-msg:empty { display: none; }
.ms-btn.busy, .btn.busy { opacity: .8; cursor: progress; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; margin-right: 8px; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── to-do ── */
.ic.rot90 { transform: rotate(90deg); } .ic.rot-90 { transform: rotate(-90deg); }
.tb span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tb.new span { width: 44px; }
.tbar-row { width: 100%; gap: 10px; }
.tseg { flex: none; }
.tseg button { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; }
.t-sum { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.t-sum b { color: var(--danger); font-weight: 600; }

/* quick add */
.qa { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; max-width: 760px; margin: 0 auto; padding: 4px 6px 6px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-xs); }
.qa:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.qa-in { display: flex; align-items: center; gap: 8px; padding: 0 4px 0 6px; min-width: 0; cursor: text; }
.qa-in .ic { color: var(--accent); }
.qa-in input { flex: 1; min-width: 0; height: 38px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.qa-in input::placeholder { color: var(--faint); }
.qa-opts { display: flex; align-items: center; gap: 6px; min-width: 0; }
.qchip { position: relative; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 500; white-space: nowrap; cursor: pointer; min-width: 0; }
.qchip:hover { border-color: var(--input-hover); }
.qchip .ic { color: var(--muted); }
.qchip.set { border-color: var(--accent-line); background: var(--accent-soft); }
.qchip input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; border: 0; padding: 0; -webkit-appearance: none; appearance: none; }
.qa-opts .btn { margin-left: auto; height: 32px; padding: 0 16px; }
@media (min-width: 640px) { .qa { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 4px 6px; } }

/* list */
.wrap { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; min-width: 0; }
.wrap.wide { max-width: none; }
.tl .grp-head { min-height: 38px; }
.tlist { min-height: 6px; }
.trow { position: relative; overflow: hidden; border-top: 1px solid var(--line); background: var(--surface); min-width: 0; }
.trow.swiping, .trow.swiped, .trow.leaving { background: var(--danger); }
.tin { position: relative; z-index: 1; display: flex; align-items: center; min-height: 48px; padding: 2px 12px 2px 0; background: var(--surface); min-width: 0; touch-action: pan-y; transition: transform .2s ease; }
.tdel { position: absolute; inset: 0 0 0 auto; width: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #fff; font-size: 11.5px; font-weight: 600; background: var(--danger); transition: width .15s; }
.tdel .ic { width: 18px; height: 18px; }
.trow.far .tdel { width: 100%; align-items: flex-end; padding-right: 26px; }
.trow.swiping .tin, .trow.swiping .tmain, .trow.swiping .tck { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.trow.leaving { transition: opacity .18s; opacity: 0; }
.trow:not(.swiping):not(.swiped):not(.leaving) .tdel { visibility: hidden; }
.tlist > .trow:first-child { border-top: 0; }
.trow .grip { align-self: stretch; width: 26px; }
.grip-sp { width: 26px; flex: none; }
@media (hover: hover) and (min-width: 900px) { .trow .grip { opacity: 0; } .trow:hover .grip { opacity: 1; } }
.tck { width: 22px; height: 22px; margin-right: 10px; border-radius: 50%; border: 1.6px solid var(--input); display: grid; place-items: center; color: transparent; flex: none; transition: background .15s, border-color .15s, color .15s; }
.tck .ic { width: 13px; height: 13px; stroke-width: 2.8; }
.tck:hover { border-color: var(--accent); color: var(--accent); }
.tck[aria-pressed="true"], .trow.ticking .tck { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tck.lg { width: 26px; height: 26px; margin: 4px 0 0; }
.tmain { flex: 1; min-width: 0; display: grid; gap: 2px; padding: 8px 0; text-align: left; }
.tt { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.trow.done .tt, .trow.ticking .tt { color: var(--faint); text-decoration: line-through; }
.trow.ticking { transition: opacity .3s .1s; opacity: .55; }
.tn { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.tn > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tn .ic { flex: none; }
.twhen { flex: none; margin-left: 10px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.twhen.od { color: var(--danger); font-weight: 600; }
.trow.done .twhen { color: var(--faint); }
.tempty { padding: 13px 16px 13px 58px; font-size: 13px; color: var(--faint); }
.drop-hot .tempty { display: none; }
.tlist .drop-ph { border-radius: 0; margin: 0; }
.drag-ghost.trow { border: 1px solid var(--line-2); border-radius: 10px; }
.drag-ghost.trow .tdel { display: none; }
.t-tip { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 2px 0 0; font-size: 12px; color: var(--faint); text-align: center; }
.t-tip .ic { display: inline-block; }
.t-err { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); border-radius: var(--r); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); color: var(--text); font-size: 13px; }
.t-err .ic { color: var(--danger); margin-top: 1px; }
.tag.acc { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* month */
.tcal-wrap { display: grid; gap: 12px; min-width: 0; }
@media (min-width: 900px) { .tcal-wrap { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); align-items: start; } }
.cal, .tday { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; box-shadow: var(--shadow-xs); min-width: 0; }
.cal-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); }
.cal-head h3 { flex: 1; font-size: 14.5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-head .btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; margin-right: 4px; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow span { padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--faint); text-align: center; text-transform: uppercase; letter-spacing: .06em; }
.cal-dow em { font-style: normal; display: none; }
.cd { min-width: 0; min-height: 54px; padding: 4px 2px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); text-align: left; }
.cd:nth-child(7n+1) { border-left: 0; }
.cd:hover { background: var(--hover); }
.cd.sel { background: var(--surface-2); }
.cdn { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 500; color: var(--text); flex: none; }
.cd.other .cdn { color: var(--faint); }
.cd.today .cdn { color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.cd.sel .cdn { background: var(--btn); color: var(--btn-ink); box-shadow: none; }
.cit { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; width: 100%; min-width: 0; }
.cit i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); font-size: 0; overflow: hidden; font-style: normal; flex: none; }
.cit i.dn { background: var(--line-2); }
.cit i.od { background: var(--danger); }
.cit b { display: none; }
.cd.drop-hot { background: var(--accent-soft); outline-offset: -2px; }
@media (min-width: 900px) {
  .cal-dow em { display: inline; text-transform: none; }
  .cal-dow span { text-transform: none; letter-spacing: 0; font-size: 12px; }
  .cd { min-height: 104px; padding: 6px; align-items: stretch; }
  .cdn { align-self: flex-start; width: 24px; height: 24px; font-size: 12.5px; }
  .cit { flex-direction: column; flex-wrap: nowrap; gap: 2px; }
  .cit i { width: auto; height: auto; padding: 1px 6px; border-radius: 4px; font-size: 11.5px; line-height: 1.4; background: var(--accent-soft); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cit i.dn { background: transparent; color: var(--faint); text-decoration: line-through; }
  .cit i.od { background: color-mix(in srgb, var(--danger) 12%, transparent); }
  .cit b { display: block; padding-left: 6px; font-size: 11px; font-weight: 500; color: var(--muted); }
}
.tday-head { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 8px 12px 8px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tday-head h3 { font-size: 14px; min-width: 0; }
.tday-head .sub { font-size: 12.5px; color: var(--muted); }
.tday-head .link-btn { display: inline-flex; align-items: center; gap: 4px; }
.tdone { border-top: 1px solid var(--line); }

/* edit window */
.tform { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.tf-top { display: flex; gap: 12px; align-items: flex-start; }
.tf-top .title-input { margin: 0; width: auto; flex: 1; min-width: 0; padding: 4px 8px; }
.tform input[type="date"], .tform input[type="time"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; line-height: 36px; }
.tquick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -6px; }
.tquick button { height: 28px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--body); background: var(--surface); }
.tquick button:hover { border-color: var(--input-hover); color: var(--text); }
.tquick button[aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.panel[data-kind="todo"] .panel-foot .link-btn { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.panel[data-kind="todo"] .panel-foot .btn { flex: 0 0 auto; min-width: 120px; margin-left: 0; }
.qa-help { display: grid; gap: 12px; color: var(--body); }
.qa-help p { margin: 0; }
.qa-help ol { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.copy-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 6px 6px 6px 10px; border: 1px solid var(--line-2); border-radius: 8px; min-width: 0; }
.copy-row .mono { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.copy-row .btn-sm { height: 28px; }
.tf-top { gap: 8px; align-items: center; }
.tf-top .tck.lg { margin: 0; }
.tf-top .title-input { padding: 4px 6px; }
@media (max-width: 899px) { .cd { min-height: 46px; padding: 3px 2px 5px; } }

/* ── app shell ── */
.d-only { display: none !important; }
@media (min-width: 900px) { .m-only { display: none !important; } .d-only { display: flex !important; } }
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; min-width: 0; }
.top { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.top h1 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.app-ic { width: 28px; height: 28px; border-radius: 7px; flex: none; }
:root[data-theme="dark"] .app-ic { box-shadow: 0 0 0 1px var(--line-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .app-ic { box-shadow: 0 0 0 1px var(--line-2); } }
.sync { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; transition: background .3s; }
.sync.busy { background: var(--faint); animation: pulse 1.2s ease-in-out infinite; }
.sync.off { background: var(--warn); }
@keyframes pulse { 50% { opacity: .3; } }
.demo-tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); border-radius: 5px; padding: 1px 5px; flex: none; }
.av { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-size: 12px; font-weight: 700; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2); }
.av-btn { border-radius: 50%; flex: none; }
.tabs { flex: none; }
.tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; }
.search { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--muted); min-width: 0; }
.top .search { width: 220px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
@media (min-width: 900px) { .search input { font-size: 14px; } }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.msearch { display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 10px auto 0; }
.msearch .search { flex: 1; height: 42px; }
.qa-wrap { padding: 0 12px 12px; }
main { flex: 1; padding: 0 12px calc(96px + env(safe-area-inset-bottom)); min-width: 0; }
@media (min-width: 900px) {
  .top { padding: 0 24px; height: 60px; border-bottom: 1px solid var(--line); }
  .top h1 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
  .qa-wrap { padding: 20px 24px 14px; }
  main { padding: 0 24px 48px; }
}
.qa-wrap .qa { max-width: 760px; }
body:has(main[data-view="month"]) .qa-wrap .qa { max-width: 1240px; }
.wrap { max-width: 760px; }
.wrap.wide { max-width: 1240px; }
.empty { text-align: center; color: var(--muted); padding: 56px 16px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--canvas) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tb { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 500; color: var(--faint); padding: 4px 0; min-width: 0; }
.tb .ic { width: 21px; height: 21px; }
.tb.on { color: var(--text); }
.tb.new span { width: 46px; height: 40px; border-radius: 12px; background: var(--btn); color: var(--btn-ink); display: grid; place-items: center; box-shadow: var(--shadow); }
.tb.new .ic { width: 20px; height: 20px; stroke-width: 2; }
.tb-badge { position: absolute; top: 0; left: calc(50% + 6px); font-style: normal; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .toast { bottom: 24px; } }
.si-ic { width: 72px; height: 72px; border-radius: 18px; display: block; margin: 0 auto 14px; }
.signin-card .link-btn { margin-top: 12px; }

/* drag & drop */
.drop-ph { border: 1.5px dashed var(--accent); border-radius: var(--r); background: var(--accent-soft); }
.drop-hot { outline: 1.5px dashed var(--accent); outline-offset: -1.5px; }
.is-dragged { display: none !important; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; box-shadow: var(--shadow-lg); opacity: .96; }
body.dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }

/* windows — always centred */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 40; animation: fade .15s; }
.panel { position: fixed; z-index: 41; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-lg); animation: pop-in .16s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }
.panel-head { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 10px 6px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { flex: 1; font-size: 15px; }
.close-x { width: 34px; height: 34px; display: grid; place-items: center; color: var(--muted); border-radius: 8px; flex: none; }
.close-x:hover { color: var(--text); background: var(--hover); }
.panel-body { flex: 0 1 auto; overflow-y: auto; overflow-x: hidden; padding: 18px 20px 22px; overscroll-behavior: contain; }
.panel-foot { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); }
.panel-foot .link-btn { display: inline-flex; align-items: center; gap: 5px; }
.panel-foot .btn { min-width: 120px; height: 38px; }
.menu-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; margin: 18px 2px 8px; }
.panel .hint { margin: 0 2px 12px; line-height: 1.5; }
.av.lg { width: 40px; height: 40px; font-size: 14px; }

/* glance (Today) */
.glance { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 12px; align-items: center; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.g-dow { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.g-d { font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: -.03em; line-height: 1.15; }
.g-stat { position: relative; width: 56px; height: 56px; display: grid; place-items: center; }
.g-stat svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.g-track { fill: none; stroke: var(--line-2); stroke-width: 4; }
.g-fill { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .4s; }
.g-stat span { position: relative; font-size: 12px; color: var(--muted); }
.g-stat b { font-size: 16px; color: var(--text); }
.g-next { grid-column: 1 / -1; display: grid; gap: 2px; padding-top: 14px; border-top: 1px solid var(--line); min-width: 0; }
.g-next .k { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.g-next-t { font-size: 17px; font-weight: 600; color: var(--text); text-align: left; overflow-wrap: anywhere; }
button.g-next-t:hover { color: var(--accent); }
.g-od { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--danger); }
.more-link { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; padding: 8px; font-size: 13px; font-weight: 500; color: var(--accent); }
/* agenda rows: time on the left, easy to scan */
.trow.ag .twhen { order: 0; width: 58px; margin: 0 6px 0 0; text-align: right; font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.25; }
.trow.ag .twhen.od { color: var(--danger); font-size: 12px; }
.trow.ag.done .twhen { color: var(--faint); font-weight: 500; }
.trow.ag .tck { margin-left: 4px; }
.trow.ag .tt { font-size: 15px; }
.tempty { padding-left: 58px; }
@media (min-width: 900px) { .glance { padding: 22px 24px 18px; } .g-d { font-size: 32px; } }

/* ── lists (categories) ── */
.lists { display: flex; flex-wrap: wrap; gap: 6px; max-width: 760px; margin: 10px auto 0; }
body:has(main[data-view="month"]) .lists { max-width: 1240px; }
.lchip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 17px; background: var(--surface); color: var(--body); font-size: 13.5px; font-weight: 500; white-space: nowrap; min-width: 0; max-width: 100%; }
.lchip span { overflow: hidden; text-overflow: ellipsis; }
.lchip:hover { border-color: var(--input-hover); color: var(--text); }
.lchip .ic { color: var(--muted); }
.lchip i { font-style: normal; font-size: 11.5px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--hover); color: var(--text); display: inline-grid; place-items: center; }
.lchip.on { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.lchip.on .ic { color: var(--btn-ink); }
.lchip.on i { background: color-mix(in srgb, var(--btn-ink) 22%, transparent); color: var(--btn-ink); }
.lchip.add { width: 34px; padding: 0; justify-content: center; border-style: dashed; color: var(--muted); }
.qa.check .qchip { display: none; }
.twhen:empty { display: none; }
.ck-head { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 8px 12px 8px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.ck-head > .ic { color: var(--muted); }
.ck-head h3 { font-size: 14.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-head .sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ck-head .link-btn, .ck-sub .link-btn { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ck .tt { font-size: 15px; }
.ck .trow .tin { min-height: 52px; }
.ck-sub { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 14px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.g-lists { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.g-lists button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 13px; color: var(--body); background: var(--surface); }
.g-lists button:hover { border-color: var(--input-hover); }
.g-lists .ic { color: var(--muted); }
.g-lists b { color: var(--text); font-weight: 700; }
.app-ic { box-shadow: 0 0 0 1px var(--line-2); }
@media (max-width: 480px) {
  .lists { gap: 5px; }
  .lchip { height: 32px; padding: 0 10px; font-size: 13px; gap: 5px; }
  .lchip .ic { display: none; }
  .lchip.add { width: 32px; }
  .lchip.add .ic { display: block; }
}
.qa.check { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 4px 6px; }
