/* =========================================================================
   MAIL — iOS 26 replica (Liquid Glass)
   Light mode only. Tuned for iPhone widths (375–430pt).
   ========================================================================= */

:root {
  /* Apple system colours, light appearance */
  --blue: #007aff;
  --orange: #ff9500;
  --red: #ff3b30;
  --gray: #8e8e93;
  --gray3: #c7c7cc;
  --gray4: #d1d1d6;
  --gray5: #e5e5ea;
  --gray6: #f2f2f7;

  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.6);
  --label-3: rgba(60, 60, 67, 0.3);
  --separator: rgba(60, 60, 67, 0.29);
  --fill-3: rgba(118, 118, 128, 0.12);
  --highlight: #d1d1d6;

  --bg: #ffffff;

  /* --- Liquid Glass -----------------------------------------------------
     Translucent, heavily blurred, over-saturated so colour bleeds through
     from the content behind, with a specular highlight along the top edge. */
  --glass: rgba(255, 255, 255, 0.7);
  --glass-solid: rgba(255, 255, 255, 0.92);
  --glass-blur: saturate(190%) blur(28px);
  --glass-edge: inset 0 0.5px 0 rgba(255, 255, 255, 0.9),
    inset 0 -0.5px 0 rgba(255, 255, 255, 0.35);
  --glass-lift: 0 6px 22px rgba(0, 0, 0, 0.11), 0 1px 3px rgba(0, 0, 0, 0.07);

  --nav-h: 44px;
  --inset: 16px;
  --row-inset: 72px; /* text + separator, clearing the dot and avatar */

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  --ease-nav: cubic-bezier(0.32, 0.72, 0, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display',
    'Helvetica Neue', system-ui, sans-serif;
  color: var(--label);
  font-size: 17px;
  line-height: 1.29;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

svg {
  display: block;
}

input,
textarea {
  font: inherit;
  border: 0;
  outline: 0;
  background: none;
  color: var(--label);
  -webkit-user-select: text;
  user-select: text;
}

/* =========================================================================
   SPLASH
   ========================================================================= */

#splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.32s ease 0.05s;
}

#splash img {
  width: 96px;
  height: 96px;
  border-radius: 22.37%;
  animation: splash-in 0.5s var(--ease-nav) both;
}

@keyframes splash-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

body.launched #splash {
  opacity: 0;
  pointer-events: none;
}

/* =========================================================================
   SCREENS + PUSH TRANSITION
   ========================================================================= */

.screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transition: transform 0.42s var(--ease-nav);
  will-change: transform;
}

#detail {
  transform: translate3d(100%, 0, 0);
  box-shadow: -3px 0 12px rgba(0, 0, 0, 0.09);
  z-index: 20;
  visibility: hidden;
}

body.detail #detail {
  transform: translate3d(0, 0, 0);
  visibility: visible;
}

body.detail #inbox {
  transform: translate3d(-28%, 0, 0);
}

#inbox::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.42s var(--ease-nav);
}

body.detail #inbox::after {
  opacity: 0.06;
}

/* The whole stack recedes when a sheet is presented over it. */
body.sheet .screen {
  transform: scale(0.935) translateZ(0);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.45s var(--ease-nav), border-radius 0.45s var(--ease-nav);
}

body.sheet.detail #inbox {
  transform: scale(0.935) translate3d(-28%, 0, 0);
}

/* =========================================================================
   NAVIGATION BAR — glass
   ========================================================================= */

.navbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding-top: var(--safe-t);
  background: transparent;
  transition: background-color 0.22s linear, box-shadow 0.22s linear;
}

.navbar.stuck {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge);
}

.navbar.stuck::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.5px;
  background: var(--separator);
}

.nav-row {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  position: relative;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--blue);
  font-size: 17px;
  letter-spacing: -0.02em;
  padding: 5px 9px;
  border-radius: 999px;
  transition: opacity 0.1s, background-color 0.15s;
  white-space: nowrap;
}

.nav-btn:active {
  opacity: 0.4;
  background: rgba(120, 120, 128, 0.14);
}

.nav-compact {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--label);
  opacity: 0;
  transition: opacity 0.15s linear;
  pointer-events: none;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navbar.stuck .nav-compact {
  opacity: 1;
}

/* =========================================================================
   SCROLL AREA
   ========================================================================= */

.scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-top: calc(var(--safe-t) + var(--nav-h));
}

.large-title {
  font-size: 34px;
  line-height: 41px;
  font-weight: 700;
  letter-spacing: 0.011em;
  padding: 3px var(--inset) 6px;
}

/* =========================================================================
   SEARCH
   ========================================================================= */

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px var(--inset) 10px;
  background: var(--bg);
}

