:root {
  --bg: #e8eef8;
  --card: rgba(255, 255, 255, 0.86);
  --ink: #0b1220;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.35);
  --blue: #2563eb;
  --cyan: #06b6d4;
  --good: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --glow: rgba(37, 99, 235, 0.22);
  font-family: "IBM Plex Sans", "PingFang TC", "Noto Sans TC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
/* Keep [hidden] above any display: rules (modals/labels/screens) */
[hidden] { display: none !important; }
html, body {
  height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(37,99,235,.18), transparent 55%),
    radial-gradient(760px 380px at 100% 0%, rgba(6,182,212,.14), transparent 50%),
    radial-gradient(700px 400px at 80% 110%, rgba(5,150,105,.10), transparent 55%),
    linear-gradient(180deg, #eef3fb 0%, #e8eef8 40%, #edf2f7 100%);
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(37,99,235,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 20%, #000 20%, transparent 75%);
  z-index: 0;
}
.screen { min-height: 100dvh; position: relative; z-index: 1; }

.desktop-only { display: none !important; }
.mobile-only { display: block; }
@media (min-width: 900px) {
  .desktop-only { display: block !important; }
  .mobile-only { display: none !important; }
}

/* Auth */
.auth {
  display: grid;
  place-items: center;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  background:
    radial-gradient(900px 400px at 10% 0%, rgba(37,99,235,.18), transparent 55%),
    radial-gradient(700px 360px at 100% 100%, rgba(5,150,105,.1), transparent 50%),
    var(--bg);
}
.auth-box {
  width: min(460px, 100%);
  background: var(--card);
  border-radius: 20px;
  padding: 22px 18px 18px;
  box-shadow: 0 16px 50px rgba(17, 24, 39, 0.08);
}
.pill {
  display: inline-block;
  background: linear-gradient(120deg, #dbeafe, #e0f2fe 40%, #d1fae5);
  background-size: 200% 100%;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 999px;
  animation: pillShine 4s ease-in-out infinite;
}
@keyframes pillShine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.chat-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 900px) {
  .chat-header {
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
    background: #fff;
  }
}
.who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  height: 32px;
  padding: 0 8px;
  border-radius: 9px;
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #06b6d4 55%, #059669);
  box-shadow: 0 4px 16px var(--glow), inset 0 0 0 1px rgba(255,255,255,.25);
  flex-shrink: 0;
  animation: brandPulse 3.2s ease-in-out infinite;
}
.dash-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.dash-card:hover {
  transform: translateY(-1px);
  border-color: rgba(37,99,235,.28);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.08);
}
.resources-list {
  display: grid;
  gap: 6px;
}
.res-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(248,250,252,.9);
  border: 1px solid var(--line);
  font-size: 12px;
}
.res-item strong { display: block; font-size: 12px; }
.res-item small { color: var(--muted); font-size: 10px; }
.res-empty { color: var(--muted); font-size: 12px; margin: 0; }
.ai-bubble {
  align-self: stretch;
  flex-shrink: 0;
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(37,99,235,.08), rgba(6,182,212,.10));
  border: 1px solid rgba(37,99,235,.22);
  box-shadow: 0 8px 24px rgba(37,99,235,.08);
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.5;
}
.ai-bubble .ai-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
  border-radius: 999px;
  padding: 2px 8px;
  margin-bottom: 8px;
  font-family: "Orbitron", sans-serif;
}

@keyframes brandPulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28); }
  50% { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(14, 165, 233, 0.35); }
}
.avatar { font-size: 26px; line-height: 1; }
.who strong { display: block; font-size: 14px; }
.who small { color: var(--muted); font-size: 11px; }

