/* AppNator, design A "Studio" (docs/design/a-studio.html): light business look, dark sidebar.
   Every colour comes from these tokens; components never type out hex values. */
:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --bg-elev: #ffffff;
  --bg-row: #fafbfc;
  --bg-sunk: #f0f2f5;
  --border: #e3e6eb;
  --border-soft: #eef0f3;
  --text: #1a1f29;
  --text-dim: #5d6675;
  --text-faint: #98a1ae;
  --accent: #2f5bea;
  --accent-soft: #eaf0ff;
  --good: #137a43;
  --warn: #b26a00;
  --crit: #c8312f;
  --info: var(--accent);
  --tint-good: #e3f6ea;
  --tint-warn: #fff4e0;
  --tint-crit: #fdecec;
  --tint-info: var(--accent-soft);
  --tint-neutral: #eef0f3;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);
  --sidebar: #111827;
  --sidebar-hover: #1a2333;
  --sidebar-active: #1f2a3d;
  --sidebar-text: #c9d1dc;
  --sidebar-faint: #6b7686;
  --radius: 10px;
  --radius-sm: 8px;
  --sidebar-w: 232px;
  --max-w: 1440px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root.theme-dark {
  color-scheme: dark;
  --bg: #0f1419;
  --bg-elev: #161d26;
  --bg-row: #1a222c;
  --bg-sunk: #121820;
  --border: #2a3542;
  --border-soft: #222c37;
  --text: #e3e9ef;
  --text-dim: #9aa6b4;
  --text-faint: #66727f;
  --accent: #5b8cff;
  --accent-soft: color-mix(in srgb, #5b8cff 16%, transparent);
  --good: #4ec27f;
  --warn: #e0a82e;
  --crit: #f0616d;
  --tint-good: color-mix(in srgb, #4ec27f 15%, transparent);
  --tint-warn: color-mix(in srgb, #e0a82e 15%, transparent);
  --tint-crit: color-mix(in srgb, #f0616d 15%, transparent);
  --tint-neutral: #222c37;
  --shadow: none;
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
  --sidebar: #0b0f14;
  --sidebar-hover: #141b24;
  --sidebar-active: #1a2330;
}

* { box-sizing: border-box; }
/* hidden always wins, also over display rules of buttons, rows and chips */
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 12px; }

/* ---- Shell: sidebar + content ---- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.company-logo { display: block; padding: 6px 10px 20px; }
.company-logo:hover { text-decoration: none; }
.company-logo span { display: block; margin: 6px 0 0 26px; font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sidebar-faint); }
.sidebar .brand-mobile { display: none; }
.company-logo img { display: block; height: 20px; width: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 16px; padding: 4px 10px 18px; }
.brand:hover { text-decoration: none; }
.brand-emblem {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, #4f7bff, #2f5bea); color: #fff; font-size: 14px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: inherit; font-size: 14px;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: 0.85; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sidebar-faint); padding: 18px 10px 6px; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid #222d3f; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sidebar-foot .who { min-width: 0; flex: 1; display: block; border-radius: 6px; padding: 4px 6px; margin: -4px -6px; }
.sidebar-foot .who:hover { text-decoration: none; background: #1b2434; }
.sidebar-foot .konto-btn { display: none; }
.sidebar-foot .who div { color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who small { color: var(--sidebar-faint); }
.icon-btn {
  width: 30px; height: 30px; border-radius: var(--radius-sm); border: 0; background: none; color: var(--sidebar-text);
  display: grid; place-items: center; cursor: pointer; font-size: 15px;
}
.icon-btn:hover { background: var(--sidebar-hover); color: #fff; }
.icon-btn svg { width: 16px; height: 16px; }

main { padding: 24px 32px 48px; max-width: var(--max-w); width: 100%; min-width: 0; }
.plain main { margin: 0 auto; max-width: 560px; padding-top: 48px; }
.legal { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 40px; font-size: 12px; color: var(--text-faint); }
.legal a { color: var(--text-faint); }
.legal a:hover { color: var(--text); }
.legal-made { margin-left: auto; }
.legal .heart { color: #e5484d; }
/* without the sidebar everything is centred, the footer too */
.plain .legal { justify-content: center; }
.plain .legal-made { margin-left: 0; flex-basis: 100%; text-align: center; }
.prose { max-width: 720px; line-height: 1.6; }
.prose h2 { font-size: 16px; margin: 28px 0 8px; }
.prose ul { padding-left: 20px; }
.prose li { margin: 4px 0; }
.plain-brand { display: flex; justify-content: center; margin-bottom: 18px; }
.plain-logo { display: block; }
.plain-logo:hover { text-decoration: none; }
.plain-logo img { display: block; height: 24px; width: auto; }
.plain-logo span { display: block; margin: 7px 0 0 31px; font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); }
.plain-logo .logo-dark, .theme-dark .plain-logo .logo-light { display: none; }
.theme-dark .plain-logo .logo-dark { display: block; }

/* ---- Typography ---- */
/* every page title takes the height of the search field, so it sits at the same place with
   or without a toolbar */
h1 { margin: 0 0 16px; padding: 6px 0; min-height: 41px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
h1 small { font-size: 13px; font-weight: 400; color: var(--text-faint); margin-left: 8px; letter-spacing: 0; }
h1 a { color: var(--text-dim); }
h2 { margin: 0; font-size: 14px; font-weight: 600; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.path { font-weight: 600; color: var(--text); }

/* ---- Toolbar, search, chips ---- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; min-height: 41px; }
.toolbar h1 { margin: 0; }
.toolbar .grow { flex: 1; }
/* button and search field in the page head: one height, one corner radius */
.toolbar .btn, .toolbar .search { height: 40px; border-radius: 9px; }
.toolbar .btn { padding: 0 16px; font-size: 14px; }
.search {
  width: 320px; max-width: 100%; padding: 9px 14px 9px 36px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg-elev) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2398a1ae' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") 12px 50% no-repeat;
  color: var(--text); font: inherit;
}
.search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chips { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-elev);
  font: 13px var(--font); color: var(--text-dim); cursor: pointer;
}
.chip:hover { border-color: var(--text-faint); color: var(--text); }
.chip.on { background: var(--text); color: var(--bg-elev); border-color: var(--text); }

/* ---- Cards (panels) and tables ---- */
.panel { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.panel-body { padding: 16px; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint);
  font-weight: 600; padding: 11px 16px; border-bottom: 1px solid var(--border); background: var(--bg-elev);
}
td { padding: 11px 16px; border-bottom: 1px solid var(--border-soft); font-size: 14px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--bg-row); }
.scroll { overflow-x: auto; }

/* ---- Badges ("pills" with a dot) ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--tint-neutral); color: var(--text-dim);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-good { background: var(--tint-good); color: var(--good); }
.badge-warn { background: var(--tint-warn); color: var(--warn); }
.badge-crit { background: var(--tint-crit); color: var(--crit); }
.badge-info { background: var(--tint-info); color: var(--accent); }

.notice { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; }
.notice-warn { background: var(--tint-warn); color: var(--warn); }
.notice-info { background: var(--tint-info); color: var(--accent); }
.notice-crit { background: var(--tint-crit); color: var(--crit); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
  font: 500 13px var(--font); cursor: pointer; white-space: nowrap; box-shadow: var(--shadow);
}
.btn:hover { background: var(--bg-row); border-color: var(--text-faint); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); border-color: transparent; }
.btn-danger { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 40%, transparent); }
.btn-danger-solid { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn-block { width: 100%; }

/* ---- Forms ---- */
form.upload { display: grid; gap: 14px; max-width: 560px; }
label { display: grid; gap: 5px; font-size: 13px; color: var(--text-dim); font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], input[type="file"], select {
  font: 14px var(--font); color: var(--text); background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 11px;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.stack { display: grid; gap: 14px; }
.row-label { display: grid; gap: 5px; }
.check { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text); font-weight: 400; }
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
form.inline { display: inline; margin: 0; }
form.danger { margin-top: 24px; }
.copy-row { display: flex; gap: 8px; margin-top: 8px; }
.copy-row input { flex: 1; font-family: var(--mono); font-size: 12px; }
.auth { max-width: 420px; margin: 0 auto; }
.auth form.upload { max-width: none; }

/* ---- App icons ---- */
.app-icon {
  display: inline-flex; flex: none; align-items: center; justify-content: center; object-fit: cover;
  background: var(--bg-sunk); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06); color: var(--text-faint); font-weight: 700;
}
img.app-icon { background: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.12); }
.app-icon-xl { width: 76px; height: 76px; border-radius: 18px; font-size: 30px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); }
.app-icon-lg { width: 40px; height: 40px; border-radius: 10px; font-size: 17px; }
.app-icon-sm { width: 20px; height: 20px; border-radius: 5px; font-size: 10px; }

