/* hearth Graphite. Dark, calm, plain-language. Customers follow their device: light tokens under .cust when it asks for light. */
:root {
  --bg: #1C1C1F;
  --side: #18181A;
  --card: #212124;
  --card-2: #252529;
  --raise: #2D2D32;
  --line: #2E2E33;
  --line-2: #3B3B41;
  --text: #EDEDEF;
  --text-2: #A3A3AB;
  --text-3: #8B8B93;
  --green: #5BD08A;
  --green-text: #5BD08A;
  --red: #FF7C7C;
  --yellow: #F2C94C;
  --peri: #8E9BFF;
  --mint: #6EDDA6;
  --btn-bg: #EDEDEF;
  --btn-fg: #161618;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
.light,
.cust-light {
  --bg: #F6F6F7;
  --side: #EEEEF0;
  --card: #FFFFFF;
  --card-2: #FAFAFB;
  --raise: #E4E4E8;
  --line: #E2E2E6;
  --line-2: #D2D2D8;
  --text: #1B1B1E;
  --text-2: #55555D;
  --text-3: #66666E;
  --green: #22A35A;
  --green-text: #177A43;
  --red: #C93636;
  --yellow: #B7860B;
  --btn-bg: #1B1B1E;
  --btn-fg: #FFFFFF;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { cursor: pointer; }
::placeholder { color: var(--text-3); opacity: 1; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.grow { flex: 1 1 auto; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* shell */
.app { min-height: 100vh; display: flex; }
.side { flex: 0 0 248px; background: var(--side); border-right: 1px solid var(--line); padding: 16px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.brand { display: flex; align-items: center; gap: 9px; padding: 2px 10px 10px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.brand svg { width: 20px; height: 20px; }
.brand .tag { font-size: 12px; font-weight: 500; color: var(--text-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 8px; letter-spacing: 0; }
.grp { font-size: 12.5px; color: var(--text-3); padding: 0 10px; margin: 12px 0 2px; }
.item { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border-radius: 8px; text-decoration: none; font-size: 14.5px; color: var(--text); }
.item svg { color: var(--text-2); }
.item:hover { background: var(--card); }
.item.on { background: var(--raise); }
.item .n { margin-left: auto; font-size: 12.5px; color: var(--text-2); }
.sub { margin: 2px 0 6px 17px; padding-left: 10px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.sub a { display: block; padding: 7px 10px; border-radius: 7px; color: var(--text-2); text-decoration: none; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub a.on { background: var(--raise); color: var(--text); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 6px 0; display: flex; flex-direction: column; gap: 10px; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); padding: 0 4px; }
.me { display: flex; align-items: center; gap: 10px; }
.av { width: 30px; height: 30px; border-radius: 8px; background: var(--raise); color: var(--text); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: none; }
.me .who { display: flex; flex-direction: column; line-height: 1.25; flex: 1 1 auto; min-width: 0; }
.me .who small { color: var(--text-3); font-size: 12.5px; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { color: var(--text); background: var(--card); }
.newc { margin: 0 2px 6px; justify-content: center; }

.main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 26px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-2); font-size: 15px; }
.crumbs b { color: var(--text); font-weight: 600; }
.crumbs .sep { color: var(--text-3); }
.content { padding: 6px 26px 32px; display: flex; flex-direction: column; gap: 16px; }
.mbar { display: none; }
@media (max-width: 760px) {
  .side { display: none; }
  .mbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--side); }
  .top { padding: 0 16px; min-height: 46px; }
  .content { padding: 4px 16px 24px; }
}

/* type + parts */
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); min-height: 34px; }
.eyebrow .live { display: inline-flex; align-items: center; gap: 7px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text-3); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.dot.ok { background: var(--green); }
.dot.warn { background: var(--yellow); }
.dot.bad { background: var(--red); }
.dot.on { background: var(--text); }
.dot.idle { border: 1.5px solid var(--text-2); width: 9px; height: 9px; }
.dot.off { border: 1.5px dashed var(--text-3); width: 9px; height: 9px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.pad { padding: 16px 18px; }
.ttl { font-size: 15px; font-weight: 600; }
.lead { margin: 0; font-size: 14.5px; line-height: 1.6; max-width: 112ch; text-wrap: pretty; }
.btn { font: inherit; font-size: 13.5px; font-weight: 600; min-height: 34px; padding: 0 14px; border-radius: 999px; background: var(--btn-bg); color: var(--btn-fg); border: 0; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--text); padding: 0 8px; font-weight: 500; }
.btn.ghost svg { color: var(--text-2); }
.btn.line { background: transparent; color: var(--text); border: 1px solid var(--line-2); }
.btn.danger { background: transparent; color: var(--red); border: 1px solid var(--line-2); }
.link { color: var(--text-2); text-decoration: none; font-size: 14px; display: inline-flex; align-items: center; min-height: 34px; }
.link:hover { color: var(--text); }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg > * { font: inherit; font-size: 14px; color: var(--text-2); background: transparent; border: 0; border-radius: 7px; min-height: 30px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-decoration: none; }
.seg > .on { background: var(--raise); color: var(--text); }
.seg > .dis { color: var(--text-3); text-decoration: line-through; cursor: not-allowed; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.field { font: inherit; font-size: 14px; background: var(--side); border: 1px solid var(--line-2); border-radius: 9px; min-height: 36px; padding: 0 12px; color: var(--text); }
.light .field, .cust-light .field { background: var(--card); }
.field:focus { outline: 2px solid var(--line-2); outline-offset: 1px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 1px 9px; border-radius: 999px; background: var(--raise); color: var(--text-2); white-space: nowrap; }
.pill.ok { background: rgba(91, 208, 138, 0.14); color: var(--green-text); font-weight: 700; letter-spacing: 0.07em; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }
.stat { display: flex; flex-direction: column; gap: 0; }
.stat .n { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.stat .l { font-size: 13px; color: var(--text-2); }
.bar { height: 5px; background: var(--raise); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.under-red { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.trace { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 14.5px; line-height: 1.55; }
.trace li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; }
.trace li .dot { margin-top: 7px; }
.trace li.dim { color: var(--text-2); }

/* chat */
.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.msg { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
.msg .who { display: flex; align-items: baseline; gap: 8px; font-weight: 600; font-size: 14px; }
.msg .who time { color: var(--text-3); font-weight: 400; font-size: 12.5px; }
.msg .body { font-size: 15px; line-height: 1.62; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.msg .body p { margin: 0; }
.msg .av.bot { background: transparent; border: 1px solid var(--line-2); }
.msg .av.bot svg { width: 16px; height: 16px; }
.meta { color: var(--text-3); font-size: 12.5px; }
.code { background: var(--side); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.light .code, .cust-light .code { background: var(--card-2); }
.code .h { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 2px 12px; border-bottom: 1px solid var(--line); color: var(--text-3); font-size: 12px; }
.code pre { margin: 0; padding: 10px 12px; font: 13px/1.55 var(--mono); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.cmd { font: 13px var(--mono); background: var(--raise); border-radius: 6px; padding: 2px 7px; }
.rcard .h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.rcard .row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border-top: 1px solid var(--line); text-decoration: none; }
.rcard .row:first-of-type { border-top: 0; }
.composer { border: 1px solid var(--line-2); border-radius: 14px; background: var(--card); }
.composer textarea { display: block; width: 100%; font: inherit; font-size: 15px; background: transparent; color: var(--text); border: 0; resize: none; padding: 14px 16px 6px; }
.composer textarea:focus { outline: none; }
.composer .foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px 8px 12px; }
.chip { font: 12.5px var(--mono); color: var(--text-2); background: transparent; border: 1px solid var(--line); border-radius: 7px; min-height: 28px; padding: 0 8px; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.frame canvas { width: 100%; aspect-ratio: 1; display: block; image-rendering: pixelated; border-radius: 8px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* tools graph */
.graph-wrap { overflow-x: auto; }
.graph { min-width: 900px; display: grid; grid-template-columns: 170px 56px 176px minmax(70px, 1fr) minmax(330px, 1.5fr); align-items: center; padding: 8px 0; }
.node { border: 1px solid var(--line-2); border-radius: 12px; background: var(--card-2); padding: 14px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.node.hub { border: 1.5px solid var(--text); }
.node svg { width: 24px; height: 24px; }
.node b { font-size: 15px; }
.hline { height: 1px; background: var(--line-2); }
.tools-list { display: flex; flex-direction: column; gap: 10px; }
.tool { height: 60px; border: 1px solid var(--line); border-radius: 10px; background: var(--card-2); padding: 0 14px; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.tool.on { border: 1.5px solid var(--text); }
.tool .r1 { display: flex; align-items: center; gap: 10px; }
.tool .r1 b { font-size: 15px; font-weight: 600; }
.tool .r2 { color: var(--text-2); font-size: 13.5px; padding-left: 19px; }
.curves { width: 100%; height: 410px; display: block; }
.curves path { fill: none; stroke: var(--line-2); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.curves path.hot { stroke: var(--green); stroke-width: 1.6; }

/* people */
.list-row { display: grid; grid-template-columns: 34px minmax(160px, 1.1fr) minmax(0, 1.4fr) minmax(150px, auto) auto; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); }
.card > .list-row:first-child, .card > div:first-child > .list-row { border-top: 0; }
.list-row .nm { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.list-row .nm b { font-size: 15px; font-weight: 600; }
.list-row .acts { display: flex; gap: 4px; justify-content: flex-end; }
.av.inv { background: transparent; border: 1.5px dashed var(--line-2); color: var(--text-2); }
@media (max-width: 1000px) { .list-row { grid-template-columns: 34px minmax(0, 1fr); } .list-row > :nth-child(n+3) { grid-column: 2; } .list-row .acts { justify-content: flex-start; } }
.confirm { border: 1px solid rgba(255, 124, 124, 0.45); background: rgba(255, 124, 124, 0.07); border-radius: 10px; padding: 12px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 16px 14px 64px; }

/* usage */
.stats4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats4 > div { padding: 16px 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.stats4 > div:nth-child(-n+2) { border-top: 0; }
.stats4 > div:nth-child(odd) { border-right: 1px solid var(--line); }
.chart { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; height: 260px; }
.yax { display: flex; flex-direction: column; justify-content: space-between; color: var(--text-3); font-size: 12px; text-align: right; padding-bottom: 22px; }
.plot { position: relative; display: flex; align-items: flex-end; gap: 10px; padding-bottom: 22px; background: repeating-linear-gradient(to top, var(--line) 0 1px, transparent 1px 25%); background-size: 100% calc(100% - 22px); background-repeat: no-repeat; }
.col { flex: 1 1 0; display: flex; flex-direction: column-reverse; gap: 2px; position: relative; height: 100%; justify-content: flex-start; }
.col i { display: block; border-radius: 3px; }
.col span { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.legend { display: flex; flex-direction: column; gap: 14px; }
.legend .row { display: flex; flex-direction: column; gap: 6px; }
.legend .row .t { display: flex; align-items: center; gap: 8px; }
.sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.side { min-width: 0; width: 248px; overflow: hidden; }
@media (max-width: 760px) { .crumbs > span, .crumbs .sep { display: none; } }

/* ---------- app additions ---------- */
html, body { min-height: 100%; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--text-2); outline-offset: 2px; }
.btn.sm { min-height: 30px; font-size: 13px; padding: 0 10px; }
.err { color: var(--red); }
.ok-text { color: var(--green-text); }
.center-msg { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-2); text-align: center; padding: 24px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 8px 26px; font-size: 13.5px; background: var(--card); border-bottom: 1px solid var(--line); color: var(--text-2); }
.banner.bad { color: var(--red); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--btn-bg); color: var(--btn-fg); border-radius: 999px; padding: 8px 16px; font-size: 13.5px; font-weight: 600; z-index: 60; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35); }
.item .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
.sub a { cursor: pointer; }
.thread-wrap { min-height: 40vh; }
.empty-chat { padding: 40px 0 20px; display: flex; flex-direction: column; gap: 8px; }
.empty-chat h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.caret { display: inline-block; width: 7px; height: 15px; background: var(--text-2); vertical-align: -2px; margin-left: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }
.msg .body ul, .msg .body ol { margin: 0; padding-left: 1.3em; }
.msg .body code.inl { font: 13px var(--mono); background: var(--raise); border-radius: 5px; padding: 1px 5px; }
.drawer-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 40; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); z-index: 41; display: flex !important; overflow-y: auto; }

/* ---------- sign-in sheet (one card on a lit stage) ---------- */
.signin-page { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: max(32px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: radial-gradient(1200px 500px at 50% -10%, rgba(255, 255, 255, 0.035), transparent 70%), var(--bg); }
.sheet { width: 100%; max-width: 980px; background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); overflow: hidden; }
.cust-light .sheet { box-shadow: 0 24px 60px rgba(20, 20, 30, 0.12); }
.sheet-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.sheet-h h1 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.hpill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border: 1px solid var(--line-2); border-radius: 9px; font-size: 13.5px; color: var(--text-2); min-width: 0; max-width: 100%; }
.hpill b { color: var(--text); font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sheet-b { display: grid; grid-template-columns: minmax(0, 452px) minmax(0, 1fr); gap: 34px; padding: 24px 24px 28px; align-items: stretch; }
@media (max-width: 860px) { .sheet-b { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; padding: 20px 18px 24px; } .stage { padding: 22px 16px 18px; } .pname { font-size: 28px; } }
.sheet-f { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 24px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px; }

/* The stage: a softly lit panel in the portal's colour, the card centred near the top, extras below. */
.stage { --glow: rgba(255, 255, 255, 0.06); --dots: rgba(255, 255, 255, 0.055); position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: 30px 26px 26px; border-radius: 14px; border: 1px solid var(--line); background: var(--side); }
.stage.emp { --glow: rgba(214, 151, 72, 0.24); }
.stage.cus { --glow: rgba(84, 190, 170, 0.2); }
.cust-light .stage { --dots: rgba(20, 20, 30, 0.08); --glow: rgba(84, 190, 170, 0.22); background: #F1F2F3; }
.stage::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(var(--dots) 1px, transparent 1.3px) 0 0 / 16px 16px;
  -webkit-mask-image: radial-gradient(75% 65% at 50% 42%, #000 25%, transparent 100%); mask-image: radial-gradient(75% 65% at 50% 42%, #000 25%, transparent 100%); }
.stage-card { position: relative; }
.stage-card::before { content: ""; position: absolute; inset: -44px -40px; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, var(--glow), transparent); }
.stage-more { display: flex; flex-direction: column; gap: 16px; }
.stage .health { background: var(--card); }
.cust-light .stage .health { background: #FFFFFF; }

.pcard { position: relative; width: 100%; min-height: 272px; border-radius: 16px; border: 1px solid var(--line-2); padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; text-align: left; color: var(--text); font: inherit;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 24px 50px rgba(0, 0, 0, 0.5); }
.pcard.emp { background: radial-gradient(140% 120% at 100% 0%, rgba(214, 151, 72, 0.22), transparent 55%), #222124; }
.pcard.cus { background: radial-gradient(140% 120% at 100% 0%, rgba(84, 190, 170, 0.2), transparent 55%), #212325; }
.cust-light .pcard.cus { background: radial-gradient(140% 120% at 100% 0%, rgba(84, 190, 170, 0.22), transparent 55%), #FFFFFF; box-shadow: 0 22px 50px rgba(20, 20, 30, 0.14); }

/* The form column: a short greeting, the form, and (customers) the invitation opener. */
.side-h h2 { margin: 0 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -0.015em; }
.side-h p { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.55; text-wrap: pretty; }
.invite-inline { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.invite-toggle { font: inherit; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 11px; background: transparent; color: var(--text); text-align: left; }
.invite-toggle:hover { background: var(--card-2); }
.invite-toggle > svg { color: #5CC9B3; }
.cust-light .invite-toggle > svg { color: #1F8A75; }
.invite-toggle .t { flex: 1 1 auto; min-width: 0; font-size: 14.5px; }
.invite-toggle .chev { display: inline-flex; color: var(--text-3); transition: transform 0.15s; }
.invite-inline.open .invite-toggle .chev { transform: rotate(90deg); }
.invite-box { display: flex; flex-direction: column; gap: 10px; }
.invite-box p { margin: 0; font-size: 14px; }
.invite-box .field { flex: 1 1 auto; min-width: 0; min-height: 40px; }
.invite-box .btn { min-height: 40px; }
.invite-box .err { margin: 0; font-size: 13.5px; }
@media (prefers-reduced-motion: reduce) { .invite-toggle .chev { transition: none; } }
.pcard-top { display: flex; align-items: center; gap: 12px; }
.picon { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
.picon svg { width: 20px; height: 20px; }
.emp .picon { border: 1.5px solid rgba(214, 151, 72, 0.7); color: #E2A660; background: rgba(214, 151, 72, 0.1); }
.cus .picon { border: 1.5px solid rgba(84, 190, 170, 0.7); color: #5CC9B3; background: rgba(84, 190, 170, 0.1); }
.cust-light .cus .picon { color: #1F8A75; }
.cust-light .emp .picon { color: #A86A1E; }
.pcard-top .who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.pcard-top .who b { font-size: 17px; font-weight: 600; }
.pcard-top .who small { color: var(--text-2); font-size: 13px; }
.ppill { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.ppill.ok { border-color: rgba(91, 208, 138, 0.55); color: var(--green-text); background: rgba(91, 208, 138, 0.1); }
.ppill.bad { border-color: rgba(255, 124, 124, 0.55); color: var(--red); background: rgba(255, 124, 124, 0.08); }
.plabel { margin-top: 26px; font: 600 11.5px/1 var(--mono); letter-spacing: 0.12em; color: var(--text-3); }
.pname { font: 700 36px/1.15 var(--mono); letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 42px; }
.pname.empty { color: var(--text-3); }
.ptag { align-self: flex-start; font: 700 11px/1 var(--mono); letter-spacing: 0.12em; padding: 5px 8px; border-radius: 5px; }
.emp .ptag { color: #E2A660; border: 1px solid rgba(214, 151, 72, 0.55); background: rgba(214, 151, 72, 0.08); }
.cus .ptag { color: #5CC9B3; border: 1px solid rgba(84, 190, 170, 0.55); background: rgba(84, 190, 170, 0.08); }
.cust-light .cus .ptag { color: #1F7A68; }
.cust-light .emp .ptag { color: #8E5916; }
.pfoot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 18px; }
.pmeta { font: 600 11.5px/1.6 var(--mono); letter-spacing: 0.1em; color: var(--text-2); text-transform: uppercase; }
.ring { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ring svg { width: 62px; height: 62px; }
.ring .lbl { font: 600 10.5px/1 var(--mono); letter-spacing: 0.12em; color: var(--text-2); }

.side-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.sess { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; font-size: 14px; color: var(--text-2); }
.sess b { color: var(--text); font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
.sess .bar { height: 6px; }
.health { border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--card-2); }
.health .h { display: flex; align-items: center; gap: 10px; }
.health .h .lbl { font: 600 11.5px/1 var(--mono); letter-spacing: 0.12em; color: var(--text-2); }
.sig { margin-left: auto; display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.sig i { width: 3px; border-radius: 1px; background: var(--line-2); display: block; }
.sig i.on { background: var(--green); }
.sig-t { font-size: 13.5px; font-weight: 600; color: var(--green-text); }
.sig-t.bad { color: var(--red); }
.strip { display: flex; align-items: flex-end; gap: 2px; height: 26px; }
.strip i { flex: 1 1 0; border-radius: 1.5px; background: var(--green); display: block; min-height: 3px; }
.strip i.bad { background: var(--red); }
.strip i.none { background: var(--line); }
.axis { display: flex; justify-content: space-between; font: 11px/1 var(--mono); color: var(--text-3); }
.hstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hstats div { display: flex; flex-direction: column; gap: 2px; }
.hstats span { font-size: 12.5px; color: var(--text-3); }
.hstats b { font: 600 14px/1.3 var(--mono); }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label > span, .form .lab { font-size: 13px; color: var(--text-2); }
.form .field { min-height: 40px; width: 100%; }
.pw { display: flex; gap: 6px; }
.pw .icon-btn { width: 40px; height: 40px; flex: none; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--green); }
.note { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.note svg { margin-top: 2px; color: var(--text-3); }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.actions .btn { min-height: 40px; padding: 0 18px; }
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.rules li { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.rules li.met { color: var(--text); }

/* ---------- phone and narrow widths ---------- */
/* Card text truncates instead of running under the badges. */
.pcard-top .who { flex: 1 1 auto; min-width: 0; }
.pcard-top .who b, .pcard-top .who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppill { flex: none; }
.top { flex-wrap: wrap; }
.usage-chart-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; align-items: start; }
.cust-conv-grid { grid-template-columns: 300px minmax(0, 1fr); }
@media (max-width: 900px) {
  .usage-chart-grid, .cust-conv-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .signin-page { align-items: flex-start;
    padding: max(12px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .sheet { border-radius: 14px; }
  .sheet-h, .sheet-f { padding: 14px 16px; }
  .sheet-b { display: flex; flex-direction: column; padding: 16px 14px 22px; gap: 20px; }
  /* The stage dissolves on phones: card, then the form, then the meters. */
  .stage { display: contents; }
  .stage::before, .stage-card::before { display: none; }
  .stage-card { order: 1; }
  .side-col { order: 2; }
  .stage-more { order: 3; margin-top: 0; }
  .stage .health { background: var(--card-2); }
  .pcard { min-height: 0; padding: 16px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); }
  .cust-light .pcard.cus { box-shadow: 0 10px 26px rgba(20, 20, 30, 0.1); }
  .pname { font-size: 26px; min-height: 32px; }
  .pcard-top { align-items: flex-start; }
  .pcard-top .who small { white-space: normal; overflow-wrap: anywhere; }
  .plabel { margin-top: 16px; }
  .pfoot { padding-top: 12px; }
  .ring svg { width: 52px; height: 52px; }
  .hpill { font-size: 12.5px; }
  .side-h h2 { font-size: 20px; }
  .sheet-f { flex-direction: column; align-items: flex-start; gap: 6px; }
  .sheet-f .grow { display: none; }
  .actions .btn { width: 100%; justify-content: center; }
  .stats4 { grid-template-columns: minmax(0, 1fr); }
  .stats4 > div { border-right: 0 !important; border-top: 1px solid var(--line) !important; }
  .stats4 > div:first-child { border-top: 0 !important; }
  .eyebrow label .field { width: 100% !important; }
  .eyebrow label { flex: 1 1 100%; }
  .chart { height: 220px; grid-template-columns: 34px minmax(0, 1fr); }
  .plot { gap: 4px; }
  .msg { grid-template-columns: 26px minmax(0, 1fr); gap: 10px; }
  .msg .av { width: 26px; height: 26px; }
}
.pcard-top { width: 100%; }
.composer .foot > button[type="submit"] { margin-left: auto; }
.composer .chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.link.crumb { font-size: 15px; min-height: 0; }

/* ---------- usage page (analytics) ---------- */
.u-wrap { padding: 22px 26px 40px; }
.u-panel { background: #19191C; border: 1px solid #2B2B30; border-radius: 22px; padding: 30px 32px 34px; display: flex; flex-direction: column; gap: 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); }
.u-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 24px; }
.u-head h1 { margin: 0 0 6px; font-size: 32px; font-weight: 500; letter-spacing: -0.02em; }
.u-head p { margin: 0; font-size: 16px; color: var(--text-2); max-width: 78ch; text-wrap: pretty; }
.u-seg { margin-left: auto; display: inline-flex; padding: 4px; gap: 4px; border-radius: 13px; background: #202024; border: 1px solid #2B2B30; }
.u-seg button { font: inherit; font-size: 15px; min-height: 38px; padding: 0 16px; border-radius: 9px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.u-seg button.on { background: #2E2E33; color: var(--text); }
.u-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 34px 40px; align-items: start; }
@media (max-width: 1100px) { .u-grid { grid-template-columns: minmax(0, 1fr); } }
.u-sec h2 { margin: 0 0 4px; font-size: 16.5px; font-weight: 500; }
.u-sec .u-sub { margin: 0 0 14px; font-size: 13.5px; color: var(--text-3); }
.u-box { background: #1D1D21; border: 1px solid #2B2B30; border-radius: 14px; }
.u-chart { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 10px; }
.u-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.u-chart .say { font-size: 15px; color: var(--text); }
.u-chart svg text { fill: var(--text-3); font: 12.5px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.weeks { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.wk { font: inherit; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 12px; padding: 10px 8px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; }
.wk.on { background: #202024; border-color: #2E2E33; }
.wk .pct { font-size: 12.5px; color: var(--text-2); }
.wk .track { width: 100%; max-width: 64px; height: 92px; background: #232327; border-radius: 6px; position: relative; overflow: hidden; }
.wk .fill { position: absolute; left: 0; right: 0; bottom: 0; background: #6E6E75; border-radius: 6px 6px 0 0; }
.wk.on .fill { background: #D9D9DE; }
.wk .over { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: #FFFFFF; }
.wk .lbl { font-size: 12.5px; color: var(--text-2); }
.wk.on .lbl { color: var(--text); }
.ubar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 3px; background: transparent; }
.ubar i { display: block; height: 100%; }
.legend-row { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; font-size: 14.5px; color: var(--text-2); }
.legend-row span { display: inline-flex; align-items: center; gap: 8px; }
.legend-row b { color: var(--text); font-weight: 500; }
.legend-row i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.big { padding: 6px 18px 12px; }
.big .row { padding: 12px 0 2px; display: flex; flex-direction: column; gap: 8px; }
.big .head { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.big .head .pct { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.big .tag { white-space: nowrap; flex: none; font-size: 11.5px; color: var(--text-3); background: #26262A; border-radius: 6px; padding: 1px 7px; }
.big .bar { height: 5px; background: #26262A; }
.big .bar i { background: #4C8DF6; }
.big .head > span:first-child { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk .lbl { white-space: nowrap; }

@media (max-width: 640px) { .u-wrap { padding: 12px 12px 28px; } .u-panel { padding: 20px 16px 22px; border-radius: 16px; gap: 20px; } .u-head h1 { font-size: 26px; } .u-head p { font-size: 14.5px; } .u-seg { margin-left: 0; } .weeks { gap: 4px; } .wk { padding: 8px 2px 6px; } .wk .pct, .wk .lbl { font-size: 11px; } }
.u-chart svg text.pt { fill: #EDEDEF; font-size: 13.5px; }
@media (max-width: 640px) {
  .u-chart { padding: 12px 10px 10px; }
  .u-chart svg text { font-size: 16.5px; }
  .u-chart svg text.pt { font-size: 18.5px; }
}

/* ---------- phones: iPhone and Android ---------- */
/* Fill the height people can actually see (iOS Safari's bars, Android's keyboard) and keep clear of
   the notch, the rounded corners and the home bar. env() is 0 elsewhere, so desktops are unchanged. */
html { text-size-adjust: 100%; color-scheme: dark; }
/* Native controls (checkboxes, scrollbars, pickers) follow the page's theme class, not just the device. */
html.cust-light { color-scheme: light; }
.app { min-height: 100vh; min-height: 100dvh; }
.center-msg { min-height: 60vh; min-height: 60dvh; }
.side { padding-left: max(12px, env(safe-area-inset-left)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.main { padding-right: env(safe-area-inset-right); }
.drawer { padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); padding-left: max(12px, env(safe-area-inset-left)); overscroll-behavior: contain; }
.toast { bottom: calc(22px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); }
/* Wide screens and phones on their side: the sidebar stays put while a long conversation scrolls. */
.side:not(.drawer) { position: sticky; top: 0; align-self: flex-start; height: 100vh; height: 100dvh; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 760px) {
  .mbar { position: sticky; top: 0; z-index: 30; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); }
  .main { padding-right: 0; }
  .top, .content, .banner { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .content { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .u-wrap { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  /* Segmented filters scroll sideways inside themselves instead of pushing the page wider. */
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg > * { flex: none; }
  .composer .chips { flex: 1 1 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-right: 18px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent); }
  .composer .chips::-webkit-scrollbar { display: none; }
  .composer .chip { flex: none; }
  .list-row .acts-none { display: none; }
  .confirm { margin: 0 12px 12px; }
  /* New invite: one row per field, buttons share the last row. */
  .invite-form > label, .invite-form > fieldset { flex: 1 1 100%; }
  .invite-form > label > span:first-child, .invite-form > fieldset > span.muted { width: 52px; flex: none; }
  .invite-form > label .field { flex: 1 1 auto; width: auto !important; min-width: 0; }
  .invite-form > .grow { display: none; }
  .invite-form > button { flex: 1 1 0; justify-content: center; }
}
/* Touch: 16 px text in fields so iPhone Safari doesn't zoom in, and 44 px targets.
   Short viewports count too: that is a phone on its side. */
@media (max-width: 760px), (pointer: coarse), (max-height: 500px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select, .field, .composer textarea { font-size: 16px; }
  .field, .form .field, .invite-box .field { min-height: 44px; }
  .icon-btn, .pw .icon-btn { width: 44px; height: 44px; }
  .btn, .btn.sm, .invite-box .btn, .actions .btn { min-height: 44px; }
  .chip { min-height: 44px; padding: 0 12px; }
  .seg > * { min-height: 44px; }
  .u-seg button { min-height: 44px; }
  .item { min-height: 44px; }
  .sub a { padding-top: 12px; padding-bottom: 12px; }
  .link, .link.crumb, .crumbs a { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; }
  .link-pill { min-height: 44px; padding: 0 14px; font-size: 13px; }
  .composer .foot > button[type="submit"] { min-width: 44px; justify-content: center; }
  .check { min-height: 44px; }
  .check input { width: 20px; height: 20px; }
}

/* The message box stays at the bottom of the window while a conversation scrolls above it. */
.composer-dock { position: sticky; bottom: 0; z-index: 4; display: flex; flex-direction: column; gap: 8px; margin-top: -6px; padding: 14px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--bg) 14px); }
.composer-dock .err { margin: 0; }

/* ---------- customer conversations: the sidebar keeps the newest 3, the rest open in a pop-up ---------- */
.item.more .t { color: var(--text-2); }
.item.more.on .t { color: var(--text); }
.item .count { margin-left: auto; font-size: 12px; color: var(--text-2); background: var(--raise); border-radius: 999px; padding: 0 8px; min-width: 24px; text-align: center; flex: none; }
.item.on .count { background: var(--card-2); }
.item .reply-dot + .count { margin-left: 0; }
button.item { font: inherit; width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer; }
.newc.off { opacity: 0.5; cursor: not-allowed; }
.full-note { margin: -2px 4px 6px; padding: 0 8px; font-size: 12.5px; line-height: 1.45; color: var(--text-3); }

html.modal-open { overflow: hidden; }
.cl-dlg { padding: 0; margin: auto; width: min(580px, calc(100vw - 32px)); max-width: none; max-height: min(680px, calc(100vh - 64px)); max-height: min(680px, calc(100dvh - 64px));
  background: var(--card); color: var(--text); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); overflow: hidden; overscroll-behavior: contain; }
.cl-dlg[open] { display: flex; flex-direction: column; }
.cl-dlg::backdrop { background: rgba(0, 0, 0, 0.5); }
.light .cl-dlg::backdrop, .cust-light .cl-dlg::backdrop { background: rgba(20, 20, 30, 0.28); }
.light .cl-dlg, .cust-light .cl-dlg { box-shadow: 0 24px 60px rgba(20, 20, 30, 0.18); }
.cl-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px 20px; }
.cl-h h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.cl-s { padding: 0 18px 10px 20px; }
.cl-search { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 12px; background: var(--side); border: 1px solid var(--line-2); border-radius: 9px; color: var(--text-2); }
.light .cl-search, .cust-light .cl-search { background: var(--card); }
.cl-search:focus-within { outline: 2px solid var(--line-2); outline-offset: 1px; }
.cl-search input { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 14px; color: var(--text); background: transparent; border: 0; outline: 0; padding: 8px 0; -webkit-appearance: none; appearance: none; }
.cl-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.cl-b { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 8px 10px; }
.cl-b ul { list-style: none; margin: 0; padding: 0; }
.cl-note { margin: 0; padding: 0 12px 4px; font-size: 13px; color: var(--text-3); }
.cl-grp { margin: 14px 0 4px; padding: 0 12px; font-size: 12.5px; font-weight: 400; color: var(--text-3); }
.cl-row { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14.5px; }
.cl-row:hover { background: var(--card-2); }
.cl-row.on { background: var(--raise); }
.cl-row .t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-row .n { flex: none; font-size: 12.5px; color: var(--text-2); }
.cl-row .reply-dot { margin-left: 0; }
.cl-f { display: flex; align-items: center; gap: 12px; padding: 12px 18px 14px 20px; border-top: 1px solid var(--line); }
.cl-f .btn:disabled { opacity: 0.5; }
.cl-meter { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--text-2); }
.cl-meter > span:last-child { flex: 1 1 auto; min-width: 0; }
.cl-meter b { color: var(--text); font-weight: 600; }
.cl-bar { flex: 0 0 120px; height: 5px; background: var(--raise); border-radius: 99px; overflow: hidden; }
.cl-bar i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.cl-meter.full .cl-bar i { background: var(--yellow); }
.cl-limit { margin-top: 32px; max-width: 560px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.cl-limit h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.cl-limit p { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.cl-limit .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* search, filter, sort, select */
.cl-kbd { font: 600 11.5px var(--mono); color: var(--text-3); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; height: 20px; display: inline-flex; align-items: center; flex: none; }
.cl-tools { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.cl-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cl-chip { font: inherit; font-size: 13px; min-height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.cl-chip.on { background: var(--raise); border-color: transparent; color: var(--text); }
.cl-chip .reply-dot { margin: 0; width: 7px; height: 7px; box-shadow: none; }
/* shared.css (loaded after this file) sizes every select.field; the toolbar's sort is smaller on desktop */
.cl-tools select.field.cl-sort { min-height: 30px; font-size: 13px; padding-left: 10px; flex: none; }
.cl-all { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 0 12px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.cl-all input, .cl-row.pick input { width: 17px; height: 17px; margin: 0; accent-color: var(--btn-bg); flex: none; }
.cl-row.pick { cursor: pointer; }
.cl-row.pick.on { background: var(--card-2); }
.cl-li { position: relative; }
.cl-acts { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: none; gap: 2px; padding-left: 8px; background: var(--card-2); border-radius: 8px; }
.cl-acts .icon-btn { width: 30px; height: 30px; border-color: transparent; }
.cl-acts .icon-btn:hover { background: var(--raise); }
@media (hover: hover) and (pointer: fine) {
  .cl-li.edit:hover .cl-acts, .cl-li.edit:focus-within .cl-acts { display: flex; }
  .cl-li.edit:hover .cl-row, .cl-li.edit:focus-within .cl-row:not(.on) { background: var(--card-2); }
}
@media (hover: none), (pointer: coarse) { .cl-kbd { display: none; } }
.cl-rename { display: flex; align-items: center; gap: 6px; padding: 3px 6px; }
.cl-rename .field { flex: 1 1 auto; min-width: 0; min-height: 34px; }
.cl-ask { flex: 1 1 auto; min-width: 0; font-size: 13.5px; color: var(--text-2); }
.cl-confirm .cl-ask { color: var(--text); }
.btn.danger-fill { background: var(--red); color: #1F0909; }
.light .btn.danger-fill, .cust-light .btn.danger-fill { background: #C93636; color: #fff; }
.btn.danger:disabled, .btn.danger-fill:disabled { opacity: 0.5; cursor: not-allowed; }

/* Phones: a sheet from the bottom of the screen; a phone on its side gets the whole screen. */
@media (max-height: 500px) {
  .cl-dlg { width: 100%; max-height: none; height: 100vh; height: 100dvh; margin: 0; border-radius: 0; border: 0;
    padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
}
@media (max-width: 760px), (max-height: 500px), (pointer: coarse) {
  .cl-f .btn { justify-content: center; }
  .cl-chip { min-height: 44px; padding: 0 13px; }
  .cl-tools select.field.cl-sort { min-height: 44px; font-size: 16px; }
  .cl-search { min-height: 44px; }
  .cl-search input { font-size: 16px; min-height: 42px; }
  .cl-row { min-height: 46px; }
  .cl-all { min-height: 44px; }
  .cl-all input, .cl-row.pick input { width: 20px; height: 20px; }
  .cl-rename { flex-wrap: wrap; }
  .cl-rename .field { flex-basis: 100%; min-height: 44px; }
  .cl-f:has(.cl-ask) { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .cl-confirm .cl-ask { flex-basis: 100%; }
  .cl-f:has(.cl-ask) .btn { flex: 1 1 auto; }
}
@media (max-width: 760px) {
  .cl-dlg { width: 100%; max-height: none; height: calc(100vh - 56px); height: calc(100dvh - 56px); margin: auto 0 0; border-radius: 18px 18px 0 0; border-bottom: 0; }
  .cl-h { padding: 14px 14px 10px 18px; }
  .cl-s { padding: 0 14px 8px 18px; }
  .cl-b { padding: 2px 6px 10px; }
  .cl-f { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 18px max(16px, env(safe-area-inset-bottom)); }
  .cl-bar { flex-basis: 72px; }
  .cl-limit { margin-top: 16px; padding: 18px; }
  .cl-limit .acts .btn { flex: 1 1 auto; justify-content: center; }
}

/* The sign-in kit both portals share (front doors, link pages, the customer sign-up). Graphite tokens plus an ice accent. */
.door {
  --ice: #B9CCE3; --ice-rgb: 185, 204, 227; --ice-text: #C6D6EA; --ice-hover: #CBDAEC; --on-ice: #0D1420;
  --d-glow: 0.3; --d-spot: rgba(185, 204, 227, 0.11); --d-dots: rgba(255, 255, 255, 0.045); --d-field: var(--side);
  --d-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --d-pass: radial-gradient(140% 120% at 100% 0%, rgba(185, 204, 227, 0.19), transparent 55%), #222225;
  position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
}
.cust-light .door {
  --ice: #3A5573; --ice-rgb: 58, 85, 115; --ice-text: #2F475F; --ice-hover: #2F475F; --on-ice: #FFFFFF;
  --d-glow: 0.22; --d-spot: rgba(58, 85, 115, 0.1); --d-dots: rgba(0, 0, 0, 0.05); --d-field: #FFFFFF;
  --d-shadow: 0 20px 50px rgba(20, 20, 30, 0.08);
  --d-pass: radial-gradient(140% 120% at 100% 0%, rgba(58, 85, 115, 0.13), transparent 55%), #FFFFFF;
}
/* a soft light from the top and a dotted grid that fades out */
.door::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 720px; pointer-events: none; background: radial-gradient(640px 360px at 50% -60px, var(--d-spot), transparent 70%); }
.door::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 620px; pointer-events: none; background-image: radial-gradient(var(--d-dots) 1px, transparent 1px); background-size: 22px 22px; -webkit-mask-image: radial-gradient(520px 380px at 50% 0, #000, transparent 75%); mask-image: radial-gradient(520px 380px at 50% 0, #000, transparent 75%); }
.door > * { position: relative; z-index: 1; }

.d-ver { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; padding: 7px 16px; padding-top: max(7px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--card) 70%, transparent); font-size: 12.5px; color: var(--text-2); text-align: center; }
.d-ver b { font: 600 12px var(--mono); color: var(--text); letter-spacing: 0.02em; }
.d-ver .sep { color: var(--text-3); }
.d-reload { min-height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(var(--ice-rgb), 0.55); background: rgba(var(--ice-rgb), 0.1); color: var(--ice-text); font: inherit; font-size: 12.5px; font-weight: 600; }
.d-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px; }
.d-wm { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.d-wm svg.i { width: 18px; height: 18px; }
.d-status { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 12px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--card); font-size: 13px; color: var(--text-2); }
.d-status b { color: var(--text); font: 600 12px var(--mono); letter-spacing: 0.04em; }
.d-main { flex: 1; display: flex; justify-content: center; padding: 36px 20px 32px; }
.d-col { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.door h1 { margin: 24px 0 6px; font-size: 24px; line-height: 1.3; font-weight: 600; letter-spacing: -0.015em; }
.d-sub { margin: 0 0 26px; max-width: 34ch; font-size: 15px; color: var(--text-2); }
.d-logo { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex: none; color: var(--ice); background: rgba(var(--ice-rgb), 0.1); border: 1.5px solid rgba(var(--ice-rgb), 0.7); box-shadow: 0 0 0 6px rgba(var(--ice-rgb), 0.06); }
.d-logo svg.i { width: 28px; height: 28px; }
.d-avatar { border-radius: 50%; font-size: 22px; font-weight: 600; color: var(--text); background: var(--raise); border: 1px solid var(--line-2); box-shadow: none; }

/* boxes */
.d-panel { width: 100%; display: flex; flex-direction: column; gap: 12px; padding: 16px; text-align: left; background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--d-shadow); }
.d-card2 { width: 100%; margin-top: 12px; padding: 14px 16px; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--card) 60%, transparent); }
.d-label { margin: 0; font: 600 11px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.d-big { position: relative; width: 100%; min-height: 46px; padding: 0 18px; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); font: inherit; font-size: 14.5px; font-weight: 500; transition: background 0.12s, border-color 0.12s, transform 0.06s; }
.d-big:hover { border-color: var(--text-3); }
.d-big:active { transform: translateY(1px); }
.d-big.primary { background: var(--ice); border-color: transparent; color: var(--on-ice); box-shadow: 0 4px 14px rgba(var(--ice-rgb), var(--d-glow)), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.d-big.primary:hover { background: var(--ice-hover); }
.d-big:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.d-big:focus-visible, .d-back:focus-visible, .d-tlink:focus-visible, .d-eye:focus-visible, .d-reload:focus-visible { outline: 2px solid rgba(var(--ice-rgb), 0.7); outline-offset: 2px; }
.d-k { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); padding: 4px 6px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--card); color: var(--text-3); font: 500 11px/1 var(--mono); }
.d-big.primary .d-k { border-color: color-mix(in srgb, var(--on-ice) 30%, transparent); background: transparent; color: var(--on-ice); opacity: 0.7; }
.d-me { justify-content: flex-start; text-align: left; }
.d-av { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: var(--raise); border: 1px solid var(--line-2); color: var(--text); font-size: 12px; font-weight: 600; }
.d-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-who small { display: block; font-size: 12px; line-height: 1.2; color: var(--text-3); }
.d-me > svg.i:last-child { margin-left: auto; color: var(--text-3); }
.d-tag { flex: none; padding: 4px 6px; border-radius: 5px; border: 1px solid rgba(var(--ice-rgb), 0.55); background: rgba(var(--ice-rgb), 0.08); color: var(--ice-text); font: 700 10.5px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }

/* fields */
.d-fld { display: flex; flex-direction: column; gap: 6px; }
.d-fld label { font-size: 13px; color: var(--text-2); }
.d-labrow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.d-field { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--d-field); color: var(--text); font: inherit; font-size: 15px; transition: border-color 0.12s, box-shadow 0.12s; }
.d-field::placeholder { color: var(--text-3); }
.d-field:focus { outline: none; border-color: var(--ice); box-shadow: 0 0 0 3px rgba(var(--ice-rgb), 0.25); }
.d-field:-webkit-autofill, .d-field:-webkit-autofill:focus { -webkit-text-fill-color: var(--text); -webkit-box-shadow: 0 0 0 1000px var(--d-field) inset; transition: background-color 9999s; }
.d-fld.bad .d-field { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent); }
.d-pw { position: relative; }
.d-pw .d-field { padding-right: 46px; }
.d-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); }
.d-eye:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.d-cb { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.d-cb input { width: 16px; height: 16px; margin: 0; accent-color: var(--ice); }
.d-tlink { padding: 0; border: 0; background: none; color: var(--text-2); font: inherit; font-size: 13.5px; }
.d-tlink:hover { color: var(--text); }
.d-back { margin-top: 14px; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 10px; border: 0; background: none; color: var(--text-2); font: inherit; font-size: 13.5px; }
.d-back:hover { color: var(--text); }
.d-back svg.i { width: 14px; height: 14px; }
.d-err { margin: 0; text-align: left; font-size: 13.5px; color: var(--red); }
.d-tip { margin: 0; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--card-2); font-size: 13.5px; color: var(--text-2); }
.d-note { margin: 16px 0 0; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.d-note b { color: var(--text); font-weight: 500; }

/* how joining works */
.d-timeline { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.d-timeline li { position: relative; display: flex; gap: 12px; padding-bottom: 14px; font-size: 13.5px; color: var(--text-2); }
.d-timeline li:last-child { padding-bottom: 0; }
.d-timeline li::before { content: ""; position: absolute; left: 9px; top: 22px; bottom: 2px; width: 1px; background: var(--line-2); }
.d-timeline li:last-child::before { display: none; }
.d-timeline b { color: var(--text); font-weight: 500; }
.d-n { width: 19px; height: 19px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card); color: var(--text-3); font: 600 10.5px/1 var(--mono); }
.d-timeline .on .d-n { border-color: var(--ice); color: var(--ice); }

/* choose a password */
.d-prog { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 22px; }
.d-prog i { height: 3px; border-radius: 3px; background: var(--line-2); }
.d-prog i.done { background: var(--green); }
.d-prog i.on { background: var(--text); }
.d-pass { width: 100%; margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; text-align: left; border-radius: 16px; border: 1px solid var(--line-2); background: var(--d-pass); box-shadow: var(--d-shadow); }
.d-pass-top { display: flex; align-items: center; gap: 12px; }
.d-picon { width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 11px; border: 1.5px solid rgba(var(--ice-rgb), 0.7); background: rgba(var(--ice-rgb), 0.1); color: var(--ice); }
.d-picon svg.i { width: 19px; height: 19px; }
.d-pwho { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.d-pwho b { font-size: 16px; font-weight: 600; }
.d-pwho small { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-ppill { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--green) 55%, transparent); background: color-mix(in srgb, var(--green) 10%, transparent); color: var(--green-text); font-size: 13px; font-weight: 600; }
.d-pname { font: 700 28px/1.15 var(--mono); letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-ptag { align-self: flex-start; padding: 5px 8px; border-radius: 5px; border: 1px solid rgba(var(--ice-rgb), 0.55); background: rgba(var(--ice-rgb), 0.08); color: var(--ice-text); font: 700 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.d-pfoot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 10px; }
.d-pmeta { font: 600 11px/1.6 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); }
.d-ring { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.d-ring svg { width: 54px; height: 54px; }
.d-ring text { font: 700 13px var(--mono); }
.d-rl { font: 600 10px/1 var(--mono); letter-spacing: 0.12em; color: var(--text-2); }
.d-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.d-meter i { height: 4px; border-radius: 2px; background: var(--line-2); transition: background 0.2s; }
.d-meter[data-s="1"] i:nth-child(-n + 1) { background: var(--red); }
.d-meter[data-s="2"] i:nth-child(-n + 2) { background: var(--yellow); }
.d-meter[data-s="3"] i:nth-child(-n + 3) { background: var(--green); }
.d-meter[data-s="4"] i { background: var(--green); }
.d-mrow { display: flex; justify-content: space-between; margin-top: -4px; font-size: 12.5px; color: var(--text-3); }
.d-mrow b { font-weight: 500; color: var(--text-2); }
.d-checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.d-checks li { display: flex; align-items: center; gap: 8px; color: var(--text-3); }
.d-checks li.met { color: var(--text); }
.d-c { width: 16px; height: 16px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--line-2); }
.d-c svg.i { width: 10px; height: 10px; stroke-width: 2.4; opacity: 0; }
.d-checks li.met .d-c { background: var(--green); border-color: var(--green); color: #fff; }
.d-checks li.met .d-c svg.i { opacity: 1; }
.d-fine { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 18px 16px 22px; padding-bottom: max(22px, env(safe-area-inset-bottom)); text-align: center; font-size: 12px; color: var(--text-3); }
.d-fine svg.i { width: 13px; height: 13px; }

/* compact variant: small icon, mono host line, a one-line status box */
.door.compact::after { display: none; }
.door.compact::before { height: 520px; background: radial-gradient(560px 300px at 50% -80px, var(--d-spot), transparent 70%); }
.d-chip { padding: 4px 6px; border-radius: 5px; border: 1px solid rgba(var(--ice-rgb), 0.55); background: rgba(var(--ice-rgb), 0.08); color: var(--ice-text); font: 700 10.5px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.d-logo-sm { width: 44px; height: 44px; border-radius: 12px; box-shadow: none; }
.d-logo-sm svg.i { width: 22px; height: 22px; }
.door h1.d-h-sm { margin: 18px 0 4px; font-size: 22px; }
.d-mono { max-width: none; font-family: var(--mono); font-size: 13.5px; letter-spacing: 0.02em; margin-bottom: 22px; }
.d-statusline { width: 100%; margin-top: 14px; padding: 10px 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 12.5px; color: var(--text-2); }
.d-statusline > span { display: inline-flex; align-items: center; gap: 6px; }
.d-statusline b { font: 600 12px var(--mono); color: var(--text); }
.d-statusline b.err { color: var(--red); }
.d-links { margin-top: 14px; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 16px; }
.d-tlink2 { min-height: 32px; padding: 4px 0; border: 0; background: none; color: var(--text-2); font: inherit; font-size: 13px; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.d-tlink2:hover { color: var(--text); }
.d-tlink2:focus-visible { outline: 2px solid rgba(var(--ice-rgb), 0.7); outline-offset: 2px; }
.d-disc { width: 100%; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.d-disc-row { display: flex; gap: 8px; }
.d-disc-row .d-field { flex: 1; min-width: 0; }
.d-disc-row .d-big { width: auto; flex: none; }

/* tiles by tone: done, waiting, a problem */
.d-logo.ok { color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); border-color: color-mix(in srgb, var(--green) 60%, transparent); }
.d-logo.wait { color: var(--text-2); background: var(--raise); border-color: var(--line-2); }
.d-logo.warn { color: var(--yellow); background: color-mix(in srgb, var(--yellow) 10%, transparent); border-color: color-mix(in srgb, var(--yellow) 45%, transparent); }
.d-spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--ice); animation: d-spin 1s linear infinite; }
@keyframes d-spin { to { transform: rotate(360deg); } }
.d-wait { margin-top: 40px; }

/* more kinds of field: a wide column with two side by side, mono, text box, hints */
.d-col.wide { max-width: 460px; }
.d-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.d-fld label em { font-style: normal; color: var(--text-3); }
.d-field.mono { font-family: var(--mono); font-size: 14.5px; letter-spacing: 0.01em; }
textarea.d-field { display: block; min-height: 84px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.d-hint { margin: 0; text-align: left; font-size: 12.5px; line-height: 1.45; color: var(--text-3); }
.d-hint-row { margin-top: -4px; }
.d-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* the 3-step bar's labels */
.d-steplabels { width: 100%; margin: -15px 0 22px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: left; font: 600 10.5px/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.d-steplabels .on { color: var(--text); }
.d-steplabels .done { color: var(--green-text); }

/* the remembered account inside the sign-in box, with "Not you?" */
.d-acct { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--d-field); }
.d-acct .d-who { font-size: 14.5px; font-weight: 500; }

/* sign-up: the welcome note from the link, keep-this-link, what you sent */
.d-welcome { width: 100%; margin: 0 0 12px; padding: 12px 14px; text-align: left; border: 1px solid var(--line); border-left: 3px solid rgba(var(--ice-rgb), 0.7); border-radius: 12px; background: color-mix(in srgb, var(--card) 60%, transparent); }
.d-welcome .d-label { margin-bottom: 7px; }
.d-welcome p:last-child { margin: 0; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.d-sub.d-intro { margin-top: -10px; max-width: 46ch; }
.d-p { margin: 0; text-align: left; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.d-p b { color: var(--text); font-weight: 500; }
.d-code { display: block; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--d-field); font: 12.5px/1.45 var(--mono); overflow-wrap: anywhere; color: var(--text); user-select: all; }
.d-btnrow { display: flex; gap: 8px; }
.d-btnrow .d-big { flex: 1; min-width: 0; padding: 0 12px; }
a.d-big { text-decoration: none; }
.d-big.ghost { min-height: 38px; background: transparent; border-color: transparent; color: var(--text-2); }
.d-big.ghost:hover { color: var(--text); border-color: transparent; background: color-mix(in srgb, var(--text) 6%, transparent); }
.d-small { margin: 14px 0 0; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.d-a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.d-facts { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; }
.d-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; min-width: 0; }
.d-facts > div + div { border-top: 1px solid var(--line); }
.d-facts dt { color: var(--text-3); }
.d-facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.d-quote { width: 100%; margin: 0; padding: 12px 14px; text-align: left; border-left: 3px solid var(--line-2); border-radius: 0 10px 10px 0; background: var(--card-2); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.d-err-top { width: 100%; margin-bottom: 12px; }
.d-big:focus-visible, .d-a:focus-visible { outline: 2px solid rgba(var(--ice-rgb), 0.7); outline-offset: 2px; }

@media (max-width: 400px) { .d-me .d-tag { display: none; } }
/* small phones (320 to 360 px): the host line stays on one line, long buttons too */
@media (max-width: 420px) { .d-mono { white-space: nowrap; font-size: min(13.5px, 3.6vw); letter-spacing: 0; } }
@media (max-width: 360px) { .d-big { font-size: 13.5px; padding: 0 10px; gap: 6px; } .d-panel { padding: 12px; } }
@media (max-width: 640px) {
  .d-row { grid-template-columns: minmax(0, 1fr); }
  .d-steplabels { font-size: 10px; letter-spacing: 0.04em; }
  .d-top { padding: 12px 16px; }
  .d-host { display: none; }
  .d-main { padding: 14px 16px 20px; }
  .door h1 { margin-top: 18px; font-size: 22px; }
  .d-sub { margin-bottom: 20px; }
  .d-panel { padding: 14px; }
  .d-k { display: none; }
  /* 16px or iOS zooms in on focus; tap targets of 44px or more, without moving the layout */
  .d-field, .d-field.mono { font-size: 16px; min-height: 46px; }
  .d-tlink { min-height: 32px; }
  .d-tlink, .d-a, .d-tlink2 { position: relative; }
  .d-tlink::after, .d-a::after, .d-tlink2::after { content: ""; position: absolute; inset: -8px -6px; }
  .d-eye { width: 44px; height: 44px; right: 1px; }
  .d-cb { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .d-big, .d-field, .d-meter i { transition: none; } .d-spin { animation: none; } }

/* Attachments: files waiting to send, files in messages, the large picture view, the drop target. */
.att-pending, .att-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; min-width: 0; }
.att-pending { padding: 10px 10px 0; }
.att-list { margin-top: 8px; }
.att-chip { display: flex; align-items: center; gap: 9px; min-width: 0; max-width: 100%; width: 260px; border: 1px solid var(--line); border-radius: 10px; background: var(--card-2); padding: 6px 4px 6px 8px; }
.att-chip.bad { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.att-ext { flex: none; width: 38px; height: 38px; border-radius: 7px; background: var(--raise); color: var(--text-2); font: 600 10.5px var(--mono); display: grid; place-items: center; letter-spacing: 0.02em; overflow: hidden; }
.att-mini { flex: none; width: 38px; height: 38px; border-radius: 7px; object-fit: cover; background: var(--raise); }
.att-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.att-name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-chip.bad .att-sub { color: var(--red); white-space: normal; }
.att-prog { height: 3px; border-radius: 99px; background: var(--raise); overflow: hidden; margin-top: 3px; }
.att-prog i { display: block; height: 100%; background: var(--peri); transition: width 0.2s; }
.att-x { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--text-2); cursor: pointer; text-decoration: none; }
.att-x:hover { background: var(--raise); color: var(--text); }
.att-pic button { display: block; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card-2); cursor: zoom-in; }
.att-pic img { display: block; max-width: min(260px, 70vw); max-height: 200px; object-fit: cover; }
.att-wait { font-size: 12.5px; }
.att-btn { flex: none; }
.composer .foot .att-btn { margin-left: -4px; }
.att-drop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 70%, transparent); border: 2px dashed var(--peri); pointer-events: none; }
.att-drop span { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 18px; }
.att-dialog { padding: 0; border: 1px solid var(--line-2); border-radius: 14px; background: var(--card); color: var(--text); max-width: min(96vw, 1100px); max-height: 92vh; width: max-content; overflow: hidden; }
.att-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.att-dialog-bar { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.att-dialog-bar .att-name { font-weight: 600; }
.att-dialog img { display: block; max-width: min(96vw, 1100px); max-height: calc(92vh - 60px); margin: 0 auto; object-fit: contain; }
.m-files { margin: 8px 0 0; font-size: 13px; }
.m-reply .att-pending { padding: 0 0 8px; }

@media (max-width: 760px) {
  .att-chip { width: 100%; }
  .att-pic img { max-width: 70vw; max-height: 180px; }
}
@media (max-width: 760px), (pointer: coarse), (max-height: 500px) {
  .att-x { width: 44px; height: 44px; }
  .att-pic button { min-height: 44px; min-width: 44px; }
}

/* ---------- your profile (both portals): avatar colours, the footer button, the card, Settings ---------- */
.av.tint { color: hsl(var(--hue) 70% 84%); background: hsl(var(--hue) 30% 26%); box-shadow: inset 0 0 0 1px hsl(var(--hue) 30% 34%); }
.light .av.tint, .cust-light .av.tint { color: hsl(var(--hue) 55% 28%); background: hsl(var(--hue) 62% 90%); box-shadow: inset 0 0 0 1px hsl(var(--hue) 40% 80%); }

/* The sidebar footer: name and avatar are one button that opens the card. */
.me-id { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; margin: -4px 0 -4px -4px; padding: 4px; border-radius: 9px; color: inherit; text-align: left; font: inherit; background: transparent; border: 0; }
button.me-id { cursor: pointer; }
button.me-id:hover { background: var(--card-2); }
.light button.me-id:hover, .cust-light button.me-id:hover { background: var(--raise); }
button.me-id:focus-visible { outline: 2px solid var(--line-2); outline-offset: 1px; }
.me .who > span, .me .who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The card: a pop-up next to the footer; on phones a sheet from the bottom. */
.pf-dlg { padding: 0; margin: auto auto 76px 16px; width: min(380px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px);
  background: var(--card); color: var(--text); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); overflow: hidden; overscroll-behavior: contain; }
.pf-dlg[open] { display: flex; flex-direction: column; }
.pf-dlg::backdrop { background: rgba(0, 0, 0, 0.42); }
.light .pf-dlg::backdrop, .cust-light .pf-dlg::backdrop { background: rgba(20, 20, 30, 0.22); }
.light .pf-dlg, .cust-light .pf-dlg { box-shadow: 0 24px 60px rgba(20, 20, 30, 0.18); }
.pf-top { display: flex; align-items: center; gap: 12px; padding: 16px 14px 12px 18px; }
.pf-t { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.pf-t h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.pf-t .faint { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av.pf-big { width: 44px; height: 44px; border-radius: 12px; font-size: 18px; }
.pf-body { padding: 4px 18px 16px; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.pf-more { display: flex; align-items: center; gap: 9px; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--text-2); text-decoration: none; font-size: 14px; }
.pf-more:hover { color: var(--text); background: var(--card-2); }
.pf-more svg:last-child { margin-left: auto; }

/* The form, in the card and in Settings. */
.pf-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.set-sec .pf-form { max-width: 560px; }
.pf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pf-l { font-size: 13px; font-weight: 600; color: var(--text-2); }
.pf-field .field { width: 100%; }
.pf-field .field[aria-invalid="true"] { border-color: var(--red); }
.pf-h { font-size: 12.5px; line-height: 1.45; color: var(--text-3); }
.pf-colors { display: grid; grid-template-columns: repeat(9, 32px); gap: 6px; }
.pf-sw { padding: 0; border: 0; background: transparent; border-radius: 10px; cursor: pointer; line-height: 0; }
.pf-sw .av { width: 32px; height: 32px; border-radius: 9px; font-size: 13px; }
.pf-sw:hover .av { filter: brightness(1.12); }
.pf-sw.on { outline: 2px solid var(--text); outline-offset: 2px; }
.pf-sw:focus-visible { outline: 2px solid var(--line-2); outline-offset: 2px; }
.pf-sw.on:focus-visible { outline-color: var(--text); }
.pf-sign { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--text-2); }
.pf-sign svg { flex: none; color: var(--text-3); }
.pf-sign b { color: var(--text); font-weight: 600; }
.pf-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pf-acts .btn:disabled { opacity: 0.5; cursor: default; }
.pf-ok { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--green-text); }
.pf-form .err { margin: 0; }

/* ---------- answers per day, a year at a time (GitHub-style grid) ---------- */
:root { --yg0: #2A2A2F; --yg1: #1E4630; --yg2: #2A7347; --yg3: #3FA466; --yg4: #5BD08A; }
.light, .cust-light { --yg0: #E7E7EB; --yg1: #C2EACF; --yg2: #8BD6A6; --yg3: #47B873; --yg4: #24914F; }
.yg-wrap { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.yg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.yg-head b { font-size: 15px; font-weight: 600; }
.yg-legend { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--text-3); }
.yg-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2.5px; }
.yg-legend i:first-child { margin-left: 4px; }
.yg-legend i:last-child { margin-right: 4px; }
.yg-body { display: flex; align-items: flex-start; min-width: 0; }
.yg-days { flex: none; display: block; }
.yg-scroll { flex: 1 1 auto; min-width: 0; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; padding-bottom: 4px; scrollbar-width: thin; }
.yg { display: block; max-width: none; cursor: pointer; touch-action: pan-x pan-y; -webkit-tap-highlight-color: transparent; }
.yg-lbl { fill: var(--text-3); font-size: 10px; font-family: inherit; }
.yg rect.yg-c, .yg-legend i.l0 { fill: var(--yg0); background: var(--yg0); }
.yg rect.l1, .yg-legend i.l1 { fill: var(--yg1); background: var(--yg1); }
.yg rect.l2, .yg-legend i.l2 { fill: var(--yg2); background: var(--yg2); }
.yg rect.l3, .yg-legend i.l3 { fill: var(--yg3); background: var(--yg3); }
.yg rect.l4, .yg-legend i.l4 { fill: var(--yg4); background: var(--yg4); }
.yg rect.on { stroke: var(--text); stroke-width: 1.5; }
.yg-wrap .yg-pick { margin: 0; min-height: 20px; font-size: 13.5px; color: var(--text-2); }
.yg-pick b { color: var(--text); font-weight: 600; }
.yg-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 4px 0 0; }
.yg-stats > div { background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.light .yg-stats > div, .cust-light .yg-stats > div { background: var(--bg); }
.yg-stats dt { font-size: 12px; color: var(--text-3); }
.yg-stats dd { margin: 2px 0 0; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yg-stats dd small { display: block; font-size: 12px; font-weight: 400; color: var(--text-2); }
.yg-wrap .yg-empty { margin: 0; font-size: 13.5px; }

/* The Usage page and the Usage section in Settings. */
.ug-page { max-width: 920px; gap: 18px; }
.ug-intro h1 { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -0.015em; }
.ug-intro p { margin: 6px 0 0; max-width: 66ch; line-height: 1.55; }
.ug-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; min-width: 0; }
.set-sec .ug-open { align-self: flex-start; }

@media (max-width: 760px) {
  .pf-dlg { width: 100%; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); margin: auto 0 0; border-radius: 18px 18px 0 0; border-bottom: 0; }
  .pf-body { padding: 4px 18px 14px; }
  .pf-more { padding: 14px 18px max(16px, env(safe-area-inset-bottom)); min-height: 48px; }
  .pf-field .field { font-size: 16px; min-height: 44px; }
  .pf-colors { grid-template-columns: repeat(5, 48px); gap: 10px; }
  .pf-sw .av { width: 48px; height: 44px; border-radius: 11px; font-size: 15px; }
  .pf-acts .btn { min-height: 44px; padding: 0 18px; }
  .yg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ug-card { padding: 16px 14px; }
  .ug-intro h1 { font-size: 22px; }
}
@media (pointer: coarse) {
  button.me-id { min-height: 44px; }
}

/* Phones: the avatar in the top bar opens the profile card too. */
.mbar-me { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -7px -7px -7px 0; padding: 0; border: 0; border-radius: 10px; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mbar-me:focus-visible { outline: 2px solid var(--line-2); outline-offset: -2px; }

/* Save stays in reach while the card scrolls: short screens, landscape phones, an open keyboard. */
.pf-dlg .pf-body { padding-bottom: 0; }
.pf-dlg .pf-acts { position: sticky; bottom: 0; z-index: 1; margin: 0 -18px; padding: 10px 18px 14px; background: var(--card); }
@media (max-height: 560px) and (min-width: 761px) {
  .pf-dlg { margin: 8px auto 8px 16px; max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
}

/* Projects: list, holdups, map, outline, people; and the unit-checked calculation card. */
.pj-page { max-width: 1180px; gap: 16px; }
.pj-intro h1, .pj-head h1 { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.pj-intro p, .pj-head p { margin: 6px 0 0; max-width: 72ch; line-height: 1.55; }
.pj-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.pj-row > label { font-size: 14px; color: var(--text-2); }
.pj-new { display: flex; flex-direction: column; gap: 8px; }
.pj-new label { font-weight: 600; }
.pj-new .field { flex: 1 1 260px; min-width: 0; }

.pj-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pj-item { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; color: inherit; text-decoration: none; min-height: 44px; }
.pj-item:hover { border-color: var(--line-2); }
.pj-item-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pj-item-h b { font-size: 15.5px; overflow-wrap: anywhere; }
.pj-item-f { font-size: 13px; }
.pj-bar { display: flex; height: 6px; border-radius: 99px; overflow: hidden; background: var(--raise); }
.pj-bar i { display: block; min-width: 4px; }

/* Status colours, shared by pills, the bar, the key and the map's legend. */
.pj-st.done, .k.done, .pj-bar .done { --c: var(--green); }
.pj-st.active, .k.active, .pj-bar .active { --c: var(--peri); }
.pj-st.blocked, .k.blocked, .pj-bar .blocked { --c: var(--red); }
.pj-st.todo, .k.todo, .pj-bar .todo { --c: var(--text-3); }
.pj-st.cancelled, .k.cancelled, .pj-bar .cancelled { --c: var(--line-2); }
.k.chain { --c: var(--yellow); }
.pj-bar i.pj-st { background: var(--c); }
.pill.pj-st { background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--text); }
.pill.pj-st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.k { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); vertical-align: -1px; }
.k.chain { border-radius: 2px; height: 3px; width: 14px; vertical-align: 2px; }

.pj-grid { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.pj-hold { display: flex; flex-direction: column; gap: 12px; }
.pj-hold-g h3 { margin: 0 0 6px; font-size: 13px; font-weight: 650; color: var(--text-2); letter-spacing: 0.04em; text-transform: uppercase; }
.pj-hold-g ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.pj-hold-g li, .pj-hold-g p { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.pj-counts { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; color: var(--text-2); }
.pj-counts span { display: inline-flex; align-items: center; gap: 6px; }
.pj-link { font: inherit; color: var(--text); background: none; border: 0; padding: 0; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; overflow-wrap: anywhere; }
.pj-link:hover { text-decoration-color: var(--text-2); }
.pj-chips { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.pj-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 7px; padding: 2px 4px 2px 8px; font-size: 13.5px; }
.pj-chip button { font: inherit; color: var(--text-2); background: none; border: 0; cursor: pointer; min-width: 24px; min-height: 24px; }
.pj-chain { margin: 0; line-height: 1.7; }

.pj-mapcard { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pm { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pm-bar { display: flex; align-items: center; gap: 6px; }
.pm-stage { position: relative; width: 100%; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); overflow: hidden; touch-action: none; }
.pm-stage canvas { position: absolute; inset: 0; display: block; }
.pm-text { cursor: pointer; }
.pm-key { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; }
.pm-key span { display: inline-flex; align-items: center; gap: 5px; }
.pj-sel { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.pj-sel p { margin: 0; line-height: 1.5; }

.pj-outline, .pj-people { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pj-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pj-add .field.grow { flex: 1 1 240px; min-width: 0; }
.pj-hours { width: 84px; }
.pj-tree, .pj-tree ul { list-style: none; margin: 0; padding: 0; }
.pj-tree { border-top: 1px solid var(--line); overflow-x: auto; }
.pj-tree li.on > .pj-tr { background: var(--raise); }
.pj-tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 7px 8px; border-bottom: 1px solid var(--line); min-height: 44px; }
.pj-title { min-width: 120px; }
.pj-kind { font: 11.5px var(--mono); color: var(--text-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.pj-kind.goal { color: var(--yellow); border-color: color-mix(in srgb, var(--yellow) 40%, transparent); }
.pj-kind.objective { color: var(--peri); border-color: color-mix(in srgb, var(--peri) 40%, transparent); }
.pj-wait { font-size: 13px; }
.pj-wait.held { color: var(--yellow); }
.pj-status { min-height: 30px; padding: 0 8px; }
.pj-acts { display: inline-flex; gap: 2px; }
.pj-members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pj-members li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pj-roles { margin: 0; font-size: 13px; line-height: 1.5; }

.pj-calc { display: flex; flex-direction: column; gap: 4px; }
.pj-calc-v { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.pj-calc-c { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }

@media (max-width: 900px) {
  .pj-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px), (pointer: coarse), (max-height: 500px) {
  .pj-link { min-height: 44px; display: inline-flex; align-items: center; }
  .pj-chip button { min-width: 44px; min-height: 44px; }
  .pj-status { min-height: 44px; }
  .pj-hours { width: 96px; }
  .pj-acts .btn { min-width: 44px; }
}

/* ---------- shared additions: settings, theme, reports, staff replies ---------- */
.me .icon-btn { width: 32px; height: 32px; }
.me { gap: 6px; }
.me .who { margin-right: 2px; }
.icon-btn.on { color: var(--text); background: var(--raise); }
.item .badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--green); color: #0F2418; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.light .item .badge { color: #fff; }
.reply-dot { margin-left: auto; width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(91, 208, 138, 0.18); flex: none; }

/* dropdowns match text boxes everywhere */
select.field, .light select.field, .cust-light select.field { appearance: none; -webkit-appearance: none; min-height: 36px; padding: 0 32px 0 12px; line-height: 1.2;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
select.field:disabled { opacity: 0.6; }

/* settings */
.set-page { max-width: 920px; gap: 22px; }
.set-sec { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.set-h { display: flex; gap: 14px; align-items: flex-start; }
.set-h h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.set-h p { margin: 3px 0 0; font-size: 14px; line-height: 1.55; max-width: 70ch; }
.set-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--raise); color: var(--text); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.set-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.theme-opt { font: inherit; text-align: left; color: var(--text); background: var(--card-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.theme-opt:hover { border-color: var(--text-3); }
.theme-opt.on { border-color: var(--green); box-shadow: 0 0 0 3px rgba(91, 208, 138, 0.16); }
.theme-opt .swatch { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); display: block; }
.theme-opt .theme-l { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 14.5px; }
.theme-opt .theme-l svg { color: var(--green); }
.theme-opt .faint { font-size: 12.5px; line-height: 1.4; }
.made { border: 1px solid rgba(91, 208, 138, 0.5); background: rgba(91, 208, 138, 0.08); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.tokline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tokline code { flex: 1 1 260px; overflow-wrap: anywhere; background: var(--side); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.tok-list { display: flex; flex-direction: column; }
.tok { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line); font-size: 14px; min-width: 0; }
.tok:first-child { border-top: 0; }
.tok > svg { color: var(--text-2); }
.tok b { font-weight: 600; }
.snips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.snip { border: 1px solid var(--line); border-radius: 10px; background: var(--side); min-width: 0; overflow: hidden; }
.snip-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); }
.snip pre { margin: 0; padding: 10px 12px; font: 12.5px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
@media (max-width: 760px) {
  .theme-grid { grid-template-columns: minmax(0, 1fr); }
  .theme-opt { display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
  .theme-opt .swatch { grid-row: span 2; }
  .snips { grid-template-columns: minmax(0, 1fr); }
  .set-sec { padding: 16px; }
}

/* MCP: token access and the list of tools */
.tok { flex-wrap: wrap; }
.tok-t { min-width: 0; flex: 1 1 220px; }
.tok-m { display: block; font-size: 13px; margin-top: 1px; }
.mcp-access > button { white-space: nowrap; }
.pill.mcp-chg { color: var(--yellow); background: rgba(242, 201, 76, 0.13); font-weight: 600; }
.pill.mcp-op { color: var(--peri); background: rgba(142, 155, 255, 0.14); font-weight: 600; }
.pill.mcp-dev { color: var(--text); font-weight: 600; }
.pill.mcp-new { color: #B9CCE3; background: transparent; box-shadow: inset 0 0 0 1px rgba(185, 204, 227, 0.45); font-weight: 600; }
.pill.mcp-out { color: #B9CCE3; background: rgba(185, 204, 227, 0.14); font-weight: 600; }
.light .pill.mcp-new, .cust-light .pill.mcp-new { color: #3A5573; box-shadow: inset 0 0 0 1px rgba(58, 85, 115, 0.45); }
.light .pill.mcp-out, .cust-light .pill.mcp-out { color: #3A5573; background: rgba(58, 85, 115, 0.1); }
.light .pill.mcp-op, .cust-light .pill.mcp-op { color: #4B57D6; }
.mcp-find { position: relative; display: flex; align-items: center; min-width: 180px; }
.mcp-find svg { position: absolute; left: 11px; color: var(--text-3); pointer-events: none; }
.mcp-find .field { width: 100%; padding-left: 34px; }
.mcp-cat { columns: 2 320px; column-gap: 24px; }
.mcp-g { break-inside: avoid; margin: 0 0 18px; }
.mcp-gh { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); padding: 0 2px 6px; border-bottom: 1px solid var(--line); }
.mcp-gh span { margin-left: auto; letter-spacing: 0; font-weight: 500; color: var(--text-3); text-transform: none; }
.mcp-t { padding: 8px 2px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mcp-t1 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mcp-t1 code { font: 13px var(--mono); color: var(--text); margin-right: auto; overflow-wrap: anywhere; }
.mcp-d { font-size: 13.5px; color: var(--text-3); line-height: 1.45; }
.mcp-kept { margin: 0; font-size: 13.5px; color: var(--text-3); line-height: 1.55; }
.mcp-kept b { color: var(--text-2); font-weight: 600; }
@media (max-width: 760px) {
  .mcp-make > .grow { flex-basis: 100%; }
  .mcp-make .seg, .mcp-filters .seg, .tok .seg { width: 100%; }
  .mcp-make .seg > *, .mcp-filters .seg > *, .tok .seg > * { flex: 1 1 0; justify-content: center; padding: 0 6px; }
  .mcp-make .btn { width: 100%; justify-content: center; }
  .mcp-find { flex-basis: 100%; }
  .mcp-cat { columns: 1; }
  .tok-t { flex-basis: 100%; }
  .tok > svg { display: none; }
}

/* reports: status, kind, form, body */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; background: var(--raise); color: var(--text-2); }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-new { color: var(--peri); background: rgba(142, 155, 255, 0.14); }
.st-seen { color: var(--text-2); }
.st-plan { color: var(--yellow); background: rgba(242, 201, 76, 0.13); }
.st-done { color: var(--green-text); background: rgba(91, 208, 138, 0.14); }
.st-no { color: var(--text-3); }
.light .st-new { color: #4B57D6; }
.kind { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.kind svg { width: 14px; height: 14px; }
.kind-bug svg { color: var(--red); }
.kind-feature svg { color: var(--yellow); }
.rform { display: flex; flex-direction: column; gap: 14px; }
.rform label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rform label > span { font-size: 13px; color: var(--text-2); }
.rform em { font-style: normal; color: var(--text-3); }
.rform .field { width: 100%; }
.rform textarea.field { padding: 9px 12px; resize: vertical; line-height: 1.5; }
.rrow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rkind { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rkind button { font: inherit; color: var(--text); text-align: left; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; min-height: 64px; }
.rkind button svg { width: 22px; height: 22px; color: var(--text-2); }
.rkind button span { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.rkind button small { color: var(--text-3); font-size: 12.5px; }
.rkind button.on { border-color: var(--green); box-shadow: 0 0 0 3px rgba(91, 208, 138, 0.15); }
.rkind button.on:first-child svg { color: var(--red); }
.rkind button.on:last-child svg { color: var(--yellow); }
.ract { display: flex; justify-content: flex-end; gap: 8px; }
.rbody { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.rbody dt { font-size: 12.5px; color: var(--text-3); margin-bottom: 2px; }
.rbody dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
@media (max-width: 560px) { .rrow, .rkind { grid-template-columns: minmax(0, 1fr); } }

/* a reply from a person on the hearth team */
.msg.staff .body { background: rgba(91, 208, 138, 0.07); border: 1px solid rgba(91, 208, 138, 0.28); border-radius: 12px; padding: 10px 14px; }
.msg .staff-av { background: rgba(91, 208, 138, 0.18); color: var(--green-text); }
.staff-tag { font-size: 11.5px; font-weight: 600; color: var(--green-text); border: 1px solid rgba(91, 208, 138, 0.4); border-radius: 999px; padding: 0 7px; }

@media (max-width: 760px), (pointer: coarse), (max-height: 500px) {
  .me .icon-btn { width: 44px; height: 44px; flex: none; }
  .me { gap: 4px; }
  .me .who { min-width: 0; }
}

/* customer: report a problem */
.cf-page { max-width: 1120px; gap: 18px; }
.cf-intro h1 { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -0.015em; }
.cf-intro p { margin: 6px 0 0; max-width: 64ch; line-height: 1.55; }
.cf-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cf-form { padding: 18px; }
.cf-mine { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cf-mine h2 { margin: 0; font-size: 16px; font-weight: 600; }
.cf-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cf-item-h { font: inherit; color: var(--text); width: 100%; background: none; border: 0; text-align: left; display: flex; align-items: center; gap: 10px; padding: 12px 14px; min-height: 48px; }
.cf-t { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-note { margin: 0 14px 12px; display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; background: rgba(91, 208, 138, 0.08); border: 1px solid rgba(91, 208, 138, 0.25); font-size: 14px; line-height: 1.5; }
.cf-note svg { color: var(--green-text); margin-top: 3px; }
.cf-body { border-top: 1px solid var(--line); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 900px) { .cf-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- touch: fingertip-sized controls (44 px) ----------
   Loaded after the other files in src/css (alphabetical), so it wins over rules that size controls
   for a mouse, e.g. shared.css's 36 px select.field. Same conditions as graphite.css's touch block. */
@media (max-width: 760px), (pointer: coarse), (max-height: 500px) {
  select.field, .light select.field, .cust-light select.field { min-height: 44px; }
  /* "Forgot?" on the sign-in pages: a 44 px tap area without moving anything. */
  .d-tlink { padding: 12px 8px; margin: -12px -8px; }
}