.header-mid {
  min-width: 0;
  display: grid;
  align-items: center;
}
.nav-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-progress-track {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  position: relative;
}
.nav-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #22d3ee, #34d399, #2563eb);
  background-size: 200% 100%;
  transition: width 0.55s cubic-bezier(.2,.8,.2,1);
  animation: progressFlow 2.8s linear infinite;
}
@keyframes progressFlow {
  from { background-position: 0% 50%; }
  to { background-position: 200% 50%; }
}
.nav-progress-pct {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--blue);
  min-width: 2.6em;
  text-align: right;
}

.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  width: 36px; height: 36px;
  border-radius: 10px;
  cursor: pointer;
}
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

@media (max-width: 720px) {
  .chat-header {
    grid-template-columns: 1fr auto;
  }
  .header-mid {
    grid-column: 1 / -1;
    order: 3;
  }
  .who .brand-mark { display: none; }
}

.auth-top h1 {
  margin: 10px 0 6px;
  font-size: clamp(26px, 6vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.auth-top p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.auth-box label, .modal-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}
.auth-box input, .modal-card textarea, .compose-row textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}
.auth-box .label { margin: 4px 0 8px; font-size: 13px; font-weight: 600; }
.animal-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 14px;
}
@media (max-width: 400px) { .animal-grid { grid-template-columns: repeat(6, 1fr); } }
.animal-btn {
  aspect-ratio: 1;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fafafa;
  font-size: 22px;
  cursor: pointer;
}
.animal-btn.selected { border-color: var(--blue); background: #eff6ff; transform: scale(1.05); }
.animal-btn.taken { opacity: 0.28; cursor: not-allowed; filter: grayscale(1); }
.err { color: var(--danger); font-size: 13px; margin: 8px 0 0; }
.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}
.btn.primary { width: 100%; background: var(--blue); color: #fff; }
.auth-step { margin-top: 4px; }
.auth-who {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
}
.btn-sm { padding: 8px 12px; font-size: 12px; width: auto; }
.btn.ghost { width: 100%; margin-top: 8px; }
.header-actions .btn.ghost { width: auto; margin-top: 0; }
.linkish {
  border: none;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

/* App shell */
.app {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto 1fr;
  max-width: 1280px;
  margin: 0 auto;
}
@media (min-width: 900px) {
  .app {
    grid-template-rows: auto 1fr;
    padding: 0 16px 16px;
    height: 100dvh;
  }
}

.lang-switch {
  display: inline-flex;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 2px;
}
.lang-btn {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.lang-btn.active { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.auth-lang { margin-bottom: 10px; }

/* Mobile progress dock */
.progress-dock {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}
.viz-top {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  align-items: center;
}
.ring-wrap { position: relative; width: 64px; height: 64px; }
.ring-wrap.lg { width: 88px; height: 88px; }
.ring-wrap.lg .ring { width: 88px; height: 88px; }
.ring { width: 64px; height: 64px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #e5e7eb; stroke-width: 3.5; }
.ring-fg {
  fill: none; stroke: var(--blue); stroke-width: 3.5;
  stroke-linecap: round; transition: stroke-dasharray 0.4s ease;
}
.ring-label {
  position: absolute; inset: 0;
  display: grid; place-content: center; text-align: center; line-height: 1;
}
.ring-label b { font-size: 16px; color: var(--blue); }
.ring-wrap.lg .ring-label b { font-size: 22px; }
.ring-label small { font-size: 10px; color: var(--muted); }
.viz-next { background: #eff6ff; border-radius: 14px; padding: 8px 10px; min-width: 0; }
.next-kicker {
  display: block; font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; color: var(--blue); text-transform: uppercase;
}
.viz-next strong, .hero-progress h2 {
  display: block; font-size: 14px; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hero-progress h2 { font-size: 18px; white-space: normal; margin: 4px 0; }
.viz-next small, .muted { color: var(--muted); font-size: 12px; }
.countdown {
  background: #fff7ed; border-radius: 14px; padding: 8px 10px; text-align: center; min-width: 78px;
}
.countdown b { display: block; font-size: 22px; color: var(--warn); line-height: 1; }
.countdown span { font-size: 10px; color: var(--muted); }
.countdown small {
  display: block; margin-top: 2px; font-size: 10px;
  max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.step-path { display: flex; gap: 4px; margin-top: 10px; overflow-x: auto; }
.dot { flex: 1; min-width: 18px; height: 8px; border-radius: 99px; background: #e5e7eb; }
.dot.done { background: var(--good); }
.dot.current { background: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.2); }
.depth-badge {
  display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
}
.depth-badge.weak { background: #fef2f2; color: #b91c1c; }
.depth-badge.ok { background: #fffbeb; color: #b45309; }
.depth-badge.strong { background: #ecfdf5; color: #047857; }

/* Workspace split */
.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  height: 100%;
}
@media (min-width: 900px) {
  .workspace {
    grid-template-columns: 360px 1fr;
    gap: 0;
    border: 1px solid var(--line);
    border-top: none;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
    background: #fff;
    min-height: 0;
  }
}
@media (min-width: 1100px) {
  .workspace { grid-template-columns: 400px 1fr; }
}

.dash-panel {
  background: #f8fafc;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 1em; /* ~one <br> between cards */
  max-height: calc(100dvh - 90px);
}
.dash-card h3 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.dash-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.hero-progress {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: center;
  background: linear-gradient(135deg, #eff6ff, #fff);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.card-head h3 { margin: 0; }

.roadmap {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.roadmap li {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: start;
  font-size: 13px;
}
.roadmap .mark {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #cbd5e1; margin-top: 2px;
}
.roadmap li.locked { opacity: 0.45; }
.roadmap li.rm-section {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  grid-template-columns: 0 1fr 0;
}
.roadmap li.rm-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.roadmap .rm-idx { color: var(--muted); font-weight: 600; }
.roadmap .rm-body {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.roadmap .rm-title { line-height: 1.3; }
.roadmap .rm-when {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}
.roadmap li.todo .mark { border-color: #cbd5e1; }
.roadmap li.current .mark {
  border-color: var(--blue);
  background: var(--blue);
}
.roadmap li.done .mark {
  border-color: var(--good);
  background: var(--good);
}
.roadmap li.waiting .mark {
  border-color: var(--warn);
  background: var(--warn);
}
.roadmap li.scheduled {
  opacity: 0.55;
}
.roadmap li.rm-note {
  grid-template-columns: 0 1fr 0;
  font-size: 10px;
  color: var(--muted);
  opacity: 0.9;
  margin: 0;
  padding: 0;
  border: 0;
}
.deadline-list { display: grid; gap: 4px; }
.dl-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  line-height: 1.25;
}
.dl-item .dl-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 6px;
  min-width: 0;
  flex: 1;
}
.dl-item .dl-main strong {
  font-weight: 650;
  font-size: 12px;
}
.dl-item .dl-main small {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.dl-item.urgent { background: #fff7ed; }
.dl-item.grace { background: #fef3c7; }
.dl-item.done {
  background: #ecfdf5;
  opacity: 0.92;
}
.dl-item.done strong { color: #047857; }
.dl-item .when {
  font-weight: 700;
  font-size: 11px;
  color: var(--warn);
  white-space: nowrap;
  flex-shrink: 0;
}
.dl-hint {
  margin: -4px 0 8px;
  font-size: 11px;
}
.notify-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  font-size: 13px;
}
.notify-banner .notify-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.notify-banner strong { font-size: 12px; color: var(--blue); }
.notify-banner span {
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.util-chips {
  padding: 0 12px 6px;
}
.util-chips .chip {
  background: #f3f4f6;
  color: var(--ink);
  border: 1px solid var(--line);
}
.auth-box input[type="file"],
.modal-card input[type="file"],
.modal-card input[type="text"] {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  width: 100%;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  margin: 8px 0;
  cursor: pointer;
}
.check-row input { margin-top: 2px; }

.sprint-status {
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  display: grid;
  gap: 2px;
  font-size: 13px;
}
.sprint-status strong { font-size: 14px; }
.sprint-status span { color: inherit; opacity: 0.9; font-size: 12px; }
.sprint-status.pending {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}
.sprint-status.done {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.sprint-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.sprint-banner.pending {
  background: #fff7ed;
  color: #9a3412;
}
.sprint-banner.done {
  background: #ecfdf5;
  color: #065f46;
}
.sprint-banner button {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}
.sprint-guide {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--ink);
  display: grid;
  gap: 4px;
}
.ambition-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.ambition-btn {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  cursor: pointer;
}
.ambition-btn:hover { border-color: var(--blue); background: #eff6ff; }
.ambition-btn b { display: block; margin-bottom: 2px; }
.ambition-btn span { font-size: 12px; color: var(--muted); }

.week-viz {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.stat {
  background: #f8fafc;
  border-radius: 12px;
  padding: 8px;
  text-align: center;
}
.stat b { display: block; font-size: 16px; }
.stat span { font-size: 11px; color: var(--muted); }
.stat.bad b { color: var(--danger); }
.stat.ok b { color: var(--good); }
.focus {
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  margin: 10px 0 0;
}

.product-preview { font-size: 13px; line-height: 1.5; }
.product-preview dl { margin: 0; display: grid; gap: 8px; }
.product-preview dt { font-size: 11px; font-weight: 700; color: var(--blue); }
.product-preview dd { margin: 2px 0 0; }

/* Chat column */
.chat-column {
  display: grid;
  grid-template-rows: 1fr auto auto;
  min-height: 0;
  height: 100%;
  background: #fff;
}
.chat-main { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, #f8fafc, #fff 40%);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
@media (min-width: 900px) {
  .chat-log { padding: 20px 22px; }
  .bubble { max-width: 78%; font-size: 15px; }
}
.bubble-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
  max-width: 88%;
}
.bubble-wrap.bot { align-self: flex-start; align-items: flex-start; }
.bubble-wrap.me { align-self: flex-end; align-items: flex-end; }
.bubble {
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  flex-shrink: 0;
}
.bubble.bot {
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.bubble.me {
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.bubble-time {
  font-size: 10px;
  color: var(--muted);
  padding: 0 4px;
}
.sys {
  align-self: center;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--muted);
  background: #e5e7eb;
  padding: 4px 10px;
  border-radius: 999px;
}
.sys.day {
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.typing {
  align-self: flex-start;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 13px;
  padding: 4px 8px;
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 8px;
}
.gap-chip {
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
}

.composer {
  border-top: 1px solid var(--line);
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  background: #fff;
}
@media (min-width: 900px) {
  .composer { padding: 12px 18px 16px; }
}
.chip {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  margin: 0 4px 8px 0;
  cursor: pointer;
}
.chip.good { background: #ecfdf5; border-color: #a7f3d0; color: var(--good); }
.compose-row {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  align-items: end;
}
.compose-row textarea {
  resize: none;
  max-height: 140px;
  min-height: 44px;
}
.send {
  width: 44px; height: 44px;
  border: none; border-radius: 14px;
  background: var(--blue); color: #fff;
  font-size: 18px; font-weight: 700; cursor: pointer;
}
.send:disabled { opacity: 0.5; }
.status { margin: 6px 0 0; font-size: 12px; color: var(--muted); min-height: 16px; }

.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  display: grid; place-items: end center;
  padding: 12px; z-index: 40;
}
@media (min-width: 720px) { .modal { place-items: center; } }
.modal-card {
  width: min(480px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 18px;
  max-height: 90dvh;
  overflow-y: auto;
}
.modal-card h2 { margin: 0 0 4px; font-size: 20px; }
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 12px;
}
.modal-actions .btn,
.modal-actions .btn.primary,
.modal-actions .btn.ghost {
  width: auto;
  margin-top: 0;
  flex: 0 0 auto;
}