.search-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 18px; /* capsule — iOS 26 */
  background: var(--fill-3);
  color: var(--label-2);
}

.search-field .glass {
  flex: none;
  opacity: 0.85;
}

.search-field input {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.search-field input::placeholder {
  color: var(--label-2);
  opacity: 1;
}

.clear-btn {
  flex: none;
  display: none;
  color: var(--gray);
  padding: 2px;
}

.clear-btn:active {
  opacity: 0.4;
}

body.has-query .clear-btn {
  display: block;
}

.cancel-btn {
  flex: none;
  color: var(--blue);
  font-size: 17px;
  letter-spacing: -0.02em;
  width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  transition: width 0.25s var(--ease-nav), opacity 0.2s linear,
    margin-right 0.25s var(--ease-nav);
  margin-right: -8px;
}

.cancel-btn:active {
  opacity: 0.4;
}

body.searching .cancel-btn {
  width: 56px;
  opacity: 1;
  margin-right: 0;
}

body.searching #inbox .navbar,
body.searching #inbox .large-title {
  display: none;
}

body.searching #inbox .scroll {
  padding-top: var(--safe-t);
}

body.searching #inbox .search-wrap {
  position: sticky;
  top: 0;
  z-index: 5;
}

.empty {
  display: none;
  text-align: center;
  padding: 72px 40px;
  color: var(--label-2);
}

.empty strong {
  display: block;
  font-size: 20px;
  font-weight: 600;
  color: var(--label);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.empty span {
  font-size: 15px;
  letter-spacing: -0.01em;
}

body.no-results .empty {
  display: block;
}

/* =========================================================================
   MESSAGE LIST
   ========================================================================= */

.list {
  list-style: none;
  padding-bottom: calc(var(--safe-b) + 104px); /* clears the floating toolbar */
}

.row {
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.row-actions {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: stretch;
}

.row-actions.trailing {
  right: 0;
}

.row-actions.leading {
  left: 0;
}

.action {
  width: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #fff;
  font-size: 11px;
  letter-spacing: -0.01em;
}

.action:active {
  filter: brightness(0.88);
}

.action.more {
  background: #a2a2a8;
}
.action.flag {
  background: var(--orange);
}
.action.archive {
  background: #0a84ff;
}
.action.unread {
  background: var(--blue);
}

.row-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg);
  padding: 10px var(--inset) 11px 20px;
  transition: transform 0.32s var(--ease-nav);
  will-change: transform;
  touch-action: pan-y;
}

.row.dragging .row-content {
  transition: none;
}

.row-content:active {
  background: var(--highlight);
}

/* Centred on the avatar, not the row — rows vary in height. */
.dot {
  position: absolute;
  left: 6px;
  top: 27px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0;
}

.row.unread .dot {
  opacity: 1;
}

/* Sender avatar — shown in the list from iOS 26. */
.avatar-sm {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  margin-top: 1px;
}

.row-main {
  flex: 1;
  min-width: 0;
}

.row-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.sender {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 17px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: -0.02em;
}

.sender-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Marks a message you sent. */
.sent-mark {
  flex: none;
  color: var(--label-2);
  position: relative;
  top: 1px;
}

.meta {
  flex: none;
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--label-2);
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.01em;
}

.meta .chev {
  color: var(--gray3);
  margin-right: -4px;
  align-self: center;
  position: relative;
  top: 1px;
}

.subject {
  font-size: 15px;
  line-height: 19px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.preview-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.preview {
  flex: 1;
  min-width: 0;
  color: var(--label-2);
  font-size: 15px;
  line-height: 18px;
  letter-spacing: -0.01em;
  margin-top: 1px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clip-pip {
  flex: none;
  color: var(--label-2);
  margin-bottom: 2px;
}

.flagpip {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  margin-bottom: 4px;
}

.row + .row .row-content::before {
  content: '';
  position: absolute;
  left: var(--row-inset);
  right: 0;
  top: 0;
  height: 0.5px;
  background: var(--separator);
}

mark {
  background: rgba(0, 122, 255, 0.22);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

/* =========================================================================
   FLOATING TOOLBAR — iOS 26 glass controls
   ========================================================================= */

.toolbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 18px calc(var(--safe-b) + 12px);
  pointer-events: none;
  /* Content scrolls beneath the floating controls, so it has to be faded
     out behind them or the status text becomes unreadable. */
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.97) 0%,
    rgba(255, 255, 255, 0.92) 46%,
    rgba(255, 255, 255, 0) 100%
  );
}

.toolbar > * {
  pointer-events: auto;
}

.cap {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-lift), var(--glass-edge);
  transition: transform 0.15s var(--ease-nav), opacity 0.12s;
}

