/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

/* ===== Design tokens ===== */
:root,
:root[data-theme="dark"] {
  --canvas: radial-gradient(120% 140% at 15% 0%, #1c3435 0%, #10211f 42%, #0b1716 100%);
  --canvas-solid: #10211f;
  --ink: #f5efe6;
  --muted: rgba(245, 239, 230, 0.62);
  --surface: rgba(18, 34, 34, 0.58);
  --surface-2: rgba(28, 46, 46, 0.68);
  --line: rgba(245, 239, 230, 0.12);
  --accent: #efbd91;
  --accent-ink: #27201a;
  --accent-hover: #f5cfa9;
  --accent-soft: rgba(239, 189, 145, 0.16);
  --notice: #ff8a73;
  --positive: #9fd1a8;
  --shadow: rgba(0, 0, 0, 0.45);
  --bloom: rgba(94, 129, 172, 0.35);
  --bloom-2: rgba(239, 189, 145, 0.22);

  --route-hq: #efbd91;
  --route-tasks: #d08770;
  --route-mail: #e5a155;
  --route-docs: #ebcb8b;
  --route-metrics: #88c0d0;
  --route-finance: #6fae7c;
  --route-files: #8fbcbb;
  --route-people: #5e81ac;
  --route-automations: #b48ead;
  --route-assistant: #a3be8c;
  --route-projects: #bf616a;
  --route-board: #81a1c1;

  /* Pulled from the live hq.easymachineai.com stylesheet for the feed card component */
  --shell-ink: #f3f6f2;
  --shell-muted: #a9bbb9;
  --shell-line: rgba(226, 241, 238, 0.13);
  --shell-peach: #efbc90;
  --shell-ease: cubic-bezier(.16, .84, .26, 1);
}

:root[data-theme="light"] {
  --canvas: linear-gradient(160deg, #fbf7f0 0%, #f3ead9 100%);
  --canvas-solid: #f3ead9;
  --ink: #23201b;
  --muted: rgba(35, 32, 27, 0.6);
  --surface: rgba(255, 255, 255, 0.72);
  --surface-2: rgba(255, 255, 255, 0.9);
  --line: rgba(35, 32, 27, 0.12);
  --accent: #c97d3f;
  --accent-ink: #fffaf2;
  --accent-hover: #b96f34;
  --accent-soft: rgba(201, 125, 63, 0.14);
  --notice: #c0472f;
  --positive: #4e8a5a;
  --shadow: rgba(35, 32, 27, 0.14);
  --bloom: rgba(94, 129, 172, 0.18);
  --bloom-2: rgba(201, 125, 63, 0.16);

  --route-hq: #c97d3f;
  --route-tasks: #b5602f;
  --route-mail: #c08a2e;
  --route-docs: #a98a2e;
  --route-metrics: #2f7f94;
  --route-finance: #3f7a4c;
  --route-files: #3f8f87;
  --route-people: #3c5f85;
  --route-automations: #8a5f85;
  --route-assistant: #5c7a4a;
  --route-projects: #a1434c;
  --route-board: #3f6690;
}

/* ===== App shell ===== */
#app {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 28px 110px;
}

#app-background { position: fixed; inset: 0; z-index: -1; background: var(--canvas); }
#app-background-image {
  position: absolute; inset: 0;
  background:
    radial-gradient(40% 50% at 85% 10%, var(--bloom), transparent 70%),
    radial-gradient(35% 45% at 10% 90%, var(--bloom-2), transparent 70%);
}

/* ===== Top bar ===== */
.hq-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.hq-breadcrumb { font-size: 15px; font-weight: 600; letter-spacing: 0.01em; display: flex; align-items: center; gap: 4px; position: relative; }
.hq-breadcrumb .sep { opacity: 0.45; margin: 0 6px; font-weight: 400; }
.hq-breadcrumb .section { color: var(--route-current, var(--accent)); }
.hq-vault-trigger {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 4px; border-radius: 6px;
  transition: background .15s ease;
}
.hq-vault-trigger:hover { background: var(--accent-soft); }
.hq-vault-trigger svg { opacity: .6; }

.hq-vault-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30;
  width: 260px; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 20px 40px var(--shadow);
  backdrop-filter: blur(16px);
  display: flex; flex-direction: column; gap: 2px;
}
.hq-vault-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 10px; border-radius: 9px;
  font-size: 13px; font-weight: 500; text-align: left; width: 100%;
}
.hq-vault-item:hover { background: var(--accent-soft); }
.hq-vault-item.active { color: var(--accent); font-weight: 700; }
.hq-vault-item .hq-vault-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hq-vault-item .reconnect { font-size: 11px; color: var(--notice); font-weight: 600; }
.hq-vault-divider { height: 1px; margin: 5px 2px; background: var(--line); }
.hq-vault-connect { color: var(--accent); font-weight: 600; }

