/* =========================================================================
   Farm Friend admin — design tokens (dark control-panel palette)
   ========================================================================= */
:root {
  /* Surfaces — deep slate, three-step elevation so panels read clearly */
  --bg:           #0e1420;   /* page */
  --surface:      #161d2c;   /* cards / panels */
  --surface-2:    #1d2434;   /* recessed (table header, hover, soft pills) */
  --border:       #283149;   /* hairline divider between panels */
  --border-soft:  #1f273a;   /* subtler internal divider */

  /* Type — near-white over slate, cool-gray secondary */
  --fg:           #e6ebf3;
  --fg-2:         #bac3d3;
  --muted:        #8893a8;

  /* Brand + status — saturated enough to register against dark surfaces.
     "soft" tokens are translucent tints so pills look painted-on, not
     swatched-on. */
  --primary:        #6db257;   /* leaf green, brand */
  --primary-ink:    #0e1420;   /* dark text on the bright primary fill */
  --primary-soft:   rgba(109, 178, 87, 0.16);
  --primary-border: rgba(109, 178, 87, 0.32);
  --attention:      #e0a83a;
  --attention-soft: rgba(224, 168, 58, 0.16);
  --warn:           #ef6b6b;
  --warn-soft:      rgba(239, 107, 107, 0.16);
  --info:           #5aa7d6;
  --info-soft:      rgba(90, 167, 214, 0.16);

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;

  /* Radii + elevation — shadows on dark are weak; we use a soft outer glow
     for panels and a true black for depth. */
  --r-1: 6px;
  --r-2: 10px;
  --r-3: 14px;
  --shadow-1: 0 1px 0 rgba(0,0,0,0.30);
  --shadow-2: 0 8px 24px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.25);

  /* Type scale */
  --font-display: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans:    -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;

  --t-xs: 12px;
  --t-sm: 13px;
  --t-base: 15px;
  --t-md: 17px;
  --t-lg: 20px;
  --t-xl: 26px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-size: var(--t-base);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

[x-cloak] { display: none !important; }

/* =========================================================================
   App chrome: header + summary strip + tabs
   ========================================================================= */
/* Note: `[hidden]` must beat the `display: flex` rules below, otherwise the
   sign-in card flashes briefly before auth resolves and the error toast shows
   as an empty bar. */
[hidden] { display: none !important; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--s-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  position: sticky; top: 0; z-index: 50;
}
.app-header .wordmark {
  font-family: var(--font-display);
  font-size: var(--t-md);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--fg);
}
.app-header .auth-meta {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--t-sm); color: var(--muted);
}
.app-header .auth-meta .email {
  max-width: 180px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: none;
}
@media (min-width: 600px) { .app-header .auth-meta .email { display: inline; } }
.icon-btn {
  background: none; border: none; padding: 6px; color: var(--muted);
  cursor: pointer; border-radius: var(--r-1);
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--t-sm);
}
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }

.summary-strip {
  display: flex; gap: var(--s-4);
  padding: 6px var(--s-4) 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: var(--t-sm);
  overflow-x: auto;
  scrollbar-width: none;
}
.summary-strip::-webkit-scrollbar { display: none; }
.summary-strip .stat {
  display: inline-flex; align-items: baseline; gap: 6px;
  white-space: nowrap;
  color: var(--muted);
}
.summary-strip .stat strong {
  font-weight: 600; font-size: var(--t-md); color: var(--fg);
}
.summary-strip .stat.attention strong { color: var(--attention); }
.summary-strip .stat.warn strong { color: var(--warn); }

nav.tabs {
  display: flex; gap: 2px;
  padding: 0 var(--s-2);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
  overflow-x: auto;
  scrollbar-width: none;
}
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button {
  background: none; border: none; cursor: pointer;
  padding: 12px var(--s-3);
  font-size: var(--t-sm); font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  min-height: 44px; /* touch target */
}
nav.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
nav.tabs .pill {
  display: inline-block; margin-left: 6px;
  background: var(--surface-2); color: var(--muted);
  font-size: 11px; font-weight: 600;
  padding: 1px 6px; border-radius: 8px; min-width: 18px; text-align: center;
}
nav.tabs button.active .pill { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-border); }
nav.tabs .pill.attention { background: var(--attention-soft); color: var(--attention); }
nav.tabs .pill.warn { background: var(--warn-soft); color: var(--warn); }

/* =========================================================================
   Page container
   ========================================================================= */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--s-5) var(--s-4) var(--s-7);
}
main.main-wide {
  max-width: 1600px;
}

