:root {
  color-scheme: light;
  --ink: #17251f;
  --muted: #4b6359;
  --green: #006b49;
  --green-dark: #07533c;
  --mint: #edf9f4;
  --border: #d2ddd8;
  --background: #f2f6f4;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--green-dark); text-underline-offset: .18em; }
p { color: var(--muted); margin: .4rem 0 1rem; }
h1, h2 { margin: 0; line-height: 1.15; letter-spacing: -.03em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: 1.4rem; }
:focus-visible { outline: 3px solid #1d9770; outline-offset: 3px; }

.shell { width: min(69rem, calc(100% - 3rem)); margin-inline: auto; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); }
.bar, .intro, .section-head, .account, .brand, .actions, .dialog-footer {
  display: flex;
  align-items: center;
  gap: .8rem;
}
.bar, .intro, .section-head, .dialog-footer { justify-content: space-between; }
.bar { min-height: 4.5rem; padding-block: .65rem; }
.brand { font-size: 1.05rem; font-weight: 700; white-space: nowrap; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: .8rem;
  background: var(--green-dark);
  color: #fff;
  font-size: .7rem;
  letter-spacing: .09em;
}
.account span { color: var(--muted); overflow-wrap: anywhere; font-size: .875rem; }
.account button { flex-shrink: 0; }
.dashboard { padding-block: 2.6rem 4rem; }
.intro { margin-bottom: 1.5rem; align-items: end; }
.intro p:last-child { margin-bottom: 0; }
.eyebrow {
  color: var(--green-dark);
  margin: 0 0 .5rem;
  text-transform: uppercase;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .13em;
}
.device-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 1rem; }
.card, dialog {
  background: #fff;
  padding: clamp(1rem, 4vw, 1.65rem);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 4px 14px #17251f08;
  min-width: 0;
}
.card form:not([method="dialog"]) { display: grid; justify-items: start; gap: .65rem; }
label { font-weight: 600; font-size: .9rem; }
input {
  width: 100%;
  min-height: 2.85rem;
  padding: .55rem .75rem;
  border: 1px solid var(--border);
  border-radius: .6rem;
  font: inherit;
  color: var(--ink);
}
button, .button {
  display: inline-flex;
  align-items: center;
  min-height: 2.65rem;
  padding: .45rem .85rem;
  border: 1px solid transparent;
  border-radius: .6rem;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
button:disabled { opacity: .6; cursor: wait; }
.primary { background: var(--green); color: #fff; }
.primary:hover:not(:disabled) { background: var(--green-dark); }
.secondary { background: #fff; border-color: var(--border); color: var(--green-dark); }
.secondary:hover:not(:disabled) { background: var(--mint); }
.danger { color: #942b2b; }
.danger:hover:not(:disabled) { background: #fff1f1; }
.devices { list-style: none; padding: 0; margin: .8rem 0 0; }
.devices li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
}
.devices li span { overflow-wrap: anywhere; }
.devices li:last-child { border-bottom: 0; }
#devices-empty { background: var(--mint); padding: .8rem; border-radius: .6rem; }
#status:not(:empty) {
  position: fixed;
  z-index: 10;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(32rem, calc(100% - 2rem));
  margin: 0;
  padding: .9rem 1rem;
  border: 1px solid #e98647;
  border-radius: .75rem;
  background: #101a31;
  color: #fff;
  box-shadow: 0 8px 28px #0008;
}
#downloads { margin-top: 1rem; scroll-margin-top: 1rem; }
.platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .65rem; }
.platform {
  border: 1px solid var(--border);
  border-radius: .75rem;
  padding: .8rem;
  background: var(--mint);
  display: flex;
  flex-direction: column;
  gap: .4rem;
  font-size: .92rem;
}
.platform summary { cursor: pointer; color: var(--green-dark); }
.variants { display: grid; gap: .3rem; margin-top: .35rem; }
.secondary-link { font-size: .82rem; }

.sign-in { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; }
.welcome { width: min(100%, 30rem); }
.welcome .brand { margin-bottom: 2rem; }
.welcome .button { margin-top: .4rem; }
dialog { color: var(--ink); width: min(calc(100% - 2rem), 38rem); max-height: calc(100dvh - 2rem); }
dialog::backdrop { background: #0b251bbc; }
.steps { padding-left: 1.35rem; color: var(--muted); }
.steps li { padding: .2rem 0; }
.actions { flex-wrap: wrap; gap: .5rem; }
.qr-panel { margin-top: .75rem; text-align: center; }
.qr-panel canvas { display: block; width: min(100%, 21rem); height: auto; margin: 0 auto .5rem; image-rendering: pixelated; }
#profile-status:empty { display: none; }
.dialog-footer { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: .75rem; }
.dialog-footer p { margin: 0; font-size: .85rem; }

@media (max-width: 42rem) {
  .shell { width: calc(100% - 2rem); }
  .dashboard { padding-top: 1.45rem; }
  .intro, .section-head { flex-wrap: wrap; align-items: start; }
  .device-grid { grid-template-columns: 1fr; }
  .bar { align-items: stretch; flex-direction: column; gap: .65rem; padding-block: .8rem; }
  .account { justify-content: space-between; gap: .75rem; min-width: 0; }
  .account span { font-size: .85rem; min-width: 0; }
  .intro .button, .section-head .button { justify-content: center; width: 100%; }
  .card form:not([method="dialog"]) button { justify-content: center; width: 100%; }
  .platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions { align-items: stretch; flex-direction: column; }
  .actions button { justify-content: center; width: 100%; }
  .dialog-footer { align-items: stretch; flex-direction: column; }
  .dialog-footer button { justify-content: center; width: 100%; }
}

/* Dark indigo surfaces and warm accents keep the portal legible on every screen. */
:root {
  --ink: #f8f9ff;
  --muted: #c4cbe0;
  --green: #ed6818;
  --green-dark: #ff8b3d;
  --mint: #202d50;
  --border: #394566;
  --background: #111b34;
  background: var(--background);
}
body { background: linear-gradient(125deg, #283568 0%, #101b32 48%, #223463 100%); min-height: 100vh; }
.topbar { background: #111b32; }
.card, dialog { background: #192544; box-shadow: 0 8px 30px #070d1d38; }
.brand-mark { background: #ec641c; color: #fff; }
.primary { background: #e96718; color: #fff; }
.primary:hover:not(:disabled) { background: #c9500c; }
.secondary { background: transparent; color: #ff9a54; border-color: #d66120; }
.secondary:hover:not(:disabled) { background: #2b3555; }
.danger { color: #ffa6a6; border-color: #a14a4a; }
.danger:hover:not(:disabled) { background: #49303e; }
input { background: #101a31; color: #fff; }
input::placeholder { color: #a5aec6; }
.platform { background: #202d50; }
.eyebrow { color: #ff9a54; }
:focus-visible { outline-color: #ff9a54; }