.hq-settings-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
  width: 280px; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 20px 40px var(--shadow);
  backdrop-filter: blur(16px);
  display: flex; flex-direction: column; gap: 2px;
}
.hq-resource-upload-list { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 4px; }
.hq-resource-upload-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.hq-resource-upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }

.hq-resource-pending { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px; }
.hq-resource-pending-names { display: flex; flex-direction: column; gap: 2px; max-height: 90px; overflow-y: auto; }
.hq-resource-pending-names .hq-resource-upload-name { font-size: 12px; }
.hq-context-input {
  width: 100%; min-height: 56px; padding: 9px 11px; border-radius: 8px; resize: vertical;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  font: inherit; font-size: 12.5px;
}
.hq-context-input:focus { outline: none; border-color: var(--accent); }
.hq-resource-pending-actions { display: flex; justify-content: flex-end; gap: 8px; }

.hq-empty-state {
  padding: 36px 18px; text-align: center; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--line); border-radius: 16px;
  font-size: 13px;
}

.hq-topbar-center { display: flex; align-items: center; gap: 14px; }
.hq-clock { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hq-date { color: var(--muted); font-size: 14px; }

.hq-topbar-right { display: flex; align-items: center; gap: 10px; }
.hq-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600;
  transition: background .15s ease, transform .15s ease;
}
.hq-btn:hover:not(:disabled) { background: var(--accent-soft); }
.hq-btn:disabled { opacity: .5; cursor: default; }
.hq-icon-btn {
  width: 38px; height: 38px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--line);
  transition: background .15s ease;
}
.hq-icon-btn:hover { background: var(--accent-soft); }

/* ===== Date rail ===== */
.hq-date-rail {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 10px 14px;
  margin-bottom: 22px;
  backdrop-filter: blur(14px);
}
.hq-date-rail-nav { display: flex; align-items: center; gap: 4px; }
.hq-week-arrow {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px; color: var(--muted);
}
.hq-week-arrow:hover { background: var(--accent-soft); color: var(--accent); }
.hq-week-today {
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent);
}
.hq-date-rail-days { display: flex; gap: 6px; flex: 1; }
.hq-day {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; border-radius: 14px;
  font-size: 13px; color: var(--muted);
  transition: background .15s ease, color .15s ease;
  position: relative;
}
.hq-day .dow { font-size: 11px; text-transform: capitalize; }
.hq-day .num { font-size: 16px; font-weight: 700; color: var(--ink); }
.hq-day.selected { background: var(--accent); color: var(--accent-ink); }
.hq-day.selected .num, .hq-day.selected .dow { color: var(--accent-ink); }
.hq-day.today:not(.selected)::after {
  content: ""; position: absolute; bottom: 4px; width: 4px; height: 4px;
  border-radius: 50%; background: var(--accent);
}

.hq-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.hq-pill .count { color: var(--muted); font-weight: 500; }
.hq-pill svg { opacity: 0.85; }