h1, h2, h3 { margin: 0; }
.section-title {
  font-size: var(--t-md);
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 var(--s-3);
  display: flex; align-items: baseline; gap: var(--s-2);
}
.section-title .muted-count {
  font-size: var(--t-sm); color: var(--muted); font-weight: 400;
}
.section-sub {
  color: var(--muted);
  font-size: var(--t-sm);
  margin: -8px 0 var(--s-4);
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  background: var(--primary);
  color: var(--primary-ink);
  border: 1px solid var(--primary);
  border-radius: var(--r-1);
  padding: 9px 14px;
  font-size: var(--t-sm); font-weight: 500;
  cursor: pointer;
  min-height: 38px;
  transition: transform 0.04s ease, opacity 0.12s ease;
}
.btn:hover { opacity: 0.94; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent; color: var(--fg-2);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); }

.btn-quiet {
  background: transparent; color: var(--muted);
  border-color: transparent;
  padding: 6px 8px;
}
.btn-quiet:hover { color: var(--warn); background: var(--warn-soft); border-color: var(--warn); }

.btn-block { width: 100%; }

/* =========================================================================
   Cards
   ========================================================================= */
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: var(--s-4);
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,0.03);
}
.card-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s-3);
}
.card-row.tappable { cursor: pointer; }
.card-title {
  font-weight: 600; color: var(--fg); font-size: var(--t-base);
}
.card-meta {
  color: var(--muted); font-size: var(--t-sm); margin-top: 2px;
}
.card-body-text {
  margin-top: var(--s-2);
  font-size: var(--t-base);
  color: var(--fg-2);
  line-height: 1.5;
}
.card-actions {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  margin-top: var(--s-3);
}

/* Marker stripes on attention cards */
.card.attention {
  border-left: 3px solid var(--attention);
  padding-left: calc(var(--s-4) - 2px);
}
.card.warn {
  border-left: 3px solid var(--warn);
  padding-left: calc(var(--s-4) - 2px);
}

/* =========================================================================
   Pills / badges / chips
   ========================================================================= */
.pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  font-size: var(--t-xs); font-weight: 500;
  border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  white-space: nowrap;
}
.pill.ok { background: var(--primary-soft); color: var(--primary); }
.pill.attention { background: var(--attention-soft); color: var(--attention); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.neutral { background: var(--surface-2); color: var(--fg-2); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s-3); }
.chip {
  display: inline-flex; align-items: center;
  background: var(--surface); color: var(--fg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: var(--t-sm); cursor: pointer;
  min-height: 32px;
}
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }

/* =========================================================================
   Forms
   ========================================================================= */
.form { display: grid; gap: var(--s-3); }
.form label.field {
  display: grid; gap: 4px;
  font-size: var(--t-sm); color: var(--muted);
}
.form input[type=number],
.form input[type=text],
.form textarea,
.form select {
  font: inherit; color: var(--fg);
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  background: var(--surface);
}
.form input:focus,
.form textarea:focus,
.form select:focus {
  outline: 2px solid var(--primary-border);
  outline-offset: -1px;
  border-color: var(--primary);
}
.form textarea { resize: vertical; min-height: 64px; }

.day-toggles {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.day-toggles .day {
  position: relative;
}
.day-toggles input { position: absolute; opacity: 0; pointer-events: none; }
.day-toggles .day span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px;
  padding: 0 8px;
  font-size: var(--t-sm); font-weight: 500;
  background: var(--surface); color: var(--fg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  cursor: pointer;
}
.day-toggles input:checked + span {
  background: var(--primary-soft); color: var(--primary);
  border-color: var(--primary-border);
}

.hour-range { display: flex; gap: var(--s-3); }
.hour-range .field { flex: 1; }

/* =========================================================================
   Empty / loading states
   ========================================================================= */
.empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--r-2);
  padding: var(--s-5);
  text-align: center;
  color: var(--muted);
  font-size: var(--t-sm);
}
.empty .glyph {
  display: block;
  font-size: 22px;
  margin-bottom: 4px;
  opacity: 0.6;
}

.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: var(--s-4);
  display: grid; gap: 6px;
}
.skel-line {
  height: 10px; background: var(--surface-2); border-radius: 4px;
  animation: pulse 1.4s ease-in-out infinite;
}
.skel-line.short { width: 40%; }
.skel-line.med   { width: 70%; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: 0.55 } }

/* =========================================================================
   Worklist
   ========================================================================= */
.worklist-empty {
  margin-top: var(--s-5);
}

/* =========================================================================
   Roster
   ========================================================================= */
.roster-section { margin-bottom: var(--s-6); }
.roster-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.roster-card + .roster-card { margin-top: var(--s-2); }
.roster-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  user-select: none;
}
.roster-card-head:hover { background: var(--surface-2); }
.roster-card-head .who { display: grid; gap: 2px; }
.roster-card-head .name { font-weight: 600; }
.roster-card-head .sub { color: var(--muted); font-size: var(--t-sm); }
.roster-card-head .chev {
  color: var(--muted); transition: transform 0.18s ease;
  font-family: var(--font-sans);
}
.roster-card[data-open="true"] .chev { transform: rotate(90deg); }
.roster-card-body {
  border-top: 1px solid var(--border-soft);
  padding: var(--s-4);
  background: var(--surface-2);
}

