/* Fundy Work. Light only: white, a cool grey, and Fundy blue for the one thing that matters on
   each screen. Corners: 10px on controls, 14px on cards, full on pills. */
:root {
  --blue: #0055FF; --blue-press: #0044CC; --wash: #E8F0FF; --paper: #F7F9FD; --card: #FFFFFF; --ink: #0B1A33; --ink2: #2B3A55; --muted: #5B6780;
  --line: #E1E7F1; --track: #EDF1F8; --green: #287052; --green-bg: #E7F2EC; --coral: #C64B40; --coral-bg: #FBEDEB; --amber: #9A6400; --amber-bg: #FBF3E2;
  --r: 10px; --r-card: 14px; --side: 264px; --panel: 440px; --head: 54px;
  --shadow: 0 1px 2px rgba(11, 26, 51, .05), 0 8px 28px rgba(11, 26, 51, .10);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--card); color: var(--ink); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 22px; letter-spacing: -.02em; }
h2 { font-size: 16px; letter-spacing: -.01em; }
h3 { font-size: 13px; font-weight: 600; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
::selection { background: #CFE0FF; }
.icon { flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.cut { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { display: grid; place-items: center; }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); font-weight: 600; white-space: nowrap; transition: background .12s, border-color .12s, transform .08s; }
.btn:hover { background: var(--paper); border-color: #CFD8E6; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-press); border-color: var(--blue-press); }
.btn.danger { color: var(--coral); }
.btn.danger:hover { background: var(--coral-bg); border-color: #EBC6C1; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.ghost { border-color: transparent; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px; color: var(--muted); position: relative; }
.icon-btn:hover, .icon-btn.on { background: var(--track); color: var(--ink); }
.icon-btn.on { color: var(--blue); background: var(--wash); }
.link { color: var(--blue); font-weight: 600; }
.link:hover { text-decoration: underline; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea, select { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); outline: none; transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; padding: 9px 12px; resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 85, 255, .14); }
input::placeholder, textarea::placeholder { color: #8893A8; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); margin: 0; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.field > small { color: var(--muted); font-size: 12px; }
.check { display: flex; align-items: center; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg { display: inline-flex; background: var(--track); border-radius: var(--r); padding: 2px; gap: 2px; }
.seg button { height: 28px; padding: 0 11px; border-radius: 8px; font-weight: 600; font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(11, 26, 51, .12); }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--track); color: var(--ink2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.blue { background: var(--wash); color: var(--blue); }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.red { background: var(--coral-bg); color: var(--coral); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.badge.quiet { background: var(--track); color: var(--muted); }
.kbd { font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 3px 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--card); }
.avatar { position: relative; display: inline-grid; place-items: center; border-radius: 30%; background: var(--wash); color: var(--blue); font-weight: 700; flex: none; user-select: none; }
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.avatar.bot { background: var(--blue); }
.avatar .on { position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: #2DA06B; border: 2px solid var(--card); }
.empty { display: grid; place-items: center; text-align: center; padding: 48px 24px; color: var(--muted); gap: 10px; }
.empty .icon { color: #A9B4C7; }
.empty strong { color: var(--ink); font-size: 15px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--blue); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--track), #F6F8FC, var(--track)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Frame */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); height: 100dvh; }
.app.has-panel { grid-template-columns: var(--side) minmax(0, 1fr) var(--panel); }
.side { background: var(--paper); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-head { height: var(--head); display: flex; align-items: center; gap: 9px; padding: 0 10px 0 16px; flex: none; }
.side-head b { font-size: 15px; letter-spacing: -.01em; }
.side-search { margin: 0 10px 8px; height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--muted); width: calc(100% - 20px); }
.side-search:hover { border-color: #CFD8E6; }
.side-scroll { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.nav-item { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 8px; border-radius: 8px; color: var(--ink2); width: 100%; text-align: left; }
.nav-item:hover { background: var(--track); text-decoration: none; }
.nav-item.on { background: var(--wash); color: var(--blue); font-weight: 600; }
.nav-item.unread { color: var(--ink); font-weight: 700; }
.nav-item .icon { color: var(--muted); }
.nav-item.on .icon { color: var(--blue); }
.nav-item .live { color: var(--green); display: inline-flex; }
.nav-item.sub { padding-left: 34px; height: 30px; }
.side-title { display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 4px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.side-title .icon-btn { width: 24px; height: 24px; }
.side-foot { border-top: 1px solid var(--line); padding: 8px; display: flex; align-items: center; gap: 8px; flex: none; }
.side-foot .me { display: flex; align-items: center; gap: 9px; padding: 5px 6px; border-radius: 8px; text-align: left; min-width: 0; flex: 1; }
.side-foot .me:hover { background: var(--track); }
.offline { background: var(--amber-bg); color: var(--amber); font-size: 12.5px; font-weight: 600; padding: 6px 16px; }
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view-head { height: var(--head); flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.view-head h1 { font-size: 16px; display: flex; align-items: center; gap: 7px; min-width: 0; }
.view-head .sub { color: var(--muted); font-size: 13px; }
.view-body { flex: 1; min-height: 0; overflow-y: auto; }
.pad { padding: 20px; }
.narrow { max-width: 860px; margin: 0 auto; width: 100%; }
.back { display: none; }
.panel { border-left: 1px solid var(--line); min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--card); }
.panel-head { height: var(--head); flex: none; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; }
.tabs { display: none; }

/* Dialogs, menus, toasts */
.overlay { position: fixed; inset: 0; background: rgba(11, 26, 51, .32); display: grid; place-items: center; padding: 20px; z-index: 50; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); width: min(480px, 100%); max-height: min(86dvh, 820px); display: flex; flex-direction: column; animation: rise .16s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.modal.wide { width: min(720px, 100%); }
.modal > header { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 10px 20px; }
.modal-body { padding: 4px 20px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.menu { position: fixed; z-index: 60; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 5px; max-height: 70dvh; overflow-y: auto; }
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; height: 32px; padding: 0 9px; border-radius: 7px; text-align: left; }
.menu button:hover, .menu button.sel { background: var(--track); }
.menu button.danger { color: var(--coral); }
.menu button small { margin-left: auto; color: var(--muted); }
.menu button span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-grid button { width: 30px; height: 30px; justify-content: center; padding: 0; font-size: 18px; }
#toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; max-width: min(92vw, 520px); animation: rise .16s; }
.toast.bad { background: #8E2F26; }
.toast .link { color: #9FC0FF; }

/* Chat */
.msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0 4px; display: flex; flex-direction: column; }
.msgs > .spacer { flex: 1; }
.day { display: flex; align-items: center; gap: 12px; padding: 10px 20px 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.new-line { display: flex; align-items: center; gap: 10px; padding: 2px 20px; color: var(--blue); font-size: 11.5px; font-weight: 700; }
.new-line::before { content: ""; flex: 1; height: 1px; background: var(--blue); opacity: .5; }
.msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 5px 20px; position: relative; }
.msg:hover, .msg.hot { background: var(--paper); }
.msg.flash { animation: flash 1.6s; }
@keyframes flash { 0%, 40% { background: var(--wash); } }
.msg.tight { padding-top: 1px; padding-bottom: 1px; }
.msg.tight .msg-avatar { visibility: hidden; height: 0; }
.msg-time { display: none; }
.msg.tight:hover .msg-time { display: block; position: absolute; left: 14px; top: 4px; font-size: 10.5px; color: var(--muted); }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-head b { font-weight: 700; }
.msg-head time, .msg-head .tag { color: var(--muted); font-size: 12px; }
.msg-body { overflow-wrap: anywhere; }
.msg-body .gap { height: 8px; }
.msg-body pre, .prose pre { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; overflow-x: auto; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 4px 0; white-space: pre-wrap; }
.msg-body code, .prose code { background: var(--track); border-radius: 5px; padding: 1px 5px; font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; }
.msg-body blockquote, .prose blockquote { margin: 3px 0; padding: 1px 0 1px 10px; border-left: 3px solid var(--line); color: var(--ink2); }
.msg-body ul { margin: 2px 0; padding-left: 20px; }
.msg.system { grid-template-columns: 1fr; padding: 3px 20px 3px 66px; color: var(--muted); font-size: 13px; }
.msg.deleted .msg-body { color: var(--muted); font-style: italic; }
.mention { background: var(--wash); color: var(--blue); border-radius: 5px; padding: 0 3px; font-weight: 600; }
.mention.me { background: #FFF1C9; color: #7A5200; }
.msg-tools { position: absolute; right: 16px; top: -14px; display: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 8px rgba(11, 26, 51, .08); padding: 2px; z-index: 2; }
.msg:hover .msg-tools, .msg.hot .msg-tools { display: flex; }
.msg-tools button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); font-size: 15px; }
.msg-tools button:hover { background: var(--track); color: var(--ink); }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.react { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--track); border: 1px solid transparent; font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.react.mine { background: var(--wash); border-color: #B9D0FF; color: var(--blue); }
.react:hover { border-color: #CFD8E6; }
.thread-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 3px 8px 3px 4px; border-radius: 8px; color: var(--blue); font-weight: 600; font-size: 12.5px; }
.thread-link:hover { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.thread-link small { color: var(--muted); font-weight: 400; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.files img { max-width: min(360px, 100%); max-height: 300px; border-radius: 10px; border: 1px solid var(--line); display: block; cursor: zoom-in; }
.file { display: flex; align-items: center; gap: 9px; padding: 8px 12px 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--ink); max-width: 320px; }
.file:hover { background: var(--paper); text-decoration: none; }
.file small { color: var(--muted); display: block; }
.card { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); max-width: 460px; color: var(--ink); text-align: left; width: 100%; }
.card:hover { border-color: #CFD8E6; text-decoration: none; }
.card .ic { width: 32px; height: 32px; border-radius: 9px; background: var(--wash); color: var(--blue); display: grid; place-items: center; flex: none; }
.card small { color: var(--muted); display: block; }
.poll { margin-top: 6px; max-width: 420px; display: flex; flex-direction: column; gap: 6px; }
.poll button { position: relative; text-align: left; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; justify-content: space-between; gap: 10px; }
.poll button i { position: absolute; inset: 0 auto 0 0; background: var(--wash); z-index: 0; transition: width .2s; }
.poll button span, .poll button b { position: relative; z-index: 1; }
.poll button.mine { border-color: var(--blue); }
.typing { height: 18px; padding: 0 20px; color: var(--muted); font-size: 12px; flex: none; }
.composer { margin: 0 16px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); flex: none; position: relative; transition: border-color .12s, box-shadow .12s; }
.composer:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 85, 255, .12); }
.composer textarea { border: 0; box-shadow: none !important; padding: 11px 12px 4px; resize: none; max-height: 40dvh; min-height: 40px; display: block; background: transparent; }
.composer-tools { display: flex; align-items: center; gap: 2px; padding: 4px 6px 6px; }
.composer-tools .send { margin-left: auto; width: 32px; height: 32px; border-radius: 9px; background: var(--blue); color: #fff; display: grid; place-items: center; }
.composer-tools .send[disabled] { background: var(--track); color: #A9B4C7; }
.composer .pending { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px 0; }
.suggest { position: absolute; left: 8px; bottom: calc(100% + 6px); width: min(360px, calc(100% - 16px)); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 5px; z-index: 5; max-height: 280px; overflow-y: auto; }
.suggest button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px; border-radius: 7px; text-align: left; }
.suggest button.sel, .suggest button:hover { background: var(--wash); }
.suggest small { color: var(--muted); margin-left: auto; white-space: nowrap; }
.jump { position: absolute; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 3; box-shadow: var(--shadow); border-radius: 999px; }
.huddle-bar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--green-bg); color: var(--green); font-weight: 600; flex: none; }
.ephemeral { margin: 4px 20px 8px 66px; padding: 10px 12px; border: 1px dashed #C9D4E6; border-radius: 12px; background: var(--paper); white-space: pre-wrap; }
.ephemeral > small { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-bottom: 4px; }

/* Fundy Bot */
.bot-steps { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 8px; }
.bot-step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.bot-step.done { color: var(--ink2); }
.bot-step .icon { color: var(--green); }
.bot-answer { white-space: pre-wrap; }
.bot-answer.thinking { color: var(--muted); }

/* Work */
.toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex: none; flex-wrap: wrap; }
.toolbar select { width: auto; height: 32px; }
.group-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 6px; font-weight: 700; font-size: 13px; position: sticky; top: 0; background: var(--card); z-index: 1; }
.task-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--track); width: 100%; text-align: left; color: var(--ink); }
.task-row:hover { background: var(--paper); text-decoration: none; }
.task-row.on { background: var(--wash); }
.task-row .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row.done .t { color: var(--muted); text-decoration: line-through; }
.task-row .meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.sdot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #A9B4C7; display: inline-grid; place-items: center; flex: none; color: #fff; }
.sdot.doing { border-color: var(--blue); background: conic-gradient(var(--blue) 50%, transparent 0); }
.sdot.review { border-color: var(--amber); background: var(--amber); }
.sdot.done { border-color: var(--green); background: var(--green); }
.due { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.due.late { color: var(--coral); font-weight: 600; }
.prio { display: inline-flex; }
.prio.p1 { color: var(--coral); } .prio.p2 { color: var(--amber); } .prio.p3 { color: var(--blue); } .prio.p4 { color: #A9B4C7; }
.bar { height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue); border-radius: inherit; transition: width .25s; }
.bar.done i { background: var(--green); }
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; padding: 16px; height: 100%; overflow-x: auto; align-items: start; }
.column { background: var(--paper); border-radius: var(--r-card); padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; max-height: 100%; overflow-y: auto; }
.column.over { box-shadow: inset 0 0 0 2px var(--blue); }
.column > header { display: flex; align-items: center; gap: 8px; padding: 4px 6px; font-weight: 700; font-size: 13px; }
.task-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; text-align: left; cursor: grab; color: var(--ink); }
.task-card:hover { border-color: #CFD8E6; text-decoration: none; }
.task-card.dragging { opacity: .4; }
.task-card .meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.task-title { font-size: 20px; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; border: 0 !important; box-shadow: none !important; padding: 0 !important; resize: none; overflow: hidden; display: block; }
.meta-grid { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.meta-grid > span { color: var(--muted); font-size: 13px; }
.meta-grid select, .meta-grid input { height: 32px; }
.section { padding: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.section > h3 { display: flex; align-items: center; justify-content: space-between; }
.steps { display: flex; flex-direction: column; }
.step { display: flex; align-items: flex-start; gap: 10px; padding: 6px 4px; border-radius: 8px; }
.step:hover { background: var(--paper); }
.step input { margin-top: 2px; }
.step.done span { color: var(--muted); text-decoration: line-through; }
.step .icon-btn { width: 22px; height: 22px; visibility: hidden; margin-left: auto; }
.step:hover .icon-btn { visibility: visible; }
.prose { line-height: 1.6; overflow-wrap: anywhere; }
.prose h1 { font-size: 26px; margin: 22px 0 8px; } .prose h2 { font-size: 19px; margin: 20px 0 6px; } .prose h3 { font-size: 15px; color: var(--ink); margin: 16px 0 4px; } .prose h4 { font-size: 13.5px; margin: 12px 0 2px; }
.prose p { margin: 0 0 10px; } .prose ul, .prose ol { margin: 0 0 10px; padding-left: 22px; } .prose li { margin: 2px 0; } .prose li.nested { margin-left: 18px; list-style: circle; }
.prose img { max-width: 100%; border-radius: 10px; } .prose table { border-collapse: collapse; margin: 8px 0; } .prose td, .prose th { border: 1px solid var(--line); padding: 6px 10px; }
.prose [data-time] { color: var(--muted); font-size: 12px; }
.copy-block { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 10px 12px; margin: 6px 0 10px; }
.copy-block pre { font: inherit; white-space: pre-wrap; margin: 0 0 8px; background: none; border: 0; padding: 0; }
.thread-item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 7px 0; }
.thread-item.event { grid-template-columns: 1fr; color: var(--muted); font-size: 12.5px; padding: 3px 0 3px 38px; }
.proof { border: 1px solid #BFE0CF; background: var(--green-bg); border-radius: 12px; padding: 10px 12px; }
.callout { border-radius: 12px; padding: 12px 14px; background: var(--wash); display: flex; flex-direction: column; gap: 10px; }
.callout.amber { background: var(--amber-bg); }
.callout.green { background: var(--green-bg); }
.goal { border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.goal .num { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

/* Calendar */
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(104px, 1fr); border-left: 1px solid var(--line); flex: 1; min-height: 0; }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); flex: none; }
.cal-dow span { padding: 6px 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-day { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow: hidden; cursor: pointer; }
.cal-day:hover { background: var(--paper); }
.cal-day.out { background: #FBFCFE; }
.cal-day.out .n { color: #A9B4C7; }
.cal-day .n { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-size: 12.5px; font-weight: 600; }
.cal-day.today .n { background: var(--blue); color: #fff; }
.cal-chip { display: flex; align-items: center; gap: 5px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--wash); color: #0A3FB8; font-size: 12px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 100%; text-align: left; flex: none; }
.cal-chip.task { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink2); font-weight: 500; }
.cal-chip.busy { background: var(--track); color: var(--muted); font-weight: 500; }
.cal-chip.proposed { background: var(--amber-bg); color: var(--amber); }
.cal-chip.no { text-decoration: line-through; opacity: .6; }
.cal-chip small { font-weight: 500; opacity: .8; }
.cal-more { font-size: 11.5px; color: var(--muted); padding: 0 6px; }
.cal-week { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); position: relative; }
.cal-week .hours div { height: 48px; font-size: 11px; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.cal-col { border-left: 1px solid var(--line); position: relative; background-image: linear-gradient(var(--track) 1px, transparent 1px); background-size: 100% 48px; }
.cal-col.today { background-color: #FAFCFF; }
.cal-event { position: absolute; left: 3px; right: 3px; border-radius: 8px; background: var(--wash); border-left: 3px solid var(--blue); padding: 3px 6px; font-size: 12px; overflow: hidden; color: #0A3FB8; text-align: left; }
.cal-event.busy { background: var(--track); border-color: #A9B4C7; color: var(--muted); }
.cal-event.proposed { background: var(--amber-bg); border-color: var(--amber); color: var(--amber); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--coral); z-index: 2; }
.agenda-day { padding: 14px 20px 4px; font-weight: 700; font-size: 13px; color: var(--muted); }
.agenda-item { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 12px; padding: 10px 20px; align-items: center; width: 100%; text-align: left; border-bottom: 1px solid var(--track); }
.agenda-item:hover { background: var(--paper); }
.guest { display: flex; align-items: center; gap: 9px; padding: 5px 0; }
.slots { display: flex; flex-wrap: wrap; gap: 6px; }

/* Docs and slides */
.doc-card { border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px; display: flex; flex-direction: column; gap: 8px; color: var(--ink); min-height: 96px; }
.doc-card:hover { border-color: #CFD8E6; text-decoration: none; background: var(--paper); }
.editor-bar { display: flex; align-items: center; gap: 2px; padding: 6px 12px; border-bottom: 1px solid var(--line); flex: none; overflow-x: auto; }
.editor-bar button { min-width: 30px; height: 30px; padding: 0 7px; border-radius: 7px; font-weight: 700; color: var(--ink2); display: inline-grid; place-items: center; white-space: nowrap; }
.editor-bar button:hover { background: var(--track); }
.editor-bar i { width: 1px; height: 18px; background: var(--line); margin: 0 5px; }
.doc-title { font-size: 30px; font-weight: 800; letter-spacing: -.025em; border: 0 !important; box-shadow: none !important; padding: 0 !important; height: auto !important; }
.editor { outline: none; min-height: 50dvh; padding-bottom: 30dvh; font-size: 15.5px; }
.editor:empty::before { content: "Start writing…"; color: #8893A8; }
.deck { display: grid; grid-template-columns: 176px minmax(0, 1fr); flex: 1; min-height: 0; }
.thumbs { border-right: 1px solid var(--line); overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--paper); }
.thumb { border: 2px solid transparent; border-radius: 9px; padding: 0; position: relative; background: none; }
.thumb.on { border-color: var(--blue); }
.thumb .slide { text-align: left; font-weight: 400; pointer-events: none; }
.thumb small { position: absolute; left: 6px; top: 4px; font-size: 10px; color: var(--muted); font-weight: 700; z-index: 1; }
.stage { overflow: auto; padding: 24px; display: flex; flex-direction: column; gap: 14px; align-items: center; background: var(--track); }
.slide { width: 100%; aspect-ratio: 16 / 9; background: #fff; border-radius: 10px; box-shadow: 0 1px 2px rgba(11, 26, 51, .08), 0 6px 22px rgba(11, 26, 51, .08); position: relative; overflow: hidden; container-type: inline-size; color: var(--ink); }
.slide .in { position: absolute; inset: 0; padding: 7cqw 8cqw; display: flex; flex-direction: column; gap: 2.4cqw; }
.slide [contenteditable] { outline: none; border-radius: .6cqw; min-width: 4cqw; }
.slide [contenteditable]:focus { box-shadow: 0 0 0 .3cqw rgba(0, 85, 255, .2); }
.slide [contenteditable]:empty::before { content: attr(data-ph); opacity: .35; }
.slide .s-title { font-size: 4.6cqw; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.slide .s-sub { font-size: 2.3cqw; color: var(--muted); line-height: 1.35; }
.slide .s-body { font-size: 2.5cqw; line-height: 1.5; white-space: pre-wrap; }
.slide .s-bullets { font-size: 2.6cqw; line-height: 1.45; display: flex; flex-direction: column; gap: 1.4cqw; }
.slide .s-bullets div { padding-left: 3cqw; position: relative; }
.slide .s-bullets div::before { content: ""; position: absolute; left: .4cqw; top: 1.25cqw; width: 1cqw; height: 1cqw; border-radius: 50%; background: var(--blue); }
.slide .s-mark { position: absolute; right: 3.4cqw; bottom: 3cqw; opacity: .9; }
.slide .s-mark svg { height: 3.4cqw; width: auto; display: block; }
.slide .s-no { position: absolute; left: 3.4cqw; bottom: 3cqw; font-size: 1.4cqw; color: var(--muted); }
.slide.title { background: var(--blue); color: #fff; }
.slide.title .in { justify-content: center; }
.slide.title .s-title { font-size: 7.4cqw; }
.slide.title .s-sub { color: #D6E4FF; font-size: 2.8cqw; }
.slide.number .in, .slide.quote .in { justify-content: center; }
.slide .s-number { font-size: 15cqw; font-weight: 800; letter-spacing: -.05em; color: var(--blue); line-height: 1; }
.slide .s-quote { font-size: 3.8cqw; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.slide .s-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4cqw; flex: 1; }
.slide .s-cols > div { border-top: .35cqw solid var(--blue); padding-top: 1.6cqw; font-size: 2.3cqw; line-height: 1.5; white-space: pre-wrap; }
.slide .s-img { flex: 1; min-height: 0; border-radius: 1cqw; background: var(--paper); border: .15cqw dashed #C9D4E6; display: grid; place-items: center; color: var(--muted); font-size: 1.8cqw; overflow: hidden; cursor: pointer; }
.slide .s-img img { width: 100%; height: 100%; object-fit: contain; }
.print-only { display: none; }
.present { position: fixed; inset: 0; background: #0B1A33; z-index: 90; display: grid; place-items: center; }
.present .slide { width: min(100vw, 177.78vh); border-radius: 0; box-shadow: none; }
.present .hud { position: fixed; right: 16px; bottom: 14px; color: #8FA0BF; font-size: 12px; display: flex; gap: 12px; align-items: center; }
.present .hud button { color: #fff; }

/* Lists used by Inbox, Mail, HQ */
.item { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--track); align-items: flex-start; width: 100%; text-align: left; color: var(--ink); }
.item:hover { background: var(--paper); text-decoration: none; }
.item.unread { background: #FAFCFF; }
.item.unread .t { font-weight: 700; }
.item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-top: 6px; flex: none; }
.item .dot.off { background: transparent; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px; }
.tile b { display: block; font-size: 24px; letter-spacing: -.02em; }
.tile span { color: var(--muted); font-size: 12.5px; }
.tile.warn b { color: var(--coral); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--track); vertical-align: middle; }
.table select { height: 30px; width: auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); }
.box { border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.secret { font: 600 14px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; overflow-wrap: anywhere; user-select: all; }

/* Huddle */
.huddle { position: fixed; right: 18px; bottom: 18px; width: min(380px, calc(100vw - 36px)); background: var(--ink); color: #fff; border-radius: 18px; box-shadow: var(--shadow); z-index: 40; overflow: hidden; display: flex; flex-direction: column; }
.huddle.big { inset: 18px; width: auto; }
.huddle-top { display: flex; align-items: center; gap: 8px; padding: 12px 12px 6px 16px; font-weight: 700; }
.huddle-top small { color: #9FB0CC; font-weight: 500; }
.huddle-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; padding: 8px 12px; flex: 1; min-height: 0; }
.htile { background: #16284A; border-radius: 12px; min-height: 84px; display: grid; place-items: center; position: relative; overflow: hidden; }
.htile.talking { box-shadow: inset 0 0 0 2px #5C95FF; }
.htile video { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.htile.screen video { object-fit: contain; background: #000; }
.htile .name { position: absolute; left: 8px; bottom: 6px; font-size: 11.5px; font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); display: flex; gap: 5px; align-items: center; z-index: 1; }
.huddle.big .huddle-tiles { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.huddle-ctl { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px 12px; }
.huddle-ctl button { width: 40px; height: 40px; border-radius: 12px; background: #1D3157; color: #fff; display: grid; place-items: center; }
.huddle-ctl button:hover { background: #27406F; }
.huddle-ctl button.off { background: #fff; color: var(--ink); }
.huddle-ctl button.on { background: var(--blue); }
.huddle-ctl button.leave { background: #C64B40; width: auto; padding: 0 14px; font-weight: 700; gap: 6px; display: inline-flex; align-items: center; }
.captions { max-height: 96px; overflow-y: auto; padding: 0 16px 8px; font-size: 12.5px; color: #C9D6EE; display: flex; flex-direction: column; gap: 3px; }
.captions b { color: #fff; }
.ring { position: fixed; right: 18px; top: 18px; z-index: 70; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 14px; display: flex; align-items: center; gap: 12px; animation: rise .2s; }

/* Sign in */
.auth { min-height: 100dvh; display: grid; place-items: center; background: var(--paper); padding: 24px; }
.auth-card { width: min(400px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.auth-card .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.auth-card h1 { font-size: 22px; }
.auth-card .err { color: var(--coral); font-weight: 600; font-size: 13px; }
.auth-card .btn { height: 42px; }
.code-input { font: 700 18px ui-monospace, SFMono-Regular, Menlo, monospace !important; letter-spacing: .08em; text-align: center; height: 46px !important; }

/* Phones */
@media (max-width: 820px) {
  .app, .app.has-panel { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .side { border-right: 0; }
  .app.detail .side { display: none; }
  .app:not(.detail) .main { display: none; }
  .panel { position: fixed; inset: 0; z-index: 30; border: 0; }
  .back { display: inline-grid; }
  .tabs { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); padding-bottom: env(safe-area-inset-bottom); }
  .app.detail.chatting .tabs { display: none; }
  .tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; color: var(--muted); font-size: 10.5px; font-weight: 600; position: relative; }
  .tabs a.on { color: var(--blue); }
  .tabs a:hover { text-decoration: none; }
  .tabs .badge { position: absolute; top: 3px; left: calc(50% + 6px); }
  .view-head { padding: 0 10px; }
  .msg { padding-left: 12px; padding-right: 12px; }
  .msg.system { padding-left: 58px; }
  .msg-tools { right: 8px; }
  .composer { margin: 0 8px 8px; }
  .board { grid-template-columns: repeat(4, 82vw); }
  .cal-month { grid-auto-rows: minmax(72px, 1fr); }
  .cal-chip { font-size: 10.5px; padding: 0 3px; }
  .cal-chip small { display: none; }
  .deck { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .thumbs { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .thumb { width: 110px; flex: none; }
  .grid2 { grid-template-columns: 1fr; }
  .overlay { padding: 0; place-items: end center; }
  .modal, .modal.wide { width: 100%; border-radius: 18px 18px 0 0; max-height: 92dvh; }
  .huddle { right: 8px; left: 8px; bottom: 64px; width: auto; }
  .pad { padding: 14px; }
  .ephemeral { margin-left: 12px; }
}
/* The app inside the iPhone and Mac apps shows only the page, not its own menu. */
.embed .side, .embed .tabs, .embed .back { display: none !important; }
.embed .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.embed .app:not(.detail) .main { display: flex; }
@media print {
  .side, .tabs, .view-head, .thumbs, .editor-bar, .huddle, #toasts { display: none !important; }
  .app, .main, .view, .view-body, .deck, .stage { display: block !important; height: auto !important; overflow: visible !important; background: #fff !important; padding: 0 !important; }
  .slide { box-shadow: none; border-radius: 0; page-break-after: always; break-after: page; width: 100vw; }
  .stage > * { display: none !important; }
  .stage > .print-only { display: block !important; }
  @page { size: landscape; margin: 0; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
