/* Ported from the v3 dashboard prototype (Business/dashboard/v3.html). Dark is the default;
   themes switch with data-theme on <html> (see the script in index.html). */

/* ================= themes ================= */
:root, [data-theme=dark] {
  --bg: #1d1d1d; --side: #161616; --raise: #262626; --hover: #2a2a2a; --sel: #2e2e2e; --line: #333; --line2: #2a2a2a; --field: #171717;
  --text: #ececec; --muted: #a3a3a3; --dim: #737373;
  --acc: #e8a33d; --acc-ink: #1d1405; --accsoft: #e8a33d22;
  --ok: #4ade80; --warn: #e8a33d; --bad: #f87171; --tag: #333; --tagt: #d4d4d4; --bar: #4a4a4a;
  color-scheme: dark;
}
[data-theme=warm] {
  --bg: #141312; --side: #100f0e; --raise: #1b1a18; --hover: #211f1d; --sel: #26231f; --line: #2a2724; --line2: #221f1d; --field: #0f0e0d;
  --text: #ede9e3; --muted: #9d968c; --dim: #6d675f;
  --acc: #e8a33d; --acc-ink: #1d1405; --accsoft: #e8a33d22;
  --ok: #8fbf7a; --warn: #e8a33d; --bad: #e07a6a; --tag: #2e2a25; --tagt: #cfc6b8; --bar: #4a3d2a;
  color-scheme: dark;
}
[data-theme=gruvbox] {
  --bg: #282828; --side: #1d2021; --raise: #32302f; --hover: #32302f; --sel: #3c3836; --line: #504945; --line2: #3c3836; --field: #1d2021;
  --text: #ebdbb2; --muted: #bdae93; --dim: #928374;
  --acc: #fabd2f; --acc-ink: #282828; --accsoft: #fabd2f22;
  --ok: #b8bb26; --warn: #fe8019; --bad: #fb4934; --tag: #3c3836; --tagt: #d5c4a1; --bar: #665c54;
  color-scheme: dark;
}
[data-theme=light] {
  --bg: #ffffff; --side: #f7f7f6; --raise: #ffffff; --hover: #f3f3f2; --sel: #ececea; --line: #e4e4e2; --line2: #efefed; --field: #fff;
  --text: #1c1c1c; --muted: #5f5f5f; --dim: #8f8f8f;
  --acc: #b86e00; --acc-ink: #fff; --accsoft: #b86e0018;
  --ok: #16a34a; --warn: #b86e00; --bad: #dc2626; --tag: #efefed; --tagt: #3a3a3a; --bar: #d6d6d3;
  color-scheme: light;
}
:root { --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", Consolas, monospace; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Inter, sans-serif; transition: background .2s, color .2s; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
h1:focus { outline: none; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); } .dim { color: var(--dim); }
.t tr.dim td, .t tr.dim b { color: var(--dim); } /* an allowed app that isn't running yet */
/* Rows in a panel (Billing's "Where it went"; Receipts in dashboard/v3.html). */
.vis { display: grid; grid-template-columns: 1fr auto; padding: 10px 16px; border-bottom: 1px solid var(--line2); font-size: 13px; }
.vis:last-child { border-bottom: 0; } .vis small { color: var(--dim); font-size: 12px; } .vis .tm { color: var(--dim); font-size: 12px; text-align: right; }

