/* ---------- Frame: the whole page is the chat (no top bar); only the feed scrolls. Details open in a drawer over it.
   Light/Dark mode is on Settings page (or key D). Demo states: ?state=day0; reset by clearing site data. ---------- */
.work.home { display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding: 0; }
.work.home .banners { margin: 12px 16px 0; }
.home-grid { flex: 1; min-height: 0; display: flex; }

/* ---------- The thread ---------- */
.thread { width: 100%; display: flex; flex-direction: column; min-height: 0; overflow: hidden; border: 0; border-radius: 0; }
.thread-head { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.thread-title { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.thread-title p { font-size: 14px; line-height: 1.4; color: var(--text2); }
.thread-body { flex: 1; min-height: 0; }
/* One reading-width column inside the chat, like a messenger; the plan, team and note use all of it */
.thread .cc-group, .thread .cc-typing, .thread .cc-earlier, .thread .cc-past, .thread .cc-daynav, .thread .cc-compose > * { width: 100%; max-width: 780px; margin-left: auto; margin-right: auto; }
.jump-btn.icon-only { padding: 0 9px; }
.jump-btn[aria-pressed="true"] { background: var(--sel); border-color: var(--accent); }
.thread .cc-card.cc-wide, .thread .cc-morning { max-width: none; }
/* The feed sits on the same dotted canvas as every other page, and no words sit on bare dots:
   ClickOn's lines get a white bubble (yours already have one), small lines get a plain backing like the page titles */
.thread .cc-feed { background-color: var(--bg); background-image: radial-gradient(var(--dots) 1.2px, transparent 1.2px); background-size: 22px 22px; }
.thread .is-crew > .cc-body > .cc-text, .thread .cc-typing-b { background: var(--surface); border: 1px solid var(--line); padding: 9px 13px; border-radius: 4px 14px 14px 14px; }
.thread .cc-head, .thread .cc-about, .thread .cc-done, .thread .cc-try .label { background: var(--bg); padding: 1px 5px; margin: 0 -5px; border-radius: 6px; }
.thread .cc-try .label { margin-right: 2px; }
.thread .cc-event { background: var(--bg); }

/* ---------- Drawer: an ad, a customer, the swap, the numbers, everything ClickOn can do ---------- */
.panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 55; width: min(420px, 100vw); overflow-y: auto; overscroll-behavior: contain; border-radius: 0; border-width: 0 0 0 1px;
  box-shadow: -14px 0 40px rgba(0, 0, 0, .14); transform: translateX(100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; }
.panel.is-open { transform: none; visibility: visible; transition: transform .2s ease; }
.panel-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.panel-head h2 { flex: 1; min-width: 0; font-size: 15px; }
.panel-body { padding: 0 20px 22px; }
.p-sec { display: flex; flex-direction: column; gap: 10px; padding: 16px 0; }
.p-sec + .p-sec { border-top: 1px solid var(--line); }
.p-sec > p { font-size: 13px; color: var(--text2); line-height: 1.5; }
.p-sec > p b { color: var(--ink); font-weight: 600; }
.p-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.p-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 13px/1.3 var(--f-body); cursor: pointer; text-align: left; }
.p-row:hover { border-color: var(--text3); }
.p-row > span:nth-child(2) { flex: 1; min-width: 0; }
.p-row > svg { flex: 0 0 14px; width: 14px; height: 14px; color: var(--text3); }
.p-empty { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); }
.p-empty svg { width: 18px; height: 18px; color: var(--pos); }
.p-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.p-rules li { display: flex; gap: 10px; font-size: 12.5px; line-height: 1.45; color: var(--text2); }
.p-rules li svg { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 1px; color: var(--accent); }
.p-rules b { color: var(--ink); font-weight: 600; }
.p-places { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.p-places li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.p-places li + li { border-top: 1px solid var(--line); }
.p-places li > svg { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 2px; color: var(--text2); }
.p-places .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 12px; color: var(--text3); line-height: 1.4; }
.p-places .t b { font-size: 13px; font-weight: 600; color: var(--ink); }
.p-who { display: flex; align-items: center; gap: 12px; }
.p-who h3 { font-size: 16px; line-height: 1.25; }
.p-who span.sub { font-size: 12px; color: var(--text3); }
.p-avatar { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken); color: var(--text2); font: 600 14px/1 var(--f-head); }
.p-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.p-dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; font-size: 12.5px; }
.p-dl dt { color: var(--text3); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.p-dl dd { margin: 0; color: var(--ink); line-height: 1.45; }
.p-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.p-nums div { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.p-nums div:nth-child(even) { border-left: 1px solid var(--line); }
.p-nums div:nth-child(n+3) { border-top: 1px solid var(--line); }
.p-nums span { font-size: 10.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); }
.p-nums b { font-family: var(--f-head); font-weight: 600; font-size: 20px; line-height: 1.2; }
.p-nums small { font-size: 11.5px; color: var(--text3); }
.p-box { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.5; }
.p-box b { font-weight: 600; }
.p-box .k { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); }
.p-msgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.p-msgs li { font-size: 12.5px; line-height: 1.45; color: var(--text2); }
.p-msgs li b { color: var(--ink); font-weight: 600; }
.p-msgs li .t { font-family: var(--f-mono); font-size: 11px; color: var(--text3); }
.p-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.p-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.p-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.p-table th, .p-table td { text-align: left; padding: 6px 6px 6px 0; border-bottom: 1px solid var(--line); }
.p-table th { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); }
.p-table td.n { font-family: var(--f-mono); font-size: 12px; white-space: nowrap; text-align: right; }
.p-table th.n { text-align: right; }
.p-table tr:last-child td { border-bottom: 0; }
.camp-row { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 12.5px; }
.camp-row .camp-pic { flex: 0 0 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; background: var(--tile, var(--sunken)); color: var(--note-ink); }
.camp-row .camp-pic svg { width: 18px; height: 18px; }
.camp-row .t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.camp-row .t b { font-weight: 600; font-size: 13px; }
.camp-row .t span { color: var(--text3); font-size: 11.5px; }
.camp-row .n { font-family: var(--f-mono); font-size: 11.5px; color: var(--text2); white-space: nowrap; }
.risk { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.risk li { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 12.5px; line-height: 1.45; color: var(--text2); }
.cmds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cmds li { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; }
.cmds li + li { border-top: 1px solid var(--line); }
.cmds .top { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.cmds .top b { font-size: 13px; font-weight: 600; }
.cmds .where { font-size: 11.5px; color: var(--text3); }
.cmds .row2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cmds .note { font-size: 12px; color: var(--text3); }
/* Quoted words in each language's quotes (the page's lang is set by assets/i18n.js) */
.cmds .cc-pill q, .p-msgs q { quotes: "“" "”"; }
html[lang="fr"] .cmds .cc-pill q, html[lang="fr"] .p-msgs q { quotes: "«\202F" "\202F»"; }
html[lang="de"] .cmds .cc-pill q, html[lang="de"] .p-msgs q { quotes: "„" "“"; }
html[lang="ru"] .cmds .cc-pill q, html[lang="ru"] .p-msgs q { quotes: "«" "»"; }
.panel-scrim { position: fixed; inset: 0; z-index: 54; background: rgba(23, 23, 26, .32); }
/* Chat history: one row per day */
.h-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.h-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.h-row:hover { background: var(--bg); border-color: var(--line); }
.h-row.is-current { background: var(--sel); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.h-row .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.35; }
.h-row .t b { font-size: 13px; font-weight: 600; }
.h-row .t span { font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-row .n { font-family: var(--f-mono); font-size: 11px; color: var(--text3); white-space: nowrap; }
.h-row > svg { flex: 0 0 14px; width: 14px; height: 14px; color: var(--text3); }

@media (max-width: 820px) {
  .work.home { height: auto; padding: 0; }
  .thread { height: calc(100dvh - var(--tabbar-space) - var(--side-h, 101px) - 2px); min-height: 420px; }
  .thread-head { padding: 10px 14px; gap: 8px; }
  .thread-title { flex-basis: 100%; }
  .thread-title p { font-size: 13px; }
  .panel { width: 100vw; border-width: 0; }
  .jump-btn { padding: 0 9px; font-size: 12px; }
  .panel-body { padding: 0 16px 22px; }
}
@media (prefers-reduced-motion: reduce) { .panel, .panel.is-open { transition: none; } }
/* Needs you, above the chat */
.needs-bar { padding: 10px 16px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.needs-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.needs-head b { font-family: var(--f-head); }
.needs-head span { font: 600 11px/1 var(--f-body); padding: 3px 7px; border-radius: 999px; background: var(--accent); color: var(--on-accent); }
.needs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.needs-list li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; min-width: 0; }
.needs-list .chip { flex: 0 0 auto; }
.needs-list .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.needs-more { margin-top: 4px; font-size: 12.5px; }
.needs-done { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 13px; color: var(--pos); }
.needs-done svg { width: 16px; height: 16px; }
