:root {
  --ink: #202a24;
  --muted: #58675d;
  --faint: #6d7a71;
  --accent: #276448;
  --accent-hover: #1d5038;
  --accent-soft: #edf4ee;
  --canvas: #f3f5f2;
  --line: #dce2da;
  --paper: #ffffff;
  --rail: #232e27;
  --success: #286143;
  --amber: #765516;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  font-size: 100%;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
button:disabled { cursor: not-allowed; opacity: .44; }
button, input, select, textarea { outline: none; }
:where(button, input, select, textarea):focus-visible { outline: 3px solid #8cae94; outline-offset: 3px; }
input, select, textarea { min-width: 0; max-width: 100%; }
input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--accent); margin: 0; cursor: pointer; flex-shrink: 0; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.align-right { text-align: right !important; }
.mono { font-family: inherit; font-variant-numeric: tabular-nums; }

/* A quiet header and a graphite navigation rail frame the mailbox. */
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; white-space: nowrap; min-width: 0; }
.brand-mark { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 11px; color: white; background: var(--accent); flex-shrink: 0; }
.brand-mark svg { width: 26px; height: 26px; }
.brand strong { font-family: "Segoe UI", sans-serif; font-size: 1.375rem; letter-spacing: -.8px; font-weight: 750; color: #202a24; }
.brand-subtitle { color: #55635a; font-size: 0.875rem; font-weight: 600; }
.brand-divider, .topbar-divider { height: 23px; width: 1px; margin: 0 8px; background: var(--line); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.demo-badge { font-size: 0.8125rem; font-weight: 600; color: #59665d; padding: 4px 9px; border: 1px solid #dce2d9; border-radius: 5px; background: #f5f7f3; white-space: nowrap; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid #cbd4c9; border-radius: 7px; background: white; font-size: 0.875rem; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.button svg { width: 19px; height: 19px; }
.button:hover { background: #f4f7f1; border-color: #8fa38f; }
.button.primary { background: var(--accent); border-color: var(--accent); color: white; }
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.button.quiet:hover { color: var(--ink); background: #edf1ea; }
.api-trigger { font-size: 0.875rem; gap: 7px; padding: 7px 9px; }
.api-trigger svg { width: 18px; height: 18px; }
.user-button { display: flex; align-items: center; gap: 9px; background: transparent; padding: 0; font-weight: 700; font-size: 0.875rem; white-space: nowrap; }
.avatar { display: inline-grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; background: #e7ede5; color: #3e5845; font-size: 0.9375rem; font-weight: 700; flex-shrink: 0; }
.icon-button { display: inline-grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; padding: 0; color: #526356; background: transparent; border-radius: 6px; }
.icon-button svg { width: 19px; height: 19px; }
.icon-button:hover { background: #e9f0e7; color: #234e35; }
.previous svg { transform: rotate(180deg); }
.mobile-menu { display: none; }

.app-shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.sidebar { display: flex; flex-direction: column; min-height: calc(100vh - 72px); padding: 29px 16px; background: var(--rail); border-right: 1px solid #26392c; }
.workspace-label { margin: 0 13px 20px; color: #b1bdb3; font-size: 0.8125rem; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 51px; height: auto; margin-bottom: 8px; padding: 12px; flex-wrap: wrap; border-radius: 7px; text-align: left; color: #d3dcd3; background: transparent; font-size: 0.875rem; font-weight: 700; }
.nav-item svg { width: 21px; height: 21px; }
.nav-item:hover { background: #334438; }
.nav-item.active { color: #20442c; background: #e9f1e8; }
.nav-count { margin-left: auto; font-size: 0.8125rem; padding: 2px 6px; border-radius: 4px; color: #285336; background: #d9e7d5; }
.task-dot { width: 7px; height: 7px; background: #b5d4ac; border-radius: 50%; margin-left: auto; }
.pending-badge, .delivery-badge { display: inline-flex; align-items: center; flex-shrink: 0; border: 1px solid; border-radius: 4px; padding: 2px 6px; white-space: nowrap; font-size: 0.75rem; line-height: 1.5; font-weight: 600; }
.pending-badge { color: #755722; background: #f6f0e2; border-color: #e9dec4; }
.delivery-badge { color: #2d6241; background: #e9f2e5; border-color: #d6e5cf; }
.nav-item .pending-badge, .nav-item .delivery-badge { margin-left: auto; padding: 2px 5px; font-size: 0.75rem; }
.nav-item .pending-badge { color: #e5cf9d; background: #3b4033; border-color: #545a46; }
.nav-item.active .pending-badge { color: #785820; background: #f2ebda; border-color: #dfd2b6; }
.nav-item .delivery-badge { background: #d6e6d0; border-color: #c3d9ba; }
.button .pending-badge, .text-button .pending-badge { margin-left: 2px; font-size: 0.75rem; }
.button.primary .pending-badge { background: #ffffff17; border-color: #ffffff45; color: #fff; }
.api-trigger .pending-badge, .user-button .pending-badge { font-size: 0.75rem; }

/* The workspace stays compact above the list; the content gets the room. */
main { padding: 25px 28px 28px; min-width: 0; }
.page-heading { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.title-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
h1 { margin: 0; font-size: 1.5625rem; line-height: 1.3; font-weight: 700; letter-spacing: -.6px; white-space: nowrap; }
.total-pill { display: inline-flex; flex-shrink: 0; padding: 3px 8px; border-radius: 5px; background: #e8ede5; color: #4f6052; font-size: 0.875rem; font-weight: 650; white-space: nowrap; vertical-align: middle; }
.heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
.auto-control { display: flex; align-items: center; gap: 8px; color: #536357; cursor: pointer; white-space: nowrap; font-size: 0.875rem; font-weight: 600; }
.auto-control input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 33px; height: 20px; border-radius: 20px; background: #b4c0b2; padding: 3px; }
.switch-track:after { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: white; box-shadow: 0 1px 2px #0002; transition: transform .15s; }
.auto-control input:checked + .switch-track { background: var(--accent); }
.auto-control input:checked + .switch-track:after { transform: translateX(13px); }
.auto-control input:focus-visible + .switch-track { outline: 3px solid #8cae94; outline-offset: 3px; }
.filter-bar { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(160px, 1.2fr) minmax(140px, .9fr) minmax(165px, 1.2fr) auto; align-items: end; gap: 12px; margin-bottom: 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.filter-bar label { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.filter-bar label > span, .form-label { color: #435448; font-size: 0.8125rem; font-weight: 700; }
.filter-bar input, .filter-bar select, .field input, .field select, .field textarea { display: block; width: 100%; min-width: 0; max-width: 100%; height: 2.75rem; min-height: 44px; border: 1px solid #ccd5c9; border-radius: 6px; background: white; font-size: 0.875rem; font-weight: 500; line-height: 1.5; padding: 9px 11px; }
.filter-bar input::placeholder, .field input::placeholder { color: #687664; opacity: 1; }
.filter-bar input:hover, .filter-bar select:hover, .field input:hover, .field select:hover { border-color: #91a18e; }
.filter-bar input:focus, .filter-bar select:focus, .field input:focus, .field select:focus { border-color: #518160; box-shadow: 0 0 0 3px #37764a0d; }
.filter-bar select, .field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%235b6c5e' stroke-width='1.7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 16px; background-position: right 10px center; padding-right: 32px; }
.input-icon { position: relative; min-width: 0; }
.input-icon > svg { position: absolute; left: 11px; top: 13px; width: 18px; height: 18px; color: #74816f; pointer-events: none; }
.input-icon > input { padding-left: 36px; }
.filter-actions { display: flex; align-items: center; gap: 5px; }
.filter-actions .button { min-width: 64px; }
.date-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-column: 1 / -1; max-width: 650px; gap: 12px; align-items: end; padding-top: 14px; border-top: 1px solid var(--line); }
.date-range label { min-width: 0; }
.date-range input { min-width: 0; width: 100%; max-width: 100%; }
.date-to { padding-bottom: 10px; font-size: 0.875rem; color: #62715f; }
.surface { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.inbox-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 400px; overflow: hidden; background: white; border: 1px solid #d5ddd1; border-radius: 12px; box-shadow: 0 5px 20px #253a2605; }
.mail-list-panel { min-width: 0; border: 0; border-right: 1px solid #d5ddd1; border-radius: 0; display: flex; flex-direction: column; height: calc(100dvh - 295px); min-height: 540px; }
.list-toolbar { height: 59px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.segmented { height: 100%; display: flex; gap: 27px; }
.segmented button { padding: 0; position: relative; color: #59675b; background: none; font-size: 0.875rem; font-weight: 600; }
.segmented button.active { color: #285b3d; font-weight: 750; }
.segmented button.active:after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: var(--accent); border-radius: 2px 2px 0 0; }
.segmented button span { font-size: 0.875rem; margin-left: 5px; font-weight: 600; color: #64765f; }
.sort-label { display: flex; align-items: center; gap: 5px; color: #657260; font-size: 0.8125rem; white-space: nowrap; }
.sort-label svg { width: 15px; height: 15px; }
.mail-table-head, .mail-row { display: grid; grid-template-columns: minmax(130px, .95fr) minmax(0, 1.5fr) 72px; gap: 14px; align-items: center; }
.mail-table-head { flex-shrink: 0; padding: 11px 20px; color: #5b6a5e; font-size: 0.8125rem; font-weight: 600; background: #f7f9f5; border-bottom: 1px solid var(--line); }
.mail-table-head > span:last-child { text-align: right; }
.mail-list { flex: 1; overflow-y: auto; overscroll-behavior-y: contain; min-height: 0; }
.mail-row { width: 100%; text-align: left; min-height: 78px; padding: 14px 20px; background: white; border-bottom: 1px solid #e7ece3; position: relative; }
.mail-row:last-child { border-bottom: 0; }
.mail-row:hover { background: #f5f8f0; }
.mail-row.selected { background: #edf4e9; }
.mail-row.selected:before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 4px; background: #487d48; }
.recipient-name { display: block; color: #26392b; font-size: 0.875rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recipient-domain { display: block; color: #5c6d5c; font-size: 0.8125rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 5px; }
.message-lines { min-width: 0; }
.sender-line { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; min-width: 0; }
.sender-name { display: block; color: #364a39; font-size: 0.875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread .sender-name { font-weight: 750; color: #243f2c; }
.unread-dot { flex-shrink: 0; width: 6px; height: 6px; background: #3a7d43; border-radius: 50%; }
.message-subject { display: block; color: #596a59; font-size: 0.8125rem; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-date { font-size: 0.8125rem; font-weight: 650; text-align: right; color: #4f6251; font-variant-numeric: tabular-nums; }
.mail-date small { display: block; margin-top: 5px; font-size: 0.75rem; font-weight: 500; color: #62745e; }
.pagination { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 57px; padding: 10px 18px; border-top: 1px solid var(--line); color: #5e6f5c; font-size: 0.875rem; }
.pagination > div { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.pagination .icon-button { width: 32px; height: 32px; border: 1px solid #d5ddcf; background: white; }
.sync-footer { display: flex; align-items: center; gap: 7px; flex-shrink: 0; padding: 10px 20px; border-top: 1px solid var(--line); background: #fbfcf9; color: #67795f; font-size: 0.8125rem; }
.status-dot { width: 6px; height: 6px; background: #6b9460; border-radius: 50%; flex-shrink: 0; }
.reader { min-width: 0; border: 0; border-radius: 0; background: #fcfdfa; overflow-y: auto; overscroll-behavior-y: contain; height: calc(100dvh - 295px); min-height: 540px; scrollbar-gutter: stable; }
.reader-top { min-height: 59px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 25px; border-bottom: 1px solid var(--line); color: #4a5f48; font-size: 0.875rem; font-weight: 700; }
.reader-top > div { display: flex; align-items: center; gap: 8px; }
.text-tag { padding: 3px 7px; border-radius: 4px; color: #536a4a; border: 1px solid #dce6d6; background: #f2f7ed; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.reader-close { display: none; }
.reader-content { padding: 26px 26px 21px; }
.reader h2 { margin: 0 0 22px; color: #1e3526; font-size: 1.3125rem; font-weight: 700; line-height: 1.45; letter-spacing: -.4px; overflow-wrap: anywhere; }
.reader-sender { display: flex; align-items: center; gap: 11px; min-width: 0; }
.sender-avatar { flex-shrink: 0; display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid #dce6d5; background: #edf3e7; border-radius: 10px; color: #3b623b; font-size: 1.0625rem; font-weight: 750; }
.reader-sender strong { display: block; font-size: 0.875rem; font-weight: 700; color: #304a34; }
.reader-sender small { display: block; color: #687961; margin-top: 4px; font-size: 0.8125rem; overflow-wrap: anywhere; }
.reader-meta { display: grid; grid-template-columns: 49px minmax(0, 1fr); gap: 9px 5px; border-bottom: 1px solid var(--line); margin: 22px 0 0; padding-bottom: 21px; font-size: 0.875rem; line-height: 1.5; }
.reader-meta dt, .reader-meta dd { margin: 0; }
.reader-meta dt { color: #6a7a61; }
.reader-meta dd { color: #465c42; overflow-wrap: anywhere; font-weight: 550; }
.reader-body { padding: 21px 0 6px; color: #40583e; font-size: 0.875rem; font-weight: 500; line-height: 1.9; overflow-wrap: anywhere; }
.reader-body p { white-space: pre-wrap; margin: 0 0 18px; }
.verification { margin: 18px 0 23px; padding: 17px 12px; border: 1px solid #d3e2c9; border-radius: 9px; background: #f0f6eb; text-align: center; }
.verification > span { display: block; color: #586f4d; font-size: 0.875rem; font-weight: 600; }
.verification-code { display: flex; align-items: center; justify-content: center; gap: 13px; margin-top: 6px; }
.verification-code strong { font-family: "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; font-size: 1.875rem; line-height: 1.4; letter-spacing: 5px; font-weight: 750; color: #2e5a2f; }
.verification .icon-button { background: #e1ecd8; color: #376136; width: 34px; height: 34px; }
.reader-footer { padding: 17px 25px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 5px 0; color: #2d633e; background: none; font-size: 0.875rem; font-weight: 650; white-space: nowrap; }
.text-button:hover { color: #193f27; text-decoration: underline; text-underline-offset: 3px; }
.text-button svg { width: 16px; height: 16px; }

/* Account and task previews use the same stronger reading scale. */
.account-filters { grid-template-columns: 240px minmax(200px, 340px) auto; justify-content: start; }
.account-selection, .section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 20px; min-height: 62px; }
.account-selection { color: #5b7059; font-size: 0.875rem; }
.account-selection > div { display: flex; align-items: center; gap: 20px; max-width: 100%; }
.account-selection #select-filtered { white-space: normal; text-align: left; justify-content: flex-start; }
.table-scroll { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; border-radius: inherit; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-size: 0.875rem; }
.data-table th { padding: 13px 20px; color: #4e634c; font-size: 0.875rem; font-weight: 700; background: #f5f8f1; border-block: 1px solid var(--line); }
.data-table td { height: 68px; padding: 15px 20px; color: #4c6248; border-bottom: 1px solid #e6ece1; font-variant-numeric: tabular-nums; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f7faf3; }
.data-table td strong { font-size: 0.875rem; font-weight: 700; color: #304c31; }
.data-table td small { display: block; margin-top: 5px; color: #687d60; font-size: 0.8125rem; }
.data-table tr.selected { background: #edf4e7; }
.data-table .check-cell { width: 49px; padding-right: 0; }
.account-table { min-width: 830px; }
.account-table .account-address { color: #2c4930; font-weight: 700; }
.account-table td:last-child .text-button + .text-button { margin-left: 18px; }
.account-table input { vertical-align: middle; }
.domain-chip { font-size: 0.875rem; padding: 5px 8px; border-radius: 4px; color: #4b6548; background: #eff4e9; border: 1px solid #e0e9d8; }
.task-summary { display: flex; gap: 43px; padding: 21px 25px; margin-bottom: 20px; border: 1px solid #d5e0cf; border-radius: 10px; background: #eaf1e4; }
.task-summary > div { display: flex; align-items: baseline; gap: 12px; }
.task-summary strong { font-family: "Segoe UI", sans-serif; font-size: 1.625rem; font-weight: 750; color: #2b5432; }
.task-summary span { color: #4e6b48; font-size: 0.875rem; font-weight: 600; }
.section-toolbar h2 { margin: 0; font-size: 1.0625rem; font-weight: 700; }
.task-table { min-width: 840px; }
.task-state { display: inline-flex; padding: 4px 8px; border-radius: 5px; font-size: 0.875rem; font-weight: 600; color: #2d663d; background: #eaf3e5; white-space: nowrap; }
.task-state.running { color: #426132; background: #ecf1df; }
.task-state.queued { color: #7e5f20; background: #f7f0dd; }
.progress { display: flex; align-items: center; gap: 10px; }
.progress-track { height: 6px; width: 100px; min-width: 65px; max-width: 120px; background: #e5ecde; border-radius: 6px; overflow: hidden; }
.progress-track i { display: block; height: 100%; background: #618a49; border-radius: 6px; transition: width .2s; }
.progress span { font-size: 0.8125rem; font-weight: 600; color: #516e44; }
.result-success { color: #2f6c3f; font-weight: 600; }
.empty-state { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 320px; padding: 35px 24px; text-align: center; color: #5e7455; }
.empty-icon { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 10px; color: #628653; background: #eef4e6; border: 1px solid #dfead4; border-radius: 16px; }
.empty-icon svg { width: 30px; height: 30px; }
.empty-state h3 { margin: 12px 0 0; font-size: 1.125rem; font-weight: 700; color: #456339; }
.empty-state p { margin: 12px 0 17px; max-width: 320px; font-size: 0.9375rem; line-height: 1.8; }
.empty-state > .button { margin-top: 19px; }

/* Dialogs keep controls large enough to use with a phone keyboard. */
dialog { width: 580px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #d3ddcb; border-radius: 14px; color: var(--ink); background: white; box-shadow: 0 24px 90px #1e32233d; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
dialog::backdrop { background: #18291d66; backdrop-filter: blur(3px); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 23px 26px 19px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font-size: 1.3125rem; font-weight: 750; line-height: 1.5; letter-spacing: -.4px; }
.dialog-header p { margin: 8px 0 0; color: #617956; font-size: 0.875rem; line-height: 1.7; }
.dialog-form, .dialog-body { padding: 23px 26px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin-bottom: 18px; }
.field > span, .field > label { font-size: 0.875rem; font-weight: 700; color: #435e3a; }
.field input, .field select { height: 2.875rem; min-height: 46px; }
.field small { color: #658157; font-size: 0.8125rem; line-height: 1.7; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 17px; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 16px 26px; border-top: 1px solid var(--line); background: #f7faf3; }
.dialog-form .dialog-actions { margin: 23px -26px -23px; }
.dialog-actions > span { margin-right: auto; color: #6b845b; font-size: 0.8125rem; }
.mini-tabs { display: flex; gap: 4px; margin-bottom: 20px; padding: 4px; border-radius: 7px; background: #edf3e6; }
.mini-tabs button { flex: 1; padding: 9px 8px; border-radius: 5px; color: #57794a; background: none; font-size: 0.875rem; font-weight: 700; }
.mini-tabs button.active { background: white; color: #2a5b35; box-shadow: 0 1px 4px #2b4b2d12; }
.preview-box { border: 1px solid #d8e5cd; background: #f5f9ef; border-radius: 7px; padding: 14px 16px; }
.preview-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: #5e7a4e; font-size: 0.8125rem; }
.preview-title strong { color: #426a34; font-size: 0.875rem; font-weight: 700; }
.preview-lines { font-size: 0.9375rem; line-height: 1.9; color: #3f6733; overflow-wrap: anywhere; }
.form-error { margin: 14px 0 0; color: #a33c32; font-size: 0.875rem; line-height: 1.7; }
.notice { background: #f0f5e9; color: #45683b; padding: 13px 15px; border-radius: 7px; font-size: 0.9375rem; line-height: 1.8; margin-bottom: 19px; }
.selected-addresses { color: #58764b; font-size: 0.875rem; line-height: 1.9; margin-bottom: 19px; overflow-wrap: anywhere; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 58px; }
.password-wrap button { position: absolute; right: 11px; top: 12px; padding: 0; color: #3f6e35; background: transparent; font-size: 0.875rem; font-weight: 700; }
.password-action { display: inline-flex; position: relative; align-items: center; gap: 8px; flex-shrink: 0; }
.password-help { display: inline-grid; place-items: center; flex-shrink: 0; width: 21px; height: 21px; padding: 0; border: 1px solid #859c79; border-radius: 50%; background: white; color: #5a7a4b; font-family: "Segoe UI", sans-serif; font-size: 0.875rem; font-weight: 750; line-height: 1; }
.password-help:hover, .password-help:focus-visible { background: #eaf3e0; border-color: #517c3d; color: #325d28; }
.password-tooltip { position: absolute; z-index: 30; top: calc(100% + 10px); right: 0; visibility: hidden; opacity: 0; min-width: 137px; padding: 10px 13px; background: #2c4229; color: white; border-radius: 6px; box-shadow: 0 5px 15px #1f371e26; white-space: nowrap; text-align: center; font-size: 0.875rem; font-weight: 600; pointer-events: none; }
.password-tooltip:before { content: ""; position: absolute; right: 7px; top: -4px; width: 8px; height: 8px; background: #2c4229; transform: rotate(45deg); }
.password-action:hover .password-tooltip, .password-action:focus-within .password-tooltip { visibility: visible; opacity: 1; }
.toast { position: fixed; z-index: 100; bottom: 28px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 28px); padding: 13px 21px; color: white; background: #293e28; border-radius: 8px; box-shadow: 0 7px 20px #1b321b24; font-size: 0.9375rem; font-weight: 600; line-height: 1.7; white-space: pre-line; }
.task-detail-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 23px; margin-bottom: 20px; }
.task-detail-summary > div { color: #537446; font-size: 0.875rem; }
.task-detail-summary strong { margin-right: 5px; font-family: "Segoe UI", sans-serif; font-size: 1.75rem; font-weight: 700; color: #335b2a; }
.task-detail-list { max-height: 300px; overflow-y: auto; border: 1px solid #d7e3cd; border-radius: 7px; }
.task-detail-item { display: flex; justify-content: space-between; gap: 12px; padding: 13px; color: #466f36; border-bottom: 1px solid #e3ecd9; font-size: 0.875rem; overflow-wrap: anywhere; }
.task-detail-item:last-child { border-bottom: 0; }
.task-detail-item .item-status { color: #367b3b; white-space: nowrap; font-weight: 600; }
.task-detail-item .item-status.skipped { color: #8b6a27; }
.detail-hint { font-size: 0.8125rem; color: #627e53; line-height: 1.8; margin: 14px 0 0; }
.detail-hint:empty { display: none; }
#task-detail-body .dialog-actions { margin: 23px -26px -23px; }
.login-placeholder { display: flex; align-items: center; gap: 13px; padding: 18px; background: #f1f7e9; border-radius: 8px; }
.login-placeholder .avatar { width: 45px; height: 45px; font-size: 1.125rem; }
.login-placeholder strong { display: block; font-size: 1.125rem; font-weight: 700; }
.login-placeholder small { display: block; font-size: 0.875rem; color: #5e7d4e; margin-top: 5px; }
.login-panel { max-width: 370px; margin: auto; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 11px; margin: 6px 0 24px; font-family: "Segoe UI", sans-serif; font-size: 1.625rem; font-weight: 750; }
.login-title { text-align: center; font-size: 1.25rem; margin: 0 0 25px; font-weight: 700; }
.login-panel .primary { width: 100%; margin-top: 7px; }

/* The interface inventory is a readable reference, separate from daily work. */
.api-dialog { width: 1040px; }
.api-intro { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 22px 26px; }
.api-intro > div { border: 1px solid #dce7d1; border-radius: 7px; background: #f3f8ec; padding: 13px 16px; }
.api-intro strong { font-family: "Segoe UI", sans-serif; font-size: 1.6875rem; font-weight: 750; color: #395f2d; margin-right: 9px; }
.api-intro span { color: #577948; font-size: 0.875rem; font-weight: 600; }
.api-table { min-width: 950px; font-size: 0.875rem; }
.api-table th, .api-table td { padding: 15px 18px; white-space: normal; }
.api-table th:first-child, .api-table td:first-child { min-width: 100px; white-space: nowrap; padding-left: 26px; }
.api-table td:nth-child(2) { font-family: Consolas, monospace; white-space: nowrap; color: #3f6f30; font-size: 0.8125rem; }
.api-table .method { display: inline-flex; padding: 3px 5px; margin-right: 6px; font-family: Consolas, monospace; font-size: 0.6875rem; font-weight: 700; color: #356d31; background: #eaf5e3; border: 1px solid #d1e4c5; border-radius: 4px; }
.api-table .method.post { color: #855c18; background: #fcf2db; border-color: #ead8ab; }
.api-table .method.delete { color: #954b3c; background: #f8eae3; border-color: #ebd1c5; }

@media (min-width: 1650px) {
  main { padding-inline: 36px; }
  .inbox-workspace { grid-template-columns: minmax(0, 1fr) 440px; }
  .mail-table-head, .mail-row { grid-template-columns: minmax(180px, 1fr) minmax(0, 1.7fr) 85px; }
  .recipient-domain { font-size: 0.875rem; }
}
@media (max-width: 1280px) {
  .app-shell { grid-template-columns: 208px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  main { padding-inline: 23px; }
  .filter-bar { grid-template-columns: minmax(125px, .95fr) minmax(145px, 1.15fr) minmax(130px, .9fr); gap: 13px; }
  .keyword-label { grid-column: 1 / 3; }
  .filter-actions { justify-content: flex-end; }
  .account-filters { grid-template-columns: minmax(180px, 230px) minmax(200px, 1fr) auto; }
  .inbox-workspace { grid-template-columns: minmax(0, 1fr) 360px; }
  .mail-list-panel, .reader { height: calc(100dvh - 375px); }
  .mail-table-head, .mail-row { grid-template-columns: minmax(122px, .9fr) minmax(0, 1.2fr) 65px; gap: 12px; padding-inline: 16px; }
  .sort-label { display: none; }
  .reader-content { padding-inline: 22px; }
  .task-summary { gap: 29px; }
}
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 200px minmax(0, 1fr); }
  .sidebar { padding-inline: 9px; }
  main { padding-inline: 20px; }
  .nav-item { padding-inline: 10px; gap: 9px; font-size: 0.9375rem; }
  .nav-item .delivery-badge, .nav-item .pending-badge { font-size: 0.6875rem; padding-inline: 4px; }
  .inbox-workspace { display: block; }
  .mail-list-panel { border-right: 0; height: auto; min-height: 0; }
  .mail-list { max-height: none; overflow: visible; }
  .mail-table-head, .mail-row { grid-template-columns: minmax(145px, 1fr) minmax(0, 1.7fr) 76px; gap: 15px; padding-inline: 20px; }
  .reader { display: none; }
  .reader.mobile-open { display: block; position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: 460px; max-width: 100vw; height: 100dvh; min-height: 0; border-radius: 0; box-shadow: -15px 0 60px #1d341e3d; padding-bottom: env(safe-area-inset-bottom); }
  .reader-close { display: inline-grid; }
  .reader-top { position: sticky; top: 0; z-index: 2; background: #fcfdfa; }
  .topbar-actions { gap: 12px; }
  .brand-subtitle, .brand-divider { display: none; }
}
@media (max-width: 760px) {
  .topbar { height: 58px; gap: 10px; padding: 0 16px; }
  .brand { gap: 8px; }
  .brand strong { font-size: 1.1875rem; }
  .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
  .brand-mark svg { width: 23px; height: 23px; }
  .mobile-menu { display: inline-grid; margin-left: -7px; }
  .topbar-divider, .api-trigger, .user-name, .demo-badge { display: none; }
  .topbar-actions { gap: 0; }
  .user-button { gap: 6px; }
  .user-button .pending-badge { padding: 2px 4px; font-size: 0.6875rem; }
  .avatar { width: 32px; height: 32px; font-size: 0.875rem; }
  .app-shell { display: block; min-height: calc(100dvh - 58px); }
  .sidebar { display: none; }
  .sidebar.open { display: flex; position: fixed; z-index: 35; left: 0; top: 58px; bottom: 0; width: 224px; min-height: 0; box-shadow: 14px 0 40px #1e331e36; overflow-y: auto; }
  .nav-item { font-size: 0.875rem; padding-inline: 12px; }
  .nav-item .pending-badge, .nav-item .delivery-badge { font-size: 0.75rem; }
  main { padding: 20px 13px 24px; }
  .page-heading { min-height: 38px; gap: 10px; align-items: center; margin-bottom: 17px; }
  h1 { font-size: 1.375rem; }
  .title-line { gap: 8px; }
  .title-line .delivery-badge { font-size: 0.6875rem; padding: 3px 5px; }
  .total-pill { font-size: 0.6875rem; padding: 3px 6px; }
  .heading-actions { gap: 8px; flex-wrap: wrap; }
  .heading-actions .button { font-size: 0.75rem; padding: 9px 11px; min-height: 43px; }
  .heading-actions .button .pending-badge { font-size: 0.6875rem; padding: 2px 4px; }
  #refresh-mail { padding: 0; width: 43px; height: 43px; }
  #refresh-mail span { display: none; }
  .auto-control { display: none; }
  .filter-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 13px 12px; gap: 12px; border-radius: 10px; margin-bottom: 14px; }
  .filter-bar label > span { font-size: 0.6875rem; }
  .filter-bar input, .filter-bar select, .field input, .field select { font-size: 1rem; }
  .filter-bar input, .filter-bar select { height: 2.8125rem; min-height: 45px; padding-inline: 10px; }
  .input-icon > svg { display: none; }
  .input-icon > input { padding-left: 10px; }
  .filter-bar select { padding-right: 28px; background-position: right 7px center; }
  .keyword-label { grid-column: auto; }
  .filter-actions { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--line); gap: 7px; }
  .filter-actions .button { min-width: 80px; min-height: 43px; }
  .date-range { grid-template-columns: minmax(0, 1fr); grid-row: 3; gap: 10px; width: 100%; max-width: none; }
  .date-to { display: none; }
  input[type="datetime-local"] { min-width: 0; width: 100%; max-width: 100%; appearance: none; }
  .date-range input { min-height: 45px; }
  .inbox-workspace { border-radius: 10px; }
  .list-toolbar { min-height: 50px; height: 50px; padding-inline: 12px; gap: 7px; }
  .segmented { gap: 24px; }
  .segmented button { font-size: 0.75rem; }
  .segmented button span { font-size: 0.6875rem; margin-left: 4px; }
  .mail-table-head, .mail-row { grid-template-columns: minmax(105px, .8fr) minmax(0, 1.3fr) 45px; gap: 8px; padding-inline: 11px; }
  .mail-table-head > span:first-child { display: block; }
  .mail-table-head { padding-block: 11px; font-size: 0.625rem; }
  .mail-row { min-height: 78px; padding-block: 14px; }
  .mail-row > span:first-child { grid-column: auto; display: block; min-width: 0; }
  .recipient-name { display: block; max-width: 100%; font-size: 0.75rem; font-weight: 500; }
  .recipient-domain { display: block; margin: 5px 0 0; min-width: 0; font-size: 0.625rem; }
  .sender-name { font-size: 0.75rem; }
  .sender-line { margin-bottom: 4px; }
  .message-subject { font-size: 0.6875rem; }
  .mail-date { align-self: center; font-size: 0.6875rem; padding-bottom: 0; }
  .mail-date small { font-size: 0.5625rem; margin-top: 4px; }
  .pagination { padding: 12px 14px; font-size: 0.6875rem; gap: 8px; }
  .pagination > div { gap: 7px; }
  .pagination .icon-button { width: 30px; height: 32px; }
  .sync-footer { padding: 11px 16px; font-size: 0.625rem; }
  .reader.mobile-open { width: 100vw; max-width: 100vw; }
  .reader-top { padding: 14px 20px; }
  .reader-content { padding: 22px 20px 18px; }
  .reader h2 { font-size: 1.25rem; }
  .reader-body { font-size: 0.875rem; line-height: 1.9; }
  .reader-sender small { font-size: 0.6875rem; }
  .reader-meta { font-size: 0.6875rem; }
  .verification-code strong { font-size: 1.8125rem; }
  .reader-footer { padding-inline: 22px; }
  .account-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #accounts-view .page-heading { align-items: flex-start; flex-direction: column; gap: 15px; }
  #accounts-view .heading-actions { justify-content: space-between; width: 100%; gap: 12px; }
  #accounts-view .heading-actions .button { font-size: 0.75rem; }
  .password-action { gap: 7px; }
  .account-selection { align-items: flex-start; flex-direction: column; padding: 12px; gap: 8px; }
  .account-selection > div { flex-wrap: wrap; gap: 14px; }
  .account-selection .text-button { font-size: 0.6875rem; }
  .data-table th, .data-table td { padding-inline: 16px; }
  .task-summary { justify-content: space-between; gap: 12px; padding: 18px; }
  .task-summary > div { display: block; }
  .task-summary strong { display: block; font-size: 1.4375rem; }
  .task-summary span { font-size: 0.6875rem; }
  .section-toolbar { padding-inline: 16px; }
  .empty-state { min-height: 280px; padding-inline: 20px; }
  dialog { width: 560px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: 12px; margin: auto; scrollbar-gutter: auto; }
  .dialog-header { padding: 20px 20px 16px; }
  .dialog-header h2 { font-size: 1.1875rem; }
  .dialog-header p { font-size: 0.75rem; overflow-wrap: anywhere; }
  .dialog-form, .dialog-body { padding: 20px; }
  .field-row { gap: 12px; }
  .field > span { font-size: 0.8125rem; }
  .field input, .field select { height: 2.9375rem; min-height: 47px; }
  .dialog-actions { padding: 15px 20px; gap: 9px; }
  .dialog-actions .button { font-size: 0.875rem; padding-inline: 12px; }
  .dialog-actions .pending-badge { font-size: 0.6875rem; padding-inline: 4px; }
  .dialog-form .dialog-actions, #task-detail-body .dialog-actions { margin: 20px -20px -20px; }
  .preview-box { padding: 13px; }
  .preview-lines { font-size: 0.6875rem; overflow-wrap: anywhere; }
  .preview-title { font-size: 0.6875rem; }
  .selected-addresses { font-size: 0.75rem; }
  .mini-tabs button { font-size: 0.8125rem; }
  .api-intro { padding: 18px; gap: 8px; }
  .api-intro > div { padding: 11px 10px; }
  .api-intro strong { display: block; font-size: 1.25rem; }
  .api-intro span { font-size: 0.6875rem; }
  .task-detail-summary { gap: 18px; }
  .task-detail-item { padding: 12px 10px; font-size: 0.6875rem; }
  .login-placeholder { padding: 15px; }
  .login-placeholder small { font-size: 0.75rem; }
}
@media (max-width: 370px) {
  .topbar { padding-inline: 12px; }
  .brand { gap: 6px; }
  .brand strong { font-size: 1.1875rem; }
  main { padding-inline: 12px; }
  .page-heading { gap: 8px; }
  h1 { font-size: 1.375rem; }
  .title-line { gap: 6px; }
  .filter-bar { padding: 14px 12px; gap: 13px 10px; }
  .filter-bar input, .filter-bar select { padding-left: 8px; }
  .filter-actions .button { min-width: 76px; }
  .list-toolbar, .mail-table-head, .mail-row { padding-inline: 13px; }
  .segmented { gap: 20px; }
  .pagination { padding-inline: 12px; font-size: 0.75rem; }
  .pagination > div { gap: 5px; }
  #accounts-view .heading-actions .button { padding-inline: 12px; }
  .task-summary { padding-inline: 15px; }
  .dialog-actions { padding-inline: 15px; }
  .dialog-actions .button { padding-inline: 10px; font-size: 0.875rem; }
  .reader-content { padding-inline: 19px; }
  .verification-code strong { font-size: 1.8125rem; letter-spacing: 4px; }
}
.brand { flex: 1; }
.brand strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { flex-shrink: 0; }
.title-line { flex-wrap: wrap; }
.filter-actions { min-width: 0; flex-wrap: wrap; }
.dialog-actions .button { max-width: 100%; white-space: normal; flex-wrap: wrap; }
@media (min-width: 761px) and (max-width: 930px) {
  .account-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .account-filters .filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (max-width: 760px) {
  #tasks-view > .page-heading { flex-wrap: wrap; align-items: flex-start; }
  .filter-bar label { gap: 6px; }
  .sender-line { font-size: 0.75rem; }
  .unread .sender-name { font-weight: 650; }
  .reader-top, .reader-sender strong { font-size: 0.8125rem; }
  .reader-body { line-height: 1.8; }
  .text-tag, .verification > span { font-size: 0.6875rem; }
  .data-table, .data-table td strong { font-size: 0.8125rem; }
  .data-table th, .domain-chip { font-size: 0.75rem; }
  .data-table td small { font-size: 0.6875rem; }
  .account-table { min-width: 690px; }
  .task-state, .text-button { font-size: 0.75rem; }
  .task-summary { padding: 15px; }
}
@media (max-width: 370px) {
  #accounts-view .heading-actions { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 12px; }
}
@media (hover: none) and (pointer: coarse) {
  .filter-bar input, .filter-bar select, .field input, .field select, .field textarea { font-size: max(1rem, 16px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; transition: none !important; }
}
