/* Oddhouse Hub. Every colour is a token here; see DESIGN.md for the reasoning. */

@font-face { font-family: "Instrument Sans"; src: url("/fonts/InstrumentSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/fonts/InstrumentSans-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/fonts/InstrumentSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: dark;

  /* brand */
  --ink: #141413;
  --cream: #fffbef;

  /* surfaces: ink stepped up in small increments */
  --bg: #191917;
  --s1: #1f1f1d;
  --s2: #252523;
  --s3: #2c2c29;
  --s4: #343431;

  /* text: cream at three strengths */
  --t1: rgb(255 251 239 / 0.92);
  --t2: rgb(255 251 239 / 0.68);
  --t3: rgb(255 251 239 / 0.54);

  /* lines */
  --line: rgb(255 251 239 / 0.08);
  --line-2: rgb(255 251 239 / 0.14);
  --line-3: rgb(255 251 239 / 0.36);

  /* tints of cream for fills */
  --tint-1: rgb(255 251 239 / 0.04);
  --tint-2: rgb(255 251 239 / 0.07);
  --tint-3: rgb(255 251 239 / 0.11);

  /* meaning, muted */
  --late: #d09580;
  --late-tint: rgb(208 149 128 / 0.12);
  --done: #a1b394;

  /* task types: muted, always paired with their label */
  --type-admin: #a6afc2;
  --type-web: #8fb8b0;
  --type-social: #cfa0b4;
  --type-shoot: #d2b27c;

  --shadow-pop: 0 12px 32px rgb(0 0 0 / 0.45), 0 0 0 1px var(--line-2);

  /* type */
  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --fs-11: 11px;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-20: 20px;
  --fs-28: 28px;

  /* space (4 px grid) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  --r-1: 2px;
  --r-2: 4px;
  --r-3: 6px;

  --control: 32px;
  --sidebar: 240px;
  --topbar: 56px;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --fast: 120ms;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--t1);
  font: 400 var(--fs-14)/22px var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
img { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
::selection { background: rgb(255 251 239 / 0.24); }
:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--t3); }
.label {
  font: 500 var(--fs-11)/16px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t3);
}
kbd {
  display: inline-block;
  min-width: 18px;
  padding: 0 4px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-1);
  font: 400 var(--fs-11)/16px var(--mono);
  color: var(--t3);
  text-align: center;
}

/* ---------- icons ---------- */
.i {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: var(--control);
  padding: 0 var(--sp-3);
  border: 1px solid transparent;
  border-radius: var(--r-2);
  background: none;
  font-weight: 500;
  font-size: var(--fs-13);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease);
  user-select: none;
}
.btn.compact { height: 28px; padding: 0 var(--sp-2); }
.btn .i { margin-left: -2px; }
.btn kbd { margin-left: var(--sp-1); margin-right: -4px; }
.btn.primary { background: var(--cream); color: var(--ink); }
.btn.primary kbd { border-color: rgb(20 20 19 / 0.28); color: rgb(20 20 19 / 0.72); }
.btn.primary:hover { background: #ebe6d9; }
.btn.primary:active { background: #d9d4c7; }
.btn.secondary { border-color: var(--line-3); color: var(--t1); }
.btn.secondary:hover { background: var(--tint-2); }
.btn.secondary:active { background: var(--tint-3); }
.btn.ghost { color: var(--t2); }
.btn.ghost:hover { background: var(--tint-2); color: var(--t1); }
.btn.ghost:active { background: var(--tint-3); }
.btn.danger { color: var(--late); }
.btn.danger:hover { background: var(--late-tint); color: var(--late); }
.btn.danger.solid { border-color: rgb(208 149 128 / 0.5); }
.btn:disabled { opacity: 0.5; cursor: default; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--control);
  height: var(--control);
  flex: none;
  padding: 0;
  border: 0;
  border-radius: var(--r-2);
  background: none;
  color: var(--t2);
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.icon-btn.small { width: 24px; height: 24px; }
.icon-btn:hover { background: var(--tint-2); color: var(--t1); }
.icon-btn:active { background: var(--tint-3); }

/* ---------- form controls ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: var(--fs-12); line-height: 16px; font-weight: 500; color: var(--t2); }
.hint { font-size: var(--fs-12); line-height: 16px; color: var(--t3); }
input:not([type="file"]):not([type="checkbox"]), select, textarea {
  width: 100%;
  min-width: 0;
  height: var(--control);
  padding: 0 var(--sp-3);
  border: 1px solid var(--line-3);
  border-radius: var(--r-2);
  background: var(--s1);
  font-size: var(--fs-14);
  transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
textarea { height: auto; padding: 6px var(--sp-3); line-height: 20px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: rgb(255 251 239 / 0.5); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--cream); box-shadow: 0 0 0 1px var(--cream); }
::placeholder { color: var(--t3); opacity: 1; }
input[type="date"], input[type="time"] { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: var(--fs-13); }
::-webkit-calendar-picker-indicator { filter: invert(0.9); opacity: 0.6; cursor: pointer; }
select {
  appearance: none;
  padding-right: 32px;
  background-image: url("/chevron.svg");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
}
/* Windows draws the open list with the option's own colours, so set them explicitly. */
select option, select optgroup { background-color: var(--s2); color: var(--t1); }
.inline { display: flex; gap: var(--sp-2); }
.prefixed { display: flex; align-items: center; border: 1px solid var(--line-3); border-radius: var(--r-2); background: var(--s1); }
.prefixed:focus-within { border-color: var(--cream); box-shadow: 0 0 0 1px var(--cream); }
.prefixed > span { padding-left: var(--sp-3); color: var(--t3); }
.prefixed input { border: 0 !important; box-shadow: none !important; background: none !important; padding-left: 4px !important; }
.form-error { font-size: var(--fs-13); color: var(--late); }

/* segmented control */
.seg { display: inline-flex; align-items: center; height: var(--control); padding: 2px; border: 1px solid var(--line-2); border-radius: var(--r-2); gap: 2px; }
.seg > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-1);
  background: none;
  color: var(--t2);
  font-size: var(--fs-13);
  font-weight: 500;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.seg > button:hover { background: var(--tint-2); color: var(--t1); }
.seg > button[aria-checked="true"] { background: var(--s4); color: var(--t1); }
.seg-picker { display: inline-flex; }

/* user picker (listbox with avatars) */
.picker { position: relative; display: block; }
.picker-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  height: var(--control);
  padding: 0 8px 0 6px;
  border: 1px solid var(--line-3);
  border-radius: var(--r-2);
  background: var(--s1);
  text-align: left;
  font-size: var(--fs-14);
  transition: border-color var(--fast) var(--ease);
}
.picker-btn:hover { border-color: rgb(255 251 239 / 0.5); }
.picker-btn > .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-btn > .i { color: var(--t2); }
.picker.inline-picker .picker-btn { width: auto; height: 26px; border: 0; background: none; color: var(--t2); font-size: var(--fs-13); font-weight: 500; padding: 0 6px 0 4px; border-radius: var(--r-1); }
.picker.inline-picker .picker-btn:hover { background: var(--tint-2); color: var(--t1); }
.picker.inline-picker.active .picker-btn { background: var(--s4); color: var(--t1); }

.menu {
  position: absolute;
  z-index: 40;
  min-width: 200px;
  max-height: 264px;
  overflow: auto;
  padding: 4px;
  border-radius: var(--r-3);
  background: var(--s3);
  box-shadow: var(--shadow-pop);
}
.menu [role="option"] {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: var(--control);
  padding: 0 var(--sp-2);
  border-radius: var(--r-2);
  font-size: var(--fs-13);
  color: var(--t1);
  cursor: pointer;
  white-space: nowrap;
}
.menu [role="option"] .sub { margin-left: auto; padding-left: var(--sp-3); color: var(--t3); font: var(--fs-11)/16px var(--mono); }
.menu [role="option"][aria-selected="true"]::after { content: ""; margin-left: auto; width: 10px; height: 6px; border-left: 1.5px solid var(--t2); border-bottom: 1.5px solid var(--t2); transform: rotate(-45deg) translate(1px, -2px); }
.menu [role="option"].active { background: var(--tint-3); }
.mention-menu [role="option"]::after { display: none; }
.picker .menu { top: calc(100% + 4px); left: 0; }

/* ---------- avatar ---------- */
.av {
  --size: 24px;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: var(--r-2);
  background: var(--s4);
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--t1);
  font: 600 calc(var(--size) * 0.4) / 1 var(--sans);
  letter-spacing: 0.02em;
  overflow: hidden;
  user-select: none;
}
.av img { width: 100%; height: 100%; object-fit: cover; }
/* House characters are head-and-neck portraits; zoom in on the face so they read at 20–32 px. */
.av img[src^="/animals/"] { transform: scale(1.3); transform-origin: 50% 38%; }
.av.none { background: none; box-shadow: none; outline: 1px dashed var(--line-3); outline-offset: -1px; }
.av.none .i { width: 70%; height: 70%; color: var(--t3); }
.av.s16 { --size: 16px; border-radius: var(--r-1); font-size: 8px; }
.av.s20 { --size: 20px; border-radius: var(--r-1); }
.av.s32 { --size: 32px; }
.av.s64 { --size: 64px; border-radius: var(--r-3); }
.av.s96 { --size: 96px; border-radius: var(--r-3); }
.av.removed { opacity: 0.6; }

