/* Niu Board, part 1 of 2 (windows.css follows it, in this order): fonts, colours, the top bar, columns and cards. */
/* Lato, our own files (#446) */
@font-face{font-family:'Lato';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/lato-400-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Lato';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/lato-400.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Lato';font-style:normal;font-weight:700;font-display:swap;src:url(../fonts/lato-700-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Lato';font-style:normal;font-weight:700;font-display:swap;src:url(../fonts/lato-700.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
/* Layout: one screen. Laptop = four columns plus a task panel on the right; phone = one column at a time, swipe, full-screen task. */
:root {
  color-scheme: dark;
  --bg: #191a1c; --col: #202124; --card: #292b2f; --card-hi: #303338; --line: #3a3d42;
  --fg: #ececea; --dim: #a0a3a9;
  --orange-soft: rgba(242, 145, 46, .16); --green-soft: rgba(76, 184, 134, .16);
  --col-line: #2b2d31; --hover-line: #4d5157; --hl: #3e4147;
  --orange: #f2912e; --mine: #d49a68; --by-claude: #b9c0cc; --on-orange: #221304;
  --blue: #5aa9f2; --green: #4cb886; --red: #e8625a; --gray: #8d9198; --on-dot: #15171a; --violet: #7c3aed; --summary: #8ec5a0; --brief: #7aa2f7; --stuck-bg: #3a1d1f; --stuck-line: #8e3b3b; --stuck-fg: #f0a5a0;
  --sans: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: var(--sans);
}
/* Dark is the default; the sun button in the top bar switches to this look. */
:root[data-look="light"] {
  color-scheme: light;
  --bg: #f8fafc; --col: #eef2f6; --card: #ffffff; --card-hi: #f1f5f9; --line: #d5dce5;
  --fg: #0f172a; --dim: #475569;
  --orange: #b04a08; --mine: #9a4c17; --by-claude: #7b8494; --on-orange: #ffffff;
  --blue: #1d6fbf; --green: #15803d; --red: #c0322b; --gray: #64748b; --on-dot: #ffffff; --violet: #6d28d9; --summary: #1f6b3d; --brief: #1e3a8a; --stuck-bg: #fbeaea; --stuck-line: #b44a4a; --stuck-fg: #8f2323;
  --orange-soft: rgba(176, 74, 8, .12); --green-soft: rgba(21, 128, 61, .12);
  --col-line: #e2e8f0; --hover-line: #b6c0cd; --hl: #e8edf3;
}
/* Light style: status pills are tinted with a thin border, because solid colours are too loud on white. */
:root[data-look="light"] .dot { border: 1px solid transparent; }
:root[data-look="light"] .dot.needs { background: #fff; color: #9a3412; box-shadow: inset 0 0 0 1.5px #c2410c; }
:root[data-look="light"] .dot.due { background: #fdeaea; color: #a12620; border-color: #f2bcb9; }
:root[data-look="light"] .dot.work { background: #eef2f6; color: #475569; border-color: #cbd5e1; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
/* --vh and --vtop follow the part of the screen the phone keyboard leaves free. */
html { height: var(--vh, 100%); overflow: hidden; }
img { max-width: 100%; }
[hidden] { display: none !important; }
#app { display: contents; }
body { background: var(--bg); color: var(--fg); font: 14px/1.45 var(--sans); display: flex; flex-direction: column; overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
/* No scroll bars (#166): finger, wheel and touchpad scroll */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

header { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-block: 10px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.brand { font: 600 14px var(--mono); color: var(--orange); letter-spacing: -.01em; }
.bar { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 100%; order: 3; }
.projects { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; }
.projects button { flex: none; padding: 4px 9px; border-radius: 5px; color: var(--dim); font-weight: 500; font-size: 13px; }
.projects button:hover { color: var(--fg); }
.projects button[aria-pressed="true"] { background: var(--card); color: var(--fg); }
.allc { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--fg); }
.allc:hover { background: var(--card); }
.allc-s { display: none; }
@media (max-width: 380px) { .allc-l { display: none; } .allc-s { display: inline; } }
.allc[aria-pressed="true"] { background: var(--orange-soft); border-color: var(--orange); color: var(--orange); }
.allc svg, .chev svg { transition: transform .12s; }
.allc[aria-pressed="true"] svg, .chev[aria-expanded="true"] svg { transform: rotate(180deg); }
.dots { display: flex; gap: 5px; margin-left: auto; }
.dot { display: inline-flex; align-items: center; justify-content: center; height: 26px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; color: var(--on-dot); }
.dot b { font: 600 13px var(--mono); font-variant-numeric: tabular-nums; }
.dot.qchip b { margin-right: 5px; }
.addp { flex: none; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 6px; color: var(--dim); font-size: 16px; line-height: 1; }
.addp:hover { background: var(--card); color: var(--fg); }
#newp, #newb { width: 160px; height: 28px; background: var(--bg); border: 1px solid var(--orange); border-radius: 6px; padding: 0 8px; font-size: 13px; }
#newpslot { flex: none; display: flex; }
.dot.needs { background: transparent; color: var(--orange); box-shadow: inset 0 0 0 1.5px var(--orange); }
/* #184, #610: Claude is blocked on him: the chip is steady red; it pulses only while one red card is unseen on this
   device (opened or met in the queue = seen), and not at all when the device asks for fewer animations */
.dot.needs.alarm { color: #fff; background: #b91c1c; box-shadow: inset 0 0 0 1.5px #fca5a5; position: relative; z-index: 1; }
@media (prefers-reduced-motion: no-preference) { .dot.needs.alarm.fresh { animation: needsglow 1.6s ease-in-out infinite; } }
@keyframes needsglow {
  0%, 100% { background: #7f1d1d; box-shadow: inset 0 0 0 1.5px #fca5a5, 0 0 2px 0 rgba(239, 68, 68, .2); }
  50% { background: #dc2626; box-shadow: inset 0 0 0 1.5px #fca5a5, 0 0 14px 4px rgba(239, 68, 68, .6); }
}
/* a card stuck in Doing is Claude's side: an orange hint on the chip, never moving */
.dot.needs.stuckq { box-shadow: inset 0 0 0 1.5px var(--orange), 0 0 0 2px var(--orange-soft); }
.dot.qchip .qwhy { margin-left: 6px; font-size: .78em; font-weight: 400; opacity: .85; white-space: nowrap; }
.column.needs > h2 { color: var(--orange); }
.dot.due { background: var(--red); }
.dot.rec { background: var(--violet); color: #fff; }
@media (prefers-reduced-motion: no-preference) { .dot.rec.late { animation: recflash 1s steps(1) infinite; } }
@keyframes recflash { 50% { background: #fff; color: var(--violet); } }
.card.recme { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
/* The T button and its popup (#117): Do at / Repeat, a time zone, the 24-hour bar with trading hours in red */
.tbtn { flex: none; height: 1.6em; min-width: 1.6em; padding: 0 .35em; margin: -.15em 0 0; border: 1px solid var(--line); border-radius: 5px; font-weight: 700; font-size: .85em; color: var(--dim); }
.tbtn:hover { color: var(--fg); background: var(--line); }
.tbtn.on { color: var(--orange); border-color: var(--orange); }
.tscrim { position: fixed; inset: 0; z-index: 60; }
.tpop { position: fixed; z-index: 61; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.45); font-size: 14px; max-height: calc(100dvh - 16px); overflow-y: auto; }
.tpop .thead { display: flex; gap: 8px; align-items: stretch; }
.tpop .thead .seg2 { flex: 1; }
.tpop .thelpb { width: 34px; border: 1px solid var(--line); border-radius: 7px; color: var(--dim); font-weight: 700; }
.tpop .thelpb[aria-expanded="true"] { color: var(--orange); border-color: var(--orange); }
.tpop .thelp { font-size: 13px; line-height: 1.4; border-left: 3px solid var(--orange); padding: 2px 0 2px 10px; }
.tpop .thelp p { margin: 0 0 6px; }
.tpop .seg2 { display: flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.tpop .seg2 button { flex: 1; padding: 7px 0; font-weight: 600; color: var(--dim); }
.tpop .seg2 button.on { background: var(--orange-soft); color: var(--orange); }
.tpop .r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tpop .r:empty { display: none; }
.tpop input, .tpop select { background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font: inherit; }
.tpop #t-zone { flex: 1 1 0; min-width: 0; }
.tpop input[type=number] { width: 72px; }
.tpop .hhmm { width: 72px; font-variant-numeric: tabular-nums; }
.tpop .chip { border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px; color: var(--dim); }
.tpop .chip.on { border-color: var(--orange); color: var(--orange); }
.tpop .dim { color: var(--dim); font-size: 12px; }
.tpop .dim b { color: var(--fg); font-weight: 600; }
.tpop .check { display: flex; align-items: center; gap: 8px; }
.tpop .check input { width: auto; }
.tbar { position: relative; height: 22px; border-radius: 5px; background: var(--bg); border: 1px solid var(--line); cursor: pointer; overflow: hidden; }
.tbar i { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--red) 55%, transparent); }
.tbar u { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: var(--orange); border-radius: 2px; }
.ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); margin-top: 2px; }
.twarn { color: var(--red); font-size: 13px; }
.tpop .end { display: flex; justify-content: space-between; align-items: center; }
.tpop .end .send { height: 32px; padding: 0 14px; }
.rdpop .rdhead { display: flex; justify-content: space-between; align-items: center; }
.rdpop .rdhead .linkbtn { font-size: 18px; padding: 0 4px; }
.rdpop .rdbtn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; text-align: left; }
.rdpop .rdbtn:hover, .rdpop .rdbtn:focus-visible { border-color: var(--orange); }
.rdpop .rdbtn b { color: var(--orange); }
.rdpop .rdbtn small { color: var(--dim); }
.dot.work { background: var(--gray); }
.dot.recent { background: transparent; color: var(--text, inherit); box-shadow: inset 0 0 0 1.5px var(--gray); }

.tabs { display: none; flex: none; gap: 4px; padding-bottom: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; padding: 7px 8px; font-size: 13px; color: var(--dim); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs .addc, .column h2 .addc { flex: none; width: 24px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 6px; color: var(--dim); font-size: 15px; line-height: 1; }
.tabs .addc { align-self: center; border-bottom: 1px solid var(--line); }
.addc:hover { background: var(--card); color: var(--fg); }
#newb { width: 110px; height: 24px; background: var(--bg); border: 1px solid var(--orange); border-radius: 6px; padding: 0 6px; font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--fg); }
.tabs button.on { color: var(--fg); border-color: var(--orange); }

.board { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding-bottom: 12px; }
.grip { position: absolute; top: 0; bottom: 0; right: -12px; width: 10px; z-index: 2; cursor: col-resize; touch-action: none; border-radius: 4px; }
.grip::after { content: ""; position: absolute; top: 8px; bottom: 8px; left: 4px; width: 2px; border-radius: 1px; background: transparent; }
.grip:hover::after, .grip:focus-visible::after, .grip.on::after { background: var(--orange); }
.column { position: relative; background: var(--col); border: 1px solid var(--col-line); border-radius: 8px; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.column.over { outline: 2px dashed var(--orange); outline-offset: -2px; }
.column h2 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .02em; padding: 10px 12px 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--dim); }
.column h2 span { margin-right: auto; }
.column h2 .addc { margin-block: -4px; }
.strip, .column .foldb { display: none; }
.minib { flex: none; width: 1.6em; height: 1.6em; margin: -.15em -.2em 0 0; border-radius: 5px; color: var(--dim); display: inline-flex; align-items: center; justify-content: center; }
.minib:hover { background: var(--line); color: var(--fg); }
.minib svg { transform: rotate(180deg); transition: transform .12s; }
.card.mini .minib svg { transform: none; }
.card.mini { gap: 0; padding-block: .5em; }
@media (min-width: 761px) {
  .column .foldb { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; margin-block: -4px; border: 1px solid var(--line); border-radius: 6px; color: var(--dim); font-size: 15px; line-height: 1; }
  .column .foldb:hover, .strip:hover { color: var(--fg); background: var(--card); }
  .column.folded > h2, .column.folded > .stack { display: none; }
  .column.folded { align-items: center; padding-bottom: 8px; gap: 8px; }
  .column.folded .strip { display: flex; flex: 1 1 auto; align-items: center; gap: 8px; width: 100%; padding: 12px 0; border-radius: 8px; writing-mode: vertical-rl; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--dim); }
  .strip b { font: 500 12px var(--mono); }
}
.column h2 { cursor: grab; }
.column h2, .tabs button { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.col-moving { opacity: .5; }
.col-target { outline: 2px solid var(--orange); outline-offset: -2px; }
.column h2 span { font: 500 12px var(--mono); }
.stack { container-type: inline-size; flex: 1 1 auto; overflow-y: auto; padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.quick { display: flex; }
.quick input { width: 100%; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; font-size: 13px; }
.quick input::placeholder { color: var(--dim); }
.empty { color: var(--dim); font-size: 13px; padding: 8px 4px; }

/* Everything inside a card is sized in em, so it scales with the width of its column. */
.card { font-size: clamp(12px, 4.9cqi, 16px); background: var(--card); border: 1px solid var(--line); border-radius: 7px; padding: .7em .7em .6em; display: flex; flex-direction: column; gap: .55em; cursor: pointer; flex: none; }
.card:hover { border-color: var(--hover-line); }
.card, .list button { border-left: 3px solid var(--pc, transparent); }
/* Who created the task (#168): orange for the Boss, silver for Claude, on the card's right edge and in the
   full view's rounded head, which also carries the project color on the left with a soft glow */
.cm-t { display: inline-flex; align-items: center; gap: 4px; }
.cm-i { flex: none; color: var(--fg); --hole: var(--card); }
.cm-i.cm-me { color: var(--orange); }
.st-t { display: inline-flex; align-items: center; gap: 3px; }
.st-working { color: var(--orange); } .st-next { color: var(--fg); } .st-waiting { color: var(--gray); }
.st-stale { color: var(--gray); } .st-ring { opacity: 0; transform-origin: 8px 8px; }
/* the one animation that ignores the phone's reduced-motion setting: a tiny status dot, and its pulse is its meaning (#440) */
.st-working:not(.st-stale) .st-ring { animation: stp 1.6s ease-out infinite; }
@keyframes stp { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(2.35); } }
.card.byme { border-right: 3px solid var(--mine); }
.card.byclaude { border-right: 3px solid var(--by-claude); }
.card.stuck { background: var(--stuck-bg); border-color: var(--stuck-line); }
.card.stale { border-color: var(--orange); }   /* #610: stuck in Doing, a hint, not red */
.card.stale .quiet { color: var(--orange); }
.card .dnote { margin: .35em 0 .1em; padding: .35em .55em; border-left: 2px solid var(--green); background: var(--green-soft); border-radius: 4px; font-size: .84em; line-height: 1.35; overflow-wrap: anywhere; }
.card .dnote b { font-weight: normal; margin-right: .2em; }
.card .dnote .undo { color: var(--dim); }
.dnote .next { color: var(--orange); }
.dnote .next.none { color: var(--dim); font-style: italic; }
.card .dnote.none { border-left-color: var(--line); background: none; color: var(--dim); font-style: italic; }
.card .live { display: flex; align-items: baseline; gap: .4em; margin-top: -.2em; font-size: .78em; color: var(--gray); min-width: 0; }
.card .live span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.card .live small { flex: none; font-size: 1em; }
.card .live i { flex: none; width: .55em; height: .55em; border-radius: 50%; background: var(--gray); }
.card .live.on i { background: var(--green); box-shadow: 0 0 6px var(--green); }
.qline { display: flex; align-items: baseline; gap: .45em; margin: .1em 0 .3em; font-size: .78em; color: var(--gray); min-width: 0; }
.qline b { flex: none; padding: 0 .45em; border: 1px solid var(--line); border-radius: 4px; font-weight: 600; color: var(--fg); }
.qline span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.qline.q-working b { border-color: var(--orange); color: var(--orange); }
.qline.q-working span { color: var(--orange); }
.qline.q-hold span { white-space: normal; }
.silence { margin: .1em 0 .3em; font-size: .8em; color: var(--orange); overflow-wrap: anywhere; }
.silence small { color: var(--dim); font-size: 1em; }
.silence.red { color: var(--red); }
.qline.q-refused { display: block; color: var(--red); white-space: normal; overflow-wrap: anywhere; }
.qline code { font-size: .95em; color: var(--gray); }
.qctl { display: flex; flex-wrap: wrap; align-items: center; gap: .35em; margin: 0 0 .35em; }
.qctl .seg button[data-to="now"] { color: var(--orange); }
.qlater { display: flex; flex-wrap: wrap; align-items: center; gap: .3em; font-size: .86em; }
.qlater button { height: 2em; padding: 0 .55em; border: 1px solid var(--line); border-radius: 6px; color: var(--fg); }
.qlater button:hover { background: var(--card-hi); }
.qlater .qwhen { height: 2em; background: var(--card); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 0 .3em; color-scheme: dark; }
.card.qwait { opacity: .6; }
.card .quiet { margin-top: -.3em; font-size: .78em; color: var(--stuck-fg); }
.panel > .p-top { --by: transparent; flex: none; margin: 10px max(6px, calc(var(--side) - 14px)) 6px; padding: 0 !important; border: 1px solid var(--line); border-left: 3px solid var(--pc, var(--line)); border-radius: 14px; background: linear-gradient(90deg, color-mix(in srgb, var(--pc) 13%, transparent), transparent 42%, transparent 58%, color-mix(in srgb, var(--by) 12%, transparent)), var(--col); }
.panel.byme > .p-top { --by: var(--mine); border-right: 3px solid var(--mine); }
.panel.byclaude > .p-top { --by: var(--by-claude); border-right: 3px solid var(--by-claude); }
.pdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pc); margin-right: 6px; vertical-align: 1px; }
.card.hl { background: var(--hl); border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.filechip { align-self: flex-start; max-width: 100%; padding: 3px 8px; border: 1px solid var(--line); border-radius: 5px; font-size: 12px; color: var(--dim); overflow-wrap: anywhere; }
.card-top { display: flex; gap: 6px; align-items: flex-start; }
@keyframes askglow { 0%, 100% { box-shadow: 0 0 0 1px var(--stuck-line); } 50% { box-shadow: 0 0 0 2px var(--red), 0 0 16px 3px rgba(232, 98, 90, .55); } }
.card.asking, .panel.asking > .p-top { animation: askglow 1.8s ease-in-out infinite; }
.panel.asking > .p-top { border-color: var(--red); }
.ask b { display: block; color: var(--stuck-fg); font-size: 12px; margin-bottom: 2px; }
.p-top > .ask { margin: 0 12px 10px; }
.p-top > .qline { margin: 0 12px 6px; font-size: .86em; }
.p-top > .qctl { margin: 0 12px 10px; }
.ask { margin: 6px 0 2px; padding: 7px 9px; border: 1px solid var(--stuck-line); border-radius: 8px; background: color-mix(in srgb, var(--stuck-bg) 60%, transparent); font-size: 13px; }
.ask span { display: block; overflow-wrap: anywhere; white-space: pre-wrap; }
.ask small { display: block; margin-top: 4px; color: var(--dim); font-size: 11px; }
.ask-b { display: flex; gap: 6px; margin-top: 6px; }
.ask-b button { flex: 1; padding: 5px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); font-weight: 600; }
.ask-b button.yes { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }
.sessb { width: auto; padding: 0 10px; color: var(--orange); border: 1px solid var(--orange); font-weight: 700; font-size: 13px; }
.sessb.wait { color: var(--red); border-color: var(--red); animation: needsglow 1.6s ease-in-out infinite; }
.panel.sess .p-acts { display: flex; align-items: center; gap: 8px; }
.sstate { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font-size: 12px; }
.sstate i, .sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray); display: inline-block; margin-right: 6px; }
.sstate i { margin: 0; }
.sstate.working i, .sdot.working { background: var(--green); }
.sstate.waiting i, .sdot.waiting { background: var(--red); }
.sstate.waiting { color: var(--red); }
.sapp { margin-right: 6px; font-size: 12px; white-space: nowrap; text-decoration: none; }
.p-body.sscr { display: block; margin: 0 max(6px, calc(var(--side) - 14px)); padding: 10px 12px; background: color-mix(in srgb, var(--bg) 70%, #000); border-radius: 8px; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--fg); }
.sscr > div { flex: none; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.45em; }
.sscr .sblank { min-height: .7em; }
.sscr .srule { min-height: 0; height: 0; border-top: 1px solid var(--line, #444); margin: .6em 0; }
.sscr .srule.ttl { height: auto; border: 0; display: flex; align-items: center; gap: 8px; color: var(--dim); }
.sscr .srule.ttl::before, .sscr .srule.ttl::after { content: ''; flex: 1; border-top: 1px solid var(--line, #444); }
.stype { flex: none; display: flex; gap: 6px; padding: 8px max(6px, calc(var(--side) - 14px)) 10px; }
.stype input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.stype button { padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-weight: 600; }
.stype .send { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }
.sesstab { border-color: var(--orange); }
.fchip { flex: none; padding: 0 6px; margin: 1px 6px 0 0; border-radius: 5px; background: var(--orange-soft); color: var(--orange); font-size: 12px; font-weight: 700; line-height: 18px; text-decoration: underline; text-underline-offset: 2px; vertical-align: 2px; }
.p-head h3 .fchip { font-size: 13px; }
.kids { margin: 4px 0 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--col); }
.kids-h { color: var(--dim); font-size: 12px; margin-bottom: 6px; }
.kid { display: flex; width: 100%; align-items: center; gap: 8px; padding: 6px 8px; margin: 3px 0; border-radius: 7px; background: var(--card); text-align: left; }
.kid i { flex: none; width: 16px; height: 16px; border: 1.5px solid var(--dim); border-radius: 4px; display: grid; place-items: center; font-style: normal; font-size: 11px; line-height: 1; }
.kid b { flex: none; color: var(--orange); font-size: 12px; font-weight: 600; }
.kid span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.kid small { flex: none; color: var(--dim); font-size: 11px; }
.kid.done { background: var(--green-soft); }
.kid.done i { background: var(--green); border-color: var(--green); color: var(--on-dot); }
.kid.done span { color: var(--dim); }
.kid-add input { width: 100%; margin-top: 4px; padding: 6px 8px; border: 1px dashed var(--line); border-radius: 7px; background: transparent; color: var(--fg); font: inherit; font-size: 13px; }
.kidn.all { color: var(--green); }
.card-title { flex: 1 1 auto; min-width: 0; text-align: left; font-weight: 500; overflow-wrap: break-word; }
.card-title .ctitle { display: inline; text-align: left; font-weight: inherit; overflow-wrap: normal; cursor: pointer; }
.card-title .fchip { display: inline; margin-right: 6px; }
.card-title .cbtns { float: right; display: flex; gap: 6px; margin: 0 0 2px 6px; }
.histb { font-size: 15px; }
.histb.on { background: var(--orange-soft); color: var(--orange); }
.hist .h-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 6px; }
.hist .h-tabs button { border: 1px solid var(--line); border-radius: 14px; padding: 3px 11px; font-size: 12px; color: var(--dim); }
.hist .h-tabs button[aria-pressed="true"] { border-color: var(--fg); color: var(--fg); }
.hist .h-note { font-size: 12.5px; color: var(--dim); margin: 4px 0 6px; }
.hist .h-day { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); margin: 12px 0 4px; }
.hist .h-ev { display: flex; gap: 9px; align-items: flex-start; padding: 4px 0; }
.hist .h-ev.old { opacity: .5; }
.hist .h-tm { flex: none; width: 40px; color: var(--dim); font-size: 12px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.hist .h-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; }
.hist .hq { color: var(--dim); }
.hd-me { background: var(--mine); } .hw-me { color: var(--mine); }
.hd-cl { background: var(--blue); } .hw-cl { color: var(--blue); }
.hd-bot { background: #a08cf5; } .hw-bot { color: #a08cf5; }
.hd-other { background: var(--by-claude); } .hw-other { color: var(--by-claude); }
.hc { display: inline-block; border-radius: 6px; padding: 0 7px; font-size: 12px; font-weight: 600; margin: 0 1px; }
.hc-you { background: var(--orange-soft); color: var(--orange); }
.hc-cl { background: color-mix(in srgb, var(--blue) 18%, transparent); color: var(--blue); }
.hc-done { background: var(--green-soft); color: var(--green); }
.hc-red { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.hc-plan { background: var(--card-hi); color: var(--fg); }
.tnum { white-space: nowrap; color: var(--dim); font-weight: 400; font-size: .86em; margin-right: .35em; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; margin: 6px 0; container-type: inline-size; }
.tablewrap table { border-collapse: collapse; font-size: .93em; width: 100%; }
.tablewrap th, .tablewrap td { border: 1px solid var(--line); padding: 5px 7px; vertical-align: top; text-align: left; overflow-wrap: normal; word-break: normal; }
.tablewrap th { background: var(--card-hi); font-weight: 700; }
@container (max-width: 520px) {
  .tablewrap table, .tablewrap tbody, .tablewrap thead, .tablewrap tfoot, .tablewrap tr, .tablewrap td, .tablewrap th { display: block; border: 0; width: auto; }
  .tablewrap tr.thead, .tablewrap thead { display: none; }
  .tablewrap tr { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; margin: 8px 0; background: var(--card); }
  .tablewrap td, .tablewrap th { padding: 2px 0; }
  .tablewrap td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
  .tablewrap tr > :first-child { display: inline; color: var(--orange); font-weight: 700; margin-right: .4em; }
  .tablewrap tr > :nth-child(2) { display: inline; }
  .tablewrap tr > :first-child::before, .tablewrap tr > :nth-child(2)::before { display: none; }
}
.comment img[data-att], .desc img[data-att] { cursor: zoom-in; }
#viewer .vw { position: fixed; inset: 0; z-index: 1000; background: rgba(8, 9, 10, .95); display: flex; flex-direction: column; color: #ececea; }
#viewer .vw-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
#viewer .vw-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#viewer .vw-name small { color: #a0a3a9; }
#viewer .vw-top button { border: 1px solid #3a3d42; border-radius: 7px; padding: 5px 11px; color: #ececea; }
#viewer .vw-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 4px 8px 16px; touch-action: pan-y pinch-zoom; }
#viewer .vw-stage img { -webkit-user-drag: none; user-select: none; max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; border-radius: 4px; }
#viewer .vw.big .vw-stage { display: block; overflow: auto; padding: 0; touch-action: auto; }
#viewer .vw.big .vw-stage img { max-width: none; max-height: none; cursor: zoom-out; }
#viewer .vw-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; background: rgba(42, 44, 48, .85); color: #ececea; font-size: 26px; line-height: 1; }
#viewer .vw-nav.prev { left: 10px; } #viewer .vw-nav.next { right: 10px; }
#viewer .vw.big .vw-nav { display: none; }
@media (max-width: 600px) { #viewer .vw-hint { display: none; } }
.meta { display: flex; flex-wrap: wrap; gap: .3em .8em; font-size: .86em; color: var(--dim); align-items: center; }
.meta .unread { color: var(--blue); font-weight: 600; }
.meta .late { color: var(--red); font-weight: 600; }
.meta .prio { border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; font-size: .92em; color: var(--fg); }
.meta .prio.p4 { border-color: var(--orange); color: var(--orange); }
.meta .prio.p5 { border-color: var(--orange); background: var(--orange); color: #1b1b1b; font-weight: 700; }
.meta .cwait { color: var(--orange); } .meta .cstarts { color: var(--blue); }
.clink { all: unset; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.chainbox { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.chainbox .ch-h { font-size: 12px; color: var(--dim); margin-bottom: 4px; }
.crow { all: unset; box-sizing: border-box; display: flex; gap: 7px; align-items: baseline; width: 100%; padding: 3px 2px; cursor: pointer; border-radius: 5px; }
.crow:hover { background: color-mix(in srgb, var(--fg) 6%, transparent); }
.crow i { flex: none; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--dim); font-size: 9px; font-style: normal; display: inline-flex; align-items: center; justify-content: center; position: relative; top: 2px; }
.crow.done i { background: var(--green); border-color: var(--green); color: var(--on-dot); }
.crow.now i { background: var(--orange); border-color: var(--orange); }
.crow.gone i { border-color: var(--red); color: var(--red); }
.crow b { flex: none; color: var(--dim); font-weight: 600; }
.crow span { flex: 1; min-width: 0; } .crow span small, .crow > small { color: var(--dim); }
.crow > small, .crow em { flex: none; font-size: 12px; } .crow em { color: var(--orange); font-style: normal; }
.crow.me span { font-weight: 600; } .crow.done span { color: var(--dim); }
.chainbox .cfoot { font-size: 13px; color: var(--dim); margin-top: 6px; }
.tpop .tl { font-size: 12px; color: var(--dim); margin: 10px 0 4px; } .tpop .tsmall { font-size: 12px; margin: 2px 0 4px; }
.tpop .tchips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.tpop .tchip { display: inline-flex; gap: 4px; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px 2px 7px; font-size: 13px; max-width: 100%; }
.tpop .tchip button { all: unset; cursor: pointer; color: var(--dim); padding: 0 4px; }
.tpop .tadd { width: 100%; box-sizing: border-box; }
.tpop .trow { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; } .tpop .trow .tchip { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.tpop .trow select { padding: 3px 4px; } .tpop .tx { color: var(--dim); padding: 0 6px; }
.tpop .tmore { border-top: 1px solid var(--line); padding-top: 8px; } .tpop .tmore > .linkbtn { color: var(--dim); }
.av { width: 1.8em; height: 1.8em; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 600 .84em var(--mono); background: var(--line); color: var(--fg); }
.av.claude { background: var(--orange-soft); color: var(--orange); }

.acts { display: flex; flex-wrap: wrap; align-items: center; gap: .3em; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { height: 2.15em; padding: 0 .5em; font-size: .86em; font-weight: 500; color: var(--dim); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--card-hi); color: var(--fg); }
.seg button[aria-pressed="true"] { background: var(--orange-soft); color: var(--orange); font-weight: 600; }
.seg button.sug:not([aria-pressed="true"]) { background: var(--green-soft); color: var(--green); font-weight: 600; box-shadow: inset 0 0 0 1px var(--green); }
.seg button.done[aria-pressed="true"] { background: var(--green-soft); color: var(--green); }
.seg.mdl button { padding: 0 .45em; min-width: 1.9em; }
/* (#415) Desktop cards: Plan/Do, Done, A S O and ⌄ on one line */
@media (min-width: 761px) { .card .acts { gap: .15em; } .card .seg button { padding: 0 .33em; } .card .seg.mdl button { min-width: 0; padding: 0 .3em; } .card .chev { width: 1.3em; } }
.seg button:focus-visible { outline-offset: -2px; }
.chev { margin-left: auto; width: 1.85em; height: 1.85em; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--dim); }
.chev:hover, .chev[aria-expanded="true"] { background: var(--card-hi); color: var(--fg); }

.thread { display: flex; flex-direction: column; gap: .7em; border-top: 1px solid var(--line); padding-top: .55em; cursor: auto; }
.thread .comment { font-size: .93em; }
.thread .comment .who { font-size: .86em; }
.thread .compose textarea, .thread .compose niu-box { font-size: .93em; }
.thread .attach, .thread .send { font-size: .86em; height: 2.3em; }
.older { align-self: flex-start; font-size: .86em; color: var(--dim); text-decoration: underline; text-underline-offset: 2px; }
.older:hover { color: var(--fg); }

.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 20; }
