/* ================================================================
   HOME SCREEN — Mode 1 (Orientation)
   Full-screen landing. Calm morning briefing.
================================================================ */
#home-screen {
  min-height: 100dvh;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  opacity: 1;
  transition: opacity 0.25s ease;
}
#home-screen.hidden { display: none; }
#home-screen.fading { opacity: 0; }

/* ── Top bar ────────────────────────────────────────────────── */
.home-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}
.home-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.home-logo-mark {
  width: 2rem; height: 2rem;
  background: var(--ink);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
}
.home-logo-text {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
}
.home-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Content area ───────────────────────────────────────────── */
.home-content {
  flex: 1;
  max-width: 64rem;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 2.5rem 5.5rem;
}

/* ── Greeting ───────────────────────────────────────────────── */
.home-greeting {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}
.home-greeting-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ── Attention strip ────────────────────────────────────────── */
.home-attention {
  margin-bottom: 2rem;
}
.home-attention-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.home-attention-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.home-attention-scroll::-webkit-scrollbar { height: 3px; }
.home-attention-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 9999px; }

.home-attn-card {
  flex-shrink: 0;
  width: 18rem;
  padding: 1rem 1.15rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  scroll-snap-align: start;
}
.home-attn-card:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(201,168,76,0.1);
}
.home-attn-card.urgency-calm { border-left: 3px solid var(--gold); }
.home-attn-card.urgency-amber { border-left: 3px solid #B5651D; }
.home-attn-card.urgency-high { border-left: 3px solid #C0392B; background: #FDF0EE; }
.home-attn-card.urgency-critical { border-left: 3px solid #C0392B; background: #F9E0DD; }

.home-attn-type {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.home-attn-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}
.home-attn-detail {
  font-size: 0.78rem;
  color: var(--mid);
  line-height: 1.4;
}
.home-attn-time {
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 0.5rem;
}
.home-attn-time.calm { color: var(--gold); }
.home-attn-time.amber { color: #B5651D; }
.home-attn-time.high { color: #C0392B; }

/* ── Pick up where you left off — recent docs list ───────────── */
.home-resume {
  margin-bottom: 1.5rem;
}
.home-resume-card-list {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.85rem 1rem 0.6rem;
}
.home-resume-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.home-resume-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.home-resume-clear {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: var(--r-sm);
  transition: all var(--t);
}
.home-resume-clear:hover { color: var(--ink); background: var(--surface); }
.home-resume-rows {
  display: flex;
  flex-direction: column;
}
.home-resume-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.4rem;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background var(--t);
}
.home-resume-row:hover { background: var(--surface); }
.home-resume-row + .home-resume-row {
  border-top: 1px solid var(--border);
}
.home-resume-row-icon {
  width: 1.7rem;
  height: 1.7rem;
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: var(--r-sm);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.home-resume-row-main {
  flex: 1;
  min-width: 0;
}
.home-resume-row-title {
  font-size: 0.875rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-resume-row-sub {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-resume-row-time {
  font-size: 0.7rem;
  color: var(--muted);
  flex-shrink: 0;
}

/* ── Chat backdrop ──────────────────────────────────────────── */
.home-chat-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,15,13,0.25);
  z-index: 49;
}
.home-chat-backdrop.hidden { display: none; }

/* ── Home chat (fixed bottom bar) ──────────────────────────── */
.home-chat-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 0.65rem 1.5rem calc(0.65rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Slide-up messages panel ───────────────────────────────── */
.home-chat-panel {
  width: 100%;
  max-width: 42rem;
  max-height: 55vh;
  display: flex;
  flex-direction: column;
  animation: chatPanelSlideUp 0.2s ease;
  margin-bottom: 0.5rem;
}
.home-chat-panel.hidden { display: none; }
@keyframes chatPanelSlideUp {
  from { opacity: 0; transform: translateY(1rem); }
  to   { opacity: 1; transform: translateY(0); }
}
.home-chat-panel-header {
  display: flex;
  justify-content: center;
  padding: 0.25rem 0 0.5rem;
}
.home-chat-collapse {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); background: none; border: none;
  cursor: pointer; padding: 0.25rem 0.5rem;
  border-radius: var(--r-sm);
}
.home-chat-collapse:hover { color: var(--ink); background: var(--surface); }
.home-chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0 0 0.5rem;
}
.home-chat-messages:empty { display: none; padding: 0; }

/* ── Last message preview ──────────────────────────────────── */
.home-chat-preview {
  width: 100%;
  max-width: 42rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 0.15s;
}
.home-chat-preview:hover { border-color: var(--gold); }
.home-chat-preview.hidden { display: none; }
.home-chat-preview-text {
  font-size: 0.8rem;
  color: var(--mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

/* ── Disclaimer ────────────────────────────────────────────── */
.lex-disclaimer {
  width: 100%;
  max-width: 42rem;
  font-size: 0.65rem;
  color: var(--muted);
  text-align: center;
  padding: 0.3rem 0;
}

/* ── Mode switcher (inline segmented control) ──────────────── */
.lex-mode-switcher {
  position: relative;
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--r-md) - 2px);
  padding: 2px;
  flex-shrink: 0;
}
.lex-mode-slider {
  position: absolute;
  top: 2px; left: 2px;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  background: var(--white);
  border-radius: calc(var(--r-md) - 2px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.2s ease;
}
.lex-mode-switcher.web .lex-mode-slider {
  transform: translateX(100%);
}
.lex-mode-btn {
  position: relative;
  z-index: 1;
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-sans);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.2s;
}
.lex-mode-btn.active { color: var(--ink); }

/* ── Web search citations ──────────────────────────────────── */
.lex-citations {
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}
.lex-citations-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.lex-citation-link {
  display: block;
  font-size: 0.7rem;
  color: var(--gold);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.6;
}
.lex-citation-link:hover { text-decoration: underline; }

/* ── Web mode indicator on messages ────────────────────────── */
.lex-msg-web-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #2980b9;
  color: white;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-bottom: 0.3rem;
}

/* ── Message timestamps ────────────────────────────────────── */
.lex-msg-time {
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 0.2rem;
}
.home-chat-messages .lex-msg-user {
  align-self: flex-end;
  background: var(--ink);
  color: var(--white);
  padding: 0.65rem 1rem;
  border-radius: var(--r-md) var(--r-md) 4px var(--r-md);
  font-size: 0.875rem;
  max-width: 85%;
  line-height: 1.5;
}
.home-chat-messages .lex-msg-ai {
  align-self: flex-start;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: var(--r-md) var(--r-md) var(--r-md) 4px;
  font-size: 0.875rem;
  max-width: 85%;
  line-height: 1.6;
  color: var(--ink);
}
.home-chat-messages .lex-thinking {
  align-self: flex-start;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.5rem 0;
}
/* ── Chat thread cards (home screen) ─────────────────────── */
.home-chat-messages .lex-thread {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 0.5rem;
  overflow: hidden;
  background: var(--white);
}
.home-chat-messages .lex-thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background: var(--white);
  cursor: pointer;
  gap: 0.5rem;
  border-bottom: 1px solid transparent;
}
.home-chat-messages .lex-thread-header:hover {
  background: var(--surface);
}
.home-chat-messages .lex-thread:not(.collapsed) .lex-thread-header {
  border-bottom-color: var(--border);
}
.home-chat-messages .lex-thread-preview {
  font-size: 0.8125rem;
  color: var(--ink);
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-chat-messages .lex-thread-meta {
  font-size: 0.7rem;
  color: var(--muted);
  flex-shrink: 0;
}
.home-chat-messages .lex-thread-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 20rem;
  overflow-y: auto;
}
.home-chat-messages .lex-thread.collapsed .lex-thread-body {
  display: none;
}
.home-chat-messages .lex-session-divider {
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
  padding: 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
/* ── Firm topbar ───────────────────────────────────────────── */
.home-topbar { position: relative; }
.home-topbar-center { display: flex; align-items: center; }
.home-topbar-firm {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--mid);
}
.home-invite-popup {
  position: absolute;
  top: 100%; right: 1.5rem;
  width: 22rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  padding: 1rem;
  z-index: 60;
}
.home-invite-popup.hidden { display: none; }
.home-invite-row { margin-bottom: 0.75rem; }
.home-invite-row label { display: block; margin-bottom: 0.25rem; }
.home-firm-code {
  font-family: monospace;
  font-size: 0.85rem;
  background: var(--surface);
  padding: 0.3rem 0.6rem;
  border-radius: var(--r-sm);
  letter-spacing: 0.05em;
  color: var(--ink);
  user-select: all;
}
.home-chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0.5rem 0.65rem 0.5rem 1rem;
  transition: border-color 0.15s;
}
.home-chat-input-row:focus-within {
  border-color: var(--gold);
}
.home-chat-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  line-height: 1.5;
  resize: none;
  max-height: 6rem;
  background: transparent;
  color: var(--ink);
}
.home-chat-input::placeholder { color: var(--muted); }
.home-chat-send {
  width: 2.25rem; height: 2.25rem;
  border-radius: var(--r-md);
  background: var(--ink);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.home-chat-send:hover { background: #2a2a25; }
.home-chat-send svg { stroke: var(--white); }

/* ── Quick actions popup ───────────────────────────────────── */
.home-chat-input-wrap { position: relative; width: 100%; max-width: 42rem; }
.home-chat-actions {
  position: absolute;
  bottom: 100%;
  left: 0; right: 0;
  margin-bottom: 0.4rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  animation: actionsSlideUp 0.15s ease;
  z-index: 10;
}
.home-chat-actions.hidden { display: none; }
@keyframes actionsSlideUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.home-action-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  font-family: var(--font-sans);
  background: none;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--ink);
  text-align: left;
  transition: background 0.1s;
  width: 100%;
}
.home-action-item:hover { background: var(--surface); }
.home-action-icon {
  width: 1.8rem; height: 1.8rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.7rem; font-weight: 700; color: var(--mid);
  flex-shrink: 0;
}
.home-action-title { font-size: 0.8rem; font-weight: 500; color: var(--ink); }
.home-action-desc { font-size: 0.7rem; color: var(--muted); }

