/* DJ Wine Mail — v2.0, real mail. MINIMAL.
   v2.0: the DJ Wine website theme, replacing the borrowed
   Dannayi light template — pure black background, white and
   gray only, system sans everywhere (the Cinzel login font
   is gone), the real DJ Wine white logo on the
   sign-in/register/reset pages and the swoosh mark in the
   app header and PWA icons.
   v1.13: offline mail reading — a plain black-on-white
   "Offline — showing saved mail" pill in the list toolbar,
   shown only while the mail on screen came from the saved
   copy in IndexedDB.
   v1.16: snooze — the Snoozed folder and the reading-pane
   Snooze picker reuse the schedule panel + chip styles
   (.schedule-panel, .snooze-chip); the "Wake now" row
   button reuses .undo-btn.
   v1.9: two-way swipe on message rows — drag left reveals
   white Flag + black Delete, drag right reveals black
   Archive (Archive folder, created on the server by
   djwine-mail-api v1.4 when it does not exist yet).
   v1.8: the login screen (and the reset page, which shares
   it) uses Cinzel Regular — the website's font, bundled
   locally as assets/fonts/cinzel-var.woff2, so the client
   still loads only local files. Lowercase renders as small
   caps, as on the site. No other screen changes.
   v1.7: an empty folder says "Mailbox is empty"; a failed
   list load shows an error instead of the empty message, so
   a dropped connection is never mistaken for an empty
   mailbox. Login/reset inputs: no autofocus (the caret sat
   on the placeholder's first letter) and 16px left padding,
   so the placeholder never sits under the icon divider.
   v1.4: login gains a Forgot password link; profile menu gains
   Change password; Settings gains a left nav (Profile /
   Signature / Address book / Change password).
   v1.3: inner UI aligned to the Myanmar DJs Mail inner UI
   (Wright's screenshots, Nov 14, 2026) — same layout, white/
   black theme, DJ Wine logo.
   Black only, white ink, system sans throughout — no
   decorative serif. No frames, no cards, no shadows on
   surfaces; hairline #262626 dividers do the separating.
   One accent: white. LOGIN keeps the same centred-column
   layout — see the Sign in section below. The [hidden]
   rule is kept — without it,
   .modal/.app display rules would override the browser's
   hidden rule and the dialogs would stay visible.
   App view: clean minimal inline SVG line icons (24x24
   viewBox, 1.5px stroke, currentColor, transparent) and
   an 8px spacing rhythm. Settings modal (display name,
   signature, address book, change password) + compose To
   autocomplete from the address book. Wider list column on
   desktop, full-width touch-friendly rows on mobile;
   two-way swipe on message rows (drag left reveals Flag +
   Delete, drag right reveals Archive). Compose Message is a rich-text editor
   with a clean formatting toolbar (Bold, Italic, Underline,
   Highlight, lists, link, emoji picker); the old textarea's
   resize handle (which could be dragged outside the modal)
   is gone and the editor scrolls internally. Sort select in
   the list toolbar; paperclip icon in list rows; attachments
   section in the reading pane; attach button + file chips
   in Compose. Drafts are saved only when the user taps Save
   draft (no auto-save). */
