:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --text: #16181d;
  --muted: #5d6573;
  --border: #e2e5ea;
  --accent: #4b3fd9;
  --accent-text: #ffffff;
  --ok: #157a4a;
  --ok-bg: #e5f5ec;
  --warn: #9a5b00;
  --warn-bg: #fdf1dc;
  --bad: #b42318;
  --bad-bg: #fde8e7;
  --info-bg: #ecebfd;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1e222b;
    --text: #e8eaee;
    --muted: #9aa3b2;
    --border: #2a2f3a;
    --accent: #8b82ff;
    --accent-text: #0f1115;
    --ok: #4cc38a;
    --ok-bg: #11291d;
    --warn: #f0b45a;
    --warn-bg: #2d2210;
    --bad: #f97066;
    --bad-bg: #2f1513;
    --info-bg: #1f1d3d;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 8px; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
button, .btn {
  font: inherit;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--bad); }
button:disabled { opacity: 0.55; cursor: progress; }
input, textarea, select {
  font: inherit;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-weight: 600; font-size: 13px; margin: 10px 0 4px; }
.hint { font-weight: 400; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--accent); }
.banner { padding: 12px 14px; border-radius: var(--radius); background: var(--info-bg); border: 1px solid var(--border); }
.banner.warn { background: var(--warn-bg); }
.stat { font-size: 26px; font-weight: 700; }

/* Auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-pitch { padding: 56px; background: var(--surface-2); display: flex; flex-direction: column; justify-content: center; }
.auth-pitch h1 { font-size: 32px; }
.auth-pitch ol { padding-left: 20px; color: var(--muted); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-form .card { width: 100%; max-width: 400px; }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.tabs button[aria-selected="true"] { background: var(--surface-2); font-weight: 600; }

/* Shell */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; display: flex; flex-direction: column; gap: 6px; }
.brand { font-weight: 800; padding: 4px 8px 12px; }
.side nav button { width: 100%; text-align: left; border: none; background: none; padding: 9px 10px; }
.side nav button[aria-current="page"] { background: var(--surface-2); font-weight: 600; }
.side .grow { flex: 1; }
main { padding: 28px clamp(16px, 4vw, 40px); max-width: 1100px; width: 100%; }
.topbar { margin-bottom: 18px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--surface-2); }
.deliverable { white-space: pre-wrap; background: var(--surface-2); border-radius: 8px; padding: 12px; max-height: 360px; overflow: auto; font-size: 14px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px; }
.empty { text-align: center; padding: 28px; color: var(--muted); }

dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); max-width: 760px; width: calc(100% - 32px); padding: 22px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; opacity: 0; transition: opacity 0.2s; pointer-events: none; user-select: text; cursor: pointer; max-width: calc(100% - 32px); }
#toast.show { pointer-events: auto; }
#toast.show { opacity: 1; }

