@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/static/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/static/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
:root {
  color-scheme: light;
  --bg: #f4f4f2;
  --card: #ffffff;
  --text: #1d2023;
  --muted: #61666b;
  --line: #e2e2de;
  --accent: #2b2f33;      /* main buttons: charcoal */
  --accent-text: #ffffff;
  --link: #2b2f33;
  --side: #1f2225;        /* sidebar: the logo's black, softened */
  --side-2: #2c3034;
  --side-text: #d6d8da;
  --brand-gold: #c6b55a;  /* the logo's gold: marks where you are */
  --good: #1d7a46;
  --good-bg: #e3f4ea;
  --warn: #8a5a00;
  --warn-bg: #fff2d6;
  --bad: #b3261e;
  --bad-bg: #fde7e5;
  --sidebar-w: 236px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17191b;
    --card: #202326;
    --text: #e6e7e8;
    --muted: #9ea3a8;
    --line: #33373b;
    --accent: #c6b55a;
    --accent-text: #1d2023;
    --link: #d8cb85;
    --side: #111315;
    --side-2: #24282b;
    --side-text: #cfd2d4;
    --good: #6fd39a;
    --good-bg: #173226;
    --warn: #f0c46a;
    --warn-bg: #352a12;
    --bad: #ff8a80;
    --bad-bg: #3a1b19;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17191b;
  --card: #202326;
  --text: #e6e7e8;
  --muted: #9ea3a8;
  --line: #33373b;
  --accent: #c6b55a;
  --accent-text: #1d2023;
  --link: #d8cb85;
  --side: #111315;
  --side-2: #24282b;
  --side-text: #cfd2d4;
  --good: #6fd39a;
  --good-bg: #173226;
  --warn: #f0c46a;
  --warn-bg: #352a12;
  --bad: #ff8a80;
  --bad-bg: #3a1b19;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--link); }
a:hover { color: var(--text); }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 24px; margin: 0; }
h2 { font-size: 16px; margin: 20px 0 8px; }
h2:first-child { margin-top: 0; }


.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.count { color: var(--muted); font-weight: 400; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid .card { margin-bottom: 0; }
.grid + .card, .grid + .grid { margin-top: 16px; }
.empty { text-align: center; padding: 40px 20px; }
.login { max-width: 380px; margin: 10vh auto 0; }

.table-wrap { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }
table.compact td, table.compact th { padding: 6px 8px; }

dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }

label { display: block; margin-bottom: 12px; font-weight: 500; }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px;
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px;
}
input.short { display: inline-block; width: 90px; margin: 0 6px; }
textarea { resize: vertical; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row label { flex: 1; min-width: 200px; margin-bottom: 0; }

.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 4px 20px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; padding: 6px 0; }
label.check input { width: auto; margin-top: 4px; flex: none; }
label.check.danger strong { color: var(--bad); }

