/* =====================================================================
   AdSense Monitor – Styles
   ===================================================================== */
:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #0f766e;
  --primary-2: #2563eb;
  --primary-soft: rgba(15, 118, 110, .10);
  --accent: #eab308;
  --good: #16a34a;
  --bad: #dc2626;
  --warn: #d97706;
  --info: #2563eb;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 30px -14px rgba(15, 23, 42, .18);
  --radius: 18px;
  --radius-sm: 12px;
  --nav-h: 64px;
  --sidebar-w: 236px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --chart-grid: rgba(15, 23, 42, .08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --surface: #121a2b;
    --surface-2: #182236;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --border: #243049;
    --primary: #2dd4bf;
    --primary-2: #60a5fa;
    --primary-soft: rgba(45, 212, 191, .12);
    --good: #4ade80;
    --bad: #f87171;
    --warn: #fbbf24;
    --info: #60a5fa;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
    --chart-grid: rgba(255, 255, 255, .08);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #121a2b;
  --surface-2: #182236;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: #243049;
  --primary: #2dd4bf;
  --primary-2: #60a5fa;
  --primary-soft: rgba(45, 212, 191, .12);
  --good: #4ade80;
  --bad: #f87171;
  --warn: #fbbf24;
  --info: #60a5fa;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
  --chart-grid: rgba(255, 255, 255, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
  min-height: 100dvh;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1rem; }
p { margin: .4em 0; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 6px; }
a { color: var(--primary-2); }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.error { color: var(--bad); font-size: .9rem; }
.up { color: var(--good); }
.down { color: var(--bad); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 1px solid transparent; border-radius: 12px; padding: .6em 1.1em;
  font: inherit; font-weight: 600; cursor: pointer; background: var(--surface-2); color: var(--text);
  transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:hover { filter: brightness(1.05); }
.btn-primary { background: linear-gradient(135deg, #0f766e, #2563eb); color: #fff; }
.btn-secondary { border-color: var(--border); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-sm { padding: .4em .8em; font-size: .85rem; border-radius: 10px; }
.btn-lg { padding: .85em 1.4em; font-size: 1.05rem; width: 100%; }
.icon-btn {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
}
.icon-btn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

select, input[type="date"], input[type="search"], input[type="number"] {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: .5em .7em; min-height: 40px;
}
select:focus, input:focus, .btn:focus-visible, .nav-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Login ---------- */
.screen {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(15, 118, 110, .35), transparent 60%),
    radial-gradient(800px 500px at 110% 110%, rgba(37, 99, 235, .35), transparent 60%),
    var(--bg);
}
.login-card {
  width: min(420px, 100%); background: var(--surface); border-radius: 24px; padding: 32px 28px;
  box-shadow: var(--shadow); text-align: center; border: 1px solid var(--border);
}
.login-logo { border-radius: 20px; }
.login-card h1 { font-size: 1.6rem; margin: 12px 0 4px; }
.login-card .lead { color: var(--muted); margin-bottom: 20px; }

/* ---------- Layout ---------- */
#app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border); padding: 20px 14px;
  display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; height: 100dvh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px; }
.brand img { border-radius: 12px; }
.brand div { display: flex; flex-direction: column; line-height: 1.2; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent;
  color: var(--muted); font: inherit; font-weight: 600; padding: .65em .8em; border-radius: 12px; cursor: pointer; text-align: left;
}
.nav-btn .ico { font-size: 1.1em; width: 1.3em; text-align: center; }
.nav-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-btn.active { background: var(--primary-soft); color: var(--primary); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 6px; }

main { padding: 16px 20px 32px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-logo { display: none; border-radius: 8px; }
.topbar h2 { font-size: 1.35rem; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.status { font-size: .8rem; color: var(--muted); }

.banner { border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 12px; font-size: .9rem; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner.warn { background: rgba(217, 119, 6, .12); color: var(--warn); }
.banner.info { background: rgba(37, 99, 235, .12); color: var(--info); }

/* ---------- Filter ---------- */
.filters {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 999px;
  padding: .35em .9em; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.range { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.custom-range { display: flex; gap: 6px; align-items: center; }
.toggle { display: inline-flex; align-items: center; gap: .4em; font-size: .85rem; color: var(--muted); cursor: pointer; }
#range-label { flex-basis: 100%; }
#domain-chips { flex-basis: 100%; padding-top: 8px; border-top: 1px dashed var(--border); }
.chip-toggle { display: inline-flex; align-items: center; gap: .45em; }
.chip-toggle .caret { display: inline-block; color: var(--muted); transition: transform .15s ease; font-size: .9em; }
.chip-toggle[aria-expanded="true"] .caret { transform: rotate(90deg); }
.chip-toggle.has-filter { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.chip-toggle.has-filter .caret { color: var(--primary); }

/* ---------- Tiles ---------- */
.section-title { font-size: .95rem; margin: 8px 0 10px; color: var(--muted); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 12px; box-shadow: var(--shadow); overflow: hidden; min-height: 96px;
}
.tile::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
}
.tile.accent-good::before { background: var(--good); }
.tile.accent-warn::before { background: var(--warn); }
.tile.accent-bad::before { background: var(--bad); }
.tile .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.tile .value { font-size: 1.55rem; font-weight: 800; margin: 3px 0 2px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .sub { font-size: .78rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.tile .delta { font-weight: 700; }
.tile .spark { position: absolute; right: 10px; bottom: 8px; width: 80px; height: 28px; opacity: .55; }

/* Hervorgehobene „Heute“-Kachel: doppelt so breit, größere Zahl */
.tile-hero {
  grid-column: span 2; min-height: 132px; padding: 18px 22px 16px;
  background: linear-gradient(135deg, var(--primary-soft), transparent 70%), var(--surface);
}
.tile-hero .label { font-size: .8rem; }
.tile-hero .value { font-size: 2.7rem; margin: 6px 0 4px; }
.tile-hero .sub { font-size: .9rem; }
.tile-hero .spark { right: 18px; bottom: 14px; width: 160px; height: 52px; opacity: .6; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0;
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 16px; }
.chart-wrap { position: relative; height: 300px; }
.chart-wrap.small { height: 240px; }

/* Dashboard-/Prognose-Raster: 6 Spalten, Karten mit span-2/3/6 – frei anordenbar */
.dash-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
.dash-grid > .card { margin-bottom: 0; grid-column: span 6; }
.dash-grid > .span-3 { grid-column: span 3; }
.dash-grid > .span-2 { grid-column: span 2; }

/* ---------- Kacheln: anordnen & minimieren ---------- */
.tiles { align-items: start; }
.sortable > [data-wid] { position: relative; }
.w-ctl { display: inline-flex; gap: 2px; align-items: center; flex: none; }
.tile > .w-ctl { position: absolute; top: 6px; right: 6px; z-index: 2; }
.card > .card-head > .w-ctl { margin-left: auto; align-self: center; }
.w-btn {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted);
  font: inherit; font-size: 1rem; font-weight: 700; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.w-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.w-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.w-handle { cursor: grab; touch-action: none; letter-spacing: -.15em; font-size: .95rem; user-select: none; -webkit-user-select: none; }
.w-handle:active { cursor: grabbing; }
/* Griffe nur im Anpassen-Modus; „–“ bei Kacheln ebenfalls, „+“ bei minimierten Kacheln immer */
.w-handle, .tile .w-min { display: none; }
body.layout-edit .w-handle, body.layout-edit .tile .w-min, .tile.collapsed .w-min { display: grid; }
body.layout-edit .sortable > [data-wid] { outline: 1.5px dashed color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: 2px; }
body.layout-edit .tile { padding-right: 70px; }
.sortable > .dragging { opacity: .55; transform: scale(.98); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .45); z-index: 5; }
.sortable > [data-wid] { transition: transform .12s ease, opacity .12s ease; }

.tile.collapsed { min-height: 0; padding: 9px 72px 9px 14px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tile.collapsed .label { margin: 0; }
.tile.collapsed .value { font-size: 1rem; margin: 0; }
.tile.collapsed .sub, .tile.collapsed .spark { display: none; }
.tile-hero.collapsed { background: var(--surface); }
.tile-hero.collapsed .value { font-size: 1.05rem; }
.card.collapsed > :not(.card-head) { display: none; }
.card.collapsed > .card-head { margin-bottom: 0; }
.card.collapsed > .card-head h3::after { content: " · minimiert"; color: var(--muted); font-weight: 500; font-size: .8rem; }

.layout-bar { justify-content: space-between; }
.layout-bar kbd { font-family: var(--mono); font-size: .85em; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 0 .35em; color: var(--text); }
#btn-layout.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
#auth-banner { justify-content: space-between; }

/* ---------- Segment-Umschalter (Statistik) ---------- */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; margin-bottom: 12px; }
.seg-btn { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: .88rem; padding: .45em .95em; border-radius: 9px; color: var(--muted); cursor: pointer; }
.seg-btn.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.seg-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* Listen */
.list { display: flex; flex-direction: column; gap: 6px; }
.list-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; font-size: .9rem; }
.list-row .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.list-row .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); }
.list-row .val { font-variant-numeric: tabular-nums; font-weight: 700; }
.list-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.domain-list { display: flex; flex-direction: column; gap: 10px; }
.domain-row {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 12px;
  background: var(--surface-2); border-radius: var(--radius-sm);
}
.domain-row .name { font-weight: 700; }
.domain-row .meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--muted); }
.domain-row .money { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Tabellen ---------- */
.stats-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.stats-toolbar label { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.stats-toolbar input[type="search"] { flex: 1; min-width: 180px; }
.table-wrap { overflow: auto; max-height: 70vh; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th, .data-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table th {
  position: sticky; top: 0; background: var(--surface-2); text-align: right; cursor: pointer; user-select: none;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); z-index: 1;
}
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table td { text-align: right; font-variant-numeric: tabular-nums; }
.data-table td:first-child { max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.data-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.data-table tfoot td { font-weight: 800; background: var(--surface-2); position: sticky; bottom: 0; }
.data-table th.sorted::after { content: " ▾"; }
.data-table th.sorted.asc::after { content: " ▴"; }

/* URL-Auswertung */
.stats-toolbar .inline-num { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.stats-toolbar .inline-num input { width: 92px; }
.url-table td:first-child { max-width: 560px; }
.url-table .url-cell { color: var(--text); text-decoration: none; }
.url-table .url-cell:hover { text-decoration: underline; color: var(--primary-2); }
.url-table .url-cell .host { color: var(--muted); }
.url-table .variants { color: var(--muted); font-size: .78rem; }
.table-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: .85rem; color: var(--muted); }
.table-foot:empty { display: none; }

/* ---------- Tipps ---------- */
.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.tip {
  background: var(--surface); border: 1px solid var(--border); border-left-width: 5px; border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.tip.good { border-left-color: var(--good); }
.tip.warn { border-left-color: var(--warn); }
.tip.bad { border-left-color: var(--bad); }
.tip.info { border-left-color: var(--info); }
.tip h4 { margin: 0 0 4px; font-size: .95rem; }
.tip p { margin: 0; font-size: .88rem; color: var(--muted); }
.tip .fact { display: inline-block; margin-top: 6px; font-size: .78rem; font-weight: 700; background: var(--surface-2); padding: 2px 8px; border-radius: 999px; }
.details summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.details summary::before { content: "▸"; color: var(--muted); }
.details[open] summary::before { content: "▾"; }
.details[open] summary { margin-bottom: 12px; }
.details .tips { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.details .tip { box-shadow: none; background: var(--surface-2); }

/* ---------- Formulare ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); font-weight: 600; }
.form select, .form input { color: var(--text); font-weight: 400; }

/* ---------- Bottom-Nav ---------- */
.bottom-nav { display: none; }

/* ---------- Toast & Loader ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 50; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#loader { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .15); z-index: 40; backdrop-filter: blur(2px); }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .4); border-top-color: var(--primary); animation: spin .8s linear infinite; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; height: 1em; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid > .span-2 { grid-column: span 3; }
}
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar-logo { display: block; }
  main { padding: 12px max(12px, env(safe-area-inset-right)) calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px) max(12px, env(safe-area-inset-left)); }
  input, select, textarea { font-size: max(16px, 1em); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
    background: var(--surface); border-top: 1px solid var(--border); z-index: 30;
  }
  .bottom-nav .nav-btn { flex-direction: column; gap: 2px; font-size: .68rem; padding: 6px 2px; border-radius: 0; justify-content: center; }
  .bottom-nav .nav-btn .ico { font-size: 1.35rem; width: auto; }
  .bottom-nav .nav-btn.active { background: transparent; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .dash-grid > .card { grid-column: span 6 !important; }
  .chart-wrap { height: 240px; }
  .tile.collapsed { padding-right: 64px; }
  .tile.collapsed .spark { display: none !important; }
  .w-btn { width: 32px; height: 32px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile .value { font-size: 1.3rem; }
  .tile .spark { display: none; }
  .tile-hero { grid-column: 1 / -1; min-height: 116px; padding: 16px 18px 14px; }
  .tile-hero .value { font-size: 2.2rem; }
  .tile-hero .sub { font-size: .85rem; }
  .tile-hero .spark { display: block; width: 110px; height: 40px; right: 14px; bottom: 12px; }
  .filters { padding: 10px 12px; }
  .topbar h2 { font-size: 1.15rem; }
}
@media (max-width: 400px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile { padding: 12px; }
}
@media (display-mode: standalone), (display-mode: minimal-ui), (display-mode: fullscreen) {
  .topbar { padding-top: env(safe-area-inset-top); }
  .sidebar { padding-top: calc(20px + env(safe-area-inset-top)); }
}
@media print {
  .sidebar, .bottom-nav, .filters, .topbar-actions, .w-ctl, .layout-bar, #auth-banner { display: none !important; }
  #app { grid-template-columns: 1fr; }
  .card, .tile { box-shadow: none; break-inside: avoid; }
}

/* =====================================================================
   Zugangsdaten & Anleitung
   ===================================================================== */
.login-card .hint { margin: 0 0 14px; }
.creds {
  text-align: left; border: 1px solid var(--border); background: var(--surface-2);
  border-radius: var(--radius-sm); padding: 0 14px; margin-bottom: 14px;
}
.creds > summary { cursor: pointer; font-weight: 700; padding: 12px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
.creds > summary::-webkit-details-marker { display: none; }
.creds > summary::before { content: "▸"; color: var(--muted); }
.creds[open] > summary::before { content: "▾"; }
.creds-form { display: flex; flex-direction: column; gap: 12px; padding-bottom: 14px; }
.creds-form label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); font-weight: 600; }
.creds-form input {
  font: inherit; font-weight: 400; font-size: 16px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: .6em .75em; min-height: 42px; width: 100%;
  font-family: var(--mono);
}
.creds-form input::placeholder { color: var(--muted); opacity: .7; }

.guide-link {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  background: var(--primary-soft); color: var(--text); border: 1px dashed var(--primary);
  border-radius: var(--radius-sm); padding: 10px 12px; font: inherit;
}
.guide-link:hover { filter: brightness(1.04); }
.guide-link strong { display: block; color: var(--primary); }
.guide-link small { display: block; color: var(--muted); font-size: .78rem; }
.guide-link-ico {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: #fff; font-weight: 800;
}
.cred-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
#cred-client-id { word-break: break-all; }

/* ---------- Anleitung (Dialog) ---------- */
dialog.guide {
  width: min(760px, calc(100vw - 24px)); max-height: min(92dvh, 900px); padding: 0; margin: auto;
  border: 1px solid var(--border); border-radius: 22px; background: var(--bg); color: var(--text);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); overflow: hidden;
}
dialog.guide[open] { display: flex; flex-direction: column; }
dialog.guide::backdrop { background: rgba(8, 13, 24, .6); backdrop-filter: blur(3px); }
.guide-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.guide-head h2 { font-size: 1.25rem; }
.guide-body { padding: 16px 20px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.guide-foot { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }

.callout { border-radius: var(--radius-sm); padding: 10px 14px; font-size: .9rem; border: 1px solid transparent; margin: 10px 0 0; }
.callout-info { background: rgba(37, 99, 235, .10); border-color: rgba(37, 99, 235, .25); }
.callout-tip { background: var(--primary-soft); border-color: rgba(15, 118, 110, .25); }
.callout-warn { background: rgba(217, 119, 6, .12); border-color: rgba(217, 119, 6, .3); }
.guide-body > .callout { margin-top: 0; }

.guide-overview {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; counter-reset: ov;
}
.guide-overview li { counter-increment: ov; }
.guide-overview a {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .3em .8em .3em .35em; font-size: .82rem; font-weight: 600;
}
.guide-overview a::before {
  content: counter(ov); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: .75rem;
}
.guide-overview a:hover { border-color: var(--primary); }

.gstep { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); scroll-margin-top: 8px; }
.gstep > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.gstep > summary::-webkit-details-marker { display: none; }
.gstep > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s ease; }
.gstep:not([open]) > summary::after { transform: rotate(-90deg); }
.gnum {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #0f766e, #2563eb); color: #fff; font-weight: 800; font-size: .9rem;
}
.gtrouble .gnum { background: var(--warn); }
.gtitle { font-weight: 700; }
.gcontent { padding: 0 16px 16px 58px; }
.gcontent ol { margin: 10px 0 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; }
.gcontent li::marker { color: var(--primary); font-weight: 700; }
.gopen { text-decoration: none; margin-top: 2px; }
.path {
  display: inline-block; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: .05em .5em; font-size: .85em; font-weight: 600; white-space: normal;
}
.copyrow { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.copyrow code { flex: 1 1 220px; min-width: 0; padding: .5em .7em; border: 1px solid var(--border); border-radius: 10px; word-break: break-all; font-size: .82rem; }
.keybox { margin-top: 10px; border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.keybox > div { display: flex; flex-direction: column; gap: 2px; }
.keylabel { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.keybox code { background: transparent; padding: 0; word-break: break-all; }
.gfaq { margin: 10px 0 0; display: flex; flex-direction: column; gap: 4px; }
.gfaq dt { font-weight: 700; margin-top: 8px; }
.gfaq dd { margin: 0; color: var(--muted); font-size: .9rem; }

@media (max-width: 600px) {
  dialog.guide { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; }
  .gcontent { padding-left: 16px; }
  .guide-body { padding: 14px 14px 8px; }
}