/* Friday – design tokens and styles.
   Every brand value lives in the tokens below (taken from the MagicMyData job search app:
   indigo #2D2A7B, pink #EF3BCD gradient wordmark, Inter). Light theme only, matching the
   job app; a dark theme only needs these tokens redefined. */

:root {
  --friday-bg: #f6f6fb;
  --friday-surface: #ffffff;
  --friday-surface-2: #f7f7ff;
  --friday-surface-hover: #f3f2fb;
  --friday-text: #1f1d3d;
  --friday-text-muted: #6b7280;
  --friday-text-faint: #9ca3af;
  --friday-accent: #2d2a7b;
  --friday-accent-hover: #24216a;
  --friday-accent-soft: #e7e6f5;
  --friday-accent-text: #ffffff;
  --friday-pink: #ef3bcd;
  --friday-magenta: #b0479b;
  --friday-gradient: linear-gradient(135deg, #2d2a7b 0%, #ef3bcd 100%);
  --friday-border: #e5e7eb;
  --friday-border-strong: #d6d5e6;
  --friday-danger: #b91c1c;
  --friday-danger-soft: #fdecec;
  --friday-success: #15805a;
  --friday-focus: 0 0 0 3px rgba(45, 42, 123, 0.25);

  --friday-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --friday-font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;

  --radius-sm: 8px;
  --radius-btn: 10px;
  --radius-input: 10px;
  --radius-card: 16px;
  --radius-panel: 18px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --shadow-bar: 0 1px 3px rgba(20, 18, 50, 0.08);
  --shadow-card: 0 8px 24px rgba(45, 42, 123, 0.10);
  --shadow-pop: 0 12px 32px rgba(20, 18, 50, 0.18);
  --shadow-modal: 0 24px 70px rgba(20, 18, 50, 0.35);

  --header-h: 60px;
}

* { box-sizing: border-box; }
html { overscroll-behavior-y: none; }
body {
  margin: 0;
  font-family: var(--friday-font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--friday-text);
  background: var(--friday-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--friday-accent); }
h1, h2, h3 { letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
[x-cloak] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--friday-text-muted); }
.small { font-size: 12px; }
.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

/* ---------- Header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; gap: var(--space-4);
  padding: 0 var(--space-5);
  background: var(--friday-surface);
  box-shadow: var(--shadow-bar);
}
.wordmark {
  font-weight: 800; font-size: 22px; letter-spacing: -0.035em; text-decoration: none;
  background: var(--friday-gradient); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.app-header .spacer { flex: 1; }
.session-timer { margin: 0; max-width: 560px; font-size: 13px; line-height: 1.35; text-align: right; color: var(--friday-text-muted); }
.session-timer .countdown { color: var(--friday-text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.session-timer.is-soon .countdown { color: var(--friday-danger); }
@media (max-width: 640px) {
  .session-timer { font-size: 11px; }
  .session-timer-more { display: none; }
}

/* Last seconds before automatic logout: nothing on the page can be used. */
.freeze-overlay { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px; background: rgba(20, 18, 50, 0.45); cursor: wait; }
.freeze-card { max-width: 360px; padding: var(--space-5); border-radius: 16px; background: var(--friday-surface); box-shadow: var(--shadow-pop); text-align: center; }
.freeze-card p { margin: 8px 0 0; color: var(--friday-text-muted); }
.user-menu { position: relative; }
.user-menu > button { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; }