/* ================= layout ================= */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--line2); padding: 14px 10px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 650; padding: 4px 10px 18px; font-size: 15px; }
.logo svg { width: 18px; height: 18px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; color: var(--muted); font-size: 13.5px; margin-bottom: 1px; }
.nav:hover { background: var(--hover); color: var(--text); }
.nav.on { background: var(--sel); color: var(--text); }
.nav .ct { margin-left: auto; font-size: 12px; color: var(--dim); }
.nav.sub { padding-left: 36px; }
.side .sp { flex: 1; }
.themeq { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; color: var(--muted); font-size: 13.5px; cursor: pointer; }
.themeq:hover { background: var(--hover); color: var(--text); }
.themeq .val { margin-left: auto; display: flex; align-items: center; gap: 4px; color: var(--dim); font-size: 12.5px; }
.themeq .val svg { width: 12px; height: 12px; }
.themeq select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.sep { height: 1px; background: var(--line2); margin: 8px 10px; }
.mewrap { position: relative; }
.me { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; text-align: left; }
.me:hover, .me.open { background: var(--hover); }
.me i { width: 20px; height: 20px; border-radius: 50%; background: var(--sel); display: grid; place-items: center; font-style: normal; font-weight: 600; font-size: 10.5px; color: var(--text); flex: none; }
.me .who { flex: 1; min-width: 0; line-height: 1.25; }
.me .who b { display: block; font-weight: 550; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who small { display: block; color: var(--dim); font-size: 12px; }
.me > svg { color: var(--dim); }
.menu.up { top: auto; bottom: calc(100% + 6px); left: 0; right: 0; }

main { padding: 30px 48px 80px; max-width: 1440px; width: 100%; margin: 0 auto; }
@media (min-width: 2600px) { html { zoom: 1.3; } }
@media (min-width: 3400px) { html { zoom: 1.6; } }
.ph { display: flex; align-items: flex-start; gap: 16px; }
.ph .sp { flex: 1; }
.ph .acts { display: flex; gap: 8px; }
h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; letter-spacing: -.2px; }
.desc { color: var(--muted); margin: 0 0 22px; }
.desc a, .ln { color: var(--acc); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, var(--acc) 45%, transparent); }
.crumb { font-size: 13px; color: var(--dim); margin-bottom: 6px; } .crumb a:hover { color: var(--text); }