/* modules toggle removed — grid always visible */

/* ── App grid ───────────────────────────────────────────────── */
.home-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 1rem;
}
.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}
.home-tile {
  padding: 1.35rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  position: relative;
}
.home-tile:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 16px rgba(201,168,76,0.1);
  transform: translateY(-2px);
}
.home-tile-icon {
  width: 2.5rem; height: 2.5rem;
  background: var(--surface);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.85rem;
  color: var(--mid);
}
.home-tile-label {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.25rem;
}
.home-tile-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

/* Admin tile — only visible when is_admin */
.home-tile.admin-only { display: none; }

/* Quick action tiles — gold-accented icon to distinguish action from nav */
.home-tile-action .home-tile-icon-gold {
  background: var(--gold-bg);
  color: var(--gold);
}
.home-tile-action:hover .home-tile-icon-gold {
  background: var(--gold);
  color: var(--white);
}

/* ═══════════════════════════════════════════════════════════════════
   New home dashboard layout (2026-04-25)
   Ticker → 3-col main → news cards grid → workspace pills
   ═══════════════════════════════════════════════════════════════════ */

/* News ticker — TV-style scrolling headline strip */
.home-ticker {
  display: flex;
  align-items: stretch;
  background: var(--ink);
  color: var(--white);
  border-radius: var(--r-md);
  margin: 1.25rem 0 1.5rem;
  overflow: hidden;
  height: 2.5rem;
}
.home-ticker-label {
  flex-shrink: 0;
  background: var(--gold);
  color: var(--ink);
  padding: 0 0.85rem;
  display: flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.home-ticker-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}