/* ---------- Layout ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: var(--space-5) var(--space-5) 64px; }
.page-narrow { max-width: 880px; }
.page-head { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-5); }
.page-head .spacer { flex: 1; }
.crumb { font-size: 13px; color: var(--friday-text-muted); text-decoration: none; }
.crumb:hover { color: var(--friday-accent); }

/* ---------- Buttons and inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px;
  font: inherit; font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap;
  color: var(--friday-text); background: var(--friday-surface);
  border: 1px solid var(--friday-border-strong); border-radius: var(--radius-btn);
  cursor: pointer; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--friday-surface-hover); }
.btn:focus-visible, .input:focus, .icon-btn:focus-visible { outline: none; box-shadow: var(--friday-focus); }
.btn-primary { color: var(--friday-accent-text); background: var(--friday-accent); border-color: var(--friday-accent); }
.btn-primary:hover { background: var(--friday-accent-hover); }
.btn-danger { color: #fff; background: var(--friday-danger); border-color: var(--friday-danger); }
.btn-danger:hover { background: #991b1b; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-google { min-height: 44px; padding: 0 20px; font-size: 15px; gap: 10px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0;
  color: var(--friday-text-muted); background: transparent; border: 0; border-radius: var(--radius-sm); cursor: pointer;
}
.icon-btn:hover { background: var(--friday-surface-hover); color: var(--friday-text); }
.input, .textarea, select.input {
  width: 100%; min-height: 36px; padding: 7px 11px;
  font: inherit; color: var(--friday-text); background: var(--friday-surface);
  border: 1px solid var(--friday-border-strong); border-radius: var(--radius-input);
}
.textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 13px; }
.counter { font-size: 12px; color: var(--friday-text-muted); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--friday-danger); font-weight: 600; }
.form-row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.form-row .input { flex: 1; min-width: 200px; width: auto; }
.error-text { color: var(--friday-danger); font-size: 13px; }
.alert { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--friday-accent-soft); margin-bottom: var(--space-4); }
.alert-error { background: var(--friday-danger-soft); color: var(--friday-danger); }
.alert-success { background: #e6f4ee; color: var(--friday-success); }

/* ---------- Avatars ---------- */
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%; overflow: hidden;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--friday-magenta);
  border: 2px solid var(--friday-surface);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-lg { width: 36px; height: 36px; font-size: 13px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar + .avatar { margin-left: -8px; }

/* ---------- Menus, popovers ---------- */
.menu {
  position: absolute; z-index: 60; min-width: 200px; padding: 6px;
  background: var(--friday-surface); border: 1px solid var(--friday-border);
  border-radius: 12px; box-shadow: var(--shadow-pop);
}
.menu-right { right: 0; }
.menu .menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px;
  font: inherit; font-size: 13px; text-align: left; text-decoration: none; color: var(--friday-text);
  background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer;
}
.menu a.menu-item:hover, .menu button.menu-item:hover { background: var(--friday-surface-hover); }
.menu .danger { color: var(--friday-danger); }
.menu-label { padding: 6px 10px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--friday-text-faint); }
.menu hr { border: 0; border-top: 1px solid var(--friday-border); margin: 6px 0; }
.menu-head { padding: 8px 10px; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 10px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { border-color: var(--friday-text); }

/* ---------- Boards home ---------- */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }
.board-card {
  position: relative; display: grid; gap: var(--space-2); padding: var(--space-5);
  background: var(--friday-surface); border: 1px solid var(--friday-border); border-radius: var(--radius-card);
  text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s;
}
.board-card:hover { box-shadow: var(--shadow-card); transform: translateY(-1px); }
.board-card h2 { padding-right: 32px; overflow-wrap: anywhere; }
.board-card .stats { display: flex; gap: var(--space-4); color: var(--friday-text-muted); font-size: 13px; }
.board-card .card-menu { position: absolute; top: 14px; right: 12px; }
.new-board { background: var(--friday-surface-2); border-style: dashed; }
.empty-state { padding: 48px 24px; text-align: center; color: var(--friday-text-muted); background: var(--friday-surface); border: 1px dashed var(--friday-border-strong); border-radius: var(--radius-card); }