/* Manager at work */
.atwork { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; background: var(--info-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.atwork .avatar { font-size: 44px; line-height: 1; animation: bob 1.6s ease-in-out infinite; }
.atwork .timer { font-variant-numeric: tabular-nums; }
.atwork .bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 10px 0 12px; }
.atwork .bar > span { display: block; height: 100%; width: 40%; border-radius: 99px; background: var(--accent); animation: slide 1.4s ease-in-out infinite; }
.steps-live { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.steps-live li { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.steps-live li.done { color: var(--ok); }
.steps-live li.now { color: var(--text); font-weight: 600; }
.steps-live li.now .icon { animation: pop 0.9s ease-in-out infinite; }
.dots::after { content: ""; animation: dots 1.2s steps(4, end) infinite; }
.pill.live { position: relative; padding-left: 20px; }
.pill.live::before { content: ""; position: absolute; left: 8px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: currentColor; animation: pulse 1.2s ease-in-out infinite; }
button[aria-busy="true"]::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
/* Team */
.team-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.member { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.member:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16, 24, 40, 0.08); }
.member.off { opacity: 0.6; }
.member.hire { background: var(--surface-2); }
.member-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.member-name { font-weight: 700; font-size: 16px; }
.face { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: var(--info-bg); }
.face.busy { animation: bob 1.6s ease-in-out infinite; box-shadow: 0 0 0 3px var(--accent); }
.member .now { text-align: left; width: 100%; font-size: 14px; border-radius: 8px; padding: 8px 10px; border: 1px dashed var(--border); background: var(--surface-2); color: var(--text); }
.member .now.busy { background: var(--info-bg); border-color: var(--accent); }
.member .now.check { background: var(--warn-bg); }
.member .now.stuck { background: var(--bad-bg); }
.member .now.idle { color: var(--muted); cursor: default; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.funfact { font-size: 13px; color: var(--muted); font-style: italic; margin: 0; }
.howto { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; border-radius: var(--radius); background: var(--info-bg); font-size: 14px; }
.howto .arrow { color: var(--accent); font-weight: 700; }
details > summary { cursor: pointer; }

/* Task window */
dialog.task-dialog { max-width: 920px; padding: 24px 28px 0; }
.t-section { border-radius: var(--radius); padding: 12px 14px; background: var(--surface-2); }
.t-section .t-title { font-size: 14px; margin: 0 0 6px; }
.t-section.feedback { background: var(--warn-bg); border: 1px solid var(--warn); }
.t-section.approved { background: var(--ok-bg); }
.md-box { background: var(--surface); border-radius: 8px; padding: 4px 12px; }
.t-history { padding: 8px 0; }
.t-footer { position: sticky; bottom: 0; padding: 12px 0 16px; background: var(--surface); border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }

/* Rendered Markdown (AI deliverables) */
.md { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h3, .md h4, .md h5 { margin: 14px 0 6px; font-size: 15px; }
.md h3 { font-size: 16px; }
.md p { margin: 6px 0; }
.md ul, .md ol { margin: 6px 0; padding-left: 22px; }
.md li { margin: 2px 0; }
.md hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.md pre { white-space: pre-wrap; background: var(--surface-2); border-radius: 8px; padding: 10px; font-size: 13px; }
.md code { background: var(--surface-2); border-radius: 4px; padding: 1px 4px; font-size: 13px; }
.md blockquote { margin: 6px 0; padding: 4px 12px; border-left: 3px solid var(--accent); color: var(--muted); }
.md a { color: var(--accent); }
.code-wrap { position: relative; margin: 8px 0; }
.code-wrap pre { margin: 0; padding-right: 92px; border: 1px dashed var(--accent); background: var(--info-bg); font-family: inherit; font-size: 14px; }
.code-wrap .copy-btn { position: absolute; top: 6px; right: 6px; }
.md-table-wrap { overflow-x: auto; margin: 8px 0; }
.md-table th, .md-table td { border: 1px solid var(--border); padding: 6px 8px; font-size: 13px; }
.md-table th { background: var(--surface-2); text-transform: none; letter-spacing: 0; color: var(--text); }

/* "Your turn" panel in the task window */
.turn { border: 2px solid var(--accent); border-radius: var(--radius); padding: 16px; background: var(--surface); }
.turn h3 { font-size: 17px; }
.turn-step { padding: 6px 10px; border-radius: 8px; background: var(--info-bg); }
.material { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--surface-2); }
.material[open] { background: var(--surface); }
.material summary { cursor: pointer; padding: 2px 0; }

/* Office floor (animated view of real events) */
.tabs-office { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.tabs-office button { border: none; border-radius: 999px; padding: 6px 14px; background: transparent; }
.tabs-office button[aria-selected="true"] { background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }
.floor { position: relative; height: 460px; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden;
  background-color: var(--surface-2);
  background-image: linear-gradient(45deg, var(--surface) 25%, transparent 25%, transparent 75%, var(--surface) 75%), linear-gradient(45deg, var(--surface) 25%, transparent 25%, transparent 75%, var(--surface) 75%);
  background-size: 48px 48px; background-position: 0 0, 24px 24px; }
.floor .rug { position: absolute; left: 50%; top: 28%; width: 300px; max-width: 70%; height: 120px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--info-bg); opacity: 0.9; }
.f-desk { position: absolute; transform: translate(-50%, -50%); text-align: center; font-size: 30px; line-height: 1; z-index: 1; }
.f-desk .label { display: block; font-size: 12px; font-weight: 600; margin-top: 4px; color: var(--muted); white-space: nowrap; }
.f-char { position: absolute; transform: translate(-50%, -50%); font-size: 34px; line-height: 1; z-index: 3; transition: left 1.3s ease-in-out, top 1.3s ease-in-out; }
.f-char.walking { animation: bob 0.45s ease-in-out infinite; }
.f-char.typing .tool { display: inline-block; }
.f-char .tool { display: none; position: absolute; right: -18px; bottom: -4px; font-size: 16px; animation: pop 0.6s ease-in-out infinite; }
.f-char .carry { position: absolute; left: -16px; bottom: -2px; font-size: 18px; }
.f-bubble { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); max-width: 230px; padding: 5px 9px; border-radius: 12px; font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); opacity: 0; transition: opacity 0.25s; pointer-events: none; }
.f-bubble.show { opacity: 1; }
.f-bubble.speak { border-color: var(--accent); font-weight: 600; }
.f-char.mgr .f-bubble.speak { background: var(--info-bg); }
.f-burst { position: absolute; font-size: 22px; transform: translate(-50%, -50%); z-index: 4; animation: burst 1.4s ease-out forwards; pointer-events: none; }
.f-banner { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 4px 12px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 12px; z-index: 5; }
@keyframes burst { 0% { opacity: 1; transform: translate(-50%, -50%) scale(0.6); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1.4); } }
@media (max-width: 760px) { .floor { height: 400px; } .f-char { font-size: 28px; } .f-desk { font-size: 24px; } .f-bubble { max-width: 150px; } }