.home-ticker-track {
  display: inline-flex;
  white-space: nowrap;
  animation: home-ticker-slide 90s linear infinite;
  padding-left: 100%; /* start off-screen right */
}
.home-ticker:hover .home-ticker-track { animation-play-state: paused; }
@keyframes home-ticker-slide {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
.home-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1.5rem;
  font-size: 0.78rem;
  color: var(--white);
  cursor: pointer;
  text-decoration: none;
}
.home-ticker-item:hover { color: var(--gold); }
.home-ticker-item-source {
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}
.home-ticker-item-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(255,255,255,0.4);
  display: inline-block;
}
.home-ticker-loading {
  display: inline-block;
  padding: 0 1rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
}
.home-ticker-close {
  flex-shrink: 0;
  width: 2.5rem;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  border-left: 1px solid rgba(255,255,255,0.08);
}
.home-ticker-close:hover {
  color: var(--white);
  background: rgba(255,255,255,0.06);
}
.home-ticker.hidden { display: none; }

/* 3-column dashboard band */
.home-dashboard {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1.2fr;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.home-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.1rem 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  min-height: 18rem;
  /* Cap the card height so a long Recently-opened-docs list (or any
     one column with more items than the others) can't push the whole
     row taller. Excess content scrolls inside the list. */
  max-height: 24rem;
  /* Grid items default to min-width: auto, which makes them grow
     to fit their min-content. A long doc title (e.g. "Bullen and
     Leake's Precedents of Pleadings in Actions") would push this
     card past its 1.2fr track and squeeze the other two columns.
     min-width: 0 lets the card honor its track size; the
     home-list-item-label rules below take care of ellipsis. */
  min-width: 0;
}
.home-card-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.85rem;
}
.home-card-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
  min-height: 0;
}
.home-card-list::-webkit-scrollbar { width: 6px; }
.home-card-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.home-card-list::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.home-card-loading {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.5rem 0;
}
.home-card-empty {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.5rem 0;
  line-height: 1.5;
}
.home-card-cta {
  margin-top: 0.6rem;
  padding: 0.4rem 0;
  background: none;
  border: none;
  border-top: 1px solid var(--border-2);
  text-align: left;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--mid);
  cursor: pointer;
}
.home-card-cta:hover { color: var(--gold); }

