/* Riven Mail — Batch 2/3 UX layer styles: recipient chips, schedule dialog,
 * labels/saved searches, dark theme tokens, accessibility focus states. */

/* ------------------------------------------------ recipient chips */
.recipient-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 0 6px; }
.recipient-chip { display: inline-flex; align-items: center; gap: 4px; background: #f1f4f5; border: 1px solid #d7dee0; border-radius: 999px; padding: 2px 8px; font-size: 12px; color: #223; max-width: 100%; }
.recipient-chip.invalid { border-color: #d33; background: #fdecec; color: #a11; }
.recipient-chip button { border: 0; background: transparent; cursor: pointer; font-size: 13px; line-height: 1; color: #667; padding: 0 0 0 2px; }
.recipient-chip button:hover { color: #C40074; }

/* ------------------------------------------------ schedule send */
#compose-schedule { margin-left: 6px; }
.schedule-label { display: inline-block; margin-left: 8px; font-size: 12px; color: #C40074; }
.modal-overlay { position: fixed; inset: 0; background: rgba(10, 18, 22, .45); display: flex; align-items: center; justify-content: center; z-index: 1200; }
.modal-card { background: #fff; border-radius: 12px; max-width: 420px; width: calc(100% - 40px); padding: 20px; box-shadow: 0 18px 60px rgba(0,0,0,.25); }
.modal-card h3 { margin: 0 0 6px; font-family: 'Boska', serif; }
.modal-card .muted { color: #5b6a70; font-size: 12px; margin: 0 0 12px; }
.modal-card input[type="datetime-local"] { width: 100%; padding: 10px; border: 1px solid #cfd8db; border-radius: 8px; margin-bottom: 10px; font: inherit; }
.schedule-presets { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.schedule-presets button { border: 1px solid #cfd8db; background: #f7f9f9; border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ------------------------------------------------ labels / saved searches */
.labels-panel { padding: 8px 10px 14px; border-top: 1px solid #e6ecee; margin-top: 8px; max-height: 42vh; overflow: auto; }
.labels-head { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7c8b91; margin: 8px 0 4px; }
.label-chip, .saved-search { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 5px 8px; border-radius: 7px; font-size: 13px; color: #33424a; cursor: pointer; }
.label-chip:hover, .saved-search:hover { background: #eef3f4; }
.saved-search .rm { float: right; color: #98a6ac; }
.muted.small { color: #7c8b91; font-size: 12px; padding: 2px 8px; }
#save-search { margin: 6px 8px 0; }

/* ------------------------------------------------ dark mode (token overrides) */
:root { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] body { background: #0f161a !important; color: #dbe6ea !important; }
html[data-theme="dark"] .app-shell, html[data-theme="dark"] .list-pane, html[data-theme="dark"] .reading-pane,
html[data-theme="dark"] .sidebar, html[data-theme="dark"] .topbar, html[data-theme="dark"] .compose-modal .modal-card,
html[data-theme="dark"] .settings-modal .modal-card, html[data-theme="dark"] #undo-bar { background: #141f25 !important; color: #dbe6ea !important; border-color: #24343c !important; }
html[data-theme="dark"] .message-row, html[data-theme="dark"] .folder-item, html[data-theme="dark"] .inbox-tab { border-color: #22323a !important; color: #c7d6dc !important; }
html[data-theme="dark"] .message-row:hover, html[data-theme="dark"] .folder-item:hover { background: #1b2a31 !important; }
html[data-theme="dark"] input, html[data-theme="dark"] textarea, html[data-theme="dark"] select { background: #101a1f !important; color: #e6eef1 !important; border-color: #2a3c45 !important; }
html[data-theme="dark"] .compose-signature, html[data-theme="dark"] .reading-body { color: #c7d6dc !important; }
html[data-theme="dark"] .recipient-chip { background: #1a282f; border-color: #2c4049; color: #d6e2e7; }
html[data-theme="dark"] .modal-card { background: #141f25; color: #dbe6ea; }

/* ------------------------------------------------ accessibility */
.skip-link { position: absolute; left: -9999px; top: 0; background: #C40074; color: #fff; padding: 8px 14px; z-index: 4000; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid #EC008C !important; outline-offset: 2px; }
.icon-btn { min-width: 40px; min-height: 40px; }
#theme-toggle { font-size: 12px; }
#mail-calendar-btn { margin: 6px 0 10px; display: inline-block; text-decoration: none; }

/* ------------------------------------------------ phone tweaks */
@media (max-width: 640px) {
  .labels-panel { max-height: 30vh; }
  .recipient-chip { font-size: 12px; }
  #compose-schedule { padding: 10px 12px; }
}
