/* Transform Iran — Delta Mail
   Brand palette (matches dashboard):
     gold  #B28E44   cream #F7F3E9   navy  #282F39

   Delta logo treatments (mirrors dashboard ka-fab + .k-logo patterns):
   - .k-logo        — 14x14 black chip, inline action buttons
   - .k-logo-sm     — 12x12 black chip, suggestion chips
   - .k-logo-inline — 14x14 black chip, baseline-aligned for inline text
   - .delta-btn .k-logo (large variant) — 18x18 for hero CTAs
   - .delta-fab     — 56x56 corner FAB with breathing animation
   - .delta-mini-logo — 28x28 in the Delta panel header
   - .brand-mark    — 32x32 in the left rail
   See brand_delta_logo.md in user memory — MANDATORY on every Delta button.
*/

:root {
  /* Transform Iran brand palette — see brand_transform_iran.md */
  --gold: #B28E44;        /* wordmark + decorative stripes */
  --gold-dark: #8E6F35;
  --red: #E92A2E;         /* primary emphasis + CTAs (Impact Report pill, Mission box) */
  --red-dark: #C81F23;
  --cream: #F7F3E9;
  --cream-dark: #EDE6D2;
  --navy: #282F39;        /* body text + section tabs */
  --navy-soft: #4A5260;
  --paper: #FFFFFF;
  --line: #E2DBC8;
  --muted: #8A8576;
  --good: #4F9D5A;
  --bad: #C44545;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(40, 47, 57, .06);
  --shadow-md: 0 6px 18px rgba(40, 47, 57, .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  /* The page itself never scrolls — only the email list and the reading
     pane scroll independently inside their columns. */
  overflow: hidden;
  font-family: var(--font);
  font-size: 14px;
  color: var(--navy);
  background: var(--cream);
}

button { font-family: inherit; cursor: pointer; }

/* ============================================================
   APP SHELL — three-pane Outlook layout
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 240px 360px 1fr;
  height: 100vh;
  overflow: hidden; /* container never scrolls — children manage their own */
  background: var(--paper);
}

/* LEFT RAIL — frozen WHEN content fits, scrolls only if labels grow.
   overflow-y:auto = no scrollbar when content is short (looks frozen),
   scrollbar appears automatically when label list exceeds viewport. */
.rail {
  background: var(--cream);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  min-height: 0;       /* allows the grid cell to constrain it */
  overflow-y: auto;    /* frozen until folder list grows past viewport */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
/* Hide scrollbar visually when not actually scrolling — keeps the
   "frozen" look until growth actually requires interaction. */
.rail::-webkit-scrollbar { width: 0; }
.rail:hover::-webkit-scrollbar { width: 6px; }
.rail::-webkit-scrollbar-thumb { background: rgba(40,47,57,.18); border-radius: 3px; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.brand-mark {
  width: 32px; height: 32px;
  background: #000;
  border-radius: 7px;
  padding: 3px;
  object-fit: contain;
  display: block;
  box-sizing: border-box;
  flex-shrink: 0;
}
.brand-text { font-weight: 700; letter-spacing: .2px; color: var(--navy); }

.compose-btn {
  width: 100%;
  background: var(--red);
  color: white;
  border: none;
  border-radius: 999px;     /* pill shape matches the brand's URL pills */
  padding: 11px 12px;
  font-weight: 600;
  letter-spacing: .2px;
  margin-bottom: 16px;
  box-shadow: 0 4px 10px rgba(233, 42, 46, .18);
  transition: background .15s;
}
.compose-btn:hover:not(:disabled) { background: var(--red-dark); }
.compose-btn:disabled { opacity: .55; cursor: not-allowed; }

.folders { display: flex; flex-direction: column; gap: 14px; }
.folders-group { display: flex; flex-direction: column; }
.folders-group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  padding: 0 8px;
}

.folder {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--navy);
  font-weight: 500;
}
.folder:hover { background: var(--cream-dark); }
.folder.active { background: var(--cream-dark); color: var(--gold-dark); font-weight: 600; }
.folder.muted { color: var(--navy-soft); font-weight: 500; }
.folder-count { color: var(--muted); font-size: 12px; }

.rail-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.user-initial {
  width: 28px; height: 28px;
  background: var(--gold);
  color: white;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
}
.user-name { color: var(--navy-soft); font-size: 13px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-link { color: var(--muted); text-decoration: none; font-size: 16px; padding: 0 6px; border-radius: 4px; }
.logout-link:hover { background: var(--cream-dark); color: var(--navy); }

/* MIDDLE — email list. Header is sticky-style (flex-shrink: 0),
   the .mail-list inner area scrolls. */
.list {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  min-height: 0;      /* allows children to constrain to grid cell */
  overflow: hidden;   /* contains the inner scroll */
}

.list-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;     /* header never collapses */
  background: var(--paper);
}
.list-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.list-search input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--cream);
  font-size: 13px;
}
.list-search input:disabled { opacity: .7; }