/* Action list (left column) */
.home-action-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}
.home-action-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.5rem;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background 0.12s;
}
.home-action-row:hover { background: var(--surface); }
.home-action-row-icon {
  width: 1.65rem; height: 1.65rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-bg);
  color: var(--gold);
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.home-action-row-label {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
}
.home-action-row-arrow {
  font-size: 0.85rem;
  color: var(--muted);
  transition: transform 0.15s, color 0.15s;
}
.home-action-row:hover .home-action-row-arrow {
  color: var(--gold);
  transform: translateX(2px);
}

/* Today / Recent list items */
.home-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.5rem 0.4rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
  border: none;
  background: none;
  width: 100%;
}
.home-list-item:hover { background: var(--surface); }
.home-list-item-icon {
  width: 1.65rem; height: 1.65rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.home-list-item-icon.is-court { background: rgba(192,57,43,0.1); color: #C0392B; }
.home-list-item-icon.is-meeting { background: rgba(46,125,82,0.1); color: #2E7D52; }
.home-list-item-icon.is-deadline { background: rgba(181,101,29,0.1); color: #B5651D; }
.home-list-item-icon.is-task { background: rgba(201,168,76,0.15); color: var(--gold); }
.home-list-item-icon.is-doc { background: var(--surface); color: var(--mid); }
.home-list-item-body { flex: 1; min-width: 0; }
.home-list-item-label {
  font-size: 0.82rem;
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-list-item-meta {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

/* News cards section */
.home-news-section { margin-bottom: 1.75rem; }
.home-news-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.home-news-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}
.home-news-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.home-news-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.home-news-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--surface);
}
.home-news-card-body {
  padding: 0.7rem 0.8rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}
.home-news-card-source {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.home-news-card-headline {
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--ink);
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Workspace pills row — these are the primary navigation into work
   modules from home, so they need to read as buttons, not cream-on-cream
   tags. Solid surface, ink text, gold-on-hover. */
.home-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.home-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1.1rem;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--white);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 2px rgba(12,12,10,0.06);
}
.home-pill svg { color: var(--gold); }
.home-pill:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(201,168,76,0.25);
}
.home-pill:hover svg { color: var(--ink); }
.home-pill.admin-only { display: none; }

/* Legal footer — privacy/terms always reachable from inside the app */
.home-legal {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 0 0.25rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.home-legal a {
  color: var(--mid);
  text-decoration: none;
  transition: color 0.15s;
}
.home-legal a:hover { color: var(--gold-2); text-decoration: underline; }
.home-legal-sep { color: var(--border); }
.home-legal-copy { margin-left: auto; font-size: 0.7rem; color: var(--muted); }

@media (max-width: 640px) {
  .home-legal-copy { margin-left: 0; width: 100%; }
}

/* Responsive */
@media (max-width: 1100px) {
  .home-dashboard { grid-template-columns: 1fr 1fr; }
  .home-card-actions { grid-column: 1 / -1; }
  .home-action-list { flex-direction: row; flex-wrap: wrap; }
  .home-action-row { flex: 1 1 calc(33.333% - 0.4rem); min-width: 14rem; }
  .home-news-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
  .home-dashboard { grid-template-columns: 1fr; }
  .home-card-actions { grid-column: auto; }
  .home-action-row { flex: 1 1 100%; }
  .home-news-grid { grid-template-columns: repeat(2, 1fr); }
  .home-card { min-height: 0; }
}
@media (max-width: 540px) {
  .home-news-grid { grid-template-columns: 1fr; }
}

/* ── Tutorial pill ──────────────────────────────────────────── */
.home-guide-pill {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--ink);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 50;
  transition: transform 0.15s;
}
.home-guide-pill:hover { transform: scale(1.05); }
.home-guide-pill.hidden { display: none; }

/* Wordmark in the topbar — serif "Lex" + gold dot, doubles as
   "back to Home" affordance. Only visible in work mode (the Home
   shell has its own chrome). Per lex-design-system primitive A. */
.topbar-wordmark {
  display: none;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.3rem 0.4rem;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink);
  border-radius: var(--r-sm);
  transition: background 0.12s ease;
}
.topbar-wordmark:hover { background: var(--paper-3); }
.topbar-wordmark-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
}
.topbar-wordmark-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--gold);
  transform: translateY(-2px);
}
.topbar-breadcrumb-chev {
  display: none;
  color: var(--ink-4);
  opacity: 0.5;
  flex-shrink: 0;
}
#app.work-mode .topbar-wordmark { display: inline-flex; }
#app.work-mode .topbar-breadcrumb-chev { display: inline-block; }

