gsmol/web/style.css

629 lines
23 KiB
CSS
Raw Normal View History

2026-10-09 13:47:42 +03:00
/* Every colour is a token, so the dark palette at the foot of this file needs
only to re-point them — no rule is written twice. */
/* One declaration per token: light-dark() picks a side from the resolved
color-scheme, so the theme toggle only has to change `color-scheme` and no
rule below ever needs a dark twin. */
:root {
color-scheme: light dark;
--bg: light-dark(#f4f6fa, #121316);
--surface: light-dark(#ffffff, #1c1e22);
/* A second surface for rails and inset cards, so nesting reads without a
second border everywhere. */
--raised: light-dark(#fafbfd, #23262b);
--fg: light-dark(#1b1c1f, #e6e8ec);
--muted: light-dark(#5e6572, #9ba1ad);
--border: light-dark(#e1e4ea, #333740);
--divider: light-dark(#eef0f4, #262930);
/* Both sides clear AA on --surface, --bg and --accent-soft alike, which is
what the compose pill, the active folder, the tab rail and the setup
checklist all need. */
--accent: light-dark(#3a55c8, #9db1ff);
--accent-soft: light-dark(#eceffd, #242a3e);
--on-accent: light-dark(#ffffff, #0e1430);
--hover: light-dark(#f1f3f7, #262a31);
--warn: light-dark(#c5221f, #f28b82);
--on-warn: light-dark(#ffffff, #3c0d0a);
--ok-bg: light-dark(#e6f4ea, #1d3826);
--ok-fg: light-dark(#137333, #81c995);
--alert-bg: light-dark(#feefc3, #3d3520);
--alert-fg: light-dark(#7a4f01, #fdd663);
--toast-bg: light-dark(#1b1c1f, #e6e8ec);
--toast-fg: light-dark(#e6e8ec, #1b1c1f);
--backdrop: light-dark(rgba(27, 28, 31, 0.34), rgba(0, 0, 0, 0.62));
--shadow-near: light-dark(rgba(23, 26, 38, 0.10), rgba(0, 0, 0, 0.50));
--shadow-far: light-dark(rgba(23, 26, 38, 0.08), rgba(0, 0, 0, 0.34));
--ui: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
--mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
/* Cards and dialogs take --radius; anything hit-sized takes --radius-sm, so
a small button never wears a curve it is too short to carry. */
--radius: 12px;
--radius-sm: 8px;
--radius-pill: 999px;
--shadow: 0 1px 2px var(--shadow-near), 0 6px 18px -8px var(--shadow-far);
--shadow-lg: 0 2px 6px var(--shadow-near), 0 24px 56px -16px var(--shadow-far);
}
/* The toggle pins a side; without the attribute the system decides. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
margin: 0;
display: flex;
flex-direction: column;
height: 100vh;
height: 100dvh; /* mobile browser chrome eats the last row of 100vh */
font: 14px/1.55 var(--ui);
color: var(--fg);
background: var(--surface);
}
button {
font: inherit;
border: 0;
border-radius: var(--radius-sm);
background: none;
color: var(--accent);
padding: 7px 14px;
cursor: pointer;
white-space: nowrap;
transition: background-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
button:hover { background: var(--hover); }
button:disabled { color: var(--muted); cursor: default; }
button:disabled:hover { background: none; }
/* Line icons from the sprite in index.html; they take their colour from the
button, so no icon needs a palette of its own. */
.sprite { display: none; }
.icon {
width: 18px;
height: 18px;
flex: none;
fill: none;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
}
.icon-only { padding: 8px; display: inline-flex; }
input, textarea {
font: inherit;
padding: 8px 11px;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
background: var(--surface);
color: var(--fg);
}
/* Keyboard focus was invisible: buttons carry no border and the input ring used
--accent-soft, which is near-white on white. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
details > summary {
width: fit-content;
padding: 2px 0;
font-size: 12px;
color: var(--muted);
cursor: pointer;
}
details > summary:hover { color: var(--accent); }
/* --- top bar --------------------------------------------------------------- */
.topbar {
display: flex;
align-items: center;
gap: 16px;
padding: 11px 18px;
border-bottom: 1px solid var(--border);
}
.brand { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.search {
flex: 1;
min-width: 0; /* an input's intrinsic size is its flex floor otherwise, and it overflows narrow bars */
max-width: 640px;
margin: 0 auto;
background: var(--hover);
border: 0;
border-radius: var(--radius-pill);
padding: 9px 16px;
}
.search:focus { background: var(--surface); outline: 2px solid var(--accent); }
.top-actions { display: flex; align-items: center; gap: 4px; }
.top-actions .icon-only { color: var(--muted); }
.top-actions .icon-only:hover { color: var(--fg); }
.account { font-size: 13px; color: var(--muted); margin-right: 4px; }
.avatar {
width: 32px;
height: 32px;
border-radius: 50%;
background: var(--accent);
color: var(--on-accent);
font-size: 15px;
font-weight: 500;
display: flex;
align-items: center;
justify-content: center;
user-select: none;
}
/* --- layout ------------------------------------------------------------------ */
main { flex: 1; min-height: 0; display: flex; background: var(--bg); }
.rail {
width: 200px;
padding: 12px 8px;
background: var(--surface);
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
gap: 4px;
}
/* The one primary action here, so it carries a solid fill rather than the soft
one it shares with selected rows — and its box edge lines up with the folder
buttons below, so the rail reads as a single column. */
.compose {
align-self: stretch;
display: flex;
align-items: center;
gap: 14px;
margin: 2px 0 18px;
padding: 12px 16px;
border-radius: var(--radius-pill);
background: var(--accent);
color: var(--on-accent);
font-weight: 500;
}
.compose:hover { background: var(--accent); box-shadow: var(--shadow); }
#folders button {
display: flex;
align-items: center;
gap: 14px;
width: 100%;
text-align: left;
padding: 9px 16px;
color: var(--fg);
font-weight: 500;
}
#folders .label { flex: 1; }
#folders button:hover { background: var(--hover); }
#folders button.active { background: var(--accent-soft); color: var(--accent); }
#folders .count { color: var(--accent); font-weight: 500; margin-left: 8px; }
.listpane {
display: flex;
flex-direction: column;
min-width: 360px;
max-width: 460px;
background: var(--surface);
border-right: 1px solid var(--border);
}
.list { flex: 1; min-height: 0; overflow-y: auto; }
/* Fetch acts on the mailbox, so it sits over the mailbox rather than in the
account cluster — and it can stand down in the contacts folder. */
.toolbar {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 8px 6px 12px;
border-bottom: 1px solid var(--border);
}
.toolbar .tools { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.toolbar .primary { display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 500; }
#import-form input {
flex: 1;
min-width: 0; /* an input's intrinsic width is its flex floor otherwise */
font-family: var(--mono);
font-size: 12px;
padding: 5px 10px;
}
/* The fetch icon turns while a session is open. */
.toolbar .primary:disabled .icon { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .toolbar .primary:disabled .icon { animation: none; } }
.list-status { margin-left: auto; padding-right: 6px; font-size: 12px; color: var(--muted); }
/* Message rows are <button>, so they are reachable and openable from the
keyboard; the generic button styling above is undone here. */
.item {
display: flex;
gap: 12px;
align-items: baseline;
width: 100%;
padding: 9px 16px;
text-align: left;
border: 0;
border-bottom: 1px solid var(--divider);
border-radius: 0;
background: var(--surface);
cursor: pointer;
color: var(--muted);
}
.item:hover { background: var(--hover); }
.item.selected { background: var(--accent-soft); }
.item.unread { color: var(--fg); }
.item .who { width: 150px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .mid { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .subject { font-weight: 400; }
.item.unread .who { font-weight: 700; }
.item.unread .subject { font-weight: 700; }
.item .snippet { color: var(--muted); }
.item.unread .snippet { color: var(--fg); }
.item .when { flex: none; font-size: 12px; color: var(--muted); }
.item button { padding: 2px 12px; font-size: 12px; }
.item.contact .mid { white-space: normal; line-height: 1.45; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.item.contact .badge + .badge { margin-left: 6px; }
/* A sender whose key is bound to no address, visible before opening the row. */
.item .dot {
display: inline-block;
width: 6px;
height: 6px;
margin-left: 6px;
border-radius: 50%;
background: var(--alert-fg);
}
.badge {
display: inline-block;
margin-top: 3px;
font-family: var(--ui);
font-size: 11px;
padding: 1px 9px;
border-radius: 10px;
background: var(--hover);
color: var(--muted);
}
.badge.ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge.alert { background: var(--alert-bg); color: var(--alert-fg); }
.view { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 28px; }
.view h2 { margin: 0 0 10px; font-size: 20px; font-weight: 400; }
.view .meta { font-size: 13px; color: var(--muted); margin-bottom: 14px; white-space: pre-line; word-break: break-word; }
.view .fields { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 10px; white-space: pre-line; }
.view pre {
white-space: pre-wrap;
overflow-wrap: anywhere; /* an unbroken URL must not widen the reader */
font-family: inherit;
margin: 14px 0 0;
padding: 14px 0 0;
border-top: 1px solid var(--border);
}
.view .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.view .actions button { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--fg); }
.view .actions button:hover { background: var(--hover); color: var(--fg); }
/* Only meaningful once the reader covers the list, below the breakpoint. */
.back { display: none; align-items: center; gap: 6px; margin: 0 0 10px -8px; }
/* What is actually known about the signer: a signature always verifies here, so
the chip reports the key-to-address binding, which is the part that can be weak. */
.trust { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.trust .keyblock { font-family: var(--mono); font-size: 12px; line-height: 1.55; color: var(--muted); }
.trust .keyblock .full { word-break: break-all; }
/* Superseded contact keys: the local record that a rotation happened. */
.history { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 14px; }
.history h3 {
margin: 0 0 4px;
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--muted);
}
.history .keyblock { margin-top: 12px; font-family: var(--mono); font-size: 12px; color: var(--muted); line-height: 1.55; }
.history .keyblock .full { word-break: break-all; }
.history .replaced { font-family: var(--ui); font-style: italic; }
.warn { color: var(--warn); }
.placeholder { color: var(--muted); font-style: italic; padding: 12px 16px; }
.name-sender { display: flex; gap: 8px; margin: 12px 0 0; }
.name-sender input { flex: 1; }
/* --- setup -------------------------------------------------------------------- */
/* One card at a time: "create" and "restore" are the same question asked two
ways, and showing both at once was most of what made first run look busy. */
.setup {
flex-direction: column;
align-items: center;
justify-content: center;
background: var(--bg);
padding: 24px 16px;
overflow-y: auto;
}
.setup-card {
width: min(440px, 100%);
display: flex;
flex-direction: column;
gap: 14px;
padding: 28px 28px 18px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
box-shadow: var(--shadow);
}
.setup-card h2 {
margin: 0;
font-size: 22px;
font-weight: 600;
letter-spacing: -0.02em;
text-align: center;
}
.setup-card .lead { margin: 0; color: var(--muted); text-align: center; }
.setup-card .stack { display: flex; flex-direction: column; gap: 14px; }
.setup-card label {
display: flex;
flex-direction: column;
gap: 5px;
font-size: 12px;
color: var(--muted);
}
.setup-card label input { font-family: var(--mono); font-size: 13px; }
#restore-extra label { margin-top: 10px; }
.hint.centered { text-align: center; }
.large { padding: 11px 20px; font-size: 15px; }
/* The quieter sibling of a card's one real action, not a second one. */
.link {
align-self: center;
padding: 6px 8px;
font-size: 13px;
color: var(--muted);
text-decoration: underline;
text-underline-offset: 3px;
}
.link:hover { color: var(--accent); background: none; }
/* A two-way choice feeding one piece of state (screen 5's new/existing
address mode) — same shape as .settings-tabs, laid out horizontally. */
.mode-toggle {
display: flex;
gap: 2px;
padding: 3px;
background: var(--raised);
border-radius: var(--radius);
}
.mode-toggle button {
flex: 1;
padding: 8px 10px;
font-size: 13px;
font-weight: 500;
color: var(--fg);
border-radius: calc(var(--radius) - 3px);
}
.mode-toggle button:hover { background: var(--hover); }
.mode-toggle button.active { background: var(--accent-soft); color: var(--accent); }
/* --- dialogs --------------------------------------------------------------------- */
dialog {
border: 0;
border-radius: var(--radius);
box-shadow: var(--shadow-lg);
padding: 0;
color: var(--fg);
background: var(--surface);
min-width: min(460px, calc(100vw - 32px));
max-width: min(640px, calc(100vw - 32px));
max-height: calc(100dvh - 48px);
overflow: hidden;
}
dialog::backdrop { background: var(--backdrop); }
.dialog-head {
display: flex;
align-items: center;
gap: 12px;
padding: 13px 12px 13px 22px;
border-bottom: 1px solid var(--border);
}
.dialog-head h2 { flex: 1; margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.dialog-head .icon-only { color: var(--muted); }
.dialog-head .icon-only:hover { color: var(--fg); }
/* The recovery card can push content past the viewport on a short window;
dialog's own overflow:hidden would just clip it with no way back. */
#compose { overflow-y: auto; }
#compose form { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; }
#compose input, #compose textarea { width: 100%; }
#compose textarea { font-family: inherit; resize: vertical; }
#compose .seed-card { margin: 0; }
#compose .actions { display: flex; gap: 8px; margin: 4px 0; }
#compose footer { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding-top: 4px; flex-wrap: wrap; }
#compose .anon { font-size: 13px; color: var(--muted); margin-right: auto; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
#confirm { max-width: min(420px, calc(100vw - 32px)); }
#confirm .confirm-body { padding: 22px 22px 4px; }
#confirm .confirm-body h2 { margin: 0 0 8px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
#confirm .confirm-body p { margin: 0; font-size: 13px; color: var(--muted); white-space: pre-wrap; }
#confirm footer { display: flex; gap: 8px; justify-content: flex-end; padding: 18px 22px 22px; }
/* Without this every action read exactly like "cancel" and "close". */
.filled { background: var(--accent); color: var(--on-accent); font-weight: 500; padding: 8px 20px; }
.filled:hover { background: var(--accent); box-shadow: var(--shadow); }
.filled:disabled { background: var(--hover); color: var(--muted); box-shadow: none; }
/* Irreversible, not just consequential — rotate stays plain-text, this doesn't. */
.danger { background: var(--warn); color: var(--on-warn); font-weight: 500; padding: 8px 20px; }
.danger:hover { background: var(--warn); box-shadow: var(--shadow); }
.error { color: var(--warn); font-size: 13px; }
/* A secondary action standing on its own under a paragraph: the border is what
stops its padding from reading as a stray indent. */
.outline { border: 1px solid var(--border); background: var(--surface); color: var(--fg); font-weight: 500; }
.outline:hover { background: var(--hover); box-shadow: var(--shadow); }
/* --- settings -------------------------------------------------------------------- */
/* Tabs, because the account, the server, a mailbox preference, the backup file
and the irreversible operations have nothing to say to each other — reading
all five in one scroll was the overwhelming part. Scoped to [open]: a bare
`display: flex` would override the UA's `display: none` on a closed dialog. */
#settings { max-width: min(760px, calc(100vw - 32px)); }
#settings[open] { display: flex; flex-direction: column; }
.settings-body { flex: 1; min-height: min(440px, 58dvh); display: flex; align-items: stretch; }
.settings-tabs {
flex: none;
width: 148px;
display: flex;
flex-direction: column;
gap: 2px;
padding: 12px 8px;
background: var(--raised);
border-right: 1px solid var(--border);
}
.settings-tabs button {
width: 100%;
padding: 8px 12px;
text-align: left;
color: var(--fg);
font-weight: 500;
}
.settings-tabs button:hover { background: var(--hover); }
.settings-tabs button.active { background: var(--accent-soft); color: var(--accent); }
.settings-panels { flex: 1; min-width: 0; overflow-y: auto; padding: 20px 24px 24px; }
#settings h3 {
margin: 24px 0 8px;
font-size: 12px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--muted);
}
#settings h3:first-child { margin-top: 0; }
#settings .danger-head { color: var(--warn); }
#settings form { display: flex; gap: 10px; margin: 12px 0 6px; flex-wrap: wrap; align-items: flex-end; }
#settings label {
display: flex;
flex-direction: column;
gap: 5px;
flex: 1;
min-width: 170px;
font-size: 12px;
color: var(--muted);
}
#settings label input { font-family: var(--mono); font-size: 13px; }
#settings details { margin: 12px 0 2px; }
/* A checkbox with a multi-line label, e.g. "leave mail on server" — the box
sits at the label's cap height rather than centered against the full wrapped
block, which is what made it look adrift. */
#settings label.check-row { flex-direction: row; align-items: flex-start; gap: 10px; flex: none; }
#settings label.check-row input { flex: none; margin: 3px 0 0; }
.check-row .check-title { display: block; color: var(--fg); font-size: 14px; }
.check-row .hint { display: block; margin: 2px 0 0; }
.hint { font-size: 12px; color: var(--muted); margin: 4px 0; }
/* label / value rows, in place of the monospace `key: value` dump */
.field { display: flex; align-items: baseline; gap: 12px; padding: 4px 0; }
.field-label { flex: none; width: 96px; font-size: 12px; color: var(--muted); }
.field-value { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; word-break: break-all; }
.field-value.empty { font-family: inherit; font-style: italic; color: var(--muted); }
.seed-card { border: 1px solid var(--warn); border-radius: var(--radius); padding: 12px 14px; margin: 4px 0 12px; }
.seed-card .row { display: flex; align-items: center; gap: 8px; }
.seed-card .seed { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; word-break: break-all; }
.seed-card p { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
/* A button whose result is explained underneath rather than beside it — each
of export/import needs its own line, so side-by-side ran out of room. */
.action-row { margin: 14px 0; }
.action-row .hint { margin: 4px 0 0; }
/* A title/subtitle pair with a control at the end, e.g. the timeout spinner —
same shape as .check-row but for a value instead of a toggle. */
.spin-row { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.spin-row .spin-text { flex: 1; min-width: 0; }
.spin-row .spin-text .check-title { display: block; }
.spin-row .spin-text .hint { display: block; margin: 2px 0 0; }
.spin-row input[type="number"] { width: 72px; font-family: var(--mono); font-size: 13px; text-align: right; }
.copy { font-size: 12px; padding: 4px 10px; }
/* --- toast ------------------------------------------------------------------------ */
.toast {
position: fixed;
left: 24px;
bottom: 24px;
max-width: 520px;
margin: 0;
padding: 12px 18px;
border-radius: var(--radius);
background: var(--toast-bg);
color: var(--toast-fg);
font-size: 13px;
white-space: pre-wrap;
box-shadow: var(--shadow);
cursor: pointer;
}
.toast.warn { background: var(--warn); color: var(--on-warn); }
.toast[hidden] { display: none; }
/* --- narrow layouts ----------------------------------------------------------------- */
/* The reader takes the whole pane and the list steps aside, rather than both
being squeezed below the width either one needs. */
@media (max-width: 1000px) {
.listpane { flex: 1; min-width: 0; max-width: none; border-right: 0; }
.view { display: none; }
#app.reading .listpane { display: none; }
#app.reading .view { display: block; }
.back { display: inline-flex; }
}
@media (max-width: 640px) {
main { flex-direction: column; }
.rail {
width: auto;
flex-direction: row;
align-items: center;
gap: 8px;
padding: 8px;
overflow-x: auto;
border-right: 0;
border-bottom: 1px solid var(--border);
}
.compose { margin: 0; padding: 8px 20px; }
.compose { align-self: center; }
#folders { display: flex; gap: 4px; }
#folders button { width: auto; gap: 8px; padding: 9px 12px; }
#folders .label { display: none; } /* aria-label keeps the accessible name */
.topbar { gap: 8px; padding: 8px 12px; }
.search { max-width: none; padding: 6px 12px; }
.account { display: none; }
.item .who { width: auto; flex: 0 1 110px; }
.view { padding: 16px; }
.toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
.setup-card { padding: 22px 18px 14px; }
/* The tab rail turns into a scrollable strip rather than eating half the
width of a phone-sized dialog. */
.settings-body { flex-direction: column; min-height: 0; }
.settings-tabs {
width: auto;
flex-direction: row;
overflow-x: auto;
padding: 8px;
border-right: 0;
border-bottom: 1px solid var(--border);
}
.settings-tabs button { width: auto; }
.settings-panels { padding: 16px 16px 20px; }
.dialog-head { padding: 12px 8px 12px 16px; }
}
@media (prefers-reduced-motion: reduce) {
button { transition: none; }
}