.mail-list {
  flex: 1;
  min-height: 0;        /* required for flex children to scroll */
  overflow-y: auto;     /* THIS is what scrolls for long inboxes */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.mail-row {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .12s ease;
}
.mail-row:hover { background: var(--cream); }
.mail-row.selected { background: var(--cream-dark); }
.mail-row.unread .mail-sender,
.mail-row.unread .mail-subject {
  font-weight: 700;
  color: var(--navy);
}
.mail-row.unread::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);              /* unread = red dot (matches brand emphasis) */
  margin-top: 14px;
  margin-left: -8px;
  flex-shrink: 0;
}

.mail-avatar {
  width: 36px; height: 36px;
  background: var(--gold);             /* sender avatar stays gold — decorative, not action */
  color: white;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 600;
  flex-shrink: 0;
}

.mail-body { flex: 1; min-width: 0; }
.mail-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.mail-sender {
  font-weight: 600;
  color: var(--navy);
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-time {
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
}
.mail-subject {
  font-size: 13.5px;
  color: var(--navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}
.mail-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}
.mail-tag-slot {
  flex-shrink: 0;
  display: inline-flex;
}
.mail-snippet {
  font-size: 12.5px;
  color: var(--navy-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* AI classification tag chips — one per category, color-coded.
   Urgent = brand red. Reply needed = gold. Task = navy. The rest are
   muted/neutral so the urgent stuff visually dominates. */
.mail-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  line-height: 1.4;
}
.mail-tag.tag-urgent       { background: var(--red); color: white; }
.mail-tag.tag-reply-needed { background: var(--gold); color: white; }
.mail-tag.tag-task         { background: var(--navy); color: white; }
.mail-tag.tag-internal     { background: rgba(63, 182, 255, .15); color: #1B6FA8; }
.mail-tag.tag-receipt      { background: rgba(40, 47, 57, .08); color: var(--navy-soft); }
.mail-tag.tag-newsletter   { background: rgba(138, 133, 118, .12); color: var(--muted); }
.mail-tag.tag-fyi          { background: rgba(138, 133, 118, .12); color: var(--muted); }
.mail-tag.tag-auto         { background: rgba(138, 133, 118, .10); color: var(--muted); }

.list-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 24px;
  color: var(--muted);
}
.empty-icon { font-size: 42px; color: var(--gold); margin-bottom: 10px; }
.empty-title { font-size: 15px; color: var(--navy); font-weight: 600; margin-bottom: 6px; }
.empty-sub { font-size: 13px; line-height: 1.5; max-width: 280px; }

/* RIGHT — reading pane. Scrolls based on the open email's length. */
.reader {
  background: var(--paper);
  padding: 24px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.reader-empty {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.reader-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.reader-subject {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}
.reader-from {
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 4px;
}
.reader-email {
  color: var(--muted);
  margin-left: 6px;
  font-weight: 400;
}
.reader-meta {
  font-size: 12px;
  color: var(--muted);
}
.reader-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reader-loading,
.reader-empty-body {
  color: var(--muted);
  padding: 20px 0;
  text-align: center;
  font-size: 13px;
}
.reader-error {
  color: var(--bad);
  padding: 14px;
  background: #FCEDED;
  border: 1px solid rgba(196, 69, 69, .25);
  border-radius: 8px;
  font-size: 13px;
}
.reader-iframe {
  width: 100%;
  border: none;
  background: var(--paper);
  min-height: 200px;
  display: block;
}
.reader-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--navy);
  margin: 0;
  padding: 0;
}

.reader-attachments {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.reader-attachments-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 8px;
}
.reader-attachment {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
.reader-attachment .ra-name { flex: 1; font-weight: 500; color: var(--navy); }
.reader-attachment .ra-meta { color: var(--muted); font-size: 11.5px; }
.reader-attachment .ra-icon { color: var(--muted); }

/* ============================================================
   OUTLOOK-STYLE READER TOOLBAR — top of the open email
   ============================================================ */
.reader-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  margin: -24px -24px 16px;       /* extends to the column edges */
  border-bottom: 1px solid var(--line);
  background: var(--cream);
  flex-wrap: wrap;
}
.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--navy-soft);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.tb-btn:hover:not(:disabled) {
  background: var(--paper);
  color: var(--navy);
  border-color: var(--line);
}
.tb-btn:disabled { opacity: .45; cursor: wait; }
.tb-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  display: block;
  flex-shrink: 0;
}
.tb-btn.active {
  color: var(--gold-dark);
  background: rgba(178, 142, 68, .08);
}
.tb-btn.tb-danger:hover:not(:disabled) {
  color: var(--bad);
  border-color: rgba(196, 69, 69, .25);
  background: #FCEDED;
}
.tb-divider {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 4px;
}

