:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #18181b;
  --muted: #52525b;
  --line: #d4d4d8;
  --accent: #6d28d9;
  --accent-fg: #ffffff;
  --soft: #f4f4f5;
  --field: #71717a; /* borders of fields: at least 3:1 against the background */
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #18181b; --fg: #f4f4f5; --muted: #a1a1aa; --line: #3f3f46; --accent: #a78bfa; --accent-fg: #18181b; --soft: #27272a; --field: #a1a1aa; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--fg); }
.brand { display: flex; flex-direction: column; padding: 12px 14px 4px; }
.brand strong { font-size: 1.15em; }
.muted { color: var(--muted); font-size: .9em; }
.tabs { display: flex; gap: 2px; padding: 6px 10px 0; border-bottom: 1px solid var(--line); }
.tabs button { font: inherit; background: none; border: 0; padding: 8px 10px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--fg); border-color: var(--accent); font-weight: 600; }
.pane { padding: 10px 14px 24px; display: grid; gap: 10px; }
.pane h2 { font-size: 1em; margin: 8px 0 0; }
.pane p { margin: 0; }
button { font: inherit; border: 1px solid var(--line); background: var(--soft); color: var(--fg); padding: 7px 12px; border-radius: 8px; cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font-size: .85em; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea, input[type=text], input[type=password], select { width: 100%; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--field); border-radius: 8px; padding: 7px 9px; }
/* One row that grows with its text, so nothing typed is cut. */
textarea.grow { field-sizing: content; resize: none; min-height: 2.4em; }
.field { display: grid; gap: 4px; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.events { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.events li { border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: grid; gap: 2px; }
progress { width: 100%; }
.status { font-weight: 500; }
[hidden] { display: none !important; }
.cloud-note { border-left: 3px solid #b45309; padding-left: 8px; }
.connection { font-weight: 500; color: var(--muted); }
.connection.on { color: var(--fg); }
.log { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .9em; }
.log li { border-left: 3px solid var(--line); padding-left: 8px; }
.route { font-weight: 600; }
.route.on_device { color: #15803d; }
.route.in_cloud { color: #1d4ed8; }
.route.fallback, .route.blocked, .route.failed { color: #b45309; }
@media (prefers-color-scheme: dark) {
  .route.on_device { color: #86efac; } .route.in_cloud { color: #93c5fd; } .route.fallback, .route.blocked, .route.failed { color: #fcd34d; }
}
.prep { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 6px; }
.confirm { border: 2px solid var(--accent); border-radius: 8px; padding: 10px; display: grid; gap: 8px; background: var(--soft); }
.confirm > div:first-child { display: grid; gap: 6px; }
.qa { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.qa li { border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: grid; gap: 6px; justify-items: start; }
.qa .field { width: 100%; }
.qa textarea.a { resize: vertical; }
.routes summary { cursor: pointer; }
.routes summary h2 { display: inline; }
.routes[open] summary { margin-bottom: 6px; }
.routes > p { margin-bottom: 6px; }
button:disabled { opacity: .55; cursor: not-allowed; }

/* Display and reading options (side panel) */
.pu-easy { font-family: Verdana, Tahoma, "Segoe UI", system-ui, sans-serif; font-size: 15.5px; line-height: 1.7; letter-spacing: .04em; word-spacing: .12em; }
/* Form controls do not inherit spacing by themselves. */
.pu-easy button, .pu-easy input, .pu-easy select, .pu-easy textarea { letter-spacing: inherit; word-spacing: inherit; }
/* High contrast. In the extension the whole page takes it (the header is
   outside the tabs); in the hosted demo only the Pipe Up column does. */
.pu-contrast, body.is-panel:has(.pu-contrast) { --bg: #000; --fg: #fff; --muted: #fff; --line: #fff; --field: #fff; --accent: #ffd60a; --accent-fg: #000; --soft: #000; background: #000; color: #fff; }
.pu-contrast button, .pu-contrast input, .pu-contrast select, .pu-contrast textarea { border-width: 2px; }
/* The route is written out in words: no need for its color here. */
.pu-contrast .route.on_device, .pu-contrast .route.in_cloud, .pu-contrast .route.fallback, .pu-contrast .route.blocked, .pu-contrast .route.failed { color: #fff; }
.pu-still *, .pu-still { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