.cap:active {
  transform: scale(0.92);
  opacity: 0.7;
}

.updated {
  color: var(--label-2);
  font-size: 13px;
  line-height: 16px;
  letter-spacing: -0.01em;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.9), 0 0 3px rgba(255, 255, 255, 1);
}

/* Message view: one glass capsule holding four actions. */
.toolbar.grouped {
  justify-content: center;
}

.bar-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-lift), var(--glass-edge);
}

.bar-btn {
  width: 56px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--blue);
  transition: background-color 0.15s, transform 0.12s;
}

.bar-btn:active {
  background: rgba(120, 120, 128, 0.16);
  transform: scale(0.94);
}

.bar-btn[disabled] {
  color: var(--gray3);
  pointer-events: none;
}

/* =========================================================================
   MESSAGE DETAIL
   ========================================================================= */

.detail-body {
  padding: 12px var(--inset) 110px;
}

.detail-subject {
  font-size: 22px;
  line-height: 27px;
  font-weight: 600;
  letter-spacing: 0.001em;
  padding-bottom: 11px;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 0;
  border-top: 0.5px solid var(--separator);
  border-bottom: 0.5px solid var(--separator);
}

.avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
}

.detail-who {
  flex: 1;
  min-width: 0;
}

.detail-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.detail-from {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-date {
  flex: none;
  color: var(--label-2);
  font-size: 15px;
  letter-spacing: -0.01em;
}

.detail-to {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--label-2);
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.01em;
  margin-top: 1px;
}

/* Tap the header — name, avatar or chevron — to reveal the addresses. */
.detail-head {
  cursor: pointer;
  position: relative;
}

.detail-head:active {
  opacity: 0.55;
}

/* Sits on the second line and stays put through the expansion. */
.head-chev {
  position: absolute;
  right: 0;
  top: 37px;
  color: var(--gray3);
  transform: rotate(90deg);
  transition: transform 0.22s var(--ease-nav);
}

.detail-head.expanded .head-chev {
  transform: rotate(-90deg);
}

.detail-head.expanded .detail-to {
  display: none;
}

.detail-more {
  display: none;
  padding-right: 20px;
}

.detail-head.expanded .detail-more {
  display: block;
}

.dline {
  font-size: 15px;
  line-height: 21px;
  letter-spacing: -0.01em;
  color: var(--label);
  word-break: break-word;
}

.dkey {
  color: var(--label-2);
}

.detail-text {
  font-size: 17px;
  line-height: 23px;
  letter-spacing: -0.01em;
  padding-top: 16px;
  white-space: pre-wrap;
  word-wrap: break-word;
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* =========================================================================
   ATTACHMENT TILE
   ========================================================================= */

.attach {
  width: 172px;
  margin-top: 26px;
  border: 0.5px solid var(--separator);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
  transition: opacity 0.1s, transform 0.12s;
  display: block;
  text-align: left;
}

.attach:active {
  opacity: 0.7;
  transform: scale(0.97);
}

.attach-page {
  height: 198px;
  background: #fff;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--gray3);
}

.attach-page img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.attach-foot {
  padding: 7px 10px 8px;
  background: var(--gray6);
  border-top: 0.5px solid var(--separator);
}

.attach-name {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attach-sub {
  font-size: 12px;
  line-height: 15px;
  color: var(--label-2);
  letter-spacing: -0.01em;
  margin-top: 1px;
}

/* =========================================================================
   MAILBOXES
   ========================================================================= */

#mailboxes {
  transform: translate3d(-28%, 0, 0);
  visibility: hidden;
  z-index: 5;
  background: var(--gray6);
}

body.mailboxes #mailboxes {
  transform: translate3d(0, 0, 0);
  visibility: visible;
}

body.mailboxes #inbox {
  transform: translate3d(100%, 0, 0);
}

.mb-group {
  margin: 22px var(--inset) 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}

.mb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  text-align: left;
  font-size: 17px;
  letter-spacing: -0.02em;
  position: relative;
}

.mb-row:active {
  background: var(--gray5);
}

.mb-row + .mb-row::before {
  content: '';
  position: absolute;
  left: 46px;
  right: 0;
  top: 0;
  height: 0.5px;
  background: var(--separator);
}

.mb-row .ic {
  flex: none;
  color: var(--blue);
  width: 22px;
  display: grid;
  place-items: center;
}

.mb-row .label {
  flex: 1;
}

.mb-row .count {
  color: var(--label-2);
  font-size: 17px;
}

.mb-row .chev {
  color: var(--gray3);
}

/* =========================================================================
   SCRIM — behind sheets and menus
   ========================================================================= */

#scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s var(--ease-nav), visibility 0.32s;
}