/* ---------- Board page ---------- */
.board-head { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.board-title-form .input { font-size: 24px; font-weight: 700; padding: 2px 8px; min-width: 260px; }
.board-title { font-size: 24px; font-weight: 700; padding: 2px 8px; margin-left: -8px; border-radius: var(--radius-sm); border: 1px solid transparent; }
.board-title.editable { cursor: text; }
.board-title.editable:hover { border-color: var(--friday-border-strong); }
.toolbar { display: flex; gap: var(--space-2); margin-bottom: var(--space-5); flex-wrap: wrap; }

.group { --group-colour: var(--friday-accent); margin-bottom: var(--space-6); }
.group-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); position: relative; }
.group-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px; margin-left: -6px; background: none; border: 0; cursor: pointer; font: inherit; font-size: 16px; font-weight: 700; color: var(--group-colour); border-radius: var(--radius-sm); }
.group-toggle:hover { background: var(--friday-surface-hover); }
.group-toggle .chev { transition: transform .15s; }
.group-toggle[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.group-count { font-size: 12px; color: var(--friday-text-muted); }
.group-body {
  border-left: 5px solid var(--group-colour);
  border-radius: 12px 12px 12px 12px;
  background: var(--friday-surface);
  box-shadow: 0 0 0 1px var(--friday-border);
  overflow-x: auto;
}
.pulse-table { width: 100%; min-width: 980px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.pulse-table th {
  font-size: 12px; font-weight: 600; color: var(--friday-text-muted); text-align: center;
  padding: 8px 10px; background: var(--friday-surface); border-bottom: 1px solid var(--friday-border);
}
.pulse-table th.col-task { text-align: left; }
.pulse-table td { height: 40px; padding: 0 10px; border-bottom: 1px solid var(--friday-border); text-align: center; vertical-align: middle; background: var(--friday-surface); }
.pulse-table > :last-child > tr:last-child td { border-bottom: 0; }
.pulse-table tbody tr:hover td { background: #fbfbfe; }
.pulse-table .col-menu { width: 40px; padding: 0 4px; }
.pulse-table .col-task { width: auto; min-width: 280px; text-align: left; position: sticky; left: 0; z-index: 2; box-shadow: 1px 0 0 var(--friday-border); }
.pulse-table th.col-menu { position: sticky; left: 0; z-index: 3; }
.pulse-table td.col-menu { position: sticky; left: 0; z-index: 3; }
.pulse-table .col-task { left: 40px; }
.pulse-table .col-owner { width: 90px; }
.pulse-table .col-status { width: 160px; padding: 0; }
.pulse-table .col-created { width: 120px; color: var(--friday-text-muted); font-size: 13px; }
.pulse-table .col-files { width: 90px; }
.pulse-table .col-desc { width: 280px; text-align: left; }
.add-row td { color: var(--friday-text-muted); }
.add-row .input { border-color: transparent; background: transparent; padding-left: 4px; min-height: 32px; }
.add-row .input:hover { border-color: var(--friday-border-strong); }
.add-row .input:focus { background: var(--friday-surface); border-color: var(--friday-accent); }

.title-cell { display: flex; align-items: center; gap: 6px; min-height: 40px; }
.title-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 6px; margin-left: -6px; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: text; }
.title-text:hover { border-color: var(--friday-border-strong); }
.title-edit { flex: 1; display: flex; align-items: center; gap: 6px; }
.title-edit .input { min-height: 30px; padding: 3px 8px; }

/* Status pill: fills the whole cell, softly rounded inside it (Monday uses square cells). */
.status-wrap { position: relative; height: 40px; padding: 4px; }
.status-pill {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  padding: 0 8px; border: 0; border-radius: var(--radius-pill); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: filter .12s;
}
.status-pill:hover { filter: brightness(0.95); }
.status-menu { left: 50%; transform: translateX(-50%); top: 42px; width: 220px; display: grid; gap: 6px; padding: 10px; }
.status-menu .status-pill { height: 32px; }
.status-menu .menu-item { justify-content: center; }

.files-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; color: var(--friday-text-muted); font: inherit; }
.files-btn:hover { background: var(--friday-surface-hover); color: var(--friday-text); }
.files-pop { width: 340px; right: auto; left: 50%; transform: translateX(-50%); top: 36px; text-align: left; padding: 12px; }
/* minmax(0, 1fr): without it the grid column grows to fit the longest file name and the
   row's buttons end up off-screen inside the scroll-clipped list. */
.file-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; max-height: 240px; overflow-y: auto; overflow-x: hidden; }
.file-list li { display: flex; align-items: center; gap: 4px; padding: 6px 4px; border-bottom: 1px solid var(--friday-border); }
.file-list .icon-btn { flex: none; }
.file-list li:last-child { border-bottom: 0; }
.file-list .file-main { flex: 1; min-width: 0; }
.file-list .file-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; text-decoration: none; }
.file-usage { font-size: 12px; color: var(--friday-text-muted); margin-bottom: 8px; }