/* ============================================================
   TOAST — small ephemeral notification (archive/star/etc feedback)
   ============================================================ */
.delta-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: white;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(40, 47, 57, .25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 9500;
}
.delta-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.delta-toast.error { background: var(--bad); }
.delta-toast.ok { background: var(--good); }

/* ============================================================
   DRAFT COMPOSER — inline reply card above the read message
   ============================================================ */
.draft-composer {
  background: var(--paper);
  border: 1px solid var(--red);
  border-radius: 14px;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(233, 42, 46, .12);
}
.draft-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}
.draft-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--navy);
  font-size: 13.5px;
}
.draft-title .k-logo { width: 16px; height: 16px; padding: 2px; }
.draft-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  line-height: 1;
}
.draft-close:hover { background: var(--cream-dark); color: var(--navy); }

.draft-fields { padding: 12px 16px 0; }
.draft-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.draft-field label {
  width: 60px;
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.draft-field input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13.5px;
  color: var(--navy);
  font-family: inherit;
  padding: 4px 0;
}

.draft-instructions {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.draft-extra-instructions {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12.5px;
  background: var(--paper);
  outline: none;
  font-family: inherit;
}
.draft-extra-instructions:focus { border-color: var(--gold); }

.draft-body-wrap {
  padding: 0 16px;
}
.draft-body {
  width: 100%;
  min-height: 240px;
  border: none;
  outline: none;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--navy);
  padding: 16px 0;
  background: transparent;
}

.draft-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--cream);
}
.draft-status {
  flex: 1;
  font-size: 12.5px;
  color: var(--muted);
}
.draft-status.ok { color: var(--good); font-weight: 600; }
.draft-status.error { color: var(--bad); }
.draft-status a { color: inherit; }
.reader-body {
  font-size: 14px;
  color: var(--navy);
  line-height: 1.6;
}
.reader-snippet {
  margin: 0 0 24px;
}
.reader-note {
  font-size: 12px;
  color: var(--muted);
  padding: 10px 12px;
  background: var(--cream);
  border-radius: 8px;
  border: 1px solid var(--line);
}

/* ============================================================
   DELTA SMALL ICON BUTTONS — mirrors dashboard .delta-btn pattern
   Use this whenever an action invokes Delta. Logo to the left of
   the text label with 7px gap. Never substitute an emoji.
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  font-family: inherit;
}
.btn:hover { background: var(--cream); }
.btn.primary {
  background: var(--red);
  border-color: var(--red);
  color: white;
}
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }

.btn.delta-btn { display: inline-flex; align-items: center; gap: 7px; }
.btn.delta-btn img.k-logo {
  width: 14px; height: 14px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
  background: #000;
  border-radius: 3px;
  padding: 1.5px;
  box-sizing: border-box;
}
.btn.delta-btn.large img.k-logo {
  width: 18px; height: 18px;
  padding: 2px;
}

/* Standalone small logo (for chips, suggestion pills, etc.) */
.k-logo {
  width: 14px; height: 14px;
  display: inline-block;
  object-fit: contain;
  flex-shrink: 0;
  background: #000;
  border-radius: 3px;
  padding: 1.5px;
  vertical-align: text-bottom;
  box-sizing: border-box;
}
.k-logo-sm {
  width: 12px; height: 12px;
  padding: 1px;
}
/* Inline variant for headings + label text — baseline-aligned */
.k-logo-inline {
  width: 14px; height: 14px;
  display: inline-block;
  object-fit: contain;
  flex-shrink: 0;
  background: #000;
  border-radius: 3px;
  padding: 1.5px;
  vertical-align: middle;
  margin-right: 4px;
  box-sizing: border-box;
}

/* ============================================================
   DELTA FAB — bottom-right floating launcher
   Matches dashboard pattern: 56x56, radius 14, bottom 22 right 22
   ============================================================ */