button, .button {
  display: inline-block; padding: 8px 14px; font: inherit; font-weight: 500;
  color: var(--text); background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; cursor: pointer; text-decoration: none;
}
button:hover, .button:hover { border-color: var(--accent); }
button.primary, .button { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
button.link { background: none; border: none; color: var(--link); padding: 0; text-decoration: underline; }
form.inline { display: inline; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 13px; background: var(--line); white-space: nowrap; }
.pill.online, .pill.done { background: var(--good-bg); color: var(--good); }
.pill.overdue, .pill.failed { background: var(--bad-bg); color: var(--bad); }
.pill.pending, .pill.sent { background: var(--warn-bg); color: var(--warn); }

ul.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
ul.tags li { padding: 2px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; }
ul.tags.warn li { background: var(--warn-bg); color: var(--warn); }

.notice { background: var(--good-bg); color: var(--good); padding: 10px 14px; border-radius: 6px; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.alert { background: var(--bad-bg); color: var(--bad); padding: 10px 14px; border-radius: 6px; }
.danger-zone { border-color: var(--bad-bg); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 12px; overflow-x: auto; white-space: pre; }

nav.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 16px; }
nav.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
nav.tabs a.active { color: var(--text); border-bottom-color: var(--brand-gold); font-weight: 600; }
button.small-btn { padding: 3px 10px; font-size: 13px; }
td.actions { white-space: nowrap; }
td.actions form + form { margin-left: 4px; }
.table-wrap.flat { border: none; padding: 0; margin: 0; }
.search { display: flex; gap: 8px; align-items: center; margin: 0 0 16px; }
.search input[type=search] { flex: 1; max-width: 520px; }
.settings-table tr.changed td { background: var(--warn-bg); }
.settings-table select { min-width: 210px; }
td.nowrap, th.nowrap { white-space: nowrap; }
.radio-row { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 8px; }
.radio-row label.check { flex: 0 0 auto; min-width: 0; }
button.link.danger, a.danger { color: var(--bad); }
.choices { display: grid; gap: 10px; margin-bottom: 8px; }
.choices label.check { align-items: flex-start; margin: 0; }
.choices label.check > span { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.choices select { width: auto; min-width: 200px; }
.choices input[type=url] { flex: 1; min-width: 260px; }
nav.small-tabs { margin-top: 4px; }
nav.small-tabs a { padding: 6px 10px; font-size: 14px; }
td.actions form { margin-right: 4px; }
.search.filters { flex-wrap: wrap; }
.search.filters select { width: auto; }

/* ---------- layout: sidebar on the left ---------- */
body.with-nav { padding-left: var(--sidebar-w); }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--side); color: var(--side-text);
  padding: 20px 12px 16px; overflow-y: auto; z-index: 20;
}
.brand { display: block; padding: 4px 10px 22px; text-decoration: none; color: #fff; }
.brand img { display: block; width: 170px; max-width: 100%; height: auto; }
.brand-name { display: block; font-size: 19px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.brand-product { display: block; margin-top: 8px; font-size: 13px; color: var(--brand-gold); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item, .nav-group > summary {
  display: block; padding: 8px 10px 8px 14px; border-radius: 6px;
  color: var(--side-text); text-decoration: none; font-size: 15px;
  border-left: 3px solid transparent;
}
.nav-item:hover, .nav-group > summary:hover { background: var(--side-2); color: #fff; }
.nav-item.here { color: #fff; font-weight: 700; border-left-color: var(--brand-gold); background: var(--side-2); border-radius: 0 6px 6px 0; }
.nav-group > summary { cursor: pointer; list-style: none; position: relative; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after {
  content: ""; position: absolute; right: 12px; top: 50%;
  width: 7px; height: 7px; margin-top: -5px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s ease; opacity: .7;
}
.nav-group[open] > summary::after { transform: rotate(45deg); }
.nav-group[data-here] > summary { color: #fff; }
.nav-children { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 6px 12px; padding-left: 4px; border-left: 1px solid var(--side-2); }
.nav-children .nav-item { font-size: 14px; padding: 6px 10px; }
.sidebar-foot { border-top: 1px solid var(--side-2); margin-top: 16px; padding-top: 12px; }
.sidebar-foot .role { display: block; font-size: 12px; font-weight: 400; opacity: .75; }
.signout { background: none; border: 1px solid var(--side-2); color: var(--side-text); width: 100%; margin-top: 8px; padding: 7px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 14px; }
.signout:hover { background: var(--side-2); color: #fff; }
.sidebar a:focus-visible, .sidebar summary:focus-visible, .sidebar button:focus-visible,
.menu-btn:focus-visible { outline: 2px solid var(--brand-gold); outline-offset: 2px; }
.mobile-bar { display: none; }

@media (max-width: 860px) {
  body.with-nav { padding-left: 0; }
  .mobile-bar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 15;
    background: var(--side); color: #fff; padding: 10px 16px;
  }
  .mobile-brand { color: #fff; text-decoration: none; font-weight: 700; }
  .mobile-brand img { max-height: 28px; display: block; }
  .menu-btn { background: var(--side-2); color: #fff; border: 0; border-radius: 6px; padding: 6px 12px; font: inherit; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .nav-group > summary::after { transition: none; }
}
body.with-nav main { margin: 0; max-width: 1180px; padding: 28px 32px 56px; }
@media (max-width: 860px) { body.with-nav main { padding: 20px 16px 48px; } }
body.no-nav { background: var(--side); }
.login-brand { max-width: 380px; margin: 12vh auto 16px; color: #fff; padding: 0 4px; }
.login-brand img { max-height: 72px; display: block; }
.login-brand .brand-name { font-size: 24px; }
body.no-nav .login { margin-top: 0; }

:focus-visible { outline: 2px solid var(--brand-gold); outline-offset: 2px; }
.pill.waiting { background: #e7e9f3; color: #3c4a8a; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .pill.waiting { background: #23283d; color: #aab4e8; }
}
html[data-theme="dark"] .pill.waiting { background: #23283d; color: #aab4e8; }
.device-id { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.head-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.button.secondary { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.button.secondary:hover { border-color: var(--text); }
.field-help { margin: 2px 0 14px; }
.add-panel { border-color: var(--brand-gold); }

/* ---------- app cards (device Apps tab) ---------- */
.apps-heading { font-size: 15px; margin: 18px 0 10px; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.app-card {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  background: var(--bg); border: 1px solid var(--line); border-left: 4px solid transparent;
  border-radius: 8px; padding: 10px 12px; transition: border-color .2s ease, background-color .2s ease;
}
.app-card.state-disabled { border-left-color: var(--warn); }
.app-card.state-hidden { border-left-color: var(--muted); }
.app-card.state-hidden .app-icon, .app-card.state-disabled .app-icon { filter: grayscale(1); opacity: .55; }
.app-card.saving { opacity: .6; }
.app-card.saved { border-color: var(--brand-gold); }
.app-icon img { display: block; width: 40px; height: 40px; }
.app-letter {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: hsl(var(--hue), 30%, 88%); color: hsl(var(--hue), 35%, 28%); font-weight: 700; font-size: 18px;
}
.app-text { min-width: 0; display: flex; flex-direction: column; }
.app-text strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-pkg { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-reason { font-size: 12px; color: var(--muted); margin-top: 2px; }
.app-pending { align-self: flex-start; margin-top: 4px; font-size: 11px; }
.app-control select { width: auto; min-width: 150px; font-size: 14px; padding: 6px 8px; }
.app-card.state-disabled select { color: var(--warn); }
.app-card.state-hidden select { color: var(--muted); }
.app-locked { font-size: 13px; color: var(--muted); }
.other-apps { margin-top: 16px; }
.other-apps > summary { cursor: pointer; font-weight: 700; font-size: 15px; padding: 6px 0; }
.other-apps[open] > summary { margin-bottom: 10px; }
.app-legend { margin-top: 14px; }
.pill.app-pill-active { background: var(--good-bg); color: var(--good); }
.pill.app-pill-disabled { background: var(--warn-bg); color: var(--warn); }
.pill.app-pill-hidden { background: var(--line); color: var(--text); }
@media (max-width: 520px) {
  .app-card { grid-template-columns: 40px 1fr; }
  .app-control { grid-column: 1 / -1; }
  .app-control select { width: 100%; }
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .app-letter { background: hsl(var(--hue), 20%, 26%); color: hsl(var(--hue), 40%, 82%); }
}
html[data-theme="dark"] .app-letter { background: hsl(var(--hue), 20%, 26%); color: hsl(var(--hue), 40%, 82%); }
@media (prefers-reduced-motion: reduce) { .app-card { transition: none; } }
[hidden] { display: none !important; }
nav.small-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
nav.small-tabs a { white-space: nowrap; flex: none; }
.converted { border-left: 3px solid var(--brand-gold); padding: 2px 0 2px 12px; margin: 4px 0 12px; }
.converted p { margin: 4px 0; word-break: break-all; }
.trust-box p { margin: 6px 0; }
dl.cert { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 6px 0; }
dl.cert dt { font-weight: 700; }
dl.cert dd { margin: 0; word-break: break-all; }

/* ---------- new-password boxes ---------- */
.pw-wrap { display: flex; gap: 6px; align-items: stretch; }
.pw-wrap input { flex: 1; min-width: 0; }
.pw-show, .pw-generate { flex: none; padding: 0 12px; font-size: 13px; }
.pw-reveal { padding: 2px 10px; font-size: 13px; margin-left: 6px; }
.removal-pw { font-size: 16px; letter-spacing: .04em; }
.removal-change { margin: 8px 0 12px; }
.removal-change summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.pw-rules { list-style: none; padding: 0; margin: 2px 0 14px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); }
.pw-rules li::before { content: "\25CB"; margin-right: 6px; }            /* empty circle */
.pw-rules li.ok { color: var(--good); }
.pw-rules li.ok::before { content: "\2713"; }                          /* check mark */
.pw-rules.pw-optional:not(.typing) { display: none; }
.pill.removed { background: var(--bad-bg); color: var(--bad); }

/* QR code setup */
.head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.qr-card { text-align: center; }
.qr svg { width: 100%; max-width: 340px; height: auto; display: block; margin: 0 auto; background: #fff; }
.center { text-align: center; }
.qr-print-title { display: none; }
@media print {
  .sidebar, .mobile-bar, .no-print { display: none !important; }
  body.with-nav main { margin: 0 !important; padding: 0 !important; }
  .grid { display: block; }
  .qr-card { border: 0; box-shadow: none; }
  .qr svg { max-width: 12cm; }
  .qr-print-title { display: block; font-size: 20px; font-weight: 700; margin-bottom: 12px; }
}
.sidebar-foot .version { display: block; font-size: 12px; color: #8b9096; padding: 0 12px 8px; }

/* Sign-in page: follows the appearance setting (light or dark), with the tower-and-fields picture
   (static/login-art.svg, colored by --art-dark and --art-gold) in the bottom right corner. */
body.no-nav:has(.login-page) { background: #f4f4f2; }
body.no-nav:has(.login-page) main { max-width: none; margin: 0; padding: 0; }
.login-page { min-height: 100vh; min-height: 100dvh; position: relative; overflow: hidden;
              display: flex; align-items: center; }
.login-panel { position: relative; z-index: 1; width: 100%; max-width: 520px;
               padding: 32px 24px 32px clamp(24px, 8vw, 120px); }
.login-page .login-brand { margin: 0 0 18px; color: var(--text); max-width: 380px; }
.login-page .login-logo { max-height: 72px; display: block; }
.login-page .brand-product { color: #8a7a2c; }
.login-page .login { margin: 0; max-width: 380px; box-shadow: 0 10px 30px rgba(31, 34, 37, .08); }
.login-art { position: absolute; right: 0; bottom: 0; width: min(58vw, 860px); height: min(90vh, 880px); pointer-events: none; }
.login-art-svg { width: 100%; height: 100%; display: block; }
.login-art { --art-dark: #b9b9b6; --art-gold: #e6dcb0; }
@media (max-width: 860px) {
  .login-page { align-items: flex-start; padding-bottom: 36vh; }
  .login-panel { padding: 28px 16px 0; max-width: none; }
  .login-page .login, .login-page .login-brand { max-width: none; }
  .login-art { width: 100%; height: 34vh; }
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) body.no-nav:has(.login-page) { background: var(--side); }
  html:not([data-theme="light"]) .login-page .login-logo { content: url("/static/logo.png"); }
  html:not([data-theme="light"]) .login-page .brand-product { color: var(--brand-gold); }
  html:not([data-theme="light"]) .login-art { --art-dark: #34383c; --art-gold: #6f6638; }
}
html[data-theme="dark"] body.no-nav:has(.login-page) { background: var(--side); }
html[data-theme="dark"] .login-page .login-logo { content: url("/static/logo.png"); }
html[data-theme="dark"] .login-page .brand-product { color: var(--brand-gold); }
html[data-theme="dark"] .login-art { --art-dark: #34383c; --art-gold: #6f6638; }

/* Appearance switch (bottom of the sidebar): Light / Dark / System. */
.theme-switch { display: flex; gap: 2px; margin: 0 0 10px; padding: 3px; border-radius: 8px; background: var(--side-2); }
.theme-switch button { flex: 1; padding: 4px 0; font-size: 12px; border: 0; border-radius: 6px; background: transparent;
                       color: var(--side-text); cursor: pointer; min-height: 0; }
.theme-switch button[aria-pressed="true"] { background: var(--brand-gold); color: #1d2023; font-weight: 700; }
.theme-switch button:hover:not([aria-pressed="true"]) { background: rgba(255, 255, 255, .08); }
fieldset.choice-row { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; }
fieldset.choice-row legend { padding: 0; margin-bottom: 4px; }
/* App library: "Send to" pickers */
.send-to { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.send-to label { flex: 1; min-width: 200px; margin-bottom: 0; }
.send-to-form { display: grid; gap: 12px; justify-items: start; }
.send-to-form > label, .send-to-form .send-to { width: 100%; }
.send-to-change summary { cursor: pointer; color: var(--link); text-decoration: underline; margin-top: 4px; }
.send-to-change .send-to { flex-direction: column; align-items: stretch; gap: 6px; }
.send-to-change .send-to label { min-width: 0; }
.send-to-change form { margin-top: 6px; gap: 6px; min-width: 220px; }
h3.rule-group { grid-column: 1 / -1; margin: 14px 0 0; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
tr.rule-group th { padding-top: 16px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
/* Logs */
.pill.log-src-server { background: #e7e9f3; color: #3c4a8a; }
.pill.log-src-phone { background: #f3eedb; color: #6b5a12; }
table.logs td { vertical-align: top; }
tr.log-error td { background: color-mix(in srgb, var(--bad-bg) 45%, transparent); }
.pager { display: flex; gap: 16px; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .pill.log-src-server { background: #23283d; color: #aab4e8; }
  html:not([data-theme="light"]) .pill.log-src-phone { background: #332c12; color: #e0cd7a; }
}
html[data-theme="dark"] .pill.log-src-server { background: #23283d; color: #aab4e8; }
html[data-theme="dark"] .pill.log-src-phone { background: #332c12; color: #e0cd7a; }
/* 2-step verification */
.two-step-method { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.two-step-method h3 { margin: 0 0 6px; font-size: 16px; }
.two-step-method .row label { max-width: 360px; }
.totp-qr svg { width: 200px; height: auto; background: #fff; padding: 8px; border-radius: 8px; display: block; margin: 8px 0 12px; }
.key { word-break: break-all; user-select: all; }
.recovery-codes ul { columns: 2; list-style: none; padding: 0; font-size: 17px; line-height: 1.9; }
.two-step-other { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 4px; }

/* ---------- policy page: app pickers ---------- */
.app-picker { margin-bottom: 18px; }
.picker-chosen { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.picker-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px 5px 8px;
}
.picker-chip .app-letter, .picker-option .app-letter { width: 28px; height: 28px; border-radius: 7px; font-size: 14px; flex: none; }
.picker-chip img, .picker-option img { width: 28px; height: 28px; flex: none; }
.picker-chip-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.picker-chip-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-chip-text .app-pkg { font-size: 11px; }
.picker-remove {
  border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 6px;
  border-radius: 6px; cursor: pointer; width: auto; margin: 0;
}
.picker-remove:hover { color: var(--text); background: var(--line); }
.picker-search { width: 100%; max-width: 520px; }
.picker-results {
  max-width: 520px; max-height: 320px; overflow-y: auto; margin-top: 4px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
}
.picker-option {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 0; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 8px 10px; color: var(--text); cursor: pointer; font-weight: normal;
}
.picker-option:last-child { border-bottom: 0; }
.picker-option:hover, .picker-option:focus { background: var(--bg); outline: none; }
.picker-option .picker-chip-text { flex: 1; }
.picker-none { margin: 0; padding: 10px; }

/* Web filters: Google Play updates line */
.play-updates p { margin: 6px 0 4px; }
.inline-details { display: inline-block; margin-left: 10px; }
.inline-details summary { cursor: pointer; font-size: 13px; }
.inline-details p { margin: 4px 0 0; }

/* Certificates: "Install on" checkboxes */
.install-on { border: 0; padding: 0; margin: 4px 0 14px; display: flex; flex-direction: column; gap: 2px; }
.install-on legend { font-weight: 600; margin-bottom: 4px; padding: 0; }
.install-on .check { margin: 0; }
.cert-change { margin-top: 6px; }
.cert-change summary { cursor: pointer; font-size: 13px; color: var(--link); }
.cert-change form { margin-top: 8px; }

/* Per-app filter choice on app cards */
.app-control { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.app-control select.app-web { font-size: 13px; padding: 4px 6px; }
.app-control select.app-web.web-bypass { color: var(--warn); border-color: var(--warn); }

/* Web filters: one collapsible row per filter */
.filter-list h2 { margin-bottom: 10px; }
.filter-item { border-top: 1px solid var(--line); }
.filter-item:first-of-type { border-top: 0; }
.filter-item > summary {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 4px; cursor: pointer; list-style: none;
}
.filter-item > summary::-webkit-details-marker { display: none; }
.filter-item > summary:hover { background: var(--bg); }
.filter-name { display: flex; flex-direction: column; min-width: 180px; flex: 1; }
.filter-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-edit { color: var(--link); margin-left: auto; }
.filter-edit .when-open, .filter-item[open] .filter-edit .when-closed { display: none; }
.filter-item[open] .filter-edit .when-open { display: inline; }
.filter-body { padding: 4px 4px 18px; }

/* Device list: filters and sortable columns */
.device-filters { margin: 4px 0 12px; flex-wrap: wrap; }
th a.sort { color: inherit; text-decoration: none; white-space: nowrap; }
th a.sort:hover { text-decoration: underline; }
th a.sort.sorted { color: var(--text); }

/* Phone-width screens: nothing should scroll sideways (0.47) */
@media (max-width: 700px) {
  nav.small-tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 2px; }
  .settings-table { width: 100%; table-layout: fixed; }
  .settings-table td, .settings-table th { overflow-wrap: anywhere; }
  .settings-table select { min-width: 0; width: 100%; }
  .app-grid { grid-template-columns: minmax(0, 1fr); }
  .app-card { grid-template-columns: 40px minmax(0, 1fr); }
  .app-control { grid-column: 1 / -1; }
  .app-control select { min-width: 0; width: 100%; }
}

/* Users: one collapsible row per user (same look as web filters) */
.user-password { display: block; margin: 8px 0 4px; }
.user-password > summary { color: var(--link); }
.user-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* Devices page: phones still on an old dashboard address (0.54) */
.move-banner { margin: 12px 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.move-banner p { margin: 0; }
.move-banner form { display: inline; }
.move-form { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.move-form .row { display: flex; gap: 8px; flex-wrap: wrap; }
.move-form input[type=url] { flex: 1 1 220px; min-width: 0; }