.desc-cell { display: flex; align-items: center; gap: 6px; }
.desc-preview { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--friday-text-muted); font-size: 13px; }
.desc-preview.empty { color: var(--friday-text-faint); font-style: italic; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(20, 18, 50, 0.45); }
.modal {
  width: min(100ch, 92vw); max-height: 70vh; display: flex; flex-direction: column;
  background: var(--friday-surface); border-radius: var(--radius-panel); box-shadow: var(--shadow-modal);
}
.modal-sm { width: min(480px, 92vw); }
.modal-head { display: flex; align-items: center; gap: var(--space-3); padding: 16px 20px; border-bottom: 1px solid var(--friday-border); }
.modal-head h2 { flex: 1; overflow-wrap: anywhere; }
.modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: var(--space-2); padding: 12px 20px; border-top: 1px solid var(--friday-border); }
.modal-foot .spacer { flex: 1; }
.description-text { white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }

/* ---------- Label editor ---------- */
.label-rows { display: grid; gap: 8px; }
.label-row { display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--friday-border); border-radius: 12px; }
.label-row .chip { width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer; }
.label-row .default-tag { font-size: 11px; font-weight: 600; color: var(--friday-accent); background: var(--friday-accent-soft); padding: 2px 8px; border-radius: var(--radius-pill); }
.colour-pop { top: 36px; left: 0; width: 240px; }

