/* RustPress control panel. A calm, Plesk-like admin look: navy sidebar, white
   cards on a light canvas, one blue primary colour. No scripts, no images from
   elsewhere, no web fonts. Every colour is a token below. */

/* ---- Design tokens --------------------------------------------------------- */

:root {
  /* Colour */
  --canvas: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --text: #1c2430;
  --muted: #5a6472;
  --line: #d9dee6;
  --line-strong: #b4bec9;
  --primary: #0b63c5;
  --primary-hover: #084f9e;
  --primary-text: #ffffff;
  --primary-soft: #e6f0fb;
  --nav-bg: #14233b;
  --nav-line: rgba(255, 255, 255, 0.1);
  --nav-text: #c9d3e2;
  --nav-hover: rgba(255, 255, 255, 0.08);
  --nav-active: #1f3557;
  --nav-accent: #5aaefc;
  --ok: #17663a;
  --ok-bg: #e5f5ec;
  --ok-line: #5fae81;
  --warn: #6b4300;
  --warn-bg: #fff3d6;
  --warn-line: #d69a2d;
  --bad: #a31f1f;
  --bad-bg: #fce8e8;
  --bad-line: #d46b6b;
  --focus: #0b63c5;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-lift: 0 4px 12px rgba(16, 24, 40, 0.1);

  /* Space (4px steps) */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;

  /* Shape */
  --radius: 8px;
  --radius-lg: 12px;

  /* Type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-sm: 0.9rem;
  --text-base: 1rem;
  --text-lg: 1.15rem;
  --text-xl: 1.5rem;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0f1420;
    --surface: #182030;
    --surface-2: #1d2739;
    --text: #e8edf4;
    --muted: #aeb8c6;
    --line: #2d3a50;
    --line-strong: #46556e;
    --primary: #6fb3ff;
    --primary-hover: #9cc9ff;
    --primary-text: #0b1322;
    --primary-soft: #1b3150;
    --nav-bg: #0b1322;
    --nav-line: rgba(255, 255, 255, 0.08);
    --nav-text: #b9c5d6;
    --nav-hover: rgba(255, 255, 255, 0.06);
    --nav-active: #1b2b45;
    --nav-accent: #6fb3ff;
    --ok: #9be3b8;
    --ok-bg: #173424;
    --ok-line: #3f9a66;
    --warn: #ffd98a;
    --warn-bg: #3a2c10;
    --warn-line: #b8862a;
    --bad: #ffb3b3;
    --bad-bg: #3d1b1b;
    --bad-line: #b85050;
    --focus: #9cc9ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lift: 0 6px 16px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

/* ---- Base ------------------------------------------------------------------ */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-text-size-adjust: 100%;
}

h1 { font-size: var(--text-xl); line-height: 1.25; margin: var(--s1) 0 0; font-weight: 700; }
h2 { font-size: var(--text-lg); line-height: 1.3; margin: 1.4em 0 var(--s2); font-weight: 700; }
p { margin: 0.5em 0; }
a { color: var(--primary); }
code { font-family: var(--mono); font-size: 0.92em; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: var(--s2); z-index: 100;
  background: var(--surface); color: var(--text); padding: var(--s2) var(--s4);
  border-radius: var(--radius); box-shadow: var(--shadow-lift);
}
.skip:focus { left: var(--s4); }

.ic {
  width: 1.2em; height: 1.2em; flex: none;
  vertical-align: -0.2em;
}

/* ---- App shell: sidebar and columns ---------------------------------------- */

.app {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: var(--s4) var(--s3);
  --focus: #8ec9ff;
}