/* ---- App overview table ---- */
.app-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; color: inherit; }
.app-cell b { display: block; color: var(--text); font-weight: 600; }
.app-cell code { color: var(--text-faint); font-size: 11px; }
.app-cell:hover { text-decoration: none; }
.app-cell:hover b { color: var(--accent); }
.ver { font-variant-numeric: tabular-nums; font-weight: 600; margin-right: 6px; white-space: nowrap; }
.ver i { font-style: normal; color: var(--text-faint); font-weight: 400; }
.expiry { color: var(--crit); font-size: 12px; font-weight: 600; margin-left: 6px; white-space: nowrap; }
tr[hidden] { display: none; }

/* ---- App page ---- */
.hero { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.hero h1 { margin: 0; padding: 0; min-height: 0; font-size: 24px; }
.hero .meta { color: var(--text-dim); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.hero .grow { flex: 1; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs a { padding: 10px 0; color: var(--text-dim); font-weight: 500; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.tabs a:focus { outline: none; }
.tabs a:focus-visible { color: var(--text); background: var(--accent-soft); border-radius: 6px 6px 0 0; }

.qr { display: block; background: #fff; border-radius: 6px; line-height: 0; padding: 4px; box-shadow: 0 0 0 1px var(--border); }
.qr svg { display: block; width: 72px; height: 72px; }
.danger-zone { border-top: 1px solid var(--border-soft); padding-top: 14px; }

.tabs[hidden] { display: none; }

/* ---- ⋯ menus (build actions, user list) ---- */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-btn {
  width: 28px; height: 24px; border-radius: 6px; display: grid; place-items: center; cursor: pointer;
  color: var(--text-faint); font-size: 18px; font-weight: 700; line-height: 1; user-select: none;
}
.menu-btn:hover, .menu[open] > .menu-btn { background: var(--bg-sunk); color: var(--text); }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 210px; padding: 4px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.menu-list form { margin: 0; }
.menu-list button {
  display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px;
  font: 500 13px var(--font); color: var(--text); cursor: pointer;
}
.menu-list button:hover:not(:disabled) { background: var(--bg-row); }
.menu-list button:disabled { color: var(--text-faint); cursor: not-allowed; }
.menu-list button small { display: block; font-weight: 400; font-size: 11px; color: var(--text-faint); }
.menu-list button.danger { color: var(--crit); }
/* an open menu reaches past the table: its panel and scroll box must not clip it */
.panel:has(details.menu[open]), .scroll:has(details.menu[open]), .vt-wrap:has(details.menu[open]) { overflow: visible; }
.build-menu { margin-left: 2px; }
td.row-menu { width: 40px; text-align: right; }
tr.hit td { background: var(--accent-soft); }
tr.row-off td { opacity: 0.55; }
tr.row-off td b { text-decoration: line-through; }
.access-summary { margin: 0 0 16px; color: var(--text-dim); }
.access-summary b { color: var(--text); }

/* QR codes: a button that opens the big one */
button.qr { border: 0; cursor: zoom-in; font: inherit; }
button.qr:hover { box-shadow: 0 0 0 2px var(--accent); }
.qr-modal { text-align: center; width: min(400px, calc(100vw - 32px)); }
.qr-modal h2 { font-size: 15px; }
.qr.qr-xl { display: inline-block; padding: 12px; margin: 8px 0 12px; }
.qr.qr-xl svg { width: 280px; height: 280px; }
.qr-modal .modal-actions { justify-content: center; }

/* ---- Dialog ---- */
.modal {
  width: min(440px, calc(100vw - 32px)); padding: 22px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-lg);
}
.modal::backdrop { background: rgba(15, 20, 30, 0.45); }
.modal h2 { font-size: 17px; margin: 0 0 8px; }
.modal p { margin: 0 0 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---- Install page (phone) ---- */
.install { max-width: 480px; margin: 0 auto; text-align: center; }
.install .app-name { font-size: 22px; font-weight: 700; margin: 12px 0 2px; }
.install .btn-install {
  display: block; width: 100%; height: 52px; line-height: 52px; margin: 20px 0 8px; border-radius: 12px;
  background: var(--accent); color: #fff; font-size: 17px; font-weight: 600;
}
.install .btn-install:hover { text-decoration: none; }
.steps { text-align: left; margin: 20px 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; padding: 10px 0 10px 36px; border-top: 1px solid var(--border-soft); font-size: 14px; }
.steps li::before {
  counter-increment: step; content: counter(step); position: absolute; left: 0; top: 10px; width: 24px; height: 24px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}

/* ---- Phones: sidebar becomes a top bar, lanes stack ---- */
/* Lists on phones (access, people): each row a card, cells labelled from their column */
@media (max-width: 860px) {
  .card-table thead { display: none; }
  .card-table, .card-table tbody, .card-table tr, .card-table td { display: block; }
  .card-table tr { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); position: relative; }
  .card-table tbody tr:last-child { border-bottom: 0; }
  .card-table tbody tr:hover td { background: none; }
  .card-table td { border: 0; padding: 2px 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
  .card-table td:first-child { padding-bottom: 6px; font-size: 15px; }
  .card-table td[data-label]::before { content: attr(data-label); width: 96px; flex: none; color: var(--text-faint); font-size: 12px; font-weight: 500; }
  .card-table td.row-menu { position: absolute; top: 10px; right: 12px; width: auto; padding: 0; }
  .card-table td:empty { display: none; }
}

/* Overview on phones: one card per app instead of a wide table */
@media (max-width: 860px) {
  .app-table thead { display: none; }
  .app-table, .app-table tbody, .app-table tr, .app-table td { display: block; }
  .app-table tr { padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
  .app-table tbody tr:last-child { border-bottom: 0; }
  .app-table tbody tr:hover td { background: none; }
  .app-table td { border: 0; padding: 3px 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
  .app-table td:first-child { padding-bottom: 8px; }
  .app-table td[data-label]::before {
    content: attr(data-label); width: 74px; flex: none; color: var(--text-faint); font-size: 12px; font-weight: 500;
  }
  .app-table td.no-version { display: none; }
  .app-table .app-cell { min-width: 0; }
  .app-table .app-cell span { min-width: 0; }
  .app-table .app-cell b, .app-table .app-cell code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 2px; padding: 10px 12px; overflow-x: auto; }
  .sidebar .brand { padding: 4px 6px 4px 0; margin-right: auto; font-size: 0; gap: 0; }
  .sidebar .brand-emblem { font-size: 14px; }
  .plain main { padding-top: 28px; }
  .nav-section, .company-logo { display: none; }
  .sidebar .brand-mobile { display: flex; }
  .nav-item { padding: 6px 9px; font-size: 13px; }
  .nav-item svg { display: none; }
  .sidebar-foot { margin: 0 0 0 4px; padding: 0; border: 0; gap: 0; }
  .nav-item { white-space: nowrap; }
  .sidebar-foot .who { display: none; }
  .sidebar-foot .konto-btn { display: inline-flex; }
  main { padding: 16px; }
  .search { width: 100%; }
  td, th { padding: 9px 12px; }
  .btn { padding: 9px 14px; }
}

/* "Als App": QR code beside the steps per platform */
.store-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; margin-top: 16px; }
.store-grid .panel { margin-bottom: 0; }
.store-qr .panel-body { text-align: center; }
.store-qr .faint { margin: 12px 0 0; }
.qr.qr-lg { display: inline-block; padding: 8px; }
.qr.qr-lg svg { width: 180px; height: 180px; }
.steps li:first-child { border-top: 0; }
.panel-body > .steps { margin-top: 0; }

/* Error page */
.error-panel { max-width: 460px; margin: 24px auto 0; text-align: center; }
.error-panel .panel-body { padding: 32px 28px; }
.error-code { font-size: 44px; font-weight: 800; color: var(--text-faint); letter-spacing: -0.02em; line-height: 1; margin-bottom: 8px; }
.error-panel h1 { margin-bottom: 8px; padding: 0; min-height: 0; }
.error-panel p { margin: 0 0 22px; }

/* Opened from the home screen: "Als App" is done */
@media (display-mode: standalone) {
  .nav-store { display: none; }
}
#pwa-install { margin-bottom: 14px; }

/* Install page: back link, help that folds away */
.install .back-link { display: block; text-align: left; margin-bottom: 10px; font-size: 14px; }
.install-help { text-align: left; margin-top: 18px; }
.install-help > summary { cursor: pointer; color: var(--text-dim); font-size: 13px; font-weight: 500; }
.install-help[open] > summary { margin-bottom: 4px; }
.install-help .help-off { margin-top: 14px; font-size: 13px; color: var(--text-dim); }
.modal-actions-stack { flex-direction: column; align-items: stretch; }
.modal p b { color: var(--text); }

/* Variant tag (Stage, Prod, Test) next to the app name */
.variant {
  display: inline-block; vertical-align: middle; margin-left: 6px; padding: 1px 7px; border-radius: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; line-height: 1.6;
  border: 1px solid currentColor;
}
.variant-prod { color: var(--good); }
.variant-stage, .variant-test { color: var(--warn); }
h1 .variant { font-size: 12px; }
.install-icon { display: block; margin: 6px auto 4px; }
.link-share { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.link-share:hover { text-decoration: underline; }
#share-dialog .copy-row { margin: 0 0 8px; }

/* ---- Version table (design B): platforms as rows, stages left to right ---- */
.vt-wrap { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 14px; box-shadow: var(--shadow); }
.vt { width: 100%; border-collapse: collapse; table-layout: fixed; }
.vt th { text-align: left; vertical-align: top; padding: 12px 16px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.vt th .bar { display: block; height: 3px; border-radius: 2px; margin-bottom: 8px; background: var(--c); }
.vt th .faint { font-size: 11px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.vt td { padding: 14px 16px; vertical-align: top; border-bottom: 1px solid var(--border-soft); }
.vt tbody tr:last-child td { border-bottom: 0; }
.vt tbody tr:hover td { background: none; }
.vt .plat-col { width: 190px; }
.vt td.plat-col code { display: block; margin-top: 4px; font-size: 10px; color: var(--text-faint); word-break: break-all; }
.vt .plat { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.stage-development { --c: #98a1ae; }
.stage-review { --c: var(--warn); }
.stage-released { --c: var(--good); }
.vt td.stage-review, .vt th.stage-review { background: color-mix(in srgb, var(--warn) 5%, transparent); }
.vt td.stage-released, .vt th.stage-released { background: color-mix(in srgb, var(--good) 5%, transparent); }
.vt .stage-batch { margin-top: 6px; text-transform: none; letter-spacing: 0; }
.v { display: flex; align-items: flex-start; gap: 8px; }
.v .info { flex: 1; min-width: 0; }
.v .info b { font-size: 15px; } .v .info i { font-style: normal; color: var(--text-faint); }
.v .sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.link-act { border: 0; background: none; padding: 0; margin-top: 8px; font: 600 13px var(--font); color: var(--accent); cursor: pointer; }
.link-act:hover { text-decoration: underline; }
.qr-icon { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--border); display: grid; place-items: center; background: var(--bg-elev); color: var(--text-dim); flex: none; cursor: zoom-in; }
.qr-icon:hover { color: var(--accent); border-color: var(--accent); }
.qr-icon svg { width: 16px; height: 16px; }
.vt .none { color: var(--text-faint); font-size: 13px; }
.install-btn { margin-top: 12px; width: 100%; padding: 12px 16px; font-size: 16px; font-weight: 600; }
/* customers on a computer: the QR code right in the cell, big enough to scan */
.qr-big { text-align: center; margin-top: 14px; }
.qr-big .qr { display: inline-block; padding: 8px; border: 0; cursor: zoom-in; }
.qr-big .qr svg { width: 180px; height: 180px; }
.qr-big .faint { display: block; margin-top: 6px; font-size: 12px; }
.vt-customer .v .info b { font-size: 20px; }
@media (max-width: 860px) {
  .vt, .vt tbody, .vt tr, .vt td { display: block; width: auto; }
  .vt thead { display: none; }
  .vt .plat-col { width: auto; padding-bottom: 6px; }
  .vt td { border-bottom: 0; }
  .vt td[data-label] { border-left: 4px solid var(--c); margin: 0 12px 10px; border-radius: 8px; }
  .vt td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c); margin-bottom: 6px; }
  .vt tbody tr { padding-bottom: 6px; border-bottom: 1px solid var(--border-soft); }
}

/* Status page */
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 16px; }
.stat b { font-size: 22px; }
.meter { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); }
.card-table th.num, .card-table td.num { text-align: right; }
.badges { display: inline-flex; flex-wrap: wrap; gap: 4px; }

/* Second factor */
.totp-qr { width: 180px; }
.totp-qr svg { display: block; width: 100%; height: auto; border-radius: 6px; }
.totp-secret { font-size: 14px; letter-spacing: 0.04em; word-break: break-all; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 6px 28px; padding: 0; margin: 0 0 14px; list-style: none; }
.recovery-codes code { font-size: 15px; }
.reset-2fa { margin-top: 10px; }
.or { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; color: var(--text-faint); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-mway { border-color: var(--accent); }
.login-mway-label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.btn-ms { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1b1b1b; border: 1px solid #8c8c8c; font-weight: 600; }
.btn-ms:hover { text-decoration: none; background: #f3f3f3; }
.btn-ms svg { width: 18px; height: 18px; }

/* Mein Konto */
.account { max-width: 780px; }
.profile { display: flex; align-items: center; gap: 16px; padding: 20px; }
.avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 20px; font-weight: 700; letter-spacing: 0.02em; }
.profile-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.profile-name { font-size: 18px; font-weight: 600; }
.settings-list { list-style: none; margin: 0; padding: 0; }
.setting { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-top: 1px solid var(--border-soft); }
.setting:first-child { border-top: 0; }
.setting-icon { flex: none; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-sunk); color: var(--text-dim); }
.setting-icon svg { width: 18px; height: 18px; }
.setting-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.setting-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sub-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.sub-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 8px; background: var(--bg-sunk); }
.sub-list form { margin: 0 0 0 auto; }
.link-danger { background: none; border: 0; padding: 0; color: var(--crit); font: inherit; font-size: 13px; cursor: pointer; }
.link-danger:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .setting { flex-wrap: wrap; }
  .setting-actions { width: 100%; justify-content: flex-start; padding-left: 50px; }
  .profile { flex-wrap: wrap; }
}
.check-group { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.check-group legend { font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 4px; padding: 0; }
.modal { width: min(480px, calc(100vw - 32px)); }
.modal form.stack, .modal .stack { gap: 12px; }
.modal input[type="text"], .modal input[type="email"], .modal input[type="password"], .modal select { width: 100%; }
.panel-head h2 .faint { font-weight: 400; margin-left: 6px; }

/* Mandanten */
.tenant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 24px; }
.tenant-card { display: flex; flex-direction: column; gap: 16px; padding: 18px; margin: 0; color: var(--text); transition: border-color .12s, box-shadow .12s, transform .12s; }
.tenant-card:hover { text-decoration: none; border-color: var(--accent); box-shadow: 0 6px 18px rgba(20, 30, 60, .08); transform: translateY(-1px); }
.tenant-card-head { display: flex; align-items: center; gap: 12px; }
.tenant-card-name { flex: 1; min-width: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-card-go { width: 18px; height: 18px; color: var(--text-faint); transition: transform .12s, color .12s; }
.tenant-card:hover .tenant-card-go { color: var(--accent); transform: translateX(3px); }
.avatar-sm { width: 40px; height: 40px; font-size: 15px; border-radius: 11px; }
.tone-0 { background: #e8efff; color: #2f5fe0; } .tone-1 { background: #e6f6ee; color: #1f8a55; }
.tone-2 { background: #fff1e0; color: #c26a12; } .tone-3 { background: #f3e9ff; color: #7b45d1; }
.tone-4 { background: #e3f6f8; color: #18808f; } .tone-5 { background: #ffe8ec; color: #c23756; }
.theme-dark [class*="tone-"] { background: color-mix(in srgb, currentColor 18%, transparent); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); padding: 12px 0; }
.stats div { display: grid; gap: 2px; padding: 0 12px; border-left: 1px solid var(--border-soft); }
.stats div:first-child { border-left: 0; padding-left: 0; }
.stats dd { margin: 0; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stats dt { font-size: 12px; color: var(--text-faint); }
.tenant-teams { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; align-items: center; }
.tenant-add { align-items: center; justify-content: center; gap: 8px; min-height: 180px; border: 2px dashed var(--border); border-radius: var(--radius); background: transparent; color: var(--text-dim); font: 600 14px var(--font); cursor: pointer; }
.tenant-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.tenant-add-plus { font-size: 28px; line-height: 1; font-weight: 400; }
.chip-static { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--bg-sunk); color: var(--text-dim); }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border-soft); }
.plain-list li:first-child { border-top: 0; }
.plain-list li .btn { margin-left: auto; }
.panel-head h2 .badge { margin-left: 6px; vertical-align: 2px; }
@media (max-width: 640px) {
  .plain-list li { flex-wrap: wrap; gap: 4px 12px; }
  .plain-list li code { flex-basis: 100%; order: 3; word-break: break-all; }
  .tenant-add { min-height: 88px; flex-direction: row; }
}
/* App page, MWAY: who sees which stages */
.vt .vt-band th { padding: 8px 16px; font-size: 12px; letter-spacing: 0.02em; text-transform: none; border-bottom: 0; }
.vt .vt-band th svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.vt .vt-band .band-internal { color: var(--text-dim); background: var(--bg-sunk); }
.vt .vt-band .band-public { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.vt .vt-band .band-blocked { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