/* ---------- Members ---------- */
.card { background: var(--friday-surface); border: 1px solid var(--friday-border); border-radius: var(--radius-card); padding: var(--space-5); margin-bottom: var(--space-5); }
.card h2 { margin-bottom: var(--space-4); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: var(--space-3); padding: 10px 0; border-bottom: 1px solid var(--friday-border); flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 180px; }
.list .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Centered pages (login, no access, errors, invites) ---------- */
.center-page { min-height: calc(100vh - var(--header-h)); display: grid; place-items: center; padding: 24px 16px; }
.center-card { width: min(440px, 100%); padding: 40px 32px; text-align: center; background: var(--friday-surface); border-radius: var(--radius-panel); box-shadow: var(--shadow-card); }
.center-card h1 { margin-bottom: 8px; }
.center-card p { color: var(--friday-text-muted); margin: 0 0 24px; }
.big-wordmark { font-size: 44px; display: inline-block; margin-bottom: 8px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(480px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--friday-text); color: #fff; box-shadow: var(--shadow-pop); font-size: 14px; }
.toast.error { background: var(--friday-danger); }

.htmx-request.btn, .htmx-request .btn-primary { opacity: .7; }

@media (max-width: 640px) {
  .app-header { padding: 0 var(--space-4); }
  .page { padding: var(--space-4) var(--space-4) 48px; }
  .board-title-form .input { min-width: 0; }
  .label-row { grid-template-columns: auto 1fr auto; }
}

/* Whole-card link on board cards; the options menu sits above it. */
.card-link { position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.board-card .card-menu { z-index: 2; }
.new-board { display: grid; align-content: center; justify-items: start; min-height: 120px; }

/* Menus inside the board table are fixed-position (placed by fridayPlace in friday.js). */
.menu.floating { position: fixed; z-index: 80; transform: none; }
.status-menu.floating, .files-pop.floating { left: auto; top: auto; transform: none; }
.title-text.locked { cursor: default; }
.title-text.locked:hover { border-color: transparent; }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.label-row .default-tag { justify-self: center; }
.usage-bar { height: 4px; border-radius: var(--radius-pill); background: var(--friday-border); overflow: hidden; margin: -4px 0 10px; }
.usage-bar span { display: block; height: 100%; background: var(--friday-accent); }
.files-pop form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.files-pop label.btn { cursor: pointer; }
button.desc-preview { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 13px; text-align: left; cursor: pointer; min-width: 0; }
button.desc-preview:hover { color: var(--friday-text); }

/* Description modal: one view at a time; click the text to edit. */
.description-text.editable { cursor: text; margin: -8px; padding: 8px; border-radius: var(--radius-sm); }
.description-text.editable:hover { background: var(--friday-surface-hover); }
.description-text.editable:focus-visible { outline: none; box-shadow: var(--friday-focus); }
.description-empty { display: block; width: 100%; padding: 24px 12px; font: inherit; color: var(--friday-text-faint); text-align: left;
  background: none; border: 1px dashed var(--friday-border-strong); border-radius: var(--radius-input); cursor: text; }
.description-empty:hover { color: var(--friday-text-muted); border-color: var(--friday-accent); }
.saved-note { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--friday-success); }
@media (max-width: 640px) { .modal-foot .hint { display: none; } }

/* ---------- Updates bubble (Task cell) ---------- */
.bubble { flex: none; display: inline-grid; place-items: center; width: 34px; height: 28px; padding: 0; background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; color: var(--friday-text-faint); }
.bubble:hover { background: var(--friday-surface-hover); color: var(--friday-accent); }
.bubble-icon { position: relative; display: inline-grid; place-items: center; }
.bubble-icon.has-count { color: var(--friday-accent); }
.bubble-icon .badge {
  position: absolute; top: -7px; right: -9px; min-width: 16px; height: 16px; padding: 0 4px;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; color: var(--friday-accent-text);
  background: var(--friday-accent); border-radius: var(--radius-pill); font-variant-numeric: tabular-nums;
}
.pulse-table tbody tr.is-open td { background: var(--friday-accent-soft); }

/* ---------- Updates side panel ---------- */
.side-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; width: min(560px, 100vw);
  display: flex; flex-direction: column; background: var(--friday-surface); box-shadow: var(--shadow-modal);
  border-radius: var(--radius-panel) 0 0 var(--radius-panel); outline: none;
}
.panel-head { display: flex; align-items: center; gap: var(--space-3); padding: 18px 20px 8px; }
.panel-head h2 { flex: 1; overflow-wrap: anywhere; }
.panel-meta { display: flex; align-items: center; gap: var(--space-2); padding: 0 20px 14px; border-bottom: 1px solid var(--friday-border); }
.status-pill.static { display: inline-flex; width: auto; height: 26px; padding: 0 14px; cursor: default; }
.status-pill.static:hover { filter: none; }
.panel-body { flex: 1; overflow-y: auto; padding: 16px 20px 32px; }
.composer, .inline-form { display: grid; gap: 6px; }
.composer .textarea, .inline-form .textarea { min-height: 72px; }
.composer-foot { display: flex; align-items: center; gap: var(--space-2); }
.composer-foot .spacer { flex: 1; }

.sort-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; margin-top: 18px; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--friday-surface-2); border: 1px solid var(--friday-border-strong); border-radius: var(--radius-pill); }
.segmented button { min-height: 28px; padding: 0 14px; font: inherit; font-size: 12px; font-weight: 600; color: var(--friday-text-muted); background: none; border: 0; border-radius: var(--radius-pill); cursor: pointer; }
.segmented button:hover { color: var(--friday-text); }
.segmented button[aria-pressed="true"] { color: var(--friday-accent-text); background: var(--friday-accent); }
.segmented button:focus-visible { outline: none; box-shadow: var(--friday-focus); }
.dir-arrow { display: inline-grid; transition: transform .15s; }
.dir-arrow.flipped { transform: rotate(180deg); }
.sort-caption { margin: 8px 0 12px; font-size: 12px; color: var(--friday-text-muted); }