/* ---------- auth ---------- */
.auth { display: grid; grid-template-columns: minmax(280px, 5fr) minmax(360px, 4fr); min-height: 100%; }
.auth-mark { display: flex; flex-direction: column; justify-content: space-between; padding: var(--sp-7) var(--sp-7) var(--sp-6); border-right: 1px solid var(--line); }
/* The logo always sits as ink artwork on a rounded cream tile. */
.logo-frame { background-color: var(--cream); border-radius: 16px; }
.auth-lockup { width: 200px; height: auto; padding: var(--sp-5); box-sizing: content-box; }
.auth-foot { font-size: var(--fs-12); color: var(--t3); }
.auth-panel { display: flex; align-items: center; padding: var(--sp-7); background: var(--s1); }
.auth-form { display: grid; gap: var(--sp-4); width: 100%; max-width: 360px; }
.eyebrow { font: 500 var(--fs-11)/16px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--t3); }
.auth-form h1 { margin-top: calc(var(--sp-2) * -1); font-size: var(--fs-28); line-height: 34px; font-weight: 600; letter-spacing: -0.02em; }
.auth-sub { margin-top: calc(var(--sp-2) * -1); margin-bottom: var(--sp-2); color: var(--t2); }
.auth-actions { display: flex; gap: var(--sp-2); align-items: center; margin-top: var(--sp-2); }
.auth-actions .btn.primary { min-width: 120px; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); height: 100%; }
.sidebar { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--bg); }
.sb-head { display: flex; align-items: center; justify-content: space-between; height: var(--topbar); padding: 0 var(--sp-3) 0 var(--sp-4); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; margin-left: -4px; border-radius: 8px; }
.brand img:first-child { width: 22px; height: 22px; }
.brand-word { width: 112px; height: auto; margin-top: 1px; }
.sb-close { display: none; }
.sb-nav { flex: 1; min-height: 0; overflow-y: auto; padding: var(--sp-4) var(--sp-2); }
.sb-label { padding: 0 var(--sp-2); margin-bottom: var(--sp-1); }
.sb-label-row { display: flex; align-items: center; justify-content: space-between; margin-top: var(--sp-5); margin-bottom: var(--sp-1); padding-right: 4px; }
.sb-label-row .sb-label { margin: 0; }
.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: var(--control);
  padding: 0 var(--sp-2);
  border: 0;
  border-radius: var(--r-2);
  background: none;
  color: var(--t2);
  font-size: var(--fs-14);
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.sb-item:hover { background: var(--tint-1); color: var(--t1); }
.sb-item[aria-current="page"] { background: var(--tint-2); color: var(--t1); }
.sb-item .i { color: var(--t3); }
.sb-item[aria-current="page"] .i { color: var(--t1); }
.sb-item > span:not(.sb-count):not(.unread) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-count { font-size: var(--fs-12); color: var(--t3); }
.sb-channels .sb-item { font-weight: 400; }
.sb-channels .sb-item.has-unread { color: var(--t1); font-weight: 600; }
.unread { width: 6px; height: 6px; border-radius: 1px; background: var(--cream); flex: none; }
.sb-foot { display: grid; gap: 2px; padding: var(--sp-2); border-top: 1px solid var(--line); }
.sb-me { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px var(--sp-2); border: 0; border-radius: var(--r-2); background: none; text-align: left; transition: background-color var(--fast) var(--ease); }
.sb-me:hover { background: var(--tint-1); }
.sb-me-text { display: grid; min-width: 0; }
.sb-me-name { font-size: var(--fs-13); font-weight: 500; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-me-sub { font-size: var(--fs-11); line-height: 16px; color: var(--t3); }
.scrim { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: var(--sp-3); height: var(--topbar); flex: none; padding: 0 var(--sp-5); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; margin-left: -8px; }
.view-title { font-size: var(--fs-20); line-height: 28px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-title .hash { color: var(--t3); font-weight: 400; margin-right: 2px; }
.view-title .month-year { font-family: var(--mono); font-weight: 400; color: var(--t3); font-size: var(--fs-16); margin-left: var(--sp-2); letter-spacing: 0; }
.view-title .m-short { display: none; }
.topbar-tools { display: flex; align-items: center; gap: var(--sp-3); margin-left: auto; }
.month-nav { display: flex; align-items: center; gap: 2px; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---------- chat ---------- */
.messages { flex: 1; min-height: 0; overflow-y: auto; padding: var(--sp-5) 0 var(--sp-3); overscroll-behavior: contain; }
.messages:focus { outline: none; }
.msg-inner { max-width: 760px; padding: 0 var(--sp-5); }
.day-rule { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-5) 0 var(--sp-3); }
.day-rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day-rule:first-child { margin-top: 0; }
.msg { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: var(--sp-3); padding: 2px 0; }
.msg.head { margin-top: var(--sp-3); }
.msg .av { grid-row: span 2; margin-top: 3px; }
.msg-meta { display: flex; align-items: baseline; gap: var(--sp-2); }
.msg-name { font-weight: 600; font-size: var(--fs-14); }
.msg-name.removed { color: var(--t3); font-weight: 500; }
.msg-time { font-size: var(--fs-11); color: var(--t3); }
.msg-body { grid-column: 2; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--t1); }
.msg-body a { color: var(--t1); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; }
.msg-body a:hover { text-decoration-color: var(--cream); }
.mention { padding: 0 2px; border-radius: var(--r-1); background: var(--tint-2); font-weight: 600; }
.mention.me { background: var(--cream); color: var(--ink); }
.task-ref { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin: 0 1px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: var(--r-1); background: var(--tint-1); color: var(--t1); font: 500 var(--fs-13)/20px var(--sans); vertical-align: bottom; transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease); }
.task-ref:hover { background: var(--tint-3); border-color: var(--line-3); }
.task-ref.done .task-ref-title { color: var(--t2); text-decoration: line-through; text-decoration-color: var(--line-3); }
.task-ref-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; }
.menu .opt-title { overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.load-more { margin: 0 0 var(--sp-3); }
.empty { display: grid; gap: 4px; padding: var(--sp-6) var(--sp-5); color: var(--t3); }
.empty strong { color: var(--t2); font-weight: 500; }
.messages .empty { padding: 0; max-width: 760px; margin: 0 var(--sp-5); }

.composer { position: relative; flex: none; padding: var(--sp-2) var(--sp-5) var(--sp-4); }
.composer-box { display: flex; align-items: flex-end; gap: var(--sp-2); max-width: 760px; padding: 4px 4px 4px var(--sp-3); border: 1px solid var(--line-3); border-radius: var(--r-3); background: var(--s1); transition: border-color var(--fast) var(--ease); }
.composer-box:focus-within { border-color: var(--cream); box-shadow: 0 0 0 1px var(--cream); }
.composer-box textarea { flex: 1; height: 24px; max-height: 200px; padding: 4px 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; resize: none; line-height: 20px; overflow-y: auto; }
.composer .send { color: var(--t2); width: 28px; height: 28px; }
.composer-hint { margin-top: 6px; font-size: var(--fs-11); color: var(--t3); }
.composer-hint kbd { min-width: 0; border: 0; padding: 0; color: var(--t2); }
.mention-menu { bottom: calc(100% - 4px); left: var(--sp-5); }

/* ---------- board ---------- */
.board-bar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: var(--sp-2); height: var(--control); margin-left: auto; padding: 0 var(--sp-2); border: 1px solid var(--line-2); border-radius: var(--r-2); color: var(--t3); width: 240px; transition: border-color var(--fast) var(--ease); }
.search:focus-within { border-color: var(--cream); box-shadow: 0 0 0 1px var(--cream); }
.search input { height: 28px !important; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; font-size: var(--fs-13) !important; }
.search input::-webkit-search-cancel-button { filter: invert(1); opacity: .5; }
.board { flex: 1; min-height: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(196px, 1fr); overflow-x: auto; overscroll-behavior-x: contain; }
.col { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.col:last-child { border-right: 0; }
.col-head { display: flex; align-items: center; gap: var(--sp-2); height: 44px; padding: 0 var(--sp-2) 0 var(--sp-4); flex: none; }
.col-head .label { color: var(--t2); }
.col-count { font: 400 var(--fs-11)/16px var(--mono); color: var(--t3); }
.col-head .icon-btn { margin-left: auto; width: 28px; height: 28px; }
.col-list { flex: 1; min-height: 80px; overflow-y: auto; overflow-x: hidden; padding: 0 var(--sp-3) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.col.drop-target .col-list { background: var(--tint-1); }
.col-empty { padding: var(--sp-3) var(--sp-1); font-size: var(--fs-13); color: var(--t3); }
.drop-line { height: 2px; margin: -5px 0; border-radius: 1px; background: var(--cream); flex: none; }

.card {
  position: relative;
  min-width: 0;
  display: grid;
  gap: var(--sp-2);
  padding: 10px var(--sp-3) var(--sp-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  background: var(--s2);
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.card:hover { border-color: rgb(255 251 239 / 0.26); }
.card.dragging { opacity: 0.4; }
.card.late { box-shadow: inset 2px 0 0 var(--late); }
.card-title { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; font-size: var(--fs-14); line-height: 20px; font-weight: 500; color: var(--t1); overflow-wrap: anywhere; border-radius: var(--r-1); }
.card.is-done .card-title { color: var(--t2); }
.card-eyebrow { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; margin-bottom: -4px; }
.type-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 2px; box-shadow: inset 0 0 0 1.5px var(--line-3); }
.type-dot.t-admin { background: var(--type-admin); box-shadow: none; }
.type-dot.t-web { background: var(--type-web); box-shadow: none; }
.type-dot.t-social { background: var(--type-social); box-shadow: none; }
.type-dot.t-shoot { background: var(--type-shoot); box-shadow: none; }
.type-tag { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 0 6px 0 5px; border-radius: var(--r-1); font: 500 var(--fs-11)/18px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
.type-tag.t-admin { color: var(--type-admin); background: rgb(166 175 194 / 0.12); }
.type-tag.t-web { color: var(--type-web); background: rgb(143 184 176 / 0.12); }
.type-tag.t-social { color: var(--type-social); background: rgb(207 160 180 / 0.12); }
.type-tag.t-shoot { color: var(--type-shoot); background: rgb(210 178 124 / 0.12); }
.card-eyebrow .card-tag { margin: 0; min-width: 0; }
.card-client { display: inline-flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; font: 600 var(--fs-11)/18px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--cc, var(--t2)); }
.card-client > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.card-tag { margin-bottom: -4px; font: 500 var(--fs-11)/16px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--t3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-links { display: grid; gap: 2px; }
.card-link { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 2px 4px; margin: 0 -4px; border-radius: var(--r-1); font-size: var(--fs-12); line-height: 18px; color: var(--t2); text-decoration: none; }
.card-link:hover { background: var(--tint-2); color: var(--t1); }
.card-link .i { width: 12px; height: 12px; color: var(--t3); }
.card-link .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host-hint { flex: none; font: 500 10px/14px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--t3); padding: 0 4px; border: 1px solid var(--line-2); border-radius: var(--r-1); }
.card-more { font-size: var(--fs-12); color: var(--t3); }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--sp-3); min-width: 0; min-height: 20px; font: 400 var(--fs-12)/16px var(--mono); color: var(--t3); }
.av-wrap { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }
.reviewer-av { display: inline-flex; align-items: center; gap: 2px; color: var(--t3); }
.reviewer-av .i { width: 12px; height: 12px; }
.meta-bit { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; flex: none; }
.meta-bit .i { width: 12px; height: 12px; }
.meta-bit.late { color: var(--late); }
.meta-bit.done { color: var(--done); }
.meta-bit.tag { display: block; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ---------- calendar ---------- */
.cal-bar { display: flex; align-items: center; padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); font-size: var(--fs-12); color: var(--t2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }

.shape { display: inline-block; flex: none; width: 8px; height: 8px; background: var(--t2); }
.shape.shoot { border-radius: 50%; background: var(--cream); }
.shape.deliverable { border-radius: 0; background: var(--cream); }
.shape.meeting { border-radius: 50%; background: none; box-shadow: inset 0 0 0 1.5px var(--cream); }
.shape.other { height: 2px; width: 8px; border-radius: 1px; background: var(--t2); }
.chip.late .shape.deadline { box-shadow: inset 0 0 0 1.5px var(--late); }
.shape.deadline { width: 7px; height: 7px; background: none; box-shadow: inset 0 0 0 1.5px var(--t2); transform: rotate(45deg); margin: 0 1px; }

.cal { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: 32px; grid-auto-rows: minmax(120px, auto); align-content: start; }
.cal-dow { position: sticky; top: 0; z-index: 2; height: 32px; display: flex; align-items: center; padding: 0 var(--sp-2); background: var(--bg); border-bottom: 1px solid var(--line); font: 500 var(--fs-11)/16px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--t3); }
.cal-dow.weekend, .day.weekend { background-color: rgb(0 0 0 / 0.12); }
.cal-dow.weekend { background-color: #171715; }
.day { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 6px 6px var(--sp-2); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; transition: background-color var(--fast) var(--ease); }
.day:nth-child(7n + 7) { border-right: 0; }
.day:hover { background-color: var(--tint-1); }
.day.outside .day-num { color: rgb(255 251 239 / 0.36); }
.day-top { display: flex; align-items: center; justify-content: space-between; height: 22px; margin-bottom: 2px; }
.day-num { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: var(--r-1); font: 400 var(--fs-12)/1 var(--mono); color: var(--t2); }
.day.today .day-num { background: var(--cream); color: var(--ink); font-weight: 500; }
.day-add { width: 22px; height: 22px; opacity: 0; }
.day:hover .day-add, .day-add:focus-visible { opacity: 1; }
.chip {
  display: grid;
  gap: 1px;
  width: 100%;
  min-width: 0;
  padding: 4px 6px 5px;
  border: 0;
  border-radius: var(--r-1);
  background: var(--s2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--t1);
  font-size: var(--fs-12);
  line-height: 16px;
  text-align: left;
  transition: background-color var(--fast) var(--ease);
}
.chip:hover { background: var(--s4); }
.chip.deadline { background: none; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--t2); }
.chip.deadline.late { box-shadow: inset 0 0 0 1px rgb(208 149 128 / 0.36); }
.chip-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chip .ttl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.chip-meta { display: flex; align-items: center; gap: 8px; min-width: 0; padding-left: 14px; font: 400 var(--fs-11)/16px var(--mono); color: var(--t3); }
.chip.late .chip-meta .time { color: var(--late); }
.chip .who { display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; white-space: nowrap; }
.chip .who > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.chip .lc { display: inline-flex; align-items: center; gap: 2px; flex: none; margin-left: auto; }
.chip .lc .i { width: 11px; height: 11px; }

.agenda { display: none; }
.agenda-day { display: grid; gap: var(--sp-1); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.agenda-day .label { display: flex; justify-content: space-between; align-items: center; }
.agenda .chip { padding: 8px 10px; font-size: var(--fs-13); line-height: 20px; }

/* ---------- dialogs ---------- */
.dialog {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: var(--r-3);
  background: var(--s3);
  color: var(--t1);
  box-shadow: var(--shadow-pop);
  overflow: visible;
}
.dialog.wide { width: min(640px, calc(100vw - 32px)); }
.dialog.narrow { width: min(400px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgb(10 10 9 / 0.66); }
.dialog > form, .dialog > .dialog-inner { display: flex; flex-direction: column; max-height: calc(100dvh - 48px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 var(--sp-2) 0 var(--sp-5); border-bottom: 1px solid var(--line); flex: none; }
.dialog-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); padding: var(--sp-5); overflow-y: auto; overflow-x: hidden; min-height: 0; }
.dialog .dialog-body input:not([type="file"]), .dialog .dialog-body select, .dialog .dialog-body textarea, .dialog .picker-btn, .dialog .prefixed { background-color: var(--s2); }
.dialog-foot { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--line); flex: none; }
.dialog-foot .btn.danger { margin-left: calc(var(--sp-2) * -1); }
.confirm-match { margin-top: var(--sp-2); }
.confirm-match strong { color: var(--t1); font-weight: 600; user-select: none; }
#confirm-ok:disabled { opacity: 0.4; cursor: not-allowed; }
.dialog-meta { flex: 1; min-width: 0; font-size: var(--fs-11); color: var(--t3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }
.title-input { height: 40px !important; font-size: var(--fs-16) !important; font-weight: 600; letter-spacing: -0.005em; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.kinds { width: 100%; }
.kinds > button { flex: 1; justify-content: center; }
.confirm-title { font-weight: 600; font-size: var(--fs-16); margin-bottom: var(--sp-1); }
.section-label { padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.stack { display: grid; gap: var(--sp-4); }

/* links editor */
.links-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.links-head { display: flex; align-items: center; gap: var(--sp-2); }
.links-list { display: grid; grid-template-columns: minmax(0, 1fr); }
.link-row { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; min-height: 36px; border-bottom: 1px solid var(--line); }
.link-row:first-child { border-top: 1px solid var(--line); }
.link-row a { display: flex; align-items: center; gap: var(--sp-2); flex: 1; min-width: 0; padding: 4px 0; color: var(--t1); text-decoration: none; font-size: var(--fs-13); }
.link-row a:hover .link-label { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-3); }
.link-row .i { color: var(--t3); }
.link-label { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 40%; }
.link-url { flex: 1; min-width: 0; font: var(--fs-12)/16px var(--mono); color: var(--t3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row .icon-btn { width: 28px; height: 28px; }
.link-add { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: var(--sp-2); }
.links-empty { font-size: var(--fs-13); color: var(--t3); }
/* ---------- task view: details left, comments right ---------- */
.dialog.task-dlg:focus { outline: none; }
.dialog.task-dlg { width: min(1120px, calc(100vw - 32px)); height: min(800px, calc(100dvh - 48px)); }
.task-dlg > form { height: 100%; max-height: none; }
.crumbs { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; font-size: var(--fs-12); color: var(--t2); }
.crumbs .i { color: var(--t3); }
.crumbs > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#t-crumb-client { display: inline-flex; align-items: center; gap: 6px; }
.crumb-sep { color: var(--t3); }
#task-dialog-title { color: var(--t1); }
.task-split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); }
.task-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--line); }
.task-main-scroll { flex: 1; padding: var(--sp-5) var(--sp-6) var(--sp-6); align-content: start; gap: var(--sp-5); }
.task-dlg .task-title { height: auto !important; padding: 4px 8px !important; margin: 0 -8px; border-color: transparent !important; background: transparent !important; font-size: 24px !important; line-height: 32px; font-weight: 600; letter-spacing: -0.015em; }
.task-dlg .task-title:hover { background: var(--tint-1) !important; }
.task-dlg .task-title:focus-visible { border-color: var(--cream) !important; }
.props { display: grid; grid-template-columns: 148px minmax(0, 1fr); margin: 0; row-gap: 2px; }
.prop { display: contents; }
.prop dt { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: var(--fs-13); color: var(--t2); }
.prop dt .i { color: var(--t3); }
.prop dd { display: flex; align-items: center; min-width: 0; min-height: 36px; margin: 0; }
.task-dlg .prop-control, .task-dlg .prop-picker .picker-btn { width: auto; max-width: 100%; min-width: 160px; height: 32px; border-color: transparent !important; background-color: transparent !important; font-size: var(--fs-13); }
.task-dlg .prop-control:hover, .task-dlg .prop-picker .picker-btn:hover { background-color: var(--tint-2) !important; }
.task-dlg .prop-control:focus-visible { border-color: var(--cream) !important; background-color: var(--s2) !important; }
.task-dlg .prop-picker { display: inline-block; }
.task-dlg .prop-picker .picker { display: inline-block; }
.task-dlg input.prop-control::placeholder { color: var(--t3); }
.prop-seg { flex-wrap: wrap; height: auto; border-color: transparent; padding: 0; margin-left: -2px; }
.prop-seg > button { height: 28px; }
.task-dlg .dialog-foot { padding: var(--sp-3) var(--sp-6); }
.task-side { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--s2); border-bottom-right-radius: var(--r-3); }
.side-head { display: flex; align-items: center; gap: var(--sp-2); height: 48px; flex: none; padding: 0 var(--sp-5); border-bottom: 1px solid var(--line); }
.side-title { font-size: var(--fs-14); font-weight: 600; }
.side-empty { padding: var(--sp-5); }
.side-wrap { flex: 1; min-height: 0; display: flex !important; flex-direction: column; }
.task-side .thread-list { flex: 1; max-height: none; padding: var(--sp-4) var(--sp-5); gap: var(--sp-4); align-content: start; }
.task-side .comment { grid-template-columns: 32px minmax(0, 1fr); gap: var(--sp-3); }
.task-side .comment .msg-body { font-size: var(--fs-14); line-height: 22px; }
.task-side .thread-compose { flex: none; padding: var(--sp-3) var(--sp-4) var(--sp-4); border-top: 1px solid var(--line); }
.task-side .composer-box { background: var(--s3); align-items: flex-end; }
.task-side .composer-box textarea { min-height: 44px; }
/* clients page */
.view-clients { overflow-y: auto; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-3); padding: var(--sp-5); align-content: start; }
.client-tile { position: relative; display: grid; gap: var(--sp-3); padding: var(--sp-4); border: 1px solid var(--line-2); border-radius: var(--r-3); background: var(--s1); cursor: pointer; overflow: hidden; transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease); }
.client-tile::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--cc, var(--line-2)); }
.client-tile:hover { border-color: rgb(255 251 239 / 0.26); background: var(--s2); }
.tile-head { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.client-mark.md { width: 44px; height: 44px; border-radius: var(--r-3); font-size: 15px; }
.tile-name { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tile-title { padding: 0; border: 0; background: none; text-align: left; font-size: var(--fs-16, 16px); line-height: 22px; font-weight: 600; color: var(--t1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: var(--r-1); }
.tile-stats { font-size: var(--fs-12); line-height: 16px; color: var(--t3); }
.tile-stats .late, .tile-next-day.late { color: var(--late); }
.tile-edit { flex: none; align-self: flex-start; margin: -6px -6px 0 0; opacity: 0.6; }
.client-tile:hover .tile-edit, .tile-edit:focus-visible { opacity: 1; }
.pipe { display: flex; gap: 2px; height: 6px; }
.pipe-seg { min-width: 6px; border-radius: 2px; }
.st-none { flex: 1; background: var(--s3); }
.st-backlog { background: rgb(255 251 239 / 0.18); }
.st-in_progress { background: rgb(255 251 239 / 0.5); }
.st-rejected { background: var(--late); }
.st-reviewing { background: var(--type-shoot); }
.st-approved { background: var(--type-web); }
.st-delivered { background: var(--done); }
.tile-foot { display: flex; align-items: flex-end; gap: var(--sp-3); min-width: 0; min-height: 40px; }
.tile-next { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--sp-2); font-size: var(--fs-13); line-height: 18px; color: var(--t2); }
.tile-next .eyebrow { grid-column: 1 / -1; }
.tile-next.muted { display: block; color: var(--t3); align-self: center; }
.tile-next-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-next-day { font-size: var(--fs-12); color: var(--t3); }
.tile-people { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.client-filter { display: flex; align-items: center; gap: 4px; height: var(--control); padding-left: var(--sp-2); border: 1px solid var(--line-2); border-radius: var(--r-2); color: var(--t3); }
.client-filter select { height: 30px; border: 0 !important; background-color: transparent; font-size: var(--fs-13); padding-left: 2px; max-width: 200px; }
.client-mark { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; overflow: hidden; border-radius: var(--r-2); background: var(--cc, var(--s4)); font: 600 12px/1 var(--sans); color: var(--cc-ink, var(--t1)); }
.client-mark img { width: 100%; height: 100%; object-fit: cover; }
.client-mark:has(img) { background: var(--cream); }
.client-mark.xs { width: 14px; height: 14px; border-radius: 3px; font-size: 0; }
.client-mark.lg { width: 72px; height: 72px; border-radius: var(--r-3); font-size: 22px; }
.client-mark-btn { flex: none; padding: 0; border: 0; background: none; border-radius: var(--r-2); cursor: pointer; }
.client-mark-btn:hover .client-mark { box-shadow: 0 0 0 2px var(--line-3); }
[data-color] { --cc-ink: var(--ink); }
[data-color=""] { --cc-ink: initial; }
[data-color="slate"] { --cc: #a6afc2; }
[data-color="sage"] { --cc: #a1b394; }
[data-color="teal"] { --cc: #8fb8b0; }
[data-color="sky"] { --cc: #93b3d6; }
[data-color="plum"] { --cc: #b7a2d0; }
[data-color="rose"] { --cc: #cfa0b4; }
[data-color="rust"] { --cc: #d09580; }
[data-color="sand"] { --cc: #d2b27c; }
.swatches { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.swatch { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line-3); border-radius: 50%; background: var(--cc, transparent); cursor: pointer; }
.swatch[data-color=""] { background: linear-gradient(135deg, transparent 46%, var(--t3) 46%, var(--t3) 54%, transparent 54%); }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--cream); }
.swatch:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--cream); }
.client-rename { min-width: 0 !important; width: 100% !important; height: 28px !important; padding: 0 6px !important; margin-left: -6px; border-color: transparent !important; background: transparent !important; font-weight: 500; }
.client-rename:hover { background: var(--tint-2) !important; }
.client-rename:focus-visible { border-color: var(--cream) !important; background: var(--s2) !important; }
.clients-empty { padding: var(--sp-3) 0; }
.thread { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
#t-thread-wrap { display: grid; gap: var(--sp-3); min-width: 0; }
.thread-list { display: grid; gap: var(--sp-3); max-height: 280px; overflow-y: auto; min-width: 0; }
.comment { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--sp-2); }
.comment .av { margin-top: 2px; }
.comment-main { min-width: 0; }
.comment .msg-body { font-size: var(--fs-13); line-height: 20px; }
.thread-compose { position: relative; }
.thread-compose .composer-box { max-width: none; background: var(--s2); }
.thread-menu { bottom: calc(100% + 4px); left: 0; }

/* profile + team */
.profile-top { display: flex; align-items: center; gap: var(--sp-4); }
.profile-pic-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.profile-pic-actions .hint, .profile-pic-actions .form-error { flex-basis: 100%; }
.animal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: var(--sp-2); }
.animal { aspect-ratio: 1; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--ink); overflow: hidden; transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease); }
.animal img { width: 100%; height: 100%; object-fit: cover; }
.animal:hover { border-color: var(--line-3); }
.animal[aria-checked="true"] { border-color: var(--cream); box-shadow: 0 0 0 1px var(--cream); }
.invite-row { display: flex; align-items: center; gap: var(--sp-2); }
.invite-code { flex: 1; display: flex; align-items: center; height: var(--control); padding: 0 var(--sp-3); border: 1px dashed var(--line-3); border-radius: var(--r-2); font-size: var(--fs-14); letter-spacing: 0.04em; user-select: all; }
.people { display: grid; }
.person { display: flex; align-items: center; gap: var(--sp-3); min-height: 52px; border-bottom: 1px solid var(--line); }
.person:first-child { border-top: 1px solid var(--line); }
.person-text { display: grid; flex: 1; min-width: 0; }
.person-name { font-weight: 500; font-size: var(--fs-14); line-height: 20px; }
.person-sub { font: var(--fs-11)/16px var(--mono); color: var(--t3); overflow: hidden; text-overflow: ellipsis; }
.person-actions { display: flex; gap: var(--sp-1); }

.keys { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2) var(--sp-4); align-items: center; font-size: var(--fs-13); color: var(--t2); }
.keys dt { white-space: nowrap; }

/* toast */
.toast { position: fixed; z-index: 100; left: 50%; bottom: var(--sp-5); transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 10px var(--sp-4); border-radius: var(--r-2); background: var(--s4); box-shadow: var(--shadow-pop); font-size: var(--fs-13); color: var(--t1); }
.toast.error { color: var(--late); }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-mark { flex-direction: row; align-items: flex-end; padding: var(--sp-5) var(--sp-4); border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-lockup { width: 96px; padding: var(--sp-3); }
  .auth-panel { align-items: flex-start; padding: var(--sp-6) var(--sp-4); }
}

@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(280px, 84vw); transform: translateX(-100%); transition: transform 150ms var(--ease); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; z-index: 45; inset: 0; background: rgb(10 10 9 / 0.6); }
  .sb-close, .menu-btn { display: inline-grid; }
  .topbar { padding: 0 var(--sp-4); gap: var(--sp-2); }
  .topbar-tools { gap: var(--sp-2); }
  .view-title .m-long { display: none; }
  .view-title .m-short { display: inline; }
  .topbar .btn.primary span, .topbar .btn.primary kbd { display: none; }
  .topbar .btn.primary { width: var(--control); padding: 0; }
  .topbar .btn.primary .i { margin: 0; }
  .msg-inner, .messages .empty { padding: 0 var(--sp-4); margin: 0; }
  .composer { padding: var(--sp-2) var(--sp-4) calc(var(--sp-3) + env(safe-area-inset-bottom)); }
  .composer-hint { display: none; }
  .board-bar { padding: var(--sp-3) var(--sp-4); }
  .search { width: 100%; margin-left: 0; }
  .search kbd { display: none; }
  .seg { max-width: 100%; overflow-x: auto; }
  .board { grid-auto-columns: 84vw; scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .cal-bar { padding: var(--sp-2) var(--sp-4); }
  .legend { gap: var(--sp-1) var(--sp-3); font-size: var(--fs-11); }
  .cal { flex: none; overflow: visible; grid-template-rows: 28px; grid-auto-rows: 52px; }
  .view-calendar { overflow-y: auto; }
  .cal-dow { position: static; padding: 0; justify-content: center; font-size: 10px; letter-spacing: 0.02em; }
  .day { padding: 4px 2px; align-items: center; gap: 4px; }
  .day-top { justify-content: center; height: 22px; margin: 0; }
  .day-add { display: none; }
  .day .chip { display: none; }
  .day-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 100%; }
  .agenda { display: block; border-top: 1px solid var(--line); }
  .field-grid { grid-template-columns: 1fr; }
  .dialog.task-dlg { height: calc(100dvh - 16px); }
  .task-split { display: block; overflow-y: auto; }
  .task-main { border-right: 0; border-bottom: 1px solid var(--line); }
  .task-main-scroll { overflow: visible; padding: var(--sp-4); }
  .task-dlg .dialog-foot { padding: var(--sp-3) var(--sp-4); }
  .props { grid-template-columns: 112px minmax(0, 1fr); }
  .task-dlg .prop-control, .task-dlg .prop-picker .picker-btn { min-width: 0; }
  .task-side { border-radius: 0 0 var(--r-3) var(--r-3); }
  .task-side .thread-list { max-height: 360px; }
  .client-filter { flex: 1; }
  .client-grid { grid-template-columns: minmax(0, 1fr); padding: var(--sp-4); }
  .client-filter select { max-width: none; width: 100%; }
  .link-add { grid-template-columns: 1fr; }
  .dialog { max-height: calc(100dvh - 16px); width: calc(100vw - 16px) !important; }
  .dialog > form, .dialog > .dialog-inner { max-height: calc(100dvh - 16px); }
  .dialog-body { padding: var(--sp-4); }
  .dialog-head { padding-left: var(--sp-4); }
  .dialog-foot { padding: var(--sp-3) var(--sp-4); flex-wrap: wrap; }
  .dialog-meta { display: none; }
}
@media (min-width: 761px) {
  .day-dots { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; scroll-behavior: auto !important; }
}