/* ===== Home layout ===== */
.hq-home { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* ===== Feed section header ===== */
.hq-feed-header { display: flex; justify-content: flex-end; margin-bottom: 10px; }

.hq-subsection { margin-bottom: 24px; }
.hq-subsection-header { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.hq-meeting-time { font-size: 12px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }

.hq-upload-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.hq-upload-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.hq-status-pill.pending { color: var(--route-automations); display: inline-flex; align-items: center; }

.hq-upload-clear {
  width: 28px; height: 28px; border-radius: 8px; margin-left: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--muted);
}
.hq-upload-clear:hover { background: var(--accent-soft); color: var(--notice); }

.hq-attach-panel {
  margin: -6px 0 10px; padding: 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px;
}
.hq-attach-label { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

.hq-lang-group { display: flex; gap: 6px; flex-wrap: wrap; }
.hq-lang-btn {
  padding: 7px 13px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.hq-lang-btn:hover { background: var(--accent-soft); }
.hq-lang-btn.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.hq-path-input {
  width: 100%; padding: 9px 11px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  font: inherit; font-size: 12.5px;
}
.hq-path-input:focus { outline: none; border-color: var(--accent); }
.hq-attach-hint { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

.hq-search-box {
  position: relative; display: flex; align-items: center; margin-bottom: 16px;
}
.hq-search-box > svg { position: absolute; left: 13px; pointer-events: none; }
.hq-search-input {
  width: 100%; padding: 10px 36px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  font: inherit; font-size: 13.5px;
}
.hq-search-input::placeholder { color: var(--muted); }
.hq-search-input:focus { outline: none; border-color: var(--accent); }
.hq-search-clear {
  position: absolute; right: 10px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.hq-search-clear:hover { background: var(--accent-soft); color: var(--ink); }

.hq-pagination {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 16px;
}
.hq-pagination-info { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.hq-pagination-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 13px; border-radius: 10px; font-size: 12.5px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  transition: background .15s ease, opacity .15s ease;
}
.hq-pagination-btn:hover:not(:disabled) { background: var(--accent-soft); }
.hq-pagination-btn:disabled { opacity: .4; cursor: default; }

.hq-command-box {
  position: relative; padding: 12px 40px 12px 14px; border-radius: 10px;
  background: var(--canvas-solid); border: 1px solid var(--line);
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; line-height: 1.5;
  color: var(--ink); white-space: pre-wrap; word-break: break-all;
}
.hq-command-copy {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.hq-command-copy:hover { background: var(--accent-soft); color: var(--accent); }

.hq-extract { display: flex; flex-direction: column; gap: 8px; }
.hq-extract-btn {
  align-self: flex-start; padding: 9px 18px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 12.5px;
  transition: background .15s ease, opacity .15s ease;
}
.hq-extract-btn:hover:not(:disabled) { background: var(--accent-hover); }
.hq-extract-btn:disabled { opacity: .5; cursor: default; }
.hq-extract-status { font-size: 12px; color: var(--muted); }
.hq-extract-status.error { color: var(--notice); }
.hq-extract-status.success { color: var(--positive); }
.hq-extract-done { display: flex; flex-direction: column; gap: 8px; }
.hq-transcript-preview { max-height: 220px; overflow-y: auto; }

/* ===== Feed carousel (ported from hq.easymachineai.com's real class names) ===== */
.workspace-theatre {
  --theatre-offset: clamp(470px, 32vw, 790px);
  --theatre-active-w: clamp(760px, 60vw, 1180px);
  --theatre-active-h: clamp(430px, 58vh, 680px);
  --theatre-selected-half: min(590px, 30vw);
  position: relative;
  min-height: clamp(540px, 68vh, 900px);
  flex: 1;
  display: flex; align-items: center;
  margin-bottom: 20px;
}
.theatre-rail { position: relative; width: 100%; height: clamp(450px, 60vh, 760px); perspective: 1400px; }

.theatre-card {
  position: absolute; top: 50%; left: 50%; z-index: 2;
  width: clamp(205px, 15vw, 320px);
  height: clamp(350px, 48vh, 560px);
  overflow: hidden;
  border-radius: 16px;
  background: #20393f;
  color: var(--shell-ink);
  box-shadow: 0 20px 60px rgba(3, 16, 21, .28);
  transform: translate(-50%, -50%);
  transform-origin: center;
  cursor: pointer;
  transition: left 300ms var(--shell-ease), width 300ms var(--shell-ease), height 300ms var(--shell-ease),
    transform 300ms var(--shell-ease), filter 300ms ease-out, opacity 300ms ease-out;
}
.theatre-card[aria-current="true"] {
  z-index: 6; cursor: default;
  width: var(--theatre-active-w); height: var(--theatre-active-h);
  filter: none; opacity: 1;
}
.theatre-card.slot-n1 { left: calc(50% - var(--theatre-offset)); transform: translate(-50%, -50%) rotateY(4deg); }
.theatre-card.slot-1 { left: calc(50% + var(--theatre-offset)); transform: translate(-50%, -50%) rotateY(-4deg); }
.theatre-card:not([aria-current="true"]) { filter: saturate(.72) brightness(.72); opacity: .8; }
.theatre-card:hover:not([aria-current="true"]) { filter: saturate(.9) brightness(.86); opacity: 1; transform: translate(-50%, -52%); }

[data-home-card-surface] {
  position: absolute; inset: 0; height: 100%;
  transform-style: preserve-3d;
  transform: translateY(var(--home-hover-lift, 0)) rotateX(var(--home-hover-rx, 0deg)) rotateY(var(--home-hover-ry, 0deg));
  transform-origin: center;
  will-change: transform;
}
[data-home-card-surface]::after {
  content: ""; position: absolute; inset: 0; z-index: 5; border-radius: inherit;
  background: radial-gradient(circle at var(--home-hover-glow-x, 50%) var(--home-hover-glow-y, 50%), rgba(255, 255, 255, .18), rgba(255, 255, 255, .05) 18%, transparent 43%);
  mix-blend-mode: screen; opacity: 0; pointer-events: none; transition: opacity .2s ease-out;
}
.theatre-card[aria-current="true"]:hover [data-home-card-surface]::after { opacity: .28; }
[data-home-card-text] { transform: translateZ(var(--home-hover-depth, 0)); transform-style: preserve-3d; }

.feed-theatre-card .feed-cover {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(24px, 3vw, 46px); box-sizing: border-box;
  background: radial-gradient(circle at 83% 20%, rgba(113, 184, 181, .28), transparent 33%), linear-gradient(135deg, #20474d 0%, #102d35 49%, #091c23 100%);
}
.feed-theatre-card .feed-topic-conversation { background: radial-gradient(circle at 82% 22%, rgba(236, 178, 128, .27), transparent 36%), linear-gradient(135deg, #354344, #162e35 50%, #0a1c22); }
.feed-theatre-card .feed-topic-content { background: radial-gradient(circle at 77% 24%, rgba(87, 179, 166, .21), transparent 44%), linear-gradient(135deg, #173c46, #123039 57%, #0b232b); }

.feed-cover-top, .feed-cover-bottom { display: flex; position: relative; z-index: 2; align-items: center; justify-content: space-between; gap: 20px; }
.feed-cover-top { color: #c8dcda; font-size: 11px; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; }
.feed-cover-mark { color: var(--shell-peach); }
.feed-cover-content { position: relative; z-index: 2; max-width: min(78%, 800px); margin: auto 0; }
.feed-cover-category { display: flex; align-items: center; gap: 8px; color: #eac9aa; font-size: 12px; font-weight: 650; letter-spacing: .04em; }
.feed-cover-category i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.feed-cover-content h2 { max-width: 18ch; margin: 20px 0 16px; color: #f6f7f2; font-size: clamp(34px, 4.3vw, 76px); font-weight: 720; line-height: 1.02; letter-spacing: -.045em; }
.feed-theatre-card:not([aria-current="true"]) .feed-cover { padding: 25px; }
.feed-theatre-card:not([aria-current="true"]) .feed-cover-content { max-width: 100%; }
.feed-theatre-card:not([aria-current="true"]) .feed-cover-content h2 { font-size: clamp(22px, 2.5vw, 36px); }
.feed-theatre-card:not([aria-current="true"]) .feed-cover-bottom,
.feed-theatre-card:not([aria-current="true"]) .feed-hover-preview { display: none; }

.feed-theatre-card .feed-cover-image, .feed-theatre-card .feed-cover-image img { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; margin: 0; border: 0; }
.feed-theatre-card .feed-cover-image img { object-fit: cover; object-position: center; filter: saturate(.86) contrast(1.04); transition: transform .6s var(--shell-ease), filter .6s ease; }
.feed-theatre-card .feed-cover-image::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(5, 20, 27, .94) 0%, rgba(5, 20, 27, .78) 39%, rgba(5, 20, 27, .35) 76%, rgba(5, 20, 27, .18) 100%), linear-gradient(0deg, rgba(5, 20, 27, .65), transparent 42%);
}
.feed-theatre-card:has(.feed-cover-image) .feed-cover-content { max-width: min(72%, 800px); }
.feed-theatre-card:not([aria-current="true"]) .feed-cover-image { opacity: .65; }
.feed-theatre-card[aria-current="true"]:hover .feed-cover-image img { transform: scale(1.075); filter: saturate(1.04) contrast(1.04); }

.feed-theatre-card[aria-current="true"] .feed-cover-content {
  position: absolute; right: 0; bottom: 0; left: 0; max-width: none !important;
  margin: 0; padding: 28px clamp(28px, 4vw, 54px) 92px; box-sizing: border-box;
  transition: transform .55s var(--shell-ease);
}
.feed-theatre-card[aria-current="true"]:hover .feed-cover-content { transform: translateY(-8px); }
.feed-hover-preview { max-width: 720px; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .58s var(--shell-ease), opacity .32s ease-out; }
.feed-hover-preview > p { margin: 13px 0 0; color: #d5e2df; font-size: clamp(13px, 1.2vw, 17px); line-height: 1.55; }
.feed-hover-details { display: flex; max-width: 720px; margin-top: 14px; padding-top: 11px; gap: 30px; border-top: 1px solid rgba(226, 241, 238, .14); }
.feed-hover-details > span { display: flex; min-width: 105px; flex-direction: column; gap: 4px; }
.feed-hover-details small { color: #aabbb8; font-size: 9px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.feed-hover-details strong { color: #f4f7f3; font-size: 11px; font-weight: 650; }
.feed-theatre-card[aria-current="true"]:hover .feed-hover-preview { max-height: 190px; opacity: 1; }

.feed-cover-reactions { display: flex; align-items: center; gap: 5px; }
.feed-icon-button {
  display: grid; position: relative; width: 36px; height: 36px; min-height: 36px; padding: 0; place-items: center;
  border: 1px solid rgba(223, 239, 235, .14); border-radius: 10px; background: rgba(5, 23, 29, .55); color: #d8e9e5;
}
.feed-icon-button:hover, .feed-icon-button:focus-visible { border-color: rgba(239, 188, 144, .5); background: rgba(239, 188, 144, .15); color: #f4c497; }
.feed-icon-button[aria-pressed="true"] { border-color: rgba(239, 188, 144, .62); background: rgba(239, 188, 144, .2); color: #f4c497; }
.feed-icon-button[data-tip]:is(:hover, :focus-visible)::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 9px); z-index: 9;
  width: max-content; max-width: 150px; padding: 7px 9px; transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 7px; background: #061a20; color: #eef5f2;
  font-size: 10px; font-weight: 600; box-shadow: 0 10px 22px rgba(0, 0, 0, .28); pointer-events: none;
}
.feed-cover-reactions > .feed-icon-button:last-child { margin-left: 7px; width: 42px; height: 42px; min-height: 42px; border-color: rgba(239, 188, 144, .35); color: #efbc90; }

.home-card-primary-action, .feed-cover-bottom .home-card-primary-action {
  display: flex; min-height: 44px; margin-top: 0; padding: 0 17px; align-items: center; justify-content: center; gap: 12px;
  border: 1px solid transparent; border-radius: 10px; background: var(--shell-peach); color: #173139;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background .2s ease, border-color .2s ease, backdrop-filter .2s ease;
}
.home-card-primary-action:hover {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .22);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
}
.home-card-primary-action:active { background: rgba(255, 255, 255, .22); }

.theatre-arrow {
  position: absolute; z-index: 8; top: 50%; width: 46px; height: 68px; transform: translateY(-50%);
  display: grid; place-items: center;
  border: 1px solid var(--shell-line); border-radius: 14px; background: #0d272d; color: var(--shell-ink);
  box-shadow: 8px 16px 34px rgba(0, 0, 0, .3);
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.theatre-arrow:hover { border-color: rgba(239, 188, 144, .58); background: #17363c; color: var(--shell-peach); }
.theatre-arrow-prev { left: clamp(18px, 3vw, 54px); }
.theatre-arrow-next { right: clamp(18px, 3vw, 54px); }

@media (max-width: 760px) {
  .theatre-card.slot-n1, .theatre-card.slot-1 { display: none; }
  .feed-cover-content h2 { font-size: clamp(29px, 7vw, 48px); }
}

/* ===== Bottom dock ===== */
.hq-dock-wrap { position: fixed; left: 0; right: 0; bottom: 20px; display: flex; justify-content: center; z-index: 10; }
.hq-dock {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 22px; padding: 10px;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 40px var(--shadow);
}
.hq-dock-item {
  position: relative;
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.hq-dock-item:hover { background: var(--accent-soft); color: var(--ink); }
.hq-dock-item.active { background: var(--route-current, var(--accent)); color: var(--accent-ink); }
.hq-dock-item .badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--notice); color: #1a0e0a;
  font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.hq-dock-item .underline {
  position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 3px; border-radius: 2px; background: var(--route-current, var(--accent));
}
.hq-dock-divider { width: 1px; align-self: stretch; margin: 6px 4px; background: var(--line); }
.hq-dock-item[data-tip]:is(:hover, :focus-visible)::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 14px); z-index: 20;
  width: max-content; max-width: 150px; padding: 7px 10px; transform: translateX(-50%);
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink);
  font-size: 11px; font-weight: 600; box-shadow: 0 10px 22px var(--shadow); pointer-events: none;
}

/* ===== Section views ===== */
.hq-section { max-width: 900px; margin: 0 auto; width: 100%; }
.hq-section-header { margin-bottom: 18px; }
.hq-section-header h1 { font-size: 24px; font-weight: 700; }
.hq-section-header p { color: var(--muted); font-size: 14px; margin-top: 4px; }

.hq-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px 18px;
  backdrop-filter: blur(14px);
}
.hq-list { display: flex; flex-direction: column; gap: 10px; }
.hq-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.hq-row-main { flex: 1; min-width: 0; }
.hq-row-title { font-weight: 600; font-size: 14px; }
.hq-row-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hq-row-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.hq-row-clickable { cursor: pointer; transition: background .15s ease; border-radius: 10px; }
.hq-row-clickable:hover { background: var(--accent-soft); }

.hq-status-pill {
  display: inline-flex; align-items: center; padding: 4px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  text-transform: capitalize; background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--line);
}
.hq-status-pill.completed { color: var(--positive); }
.hq-status-pill.blocked { color: var(--notice); }
.hq-status-pill.priority { color: var(--notice); font-weight: 800; }

.hq-segment-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: var(--segment-color); background: color-mix(in srgb, var(--segment-color) 16%, transparent);
  white-space: nowrap;
}
.hq-segment-tag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--segment-color); flex-shrink: 0;
}

.hq-segment-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.hq-segment-filter .hq-pill { cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.hq-segment-filter .hq-pill:hover { background: var(--accent-soft); }
.hq-segment-filter .hq-pill.active { border-color: var(--segment-color, var(--accent)); color: var(--segment-color, var(--accent)); background: color-mix(in srgb, var(--segment-color, var(--accent)) 14%, transparent); }
.hq-segment-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--segment-color); flex-shrink: 0; }

.hq-checkbox {
  width: 20px; height: 20px; border-radius: 7px; border: 1.5px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.hq-checkbox.checked { background: var(--positive); border-color: var(--positive); }

.hq-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--route-mail); flex-shrink: 0; }

.hq-metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.hq-metric-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; backdrop-filter: blur(14px); }
.hq-metric-tile .label { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.hq-metric-tile .value { font-size: 26px; font-weight: 700; }
.hq-metric-tile .delta { font-size: 12px; margin-top: 4px; color: var(--positive); }
.hq-metric-tile .delta.negative { color: var(--notice); }
.hq-metric-tile .value.negative { color: var(--notice); }

.hq-app-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hq-app-card-main { display: flex; align-items: center; gap: 12px; text-align: left; flex: 1; min-width: 0; background: none; border: 0; padding: 0; }
.hq-toggle {
  position: relative; flex-shrink: 0; width: 38px; height: 22px; border-radius: 999px;
  background: var(--line); border: 1px solid var(--line); transition: background .15s ease;
}
.hq-toggle .hq-toggle-knob {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface-2); box-shadow: 0 1px 3px var(--shadow); transition: transform .15s ease, background .15s ease;
}
.hq-toggle.on { background: var(--accent); border-color: var(--accent); }
.hq-toggle.on .hq-toggle-knob { transform: translateX(16px); background: var(--accent-ink); }
.hq-toggle.locked { opacity: .4; cursor: default; }

.hq-people-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.hq-person-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; backdrop-filter: blur(14px); }

/* ===== Projects: medium icon-grid view ===== */
.hq-projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 22px 12px; }
.hq-project-icon-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; padding: 14px 8px; border-radius: 14px;
  transition: background .15s ease;
}
.hq-project-icon-card:hover { background: var(--surface); }
.hq-project-icon-tile {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--route-projects) 20%, transparent);
  color: var(--route-projects);
  margin-bottom: 4px;
}
.hq-project-icon-title { font-weight: 650; font-size: 13.5px; line-height: 1.3; }
.hq-project-icon-sub { font-size: 11.5px; color: var(--muted); }