.update-list { display: grid; gap: 10px; }
.update { padding: 12px 14px; border: 1px solid var(--friday-border); border-radius: 14px; background: var(--friday-surface); scroll-margin: 16px; }
.update.level-1, .update.level-2 { position: relative; border-color: transparent; background: var(--friday-surface-2); }
.update.level-1 { margin-left: 28px; }
.update.level-2 { margin-left: 56px; }
/* Thin connector line from the parent down to each reply. */
.update.level-1::before, .update.level-2::before { content: ""; position: absolute; left: -16px; top: -10px; bottom: 50%; width: 12px; border-left: 2px solid var(--friday-border-strong); border-bottom: 2px solid var(--friday-border-strong); border-bottom-left-radius: 10px; }
.update.deleted { padding: 8px 14px; background: transparent; border-style: dashed; border-color: var(--friday-border-strong); }
.deleted-note { margin: 0; font-size: 13px; font-style: italic; color: var(--friday-text-faint); }
.update-head { display: flex; align-items: center; gap: var(--space-2); }
.update-head .spacer { flex: 1; }
.update-author { font-size: 13px; }
.update-body { margin-top: 8px; overflow-wrap: anywhere; line-height: 1.55; }
.update .inline-form { margin-top: 8px; }
.update-actions { margin-top: 4px; margin-left: -8px; }
.reply-context { display: block; max-width: 100%; margin-top: 6px; padding: 2px 8px; font: inherit; font-size: 12px; text-align: left; color: var(--friday-text-muted); background: var(--friday-surface-2); border: 0; border-radius: var(--radius-sm); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-context:hover { color: var(--friday-accent); }
.update.flash { animation: friday-flash 2s ease-out; }
@keyframes friday-flash { from { box-shadow: 0 0 0 3px var(--friday-pink); } to { box-shadow: 0 0 0 3px transparent; } }
.panel-empty { padding: 32px 12px; text-align: center; }
.panel-empty p { margin: 0 0 4px; }
@media (max-width: 640px) {
  .side-panel { width: 100vw; border-radius: 0; }
  .update.level-1 { margin-left: 16px; }
  .update.level-2 { margin-left: 32px; }
}

/* ---------- Drag and drop (admin) ---------- */
.pulse-table.can-reorder .col-menu { width: 64px; }
.pulse-table.can-reorder .col-task { left: 64px; }
.row-tools { display: flex; align-items: center; justify-content: center; gap: 2px; }
.drag-handle { display: inline-grid; place-items: center; width: 22px; height: 28px; color: var(--friday-text-faint); cursor: grab; border-radius: var(--radius-sm); }
.drag-handle:hover { color: var(--friday-text); background: var(--friday-surface-hover); }
.pulse-row.drag-ghost td { background: var(--friday-accent-soft) !important; opacity: .6; }
.pulse-row.drag-chosen td { background: var(--friday-surface-hover); }
.is-dragging, .is-dragging * { cursor: grabbing !important; }
.drop-hint td { height: 36px; font-size: 12px; color: var(--friday-text-faint); text-align: left; padding-left: 74px; font-style: italic; }
.group-head.drop-target { outline: 2px dashed var(--group-colour); outline-offset: 4px; border-radius: var(--radius-sm); }

/* ---------- Group status summary bar ---------- */
.pulse-table tfoot td { height: 36px; background: var(--friday-surface); border-bottom: 0; }
.pulse-table tfoot td.col-status { padding: 0 4px; }
.summary-bar { display: flex; gap: 2px; height: 22px; border-radius: var(--radius-pill); overflow: hidden; }
.summary-bar span { min-width: 6px; cursor: default; transition: filter .12s; }
.summary-bar span:hover { filter: brightness(0.92); }

/* ---------- Loading indicator (any request in flight) ---------- */
.loading-bar { position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 95; height: 3px; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .2s; }
.loading-bar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; background: var(--friday-gradient); border-radius: var(--radius-pill); animation: friday-loading 1.1s ease-in-out infinite; }
.is-loading .loading-bar { opacity: 1; }
@keyframes friday-loading { from { left: -35%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .loading-bar::after { animation: none; left: 0; width: 100%; opacity: .6; } }
.title-text:focus-visible { outline: none; box-shadow: var(--friday-focus); }