/* Live office */
.office { display: flex; flex-wrap: wrap; gap: 12px; padding: 16px; border-radius: var(--radius); background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 12px, var(--surface) 12px, var(--surface) 24px); border: 1px solid var(--border); }
.desk { flex: 1 1 140px; max-width: 190px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); text-align: center; }
.desk.busy .face { animation: bob 1.6s ease-in-out infinite; box-shadow: 0 0 0 3px var(--accent); }
.desk-name { font-weight: 700; }
.desk-mood { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.chat { display: flex; flex-direction: column; gap: 12px; }
.bubble-row { display: flex; gap: 10px; align-items: flex-end; max-width: 85%; animation: rise 0.35s ease-out both; }
.bubble-row.team { flex-direction: row-reverse; align-self: flex-end; }
.bubble-row.owner { flex-direction: row-reverse; align-self: flex-end; }
.bubble-row .who { font-size: 26px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); flex: none; }
.bubble { padding: 10px 14px; border-radius: 16px; background: var(--surface-2); font-size: 14px; line-height: 1.45; }
.bubble[title] { cursor: pointer; }
.bubble-row.manager .bubble { border-bottom-left-radius: 4px; background: var(--info-bg); }
.bubble-row.team .bubble { border-bottom-right-radius: 4px; }
.bubble-row.owner .bubble { border-bottom-right-radius: 4px; background: var(--ok-bg); }
.bubble-head { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; margin-bottom: 2px; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@keyframes pop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@media (prefers-reduced-motion: reduce) {
  .f-char, .f-char.walking, .f-char .tool, .f-burst, .desk.busy .face, .bubble-row, .face.busy, .member, .atwork .avatar, .atwork .bar > span, .steps-live li.now .icon, .pill.live::before, button[aria-busy="true"]::before, .dots::after { animation: none; }
}

@media (max-width: 760px) {
  .auth { grid-template-columns: 1fr; }
  .auth-pitch { padding: 28px 16px; }
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--border); }
  .side nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .side nav button { width: auto; }
  .side .grow { display: none; }
  table { font-size: 14px; }
  .hide-sm { display: none; }
}

