/* Customer cabinet. Plain CSS, system fonts, light and dark themes (by the system or chosen). */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --border: #e1e4e9;
  --text: #16181d;
  --muted: #5b616e;
  --accent: #0e6b5c;
  --accent-hover: #0b5a4d;
  --on-accent: #ffffff;
  --accent-soft: #e3f1ee;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #8a5a00;
  --warn-soft: #fff6e5;
  --ok: #157f3b;
  --ok-soft: #e6f4ea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(22, 24, 29, 0.06), 0 4px 16px rgba(22, 24, 29, 0.06);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

/* Dark: by the system ("auto") unless light is chosen, or chosen by hand. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121418;
    --surface: #1e2128;
    --surface-2: #252931;
    --border: #2c3039;
    --text: #eceef2;
    --muted: #9aa1ad;
    --accent: #2fa38f;
    --accent-hover: #3bb8a2;
    --on-accent: #0b1714;
    --accent-soft: #17312c;
    --danger: #ff8a80;
    --danger-soft: #3a1d1b;
    --warn: #f2c94c;
    --warn-soft: #3a2f12;
    --ok: #6fd28f;
    --ok-soft: #173222;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121418;
  --surface: #1e2128;
  --surface-2: #252931;
  --border: #2c3039;
  --text: #eceef2;
  --muted: #9aa1ad;
  --accent: #2fa38f;
  --accent-hover: #3bb8a2;
  --on-accent: #0b1714;
  --accent-soft: #17312c;
  --danger: #ff8a80;
  --danger-soft: #3a1d1b;
  --warn: #f2c94c;
  --warn-soft: #3a2f12;
  --ok: #6fd28f;
  --ok-soft: #173222;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 16px 0 8px; }
p { margin: 0 0 12px; }
code, .mono { font-family: var(--mono); font-size: 13px; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.topbar { display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 56px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.brand { font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; }
/* the logo of brand/ in front of the name, as on the public site (owner 2026-10-17) */
.brand-icon { width: 26px; height: 26px; flex: none; display: block; }
.dev-badge { display: inline-block; padding: 1px 8px; border-radius: 6px; background: #c8361f; color: #fff; font-weight: 700; font-size: 12px; letter-spacing: 0.04em; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.usermenu { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
/* the bar of the cabinet: the sections, the menu button (phone), the account menu (user icon) */
.topbar .main-nav { flex: 1; }
.topbar .topbar-end { margin-left: auto; gap: 8px; flex-wrap: nowrap; }
.topbar button.burger, .topbar button.avatar { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; color: var(--text); flex-shrink: 0; }
.topbar button.burger { display: none; border-radius: 8px; border-color: transparent; background: none; }
.topbar button.avatar { background: var(--surface-2); }
.topbar button.avatar:hover, .topbar button.avatar[aria-expanded='true'] { border-color: var(--accent); color: var(--accent); }
.account { position: relative; margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.plan-badge { display: inline-block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; }
a.plan-badge:hover { text-decoration: underline; }
.menu-panel { display: none; }
.menu-panel.open { display: block; }
.account-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 300px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 30; }
.menu-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); }
.menu-email { overflow-wrap: anywhere; }
.menu-links { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px solid var(--border); }
.menu-links a { padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.menu-links a:hover { background: var(--surface-2); }
.menu-links a.active { background: var(--accent-soft); color: var(--accent); }
.menu-settings { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-bottom: 1px solid var(--border); }
.menu-row { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.menu-row select { width: 100%; }
.menu-row .segmented { display: flex; }
.menu-row .segmented button { flex: 1; }
.account-panel .menu-logout { width: 100%; margin-top: 6px; }
/* ready-made styles of the widget (site page, Widget → Appearance) */
.presets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
button.preset { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px; min-height: 0; border-radius: 10px; font-weight: 500; }
button.preset[aria-pressed='true'] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
button.preset .mini { position: relative; display: flex; flex-direction: column; gap: 5px; height: 64px; padding: 0 0 8px; background: #fff; border: 1px solid #e3e6ea; overflow: hidden; }
button.preset .bar { height: 16px; flex-shrink: 0; }
button.preset .line { height: 5px; margin: 0 8px; border-radius: 3px; background: #e3e6ea; }
button.preset .line.short { width: 45%; }
button.preset .btn-dot { position: absolute; right: 6px; bottom: 6px; width: 12px; height: 12px; border-radius: 50%; }
.own-style { position: relative; display: flex; flex-direction: column; }
.own-style > button.preset { flex: 1; }
.own-actions { position: absolute; top: 4px; right: 4px; display: flex; gap: 4px; }
.own-actions button.small { min-height: 0; height: 26px; min-width: 26px; padding: 0 6px; font-size: 13px; line-height: 1; background: var(--surface, #fff); }
button.preset .name { font-size: 12px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .presets { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .presets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* fine-tuning of the widget (site page, Widget → Appearance) */
details.tune { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
details.tune > summary { cursor: pointer; font-weight: 600; }
details.tune[open] > summary { margin-bottom: 10px; }
.tune-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 12px; align-items: center; }
.tune-cell { display: inline-flex; align-items: center; gap: 6px; }
.tune-cell input[type='color'] { flex-shrink: 0; width: 34px; height: 30px; padding: 0 2px; border: 1px solid var(--border); border-radius: 6px; background: none; }
.tune-cell button.small { min-height: 30px; padding: 2px 8px; }
@media (max-width: 640px) {
  .tune-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tune-grid > .tune-corner { display: none; }
  .tune-grid > .tune-label { grid-column: 1 / -1; margin-top: 4px; }
  .tune-cell { gap: 4px; }
  .tune-cell input[type='color'] { width: 28px; }
  .tune-cell input:not([type='color']) { width: 82px !important; min-width: 0; padding: 5px 4px; font-size: 13px; font-family: var(--mono); }
  .tune-cell button.small { padding: 2px 5px; }
}
details.dropdown { position: relative; }
details.dropdown > summary { list-style: none; }
details.dropdown > summary::-webkit-details-marker { display: none; }
/* the arrow of a dropdown button (owner's request: bigger than the ▾ character), turned up when open */
.chevron { display: inline-block; width: 8px; height: 8px; margin: -4px 2px 0 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 0.15s; vertical-align: middle; }
details[open] > summary .chevron { margin-top: 4px; transform: rotate(-135deg); }
.dropdown-panel { position: absolute; left: 0; top: calc(100% + 6px); min-width: 220px; max-width: calc(100vw - 24px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 25; }
.dropdown-panel a { padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.dropdown-panel a:hover { background: var(--surface-2); }
/* the channel picker: each option shows the channel icon and name; the current one is marked */
.channel-picker > summary { min-width: 180px; justify-content: space-between; }
.channel-picker .dropdown-panel button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; color: var(--text); font-weight: 400; min-height: 0; cursor: pointer; }
.channel-picker .dropdown-panel button:hover { background: var(--surface-2); }
.channel-picker .dropdown-panel button.on { color: var(--accent); font-weight: 600; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segmented button { border: 0; border-radius: 0; background: none; min-height: 32px; padding: 4px 10px; font-size: 13px; color: var(--muted); }
.segmented button + button { border-left: 1px solid var(--border); }
.segmented.stretch { display: flex; max-width: 520px; }
.segmented.stretch button { flex: 1; white-space: normal; line-height: 1.2; padding: 6px 8px; }
.segmented button[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }
.main.narrow { max-width: 460px; padding-top: 56px; }
.main.narrow.bar { padding-top: 24px; }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px; }
.footer a { color: var(--muted); margin: 0 8px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.flat { box-shadow: none; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
/* the columns shrink to the screen: wide content (tabs, code) scrolls inside, not the page */
.split > * { min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 960px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .usermenu .email { display: none; }
}
@media (max-width: 760px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .topbar button.burger { display: inline-flex; }
  .topbar .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 2px; padding: 8px 12px 12px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); overflow: visible; }
  .topbar .main-nav.open { display: flex; }
  .topbar .main-nav a { padding: 10px 12px; }
  .plan-badge { max-width: 120px; }
  /* the bar of a public page: the theme and the language go to a second row on a phone */
  /* (the theme and the language are two icon buttons now: they fit next to the brand) */
  .topbar.bar { padding: 8px 12px; }
}

/* ---------- forms ---------- */
label.field { display: block; }
.field > .label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.field.plain-label > .label { font-weight: 400; color: var(--muted); }
.field > .hint { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.field > .error { display: block; color: var(--danger); font-size: 13px; margin-top: 4px; }
input[type='text'], input[type='email'], input[type='password'], input[type='url'], input[type='number'], input[type='date'], input[type='time'], input[type='search'], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-height: 38px;
}
textarea { min-height: 84px; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: 13px; min-height: 160px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.invalid input, .invalid select, .invalid textarea, input.invalid { border-color: var(--danger); }
input[type='color'] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
input[type='range'] { width: 100%; }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 4px; }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; }

button, .btn {
  font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; padding: 8px 14px; min-height: 38px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { background: var(--surface-2); color: var(--text); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); color: var(--on-accent); }
/* an accented second action ("Test the widget"): stands out, but not like the main one */
.btn.accent { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.btn.accent:hover { background: var(--accent); color: var(--on-accent); }
button.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
button.danger:hover { background: var(--danger-soft); }
button.link { border: none; background: none; color: var(--accent); padding: 0; min-height: 0; font-weight: 500; }
button.small, .btn.small { padding: 4px 10px; min-height: 30px; font-size: 13px; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 16px; }
.sticky-save { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 12px 20px; margin: 16px -20px -20px; border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: 8px; align-items: center; justify-content: flex-end; }

/* ---------- notices ---------- */
.notice { border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; border: 1px solid transparent; }
.notice.info { background: var(--accent-soft); }
.notice.warn { background: var(--warn-soft); color: var(--text); border-color: var(--warn); }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.tabs button { position: relative; }
/* on a tab: a badge in its top right corner, taking no room */
.tabs button .dot-alert { position: absolute; top: 7px; right: 3px; margin: 0; }
.dot-alert { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); vertical-align: middle; margin-bottom: 2px; cursor: help; }
.mark-alert { color: var(--danger); font-weight: 800; font-size: 1.15em; line-height: 1; cursor: help; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 360px; }
.toast.error { background: var(--danger); color: #fff; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.empty { text-align: center; color: var(--muted); padding: 32px; }
/* On a phone (owner's request) a table with a header is a list of cards: the first cell is the title
   of the card, the others show the name of their column (data-label, set by h()) before the value. */
@media (max-width: 640px) {
  table.cards thead { display: none; }
  table.cards, table.cards tbody, table.cards tr { display: block; }
  table.cards tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  table.cards tr:last-child { border-bottom: none; }
  table.cards td { display: block; padding: 3px 12px; border: none; text-align: left !important; white-space: normal; }
  table.cards td:first-child { padding-bottom: 6px; }
  table.cards td[data-label] { display: flex; align-items: flex-start; gap: 12px; }
  table.cards td[data-label] > .cell { flex: 1 1 auto; min-width: 0; }
  table.cards td:empty { display: none; }
  table.cards td[data-label]::before { content: attr(data-label); flex: 0 0 100px; padding-top: 3px; font-size: 12px; line-height: 18px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
  table.cards td:not(:first-child):not([data-label]) { padding-top: 8px; }
  table.cards td > .row { justify-content: flex-start !important; }
  table.cards tr.clickable:hover td { background: none; }
  table.cards tr.clickable:hover { background: var(--surface-2); }
  table.cards td.empty { display: block; text-align: center; }
  table.cards td.desk-only { display: none; }
}

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
/* on a phone the tabs wrap: all of them in view, nothing hidden behind a scroll */
@media (max-width: 640px) { .tabs { flex-wrap: wrap; overflow: visible; } }
.tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); padding: 10px 14px; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- modal ---------- */
dialog { border: none; border-radius: 12px; padding: 0; max-width: min(560px, calc(100vw - 32px)); width: 100%; background: var(--surface); color: var(--text); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3); }
dialog::backdrop { background: rgba(10, 12, 16, 0.5); }
dialog .modal-body { padding: 20px; }
dialog h2 { margin-bottom: 16px; }

/* ---------- specific ---------- */
.secret { font-family: var(--mono); font-size: 18px; letter-spacing: 0.04em; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 8px; padding: 10px 14px; word-break: break-all; }
/* an editable value shown like a secret (the operator's password) */
input.secret { font-family: var(--mono); font-size: 18px; letter-spacing: 0.04em; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 8px; padding: 10px 14px; min-width: 0; }
/* the icon of a site (operators' app): a rounded square, empty without one */
.site-icon { position: relative; overflow: hidden; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-weight: 600; line-height: 1; }
.site-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
/* the photo of an operator, or the first letter of the name */
.op-avatar { position: relative; overflow: hidden; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-weight: 600; border: 1px solid var(--border); }
.op-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.snippet { font-family: var(--mono); font-size: 13px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; word-break: break-all; }
/* a few lines of code: kept on their own lines, long ones wrap at any place */
.snippet.code { white-space: pre-wrap; word-break: normal; overflow-wrap: anywhere; }
.messages { display: flex; flex-direction: column; gap: 10px; }
.msg { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: var(--surface); max-width: 760px; }
.msg.visitor { background: var(--surface-2); }
.msg.operator { border-color: var(--accent); }
.msg.system { background: transparent; border-style: dashed; color: var(--muted); }
.msg .meta { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.deleted .body { font-style: italic; color: var(--muted); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.kpi .value { font-size: 22px; font-weight: 700; }
.kpi .label { color: var(--muted); font-size: 13px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .bar-a { fill: var(--accent); }
.chart .bar-u { fill: #e9a23b; }
.chart .axis { stroke: var(--border); }
.chart text { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.preview-pane { position: sticky; top: 72px; }
.preview-frames { display: grid; grid-template-columns: 1fr; gap: 8px; }
.preview-frames .frame-box { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; }
.preview-frames iframe { display: block; width: 520px; height: 780px; border: 0; background: transparent; transform-origin: 0 0; }
.preview-frames .cap { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 4px; }
.interval { display: flex; gap: 6px; align-items: center; margin: 4px 0; }
.interval input { width: 110px; }
.day-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; gap: 4px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 13px; }
.chip button { min-height: 0; padding: 0 6px; border: none; background: none; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; justify-content: center; padding: 48px; }
.danger-zone, details.danger-zone { border-color: var(--danger); }
/* an address of a site: the scheme and the domain joined into one field */
select.scheme { width: auto; flex: 0 0 auto; border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
select.scheme + input { border-top-left-radius: 0; border-bottom-left-radius: 0; }
/* the privacy address of the contact form: orange while empty, green with an address */
input.addr-missing { border-color: #e8710a; box-shadow: 0 0 0 1px #e8710a; }
input.addr-ok { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
/* the contact form fields: one under the other, the name on the left (owner's request) */
.field-rows { display: flex; flex-direction: column; gap: 8px; max-width: 540px; }
.field-rows label.field { display: grid; grid-template-columns: 140px minmax(0, 1fr); align-items: center; gap: 12px; }
.field-rows label.field .label { margin: 0; }
@media (max-width: 640px) { .field-rows label.field { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
/* a line between two parts of one tab (working hours and contacts, owner's request) */
hr.section-line { width: 100%; margin: 28px 0 12px; border: 0; border-top: 1px solid var(--border); }
/* the quick dates of the dialogs on a phone: four buttons share the width */
@media (max-width: 640px) { .segmented.quick-dates { display: flex; width: 100%; } .segmented.quick-dates button { flex: 1; padding: 4px 4px; font-size: 12px; white-space: normal; line-height: 1.2; } }
/* the list of sites: the "Code" button in its column, on a phone under the name */
.phone-only { display: none; }
@media (max-width: 640px) { .phone-only { display: block; } span.phone-only { display: inline; } .desk-only { display: none; } }
details.danger-zone > summary { color: var(--danger); }
.legal { max-width: 760px; }
/* Terms and Privacy: English by default, another language by the address (#uk) */
.legal article { display: none; }
.legal article:target, .legal:not(:has(article:target)) article#en { display: block; }
.legal-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 24px; }
.legal-brand { font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; }
.legal-langs { color: var(--muted); }
.legal h2 { margin-top: 28px; }
.legal p { line-height: 1.6; }
.legal mark { background: #fff3bf; color: #1f1f1f; padding: 0 3px; border-radius: 3px; }
.qr { border-radius: 8px; border: 1px solid var(--border); background: #fff; max-width: 100%; height: auto; }

/* the sign-in tabs of the operator link page: the login and the password inside a numbered step
   have less width on a phone, a slightly smaller type keeps a 17-character password on one line */
@media (max-width: 640px) {
  .how-tabs .secret { font-size: 15px; }
}
/* the device icons of the sign-in tabs on the operator link page */
.how-tabs .tabs button { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.how-tabs .tab-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
@media (max-width: 640px) { .how-tabs .tabs { flex-wrap: nowrap; } .how-tabs .tabs button { padding: 10px 10px; gap: 6px; } }
/* line icons (the theme and the language menus of the top bar of a public page) */
.line-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }
/* an icon button with a list (the theme and the language in the top bar of a public page) */
.icon-menu > summary.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); cursor: pointer; background: var(--surface); }
.icon-menu > summary.icon-btn:hover, .icon-menu[open] > summary.icon-btn { background: var(--surface-2); }
.icon-menu > summary.icon-btn .line-icon { width: 20px; height: 20px; }
.icon-menu .dropdown-panel { left: auto; right: 0; min-width: 170px; }
.icon-menu .dropdown-panel button { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; color: var(--text); font-weight: 400; min-height: 0; }
.icon-menu .dropdown-panel button:hover { background: var(--surface-2); }
.icon-menu .dropdown-panel button.on { color: var(--accent); font-weight: 600; }
.topbar .bar-login { margin-right: 4px; min-height: 38px; height: 38px; display: inline-flex; align-items: center; border-radius: 10px; }
.server-name { font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
/* the theme and the language in the account menu: the icon menus of the public pages */
.menu-settings.menu-icons { flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; }
.menu-icons .icon-menu .dropdown-panel { left: 0; right: auto; }
/* sessions beyond the first five in Settings: hidden until "Show all" (also in the card layout of phones) */
tr.more-session[hidden] { display: none !important; }

/* Sign-in pages (owner's request to tidy them): one card, a wide button, the eye in the password. */
.main.auth h1 { margin-bottom: 16px; }
.main.auth .card { padding: 28px; }
@media (max-width: 640px) { .main.auth .card { padding: 20px; } }
button.wide { width: 100%; justify-content: center; }
label.field.has-corner { position: relative; }
.field-corner { position: absolute; top: 0; right: 0; }
.auth-note { margin: 16px 0 0; }
.auth-alt { margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--border); text-align: center; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; min-height: 36px; padding: 0; border: 0; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.pw-eye:hover { color: var(--text); background: transparent; }
.pw-eye .line-icon { width: 20px; height: 20px; }

/* "Continue with Google" (Google's branding guidelines: the standard-color G; light #fff with a
   #747775 border and #1f1f1f text, dark #131314 with #8e918f and #e3e3e3; 14/20 medium). */
.google-btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 0 12px; border-radius: 10px; background: #fff; color: #1f1f1f; border: 1px solid #747775; font-weight: 500; font-size: 14px; line-height: 20px; cursor: pointer; }
.google-btn:hover { background: #f8f9fa; }
.google-btn:disabled { opacity: 0.6; cursor: default; }
.google-btn.inline { width: auto; padding: 0 16px 0 12px; }
.google-btn .g-logo { width: 20px; height: 20px; flex: none; display: inline-flex; }
.google-btn .g-logo svg { width: 20px; height: 20px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .google-btn { background: #131314; color: #e3e3e3; border-color: #8e918f; }
  :root:not([data-theme="light"]) .google-btn:hover { background: #1f1f21; }
}
:root[data-theme="dark"] .google-btn { background: #131314; color: #e3e3e3; border-color: #8e918f; }
:root[data-theme="dark"] .google-btn:hover { background: #1f1f21; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; border-top: 1px solid var(--border); }
.main.auth p { overflow-wrap: anywhere; }
