/* GotEmail on the web. Tokens from App/DesignSystem/Palette.swift (web/DESIGN.md).
   Rule: nothing moves under the pointer. Hover and press change colour only. */

:root {
    /* The frame: graphite (SidebarTint.graphite), the same in light and dark. */
    --frame: #282828;
    --rail: #202020;
    --frame-selection: #3a3a3a;
    --frame-hairline: #383838;
    --frame-text: #ededed;
    --frame-muted: #8c8c8c;

    /* Cards, light. */
    --card: #ffffff;
    --card-edge: #ffffff;
    --hairline: #ededed;
    --outline: #e3e3e3;
    --pill: #f3f3f3;
    --pill-text: #6e6e6e;
    --panel-deep: #e9e9e9;
    --panel-pressed: #dedede;
    --row-selection: #f4f4f4;
    --row-hover: #f9f9f9;
    --text: #171717;
    --text-2: #737373;
    --text-3: #8a8a8a;
    --toast: #282828;
    --toast-text: #ffffff;
    --prominent: #282828;
    --prominent-text: #ffffff;
    --tool-hover: rgba(23, 23, 23, 0.07);
    --tool-press: rgba(23, 23, 23, 0.14);
    --scrim: rgba(0, 0, 0, 0.35);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.18);

    --accent: #3f86f7;
    --star: #f59e0b;
    --green: #16a34a;
    --red: #dc2626;

    --gap: 5px;
    --card-radius: 13px;
    --row-radius: 10px;
    --tool: 36px;
    --rail-width: 78px;
    --sidebar-width: 232px;
    --list-width: 350px;
    --header: 58px;
    --text-scale: 1;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --card: #282828;
    --card-edge: #3a3a3a;
    --hairline: #383838;
    --outline: #444444;
    --pill: #3a3a3a;
    --pill-text: #b4b4b4;
    --panel-deep: #343434;
    --panel-pressed: #404040;
    --row-selection: #3a3a3a;
    --row-hover: #313131;
    --text: #ededed;
    --text-2: #a3a3a3;
    --text-3: #8c8c8c;
    --toast: #e8e8e8;
    --toast-text: #171717;
    --prominent: #e8e8e8;
    --prominent-text: #171717;
    --tool-hover: rgba(237, 237, 237, 0.14);
    --tool-press: rgba(237, 237, 237, 0.26);
    color-scheme: dark;
}