.brand {
  display: inline-flex; align-items: center; gap: var(--s2);
  color: var(--text); text-decoration: none;
  font-weight: 700; font-size: 1.15rem; letter-spacing: 0.01em;
}
.sidebar .brand { color: #ffffff; padding: var(--s2) var(--s3) var(--s4); }

.logo { width: 30px; height: 30px; flex: none; color: #ffffff; }
.logo-tile { fill: var(--primary); }
.sidebar .logo-tile { fill: #3b82f6; }
.brand-centre .logo { width: 40px; height: 40px; }
.brand-centre .logo-tile { fill: var(--primary); }

.nav-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.nav-list a,
.side-account,
.mobile-panel .nav-list a {
  display: flex; align-items: center; gap: var(--s3);
  min-height: 44px; padding: var(--s2) var(--s3);
  border-radius: var(--radius);
  color: var(--nav-text); text-decoration: none; font-weight: 500;
  position: relative;
}
.nav-list a:hover,
.side-account:hover { background: var(--nav-hover); color: #ffffff; }
.nav-list a[aria-current="page"],
.side-account[aria-current="page"] {
  background: var(--nav-active); color: #ffffff; font-weight: 600;
}
.nav-list a[aria-current="page"]::before,
.side-account[aria-current="page"]::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px;
  width: 4px; border-radius: 0 4px 4px 0; background: var(--nav-accent);
}
.nav-list span:not(.count):not(.sr-only) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-list .count { margin-left: auto; }

.side-foot {
  margin-top: auto; padding-top: var(--s3);
  border-top: 1px solid var(--nav-line);
}

.column { min-width: 0; display: flex; flex-direction: column; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s3);
  min-height: 60px; padding: var(--s2) var(--s5);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.top-search {
  display: flex; align-items: center;
  flex: 1 1 260px; max-width: 420px; margin-right: auto;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface-2);
}
.top-search input {
  flex: 1; min-width: 0; min-height: 40px; border: 0; background: transparent;
  padding: 0 var(--s3); font: inherit; color: var(--text);
}
.top-search input:focus-visible { outline-offset: -3px; }
.top-search .search-go {
  background: transparent; border: 0; color: var(--muted);
  min-height: 40px; min-width: 44px; padding: 0 var(--s3); border-radius: 0 var(--radius) var(--radius) 0;
}
.top-search .search-go:hover { color: var(--text); background: var(--nav-hover); }

.icon-button {
  position: relative;
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 44px; min-width: 44px; padding: var(--s2);
  border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--text);
  font: inherit; text-decoration: none; cursor: pointer; list-style: none;
}
.icon-button:hover { background: var(--surface-2); border-color: var(--line); }
.icon-button .ic { width: 22px; height: 22px; }
.bell .count {
  position: absolute; top: 2px; right: 0;
  min-width: 1.25rem;
}

.user-menu { position: relative; margin-left: var(--s2); }
.user-menu > summary,
.mobile-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker,
.mobile-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary {
  display: flex; align-items: center; gap: var(--s2);
  min-height: 44px; padding: var(--s1) var(--s3) var(--s1) var(--s1);
  border: 1px solid transparent; border-radius: 999px;
}
.user-menu > summary:hover { background: var(--surface-2); border-color: var(--line); }
.avatar {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: var(--primary-text);
  font-weight: 700; font-size: 0.95rem;
}
.who-name { font-weight: 600; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-role { color: var(--muted); font-size: var(--text-sm); }

.menu-panel {
  position: absolute; right: 0; top: calc(100% + var(--s2));
  z-index: 30; min-width: 260px; padding: var(--s2);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lift);
}
.menu-who {
  margin: 0 0 var(--s1); padding: var(--s2) var(--s3);
  color: var(--muted); font-size: var(--text-sm); word-break: break-all;
  border-bottom: 1px solid var(--line);
}
.menu-item {
  display: flex; align-items: center; gap: var(--s3);
  width: 100%; min-height: 44px; padding: var(--s2) var(--s3);
  border: 0; border-radius: var(--radius);
  background: transparent; color: var(--text);
  font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item:hover { background: var(--surface-2); }

/* Mobile menu: only shown when the sidebar is hidden */
.mobile-menu { position: relative; display: none; }
.mobile-menu > summary { display: inline-flex; align-items: center; gap: var(--s2); }
.mobile-menu > summary span { font-weight: 600; }
.mobile-panel {
  position: absolute; left: 0; top: calc(100% + var(--s2));
  z-index: 40; width: min(300px, calc(100vw - 32px));
  padding: var(--s3);
  background: var(--nav-bg); color: var(--nav-text);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lift);
  --focus: #8ec9ff;
}
.mobile-panel .side-account { margin-top: var(--s2); border-top: 1px solid var(--nav-line); border-radius: 0 0 var(--radius) var(--radius); padding-top: var(--s3); }
.brand-mobile { display: none; color: var(--text); }


main {
  width: 100%; max-width: 1080px;
  padding: var(--s5) var(--s5) var(--s6);
}

.foot { padding: 0 var(--s5) var(--s5); color: var(--muted); font-size: var(--text-sm); }
.foot p { margin: 0; }

/* Page header with breadcrumbs */
.page-head { margin-bottom: var(--s4); }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); list-style: none; margin: 0; padding: 0; font-size: var(--text-sm); }
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li + li::before { content: "\203A"; color: var(--muted); margin: 0 var(--s2); font-size: 1.1em; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }

/* Sign-in and other pages without the shell */
body.bare { min-height: 100vh; }
.auth {
  max-width: 440px; margin: 0 auto; padding: var(--s6) var(--s4) 0;
}
.brand-centre { justify-content: center; width: 100%; margin-bottom: var(--s5); }
.auth-card { padding: 0; }
.auth-card h1 { text-align: center; font-size: 1.6rem; margin-bottom: var(--s4); }
.auth-card > .card { margin-top: var(--s4); padding: var(--s5); }
.auth-card > p { color: var(--muted); text-align: center; }
.auth-link { text-align: center; }
.auth .foot { text-align: center; padding: var(--s5) 0; }

/* ---- Buttons --------------------------------------------------------------- */

.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px;
  padding: var(--s2) var(--s4);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-text);
  font: inherit; font-weight: 600; line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn:hover, button:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.secondary, button.secondary {
  background: var(--surface); color: var(--primary); border-color: var(--line-strong);
}
.btn.secondary:hover, button.secondary:hover { background: var(--surface-2); border-color: var(--primary); color: var(--primary); }
.btn.danger, button.danger {
  background: var(--bad); border-color: var(--bad); color: #ffffff;
}
.btn.danger:hover, button.danger:hover { background: #861818; border-color: #861818; color: #ffffff; }
.btn.danger .ic { color: inherit; }
button.link {
  display: inline; min-height: 0; padding: 0; border: 0; background: none;
  color: var(--primary); font-weight: 400; text-decoration: underline;
}
button.link:hover { background: none; color: var(--primary-hover); }
form.inline { display: inline; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s4) 0; align-items: center; }
.menu-item.danger, .menu-item.danger .ic { color: var(--bad); }

/* ---- Forms ----------------------------------------------------------------- */

.field { margin: var(--s4) 0; }
.field > label { display: block; font-weight: 600; margin-bottom: var(--s1); }
.field input:not([type="checkbox"]), .field select, .field textarea {
  width: 100%;
  min-height: 44px;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.field input:focus-visible { border-color: var(--primary); }
.field.check { display: flex; align-items: center; gap: var(--s3); }
.field.check > label { margin: 0; font-weight: 400; }
.field.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.field .help { color: var(--muted); font-size: var(--text-sm); margin: var(--s1) 0 var(--s2); }
.field.has-error input { border: 2px solid var(--bad); }
.problem {
  display: flex; align-items: center; gap: var(--s2);
  color: var(--bad); font-weight: 600; margin: var(--s1) 0;
}
.problem .ic { width: 1em; height: 1em; }
.help { color: var(--muted); font-size: var(--text-sm); }
.field .help, .help { margin-top: var(--s1); }

/* ---- Notices --------------------------------------------------------------- */

.notice {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s3) var(--s4);
  margin: var(--s4) 0;
  border: 1px solid; border-radius: var(--radius-lg);
}
.notice > .ic { width: 22px; height: 22px; margin-top: 1px; }
.notice-body { min-width: 0; flex: 1; }
.notice-body > :first-child { margin-top: 0; }
.notice-body > :last-child { margin-bottom: 0; }
.notice p { margin: 0.25em 0; }
.notice.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.notice.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.notice.error { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }

/* ---- Badges (status words always carry an icon too) ------------------------ */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px 2px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: var(--text-sm); font-weight: 600; line-height: 1.5;
  white-space: nowrap;
}
.badge .ic { width: 15px; height: 15px; }
.badge.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.badge.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.badge.bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.badge.muted { color: var(--muted); background: var(--surface-2); border-color: var(--line-strong); }

.count {
  display: inline-block; min-width: 1.5em; padding: 0 6px; white-space: nowrap;
  border-radius: 999px; background: var(--bad); color: #ffffff;
  font-size: 0.78rem; font-weight: 700; line-height: 1.5; text-align: center;
}
.nav-list .count { background: #ffffff; color: var(--nav-bg); font-size: 0.8rem; padding: 0 8px; }

/* ---- Cards ----------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--s5);
  margin: var(--s4) 0;
}
.card > h2:first-child { margin-top: 0; }
.card.confirm { max-width: 640px; }
.confirm-text { font-size: 1.05rem; }
.card.coming { color: var(--muted); border-style: dashed; box-shadow: none; }

/* Sites list */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--s3); margin: 0 0 var(--s4);
}
.toolbar .help { margin: 0; }

.site-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.site-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--s4) var(--s5);
  margin: 0; padding: var(--s4) var(--s5);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.site-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
.site-main { min-width: 0; flex: 1 1 320px; }
.site-name {
  display: inline-block; font-size: 1.3rem; font-weight: 700; line-height: 1.3;
  color: var(--primary); text-decoration: none; overflow-wrap: anywhere;
}
.site-name:hover { text-decoration: underline; }
.site-sub { margin: 2px 0 var(--s2); color: var(--muted); font-size: var(--text-sm); }
.site-badges { display: flex; flex-wrap: wrap; gap: var(--s2); }
.site-facts {
  display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4);
  margin: var(--s2) 0 0; color: var(--muted); font-size: var(--text-sm);
}
.site-links {
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4);
  font-size: var(--text-sm);
}
.site-links a {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 var(--s2); border-radius: var(--radius);
  color: var(--primary); text-decoration: none; font-weight: 600;
}
.site-links a:hover { background: var(--primary-soft); text-decoration: underline; }
.site-links .ic { width: 17px; height: 17px; }

/* Dashboard header */
.site-head { padding: var(--s4) var(--s5); }
.site-head .actions { margin: var(--s3) 0 0; }
.power {
  margin-top: var(--s4); padding-top: var(--s4);
  border-top: 1px solid var(--line);
}
.power-label {
  display: flex; align-items: center; gap: var(--s2);
  margin: 0; font-weight: 700;
}
.power .actions { margin: var(--s3) 0 0; }

.strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3);
}
.strip-domain {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 1.1rem; color: var(--primary); text-decoration: none;
  margin-left: var(--s2); overflow-wrap: anywhere;
}
.strip-domain .ic { width: 16px; height: 16px; }
.strip-domain:hover { text-decoration: underline; }