/* ===== Board: current-sprint ticket list + full-screen detail ===== */
.hq-board-points { font-size: 11px; background: var(--surface-2); border-radius: 999px; padding: 1px 7px; flex-shrink: 0; }
.hq-back-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 14px;
}
.hq-back-link:hover { color: var(--ink); }
.hq-ticket-body-full {
  max-height: calc(100vh - 230px); min-height: 220px;
  overflow-y: auto; overflow-x: hidden; padding-right: 14px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.hq-ticket-body-full::-webkit-scrollbar { width: 6px; }
.hq-ticket-body-full::-webkit-scrollbar-track { background: transparent; }
.hq-ticket-body-full::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.hq-ticket-body-full::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.hq-ticket-body {
  margin-top: 18px;
  font-size: 14px; line-height: 1.75; word-break: break-word;
}
.hq-ticket-body h2, .hq-ticket-body h3, .hq-ticket-body h4, .hq-ticket-body h5, .hq-ticket-body h6 {
  font-weight: 750; line-height: 1.35; margin: 26px 0 10px;
}
.hq-ticket-body > :first-child { margin-top: 0; }
.hq-ticket-body h2 { font-size: 16px; }
.hq-ticket-body h3 { font-size: 14px; color: var(--route-board); }
.hq-ticket-body h4, .hq-ticket-body h5, .hq-ticket-body h6 { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.hq-ticket-body p { margin: 0 0 14px; }
.hq-ticket-body ul, .hq-ticket-body ol { margin: 0 0 14px; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.hq-ticket-body li { line-height: 1.65; }
.hq-ticket-body blockquote {
  margin: 14px 0; padding: 10px 16px; border-left: 3px solid var(--route-board);
  background: var(--surface); border-radius: 0 10px 10px 0;
}
.hq-ticket-body blockquote > :last-child { margin-bottom: 0; }
.hq-ticket-body code.hq-md-code {
  background: var(--surface-2); border-radius: 4px; padding: 1.5px 5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px;
}
.hq-ticket-body pre.hq-md-pre {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; overflow-x: auto; margin: 10px 0;
}
.hq-ticket-body pre.hq-md-pre code {
  background: none; padding: 0; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px; white-space: pre;
}
.hq-md-wikilink { color: var(--accent); font-weight: 600; }
.hq-md-check-item { list-style: none; margin-left: -20px; display: flex; align-items: flex-start; gap: 7px; }
.hq-md-checkbox {
  width: 14px; height: 14px; margin-top: 3px; flex-shrink: 0;
  border: 1.5px solid var(--line); border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; color: #fff;
}
.hq-md-checkbox.done { background: var(--positive); border-color: var(--positive); }
.hq-md-table-wrap { overflow-x: auto; margin: 10px 0; }
.hq-md-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.hq-md-table th, .hq-md-table td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top; }
.hq-md-table th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }

/* ===== Finance: account card slider ===== */
.hq-finance-theatre { position: relative; display: flex; align-items: center; justify-content: center; min-height: 250px; margin-bottom: 16px; }
.finance-theatre-rail { position: relative; width: 100%; height: 230px; }
.finance-theatre-card {
  position: absolute; top: 50%; left: 50%; z-index: 2;
  width: 300px; height: 180px; padding: 22px; box-sizing: border-box;
  display: flex; flex-direction: column; justify-content: space-between;
  text-align: left; font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--card-color) 32%, var(--surface)), var(--surface) 75%);
  transform: translate(-50%, -50%) scale(.8);
  opacity: .5; filter: saturate(.65) brightness(.85);
  cursor: pointer;
  transition: left .3s ease, transform .3s ease, opacity .3s ease, filter .3s ease, border-color .3s ease;
}
.finance-theatre-card[aria-current="true"] {
  z-index: 4; cursor: default; opacity: 1; filter: none;
  transform: translate(-50%, -50%) scale(1.14);
  border-color: var(--card-color);
  box-shadow: 0 18px 44px var(--shadow);
}
.finance-theatre-card.slot-n1 { left: calc(50% - 310px); }
.finance-theatre-card.slot-1 { left: calc(50% + 310px); }
.finance-theatre-card:hover:not([aria-current="true"]) { opacity: .78; }
.finance-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.finance-card-bank { font-size: 18px; font-weight: 700; letter-spacing: .01em; }
.finance-card-type {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); white-space: nowrap;
}
.finance-card-product { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.finance-card-number { font-size: 14px; font-weight: 600; letter-spacing: .06em; margin: auto 0; color: var(--ink); text-align: right; white-space: nowrap; }
.finance-card-stats { display: flex; gap: 28px; }
.finance-stat { display: flex; flex-direction: column; gap: 3px; }
.finance-stat-label { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.finance-stat-value { font-size: 15px; font-weight: 700; }
.finance-stat.overdue .finance-stat-label, .finance-stat.overdue .finance-stat-value { color: var(--notice); }
.finance-arrow { position: absolute; top: 50%; transform: translateY(-50%); }
.finance-arrow.finance-arrow-prev { left: 4px; }
.finance-arrow.finance-arrow-next { right: 4px; }

.hq-finance-tabs { display: flex; gap: 20px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.hq-finance-tab {
  padding: 10px 2px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.hq-finance-tab.active { color: var(--ink); border-bottom-color: var(--accent); }

.hq-view-switcher { display: flex; gap: 8px; }
.hq-view-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.hq-view-btn:hover { transform: translateY(-1px); background: var(--accent-soft); color: var(--ink); }
.hq-view-btn.active { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 8px 18px -8px var(--shadow); }

/* ===== Finance: calendar view ===== */
.hq-calendar-grid { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .hq-calendar-grid { grid-template-columns: 1fr; } }

.hq-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; backdrop-filter: blur(14px); }

.hq-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hq-cal-month-btn { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; padding: 4px 6px; border-radius: 8px; }
.hq-cal-month-btn:hover { background: var(--accent-soft); }
.hq-cal-month-btn svg { stroke: var(--muted); }
.hq-cal-nav { display: flex; gap: 4px; }
.hq-cal-nav button { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.hq-cal-nav button:hover { background: var(--accent-soft); color: var(--ink); }

.hq-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.hq-cal-dow { text-align: center; font-size: 10.5px; font-weight: 700; color: var(--muted); padding: 4px 0 8px; }
.hq-cal-day {
  position: relative; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center;
  padding-top: 6px; border-radius: 9px; font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.hq-cal-day.empty { visibility: hidden; }
.hq-cal-day.today .hq-cal-day-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--accent); font-weight: 700;
}
.hq-cal-dots { display: flex; gap: 2px; margin-top: 3px; flex-wrap: wrap; justify-content: center; max-width: 30px; }
.hq-cal-dot { width: 5px; height: 5px; border-radius: 50%; }
.hq-cal-day.has-dots { cursor: pointer; }
.hq-cal-day.has-dots:hover { background: var(--surface-2); }

.hq-cal-tooltip {
  position: absolute; z-index: 20; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; box-shadow: 0 16px 32px var(--shadow);
  font-size: 11px; white-space: nowrap; pointer-events: none;
}
.hq-cal-tooltip-label { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px; }
.hq-cal-tooltip-row { display: flex; align-items: center; gap: 6px; }
.hq-cal-tooltip-row + .hq-cal-tooltip-row { margin-top: 4px; }
.hq-cal-tooltip-row i { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.hq-cal-tooltip-row b { font-variant-numeric: tabular-nums; margin-left: auto; padding-left: 10px; }

.hq-cal-total { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); text-align: right; }
.hq-cal-total-label-row { display: flex; align-items: center; justify-content: flex-end; gap: 6px; position: relative; margin-bottom: 4px; }
.hq-cal-total-label { font-size: 10.5px; color: var(--muted); }
.hq-cal-total-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

.hq-info-btn {
  width: 15px; height: 15px; border-radius: 50%; flex: none; position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); border: 1px solid var(--line);
}
.hq-info-btn:hover { color: var(--ink); border-color: var(--ink); }
.hq-info-tooltip {
  position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 20;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 10px; box-shadow: 0 16px 32px var(--shadow);
  font-size: 11px; color: var(--muted); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s ease;
}
.hq-info-btn:hover .hq-info-tooltip, .hq-info-btn:focus-visible .hq-info-tooltip { opacity: 1; }

.hq-list-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.hq-list-title { font-size: 13.5px; font-weight: 700; }
.hq-list-sub { font-size: 11px; color: var(--muted); }

.hq-pay-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.hq-pay-table th {
  text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 0 10px 8px; border-bottom: 1px solid var(--line);
}
.hq-pay-table th.num, .hq-pay-table td.num { text-align: right; }
.hq-pay-table td { padding: 10px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.hq-pay-table tr:last-child td { border-bottom: none; }
.hq-pay-table td.num { font-variant-numeric: tabular-nums; }
.hq-card-cell { display: flex; align-items: center; gap: 8px; }
.hq-card-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.hq-card-name { font-weight: 600; }
.hq-date-cell { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hq-pay-table tr.row-unknown td { color: var(--muted); font-style: italic; }

.hq-finance-table-wrap { overflow-x: auto; }
.hq-finance-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.hq-finance-table th {
  text-align: left; padding: 8px 14px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line);
}
.hq-finance-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.hq-finance-table tbody tr { cursor: pointer; transition: background .15s ease; }
.hq-finance-table tbody tr:hover { background: var(--surface); }
.hq-finance-table tbody tr.selected { background: var(--accent-soft); }
.hq-finance-table td:first-child { font-weight: 700; }
.hq-finance-table td.overdue { color: var(--notice); font-weight: 700; }
.hq-person-avatar {
  width: 38px; height: 38px; border-radius: 50%; margin-bottom: 10px;
  background: var(--route-people); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}

.hq-assistant-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.hq-assistant-msg { max-width: 75%; padding: 12px 14px; border-radius: 16px; font-size: 14px; line-height: 1.4; }
.hq-assistant-msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
.hq-assistant-msg.assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); }
.hq-assistant-composer {
  display: flex; gap: 10px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 16px; padding: 10px 10px 10px 16px;
}
.hq-assistant-composer input { flex: 1; background: none; border: none; color: var(--ink); font: inherit; outline: none; }

/* ===== Motion toast ===== */
.hq-motion-toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 16px; font-size: 13px;
  box-shadow: 0 20px 40px var(--shadow); z-index: 50;
}
.hq-motion-toast button { font-weight: 700; color: var(--accent); }

