/* Demo toolbar around the app. Its colours are read from the app (shell.js), so it follows
   light/dark mode and the colour theme; these are only the values before the app has loaded. */
:root {
  --db-bg: #0b1220;
  --db-line: rgb(255 255 255 / 0.09);
  --db-ink: #e8edf7;
  --db-muted: #93a0b8;
  --db-field: #111a2c;
  --db-stage: #070c16;
  --db-blue: #2f6bff;
  --db-on-blue: #fff;
  --db-hover: color-mix(in srgb, var(--db-ink) 8%, transparent);
  --db-h: 58px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { display: flex; flex-direction: column; overflow: hidden; background: var(--db-bg); color: var(--db-ink); font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, select, a { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--db-blue); outline-offset: 2px; }
.db-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.db { display: flex; flex: none; align-items: center; gap: 16px; height: var(--db-h); padding: 0 14px; border-bottom: 1px solid var(--db-line); background: var(--db-bg); }
body.db-hidden .db { display: none; }
.db-brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--db-ink); text-decoration: none; }
/* The app's logo, drawn in the theme colour like the app's own (same mask as .mark in the app). */
.db-mark { flex: none; width: 30px; height: 30px; background: linear-gradient(160deg, color-mix(in srgb, var(--db-blue) 55%, #fff) 10%, var(--db-blue) 55%, color-mix(in srgb, var(--db-blue) 72%, #000) 100%); -webkit-mask: url("/assets/img/logo-mark.svg") center / contain no-repeat; mask: url("/assets/img/logo-mark.svg") center / contain no-repeat; }
/* Larger logo for the About window. */
.db-mark.lg { width: 48px; height: 48px; }
.db-brand b { font-size: 16px; white-space: nowrap; }
.db-ver { padding: 2px 8px; border: 1px solid var(--db-line); border-radius: 99px; color: var(--db-muted); font-size: 11.5px; white-space: nowrap; }

.db-ic { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 9px; background: none; color: var(--db-muted); }
.db-ic:hover { background: var(--db-hover); color: var(--db-ink); }

.db-tools { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.db-devices { display: flex; gap: 4px; }
.db-devices button { display: grid; place-items: center; width: 38px; height: 36px; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--db-muted); }
.db-devices button:hover { color: var(--db-ink); }
.db-devices button[aria-pressed="true"] { border-color: color-mix(in srgb, var(--db-blue) 60%, transparent); background: color-mix(in srgb, var(--db-blue) 16%, transparent); color: var(--db-blue); }
.db-sep { width: 1px; height: 26px; margin: 0 8px; background: var(--db-line); }
#dbTheme .sun, body.db-dark #dbTheme .moon { display: none; }
body.db-dark #dbTheme .sun { display: block; }
#dbDir[aria-pressed="true"] { color: var(--db-blue); background: color-mix(in srgb, var(--db-blue) 16%, transparent); }
.db-buy { display: inline-flex; align-items: center; gap: 8px; height: 38px; margin-inline-start: 8px; padding: 0 18px; border-radius: 10px; background: var(--db-blue); color: var(--db-on-blue); font-weight: 700; text-decoration: none; white-space: nowrap; }
.db-buy:hover { filter: brightness(1.1); }
.db-text { height: 36px; padding: 0 10px; border: 0; border-radius: 9px; background: none; color: var(--db-ink); }
.db-text:hover { background: var(--db-hover); }


/* The stage: the app fills it, or sits in a device-sized frame. */
.db-stage { position: relative; display: flex; flex: 1; justify-content: center; min-height: 0; overflow: auto; background: var(--db-stage) radial-gradient(circle at 50% 0, color-mix(in srgb, var(--db-blue) 14%, transparent), transparent 60%); }
.db-frame { width: 100%; height: 100%; transition: width 0.3s ease, height 0.3s ease; }
.db-frame iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--db-stage); }
.db-stage[data-device="tablet"], .db-stage[data-device="phone"] { padding: 24px 16px; }
.db-stage[data-device="tablet"] .db-frame { flex: none; width: 854px; height: min(1132px, 100%); } /* 834 × 1112 inside the 10px bezel */
.db-stage[data-device="phone"] .db-frame { flex: none; width: 410px; height: min(864px, 100%); } /* 390 × 844 inside the bezel */
.db-stage:not([data-device="desktop"]) .db-frame { overflow: hidden; border: 10px solid color-mix(in srgb, var(--db-ink) 22%, var(--db-bg)); border-radius: 30px; box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.45); }

/* About dialog. */
.db-about { width: min(460px, calc(100% - 32px)); padding: 0; border: 1px solid var(--db-line); border-radius: 18px; background: var(--db-bg); color: var(--db-ink); }
.db-about::backdrop { background: rgb(3 7 15 / 0.7); }
.db-about form { position: relative; display: grid; gap: 10px; padding: 26px; }
.db-about h2 { margin: 4px 0 0; font-size: 22px; }
.db-about p, .db-about li { margin: 0; color: var(--db-muted); line-height: 1.55; }
.db-about ul { margin: 0; padding-inline-start: 20px; }
.db-about-ver { font-size: 13px; }
.db-about-note { padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--db-ink) 5%, transparent); font-size: 13px; }
.db-about-x { position: absolute; top: 12px; right: 12px; }
.db-about-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.db-about-actions .db-buy { margin: 0; }

/* Smaller screens: keep the page picker and Buy; drop device preview (there is no room to show it). */
@media (max-width: 1100px) {
  .db-text#dbAbout, #dbOpen { display: none; }
}
@media (max-width: 900px) {
  .db-devices, .db-sep, .db-ver { display: none; }
  .db { gap: 10px; }
  .db-stage { padding: 0 !important; }
  .db-stage .db-frame { width: 100% !important; height: 100% !important; border: 0 !important; border-radius: 0 !important; }
}
@media (max-width: 640px) {
  .db-brand b, #dbDir { display: none; }
  .db-buy { padding: 0 12px; margin: 0; }
  .db-buy span { display: none; }
  .db { padding: 0 8px; gap: 6px; }
}
