/* The console, styled after a macOS window: the system font at its
 * sizes, a window-grey ground with grouped white panels, a segmented
 * control for the sections, push buttons, tinted tags, and the system's
 * semantic colours in light and dark appearance. */
:root {
  --bg: #f2f2f7; --fg: #1d1d1f; --muted: #6e6e73; --card: #ffffff; --line: rgba(0, 0, 0, 0.1);
  --row: rgba(0, 0, 0, 0.03); --accent: #007aff; --accent-fg: #ffffff; --ok: #28a745; --warn: #c77800; --bad: #e0302a;
  --ok-bg: rgba(52, 199, 89, 0.16); --warn-bg: rgba(255, 159, 10, 0.18); --bad-bg: rgba(255, 59, 48, 0.14);
  --pill: rgba(0, 0, 0, 0.06); --seg: rgba(0, 0, 0, 0.06); --seg-on: #ffffff;
  --toolbar: rgba(246, 246, 246, 0.82); --field: #ffffff; --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1e1e1e; --fg: #f5f5f7; --muted: #98989d; --card: #2a2a2c; --line: rgba(255, 255, 255, 0.1);
    --row: rgba(255, 255, 255, 0.03); --accent: #0a84ff; --accent-fg: #ffffff; --ok: #30d158; --warn: #ffd60a; --bad: #ff453a;
    --ok-bg: rgba(48, 209, 88, 0.18); --warn-bg: rgba(255, 214, 10, 0.16); --bad-bg: rgba(255, 69, 58, 0.18);
    --pill: rgba(255, 255, 255, 0.08); --seg: rgba(255, 255, 255, 0.08); --seg-on: #636366;
    --toolbar: rgba(40, 40, 42, 0.82); --field: #1c1c1e; --shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.12); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 13px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); font-size: 0.92em; }
code { background: var(--pill); padding: 0.05em 0.35em; border-radius: 4px; }
pre code { background: none; padding: 0; }

/* The toolbar: translucent, with the sections as a segmented control. */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1.25rem; padding: 0.55rem 1.25rem;
  background: var(--toolbar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 15px; color: var(--fg); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.tabs, nav { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--seg); flex-wrap: wrap; }
.tabs a, nav a { color: var(--fg); padding: 0.2rem 0.7rem; border-radius: 6px; font-weight: 500; line-height: 1.4; }
.tabs a:hover, nav a:hover { text-decoration: none; }
.tabs a.here, nav a.here { background: var(--seg-on); box-shadow: var(--shadow); }
.tabs { margin: 0 0 1.1rem; }
.tab-pane[hidden] { display: none; }
.badge { background: var(--bad); color: #fff; border-radius: 999px; padding: 0 0.45em; font-size: 0.8em; font-weight: 600; vertical-align: 1px; }
.who { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; color: var(--muted); }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0.1rem 0 1rem; }
h1 small, h2 small { color: var(--muted); font-weight: 400; font-size: 0.75em; letter-spacing: 0; }
h2 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 0.6rem; }
.subnav { margin-top: -0.6rem; color: var(--muted); }

/* Grouped panels, as in System Settings. */
.card { background: var(--card); border-radius: 10px; box-shadow: var(--shadow); padding: 0.9rem 1.1rem 1rem; margin-bottom: 1.1rem; }
.card.narrow { max-width: 24rem; margin: 4rem auto; }
.card.attention { box-shadow: var(--shadow), inset 0 0 0 1px var(--warn); }
.card.danger { box-shadow: var(--shadow), inset 0 0 0 1px var(--bad); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.1rem; margin-bottom: 1.1rem; }
.grid .card { margin-bottom: 0; }

/* Lists: alternating rows, muted headers. */
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: 0.4rem 0.55rem; vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 11px; border-bottom: 1px solid var(--line); }
tbody tr:nth-child(even) td { background: var(--row); }
tbody tr:first-child td { border-radius: 0; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.2rem; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; }
.muted { color: var(--muted); }
.warn { color: var(--warn); }

.notice, .problem { padding: 0.55rem 0.9rem; border-radius: 8px; margin: 0 0 1rem; }
.notice { background: var(--ok-bg); }
.problem { background: var(--bad-bg); }
.problem-inline { color: var(--bad); }