/* ===================== Office floor decor ===================== */
.floor.night { background-color: #1b1d33; }
.floor.night::after { content: ""; position: absolute; inset: 0; background: rgba(20, 18, 60, 0.28); pointer-events: none; z-index: 0; }
.f-deco { position: absolute; transform: translate(-50%, -50%); font-size: 30px; z-index: 1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.15)); }
.f-window { position: absolute; left: 12px; top: 12px; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 12px; border-radius: 12px; border: 3px solid #c9a27a; background: linear-gradient(180deg, #bfe3ff, #e9f6ff); font-size: 18px; color: #1d3557; box-shadow: var(--shadow); }
.floor.night .f-window { background: linear-gradient(180deg, #1d2b53, #3a3f7a); color: #fff; }
.f-clock { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.f-board { position: absolute; right: 12px; top: 12px; z-index: 2; width: 240px; max-width: 45%; padding: 10px 12px; border-radius: 10px; background: #fffef8; color: #1f2430; border: 3px solid #9aa3b2; box-shadow: var(--shadow); font-size: 13px; display: grid; gap: 6px; }
.f-progress { height: 8px; border-radius: 99px; background: #e6e8ee; overflow: hidden; }
.f-progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #22c55e, #16a34a); transition: width 0.8s ease; }
.f-desk .desk-top { display: inline-block; padding: 2px 16px 8px; border-radius: 10px; background: linear-gradient(180deg, #c99a6b, #a87a4f); box-shadow: 0 4px 0 #7c5532; }
.f-char { cursor: pointer; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.18)); }
.f-char.mgr { cursor: default; }
.f-char.sleepy::after { content: "💤"; position: absolute; right: -14px; top: -10px; font-size: 16px; animation: floatz 2.4s ease-in-out infinite; }
.f-char.stuck { animation: shake 2.2s ease-in-out infinite; }
@keyframes floatz { 0% { opacity: 0; transform: translate(0, 4px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(8px, -14px); } }
@keyframes shake { 0%, 86%, 100% { transform: translate(-50%, -50%); } 89% { transform: translate(-56%, -50%); } 92% { transform: translate(-44%, -50%); } 95% { transform: translate(-54%, -50%); } }
@media (max-width: 760px) { .f-board { width: 170px; font-size: 11px; } .f-window { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .f-char.sleepy::after, .f-char.stuck, .f-progress > span { animation: none; transition: none; } }

/* ===================== Bolder look ===================== */
:root {
  --accent: #6d28d9;
  --accent-2: #db2777;
  --grad: linear-gradient(135deg, #6d28d9 0%, #a21caf 55%, #db2777 100%);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 6px 18px rgba(76, 29, 149, 0.07);
  --info-bg: #f1ebff;
  --bg: #f7f5fc;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #a78bfa;
    --accent-2: #f472b6;
    --grad: linear-gradient(135deg, #7c3aed 0%, #c026d3 55%, #db2777 100%);
    --info-bg: #241b3d;
    --bg: #0e0c16;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}
body { background: radial-gradient(1200px 600px at 100% -10%, rgba(219, 39, 119, 0.07), transparent 60%), radial-gradient(900px 500px at -10% 10%, rgba(109, 40, 217, 0.08), transparent 60%), var(--bg); background-attachment: fixed; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 19px; font-weight: 750; }
button { transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease; }
button:hover:not(:disabled) { transform: translateY(-1px); }
button.primary { background: var(--grad); border: none; color: #fff; box-shadow: 0 6px 16px rgba(162, 28, 175, 0.28); }
button.primary:hover:not(:disabled) { box-shadow: 0 10px 22px rgba(162, 28, 175, 0.36); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15); }
.card { border-radius: var(--radius); border-color: transparent; box-shadow: var(--shadow); }
.stat { font-size: 32px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grid > .card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.grid > .card:hover { transform: translateY(-2px); }
.pill.ok { background: #dcfce7; color: #15803d; }
.pill.warn { background: #fef3c7; color: #b45309; }
.pill.bad { background: #fee2e2; color: #b91c1c; }
.pill.info { background: #ede9fe; color: #6d28d9; }
@media (prefers-color-scheme: dark) {
  .pill.ok { background: #0f2e1d; color: #4ade80; }
  .pill.warn { background: #33240b; color: #fbbf24; }
  .pill.bad { background: #3a1414; color: #f87171; }
  .pill.info { background: #2a1f4a; color: #c4b5fd; }
}
.banner { border: none; border-left: 4px solid var(--accent); }
.banner.warn { border-left-color: #f59e0b; }

/* Sidebar */
.side { background: linear-gradient(180deg, #1e1035 0%, #2a1250 55%, #3b0f45 100%); border-right: none; color: #f3f0ff; padding: 22px 14px; }
.side .brand { font-size: 19px; letter-spacing: -0.01em; background: linear-gradient(90deg, #fff, #f9a8d4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.side select { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.18); }
.side select option { color: #111; }
.side nav button { color: #e9e3ff; border-radius: 10px; font-size: 15px; }
.side nav button:hover { background: rgba(255, 255, 255, 0.08); transform: none; }
.side nav button[aria-current="page"] { background: rgba(255, 255, 255, 0.16); color: #fff; box-shadow: inset 3px 0 0 #f472b6; }
.side > button.small { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.18); }
.side .muted { color: #c9bfe6 !important; }

/* Auth & onboarding */
.auth-pitch { background: var(--grad); color: #fff; }
.auth-pitch .muted, .auth-pitch ol { color: rgba(255, 255, 255, 0.85); }
.auth-pitch .pill.info { background: rgba(255, 255, 255, 0.18); color: #fff; }
.auth-pitch h1 { font-size: 36px; }

/* Team cards & office */
.member { border-color: transparent; box-shadow: var(--shadow); }
.face { background: linear-gradient(135deg, #ede9fe, #fce7f3); }
@media (prefers-color-scheme: dark) { .face { background: linear-gradient(135deg, #2a1f4a, #3a1630); } }
.howto { background: var(--grad); color: #fff; font-weight: 600; }
.howto .arrow { color: #fde68a; }
.atwork { background: linear-gradient(135deg, var(--info-bg), rgba(252, 231, 243, 0.6)); border: none; box-shadow: var(--shadow); }
.atwork .bar > span { background: var(--grad); }
.tabs-office { background: rgba(109, 40, 217, 0.08); }

/* ===================== Seated Manager, desks and the shout ===================== */
.f-desk { z-index: 4; }                 /* desks sit in front, so people look seated */
.f-char.mgr { font-size: 42px; }
.mgr-desk .desk-top.wide { display: inline-flex; align-items: flex-end; gap: 10px; padding: 4px 28px 12px; border-radius: 12px; font-size: 28px; }
.desk-items { font-size: 16px; }
.nameplate { display: block; margin: 6px auto 0; width: max-content; padding: 2px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #fff; background: var(--grad); }
.f-chair { position: absolute; transform: translate(-50%, -50%); width: 58px; height: 58px; border-radius: 16px 16px 8px 8px; background: linear-gradient(180deg, #4c1d95, #2e1065); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.2); z-index: 2; }
.f-char.shout { animation: shout 0.5s ease-in-out infinite; cursor: pointer; }
.f-char.shout::before { content: "📣"; position: absolute; left: -26px; top: 2px; font-size: 22px; animation: pop 0.5s ease-in-out infinite; }
.f-char.shout .f-bubble { border-color: #f59e0b; background: #fef3c7; color: #92400e; font-weight: 700; font-size: 13px; }
.f-char.called::before { content: "❗"; position: absolute; left: 50%; top: -38px; transform: translateX(-50%); font-size: 20px; animation: bob 0.8s ease-in-out infinite; }
@keyframes shout { 0%, 100% { transform: translate(-50%, -50%) rotate(0); } 25% { transform: translate(-50%, -55%) rotate(-4deg); } 75% { transform: translate(-50%, -55%) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .f-char.shout, .f-char.shout::before, .f-char.called::before { animation: none; } }

/* Stuck teammates jump and call for help */
.f-char.jump { animation: jump 0.9s ease-in-out infinite; }
.f-char.jump .f-bubble { border-color: #ef4444; background: #fee2e2; color: #991b1b; font-weight: 700; }
@keyframes jump { 0%, 100% { transform: translate(-50%, -50%); } 30% { transform: translate(-50%, -85%); } 50% { transform: translate(-50%, -50%); } 60% { transform: translate(-50%, -62%); } }
@media (prefers-reduced-motion: reduce) { .f-char.jump { animation: none; } }

/* Office controls */
select.small-select { width: auto; padding: 6px 10px; font-size: 13px; border-radius: 8px; }

/* Talking to the team in a meeting */
.talkbar { display: none; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); border: 2px solid var(--accent); }
.talkbar.open { display: flex; }
.talkbar input { flex: 1 1 320px; }
.talk-hints { flex-basis: 100%; }
.mic.listening { background: #fee2e2; color: #b91c1c; border-color: #ef4444; animation: pulse 1s ease-in-out infinite; }
.floor.meeting .rug { background: radial-gradient(circle, rgba(219, 39, 119, 0.18), var(--info-bg)); }

/* Notifications */
.side .bell { display: flex; align-items: center; justify-content: space-between; width: 100%; background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.18); }
.bell-count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #f43f5e; color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.bell.ring { animation: none; } /* calm: the count is enough */
@keyframes ring { 0%, 88%, 100% { transform: rotate(0); } 90% { transform: rotate(-4deg); } 94% { transform: rotate(4deg); } 97% { transform: rotate(-2deg); } }
.notes { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.notes li { padding: 10px 12px; border-radius: 10px; cursor: pointer; background: var(--surface-2); }
.notes li.unread { background: var(--info-bg); box-shadow: inset 3px 0 0 var(--accent); }
.notes li:hover { filter: brightness(0.98); }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
@media (prefers-reduced-motion: reduce) { .bell.ring { animation: none; } }

/* Scrolling lists and long text */
.scroll-box { max-height: 60vh; overflow-y: auto; padding-right: 6px; overscroll-behavior: contain; }
.scroll-box::-webkit-scrollbar { width: 8px; }
.scroll-box::-webkit-scrollbar-thumb { background: rgba(109, 40, 217, 0.35); border-radius: 99px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp.open { display: block; -webkit-line-clamp: unset; }
.link-btn { border: none; background: none; padding: 2px 0; color: var(--accent); font-weight: 600; cursor: pointer; }
.link-btn:hover { transform: none; text-decoration: underline; }

/* Sidebar stays in place while the page scrolls */
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
@media (max-width: 760px) { .side { position: static; height: auto; } }

/* ---------- documents ---------- */
.doc-picker summary { cursor: pointer; font-weight: 600; }
.doc-list:empty { display: none; }
.doc-chip { gap: 8px; justify-content: space-between; }
.doc-row { gap: 6px; flex-wrap: wrap; }

/* ---------- Kabir ↔ Claude Code ---------- */
.cc-chat { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px 2px; }
.cc-msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line, #e5e0f5); }
.cc-msg.dev { align-self: flex-end; background: #f1ecff; border-bottom-right-radius: 4px; }
.cc-msg.claude { align-self: flex-start; background: #fff7ed; border-bottom-left-radius: 4px; }
.cc-who { font-weight: 600; margin-bottom: 4px; opacity: .8; }
.cc-status { align-self: center; text-align: center; }

/* ---------- Manager's to-do (office floor) ---------- */
.f-agenda { padding: 12px 16px; border-radius: 12px; background: #f6f1ff; color: #1f2430; border: 2px solid #d6c8f5; font-size: 14px; cursor: pointer; }
.f-agenda ul { margin: 6px 0 0; padding-left: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; }
@media (max-width: 760px) { .f-agenda { font-size: 12px; } }
.danger-zone summary { cursor: pointer; color: #c0392b; font-weight: 600; }

/* Links that look like buttons (e.g. open in VS Code) */
a.button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line, #e5e0f5); background: var(--card, #fff); color: inherit; text-decoration: none; font-weight: 600; }
a.button:hover { filter: brightness(0.97); }
.cc-body.clamped { max-height: 5.2em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }

/* ✕ close button in the corner of every popup */
.dlg-close { position: sticky; top: 0; float: right; z-index: 5; width: 36px; height: 36px; margin: -8px -10px 0 8px; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.dlg-close:hover:not(:disabled) { background: var(--accent); color: var(--accent-text); border-color: var(--accent); transform: none; }

/* "Your turn": the first thing in a person's task window */
.your-turn { border: 2px solid var(--accent); }
.plain-steps { margin: 4px 0 6px; padding-left: 22px; display: grid; gap: 6px; line-height: 1.5; }

/* Password field with a show/hide button. The eye sits inside the box and
   never moves: no transform, so the app-wide button hover can't shift it. */
.pw-field { position: relative; }
.pw-field input { width: 100%; margin: 0; }
.pw-eye, .pw-eye:hover:not(:disabled) { position: absolute; top: 0; bottom: 0; right: 6px; margin: auto 0; width: 36px; height: 32px; padding: 0; border: none; border-radius: 8px; background: transparent; font-size: 17px; line-height: 1; cursor: pointer; box-shadow: none; transform: none; }
.pw-eye:hover:not(:disabled) { background: rgba(0, 0, 0, 0.06); }

/* Login page: the selected tab is clear, and the brand pill fits its text */
.auth .tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(109, 40, 217, 0.08); }
.auth .tabs [role="tab"] { flex: 1; border: none; background: transparent; box-shadow: none; font-weight: 600; color: var(--muted, #6b7280); }
.auth .tabs [role="tab"].active { background: var(--surface, #fff); color: var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.auth .tabs [role="tab"]:hover:not(:disabled) { transform: none; }
.auth-pitch p.pill { display: inline-flex; width: max-content; max-width: 100%; }
.notes li.sorted { opacity: 0.55; }

/* Sidebar: details live under "More" */
.nav-more summary { cursor: pointer; list-style: none; padding: 8px 12px; color: rgba(255, 255, 255, 0.65); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary::after { content: " ▾"; }
.nav-more[open] summary::after { content: " ▴"; }
.nav-more button { font-size: 14px; opacity: 0.9; }

/* Home: "What you need to do now" */
.todo-now { border: 2px solid var(--accent); background: linear-gradient(135deg, rgba(124, 58, 237, 0.07), rgba(236, 72, 153, 0.05)); }
.todo-now.calm { border-color: var(--border); background: var(--surface); }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.todo-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.todo-icon { font-size: 22px; }
.todo-text { flex: 1; font-weight: 600; }
.todo-text .small { font-weight: 400; }
.small-stat { font-size: 22px; }
details.settings > summary { cursor: pointer; }

/* Meeting transcript: what everyone said, newest at the bottom */
.meeting-log { flex-basis: 100%; display: grid; gap: 6px; max-height: 260px; overflow-y: auto; margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; line-height: 1.45; }
.meeting-log:empty { display: none; }
.ml-line.you { color: var(--accent); }
.ml-line.manager strong { color: #7c3aed; }
.ml-line.team strong { color: #db2777; }
.ml-line.system, .ml-line.thinking { color: var(--muted, #6b7280); font-style: italic; }

/* Goal cards that open and close */
.goal-title { cursor: pointer; }
.goal-summary { gap: 10px; align-items: center; }
.goal-summary .grow { flex: 1; }
.goal-progress { width: 160px; height: 8px; border-radius: 99px; background: var(--surface-2, #eef0f4); overflow: hidden; }
.goal-progress span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #10b981, #34d399); }
.card.collapsed { padding-bottom: 14px; }
.task-counts { gap: 6px; flex-wrap: wrap; }

/* Projects & goals */
.project-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.project-tabs button { border: none; background: transparent; box-shadow: none; padding: 8px 14px; border-radius: 10px; font-weight: 600; color: var(--muted, #6b7280); }
.project-tabs button:hover:not(:disabled) { transform: none; background: rgba(109, 40, 217, 0.06); }
.project-tabs button.active { background: var(--accent); color: var(--accent-text, #fff); }
.project-tabs button.active:hover:not(:disabled) { background: var(--accent); color: var(--accent-text, #fff); }
.project-tabs .tab-count { margin-left: 8px; padding: 0 7px; border-radius: 99px; font-size: 12px; background: rgba(0, 0, 0, 0.08); }
.project-tabs button.active .tab-count { background: rgba(255, 255, 255, 0.25); }
.project-tabs .tab-new { color: var(--accent); }
.project-chip { display: inline-block; margin-right: 10px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; vertical-align: middle; color: var(--accent); background: rgba(109, 40, 217, 0.08); }

/* AI spend */
.spend-head { gap: 40px; align-items: flex-end; }
.muted-stat { color: var(--muted, #6b7280); font-size: 26px; }
.spend-bar { height: 8px; border-radius: 99px; background: var(--surface-2, #eef0f4); overflow: hidden; }
.spend-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #db2777); }
.spend-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spend-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted, #6b7280); padding: 6px 4px; }
.spend-table td { padding: 8px 4px; border-top: 1px solid var(--border); }

/* Team room */
.team-room { background: #fffbf3; border: 1px solid #f3e3c3; }
.room-list { display: grid; gap: 8px; max-height: 240px; overflow-y: auto; font-size: 14px; line-height: 1.45; }
.room-line strong { color: #b45309; }
.ml-line.cost { font-size: 12px; }

/* ===================== Calm, premium look =====================
   One accent colour, a deep ink sidebar, quiet shadows and no gradient
   text. Comes last so it settles everything above. */
:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f2f2f5;
  --text: #111318;
  --muted: #646a78;
  --border: #e6e7eb;
  --accent: #4f46e5;
  --accent-soft: #eef0ff;
  --info-bg: #eef0ff;
  --grad: var(--accent);
  --radius: 12px;
  --shadow: 0 1px 2px rgba(17, 19, 24, 0.04), 0 1px 1px rgba(17, 19, 24, 0.02);
  --shadow-lg: 0 12px 32px rgba(17, 19, 24, 0.10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e12;
    --surface: #15171c;
    --surface-2: #1c1f26;
    --text: #ececf0;
    --muted: #9a9fac;
    --border: #262a33;
    --accent: #8b8cf8;
    --accent-soft: #1e2040;
    --info-bg: #1e2040;
    --grad: var(--accent);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  }
}
body {
  background: var(--bg);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
h1 { font-size: 26px; font-weight: 650; letter-spacing: -0.022em; }
h2 { font-size: 17px; font-weight: 620; letter-spacing: -0.01em; }
h3 { font-size: 14.5px; font-weight: 620; }
main { padding-top: 32px; }

/* Buttons: solid, no lift */
button, .btn { border-radius: 8px; font-weight: 500; }
button:hover:not(:disabled) { transform: none; background: var(--surface-2); }
button.primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); box-shadow: none; font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); box-shadow: none; }
@media (prefers-color-scheme: dark) { button.primary { color: #0d0e12; } }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

/* Cards: a hairline border instead of glow */
.card { border: 1px solid var(--border); box-shadow: var(--shadow); }
.grid > .card:hover { transform: none; }
.stat { background: none; color: var(--text); -webkit-background-clip: border-box; background-clip: border-box; font-weight: 650; font-size: 28px; letter-spacing: -0.02em; }
.pill { font-weight: 550; }
.pill.info { background: var(--accent-soft); color: var(--accent); }

/* Sidebar: deep ink, white text, a thin accent marker */
.side { background: #101116; color: #e7e8ec; padding: 22px 12px; border-right: 1px solid #1d1f26; }
.side .brand { background: none; color: #fff; -webkit-background-clip: border-box; background-clip: border-box; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.side .brand span, .side .brand em { color: #a5a6ff; }
.side select, .side > button.small, .side .bell { background: #181a21; border-color: #262833; color: #e7e8ec; }
.side select option { background: #181a21; color: #e7e8ec; }
.side nav button { display: flex; align-items: center; gap: 10px; color: #b8bbc6; font-size: 14px; border-radius: 8px; padding: 8px 10px; }
.side nav button:hover { background: #181a21; color: #fff; }
.side nav button[aria-current="page"] { background: #1d1f28; color: #fff; box-shadow: inset 2px 0 0 #8b8cf8; font-weight: 600; }
.side .muted { color: #8a8d99 !important; }
.side .bell { gap: 10px; justify-content: flex-start; }
.side .bell .bell-count { margin-left: auto; }
.nav-more summary { color: #6f7280; font-size: 11.5px; padding: 10px 10px 6px; }
.ico { display: inline-flex; width: 18px; height: 18px; flex: none; opacity: 0.9; }
.bell-count { background: var(--accent); }

/* Home: what needs you */
.todo-now { border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); background: var(--surface); box-shadow: inset 3px 0 0 var(--accent), var(--shadow); }
.turn, .your-turn { border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: inset 3px 0 0 var(--accent); }
.banner { border-left-width: 3px; }

/* Spend */
.spend-bar span { background: var(--accent); }

/* Sign-in page and the "how it works" strip */
.auth-pitch { background: #101116; color: #fff; }
.auth-pitch h1 { font-size: 32px; font-weight: 650; }
.howto { background: var(--surface); color: var(--text); border: 1px solid var(--border); font-weight: 500; }
.howto .arrow { color: var(--accent); }
.atwork { background: var(--surface); border: 1px solid var(--border); }
.atwork .bar > span { background: var(--accent); }
.face { background: var(--surface-2); }
@media (prefers-color-scheme: dark) { .face { background: var(--surface-2); } }

/* Office: a plain warm floor instead of the checkerboard */
.floor { background-color: #f4f1ec; background-image: radial-gradient(rgba(0, 0, 0, 0.045) 1px, transparent 1px); background-size: 22px 22px; border-color: var(--border); }
@media (prefers-color-scheme: dark) { .floor { background-color: #17181d; background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px); } }
.floor .rug { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.tabs-office { background: var(--surface-2); }
dialog { box-shadow: var(--shadow-lg); border-color: var(--border); }
.side { min-width: 0; overflow-x: hidden; }
.side-email { padding: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-icon { font-size: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.f-agenda { background: var(--surface) !important; border: 1px solid var(--border) !important; color: var(--text); }
.team-room { background: var(--surface); border: 1px solid var(--border); }
.wa-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.wa-text { white-space: pre-wrap; padding: 10px 12px; border-radius: 10px; background: #e7fbe9; color: #0b2e13; }
@media (prefers-color-scheme: dark) { .wa-text { background: #12301b; color: #d6f5dc; } }
a.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; }

/* Chat boxes (developer ↔ Claude Code, meeting, team room): newest at the
   bottom, own scroll, the page never moves. */
.chat-wrap { position: relative; flex-basis: 100%; }
.chat-log { overflow-y: auto; overscroll-behavior: contain; }
.chat-log.room-list { max-height: 280px; }
.chat-new { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); border-radius: 999px; background: var(--accent); color: #fff; border: none; padding: 5px 14px; box-shadow: var(--shadow-lg); }
.chat-new:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }

/* Meeting: conversation on top, typing row at the bottom, taller box */
.talkbar.open { display: grid; gap: 10px; border-width: 1px; }
.talkbar .chat-wrap { order: 0; }
.talk-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.talk-row input { flex: 1 1 320px; }
.meeting-log { max-height: min(56vh, 520px); margin-top: 0; font-size: 15px; }
.meeting-log:empty { display: block; min-height: 120px; }
.meeting-log:empty::before { content: "Say hi to the team…"; color: var(--muted); }
.floor { transition: height 0.3s ease; }
.floor.meeting { height: 300px; }
.meeting-log { max-height: max(220px, calc(100vh - 520px)); }
.talk-row { position: sticky; bottom: 0; z-index: 3; padding: 8px 0 2px; background: var(--surface); }

/* Goal cards: the title takes the space left and is cut short with "…", so the
   status and buttons sit in the same place on every card. */
.goal-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.goal-head h2 { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; }
.goal-head .project-chip { flex: none; }
.goal-head .goal-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-head > .row { flex-wrap: nowrap; justify-content: flex-end; }
@media (max-width: 760px) {
  .goal-head { grid-template-columns: 1fr; }
  .goal-head > .row { flex-wrap: wrap; justify-content: flex-start; }
}
.update-ready { position: fixed; right: 18px; bottom: 18px; z-index: 50; border-radius: 999px; background: var(--accent); color: #fff; border: none; padding: 8px 16px; box-shadow: var(--shadow-lg); }
.update-ready:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }

/* Past meetings */
.meeting-list { display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; }
.meeting-item { display: grid; gap: 4px; text-align: left; padding: 12px 14px; border-radius: 10px; }
.meeting-log.past { max-height: 50vh; }

/* Running work: how far along and about how long is left */
.eta-cell { display: grid; gap: 4px; justify-items: start; }
.eta { display: grid; gap: 3px; min-width: 140px; }
.eta-bar { height: 6px; width: 100%; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.eta-bar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.6s ease; }
.eta.late .eta-bar span { background: #d97706; }
.eta.late .small { color: #b45309; }
.eta-now { color: var(--text); }
.live-now .eta { margin-top: 6px; max-width: 320px; }
.app-link { gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); }
.area-chip { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 6px; font-size: 11.5px; font-family: ui-monospace, Consolas, monospace; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.tech-details summary { color: var(--muted); cursor: pointer; }
.tech-text { white-space: pre-wrap; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; background: var(--surface-2); padding: 10px 12px; border-radius: 8px; }

/* The plan at a glance */
.plan-summary { padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); font-size: 15.5px; line-height: 1.55; }
.plan-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.plan-fact { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); display: grid; gap: 4px; align-content: start; }
.plan-fact-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.plan-fact ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 14px; }
.plan-more { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; background: var(--surface); }
.plan-more > summary { cursor: pointer; font-weight: 600; }
.plan-more[open] > summary { margin-bottom: 8px; }
.plan-risks { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }

/* A row whose state just changed: a soft highlight that fades */
@keyframes row-flash { from { background: var(--accent-soft); } to { background: transparent; } }
tr.just-changed td { animation: row-flash 2.4s ease-out; }

/* Task tables keep their shape: fixed columns, one-line live status */
table.task-table { table-layout: fixed; width: 100%; }
table.task-table col.col-who { width: 210px; }
table.task-table col.col-status { width: 250px; }
table.task-table td { overflow-wrap: anywhere; }
table.task-table .eta { min-width: 0; }
table.task-table .eta-now { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { table.task-table col.col-status { width: 170px; } }
.app-link { flex-wrap: wrap; }
.app-guide { flex-basis: 100%; margin-top: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; max-height: 360px; overflow: auto; }
.app-guide > summary { cursor: pointer; font-weight: 600; }

/* Clients: choosing a project kind, the conversation, request chips */
.kind-choices { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.kind-choice { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; }
.kind-choice.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.convo { max-height: 50vh; overflow-y: auto; padding: 4px; }
.request-chip { color: var(--text); background: var(--surface-2); }
.project-tabs .tab-flag { margin-left: 6px; }


/* Messages with numbered steps keep their line breaks. */
.keep-lines { white-space: pre-line; }

/* A problem with its fix: what happened, why, then numbered steps. */
.fix-steps { display: flex; flex-direction: column; gap: 6px; color: var(--text); font-size: 14px; line-height: 1.5; }
.fix-steps p { margin: 0; }
.fix-what { font-weight: 600; }
.fix-why { color: var(--muted); }
.fix-head { margin-top: 4px !important; font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.fix-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.fix-list li::marker { font-weight: 700; color: var(--accent); }
.fix-tip { font-size: 13px; color: var(--muted); }
.handle { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.handle code { padding: 1px 6px; border-radius: 6px; background: var(--info-bg); font-size: 13px; }

/* Urgent: lit (with a soft glow) while something still needs someone. */
.side .urgent-btn { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 8px; background: #181a21; border: 1px solid #262833; color: #b8bbc6; }
.side .urgent-btn .bell-count { margin-left: auto; }
.side .urgent-btn.alert { background: #3b1219; border-color: #ef4444; color: #fff; font-weight: 600; animation: urgent-glow 2s ease-in-out infinite; }
.side .urgent-btn.alert .bell-count { background: #ef4444; color: #fff; }
@keyframes urgent-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); } 50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); } }
@media (prefers-reduced-motion: reduce) { .side .urgent-btn.alert { animation: none; } }
.urgent-list { display: flex; flex-direction: column; gap: 12px; }
.urgent-item { padding: 14px 16px; border-radius: 10px; border: 1px solid var(--border); border-left: 4px solid #ef4444; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.urgent-item.approve { border-left-color: var(--accent); }
.urgent-item.is-hidden { opacity: 0.7; }

/* A small "⋯" menu (goal card actions): opens below, closes when picked or clicked again. */
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; padding: 2px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); line-height: 1.6; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu .menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; display: flex; flex-direction: column; gap: 4px; min-width: 150px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }
details.menu .menu-list button { text-align: left; }

/* Sidebar: when the menu doesn't fit the window it scrolls; items never squash
   into each other (flex items shrink by default). A slim, quiet scrollbar. */
.side > * { flex-shrink: 0; }
.side .grow { flex: 1 0 8px; }
.side { overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #2a2d38 transparent; }
.side::-webkit-scrollbar { width: 6px; }
.side::-webkit-scrollbar-thumb { background: #2a2d38; border-radius: 6px; }
.side::-webkit-scrollbar-track { background: transparent; }

/* Anything marked hidden stays hidden, even when a class gives it display:flex. */
[hidden] { display: none !important; }

/* Sidebar layout: brand and workspace on top, alerts and sign-out pinned at the
   bottom, and only the menu in between scrolls (the sidebar itself never does). */
.side { overflow-y: hidden; }
.side > nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: #2a2d38 transparent; }
.side > nav::-webkit-scrollbar { width: 6px; }
.side > nav::-webkit-scrollbar-thumb { background: #2a2d38; border-radius: 6px; }
.side-foot { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid #1d1f26; }
@media (max-width: 760px) {
  .side { overflow-y: visible; }
  .side > nav { overflow: visible; flex: 1 1 100%; }
  .side-foot { flex-direction: row; flex-wrap: wrap; border-top: none; width: 100%; }
}
.side-foot > button.small { background: #181a21; border-color: #262833; color: #e7e8ec; }

/* Short code in text copies on a click. */
:not(pre) > code { cursor: copy; }
:not(pre) > code:hover { outline: 1px dashed var(--border); outline-offset: 1px; }

/* Long text folded to its first lines (Show more / Show less). */
.folded {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
