/* The launcher: Domestique's v2 visual system (YT-PLATFORM-DESIGN-001), the same tokens, nothing new.
   Light, low-glare; colour only carries meaning (green: up; muted grey: down or not connected;
   amber: needs Holden). 15px body, 12px minimum. */
:root {
  --page: #F3F1EC; --card: #FBFAF7; --card-line: #E2DED5; --divider: #ECE9E2; --well: #F5F3EE;
  --ink: #2A2B2E; --ink-2: #575A60; --ink-3: #6F7278;
  --blue: #3F6597; --blue-dark: #23406B; --blue-tint: #E6EBF2;
  --track: #EEF0F3; --line-btn: #C9CED6;
  --better: #2F7A5F; --better-bg: #DDEBE3;
  --worse: #A4492F; --worse-bg: #F7E3DC;
  --needs: #7A4E0C; --needs-bg: #F7EBD3; --needs-line: #E2C48A;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--ink); }
body { font-family: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); text-decoration: underline; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: var(--ink); }
h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.sub { margin: 0 0 18px; font-size: 14px; color: var(--ink-2); }
.small { font-size: 13px; color: var(--ink-3); }

/* Buttons (Domestique .btn) */
.btn { display: inline-block; padding: 9px 14px; border-radius: 8px; font-size: 15px; font-weight: 600; background: var(--card);
  border: 1px solid var(--line-btn); color: var(--ink); text-align: center; }
.btn:hover { text-decoration: none; background: var(--well); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #FFFFFF; }
.btn.primary:hover { background: var(--blue-dark); color: #FFFFFF; }
.btn[disabled] { color: var(--ink-3); background: var(--track); border-color: var(--track); cursor: default; }
.btn.wide { display: block; width: 100%; }
.linkbtn { color: var(--blue); font-size: 14px; }
.linkbtn:hover { color: var(--blue-dark); text-decoration: underline; }

/* Signed-out pages: one card in the middle */
.door { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 40px; }
.door-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--card-line); border-radius: 14px; padding: 26px 24px; }
.door-card .brand { margin: 0 0 22px; font-weight: 700; font-size: 18px; }
.alt { margin: 16px 0 0; text-align: center; font-size: 14px; }
.notice { margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; background: var(--needs-bg); border: 1px solid var(--needs-line);
  color: var(--needs); font-size: 14px; font-weight: 600; }
.error { margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; background: var(--worse-bg); color: var(--worse); font-size: 14px; }
.error[hidden] { display: none; }
#passkey-error { margin: 14px 0 0; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 5px; font-size: 14px; color: var(--ink-2); }
.form input { padding: 9px 11px; border: 1px solid var(--line-btn); border-radius: 8px; background: #FFFFFF; font-size: 16px; width: 100%; }
.form input:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.field { margin: 0; display: grid; gap: 5px; font-size: 14px; color: var(--ink-2); }
.field .value { color: var(--ink); font-size: 16px; }
.qr { display: flex; justify-content: center; margin: 4px 0 10px; }
.qr svg { max-width: 220px; height: auto; }
.key { font-family: ui-monospace, Consolas, monospace; color: var(--ink); letter-spacing: 0.04em; }

/* Signed-in top bar (Domestique .topbar) */
.topbar { background: var(--card); border-bottom: 1px solid var(--card-line); }
.topbar .in { max-width: 1360px; margin: 0 auto; padding: 10px 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar .brand { font-weight: 700; font-size: 16px; color: var(--ink); white-space: nowrap; }
.topbar .right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar .who { font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline { display: inline; margin: 0; }

/* Tool cards: three across on a wide desktop, two on a narrow one, one on a phone; equal height */
.wrap { max-width: 1360px; margin: 0 auto; padding: 24px 28px 64px; }
.cards { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: 1fr; gap: 20px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tool-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto 1fr auto; column-gap: 14px; row-gap: 3px;
  background: var(--card); border: 1px solid var(--card-line); border-radius: 14px; padding: 20px 22px; color: var(--ink); min-width: 0; }
a.tool-card:hover { text-decoration: none; background: var(--well); border-color: var(--line-btn); color: var(--ink); }
a.tool-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.tool-card .icon { grid-row: 1 / span 2; width: 44px; height: 44px; }
.tool-card .name { font-size: 17px; font-weight: 600; line-height: 1.3; }
.tool-card .line { font-size: 14px; color: var(--ink-2); }
.tool-card .state { grid-column: 2; align-self: end; margin-top: 12px; display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }
.tool-card .note { grid-column: 2; font-size: 13px; color: var(--ink-3); }
.tool-card.off { cursor: default; }
.tool-card.off .name, .tool-card.off .line { color: var(--ink-3); }
.tool-card.off .icon { opacity: 0.55; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); flex: none; }
.state.up { color: var(--better); }
.state.up .dot { background: var(--better); }
.state.down, .state.off, .state.unknown { color: var(--ink-3); }
.empty { background: var(--well); border-radius: 10px; padding: 14px 16px; font-size: 15px; color: var(--ink-2); margin: 0; }

@media (max-width: 639px) {
  .topbar .in { padding: 10px 16px; }
  .wrap { padding: 16px 16px 48px; }
  .door { padding-top: 8vh; }
}