/* ================= controls ================= */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 7px; font-weight: 550; font-size: 13.5px; border: 1px solid var(--line); background: var(--raise); white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.p { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.p:hover { filter: brightness(1.06); }
.btn.d { color: var(--bad); }
.btn:disabled { opacity: .6; cursor: default; }
.tb { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; background: var(--field); color: var(--dim); }
.search input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font: inherit; padding: 8px 0; }
.search:focus-within { border-color: var(--acc); }
.count { display: inline-block; background: var(--tag); color: var(--tagt); border-radius: 20px; padding: 1px 10px; font-size: 12px; margin-bottom: 18px; }
.tag { display: inline-block; background: var(--tag); color: var(--tagt); border-radius: 4px; padding: 0 6px; font-size: 11.5px; line-height: 19px; margin: 5px 4px 0 0; white-space: nowrap; }
.tag.a { background: var(--accsoft); color: var(--acc); }
.tag.w { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.fld { width: 100%; background: var(--field); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; color: var(--text); font: inherit; outline: 0; }
.fld:focus { border-color: var(--acc); }
.fld.mono { font-family: var(--mono); font-size: 12.5px; }
.flabel { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.fhint { display: block; color: var(--dim); font-size: 12.5px; margin: 5px 0 0; }
.fgroup { margin-bottom: 14px; }
.err { color: var(--bad); font-size: 13px; margin: 0 0 12px; }
.note { color: var(--muted); font-size: 13.5px; border: 1px solid var(--line); border-radius: 9px; padding: 11px 14px; margin: 0 0 16px; }

/* ================= table ================= */
.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--dim); padding: 0 14px 10px 0; border-bottom: 1px solid var(--line); }
.t td { padding: 13px 14px 13px 0; border-bottom: 1px solid var(--line2); vertical-align: top; }
.t tr.c { cursor: pointer; } .t tr.c:hover td { background: var(--hover); }
.t td:first-child, .t th:first-child { padding-left: 8px; }
.t td b { font-weight: 600; }
.t td .s2 { display: block; color: var(--dim); font-size: 12.5px; }
.t .act { width: 40px; text-align: right; position: relative; }
.st { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
.t td .s2 .st { color: inherit; gap: 6px; } /* a status inside a second line */
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.st.on::before { background: var(--ok); } .st.hot { color: var(--text); } .st.hot::before { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.url { display: inline-flex; gap: 8px; align-items: center; font-family: var(--mono); font-size: 12.5px; }
.cp { color: var(--dim); font-family: system-ui; font-size: 12px; } .cp:hover { color: var(--acc); }
.more { width: 28px; height: 22px; margin: -1px 0; border-radius: 6px; color: var(--dim); display: inline-grid; place-items: center; vertical-align: top; }
.more svg { width: 16px; height: 4px; fill: currentColor; }
.more:hover { background: var(--sel); color: var(--text); }
.menu { position: absolute; right: 0; top: 34px; background: var(--raise); border: 1px solid var(--line); border-radius: 8px; padding: 4px; min-width: 170px; z-index: 30; box-shadow: 0 12px 28px #0006; text-align: left; }
.menu button, .menu a { display: block; width: 100%; text-align: left; padding: 6px 10px; border-radius: 5px; font-size: 13px; }
.menu button:hover, .menu a:hover { background: var(--hover); } .menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; } .menu .bad { color: var(--bad); }
.backdrop { position: fixed; inset: 0; z-index: 25; }
.linkbtn { color: var(--acc); font-weight: 550; font-size: 13px; } .linkbtn:hover { text-decoration: underline; }
.linkbtn.q { color: var(--muted); font-weight: 400; }
.linkbtn.bad { color: var(--bad); }
.h2 { font-size: 15px; font-weight: 600; margin: 34px 0 4px; }
.h2 + .desc { margin-bottom: 14px; font-size: 13.5px; }

/* ================= detail layouts ================= */
.two { display: grid; grid-template-columns: 1.45fr 1fr; gap: 44px; }
.panel { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.kv { display: grid; grid-template-columns: 140px 1fr; font-size: 13.5px; }
.kv > div { padding: 10px 16px; border-bottom: 1px solid var(--line2); } .kv > div:nth-child(odd) { color: var(--muted); }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.ph-h { padding: 11px 16px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13.5px; display: flex; align-items: center; }
.ph-h small { margin-left: auto; color: var(--dim); font-weight: 400; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding: 14px 16px; }
.bars i { flex: 1; background: var(--bar); border-radius: 1px; min-height: 2px; } .bars i:last-child { background: var(--acc); }
.bars-legend { display: flex; justify-content: space-between; padding: 0 16px 12px; color: var(--dim); font-size: 12px; }
.warnline { border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); color: var(--text); border-radius: 8px; padding: 10px 14px; margin: 0 0 20px; font-size: 13.5px; }

/* ================= add machine ================= */
.steps { display: flex; gap: 28px; margin: 6px 0 28px; font-size: 13.5px; color: var(--dim); }
.steps span { display: flex; align-items: center; gap: 8px; }
.steps b { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 11.5px; }
.steps .on { color: var(--text); } .steps .on b { border-color: var(--acc); color: var(--acc); }
.steps .done { color: var(--muted); } .steps .done b { background: var(--accsoft); border-color: transparent; color: var(--acc); }
.osl { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; max-width: 480px; }
.os { padding: 16px 18px; text-align: left; border-right: 1px solid var(--line); }
.os:last-child { border-right: 0; } .os b { display: block; font-weight: 600; } .os small { color: var(--dim); }
.os:hover { background: var(--hover); } .os.on { background: var(--accsoft); box-shadow: inset 0 -2px 0 var(--acc); }
.cmd { max-width: 720px; display: flex; align-items: center; gap: 14px; background: var(--field); border: 1px solid var(--line); border-radius: 9px; padding: 13px 15px; font-family: var(--mono); font-size: 12.5px; }
.cmd code { flex: 1; overflow-x: auto; white-space: nowrap; } .cmd .pr { color: var(--dim); } .cmd .tk { color: var(--acc); }
.wait { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 22px 0 6px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--acc); animation: pu 1.4s ease-in-out infinite; }
@keyframes pu { 50% { opacity: .25; } }
.hint { color: var(--dim); font-size: 13px; max-width: 720px; margin: 10px 0 0; }
.narrow { max-width: 460px; }

/* ================= appearance ================= */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; max-width: 900px; }
.th { border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: left; }
.th:hover { border-color: var(--muted); }
.th.on { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.sw { height: 84px; border-radius: 6px; display: grid; grid-template-columns: 30% 1fr; overflow: hidden; margin-bottom: 8px; border: 1px solid #0002; }
.sw .a { padding: 8px 6px; display: flex; flex-direction: column; gap: 5px; } .sw .a i { height: 5px; border-radius: 2px; opacity: .5; }
.sw .b { padding: 10px; display: flex; flex-direction: column; gap: 6px; } .sw .b i { height: 6px; border-radius: 2px; }
.th b { font-weight: 600; font-size: 13.5px; } .th small { display: block; color: var(--dim); font-size: 12px; }

.empty { padding: 50px 0; max-width: 460px; } .empty h2 { font-size: 19px; margin: 0 0 8px; } .empty p { color: var(--muted); margin: 0 0 20px; }
.dlg { position: fixed; inset: 0; background: #0008; display: grid; place-items: center; z-index: 62; }
.dbox { background: var(--raise); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; width: min(430px, calc(100vw - 32px)); }
.dbox h3 { margin: 0 0 8px; font-size: 16px; } .dbox p { color: var(--muted); margin: 0 0 18px; } .dbox .r { display: flex; gap: 10px; justify-content: flex-end; }
.examples { display: flex; flex-wrap: wrap; gap: 6px; }
.ex { border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; font-size: 12.5px; }
.ex:hover { background: var(--hover); } .ex.on { border-color: var(--acc); background: var(--accsoft); }
.ex .dim { font-family: var(--mono); margin-left: 3px; }
.uopts { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.uo { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line2); cursor: pointer; font-size: 13.5px; width: 100%; text-align: left; }
.uo:last-child { border-bottom: 0; } .uo:hover { background: var(--hover); }
.uo .r { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--dim); flex: none; }
.uo.on { background: var(--accsoft); } .uo.on .r { border-color: var(--acc); box-shadow: inset 0 0 0 3px var(--raise), inset 0 0 0 8px var(--acc); }
.uo .end { margin-left: auto; color: var(--muted); white-space: nowrap; font-size: 12.5px; }
.uo:disabled { cursor: default; opacity: .55; }
.trialbar { display: flex; align-items: center; gap: 16px; border: 1px solid color-mix(in srgb, var(--acc) 40%, var(--line)); background: color-mix(in srgb, var(--acc) 7%, transparent); border-radius: 10px; padding: 12px 14px 12px 16px; margin: -6px 0 18px; font-size: 13.5px; color: var(--muted); }
.trialbar b { color: var(--text); font-weight: 600; } .trialbar > div { flex: 1; }
@media (max-width: 760px) { .uopts { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.uo { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line2); cursor: pointer; font-size: 13.5px; width: 100%; text-align: left; }
.uo:last-child { border-bottom: 0; } .uo:hover { background: var(--hover); }
.uo .r { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--dim); flex: none; }
.uo.on { background: var(--accsoft); } .uo.on .r { border-color: var(--acc); box-shadow: inset 0 0 0 3px var(--raise), inset 0 0 0 8px var(--acc); }
.uo .end { margin-left: auto; color: var(--muted); white-space: nowrap; font-size: 12.5px; }
.uo:disabled { cursor: default; opacity: .55; }
.trialbar { flex-direction: column; align-items: stretch; margin-top: 10px; } .trialbar .btn { justify-content: center; } }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 80px); background: var(--raise); border: 1px solid var(--line); padding: 9px 16px; border-radius: 8px; font-size: 13.5px; transition: transform .25s, opacity .25s; z-index: 70; opacity: 0; visibility: hidden; }
.toast.on { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.loading { min-height: 100vh; display: grid; place-items: center; color: var(--dim); font-size: 13.5px; }

/* ================= mobile app layout ================= */
.topbar, .tabbar { display: none; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; gap: 28px; } .t .hide { display: none; } }
@media (max-width: 760px) {
  html, body { font-size: 15px; }
  .app { grid-template-columns: 1fr; } .side { display: none; }
  main { padding: 14px 16px calc(92px + env(safe-area-inset-bottom)); }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 15; margin: -14px -16px 14px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line2); }
  .topbar .logo { padding: 0; font-size: 16px; } .topbar .sp { flex: 1; }
  .tbtn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--text); border: 1px solid var(--line); background: var(--raise); }
  .tav { width: 34px; height: 34px; border-radius: 50%; background: var(--sel); font-weight: 600; font-size: 13px; display: grid; place-items: center; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: color-mix(in srgb, var(--side) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line2); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; color: var(--dim); border-radius: 10px; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--acc); }
  .ph { flex-direction: column; gap: 6px; } .ph .sp { display: none; }
  /* Page-header buttons give way to the + in the top bar (as in dashboard/v3.html); .keep ones stay. */
  .ph > .btn, .ph > a.btn, .ph > .acts { display: none; }
  .ph .btn.keep { display: inline-flex; } .ph > .acts.keep { display: flex; margin: 4px 0 12px; }
  h1 { font-size: 21px; } .desc { font-size: 14px; margin-bottom: 16px; }
  .search input { font-size: 16px; padding: 10px 0; }
  .count { margin-bottom: 6px; }
  /* tables become list rows */
  .t, .t tbody, .t tr, .t td, .t th { display: block; }
  .t tr:has(> th:not([colspan])) { display: none; }
  .t tr:has(> th[colspan]) th { padding: 22px 0 8px; border-bottom: 1px solid var(--line); }
  .t tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 3px 12px; padding: 13px 2px; border-bottom: 1px solid var(--line2); }
  .t td { padding: 0 !important; border: 0; background: none !important; }
  .t td.act { grid-row: 1; grid-column: 3; }
  .t tr.c:active { background: var(--hover); }
  /* As in dashboard/v3.html: name, status and menu on the first line, the address below it (full width,
     so a long one like name.emberway.link:30123 wraps instead of running into the status). */
  .t-apps td:nth-child(1) { grid-area: 1 / 1; } .t-apps td:nth-child(3) { grid-area: 1 / 2; text-align: right; } .t-apps td:nth-child(4) { grid-area: 1 / 3; }
  .t-apps td:nth-child(2) { grid-area: 2 / 1 / 3 / 4; }
  .t-apps td:nth-child(3) .s2, .t-apps td:nth-child(2) .s2, .t-apps td:nth-child(2) .dim { display: none; }
  .t-mapps tr { grid-template-columns: minmax(0, 1fr) auto; } .t-mapps td:nth-child(2) { grid-area: 2 / 1 / 3 / 3; } .t-mapps td:nth-child(3) { grid-area: 1 / 2; }
  .t-mach td:nth-child(1) { grid-area: 1 / 1; } .t-mach td:nth-child(4) { grid-area: 1 / 2; } .t-mach td:nth-child(5) { grid-area: 1 / 3; }
  .t-mach td:nth-child(3) { grid-area: 2 / 1 / 3 / 4; color: var(--dim); font-size: 13px; } .t-mach td:nth-child(3) .s2 { display: inline; margin-left: 6px; }
  .t-mach td:nth-child(2) { display: none; }
  .t-plan tr { grid-template-columns: minmax(0, 1fr) auto; } .t-plan td.act { grid-column: 2; }
  .url { flex-wrap: wrap; word-break: break-all; }
  .t .act { width: auto !important; }
  .more { width: 40px; height: 34px; margin: 0; }
  .linkbtn { padding: 8px 4px; }
  /* menus + dialogs become bottom sheets */
  .menu { position: fixed; left: 8px; right: 8px; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom)); border-radius: 14px; padding: 6px; z-index: 60; min-width: 0; }
  .backdrop { background: #0008; z-index: 55; }
  .menu button, .menu a { padding: 14px 16px; font-size: 16px; border-radius: 10px; }
  .dlg { place-items: end stretch; } .dbox { width: auto; max-width: none; border-radius: 16px 16px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); }
  .dbox .r { flex-direction: column-reverse; } .dbox .btn { justify-content: center; padding: 12px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .steps { gap: 14px; font-size: 12.5px; flex-wrap: wrap; }
  .cmd { flex-direction: column; align-items: stretch; gap: 10px; } .cmd code { white-space: normal; word-break: break-all; }
  .kv { grid-template-columns: 120px 1fr; }
  .themes { grid-template-columns: 1fr 1fr; }
}