/* ── Tutorial overlay ────────────────────────────────────────── */
#tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
}
.tutorial-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 13, 0.45);
  cursor: pointer;
}
.tutorial-highlight {
  position: relative;
  z-index: 101;
  box-shadow: 0 0 0 4px var(--gold), 0 0 0 6px rgba(201,168,76,0.3);
  border-radius: var(--r-lg);
}
.tutorial-callout {
  position: fixed;
  z-index: 102;
  width: 20rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  animation: tutorialFadeIn 0.2s ease;
}
@keyframes tutorialFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tutorial-step-count {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.tutorial-callout-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.tutorial-callout-body {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--mid);
  margin-bottom: 1rem;
}
.tutorial-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Morph transition overlay ────────────────────────────────── */
#morph-overlay {
  position: fixed;
  z-index: 9999;
  background: var(--white);
  border-radius: var(--r-lg);
  pointer-events: none;
  opacity: 0;
  transition: top 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              left 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              border-radius 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.15s ease;
}
#morph-overlay.morphing {
  opacity: 1;
}
#morph-overlay.morph-full {
  border-radius: 0;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .home-topbar { padding: 1rem 1.5rem; }
  .home-content { padding: 1.5rem 1.5rem 5.5rem; }
  .home-greeting { font-size: 1.6rem; }
  .home-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .home-topbar { padding: 0.85rem 1rem; }
  .home-content { padding: 1.25rem 1rem 5rem; }
  .home-greeting { font-size: 1.35rem; }
  .home-grid { grid-template-columns: 1fr; }
  .home-attn-card { width: 15rem; }
  .home-chat-bar { padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom)); }
  .home-chat-panel { max-height: 50vh; }
  .home-invite-popup { right: 0.75rem; width: calc(100vw - 1.5rem); max-width: 22rem; }
}

/* ── Today's plate progress strip ───────────────────────────── */
.home-today-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.home-today-stat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.home-today-stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.home-today-stat-value {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}
.home-today-stat-value span {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 400;
}
.home-today-stat-bar {
  height: 4px;
  background: var(--surface);
  border-radius: 2px;
  overflow: hidden;
}
.home-today-stat-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Past / done items in today's plate render dimmer */
.home-list-item.is-past .home-list-item-label {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--muted);
}
.home-list-item.is-past .home-list-item-icon {
  opacity: 0.5;
}

/* ── Today's plate header (pop-out button) ──────────────────── */
.home-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.home-card-popout {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--mid);
  font-size: 0.7rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--t);
}
.home-card-popout:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-bg);
}
