:root {
  color-scheme: light dark;
  --bg: #ffffff; --fg: #1d2129; --muted: #5c6470; --line: #d0d5dc; --accent: #1f6feb; --warn: #b45309;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1f2329; --fg: #eceef1; --muted: #a4abb6; --line: #414853; --accent: #79b0ff; --warn: #fbbf24; }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 560px; margin: 0 auto; padding: 32px 16px; }
h1 { margin: 0 0 4px; font-size: 22px; }
p { margin: 0 0 20px; color: var(--muted); }
.field { display: block; margin-bottom: 18px; font-weight: 600; }
.field input:not([type="checkbox"]), .field select {
  display: block; width: 100%; margin-top: 6px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); font: inherit; font-weight: 400;
}
/* The open list is drawn by the browser and does not inherit the select's colors everywhere. */
.field option { background: var(--bg); color: var(--fg); }
.field small { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; }
button {
  padding: 8px 16px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
@media (prefers-color-scheme: dark) { button { color: #10151c; } }
a { color: var(--accent); }
#status { margin-left: 10px; color: var(--muted); }
.notice { margin-bottom: 20px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--fg); }
.document h2 { margin: 24px 0 6px; font-size: 16px; }
.document p { color: var(--fg); margin-bottom: 10px; }
.document ul { margin: 0 0 10px; padding-left: 20px; }
.document li { margin-bottom: 6px; }
body.popup { width: 300px; }
body.popup main { padding: 14px; }
.brand { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; font-size: 15px; }
.switch-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; cursor: pointer; }
.switch-row[hidden] { display: none; }
.site-row { margin-top: 12px; }
.switch-label { display: block; font-weight: 600; }
.switch-row small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.switch {
  appearance: none; position: relative; flex: none; width: 40px; height: 22px; margin: 0;
  border-radius: 11px; background: var(--line); cursor: pointer; transition: background-color .15s;
}
.switch::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s;
}
.switch:checked { background: var(--accent); }
.switch:checked::before { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch:disabled { opacity: .5; cursor: default; }
.popup-message { margin: 10px 0 8px; min-height: 21px; font-size: 13px; }
.popup-spend.warn { color: var(--warn); }
.popup-shortcuts { margin: 0 0 12px; font-size: 12px; }
.shortcuts { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.shortcuts h2 { margin: 0 0 10px; font-size: 16px; }
.shortcuts table { width: 100%; margin-bottom: 12px; border-collapse: collapse; }
.shortcuts td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.shortcuts td:last-child { text-align: right; }
.shortcuts p { margin-bottom: 12px; }
kbd { padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; font: 12px ui-monospace, Consolas, monospace; }
.frame-row[hidden] { display: none; }
.frame-row { margin-bottom: 10px; font-size: 12px; }
.link-button { display: block; margin-top: 4px; padding: 4px 10px; font-size: 12px; }
.popup-spend { margin: 0 0 12px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; }
@media (prefers-reduced-motion: reduce) {
  .switch, .switch::before { transition: none; }
}