/* ===== Resource relationship graph modal ===== */
.hq-modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.hq-modal-panel {
  width: min(420px, 92vw); max-height: 85vh; overflow-y: auto;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 18px; padding: 20px; box-shadow: 0 30px 60px var(--shadow);
}
.hq-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.hq-modal-title { font-size: 15px; font-weight: 700; }
.hq-modal-subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hq-modal-close {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--muted);
}
.hq-modal-close:hover { background: var(--accent-soft); color: var(--notice); }
.hq-graph-svg { width: 100%; height: auto; margin-top: 16px; overflow: visible; }
.hq-graph-node-center { fill: var(--accent); }
.hq-graph-node-satellite { fill: var(--line); }
.hq-graph-node-satellite.note { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.hq-graph-edge { stroke: var(--line); stroke-width: 1.5; }
.hq-graph-label { font-size: 11px; fill: var(--ink); text-anchor: middle; font-weight: 500; }
.hq-graph-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 20px 0; }
.hq-graph-legend { display: flex; gap: 18px; justify-content: center; margin-top: 14px; font-size: 11px; color: var(--muted); }
.hq-graph-legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.hq-graph-node-satellite, .hq-graph-node-center { cursor: pointer; }
.hq-file-meta { display: flex; flex-direction: column; gap: 6px; padding: 4px 2px; }
.hq-back-btn { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; }

/* ===== Reduced / calm motion ===== */
[data-hq-motion="calm"] * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }

@media (max-width: 760px) {
  #app { padding: 14px 14px 110px; }
  .hq-topbar-center { display: none; }
}