/* =========================================================================
   Opportunities
   ========================================================================= */
.opp-card { padding: var(--s-3) var(--s-4); }
.opp-card .top {
  display: flex; align-items: center; gap: var(--s-2);
  justify-content: space-between;
}
.opp-card .farm { font-weight: 600; }
.opp-card .activity { color: var(--muted); font-size: var(--t-sm); margin-top: 2px; }
.opp-card .meta-row {
  display: flex; flex-wrap: wrap; gap: var(--s-3);
  margin-top: var(--s-2);
  font-size: var(--t-sm); color: var(--muted);
}
.opp-card .seats-bar {
  height: 6px; background: var(--surface-2); border-radius: 3px;
  margin-top: var(--s-2); overflow: hidden;
}
.opp-card .seats-bar > span {
  display: block; height: 100%; background: var(--primary);
}
.opp-card.full .seats-bar > span { background: var(--info); }

/* =========================================================================
   System Test — conversation transcript
   ========================================================================= */
/* =========================================================================
   DEMO STAGE — phone-mockup conversation wall
   The demo is the dashboard's hero surface (first tab). Each pinned person is
   rendered as a smartphone showing a live SMS thread, so the coordinator can
   present 3–4 simultaneous conversations to an audience.
   ========================================================================= */

/* --- Demo-mode chrome collapse -----------------------------------------
   On the Demo tab the phones are the product. Shrink the header, drop the
   KPI strip (hidden in markup), and let the stage fill the viewport. */
.demo-mode .app-header { padding: 6px var(--s-4); }
.demo-mode .app-header .wordmark { font-size: var(--t-base); }
.demo-mode main {
  max-width: none;
  padding: var(--s-3) var(--s-4) var(--s-4);
}

.demo-empty { margin-top: var(--s-6); }

/* Slim, single-row operator bar. */
.stage-bar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-bottom: var(--s-3);
  font-size: var(--t-sm);
}
.stage-bar-spacer { flex: 1 1 auto; }

.btn-danger-outline {
  background: transparent;
  color: var(--warn);
  border: 1px solid var(--warn);
  padding: 6px 10px;
}
.btn-danger-outline:hover:not(:disabled) { background: var(--warn-soft); }
.btn-danger {
  background: var(--warn);
  color: #fff;
  border: 1px solid var(--warn);
  padding: 6px 10px;
}
.btn-danger:hover:not(:disabled) { filter: brightness(1.1); }
.btn-danger:disabled,
.btn-danger-outline:disabled { opacity: 0.45; cursor: not-allowed; }
.clear-confirm {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.clear-confirm-label { color: var(--muted); }
.clear-confirm-label code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--warn);
  font-weight: 600;
}
.clear-confirm-input {
  width: 92px;
  font-family: inherit;
  text-transform: uppercase;
}
.clear-result { color: var(--muted); font-style: italic; }
.btn-link {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: var(--t-sm);
  cursor: pointer;
  padding: 4px 6px;
}
.btn-link:hover:not(:disabled) { color: var(--fg); text-decoration: underline; }
.btn-link:disabled { opacity: 0.4; cursor: default; }

.pin-add select {
  padding: 6px 10px;
  font-size: var(--t-sm);
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--r-2, 6px);
}
.pin-phone {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.pin-phone input {
  width: 170px;
  padding: 6px 10px;
  font-size: var(--t-sm);
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--r-2, 6px);
}
.pin-phone .btn { min-height: 34px; padding: 6px 12px; }

/* --- Phone wall --------------------------------------------------------- */
/* A centered row of smartphones. Fixed phone width (300px) and flex-wrap so
   1 phone centers, 2–4 sit side by side on a laptop/projector, and they wrap
   to a new row on narrower screens. */
.phone-wall {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: var(--s-4);
}
.phone-wall.wall-1 { justify-content: center; }

.phone { flex: 0 0 auto; display: flex; }

/* Bezel: the physical phone shell. Subtle metallic edge + screen inset.
   Fills available height so the phones are the dominant element. */
.phone-bezel {
  position: relative;
  width: 380px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #2b3346, #11161f);
  border-radius: 42px;
  padding: 13px;
  box-shadow:
    0 0 0 2px #000,
    0 18px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 1px rgba(255, 255, 255, 0.08);
}
/* Notch / speaker pill at the top of the bezel. */
.phone-notch {
  position: absolute;
  top: 17px; left: 50%;
  transform: translateX(-50%);
  width: 100px; height: 7px;
  background: #05070b;
  border-radius: 999px;
  z-index: 3;
}
/* Screen: the actual chat surface, clipped to rounded glass. Height tracks the
   viewport minus the (collapsed) chrome above, clamped so it stays phone-like. */