.delta-fab {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #000;
  border: none;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
  z-index: 9000;
  transition: transform .15s, box-shadow .15s;
}
.delta-fab:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }
.delta-fab img { width: 70%; height: 70%; display: block; object-fit: contain; }
.delta-fab .delta-fab-x { display: none; color: #fff; font-size: 24px; font-weight: 300; line-height: 1; }
.delta-fab.open img { display: none; }
.delta-fab.open .delta-fab-x { display: block; }
body.delta-panel-open .delta-fab { display: none; }

/* Soft "breathing" idle animation — gentle outward glow pulse + subtle scale.
   Matches the dashboard's ka-fab pattern. */
@keyframes delta-breathe {
  0%, 100% {
    box-shadow: 0 4px 14px rgba(0,0,0,.4), 0 0 0 0 rgba(178, 142, 68, .35);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 4px 14px rgba(0,0,0,.4), 0 0 0 14px transparent;
    transform: scale(1.025);
  }
}
.delta-fab:not(.open):not(:hover) {
  animation: delta-breathe 2.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .delta-fab { animation: none !important; }
}

/* DELTA PANEL — full-height slide-in from the RIGHT side.
   Mirrors the dashboard's ka-panel (which slides from the left)
   but flipped to match Shahryar's "AI on the right" preference.
   The panel sits ABOVE the inbox; you can still see the email
   list/folders peek behind it on wide screens. */
.delta-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: calc(100vw - 60px);
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 40px rgba(40, 47, 57, .14);
  display: flex;
  flex-direction: column;
  z-index: 9001;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform .25s ease-out;
  pointer-events: none;
}
.delta-panel.open {
  transform: translateX(0);
  pointer-events: auto;
}

/* ---------- DELTA PANEL HEADER ---------- */
.delta-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
  flex-shrink: 0;
}
.delta-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--navy);
  font-size: 14px;
}
.delta-mini-logo {
  width: 28px; height: 28px;
  background: #000;
  border-radius: 6px;
  padding: 3px;
  object-fit: contain;
  display: block;
  box-sizing: border-box;
  flex-shrink: 0;
}
.delta-close {
  background: transparent;
  border: none;
  color: var(--navy-soft);
  font-size: 22px;
  line-height: 1;
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
}
.delta-close:hover { background: var(--cream-dark); color: var(--navy); }

/* ---------- DELTA WELCOME STATE — vertically centered ---------- */
.delta-welcome {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;   /* vertical centering — the key fix */
  align-items: center;
  padding: 24px;
  text-align: center;
  min-height: 0;
}
.delta-big-logo {
  width: 72px; height: 72px;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.delta-big-logo img { width: 70%; height: 70%; display: block; object-fit: contain; }

.delta-greet {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 24px;
  color: var(--navy-soft);
}

.delta-input-wrap {
  width: 100%;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .15s;
}
.delta-input-wrap:focus-within { border-color: var(--gold); }

.delta-input {
  width: 100%;
  background: transparent;
  color: var(--navy);
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  min-height: 48px;
  max-height: 160px;
}
.delta-input::placeholder { color: var(--muted); }

.delta-input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.delta-input-actions-left {
  display: flex;
  gap: 2px;
  align-items: center;
}

/* Icon-only borderless circular buttons (mic + attach) — exact dashboard treatment. */
.delta-icon-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  width: 36px; height: 36px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background .12s, color .12s;
}
.delta-icon-btn:hover:not(:disabled) { background: var(--cream-dark); color: var(--navy); }
.delta-icon-btn:disabled { opacity: .45; cursor: not-allowed; }
.delta-icon-btn svg { width: 18px; height: 18px; fill: currentColor; display: block; }

.delta-send {
  background: var(--navy);
  color: white;
  border: none;
  padding: 7px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity .15s;
}
.delta-send:hover:not(:disabled) { opacity: .85; }
.delta-send:disabled { opacity: .45; cursor: not-allowed; }

.delta-footer-note {
  margin-top: 20px;
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

/* Suggestion chips in welcome state */
.delta-suggestions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  width: 100%;
}
.delta-chip {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--navy);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.delta-chip:hover { border-color: var(--gold); color: var(--gold-dark); }

/* ---------- CHAT STATE ---------- */
.delta-chat {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.delta-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.delta-messages::-webkit-scrollbar { width: 6px; }
.delta-messages::-webkit-scrollbar-thumb { background: rgba(40,47,57,.15); border-radius: 3px; }

.delta-msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.delta-msg.user {
  align-self: flex-end;
  background: var(--red);              /* "your voice" stands out, like brand callout quotes */
  color: white;
  border-bottom-right-radius: 4px;
}
.delta-msg.assistant {
  align-self: flex-start;
  background: var(--cream);
  color: var(--navy);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.delta-msg.assistant.loading {
  color: var(--muted);
  font-style: italic;
}
.delta-msg.error {
  background: #FCEDED;
  color: #8B1F1F;
  border: 1px solid rgba(196, 69, 69, .3);
}
.delta-msg .delta-msg-avatar {
  display: inline-block;
  width: 18px; height: 18px;
  background: #000;
  border-radius: 4px;
  padding: 2px;
  margin-right: 6px;
  vertical-align: text-bottom;
  box-sizing: border-box;
}

.delta-foot {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  flex-shrink: 0;
}
.delta-foot .delta-input-wrap {
  margin: 0;
}
.delta-foot .delta-input { min-height: 24px; }
.delta-foot textarea { rows: 1; }
