/* Nora SMS mockup. Board chrome follows the v68 shell, greeting, weather card and Nora header. */

:root {
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s6: 24px;
  --s8: 32px;
  --radius: 24px;
  --pill: 99px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  font: 15px var(--font-family, system-ui, -apple-system, "Segoe UI", sans-serif);
  color: var(--ink, #14213D);
  background: var(--ground, #F6F7FB);
}

h1, h2, h3, p { margin: 0; }

.board-main {
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  overflow: auto;
  padding: 16px 32px 88px;
  max-width: none;
}

.board-main > * {
  max-width: 1190px;
  margin-left: auto;
  margin-right: auto;
}

/* Shell (from v68 index), kept local so this page is not an iframe. */
.shell-rail {
  position: static;
  height: 100dvh;
  overflow: auto;
  background: linear-gradient(180deg, var(--ink), var(--ink-deep));
  color: var(--surface, #fff);
  padding: var(--s4);
  min-width: 0;
}

.shell-brand {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s4);
}

.shell-brand img,
.shell-mobile img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.shell-brand span { display: block; font-size: 13px; color: #c4cee5; }

.shell-rail summary {
  font-size: 13px;
  color: #c4cee5;
  cursor: pointer;
  min-height: 32px;
  display: flex;
  align-items: center;
}

.shell-row {
  display: flex;
  align-items: center;
  gap: var(--s2);
  text-align: left;
  width: 100%;
  border: 0;
  border-radius: var(--s2);
  padding: 0 var(--s2);
  min-height: 44px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.shell-row[aria-current] {
  background: var(--navy-hot, #1B2C58);
  color: var(--peach, #FFB46B);
}

.shell-rail .nav-label {
  color: #a8b0c8;
  font-size: 11px;
  margin: var(--s4) 0 var(--s2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shell-rail .secondary {
  margin-top: var(--s4);
  border-top: 1px solid #1a2240;
  padding-top: var(--s2);
}

.nav-copy { min-width: 0; line-height: 1.2; }
.nav-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #a8b0c8;
  font-size: 12px;
  margin-top: 2px;
}

.nav-tags {
  margin-left: auto;
  display: grid;
  justify-items: end;
  gap: 2px;
  flex: none;
}

.nav-tag {
  border: 1px solid transparent;
  border-radius: var(--pill);
  font-size: 10px;
  line-height: 14px;
  padding: 0 6px;
  font-weight: 600;
  white-space: nowrap;
}

.nav-tag.hired { background: #e3f4e8; color: #1d6b35; border-color: #b6dfc2; }
.nav-tag.only { background: #e3e8f4; color: #1d2f57; border-color: #c3cde6; }
.nav-tag.testing { background: #1a2240; color: #bbc5de; border-color: #e5b868; }

.shell-mark {
  display: grid;
  place-items: center;
  background: var(--navy, #25407A);
  color: #f2703a;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
}

.shell-mark img { width: 100%; height: 100%; object-fit: cover; }

.shell-mobile { display: none; }
.shell-scrim { display: none; }
.shell-menu-close { display: none; }

.tubis-launch {
  position: fixed;
  right: var(--s4);
  bottom: var(--s4);
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 52px;
  padding: var(--s1) var(--s4) var(--s1) var(--s1);
  background: linear-gradient(180deg, var(--ink), var(--ink-deep));
  color: var(--surface, #fff);
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  z-index: 4;
  box-shadow: 0 8px 24px rgba(20, 33, 61, 0.28);
}

.tubis-launch img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 50%;
}

/* Nora product header: white pill on the navy banner, as in the v68 Inbox. */
html body .nora-shared-header {
  background: linear-gradient(120deg, var(--ink), var(--navy)) !important;
  border: 0 !important;
  border-radius: 16px !important;
  padding: 24px 20px 8px;
  color: var(--surface, #fff) !important;
  box-shadow: 0 10px 30px rgba(20, 33, 61, 0.12);
  margin: 16px auto 0;
}

.nora-shared-header .identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nora-shared-header img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

html body .nora-shared-header h1 {
  font-size: 26px;
  font-weight: 600 !important;
  color: inherit;
}

.nora-shared-header .identity p {
  margin-top: 8px;
  color: #e4e9f5;
  font-size: 13px;
  line-height: 1.55;
}

.nora-shared-header .tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 32px;
}

html body .nora-shared-header .tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  color: inherit !important;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html body .nora-shared-header .tabs a:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: inherit !important;
}

html body .nora-shared-header .tabs a[aria-current],
html body .nora-shared-header .tabs a[aria-current]:hover {
  background: #fff !important;
  color: #11192e !important;
}

/* Messages workspace */
.sms-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px auto 12px;
}

.sms-top h2 { font-size: 16px; font-weight: 600; }
.sms-top p { color: #4a5578; font-size: 13px; line-height: 1.5; margin-top: 2px; }

html body .sms-top .sms-new {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px !important;
  background: var(--orange, #FF7A1A) !important;
  border: 1px solid var(--orange, #FF7A1A) !important;
  color: #fff !important;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

html body .sms-top .sms-new:hover { background: #e86a12 !important; }

.sms-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(0, 1.55fr);
  min-height: min(620px, calc(100dvh - 260px));
  max-height: calc(100dvh - 220px);
  background: #fff;
  border: 1px solid var(--line-warm, #F3DDC2);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(20, 33, 61, 0.12);
}

.sms-list,
.sms-thread {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.sms-thread { border-left: 1px solid #e3e8f2; }

.sms-list-head,
.sms-thread-head {
  flex: none;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #e3e8f2;
  background: #fff;
}

.sms-list-head h2 { font-size: 16px; }
.sms-search {
  display: block;
  margin-top: 10px;
}

.sms-search input,
.sms-compose input,
.sms-compose textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #aab7cd;
  border-radius: 10px;
  font: inherit;
  color: inherit;
  background: #fff6ea;
}

.sms-compose textarea { min-height: 96px; resize: vertical; line-height: 1.5; }

.sms-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

html body .sms-filters button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px !important;
  border: 1px solid #C9D9FA !important;
  background: var(--blue-100, #E8F0FF) !important;
  color: var(--ink, #14213D) !important;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

html body .sms-filters button:hover {
  background: var(--orange, #FF7A1A) !important;
  border-color: var(--orange, #FF7A1A) !important;
  color: #fff !important;
}

html body .sms-filters button[aria-pressed="true"],
html body .sms-filters button[aria-pressed="true"]:hover {
  background: var(--ink, #14213D) !important;
  border-color: var(--ink, #14213D) !important;
  color: #fff !important;
}

.sms-coming {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f6f7fb;
  color: #4a5578;
  font-size: 12px;
  line-height: 1.45;
}

.sms-people {
  flex: 1;
  overflow: auto;
  padding: 6px;
}

.sms-person {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 8px 10px;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 10px 10px;
  margin-top: 2px;
  cursor: pointer;
}

.sms-person:hover { background: #edf2fa; }

.sms-person[aria-current="true"],
.sms-person[aria-current="true"]:hover {
  background: #e0e9f8;
  box-shadow: none;
  border-left: 3px solid #244d8b;
}

.sms-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #25407A;
  flex: none;
  grid-row: 1 / span 2;
  align-self: start;
}

.sms-person-top,
.sms-person-mid {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  grid-column: 2;
}

.sms-person-top strong {
  font-weight: 500;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sms-time {
  font-size: 12px;
  color: #5A6B93;
  flex: none;
  grid-column: 3;
  grid-row: 1;
}

.sms-snippet {
  grid-column: 2;
  font-size: 13px;
  color: #4a5578;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sms-person-meta {
  grid-column: 2 / 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #25407A;
  flex: none;
}

.sms-state,
.sms-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}

.sms-state { background: #EEF0F6; color: #5A6B93; }
.sms-state.waiting { background: #FFE7D3; color: #C2510A; }
.sms-state.approved, .sms-state.sent { background: #E8F0FF; color: #25407A; }
.sms-state.delivered { background: #E8F5ED; color: #195934; }
.sms-state.failed, .sms-state.opted { background: #FDECEC; color: #AE291C; }
.sms-state.check { background: #FFF4D6; color: #714400; }

.sms-tag.urgent {
  background: var(--orange, #FF7A1A);
  color: #fff;
}
.sms-tag.to-act { background: #fff0d2; color: #714400; }
.sms-tag.heads { background: #E8F0FF; color: #25407A; }

.sms-thread-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

html body .sms-back {
  display: none;
  flex: none;
  min-height: 44px;
  min-width: 44px;
  padding: 0 10px;
  border-radius: 999px !important;
  border: 1px solid #aab7cd !important;
  background: #fff !important;
  color: var(--ink) !important;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.sms-thread-who { min-width: 0; flex: 1; }
.sms-thread-who h2 { font-size: 16px; font-weight: 600; }
.sms-thread-who p { color: #4a5578; font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }

.sms-thread-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: none;
}

.sms-credit {
  font-size: 12px;
  color: #4a5578;
  text-align: right;
  line-height: 1.4;
  max-width: 16rem;
}

.sms-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  background: #FDECEC;
  color: #AE291C;
}

.sms-chat {
  flex: 1;
  overflow: auto;
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f7f8fb;
}

.sms-day {
  align-self: center;
  font-size: 12px;
  color: #5A6B93;
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
}

.sms-block { display: flex; flex-direction: column; gap: 6px; max-width: 100%; }

.sms-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: min(78%, 440px);
}

.sms-row.from-nora { align-self: flex-end; align-items: flex-end; }
.sms-row.from-them { align-self: flex-start; align-items: flex-start; }

.sms-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.sms-row.from-nora .sms-bubble {
  background: #11192e;
  color: #fff;
  border-bottom-right-radius: 6px;
}

.sms-row.from-them .sms-bubble {
  background: #E8F0FF;
  color: #0b1230;
  border-bottom-left-radius: 6px;
}

.sms-loose .sms-bubble {
  background: #fff;
  border: 1px solid #e3e8f2;
  color: #0b1230;
}

.sms-loose-label,
.sms-meta {
  font-size: 11px;
  color: #5A6B93;
  line-height: 1.35;
}

.sms-row.from-nora .sms-meta { text-align: right; }

.sms-opted-note {
  padding: 12px 14px;
  border-radius: 12px;
  background: #FFF4D6;
  color: #714400;
  font-size: 13px;
  line-height: 1.5;
}

.sms-draft-card {
  align-self: stretch;
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  border: 1px solid #e3e8f2;
  box-shadow: 0 2px 8px rgba(20, 33, 61, 0.05);
}

.sms-draft-card .draft-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.sms-draft-card .draft-title img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 50%;
}

.sms-draft-card h3 { font-size: 14px; font-weight: 600; }
.sms-draft-card .reason { font-size: 13px; color: #4a5578; margin-bottom: 10px; line-height: 1.45; }

.sms-draft-card textarea {
  width: 100%;
  min-height: 76px;
  padding: 8px 10px;
  border: 1px solid #aab7cd;
  border-radius: 10px;
  font: inherit;
  line-height: 1.5;
  color: inherit;
  background: #f7f8fb;
}

.sms-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

html body .sms-actions .primary,
html body .sms-modal .primary,
html body .sms-compose .primary {
  background: var(--orange, #FF7A1A) !important;
  border: 1px solid var(--orange, #FF7A1A) !important;
  color: #fff !important;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px !important;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

html body .sms-actions button,
html body .sms-compose .ghost,
html body .sms-modal .ghost {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px !important;
  border: 1px solid #aab7cd !important;
  background: #fff !important;
  color: var(--ink) !important;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

html body .sms-actions .skip {
  margin-inline-start: auto;
  background: transparent !important;
  border-color: transparent !important;
  color: #4a5578 !important;
}

.sms-draft-result { margin-top: 8px; font-size: 13px; color: #195934; }
.sms-draft-result:empty { display: none; }

.sms-composer {
  flex: none;
  padding: 12px 16px 16px;
  border-top: 1px solid #e3e8f2;
  background: #fff;
}

.sms-composer form,
.sms-compose {
  display: grid;
  gap: 8px;
}

.sms-composer textarea {
  width: 100%;
  min-height: 44px;
  max-height: 140px;
  padding: 10px 12px;
  border: 1px solid #aab7cd;
  border-radius: 14px;
  font: inherit;
  line-height: 1.45;
  resize: none;
  color: inherit;
}

.sms-composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.sms-composer-row p { font-size: 12px; color: #5A6B93; }

.sms-compose {
  padding: 16px;
  overflow: auto;
  background: #f7f8fb;
  flex: 1;
}

.sms-compose label.field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.sms-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #0b1230;
}

.sms-consent input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--navy, #25407A);
}

.sms-foot-note {
  margin: 10px auto 0;
  font-size: 12px;
  color: #5A6B93;
  line-height: 1.45;
}

/* Centre modal for cost review */
.sms-modal[hidden] { display: none !important; }

.sms-modal {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 16px;
}

.sms-modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 26, 51, 0.45);
}

.sms-modal-card {
  position: relative;
  width: min(420px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 24px 20px 20px;
  box-shadow: 0 16px 48px rgba(20, 33, 61, 0.24);
  max-height: calc(100dvh - 32px);
  overflow: auto;
}

.sms-modal-card h2 { font-size: 18px; }
.sms-modal-card .preview {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #11192e;
  color: #fff;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.sms-modal-card .cost {
  background: #FFF6EA;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
}

.sms-modal-card .cost strong { display: block; font-size: 16px; margin-bottom: 4px; }
.sms-modal-card .sms-actions { margin-top: 16px; }
.sms-modal-card .to { font-size: 13px; color: #4a5578; margin-top: 8px; }

.sms-empty {
  padding: 24px 16px;
  color: #5A6B93;
  font-size: 13px;
}

@media (max-width: 900px) {
  body {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
  }

  .shell-mobile {
    display: flex;
    align-items: center;
    gap: var(--s2);
    background: linear-gradient(180deg, var(--ink), var(--ink-deep));
    color: var(--surface, #fff);
    padding: var(--s2) var(--s4);
    flex: none;
    min-height: 52px;
  }

  html body .shell-mobile button {
    color: inherit !important;
    background: transparent !important;
    border: 0 !important;
    min-height: 44px;
    min-width: 44px;
    padding: 0;
    border-radius: 10px !important;
    cursor: pointer;
  }

  .shell-rail {
    display: none;
    position: static;
    height: auto;
    max-height: 62dvh;
    flex: none;
  }

  .shell-rail.shell-open { display: block; }
  .shell-brand { display: none; }

  .shell-menu-close {
    display: inline-flex;
    margin-left: auto;
    color: inherit;
    background: transparent;
    border: 0;
    min-height: 44px;
    min-width: 44px;
    font-size: 24px;
    cursor: pointer;
  }

  .board-main {
    flex: 1;
    height: auto;
    padding: 12px 16px 80px;
  }

  .tubis-launch { display: none; }
}

@media (max-width: 760px) {
  html body .nora-shared-header { padding: 16px 16px 8px; }
  .nora-shared-header .tabs { margin-top: 16px; }
  html body .nora-shared-header .tabs a { padding-inline: 10px; }

  .sms-grid {
    display: block;
    min-height: 0;
    max-height: none;
  }

  .sms-grid[data-view="list"] .sms-thread,
  .sms-grid[data-view="list"] .sms-compose-pane { display: none; }

  .sms-grid[data-view="thread"] .sms-list,
  .sms-grid[data-view="compose"] .sms-list { display: none; }

  html body .sms-back { display: inline-flex; }

  .sms-thread, .sms-list, .sms-compose-pane {
    min-height: 0;
  }

  .sms-row { max-width: 88%; }
}

@media (max-width: 479px) {
  .sms-credit { max-width: 11rem; font-size: 11px; }
  .board-main { padding: 10px 12px 72px; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .shell-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 26, 51, 0.4);
    z-index: 5;
    border: 0;
  }
  .shell-scrim.is-on { display: block; }
  .shell-rail.shell-open { position: relative; z-index: 6; }
}

/* Author display:flex must not override the hidden attribute. */
.sms-thread[hidden],
.sms-compose-pane[hidden],
[data-thread][hidden] {
  display: none !important;
}

/* Keep the composer in view on desktop; let the list and chat scroll inside the grid. */
@media (min-width: 901px) {
  .board-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 20px;
  }

  .hello.page-hello,
  .nora-shared-header,
  .sms-top,
  .sms-foot-note {
    flex: none;
    width: 100%;
  }

  .sms-grid {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    width: 100%;
  }

  .tubis-launch {
    right: 28px;
    bottom: 20px;
  }
}

/* Colourful.css styles [data-review] as navy. Keep SMS actions orange. */
html body .sms-composer button.primary,
html body .sms-composer button.primary[data-sms-review],
html body .sms-compose button.primary,
html body .sms-actions button.primary,
html body #review-new,
html body #modal-approve {
  background: var(--orange, #FF7A1A) !important;
  border-color: var(--orange, #FF7A1A) !important;
  color: #fff !important;
  background-image: none !important;
}

/* On a phone, opening a conversation should fill the screen. */
@media (max-width: 760px) {
  body:has(#sms-grid[data-view="thread"]) .page-hello,
  body:has(#sms-grid[data-view="compose"]) .page-hello,
  body:has(#sms-grid[data-view="thread"]) .nora-shared-header,
  body:has(#sms-grid[data-view="compose"]) .nora-shared-header,
  body:has(#sms-grid[data-view="thread"]) .sms-top,
  body:has(#sms-grid[data-view="compose"]) .sms-top,
  body:has(#sms-grid[data-view="thread"]) .sms-foot-note,
  body:has(#sms-grid[data-view="compose"]) .sms-foot-note {
    display: none !important;
  }

  body:has(#sms-grid[data-view="thread"]) .board-main,
  body:has(#sms-grid[data-view="compose"]) .board-main {
    padding: 8px 10px 12px;
    overflow: hidden;
  }

  .sms-grid[data-view="thread"],
  .sms-grid[data-view="compose"] {
    min-height: calc(100dvh - 68px);
    max-height: calc(100dvh - 68px);
  }

  .sms-top {
    align-items: center;
    flex-wrap: nowrap;
  }

  .sms-top .sms-new { flex: none; }

  .sms-thread-head {
    flex-wrap: wrap;
  }

  .sms-thread-aside {
    width: 100%;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
  }

  .sms-credit { text-align: right; }
}

/* Tighten the Nora banner slightly so the conversation keeps more height. */
html body .nora-shared-header {
  padding: 18px 20px 6px;
}
.nora-shared-header .tabs { margin-top: 18px; }

/* Kill the earlier 70dvh floor that pushed phone thread headers under the top bar. */
@media (max-width: 760px) {
  .sms-thread,
  .sms-list,
  .sms-compose-pane {
    min-height: 0;
  }

  .sms-grid[data-view="list"] {
    min-height: 0;
    max-height: none;
    height: auto;
  }

  body:has(#sms-grid[data-view="thread"]) .board-main,
  body:has(#sms-grid[data-view="compose"]) .board-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 8px 10px 10px;
    min-height: 0;
  }

  .sms-grid[data-view="thread"],
  .sms-grid[data-view="compose"] {
    flex: 1 1 auto;
    min-height: 0 !important;
    max-height: none !important;
    height: auto;
    display: flex;
    flex-direction: column;
  }
  .sms-grid[data-view="thread"] .sms-thread,
  .sms-grid[data-view="compose"] .sms-thread,
  .sms-grid[data-view="compose"] .sms-compose-pane {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
  }
  .sms-thread .sms-composer,
  .sms-compose-pane .sms-compose {
    flex: none;
  }
}

/* Tablet: fill leftover height like desktop, so the composer stays on screen. */
@media (min-width: 761px) and (max-width: 900px) {
  html body .page-hello:has(> .clock-widget) {
    padding-bottom: 112px !important;
  }
  .board-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 16px;
    min-height: 0;
  }
  .sms-grid {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    width: 100%;
  }
}

/* Keep the weather card on screen at tablet widths. */
@media (max-width: 900px) {
  html body .page-hello,
  html body .page-hello:has(> .clock-widget) {
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-direction: column !important;
    align-items: stretch !important;
    height: auto !important;
  }
  /* padding-bottom is applied in the tablet band only */
  html body .page-hello .hello-copy,
  html body .page-hello .clock-widget,
  html body .page-hello .clock-widget.weather-card {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    flex: 0 0 auto !important;
    left: auto !important;
    right: auto !important;
    position: static !important;
  }
}

.sms-search input,
.sms-compose input,
.sms-compose textarea {
  padding-left: 14px;
}

html body .board-main {
  overflow-x: hidden;
}