/* Tool tiles, grouped under headings */
.tile-group { margin-top: var(--s5); }
.tile-group > h2 {
  margin: 0 0 var(--s3);
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.tiles {
  display: grid; gap: var(--s3);
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.tile {
  display: flex; align-items: flex-start; gap: var(--s3);
  min-height: 96px; padding: var(--s4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  color: var(--text); text-decoration: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.tile:hover { border-color: var(--primary); box-shadow: var(--shadow-lift); }
.tile-icon {
  display: grid; place-items: center; flex: none;
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary);
}
.tile-icon .ic { width: 22px; height: 22px; }
.tile-text { display: block; min-width: 0; }
.tile-title { display: block; font-weight: 700; color: var(--text); }
.tile-title .ic { width: 14px; height: 14px; vertical-align: -2px; }
.tile-blurb { display: block; color: var(--muted); font-size: var(--text-sm); margin-top: 2px; }
.tile-status { display: block; margin-top: var(--s2); font-size: var(--text-sm); font-weight: 600; color: var(--text); }

/* Notifications list */
ul.notices { list-style: none; padding: 0; margin: var(--s3) 0; display: grid; gap: var(--s2); }
ul.notices li {
  padding: var(--s3) var(--s4); background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: var(--radius);
}
ul.notices li.bad { border-left-color: var(--bad); }
ul.notices li.warn { border-left-color: var(--warn-line); }
ul.notices li.ok { border-left-color: var(--ok-line); }

/* Tables */
.table-wrap { overflow-x: auto; margin: var(--s3) 0; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: var(--text-sm); color: var(--muted); font-weight: 600; background: var(--surface-2); }
tbody tr:hover td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td a { font-weight: 600; }
.table-wrap table { min-width: 36rem; }

.empty { color: var(--muted); font-style: italic; }
.empty-state { text-align: center; padding: var(--s6) var(--s4); }
.empty-state p { margin: var(--s2) auto var(--s4); max-width: 46ch; font-size: 1.05rem; }
.empty-icon {
  display: inline-grid; place-items: center;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
}
.empty-icon .ic { width: 30px; height: 30px; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--s2) var(--s5); margin: var(--s3) 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
dl.facts.card { padding: var(--s4) var(--s5); }

/* Job progress and steps */
.progress { margin: var(--s4) 0; }
.progress .help { margin-top: var(--s2); }
progress {
  display: block; width: 100%; height: 12px;
  border: 0; border-radius: 999px; overflow: hidden;
  background: var(--line); accent-color: var(--primary);
  -webkit-appearance: none; appearance: none;
}
progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--primary); border-radius: 999px; }

ol.steps { list-style: none; padding: 0; margin: var(--s3) 0; border-top: 1px solid var(--line); }
ol.steps li {
  display: flex; gap: var(--s3); align-items: baseline;
  padding: var(--s3) 0; border-bottom: 1px solid var(--line);
}
ol.steps .mark {
  display: inline-grid; place-items: center; flex: none;
  width: 1.6em; height: 1.6em; border-radius: 50%;
  font-weight: 700; font-size: 0.9rem; color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--line-strong);
}

pre.log, pre.secret {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s3) var(--s4);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 0.9rem/1.5 var(--mono);
}
pre.secret {
  font-size: 1.3rem; font-weight: 700; letter-spacing: 0.04em; text-align: center;
  background: var(--surface-2);
}

/* Two-step sign-in */
.qr { display: inline-block; padding: var(--s3); background: #ffffff; border-radius: var(--radius); border: 1px solid var(--line); }
.manual-key { font: 1rem var(--mono); word-break: break-all; }

/* ---- Small screens --------------------------------------------------------- */

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .mobile-menu { display: block; }
  .brand-mobile { display: inline-flex; }
  .topbar { padding: var(--s2) var(--s3); gap: var(--s2); flex-wrap: wrap; }
  .brand-mobile { margin-right: auto; }
  .top-search { order: 10; flex: 1 1 100%; max-width: none; margin-right: 0; }
  .user-menu { margin-left: 0; }
  .who-name, .who-role { display: none; }
  main { padding: var(--s4) var(--s4) var(--s6); }
  .foot { padding: 0 var(--s4) var(--s5); }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .site-card { padding: var(--s4); }
  .site-links { width: 100%; }
  .card { padding: var(--s4); }
  .auth-card > .card { padding: var(--s4); }
  .menu-panel { right: -8px; min-width: min(260px, calc(100vw - 32px)); }
  .brand-mobile span { font-size: 1rem; }
  .actions .btn, .actions button { flex: 1 1 auto; }
  th, td { padding: var(--s2) var(--s3); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