/* The accents of AccentChoice (Settings → Appearance, F6 for the picker). */
:root[data-accent="indigo"] { --accent: #5b5bd6; }
:root[data-accent="purple"] { --accent: #8e5cd9; }
:root[data-accent="pink"] { --accent: #e0559a; }
:root[data-accent="red"] { --accent: #e5484d; }
:root[data-accent="orange"] { --accent: #f0883e; }
:root[data-accent="green"] { --accent: #30a46c; }
:root[data-accent="teal"] { --accent: #12a594; }

/* The other frames of SidebarTint (custom colours, F6). */
:root[data-frame="blue"] { --frame: #1f2b46; --rail: #18223a; --frame-selection: #334262; --frame-hairline: #2c3a56; }
:root[data-frame="green"] { --frame: #1f3329; --rail: #182a21; --frame-selection: #324a3c; --frame-hairline: #2b4235; }
:root[data-frame="purple"] { --frame: #2d2449; --rail: #251d3d; --frame-selection: #443863; --frame-hairline: #3c3157; }
:root[data-frame="rose"] { --frame: #3b2329; --rail: #311c21; --frame-selection: #55363e; --frame-hairline: #4b3038; }
:root[data-frame="brown"] { --frame: #3a2b1e; --rail: #302318; --frame-selection: #53402f; --frame-hairline: #4a382a; }
:root[data-frame="teal"] { --frame: #1c3437; --rail: #162b2e; --frame-selection: #2f4c50; --frame-hairline: #294447; }

/* Label tints (MailLabel.Tint). */
.tint-red { --tint: #ff3b30; } .tint-orange { --tint: #ff9500; } .tint-yellow { --tint: #d9a400; }
.tint-green { --tint: #34c759; } .tint-teal { --tint: #30b0c7; } .tint-blue { --tint: #007aff; }
.tint-indigo { --tint: #5856d6; } .tint-purple { --tint: #af52de; } .tint-pink { --tint: #ff2d55; }
.tint-gray { --tint: #8e8e93; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
    background: var(--frame);
    color: var(--text);
    font: calc(13px * var(--text-scale)) / 1.35 var(--font);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: default; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.i { flex: none; display: inline-block; vertical-align: middle; fill: none; stroke: currentColor; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------------------------------------------------------------- the shell */

.shell {
    position: fixed; inset: 0;
    display: grid;
    grid-template-columns: var(--rail-width) var(--sidebar-width) var(--gap) var(--list-width) var(--gap) minmax(360px, 1fr);
    grid-template-rows: 100%;
    padding: var(--gap) var(--gap) var(--gap) 0;
}
:root[data-sidebar="hidden"] .shell { grid-template-columns: var(--rail-width) 0 var(--gap) var(--list-width) var(--gap) minmax(360px, 1fr); }
:root[data-sidebar="hidden"] .sidebar { visibility: hidden; }
.shell > .rail { margin: calc(-1 * var(--gap)) 0; grid-column: 1; grid-row: 1; }
.shell > .sidebar { margin: calc(-1 * var(--gap)) 0; grid-column: 2; grid-row: 1; }
.shell > .divider.sidebar-divider { grid-column: 3; grid-row: 1; }
.shell > .list-card { grid-column: 4; grid-row: 1; }
.shell > .divider.list-divider { grid-column: 5; grid-row: 1; }
.shell > .message-card { grid-column: 6; grid-row: 1; }

.card {
    background: var(--card);
    border: 1px solid var(--card-edge);
    border-radius: var(--card-radius);
    overflow: hidden;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.divider { cursor: col-resize; touch-action: none; }
.divider:hover, .divider.dragging { background: transparent; }

.hairline { height: 1px; background: var(--hairline); flex: none; }
.pill {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--pill); color: var(--pill-text);
    font-size: calc(12px * var(--text-scale)); line-height: 1.3;
    padding: 3px 10px; border-radius: 999px; border: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
button.pill:hover { background: var(--panel-deep); }
button.pill:active { background: var(--panel-pressed); }

/* Tool groups: buttons on one capsule ground, a round highlight under the pointer. */
.tools { display: inline-flex; align-items: center; border: 1px solid var(--outline); border-radius: 999px; background: var(--card); flex: none; }
.tool {
    width: var(--tool); height: var(--tool); border: 0; padding: 0; background: none;
    display: inline-grid; place-items: center; color: var(--text); position: relative;
}
.tool::before { content: ""; position: absolute; width: 30px; height: 30px; border-radius: 50%; background: transparent; transition: background-color .15s; }
.tool:hover::before { background: var(--tool-hover); }
.tool:active::before { background: var(--tool-press); }
.tool .i { position: relative; }
.tool:disabled { opacity: .35; }
.tool:disabled::before { background: transparent; }
.tool.on { color: var(--accent); }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: var(--header); flex: none; }
.toolbar .spacer { flex: 1; }

.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 30px; padding: 0 14px; border-radius: 999px;
    border: 1px solid var(--outline); background: var(--card); color: var(--text);
    font-weight: 500; white-space: nowrap; transition: background-color .15s;
}
.button:hover { background: var(--row-hover); }
.button:active { background: var(--row-selection); }
.button.prominent { background: var(--prominent); color: var(--prominent-text); border-color: transparent; }
.button.prominent:hover { background: color-mix(in srgb, var(--prominent) 88%, var(--card)); }
.button.destructive { color: var(--red); }
.button.destructive.prominent { background: var(--red); color: #fff; }
.button:disabled { opacity: .45; }
.button.small { height: 24px; padding: 0 10px; font-size: calc(12px * var(--text-scale)); }
.button.large { height: 36px; padding: 0 18px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 500; cursor: pointer; }
.link:hover { text-decoration: underline; }

.field {
    width: 100%; height: 32px; padding: 0 10px; border-radius: 8px;
    border: 1px solid var(--outline); background: var(--card); color: var(--text);
}
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
textarea.field { height: auto; padding: 8px 10px; resize: vertical; }
select.field { padding-right: 24px; }

.spinner {
    width: 14px; height: 14px; border-radius: 50%; flex: none;
    border: 2px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor;
    animation: spin .8s linear infinite;
}
.spinner.big { width: 24px; height: 24px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- the rail */

.rail {
    background: var(--rail); color: var(--frame-muted);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 18px 0 14px; overflow-y: auto; overflow-x: hidden;
}
.rail-button {
    width: 36px; height: 36px; border-radius: 9px; border: 0; padding: 0; background: transparent;
    color: var(--frame-muted); display: grid; place-items: center; position: relative; flex: none;
    transition: background-color .15s, color .15s;
}
.rail-button:hover { background: color-mix(in srgb, var(--frame-selection) 50%, transparent); }
.rail-button.selected { background: var(--frame-selection); color: var(--frame-text); }
.rail-button img { width: 18px; height: 18px; opacity: .7; border-radius: 4px; }
.rail-button.selected img { opacity: 1; }
.rail-button .badge {
    position: absolute; top: -4px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 999px; background: var(--accent); color: #fff; border: 1.5px solid var(--rail);
    font-size: 9px; font-weight: 700; line-height: 13px; text-align: center; font-variant-numeric: tabular-nums;
}
.rail-line { width: 50px; height: 1px; background: var(--frame-hairline); margin: 6px 0; flex: none; }
.rail .space { flex: 1; }
.appearance-switch { background: var(--frame-selection); border-radius: 999px; padding: 2px; display: flex; flex-direction: column; position: relative; }
.appearance-switch button { width: 24px; height: 24px; border: 0; padding: 0; border-radius: 50%; background: transparent; color: var(--frame-muted); display: grid; place-items: center; position: relative; z-index: 1; }
.appearance-switch button.on { color: var(--frame); background: var(--frame-text); }

/* ---------------------------------------------------------------- the sidebar */

.sidebar {
    background: var(--frame); color: var(--frame-text);
    display: flex; flex-direction: column; min-width: 0; overflow: hidden;
    font-size: calc(13px * var(--text-scale));
}
.sidebar-top { display: flex; align-items: center; justify-content: flex-end; height: 32px; padding: 14px 12px 0; flex: none; box-sizing: content-box; }
.sidebar-write { padding: 14px 12px 14px; display: flex; gap: 8px; flex: none; }
.new-message {
    flex: 1; height: 36px; border-radius: 999px; border: 0; background: var(--frame-text); color: var(--frame);
    font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.new-message:hover { background: #ffffff; }
.new-message kbd { font: 500 calc(11px * var(--text-scale)) var(--font); opacity: .55; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 0 12px 12px; scrollbar-width: thin; scrollbar-color: #555 transparent; }
.sidebar-bottom { border-top: 1px solid var(--frame-hairline); padding: 12px; flex: none; }
.heading {
    display: flex; align-items: center; gap: 4px;
    font-size: calc(11px * var(--text-scale)); font-weight: 500; letter-spacing: .4px; text-transform: uppercase;
    color: var(--frame-muted); padding: 10px 8px 6px; border: 0; background: none; width: 100%; text-align: left;
}
button.heading:hover { color: var(--frame-text); }
.heading .grow { flex: 1; }
.srow {
    display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 8px;
    border: 0; border-radius: 8px; background: transparent; color: var(--frame-text); text-align: left;
    position: relative; transition: background-color .15s;
}
.srow:hover { background: color-mix(in srgb, var(--frame-selection) 50%, transparent); }
.srow.selected, .srow:active { background: var(--frame-selection); }
.srow.drop { box-shadow: inset 0 0 0 2px var(--accent); }
.srow .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow .sub { font-size: calc(11px * var(--text-scale)); color: var(--frame-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.srow .count { font-size: calc(12px * var(--text-scale)); color: var(--frame-muted); font-variant-numeric: tabular-nums; }
.srow .chev { color: var(--frame-muted); }
.srow .muted { color: var(--frame-muted); }
.srow .alert { color: var(--red); }
.srow .pinner { width: 22px; height: 32px; display: none; place-items: center; color: var(--frame-muted); border: 0; background: none; padding: 0; }
.srow:hover .pinner, .srow .pinner.on { display: grid; }
.srow .pinner.on { color: var(--frame-text); }
.srow .chev-button { width: 26px; height: 26px; margin-right: -4px; border: 0; background: none; padding: 0; display: grid; place-items: center; color: var(--frame-muted); }
.srow .chev-button:hover { color: var(--frame-text); }
.srow.account-row.drop-before::before { content: ""; position: absolute; left: 6px; right: 6px; top: -1px; height: 2px; border-radius: 1px; background: var(--accent); }
.label-dot { color: var(--tint); }
.folder-gap { padding-left: 8px; color: var(--frame-muted); height: 32px; display: flex; align-items: center; }
.sidebar .spinner { width: 11px; height: 11px; border-width: 1.5px; color: var(--frame-muted); }

/* ---------------------------------------------------------------- the list */

.list-card { position: relative; }
.list-head { flex: none; background: var(--card); }
.list-title { display: flex; align-items: center; gap: 8px; height: var(--header); padding: 0 14px; }
.list-title h1 { font-size: calc(17px * var(--text-scale)); font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.list-title .spacer { flex: 1; min-width: 8px; }
.list-title .toggle { width: 28px; height: 28px; border: 0; background: none; padding: 0; margin-left: -6px; display: grid; place-items: center; color: var(--text-3); }
.loadline { position: relative; height: 1px; background: var(--hairline); }
.loadbar { position: absolute; left: 0; top: -1px; height: 2px; width: 0; border-radius: 1px; background: var(--accent); opacity: 0; transition: opacity .2s; pointer-events: none; }
.loadbar.on { opacity: 1; }
.search {
    margin: 12px 14px 6px; height: 36px; border: 1px solid var(--outline); border-radius: 999px;
    display: flex; align-items: center; gap: 8px; padding: 0 8px 0 14px; color: var(--text-3);
}
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: calc(13px * var(--text-scale)); }
.search .clear { border: 0; background: none; padding: 4px; color: var(--text-3); display: grid; place-items: center; }
.search kbd { font: 500 10px var(--font); color: var(--text-3); border: 1px solid var(--outline); border-radius: 4px; padding: 1px 4px; }
.banner { margin: 6px 14px; padding: 10px; border-radius: 10px; display: flex; gap: 8px; align-items: flex-start; font-size: calc(12px * var(--text-scale)); }
.banner.problem { background: color-mix(in srgb, var(--red) 8%, transparent); }
.banner.problem > .i { color: var(--red); }
.banner.notice { background: color-mix(in srgb, var(--pill) 70%, transparent); }
.banner.notice > .i { color: var(--text-2); }
.banner .words { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; user-select: text; }
.banner button { border: 0; background: none; color: var(--text-2); padding: 0; }

.rows { flex: 1; overflow-y: auto; position: relative; outline: none; overscroll-behavior: contain; }
.rows-space { position: relative; width: 100%; }
.row {
    position: absolute; left: 0; right: 0; display: flex; gap: 10px; padding: 9px 16px 0; overflow: hidden;
    user-select: none;
}
.row::before { content: ""; position: absolute; inset: 0 10px 1px; border-radius: var(--row-radius); background: transparent; transition: background-color .12s; z-index: 0; }
.row:hover::before { background: var(--row-hover); }
.row.selected::before { background: var(--row-selection); }
.row::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--hairline); }
.row > * { position: relative; z-index: 1; }
.row .lines { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row .line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.row .line > .grow { flex: 1; min-width: 4px; }
.row .from { font-size: calc(13px * var(--text-scale)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.row.unread .from { font-weight: 600; }
.row .subject { font-size: calc(13px * var(--text-scale)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.row.unread .subject { font-weight: 500; }
.row .subject.none { color: var(--text-2); }
.row .preview { font-size: calc(12px * var(--text-scale)); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .account { font-size: calc(10px * var(--text-scale)); font-weight: 500; color: var(--text-3); padding-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .date { font-size: calc(12px * var(--text-scale)); color: var(--text-3); white-space: nowrap; flex: none; }
.row .glyph { color: var(--text-3); flex: none; align-self: center; }
.row .glyph.star { color: var(--star); }
.row .thread { font-size: calc(10px * var(--text-scale)); font-weight: 600; color: var(--pill-text); background: var(--pill); border-radius: 999px; padding: 1px 5px; flex: none; }
.chips { display: inline-flex; gap: 4px; flex: none; }
.chip { font-size: calc(10px * var(--text-scale)); font-weight: 600; color: var(--tint); background: color-mix(in srgb, var(--tint) 14%, transparent); padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.chips.big .chip { font-size: calc(11px * var(--text-scale)); padding: 2px 8px; }

.badge-wrap { position: relative; width: 24px; height: 24px; flex: none; margin-top: 1px; }
.sender-badge {
    width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
    font-size: calc(10px * var(--text-scale)); font-weight: 600; color: #fff; background: var(--badge, #8a8a8a);
}
.sender-badge img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.sender-badge.big { font-size: calc(14px * var(--text-scale)); }
.unread-dot {
    position: absolute; left: -4px; top: -4px; width: 12px; height: 12px; border-radius: 50%;
    background: var(--accent); border: 2px solid var(--card); box-shadow: 0 0 5px color-mix(in srgb, var(--accent) 45%, transparent);
}
.older { position: absolute; left: 0; right: 0; display: grid; place-items: center; height: 56px; }

.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-2); text-align: center; padding: 24px; pointer-events: none; }
.empty .i { color: var(--text-3); }
.empty h2 { margin: 6px 0 0; font-size: calc(17px * var(--text-scale)); font-weight: 600; color: var(--text); }
.empty p { margin: 0; max-width: 300px; }
.empty button { pointer-events: auto; }

/* ---------------------------------------------------------------- the message */

.message-card { position: relative; }
.reader { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.reader-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }
.reader-head { max-width: 720px; width: 100%; margin: 0 auto; padding: 30px 44px 22px; display: flex; flex-direction: column; gap: 18px; }
.subject-line { display: flex; align-items: center; gap: 14px; }
.subject-line h2 { margin: 0; font-size: calc(22px * var(--text-scale)); font-weight: 600; flex: 1; user-select: text; overflow-wrap: anywhere; }
.subject-line h2.none { color: var(--text-2); }
.people { display: flex; gap: 12px; align-items: flex-start; }
.people .badge-wrap { width: 36px; height: 36px; }
.people .who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.people .from-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.people .from-name { font-weight: 600; user-select: text; }
.recipients { display: flex; gap: 4px; flex-wrap: wrap; color: var(--text-2); }
.recipients button { border: 0; background: none; padding: 0 4px 0 0; color: var(--text-2); }
.recipients button:hover { color: var(--text); }
.recipients .more { color: var(--text); font-weight: 500; }
.people .when { color: var(--text-2); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.reader .rule { max-width: 720px; width: calc(100% - 88px); margin: 0 auto; height: 1px; background: var(--hairline); flex: none; }
.notices { max-width: 720px; width: 100%; margin: 0 auto; padding: 8px 44px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: calc(12px * var(--text-scale)); }
.notices:empty { display: none; }
.notices .notice { display: flex; align-items: center; gap: 8px; }
.images-bar { max-width: 720px; width: 100%; margin: 0 auto; padding: 8px 44px; display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: calc(12px * var(--text-scale)); }
.images-bar .grow { flex: 1; }
/* The frame is as tall as its page (ui/frame.js fitFrame): the card scrolls, not the frame. */
.body { flex: none; margin: 8px 24px 24px; border-radius: 8px; overflow: hidden; position: relative; }
.body iframe { border: 0; width: 100%; height: 120px; background: transparent; display: block; }
.body .center { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-2); padding: 40px 0; }
.codes { display: flex; gap: 6px; flex: none; }
.code-pill { font: 600 calc(15px * var(--text-scale)) var(--mono); letter-spacing: 1px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); border: 0; border-radius: 999px; padding: 5px 12px; }
.code-pill:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }

.attachments { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.attachment {
    display: inline-flex; align-items: center; gap: 8px; max-width: 260px; height: 34px; padding: 0 6px 0 10px;
    border: 1px solid var(--outline); border-radius: 10px; background: var(--card);
}
.attachment:hover { background: var(--row-hover); }
.attachment .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.attachment .size { color: var(--text-3); font-size: calc(11px * var(--text-scale)); white-space: nowrap; }
.attachment button { border: 0; background: none; padding: 4px; color: var(--text-2); display: grid; place-items: center; border-radius: 6px; }
.attachment button:hover { background: var(--tool-hover); color: var(--text); }

.quick-reply { padding: 14px 24px; flex: none; }
.quick-reply .box { min-height: 46px; border: 1px solid var(--outline); border-radius: 23px; display: flex; align-items: center; gap: 10px; padding: 7px 7px 7px 16px; color: var(--text-3); }
.quick-reply input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); }

.nothing { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-2); text-align: center; padding: 24px; }
.nothing h2 { margin: 0; font-size: calc(17px * var(--text-scale)); color: var(--text); font-weight: 600; }
.nothing .i { color: var(--text-3); }
.nothing .actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }

.back-button { display: none; }

/* ---------------------------------------------------------------- reading, wave 2 */

.toolbar-slot { display: contents; }
.reader-scroll > .body-wrap, .reader .thread .body-wrap { display: flex; flex-direction: column; flex: none; }
.reader .thread .body-wrap .body { margin: 4px 0 8px; }

/* The notices line (MessageNotices): trackers, the look, the text size, Unsubscribe. */
.notices-line { max-width: 720px; width: 100%; margin: 0 auto; padding: 8px 44px; display: flex; align-items: center; gap: 10px; min-height: 40px; color: var(--text-2); font-size: calc(12px * var(--text-scale)); flex-wrap: wrap; box-sizing: border-box; flex: none; }
.notices-line.in-thread { padding: 0; max-width: none; min-height: 28px; }
.notices-line .notice { display: inline-flex; align-items: center; gap: 6px; }
.notices-line .grow { flex: 1; }
.notices-line .unsubscribed { color: var(--text-3); }
.notices-line .button { display: inline-flex; align-items: center; gap: 4px; }
.text-size { display: inline-flex; border: 1px solid var(--outline); border-radius: 999px; overflow: hidden; flex: none; }
.mini { border: 0; background: none; color: var(--text-2); font-size: calc(11px * var(--text-scale)); font-weight: 600; padding: 3px 9px; transition: background-color .15s, color .15s; }
.mini:hover { background: var(--tool-hover); color: var(--text); }
.mini:disabled { opacity: .35; background: none; }
.mini.icon { display: grid; place-items: center; border-radius: 999px; padding: 4px; }
.tool.small { width: 28px; height: 28px; }
.tool.small::before { width: 24px; height: 24px; }

/* Login codes by the subject (LoginCodePills). */
.codes .code-pill { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; transition: background-color .15s; }
.codes .code-pill.link { font-family: inherit; letter-spacing: 0; }
.codes.small .code-pill { font-size: calc(11px * var(--text-scale)); padding: 2px 8px; }

/* The calendar card (InviteCard). */
.invite { max-width: 632px; width: calc(100% - 88px); margin: 8px auto; display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; padding: 12px; border: 1px solid var(--outline); border-radius: 12px; background: var(--card); box-sizing: border-box; flex: none; }
.reader .thread .invite { width: auto; margin: 6px 0 6px 32px; max-width: none; }
.invite.reading { align-items: center; color: var(--text-3); font-size: calc(12px * var(--text-scale)); min-height: 26px; }
.invite .tile { width: 46px; height: 48px; flex: none; border-radius: 9px; background: var(--pill); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.invite .tile .month { font-size: calc(10px * var(--text-scale)); font-weight: 600; letter-spacing: .4px; color: var(--red); }
.invite .tile .day { font-size: calc(19px * var(--text-scale)); font-weight: 600; }
.invite.cancelled .tile .month, .invite.cancelled .tile .day { color: var(--text-3); }
.invite .details { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 3px; }
.invite .title { font-size: calc(14px * var(--text-scale)); font-weight: 600; user-select: text; overflow-wrap: anywhere; }
.invite.cancelled .title { text-decoration: line-through; color: var(--text-2); }
.invite .when { color: var(--text-2); font-size: calc(12px * var(--text-scale)); user-select: text; }
.invite .state { display: inline-flex; align-items: center; gap: 4px; font-size: calc(12px * var(--text-scale)); font-weight: 500; }
.invite .state.red { color: var(--red); }
.invite .facts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; }
.invite .fact { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: calc(12px * var(--text-scale)); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite .fact.link { color: var(--accent); text-decoration: none; }
.invite .fact.link:hover { text-decoration: underline; }
.invite-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.invite-actions .button { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; justify-content: center; }

/* A conversation (ConversationView): the head, then the thread or the chat. */
.conversation-head { max-width: 720px; width: 100%; margin: 0 auto; padding: 30px 44px 16px; display: flex; flex-direction: column; gap: 10px; box-sizing: border-box; flex: none; }
.conversation-head .subject-line { flex-wrap: wrap; }
.conversation-sub { display: flex; align-items: center; gap: 10px; min-height: 24px; }
.conversation-sub .grow { flex: 1; }
.segmented.small button { padding: 2px 10px; font-size: calc(12px * var(--text-scale)); }
.reader .thread { max-width: 720px; width: 100%; margin: 0 auto; padding: 0 44px 24px; box-sizing: border-box; display: flex; flex-direction: column; flex: none; }
.message-card-item { border-bottom: 1px solid var(--hairline); display: flex; flex-direction: column; }
.card-line { display: flex; align-items: center; gap: 10px; min-height: 54px; cursor: default; border-radius: 8px; outline-offset: -2px; }
.card-line .badge-wrap.small { width: 22px; height: 22px; margin: 0; }
.card-line .card-from { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; flex: none; }
.card-line.open .card-from { font-weight: 600; }
.card-line .preview-pill { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; }
.card-line .grow { flex: 1; }
.card-line .glyph.star { color: var(--star); display: inline-flex; }
.card-line .date { color: var(--text-3); font-size: calc(12px * var(--text-scale)); white-space: nowrap; flex: none; }
.card-actions { display: inline-flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.card-line:hover .card-actions, .card-line:focus-within .card-actions { opacity: 1; }
.card-recipients { padding-left: 32px; margin-top: -10px; display: flex; flex-direction: column; gap: 2px; font-size: calc(12px * var(--text-scale)); }
.message-card-item > .notices-line, .message-card-item > .card-attachments, .message-card-item > .body-wrap { margin-left: 32px; width: auto; }
.card-attachments { padding: 6px 0; }
.message-card-item > .body-wrap:last-child { margin-bottom: 14px; }

/* The chat (ConversationChat): bubbles in Messages' colours. */
.chat { max-width: 720px; width: 100%; margin: 0 auto; padding: 4px 44px 28px; box-sizing: border-box; display: flex; flex-direction: column; flex: none; }
.chat-day { display: flex; align-items: center; gap: 12px; margin: 22px 0 2px; color: var(--text-3); font-size: calc(11px * var(--text-scale)); font-weight: 500; }
.chat-day::before, .chat-day::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.chat-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 4px; }
.chat-row.opens { margin-top: 12px; }
.chat-row.mine { justify-content: flex-end; }
.chat-badge, .chat-badge-gap { width: 28px; height: 28px; flex: none; margin-top: 20px; }
.chat-row:not(.opens) .chat-badge-gap { margin-top: 0; height: 1px; }
.chat-column { display: flex; flex-direction: column; gap: 4px; max-width: min(540px, 80%); align-items: flex-start; min-width: 0; }
.chat-row.mine .chat-column { align-items: flex-end; }
.chat-sender { color: var(--text-2); font-size: calc(12px * var(--text-scale)); font-weight: 500; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bubble { --bubble: #E9E9EB; --bubble-text: var(--text); background: var(--bubble); color: var(--bubble-text); border-radius: 17px; padding: 8px 13px; user-select: text; overflow-wrap: anywhere; max-width: 100%; box-sizing: border-box; }
:root[data-theme="dark"] .bubble { --bubble: #3A3A3C; }
.bubble.mine { --bubble: #0A84FF; --bubble-text: #fff; }
.bubble.tail.mine { border-bottom-right-radius: 5px; }
.bubble.tail:not(.mine) { border-bottom-left-radius: 5px; }
.bubble .bubble-text { white-space: pre-wrap; }
.bubble.folded .bubble-text { display: -webkit-box; -webkit-line-clamp: 12; -webkit-box-orient: vertical; overflow: hidden; }
.bubble a { color: inherit; text-decoration: underline; }
.bubble.loading { color: var(--text-3); min-width: 48px; text-align: center; }
.bubble em { color: inherit; opacity: .7; }
.chat-time { color: var(--text-3); font-size: calc(11px * var(--text-scale)); padding: 0 4px; }
.show-more { font-size: calc(12px * var(--text-scale)); padding: 0 4px; }
.attachments.chips-only .attachment { height: 28px; }

/* The list's clock for a snoozed message. */
.row .glyph.clock { color: var(--accent); }

/* The search palette (SearchPalette). */
.palette-layer { position: fixed; inset: 0; background: var(--scrim); z-index: 55; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fade .15s ease both; }
.palette { width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--card-edge); border-radius: 13px; box-shadow: 0 18px 60px rgba(0, 0, 0, .3); overflow: hidden; }
.palette-field { display: flex; align-items: center; gap: 10px; padding: 0 10px 0 16px; height: 52px; border-bottom: 1px solid var(--hairline); color: var(--text-2); flex: none; }
.palette-field input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: calc(16px * var(--text-scale)); min-width: 0; }
.palette-field input::-webkit-search-cancel-button { display: none; }
.palette-list { overflow-y: auto; padding: 6px; display: flex; flex-direction: column; }
.palette-row { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 0; background: none; color: var(--text); padding: 8px 10px; border-radius: 9px; font: inherit; transition: background-color .1s; }
.palette-row.on { background: var(--row-selection); }
.palette-row.servers { flex-direction: row; align-items: center; gap: 10px; color: var(--text-2); }
.palette-row.servers span:nth-child(2) { flex: 1; }
.palette-row .key { color: var(--text-3); font-size: calc(11px * var(--text-scale)); }
.palette-line { display: flex; gap: 8px; align-items: baseline; }
.palette-line .from { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-line .from.unread { font-weight: 600; }
.palette-line .grow { flex: 1; }
.palette-line .date { color: var(--text-3); font-size: calc(12px * var(--text-scale)); white-space: nowrap; }
.palette-subject, .palette-words { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-words { color: var(--text-2); font-size: calc(12px * var(--text-scale)); }
.palette-row b { font-weight: 700; color: var(--text); }
.palette-where { display: flex; align-items: center; gap: 4px; color: var(--text-3); font-size: calc(11px * var(--text-scale)); }
.palette-heading { color: var(--text-3); font-size: calc(11px * var(--text-scale)); font-weight: 500; letter-spacing: .4px; text-transform: uppercase; padding: 10px 10px 4px; }
.palette-none, .palette-intro { color: var(--text-2); padding: 12px 10px; font-size: calc(13px * var(--text-scale)); }
.palette-intro p { margin: 0 0 6px; }

/* The Keyboard Shortcuts sheet, Choose Folders…. */
.shortcut-list { gap: 0; }
.shortcut-row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--hairline); }
.shortcut-row .keys { color: var(--text-2); font-family: var(--mono); white-space: nowrap; }
.shortcut-heading { color: var(--text-3); font-size: calc(11px * var(--text-scale)); font-weight: 500; letter-spacing: .4px; text-transform: uppercase; padding: 14px 0 4px; }
.choose-folders { gap: 4px; max-height: 50vh; }

/* ---------------------------------------------------------------- overlays */

.toast-layer { position: fixed; left: 0; right: 0; bottom: 22px; display: flex; justify-content: center; pointer-events: none; z-index: 60; }
.toast {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 10px 14px; border-radius: 999px;
    background: var(--toast); color: var(--toast-text); font-weight: 500; box-shadow: var(--shadow);
    max-width: calc(100vw - 32px); pointer-events: auto;
    animation: toast-in .45s cubic-bezier(.2, 1.2, .4, 1) both;
}
.toast .text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast .sep { width: 1px; height: 16px; background: color-mix(in srgb, var(--toast-text) 25%, transparent); margin: 0 4px; }
.toast button { border: 0; background: none; color: var(--toast-text); font-weight: 600; padding: 0; }
.toast.leaving { animation: toast-out .25s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.8); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px) scale(.95); } }

.tip {
    position: fixed; z-index: 80; pointer-events: none; padding: 5px 8px; border-radius: 6px;
    background: var(--card); color: var(--text); border: 1px solid var(--outline);
    font-size: calc(11px * var(--text-scale)); font-weight: 500; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}

.menu {
    position: fixed; z-index: 70; min-width: 200px; max-width: 320px; max-height: 70vh; overflow-y: auto;
    background: var(--card); color: var(--text); border: 1px solid var(--outline); border-radius: 10px;
    box-shadow: var(--shadow); padding: 5px; outline: none;
}
.menu-item {
    display: flex; align-items: center; gap: 8px; width: 100%; height: 28px; padding: 0 10px; border: 0; border-radius: 6px;
    background: none; color: var(--text); text-align: left; white-space: nowrap;
}
.menu-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.menu-item .key { color: var(--text-3); font-size: calc(11px * var(--text-scale)); }
.menu-item.active { background: var(--accent); color: #fff; }
.menu-item.active .key, .menu-item.active .i { color: #fff; }
.menu-item.destructive { color: var(--red); }
.menu-item.active.destructive { background: var(--red); color: #fff; }
.menu-item:disabled { opacity: .4; }
.menu-item .check { width: 14px; display: grid; place-items: center; }
.menu-sep { height: 1px; background: var(--hairline); margin: 4px 6px; }
.menu-title { padding: 4px 10px; color: var(--text-3); font-size: calc(11px * var(--text-scale)); font-weight: 500; }

.sheet-layer { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s ease both; }
@keyframes fade { from { opacity: 0; } }
.sheet {
    width: min(460px, 100%); max-height: min(760px, calc(100vh - 32px)); display: flex; flex-direction: column;
    background: var(--card); color: var(--text); border-radius: var(--card-radius); border: 1px solid var(--card-edge); box-shadow: var(--shadow);
}
.sheet.small { width: min(360px, 100%); }
.sheet.wide { width: min(900px, 100%); height: min(760px, calc(100vh - 32px)); }
.sheet-head { padding: 20px 20px 0; display: flex; flex-direction: column; gap: 6px; }
.sheet-head h2 { margin: 0; font-size: calc(17px * var(--text-scale)); font-weight: 600; }
.sheet-head p { margin: 0; color: var(--text-2); }
.sheet-body { padding: 16px 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.sheet-foot { padding: 0 20px 20px; display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.sheet-foot .grow { flex: 1; }
.sheet-foot .working { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: calc(12px * var(--text-scale)); }
.back-link { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; color: var(--text-2); font-size: calc(12px * var(--text-scale)); font-weight: 500; align-self: flex-start; }
.back-link:hover { color: var(--text); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile {
    height: 88px; border: 1px solid var(--outline); border-radius: 12px; background: var(--card);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-weight: 500;
}
.tile:hover { background: var(--row-hover); }
.tile:active { background: var(--row-selection); }
.mark { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; background: #fff; border: 1px solid var(--outline); display: grid; place-items: center; flex: none; }
.mark img { width: 100%; height: 100%; object-fit: cover; }
.mark.bare img { width: 18px; height: 18px; object-fit: contain; }
.mark.plain { background: var(--pill); color: var(--text-2); }
.box-note { display: flex; gap: 10px; padding: 12px; border-radius: 10px; background: var(--pill); color: var(--text-2); font-size: calc(12px * var(--text-scale)); }
.fine { color: var(--text-3); font-size: calc(11px * var(--text-scale)); margin: 0; }
.form { display: flex; flex-direction: column; gap: 10px; }
.form-section { border: 1px solid var(--outline); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.form-section > h3 { margin: 0; font-size: calc(12px * var(--text-scale)); font-weight: 600; color: var(--text-2); }
.form-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; }
.form-row > label { color: var(--text-2); }
.form-row.top { align-items: start; }
.form-row.top > label { padding-top: 7px; }
.guide { display: flex; gap: 6px; font-size: calc(11px * var(--text-scale)); color: var(--text-2); }
.guide > .i { color: var(--accent); margin-top: 1px; }
.guide.warning, .guide.warning > .i { color: var(--red); }
.guide ol { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 3px; }
.guide .link { font-size: inherit; display: inline-block; margin-top: 4px; }
.failure { display: flex; flex-direction: column; gap: 6px; color: var(--red); font-size: calc(12px * var(--text-scale)); }
.failure .row1 { display: flex; gap: 6px; }
.failure .link { margin-left: 20px; align-self: flex-start; }
.account-list { display: flex; flex-direction: column; gap: 4px; }

.preview-frame { flex: 1; border: 0; width: 100%; background: #fff; border-radius: 8px; }
.preview-image { max-width: 100%; max-height: 100%; object-fit: contain; margin: auto; display: block; }
.preview-text { white-space: pre-wrap; font: calc(12px * var(--text-scale)) / 1.5 var(--mono); margin: 0; user-select: text; }

/* ---------------------------------------------------------------- license and onboarding */

.stage { position: fixed; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: 24px 16px; color: #fff; background: var(--frame); }
.stage .panel { width: min(520px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; }
.stage .mark-big { color: #fff; margin-bottom: 30px; }
.stage h1 { margin: 0; font-size: calc(26px * var(--text-scale)); font-weight: 500; }
.stage .sub { margin: 12px 0 0; font-size: calc(14px * var(--text-scale)); color: rgba(255, 255, 255, .62); line-height: 1.55; max-width: 440px; }
.stage .note { margin: 10px 0 0; font-size: calc(12px * var(--text-scale)); color: rgba(255, 255, 255, .42); }
.stage .content { min-height: 230px; width: 100%; display: flex; flex-direction: column; align-items: center; }
.stage .key-row { display: flex; gap: 8px; width: min(400px, 100%); margin-top: 16px; }
.stage .key-row input {
    flex: 1; min-width: 0; height: 38px; border-radius: 10px; padding: 0 12px; font: calc(13px * var(--text-scale)) var(--mono);
    color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); outline: none;
}
.stage .key-row input:focus { border-color: rgba(255, 255, 255, .4); }
.stage .error { color: #ff8a80; margin-top: 10px; font-size: calc(12px * var(--text-scale)); max-width: 440px; }
.stage .done { color: var(--green); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; margin-top: 14px; }
.on-frame { height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .1); color: #fff; font-weight: 500; }
.on-frame:hover { background: rgba(255, 255, 255, .16); }
.on-frame:disabled { opacity: .45; }
.primary-on-frame { height: 38px; min-width: 120px; padding: 0 22px; border-radius: 999px; border: 0; background: #fff; color: #171717; font-weight: 600; }
.primary-on-frame:hover { background: #e8e8e8; }
.primary-on-frame:disabled { opacity: .45; }
.plain-on-frame { border: 0; background: none; color: rgba(255, 255, 255, .62); padding: 0; }
.plain-on-frame:hover { color: #fff; }
.stage .buttons { display: flex; align-items: center; gap: 18px; margin-top: 6px; }
.stage .dots { display: flex; gap: 8px; margin-top: 30px; }
.stage .dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.stage .dots span.on { background: #fff; }
.stage .buy { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; justify-content: center; }
.stage .buy a { color: #fff; font-weight: 500; text-decoration: none; }
.stage .buy a:hover { text-decoration: underline; }
.stage .dev { margin-top: 18px; }

/* ---------------------------------------------------------------- settings (SettingsView.swift: every pane) */

.settings { position: fixed; inset: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--gap); padding: var(--gap) var(--gap) var(--gap) 0; background: var(--frame); }
.settings-nav { display: flex; flex-direction: column; gap: 14px; padding: 6px 10px 16px; overflow-y: auto; color: var(--frame-text); }
.settings-mail { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--frame-muted); padding: 6px 8px; border-radius: 8px; align-self: flex-start; font-weight: 500; transition: color .15s, background-color .15s; }
.settings-mail:hover { color: var(--frame-text); background: color-mix(in srgb, var(--frame-selection) 50%, transparent); }
.settings-group { display: flex; flex-direction: column; gap: 1px; }
.settings-tab { display: flex; align-items: center; gap: 10px; height: calc(32px * var(--text-scale)); padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--frame-text); text-align: left; transition: background-color .15s; }
.settings-tab:hover { background: color-mix(in srgb, var(--frame-selection) 50%, transparent); }
.settings-tab.selected { background: var(--frame-selection); }
.pane-tile { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; flex: none; background: linear-gradient(180deg, color-mix(in srgb, var(--tile) 82%, #fff), var(--tile)); }
.settings-card { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.settings-head { display: flex; align-items: center; gap: 8px; height: var(--header); padding: 0 20px; border-bottom: 1px solid var(--hairline); flex: none; }
.settings-head h1 { margin: 0; font-size: calc(17px * var(--text-scale)); font-weight: 600; }
.settings-back { display: none; }
.settings-body { flex: 1; overflow-y: auto; padding: 20px 24px 40px; }
.settings-pane { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.settings-pane .form-section { gap: 10px; padding: 12px 14px; }
.settings-pane h4 { margin: 4px 0 0; font-size: calc(11px * var(--text-scale)); font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .4px; }
.settings-row { min-height: 30px; }
.form-section > .segmented { align-self: flex-start; }
.settings-row .field-label { width: auto; min-width: 150px; flex: 1; display: flex; flex-direction: column; color: var(--text); }
.settings-row .field-label .sub { margin-top: 1px; }
.settings-row select.field { flex: 0 1 260px; min-width: 160px; }
.settings-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.settings-actions.end { justify-content: flex-end; }
.settings-list { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.settings-line { margin: 0; }
.settings-loading { color: var(--text-2); }
.radio-list { display: flex; flex-direction: column; gap: 6px; }
.toggle-row { min-height: 26px; }
.toggle-row .grow { flex: 1; }

/* A switch, the Mac's toggle: the track the accent when on. */
input.switch { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--panel-pressed); position: relative; flex: none; margin: 0; transition: background-color .15s; cursor: default; }
input.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: left .15s; }
input.switch:checked { background: var(--accent); }
input.switch:checked::after { left: 16px; }
input.switch:disabled { opacity: .45; }

.settings-account { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--hairline); }
.settings-account:last-child { border-bottom: 0; }
.settings-account .mark { width: 24px; height: 24px; }
.settings-account .mark.bare img { width: 14px; height: 14px; }

.swatches { display: flex; flex-wrap: wrap; gap: 4px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 0; padding: 0; background: none; position: relative; }
.swatch::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--text) 18%, transparent); }
.swatch.on::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--text) 70%, transparent); }

.keycaps { display: inline-flex; gap: 3px; }
.keycap { font: 500 calc(11px * var(--text-scale)) var(--font); min-width: 22px; text-align: center; padding: 2px 5px; border-radius: 5px; background: color-mix(in srgb, var(--text) 7%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent); }
.shortcut-table { display: flex; flex-direction: column; }
.shortcut-row { border-bottom: 1px solid var(--hairline); padding: 3px 0; }
.shortcut-row:last-child { border-bottom: 0; }
.shortcut-row .keys { display: inline-flex; gap: 6px; align-items: center; }
.recorder { display: inline-flex; align-items: center; gap: 4px; }
.recorder .record { border: 0; background: none; padding: 2px; border-radius: 6px; }
.recorder .record:hover .keycap { background: color-mix(in srgb, var(--text) 12%, transparent); }
.recorder .press { display: inline-block; font-size: calc(11px * var(--text-scale)); font-weight: 500; color: var(--text-2); padding: 2px 8px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--accent); }
.recorder .clear { width: 22px; height: 22px; }
.fine.none { color: var(--text-3); }

.swipe-preview { display: flex; height: 54px; border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--outline); }
.swipe-preview .swipe-row { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 0 12px; background: var(--card); font-size: calc(11px * var(--text-scale)); color: var(--text-2); }
.swipe-preview .swipe-row strong { color: var(--text); font-size: calc(12px * var(--text-scale)); }
.swipe-button { width: 66px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #fff; font-size: calc(10px * var(--text-scale)); font-weight: 500; white-space: nowrap; }

.about-head { display: flex; align-items: center; gap: 12px; }
.about-name { font-weight: 700; }
.license-status .ok { color: var(--green); display: inline-flex; gap: 5px; align-items: center; }
.license-status .bad { color: var(--red); }
.license-key { font-family: var(--mono); }
.acknowledgements .ack { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--hairline); }
.acknowledgements .mit { line-height: 1.5; }
.per-account { display: flex; flex-direction: column; gap: 6px; padding-left: 12px; border-left: 2px solid var(--hairline); }
.receive-list .receive-line { padding: 4px 0; }
.receive-list .grow { flex: 1; min-width: 0; }

.segmented { display: inline-flex; border: 1px solid var(--outline); border-radius: 999px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: none; padding: 4px 12px; border-radius: 999px; color: var(--text-2); transition: color .15s, background-color .15s; }
.segmented button:hover { color: var(--text); }
.segmented button.on { background: var(--prominent); color: var(--prominent-text); }
.check-row { display: flex; gap: 8px; align-items: center; }

/* A phone: the list of panes is a page; a pane has Back to it. */
@media (max-width: 700px) {
    .settings { grid-template-columns: minmax(0, 1fr); padding: var(--gap); }
    .settings[data-view="pane"] .settings-nav { display: none; }
    .settings[data-view="list"] .settings-card { display: none; }
    .settings-back { display: inline-grid; }
    .settings-body { padding: 16px 16px 32px; }
    .settings-row .field-label { min-width: 0; flex-basis: 100%; }
    .settings-row select.field { flex: 1 1 100%; }
}

/* Drawn avatars (NotionistAvatar): the figure on its pastel, a hairline round it. */
.sender-badge.drawn { box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--outline) 60%, transparent); }
.sender-badge.drawn img { background: transparent; object-fit: contain; }

/* An accent of one's own reaches the list's names and subjects (Palette.listTitle). */
:root[data-accent] .row .from, :root[data-accent] .row .subject { color: var(--accent); }

/* ---------------------------------------------------------------- narrower windows */

.drawer-scrim { display: none; }

@media (max-width: 1100px) {
    :root { --sidebar-width: 200px !important; --list-width: 300px !important; }
}

@media (max-width: 900px) {
    .shell { grid-template-columns: var(--rail-width) 0 0 1fr 0 0 !important; padding-right: var(--gap); }
    .shell .divider { display: none; }
    .shell > .sidebar {
        position: fixed; left: var(--rail-width); top: 0; bottom: 0; width: 260px; z-index: 40; margin: 0;
        transform: translateX(-120%); visibility: hidden; transition: transform .2s ease, visibility .2s;
        box-shadow: var(--shadow);
    }
    :root[data-drawer="open"] .shell > .sidebar { transform: none; visibility: visible; }
    :root[data-drawer="open"] .drawer-scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 39; }
    .shell > .message-card { display: none; grid-column: 4; grid-row: 1; }
    :root[data-pane="message"] .list-card { display: none; }
    :root[data-pane="message"] .message-card { display: flex; }
    .back-button { display: inline-grid; }
    .reader-head { padding: 22px 24px 16px; }
    .notices, .images-bar { padding-left: 24px; padding-right: 24px; }
    .reader .rule { width: calc(100% - 48px); }
    .body { margin: 8px 8px 0; }
}

@media (max-width: 600px) {
    .shell { grid-template-columns: 0 0 0 1fr 0 0 !important; padding: var(--gap); }
    .shell > .rail { display: none; }
    :root[data-drawer="open"] .shell > .rail { display: flex; position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail-width); z-index: 41; margin: 0; }
    .shell > .sidebar { left: var(--rail-width); }
    .people { flex-wrap: wrap; }
    .people .when { width: 100%; }
    .tiles { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* A message in its own tab (/m/...): the message card alone on the frame. */
:root[data-standalone] .shell { grid-template-columns: 0 0 0 0 0 1fr !important; padding: var(--gap); }
:root[data-standalone] .shell > :not(.message-card) { display: none !important; }
:root[data-standalone] .shell > .message-card { display: flex !important; grid-column: 6; }

@media print {
    body { background: #fff; overflow: visible; }
    .shell { position: static; display: block; padding: 0; }
    .rail, .sidebar, .list-card, .divider, .toolbar, .quick-reply { display: none !important; }
}

/* web-compose */
/* ---------------------------------------------------------------- writing (js/compose, ui/compose.js) */

/* The composer over the message, in the right card. */
.message-card > .composer { position: absolute; inset: 0; z-index: 5; background: var(--card); display: flex; flex-direction: column; min-height: 0; }
.composer.dropping { box-shadow: inset 0 0 0 2px var(--accent); }
.compose-fields { display: flex; flex-direction: column; padding: 8px 20px 0; flex: none; }
.compose-row { display: flex; align-items: center; gap: 10px; min-height: 40px; border-bottom: 1px solid var(--hairline); }
.compose-row[hidden] { display: none; }
.compose-row .grow { flex: 1; }
.compose-label { width: 56px; flex: none; color: var(--text-2); font-size: calc(13px * var(--text-scale)); }
.from-button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--text); padding: 4px 8px; margin-left: -8px; border-radius: 8px; min-width: 0; transition: background-color .15s; }
.from-button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.from-button:hover { background: var(--tool-hover); }
.from-only { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.small-link { font-size: calc(12px * var(--text-scale)); white-space: nowrap; }
.small-link:disabled { color: var(--text-3); text-decoration: none; cursor: default; }
.small-link[hidden] { display: none; }
.subject-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: calc(14px * var(--text-scale)); font-weight: 500; height: 38px; }

/* The recipient chips and their suggestions. */
.recipient-field { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 5px 0; position: relative; cursor: text; }
.recipient-chips { display: contents; }
.recipient-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 280px; height: 24px; padding: 0 4px 0 10px; border-radius: 999px; border: 0; background: var(--pill); color: var(--text); font-size: calc(13px * var(--text-scale)); transition: background-color .12s; }
.recipient-chip:hover { background: var(--panel-deep); }
.recipient-chip:focus { outline: none; background: color-mix(in srgb, var(--accent) 22%, var(--pill)); }
.recipient-chip.invalid { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.recipient-chip .chip-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.recipient-chip .chip-x { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: var(--text-3); }
.recipient-chip .chip-x:hover { background: var(--tool-hover); color: var(--text); }
.recipient-input { flex: 1; min-width: 120px; border: 0; outline: 0; background: transparent; color: var(--text); height: 26px; font-size: calc(13px * var(--text-scale)); }
.suggestions { position: absolute; left: 0; top: 100%; z-index: 20; min-width: 280px; max-width: 440px; padding: 5px; background: var(--card); border: 1px solid var(--outline); border-radius: 10px; box-shadow: var(--shadow); }
.suggestions[hidden] { display: none; }
.suggestion { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; border-radius: 7px; cursor: default; min-width: 0; }
.suggestion.active { background: var(--row-selection); }
.suggestion .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.suggestion .email { color: var(--text-2); font-size: calc(12px * var(--text-scale)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* The formatting bar and the editor. */
.format-bar { display: flex; align-items: center; padding: 4px 14px; flex: none; }
.format-bar .tool { width: 30px; height: 30px; color: var(--text-2); }
.format-bar .tool::before { width: 26px; height: 26px; }
.format-bar .tool.on { color: var(--accent); }
.format-sep { width: 1px; height: 16px; background: var(--hairline); margin: 0 6px; }
.compose-editor { flex: 1; min-height: 120px; display: flex; padding: 0 8px; }
.editor-frame { border: 0; width: 100%; flex: 1; display: block; background: transparent; }

/* Attachments, the reason a message can not go, the actions. */
.compose-attachments { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 20px; flex: none; }
.compose-attachments[hidden] { display: none; }
.compose-attachment { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; height: 30px; padding: 0 4px 0 10px; border: 1px solid var(--outline); border-radius: 9px; background: var(--card); font-size: calc(12px * var(--text-scale)); }
.compose-attachment .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.compose-attachment .size { color: var(--text-3); white-space: nowrap; }
.compose-attachment button { border: 0; background: none; padding: 4px; color: var(--text-2); display: grid; place-items: center; border-radius: 6px; }
.compose-attachment button:hover { background: var(--tool-hover); color: var(--text); }
.compose-error { display: flex; align-items: flex-start; gap: 8px; margin: 0 20px 8px; padding: 8px 10px; border-radius: 9px; color: var(--red); background: color-mix(in srgb, var(--red) 9%, transparent); font-size: calc(12px * var(--text-scale)); flex: none; }
.compose-error[hidden] { display: none; }
.compose-error .text { flex: 1; user-select: text; overflow-wrap: anywhere; }
.compose-error .dismiss { border: 0; background: none; padding: 2px; color: inherit; display: grid; place-items: center; border-radius: 5px; }
.compose-error .dismiss:hover { background: color-mix(in srgb, var(--red) 14%, transparent); }
.compose-actions { display: flex; align-items: center; gap: 8px; padding: 10px 14px; flex: none; }
.compose-actions .spacer { flex: 1; }
.compose-actions .tool[hidden] { display: none; }

/* Send, whose words become the wait: Undo Send with the ring, then Sending, then Sent. */
.send-button { display: inline-grid; align-items: center; height: 36px; min-width: 112px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--prominent); color: var(--prominent-text); font-weight: 600; transition: background-color .15s; --ring-ground: var(--prominent); }
.send-button:hover:not(:disabled) { background: color-mix(in srgb, var(--prominent) 88%, var(--card)); --ring-ground: color-mix(in srgb, var(--prominent) 88%, var(--card)); }
.send-button:disabled { opacity: 1; }
.send-button[data-stage="gone"] { background: var(--green); color: #fff; }
.send-state { grid-area: 1 / 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; visibility: hidden; white-space: nowrap; }
.send-state.on { visibility: visible; }
.send-state .key { font-weight: 500; opacity: .6; font-size: calc(12px * var(--text-scale)); }
.ring {
    --left: 1; width: 20px; height: 20px; border-radius: 50%; flex: none; position: relative; display: inline-grid; place-items: center;
    background: conic-gradient(currentColor calc(var(--left) * 360deg), color-mix(in srgb, currentColor 22%, transparent) 0);
}
.ring::before { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: var(--ring-ground, var(--card)); }
.ring-number { position: relative; font-size: 10px; font-weight: 700; line-height: 1; }
.toast .toast-ring { --ring-ground: var(--toast); color: var(--toast-text); }
.later-line { margin: 0; color: var(--text-2); }

/* A message being written in a tab of its own (/compose/<id>): the card alone. */
:root[data-compose-standalone] .shell { grid-template-columns: 0 0 0 0 0 1fr !important; padding: var(--gap); }
:root[data-compose-standalone] .shell > :not(.message-card) { display: none !important; }
:root[data-compose-standalone] .shell > .message-card { display: flex !important; grid-column: 6; }

/* Quick reply: a line that grows to six. */
.quick-reply .quick-suggest { display: flex; gap: 6px; margin-bottom: 8px; }
.quick-reply .quick-box { align-items: center; padding: 6px 6px 6px 8px; }
.quick-reply .quick-box.tall { align-items: flex-end; border-radius: 18px; }
.quick-reply .quick-input { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--text); font: inherit; line-height: 20px; padding: 6px 0; max-height: 128px; overflow-y: auto; }
.quick-reply .quick-ai, .quick-reply .quick-send { width: 32px; height: 32px; flex: none; border: 0; border-radius: 50%; display: grid; place-items: center; transition: background-color .15s; }
.quick-reply .quick-ai { background: none; color: var(--text-3); }
.quick-reply .quick-send { background: var(--prominent); color: var(--prominent-text); }
.quick-reply .quick-send:disabled { background: var(--pill); color: var(--text-3); }
.quick-reply .quick-ai:disabled { opacity: .5; }
.quick-reply .quick-failure { margin-top: 6px; color: var(--red); font-size: calc(12px * var(--text-scale)); }
.quick-reply .quick-failure[hidden] { display: none; }

/* Contacts, Notes, Templates, Scheduled: a list card and a detail card in place of the mail's. */
:root[data-compose-pane] .shell > .list-card,
:root[data-compose-pane] .shell > .divider.list-divider,
:root[data-compose-pane] .shell > .message-card { display: none !important; }
.shell > .compose-pane { grid-column: 4 / 7; grid-row: 1; display: none; grid-template-columns: var(--list-width) minmax(320px, 1fr); gap: var(--gap); min-width: 0; min-height: 0; }
:root[data-compose-pane] .shell > .compose-pane { display: grid; }
.pane-list, .pane-detail { min-height: 0; }
.pane-search { margin: 10px 14px 6px; }
.pane-rows { flex: 1; overflow-y: auto; outline: none; overscroll-behavior: contain; display: flex; flex-direction: column; padding-bottom: 8px; }
.pane-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; margin: 0 6px; border-radius: var(--row-radius); cursor: default; transition: background-color .12s; flex: none; }
.pane-row:hover { background: var(--row-hover); }
.pane-row.selected { background: var(--row-selection); }
.pane-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pane-row .line1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.pane-row .who { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane-row .date { color: var(--text-3); font-size: calc(12px * var(--text-scale)); white-space: nowrap; flex: none; }
.pane-row .line2, .pane-row .line3 { color: var(--text-2); font-size: calc(12px * var(--text-scale)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.pane-row .line2.subject-line-small { color: var(--text); }
.pane-row .failed, .scheduled-detail .failed { color: var(--red); }
.pill.tiny { font-size: calc(10px * var(--text-scale)); padding: 1px 6px; }
.pane-more { text-align: center; padding: 10px; }
.fine { color: var(--text-3); font-size: calc(11px * var(--text-scale)); margin: 0; }
.pane-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.scheduled-clock { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--pill); color: var(--text-2); flex: none; }
.scheduled-clock.failed { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }

.contact-card { max-width: 560px; margin: 0 auto; padding: 32px 28px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.contact-card h1 { margin: 6px 0 0; font-size: calc(22px * var(--text-scale)); font-weight: 600; overflow-wrap: anywhere; }
.contact-card .muted { margin: 0; color: var(--text-2); }
.contact-badge, .contact-badge .sender-badge { width: 64px; height: 64px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 8px 0; }
.heading-dark { align-self: stretch; text-align: left; margin: 14px 0 2px; font-size: calc(13px * var(--text-scale)); font-weight: 600; }
.recent-list { align-self: stretch; display: flex; flex-direction: column; }
.recent-row { display: flex; gap: 12px; align-items: baseline; border: 0; background: none; color: var(--text); text-align: left; padding: 8px 10px; border-radius: 8px; transition: background-color .12s; }
.recent-row:hover { background: var(--row-hover); }
.recent-row .subject { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-row .date { color: var(--text-3); font-size: calc(12px * var(--text-scale)); white-space: nowrap; }

.note-editor { flex: 1; border: 0; outline: 0; resize: none; padding: 22px 28px; background: transparent; color: var(--text); font: inherit; font-size: calc(14px * var(--text-scale)); line-height: 1.5; }
.template-form { max-width: 720px; margin: 0 auto; padding: 22px 28px; display: flex; flex-direction: column; gap: 10px; }
.template-form .template-body { min-height: 220px; }
.template-form .compose-attachments { padding: 0; }
.scheduled-detail { max-width: 720px; margin: 0 auto; padding: 26px 32px; display: flex; flex-direction: column; gap: 14px; }
.scheduled-detail h1 { margin: 0; font-size: calc(22px * var(--text-scale)); font-weight: 600; overflow-wrap: anywhere; }
.scheduled-detail .sends { display: flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 500; }
.scheduled-detail p { margin: 0; }
.scheduled-lines { display: flex; flex-direction: column; gap: 6px; }
.scheduled-line { display: flex; gap: 10px; }
.scheduled-line .label { width: 70px; flex: none; color: var(--text-2); }
.scheduled-line .value { flex: 1; min-width: 0; overflow-wrap: anywhere; user-select: text; }
.scheduled-body { white-space: pre-wrap; user-select: text; overflow-wrap: anywhere; line-height: 1.5; }
.feedback-sent { align-items: center; text-align: center; padding-bottom: 6px; }
.feedback-sent .i { color: var(--green); }

@media (max-width: 900px) {
    .shell > .compose-pane { grid-column: 4; grid-template-columns: 1fr; }
    .compose-pane > .pane-detail { display: none; }
    :root[data-pane-detail] .compose-pane > .pane-list { display: none; }
    :root[data-pane-detail] .compose-pane > .pane-detail { display: flex; }
    .compose-fields { padding: 6px 14px 0; }
    .compose-label { width: 48px; }
}

/* ---- F3: What's New (WhatsNewView.swift) ---- */
.whatsnew { --fixed: #EA580C; }
.whatsnew .release { display: flex; flex-direction: column; gap: 8px; }
.whatsnew .release + .release { border-top: 1px solid var(--hairline); padding-top: 14px; }
.whatsnew .release-head { display: flex; align-items: baseline; gap: 8px; font-size: calc(14px * var(--text-scale)); }
.whatsnew .release-head .date { color: var(--text-3); font-size: calc(12px * var(--text-scale)); }
.whatsnew .release-item { display: flex; align-items: baseline; gap: 8px; line-height: 1.45; }
.whatsnew .release-tag { flex: none; font-size: calc(10px * var(--text-scale)); font-weight: 600; padding: 2px 6px; border-radius: 999px; }
.whatsnew .tag-new { color: var(--green); background: color-mix(in srgb, var(--green) 16%, transparent); }
.whatsnew .tag-changed { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.whatsnew .tag-fixed { color: var(--fixed); background: color-mix(in srgb, var(--fixed) 16%, transparent); }
.general-extras { display: flex; flex-direction: column; gap: 8px; }

/* ---- F4: Sign in with Microsoft ---- */
.oauth-fields { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0 0; font-size: calc(12px * var(--text-scale)); }
.oauth-fields dt { color: var(--text-2); font-weight: 500; }
.oauth-fields dd { margin: 0; word-break: break-word; user-select: text; }
.form-row.microsoft-again { display: flex; align-items: center; gap: 12px; justify-content: space-between; }

/* ---------------------------------------------------------------- swipe and pull on touch (ui/rowswipe.js) */

.rows { overflow-x: hidden; }
.rows .row { touch-action: pan-y; }
.row.swiping { background: var(--card); z-index: 2; transition: transform .16s ease-out; }
.row.swiping:active { transition: none; }
.swipe-tray { position: absolute; left: 0; right: 0; display: flex; z-index: 1; overflow: hidden; }
.swipe-tray.right { justify-content: flex-start; }
.swipe-tray.left { justify-content: flex-end; }
.swipe-tray .swipe-button { border: 0; transition: flex-grow .16s; }
.swipe-tray.right.full .swipe-button:first-child, .swipe-tray.left.full .swipe-button:last-child { flex-grow: 1; }
.pull-indicator { height: 0; overflow: hidden; display: grid; place-items: center; color: var(--text-3); flex: none; transition: height .16s; }
.pull-indicator.on { height: var(--pull, 0); transition: none; }
.pull-indicator.ready { color: var(--accent); }
.pull-indicator.ready .i { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
    .row.swiping, .pull-indicator, .swipe-tray .swipe-button { transition: none; }
}

/* ---------------------------------------------------------------- print (js/print.js) */

.print-frame { position: fixed; left: -10000px; top: 0; width: 680px; height: 900px; border: 0; }

/* ---------------------------------------------------------------- screenshot (js/screenshot/) */

.shot-layer { position: fixed; inset: 0; z-index: 70; background: var(--scrim); display: grid; place-items: center; padding: 16px; }
.shot-panel { width: min(1000px, 100%); height: min(860px, 100%); background: var(--card); border: 1px solid var(--card-edge); border-radius: var(--card-radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; outline: none; }
.shot-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--hairline); }
.shot-bar .spacer { flex: 1; }
.shot-sub { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--hairline); color: var(--text-2); font-size: calc(12px * var(--text-scale)); }
.shot-sub .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.shot-sub .spacer { flex: 1; }
.shot-scroll { flex: 1; overflow: auto; background: var(--panel-deep); padding: 24px; }
.shot-scroll .shot-root { width: max-content; margin: 0 auto; }
.tool.labeled { width: auto; padding: 0 10px; gap: 6px; display: inline-flex; align-items: center; border-radius: 999px; }
.tool.labeled::before { width: calc(100% - 6px); border-radius: 999px; }
.tool.labeled span { position: relative; font-size: calc(12px * var(--text-scale)); font-weight: 500; }
.shot-tints { display: inline-flex; gap: 4px; }
.shot-tint { width: 22px; height: 22px; border-radius: 50%; border: 0; background: none; position: relative; padding: 0; }
.shot-tint::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--swatch); }
.shot-tint.on::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--text); }
.segmented.small button { padding: 3px 10px; font-size: calc(12px * var(--text-scale)); }
@media (max-width: 700px) {
    .shot-layer { padding: 0; }
    .shot-panel { height: 100%; border-radius: 0; }
    .shot-scroll { padding: 8px; }
}

/* ---------------------------------------------------------------- reading polish (F6) */

.warm-frame { position: fixed; left: -10000px; top: 0; width: 640px; height: 400px; border: 0; visibility: hidden; pointer-events: none; }
.translation { margin: 8px 28px 0; padding: 10px 12px; border-radius: 10px; background: var(--pill); display: flex; flex-direction: column; gap: 8px; }
.translation-head { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: calc(12px * var(--text-scale)); }
.translation-head .grow { flex: 1; }
.translation-text { white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; font-size: calc(14px * var(--text-scale)); line-height: 1.5; }
.reader .thread > .show-older { align-self: center; margin: 6px auto 10px; display: flex; }
.palette-row.command { display: flex; align-items: center; gap: 10px; }
.palette-row.command .grow { flex: 1; text-align: left; }

/* ---------------------------------------------------------------- more contrast, less motion (F6 accessibility) */

@media (prefers-contrast: more) {
    :root { --text-2: #4d4d4d; --text-3: #5c5c5c; --hairline: #c8c8c8; --outline: #9a9a9a; --frame-muted: #c4c4c4; --pill-text: #3d3d3d; }
    :root[data-theme="dark"] { --text-2: #d0d0d0; --text-3: #bdbdbd; --hairline: #5a5a5a; --outline: #7a7a7a; --pill-text: #e0e0e0; }
    /* A label chip drops its tint for the text colour and a border. */
    .chip { color: var(--text) !important; background: transparent !important; box-shadow: inset 0 0 0 1px currentColor; }
    .pill, .segmented, .tools { box-shadow: inset 0 0 0 1px var(--outline); }
    .row.selected::before { box-shadow: inset 0 0 0 2px var(--accent); }
    .srow.selected { box-shadow: inset 0 0 0 1px var(--frame-text); }
    :focus-visible { outline-width: 3px; }
}

@media (prefers-reduced-motion: reduce) {
    .settings-tab, .settings-mail, input.switch, input.switch::after, .segmented button, .tool::before { transition: none !important; }
    .drawer-scrim, .shell > .sidebar { transition: none !important; }
}

/* ---------------------------------------------------------------- signature editor (ui/signatureeditor.js) */

.signature-editor { display: flex; flex-direction: column; gap: 6px; }
.signature-bar { display: flex; align-items: center; gap: 8px; }
.signature-bar .grow { flex: 1; }
.signature-bar .tool.small { width: 30px; height: 30px; }
.signature-area { min-height: 72px; max-height: 220px; overflow-y: auto; padding: 8px 10px; height: auto; line-height: 1.45; user-select: text; white-space: normal; }
.signature-source { font-family: var(--mono); font-size: calc(12px * var(--text-scale)); }