:root {
  color-scheme: dark;
  --accent: #ffffff;
  --accent-dark: #d4d4d4;
  --accent-soft: #1f1f1f;
  --accent-softer: #141414;
  --bg: #000000;
  --panel: #0a0a0a;
  --panel-2: #18181b;
  --sidebar-bg: #000000;
  --border: #262626;
  --input-border: #333333;
  --text: #f5f5f5;
  --body: #d4d4d4;
  --muted: #9ca3af;
  --muted-2: #6b7280;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--body); }
/* System sans everywhere, 15px / 1.55; headings same face,
   600 weight, no decorative serif. */
#app, #compose-modal, #settings-modal, #toast { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 1.55; }
h2, .settings-title { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--text); }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; color: var(--text); background: #0d0d0d; border: 1px solid var(--input-border); border-radius: 8px; padding: 10px 12px; width: 100%; }
input:focus, textarea:focus { outline: none; border-color: #737373; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.btn { border: 1px solid transparent; background: transparent; color: var(--text); border-radius: 8px; padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #000000; font-weight: 600; }
.btn-primary:hover { background: var(--accent-dark); }
/* Header Compose is outlined (like the DJs header Compose);
   the sidebar Compose stays filled black. */
#compose-btn { background: transparent; border-color: var(--border); color: var(--text); }
#compose-btn:hover { background: var(--panel-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--panel-2); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.icon-btn { background: transparent; border: none; color: var(--text); border-radius: 8px; padding: 8px 10px; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--panel-2); }
.icon-btn svg { width: 20px; height: 20px; flex: none; }
.error-text { color: #f5f5f5; font-size: 13px; font-weight: 600; }

/* Sign in — the DJ Wine website theme. Black page, no card,
   no title; centred 320px column; the DJ Wine
   white logo 230px wide; icon-cell + input fields 320x50px,
   1px #333333 border, 6px radius, near-black inside; focused
   field 1px #E5E7EB + 3px #262626 halo; white LOGIN button
   320x42px, 3px radius, black text; "DJ Wine Mail" footer
   #9CA3AF 14px below the button. Labels exist only as
   visually-hidden text — the form shows placeholders +
   icons, no visible labels. */
#login-screen { min-height: 100vh; padding: 16vh 16px 24px; background: #000000; }
#login-screen #layout-content { text-align: center; width: 100%; max-width: 320px; margin: 0 auto; display: block; }
#login-screen #logo { position: static !important; top: auto !important; display: block; margin: 0 auto; width: 230px; max-height: none !important; height: auto; background: none !important; border-radius: 0 !important; padding: 0 !important; box-shadow: none !important; }
#login-screen #login-form { position: static !important; top: auto !important; width: 100%; max-width: none; margin: 45px 0 0; background: transparent !important; border: none !important; box-shadow: none !important; }
/* One continuous box per row: icon cell joined to the
   input, same height (50px), thin divider between them. */
#login-screen #login-form .input-group { display: flex; align-items: stretch; width: 100%; height: 50px; background: #0a0a0a; border: 1px solid #333333; border-radius: 6px; overflow: hidden; }
#login-screen #login-form .input-group + .input-group { margin-top: 10px; }
#login-screen #login-form .input-group:focus-within { border-color: #e5e7eb; box-shadow: 0 0 0 3px #262626; }
#login-screen #login-form .input-group-prepend { display: flex; margin-right: 0 !important; }
#login-screen #login-form .input-group-text { display: flex; align-items: center; justify-content: center; height: 100%; background: #0a0a0a !important; border: none !important; border-right: 1px solid #262626 !important; border-radius: 0 !important; color: #9ca3af !important; padding: 0 14px; }
#login-screen #login-form .input-group-text svg { display: block; width: 15px; height: 15px; fill: #9ca3af; }
#login-screen #login-form .input-group input.form-control { border: none !important; border-radius: 0 !important; margin-left: 0 !important; flex: 1 1 auto; min-width: 0; height: 100%; padding: 0 16px; }
#login-screen #login-form input[type="text"],
#login-screen #login-form input[type="password"] { background: #0a0a0a !important; color: #f5f5f5 !important; font-size: 15px; }
#login-screen #login-form input:focus { outline: none; border: none !important; }
#login-screen #login-form input::placeholder { color: #6b7280 !important; opacity: 1; }
#login-screen .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; }
#login-screen #login-form .formbuttons { margin: 9px 0 0; }
#login-screen #rcmloginsubmit,
#login-screen #login-form .btn-primary { background: #ffffff !important; border: 1px solid #ffffff !important; border-radius: 3px !important; box-shadow: none !important; font-weight: 600; letter-spacing: .1em; width: 100%; height: 42px; padding: 0 14px; font-size: 16px; color: #000000; }
#login-screen #rcmloginsubmit:hover,
#login-screen #login-form .btn-primary:hover { background: #d4d4d4 !important; }
/* Register page: the Gmail button is a plain ghost button, not the
   solid black login button. The ID selector beats the !important
   login rule above (which also beat the old inline style on the
   button — inline styles lose to !important rules). */
#login-screen #login-form #google-btn { background: transparent !important; color: #f5f5f5 !important; border: 1px solid #525252 !important; }
#login-screen #login-form #google-btn:hover { background: #171717 !important; }
#login-screen #login-form .error-text { margin: 12px 0 0; }
#login-screen #login-footer { display: block !important; color: #9ca3af; font-size: 14px; text-align: center; margin-top: 19px; }
#login-screen .forgot-wrap { margin: 14px 0 0; text-align: center; }
#login-screen .link-btn { background: none; border: none; color: #9ca3af; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; padding: 0; }
#login-screen .link-btn:hover { color: #ffffff; }
/* v1.5 reset page (reset.html) — same login column, so it
   needs only its own title/text/done lines. */
#login-screen .reset-title { font-size: 18px; font-weight: 600; color: #f5f5f5; margin: 0 0 10px; text-align: center; }
#login-screen .reset-text { font-size: 14px; color: #9ca3af; line-height: 1.5; margin: 0 0 16px; text-align: center; }
#login-screen .reset-done { font-size: 14px; color: #e5e7eb; line-height: 1.6; margin: 20px 0 0; text-align: center; }
#login-screen .reset-done a { color: #ffffff; }
@media (max-width: 480px) {
  #login-screen { padding-top: 12vh; }
  #login-screen #logo { width: 200px; }
}
/* Header brand: the DJ Wine swoosh mark, not a round badge. */
.logo-frame.small { width: auto; height: 36px; margin: 0; background: transparent; border-radius: 0; }
.logo-frame.small img { width: auto; height: 30px; border-radius: 0; }

/* App shell */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.app-header { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: .02em; white-space: nowrap; }
.search-box { flex: 1; max-width: 520px; margin-left: 8px; }
.search-box input { border: none; background: #171717; color: var(--text); border-radius: 999px; padding: 8px 16px; }
.search-box input:focus { border: none; background: #1f1f1f; }
.account-wrap { position: relative; margin-left: auto; }
.account-btn { background: transparent; border: none; border-radius: 50%; padding: 0; }
.account-menu { position: absolute; right: 0; top: 48px; width: 260px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; z-index: 10; box-shadow: 0 8px 30px rgba(0, 0, 0, .08); }
.account-menu .account-email { margin: 0 0 10px; font-size: 13px; word-break: break-all; }
.account-menu .btn-block { margin-bottom: 8px; }
.account-menu .btn-block:last-child { margin-bottom: 0; }
.app-body { flex: 1; display: grid; grid-template-columns: 220px minmax(360px, 440px) 1fr; min-height: 0; }
.sidebar { background: var(--sidebar-bg); border-right: 1px solid var(--border); padding: 16px 12px; }
.folder-list { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.folder-btn { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; background: transparent; border: 0; color: var(--body); padding: 9px 12px; border-radius: 0 8px 8px 0; font-size: 14px; }
.folder-btn:hover { background: var(--panel-2); }
.folder-btn.active { background: var(--panel-2); color: #ffffff; font-weight: 600; border-radius: 8px; }
.folder-btn .count { background: transparent; color: var(--muted-2); border-radius: 0; padding: 0; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
/* Folder icons are inline SVG line icons (16px, currentColor). */
.folder-label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.folder-label svg { width: 16px; height: 16px; flex: none; }
.mail-list-pane { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; }
.list-toolbar { display: flex; align-items: center; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.list-toolbar h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: .02em; flex: 1; }
/* Sort select — borderless, muted, same look as the other toolbar controls. */
.list-toolbar select { font: inherit; color: var(--muted); background: transparent; border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.list-toolbar select:focus { outline: none; color: var(--text); }
#list-count { font-variant-numeric: tabular-nums; }
/* v1.13: offline badge in the list toolbar — plain black-on-white pill, no colour. */
.offline-badge { border: 1px solid #f5f5f5; border-radius: 999px; padding: 4px 10px; font-size: 12px; color: #f5f5f5; background: #000000; white-space: nowrap; }
.check-row { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.check-row input { width: auto; }
.mail-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
/* Rows are swipeable both ways (v1.9) — the content slides
   left over white Flag + black Delete behind it, or right
   over a black Archive behind it. touch-action: pan-y
   leaves vertical scrolling to the browser; only a
   primarily-horizontal drag is handled by JS. */
.mail-item { position: relative; overflow: hidden; padding: 0; border-bottom: 1px solid var(--border); cursor: pointer; touch-action: pan-y; }
.mail-item-content { position: relative; z-index: 1; background: var(--bg); padding: 16px 20px; will-change: transform; }
.mail-item:hover .mail-item-content { background: var(--accent-softer); }
.mail-item.selected .mail-item-content { background: var(--accent-soft); }
.swipe-delete { position: absolute; right: 0; top: 0; bottom: 0; width: 96px; background: #ffffff; color: #000000; border: 0; font: inherit; font-weight: 600; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 0; }
.swipe-flag { position: absolute; right: 96px; top: 0; bottom: 0; width: 96px; background: #171717; color: #f5f5f5; border: 0; border-right: 1px solid var(--border); font: inherit; font-weight: 600; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 0; }
.swipe-archive { position: absolute; left: 0; top: 0; bottom: 0; width: 96px; background: #262626; color: #ffffff; border: 0; font: inherit; font-weight: 600; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 0; }
.mail-item.unread { font-weight: 600; }
.mail-item.unread .mail-subject, .mail-item.unread .mail-from { font-weight: 600; }
.mail-top { display: flex; justify-content: space-between; gap: 8px; }
.mail-from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mail-date { color: var(--muted-2); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mail-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 3px 0; font-size: 14px; }
.mail-snippet { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.star { color: var(--text); display: inline-flex; vertical-align: -3px; margin-left: 6px; }
.star svg { width: 16px; height: 16px; flex: none; }
/* Paperclip in list rows, same treatment as the star. */
.attach { color: var(--muted); display: inline-flex; vertical-align: -3px; margin-left: 6px; }
.attach svg { width: 16px; height: 16px; flex: none; }
.load-more-wrap { padding: 12px 16px; text-align: center; }
.reading-pane { padding: 28px 32px; overflow-y: auto; min-width: 0; }
.empty-state { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty-state img { width: 110px; height: auto; object-fit: contain; opacity: .85; }
.reading-head h2 { margin: 0 0 12px; font-size: 20px; font-weight: 600; line-height: 1.3; }
.reading-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #262626; color: #f5f5f5; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.avatar.small { width: 36px; height: 36px; font-size: 15px; }
.reading-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; }
.body-toggle { display: flex; gap: 4px; margin-bottom: 12px; }
.reading-body { line-height: 1.6; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.reading-html { width: 100%; min-height: 480px; border: 1px solid var(--border); border-radius: 8px; background: #ffffff; }
.reading-body a { color: var(--text); }
/* Attachments under the message body. */
.read-attachments { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 14px; }
.attachments-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.attachment-chip { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--accent-softer); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.attachment-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.attachment-name svg { width: 16px; height: 16px; flex: none; }
.attachment-name > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-download { color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap; }

/* Modals */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 20; overflow-y: auto; }
.modal-card { width: 100%; max-width: 640px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin: auto 0; box-shadow: 0 12px 40px rgba(0, 0, 0, .10); }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.modal-card label { display: block; margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
.modal-card .error-text { font-size: 13px; font-weight: 600; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
/* Forgot password dialog (login). */
#forgot-modal .modal-card { max-width: 420px; }
#forgot-modal p { margin: 12px 0 0; line-height: 1.55; }
/* Settings — same theme, same type scale, SVG line icons only. */
/* Settings — left nav + content (v1.4). */
.settings-card { max-width: 780px; }
.settings-layout { display: grid; grid-template-columns: 180px 1fr; margin-top: 8px; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; padding-right: 16px; border-right: 1px solid var(--border); }
.settings-nav-btn { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: var(--body); padding: 9px 12px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.settings-nav-btn:hover { background: var(--panel-2); }
.settings-nav-btn.active { background: var(--panel-2); color: #ffffff; font-weight: 600; }
.settings-content { padding-left: 20px; min-width: 0; }
.settings-section .settings-title { margin-top: 0; }
#settings-modal .modal-card { max-height: calc(100vh - 80px); overflow-y: auto; }
/* The compose card must NOT clip — on a short screen the card
   is taller than the viewport, so the overlay scrolls
   (`.modal { overflow-y: auto }` above) and the card's auto
   margin centres it when it fits. That is what keeps the Send
   button reachable. */
/* Compose formatting toolbar + rich-text body.
   The body is a contenteditable div, not a textarea: a textarea
   has a resize handle that can be dragged outside the modal.
   The div cannot be resized, scrolls internally past its
   max-height, and never exceeds the modal. */
.field-label { display: block; margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
.compose-toolbar { position: relative; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; background: transparent; border: 1px solid var(--border); border-bottom: none; border-radius: 8px 8px 0 0; padding: 4px 6px; }
.tool-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: none; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; padding: 0; }
.tool-btn:hover { background: var(--panel-2); }
.tool-btn.active { background: var(--accent); color: #000; }
.tool-btn svg { width: 18px; height: 18px; flex: none; }
.tool-letter { font-size: 15px; font-weight: 700; line-height: 1; }
.tool-italic { font-style: italic; }
.tool-underline { text-decoration: underline; }
.tool-hl-bar { position: absolute; left: 8px; right: 8px; bottom: 5px; height: 4px; border-radius: 2px; background: #d1d5db; }
.toolbar-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.compose-body { min-height: 180px; max-height: 40vh; overflow-y: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 0 0 8px 8px; padding: 12px 14px; color: var(--text); outline: none; word-wrap: break-word; }
.compose-body:focus { outline: none; border-color: #525252; }
.compose-body:empty::before { content: attr(data-placeholder); color: #9ca3af; }
.compose-body a { color: var(--text); }
.compose-body ul, .compose-body ol { margin: 4px 0; padding-left: 24px; }
.tool-pop { position: absolute; top: calc(100% + 6px); left: 8px; z-index: 5; display: flex; gap: 6px; align-items: center; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px; box-shadow: 0 8px 30px rgba(0, 0, 0, .08); max-width: calc(100% - 16px); }
#link-pop input { width: 200px; padding: 8px 10px; }
.btn-small { padding: 7px 10px; font-size: 13px; }
#emoji-pop { display: grid; grid-template-columns: repeat(8, 32px); gap: 2px; max-height: 180px; overflow-y: auto; }
.emoji-btn { width: 32px; height: 32px; font-size: 20px; line-height: 1; border: none; border-radius: 6px; background: transparent; cursor: pointer; padding: 0; }
.emoji-btn:hover { background: var(--panel-2); }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); cursor: pointer; padding: 0; }
.swatch-none { background: transparent; color: var(--text); font-size: 13px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
/* Draft status line under the compose editor. */
#compose-draft-status { min-height: 18px; margin: 6px 0 0; }
/* Attached files in Compose — removable chips above the
   editor. The × is plain text (same as the highlight swatch),
   not an emoji. */
.compose-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.compose-attachments .attachment-chip { margin-bottom: 0; }
.compose-chip svg { width: 14px; height: 14px; }
.chip-remove { background: transparent; border: 0; color: var(--text); font-size: 16px; line-height: 1; padding: 0 2px; cursor: pointer; flex: none; }
/* Textareas (e.g. the signature field) never get a resize handle
   either — same overflow problem as the old compose box. */
textarea { resize: none; }
.settings-title { margin: 24px 0 4px; font-size: 16px; font-weight: 600; }
.settings-title:first-of-type { margin-top: 16px; }
.hint { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.contact-list { list-style: none; margin: 8px 0 0; padding: 0; }
.contact-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.contact-info { display: flex; flex-direction: column; min-width: 0; }
.contact-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-email { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-actions { display: flex; gap: 4px; flex: none; }
.contact-actions .icon-btn { padding: 6px; }

/* Compose To autocomplete. */
.to-wrap { position: relative; display: block; }
.to-wrap input { margin: 0; }
/* v1.12: Cc / Bcc toggle — plain small link, no button chrome. */
.cc-toggle { background: none; border: none; padding: 0; margin: 2px 0 8px; font: inherit; font-size: 13px; color: #9ca3af; cursor: pointer; text-align: left; }
/* v1.18: push notifications toggle — plain checkbox row. */
.push-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.push-row input { width: auto; margin: 0; }
.cc-toggle:hover { color: #ffffff; }
/* v1.14: undo send — the Undo button on a waiting Outbox row,
   and the live countdown number in its snippet. */
.undo-btn { background: none; border: 1px solid #333333; border-radius: 6px; padding: 4px 10px; margin-top: 6px; font: inherit; font-size: 13px; color: #e5e7eb; cursor: pointer; }
.undo-btn:hover { background: #171717; }
.undo-count { font-weight: 600; color: #f5f5f5; }
/* v1.15: schedule send — the picker inside Compose (preset
   chips + custom date/time) and the Send now / Cancel
   buttons on a scheduled Outbox row. */
.schedule-panel { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-top: 12px; }
.schedule-title { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.schedule-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sched-chip, .snooze-chip { background: none; border: 1px solid #333333; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; color: #e5e7eb; cursor: pointer; }
.sched-chip:hover, .snooze-chip:hover { background: #171717; }
.sched-chip.active, .snooze-chip.active { background: #ffffff; border-color: #ffffff; color: #000000; }
.schedule-panel label { margin: 0 0 10px; }
.schedule-actions { display: flex; justify-content: flex-end; gap: 8px; }
.sched-btns { display: flex; gap: 6px; margin-top: 6px; }
.sched-btns .undo-btn { margin-top: 0; }
.suggestions { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, .08); z-index: 25; overflow: hidden; }
.suggestion-item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; background: transparent; border: 0; color: var(--text); padding: 8px 12px; cursor: pointer; }
.suggestion-item:hover { background: var(--panel-2); }
.suggestion-name { font-size: 14px; }
.suggestion-email { font-size: 12.5px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #f5f5f5; border: none; color: #000000; padding: 10px 16px; border-radius: 8px; z-index: 30; }

@media (max-width: 900px) {
  .app-body { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.open { display: block; }
  .mail-list-pane { border-right: 0; }
  .reading-pane { border-top: 1px solid var(--border); padding: 16px; }
  /* Full-width list, generous touch-friendly rows. */
  .mail-item-content { padding: 16px 20px; }
  .list-toolbar { padding: 12px 16px; }
  #compose-btn { display: none; }
  .search-box { display: none; }
  /* Android touch targets */
  .btn, .folder-btn, .mail-item { min-height: 44px; }
  .app-header { padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .login-screen { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 0 0 10px; margin-bottom: 16px; }
  .settings-nav-btn { width: auto; flex: none; }
  .settings-content { padding-left: 0; }
}