/* Tags. */
.pill { display: inline-block; padding: 0.05rem 0.55rem; border-radius: 999px; background: var(--pill); color: var(--muted); font-size: 11px; font-weight: 500; }
.pill.on { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.off { background: var(--bad-bg); color: var(--bad); }
.outcome { font-weight: 600; }
.outcome.synced, .outcome.backup, .outcome.set, .outcome.fixed, .outcome.unchanged { color: var(--ok); }
.outcome.dry-run, .outcome.held, .outcome.pending, .outcome.skipped, .outcome.busy { color: var(--warn); }
.outcome.error, .outcome.blank { color: var(--bad); }

/* Forms: text fields with the focus ring, push buttons. */
form label { display: block; margin: 0.6rem 0; }
form label small { display: block; color: var(--muted); }
form label.check { display: flex; gap: 0.5rem; align-items: baseline; }
input:not([type=checkbox]):not([type=file]), select, textarea { width: 100%; max-width: 32rem; padding: 0.3rem 0.5rem;
  border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--fg); font: inherit; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.04); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
textarea { font-family: var(--mono); font-size: 0.9em; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 0.8rem; padding: 0.4rem 0.9rem 0.8rem; }
legend { color: var(--muted); padding: 0 0.3rem; }
button, .button { font: inherit; font-weight: 500; padding: 0.28rem 0.85rem; border-radius: 6px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-fg); cursor: pointer; display: inline-block; line-height: 1.5; box-shadow: var(--shadow); }
button:hover, .button:hover { text-decoration: none; filter: brightness(1.06); }
button:active, .button:active { filter: brightness(0.92); }
button.quiet, .button.quiet { background: var(--card); color: var(--fg); }
button.danger { background: var(--bad); color: #fff; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; cursor: pointer; box-shadow: none; font-weight: 400; }
button.link:hover { filter: none; text-decoration: underline; }
button[disabled] { opacity: 0.45; cursor: default; }
.actions { display: flex; gap: 0.45rem; align-items: center; flex-wrap: wrap; }
td.actions form { margin: 0; }
.small { font-size: 0.92em; }
form.inline { display: flex; gap: 0.8rem; align-items: end; flex-wrap: wrap; margin-top: 0.8rem; }
form.inline label { margin: 0; }
pre.log { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0.8rem; overflow: auto; max-height: 32rem; white-space: pre-wrap; }
details summary { cursor: pointer; color: var(--muted); }
form label > input:not([type=checkbox]):not([type=file]), form label > select, form label > textarea { display: block; margin-top: 0.25rem; }
code.pin { word-break: break-all; }
@media (max-width: 640px) { dl { grid-template-columns: 1fr; } .who { margin-left: 0; } main { padding: 1rem; } }

/* The device page's bar: the tabs and the Settings menu. */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 1.1rem; flex-wrap: wrap; }
.bar .tabs { margin: 0; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; font-weight: 500; padding: 0.28rem 0.85rem; border-radius: 6px;
  background: var(--card); box-shadow: var(--shadow); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " \2304"; color: var(--muted); font-size: 0.8em; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); min-width: 12rem; background: var(--card); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), var(--shadow); padding: 0.3rem; z-index: 20; }
.menu-list a { display: block; padding: 0.3rem 0.7rem; border-radius: 5px; color: var(--fg); }
.menu-list a:hover { background: var(--accent); color: var(--accent-fg); text-decoration: none; }

/* Sheets: a settings block over the page. */
dialog.sheet { border: 0; border-radius: 12px; padding: 1.1rem 1.3rem 1.3rem; width: min(42rem, calc(100vw - 2rem));
  background: var(--card); color: var(--fg); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), var(--shadow); }
dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.3); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog.sheet:target { display: block; position: fixed; inset: 0; margin: auto; height: fit-content; }
dialog.sheet { max-height: calc(100vh - 3rem); overflow: auto; }
dialog.sheet h2 { font-size: 15px; color: var(--fg); margin-right: 5rem; }
.sheet-close { float: right; margin: -0.2rem -0.4rem 0 0; }
dialog.sheet input:not([type=checkbox]):not([type=file]), dialog.sheet select, dialog.sheet textarea { max-width: none; }

.pair-code { text-align: center; margin: 1rem 0 1.2rem; }
.pair-code code { font-size: 28px; letter-spacing: 0.12em; padding: 0.4rem 0.9rem; border-radius: 10px; }