body.sheet #scrim,
body.menu #scrim {
  opacity: 1;
  visibility: visible;
}

body.menu #scrim {
  background: rgba(0, 0, 0, 0.14);
}

/* =========================================================================
   REPLY MENU — floating glass menu anchored above the toolbar
   ========================================================================= */

#menu {
  position: fixed;
  z-index: 60;
  right: 14px;
  bottom: calc(var(--safe-b) + 74px);
  width: 252px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--glass-solid);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22), var(--glass-edge);
  transform: scale(0.86) translateY(14px);
  transform-origin: 78% 100%;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.26s var(--ease-nav), opacity 0.18s linear, visibility 0.26s;
}

body.menu #menu {
  transform: scale(1) translateY(0);
  opacity: 1;
  visibility: visible;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 11px 15px;
  font-size: 17px;
  letter-spacing: -0.02em;
  text-align: left;
  color: var(--label);
  position: relative;
}

.menu-item + .menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0.5px;
  background: var(--separator);
}

.menu-item:active {
  background: rgba(120, 120, 128, 0.18);
}

.menu-item .mi {
  flex: none;
  color: var(--label);
}

/* =========================================================================
   COMPOSE SHEET
   ========================================================================= */

#compose {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 50;
  margin-top: calc(var(--safe-t) + 10px);
  background: var(--bg);
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translate3d(0, 100%, 0);
  visibility: hidden;
  box-shadow: 0 -2px 24px rgba(0, 0, 0, 0.18);
  transition: transform 0.45s var(--ease-nav), visibility 0.45s;
}

body.sheet #compose {
  transform: translate3d(0, 0, 0);
  visibility: visible;
}

.compose-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 52px;
  padding: 0 12px;
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge);
}

.compose-bar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.5px;
  background: var(--separator);
}

.compose-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  max-width: 54%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.send-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  transition: transform 0.12s, opacity 0.15s;
}

.send-btn:active {
  transform: scale(0.9);
}

.send-btn[disabled] {
  background: var(--gray5);
  color: var(--gray);
  pointer-events: none;
}

.compose-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.field {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 11px var(--inset);
  position: relative;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.field::after {
  content: '';
  position: absolute;
  left: var(--inset);
  right: 0;
  bottom: 0;
  height: 0.5px;
  background: var(--separator);
}

.field .flabel {
  flex: none;
  color: var(--label-2);
}

.field input {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.field .token {
  background: rgba(0, 122, 255, 0.14);
  color: var(--label);
  border-radius: 6px;
  padding: 1px 6px;
}

.compose-body {
  width: 100%;
  min-height: 140px;
  padding: 14px var(--inset) 0;
  font-size: 17px;
  line-height: 23px;
  letter-spacing: -0.01em;
  resize: none;
  display: block;
}

/* Quoted original, with the blue rule iOS draws beside it. */
.quote {
  margin: 4px var(--inset) 40px;
  padding-left: 12px;
  border-left: 2px solid #c3d9f5;
  color: #3c3c4399;
  font-size: 17px;
  line-height: 23px;
  letter-spacing: -0.01em;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.quote-head {
  padding: 18px var(--inset) 2px;
  font-size: 17px;
  line-height: 23px;
  letter-spacing: -0.01em;
  color: var(--label);
}

.compose-attach {
  margin: 0 var(--inset) 24px;
}

/* =========================================================================
   ATTACHMENT VIEWER (Quick Look)
   ========================================================================= */

#qlook {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: #f2f2f7;
  display: flex;
  flex-direction: column;
  transform: translate3d(0, 100%, 0);
  visibility: hidden;
  transition: transform 0.42s var(--ease-nav), visibility 0.42s;
}

body.qlook #qlook {
  transform: translate3d(0, 0, 0);
  visibility: visible;
}

.ql-bar {
  flex: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  padding: 0 14px;
  padding-top: var(--safe-t);
  height: calc(var(--nav-h) + var(--safe-t));
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge);
  z-index: 2;
}

.ql-bar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.5px;
  background: var(--separator);
}

.ql-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin-top: calc(var(--safe-t) / 2);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.ql-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 12px calc(var(--safe-b) + 24px);
}

.ql-page {
  width: 100%;
  display: block;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
}

.ql-count {
  text-align: center;
  color: var(--label-2);
  font-size: 13px;
  letter-spacing: -0.01em;
  padding-top: 14px;
}

/* =========================================================================
   MOTION PREFERENCES
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
  .screen,
  .row-content,
  #splash,
  .cancel-btn,
  #compose,
  #qlook,
  #menu,
  #scrim {
    transition-duration: 0.01ms !important;
  }
  #splash img {
    animation: none;
  }
}