/* ================= sign-in page (port of dashboard/login.html) ================= */
.signin { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; position: relative; overflow: hidden; font-size: 15px; line-height: 1.55; }
.signin .pat { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 45%; pointer-events: none; -webkit-mask-image: linear-gradient(transparent, #000); mask-image: linear-gradient(transparent, #000); }
.signin .top { display: flex; align-items: center; padding: 22px 28px; position: relative; }
.signin .logo { padding: 0; font-size: 16px; } .signin .logo svg { width: 19px; height: 19px; }
.signin .top .sp { flex: 1; }
.signin .top .q { color: var(--muted); font-size: 14px; } .signin .top .q:hover { color: var(--text); }
.signin .mid { display: grid; place-items: center; padding: 20px; position: relative; }
.signin .box { width: 100%; max-width: 360px; }
.signin h1 { font-size: 25px; font-weight: 620; letter-spacing: -.4px; margin: 0 0 6px; }
.signin .sub { color: var(--muted); margin: 0 0 24px; }
.signin .oauth { display: grid; gap: 10px; }
.signin .btn { display: flex; justify-content: center; gap: 10px; width: 100%; padding: 11px 14px; border-radius: 9px; font-size: 14.5px; }
.signin .btn svg { width: 18px; height: 18px; }
.signin .err { font-size: 13.5px; margin: 0 0 16px; }
.signin .note { color: var(--muted); font-size: 13.5px; border: 1px solid var(--line); border-radius: 9px; padding: 11px 14px; }
.signin .perks { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 22px; color: var(--dim); font-size: 12.5px; }
.signin .perks span { display: flex; align-items: center; gap: 6px; }
.signin .perks span::before { content: ""; flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--ok); position: relative; top: -1px; } /* centred on the letters, not the line (which includes room below for descenders) */
.signin .fine { color: var(--dim); font-size: 12px; margin-top: 18px; text-align: center; }
.signin .fine a { text-decoration: underline; text-underline-offset: 2px; }
.signin .bottom { display: flex; gap: 18px; justify-content: center; padding: 22px; color: var(--dim); font-size: 12.5px; position: relative; }
.signin .bottom a:hover { color: var(--text); }
@media (max-width: 500px) { .signin .top { padding: 18px 20px; } .signin .mid { place-items: start center; padding-top: 20px; } }

/* ================= Blazor error UI ================= */
/* The dev sign-in on the login page (Development only). */
.devsign { border: 1px dashed var(--line); border-radius: 9px; padding: 10px; }
.devsign small { display: block; color: var(--dim); font-size: 12px; margin-bottom: 8px; text-align: left; }
.devsign div { display: grid; gap: 8px; } /* field above the (full-width) button, like the sign-in buttons */
.devsign .fld { width: 100%; padding: 10px 12px; }
#blazor-error-ui { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; padding: 12px 20px; background: var(--raise); border-top: 1px solid var(--line); color: var(--text); font-size: 14px; }
#blazor-error-ui .reload { color: var(--acc); margin-left: 8px; }
#blazor-error-ui .dismiss { position: absolute; right: 20px; top: 12px; cursor: pointer; color: var(--muted); }
.blazor-error-boundary { padding: 12px 16px; border: 1px solid var(--bad); border-radius: 9px; color: var(--bad); }
.blazor-error-boundary::after { content: "Something went wrong."; }

/* A notice inside a panel (Billing: cancelled, payment failed): same inner spacing as the rows. */
.panel .panel-note { margin: 0; padding: 12px 16px 14px; border-top: 1px solid var(--line2); line-height: 1.5; }