.phone-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: clamp(720px, calc(100vh - 170px), 900px);
  min-height: 720px;
  background: var(--bg);
  border-radius: 30px;
  overflow: hidden;
}

/* Chat app top bar — who is holding this phone. */
.chat-bar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 22px var(--s-3) 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  flex: 0 0 auto;
}
.role-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--muted);
}
.role-dot.role-farmer { background: var(--attention); }
.role-dot.role-volunteer { background: var(--primary); }
.role-dot.role-both { background: var(--info); }
.role-dot.role-unknown { background: var(--muted); }
.chat-bar-who {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
  margin-right: auto;
}
.chat-name {
  font-weight: 600;
  font-size: var(--t-base);
  color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-role {
  font-size: var(--t-xs);
  color: var(--muted);
  text-transform: capitalize;
}
.chat-clear { padding: 2px 6px; }
.chat-x {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}
.chat-x:hover { color: var(--warn); }

/* Conversation scroll area. */
.chat-thread {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--s-3);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  scrollbar-width: thin;
}
.chat-thread::-webkit-scrollbar { width: 5px; }
.chat-thread::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
/* Each turn is wrapped in a bare <div> by the x-for template; make it a flex
   column so the bubble's align-self (left/right) actually takes effect. */
.chat-thread > div {
  display: flex;
  flex-direction: column;
}
.thread-empty {
  color: var(--muted);
  font-size: var(--t-sm);
  font-style: italic;
  text-align: center;
  margin: auto 0;
}

/* Message bubbles — iMessage-style. inbound = person (right, green);
   outbound = Farm Friend (left, grey). */
.bubble {
  max-width: 78%;
  width: fit-content;
  padding: 9px 13px;
  border-radius: 18px;
  font-size: var(--t-sm);
  line-height: 1.38;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble.inbound {
  align-self: flex-end;
  background: var(--primary);
  color: var(--primary-ink);
  border-bottom-right-radius: 5px;
}
.bubble.outbound {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}
.bubble-from {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  opacity: 0.8;
  margin-bottom: 3px;
}
.bubble.typing { padding: 12px 14px; }
.typing-dots { display: inline-flex; align-items: center; gap: 4px; }
.typing-dots > span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--fg);
  opacity: 0.35;
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-dots > span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots > span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-3px); opacity: 0.85; }
}

/* System / error rows inside the thread. */
.chat-system {
  align-self: center;
  font-size: var(--t-xs);
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: 2px 8px;
}
.chat-error {
  align-self: stretch;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--warn);
  background: var(--warn-soft);
  border-radius: var(--r-1);
  padding: 8px 10px;
}

/* Compose bar pinned to the bottom of the phone. */
.chat-compose {
  flex: 0 0 auto;
  padding: var(--s-2) var(--s-2) var(--s-3);
  background: var(--surface);
  border-top: 1px solid var(--border-soft);
}
.quick-replies {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 7px;
  scrollbar-width: none;
}
.quick-replies::-webkit-scrollbar { display: none; }
.quick-chip {
  flex: 0 0 auto;
  appearance: none;
  background: var(--surface-2);
  color: var(--fg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--t-xs);
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.quick-chip:hover { color: var(--fg); border-color: var(--primary-border); }
.compose-row {
  display: flex;
  align-items: flex-end;
  gap: var(--s-2);
}
.compose-row textarea {
  flex: 1;
  font-family: inherit;
  font-size: var(--t-sm);
  padding: 8px 12px;
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 18px;
  resize: none;
  max-height: 90px;
  box-sizing: border-box;
}
.compose-row textarea:focus {
  outline: none;
  border-color: var(--primary-border);
}
.send-btn {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.send-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(14, 20, 32, 0.35);
  border-top-color: var(--primary-ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast-error {
  position: fixed; left: 50%; bottom: 24px;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: var(--r-2);
  padding: 10px 14px;
  font-size: var(--t-sm);
  box-shadow: var(--shadow-2);
  z-index: 9999;
  display: flex; align-items: center; gap: 10px;
  max-width: calc(100vw - 32px);
}
.toast-error button {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 16px; line-height: 1;
}

/* =========================================================================
   Sign-in screen
   ========================================================================= */
.signin {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: var(--s-5);
  background: var(--bg);
  text-align: center;
}
.signin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-2);
  padding: var(--s-6) var(--s-5);
  max-width: 380px; width: 100%;
}
.signin .wordmark {
  font-family: var(--font-display);
  font-size: var(--t-xl);
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 4px;
}
.signin .tagline {
  color: var(--muted);
  font-size: var(--t-sm);
  margin-bottom: var(--s-5);
}
.signin .pending-state {
  color: var(--attention);
  font-size: var(--t-sm);
  margin-top: var(--s-3);
}
