:root {
  color-scheme: dark;
  --ink: #f4f4f5;
  --muted: #a2a2a9;
  --paper: #050505;
  --surface: #111113;
  --line: #29292d;
  --red: #d71920;
  --red-hover: #ed252c;
  --accent: #ff6269;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
header { height: 88px; max-width: 1160px; margin: auto; padding: 0 36px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { font-size: 13px; letter-spacing: 3px; text-decoration: none; font-weight: 700; }
.brand span { margin: 0 14px; color: var(--accent); }
.dashboard { max-width: 1088px; padding: 54px 36px 20px; margin: auto; }
.eyebrow { font-size: 10px; letter-spacing: 2.3px; color: var(--accent); font-weight: 700; }
h1 { font-size: clamp(32px, 4vw, 48px); font-weight: 500; line-height: 1.18; letter-spacing: -1.3px; margin: 16px 0 20px; }
h2 { font-size: 22px; font-weight: 500; line-height: 1.3; letter-spacing: -.4px; margin: 16px 0 12px; }
p { color: var(--muted); margin: 0 0 20px; }
p strong { color: #dedee1; font-weight: 500; }
.intro { margin-bottom: 42px; }
.intro p { font-size: 16px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px 32px; display: flex; flex-direction: column; }
.card-head { display: flex; justify-content: space-between; align-items: center; }
.step { color: #93939b; font-size: 12px; letter-spacing: 1px; }
.badge { border: 1px solid #3b3b41; padding: 4px 10px; border-radius: 4px; color: #b8b8bf; font-size: 11px; }
.badge.connected { background: #281215; border-color: #663136; color: #ff9da2; }
button, .button { border: 1px solid transparent; background: var(--red); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 46px; padding: 12px 22px; border-radius: 5px; font: 600 13px "Helvetica Neue", Arial, sans-serif; letter-spacing: .2px; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
button:hover, .button:hover { background: var(--red-hover); }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
button:disabled, .disabled { opacity: .5; cursor: not-allowed; }
button:disabled:hover, .button.disabled:hover { background: var(--red); }
button.secondary { background: #19191c; border-color: #45454c; color: var(--ink); }
button.secondary:hover { background: #26262b; border-color: #707078; }
button.secondary:disabled:hover { background: #19191c; border-color: #45454c; }
.card .button, .card button { align-self: flex-start; margin-top: auto; }
.subtle-link { font-size: 11px; color: #b6b6be; margin-top: 16px; text-underline-offset: 4px; }
.text-button { color: #c0c0c6; background: none; min-height: 0; padding: 6px 12px; font-weight: 400; }
.text-button:hover { background: #1c1c20; color: #fff; }
.metric { display: flex; align-items: baseline; gap: 12px; margin-top: auto; margin-bottom: 12px; }
.metric strong { font-size: 48px; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
.metric span, small { font-size: 12px; color: var(--muted); }
.sync-card { display: flex; align-items: center; justify-content: space-between; gap: 32px; background: #131315; border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 8px; padding: 28px 32px; margin: 24px 0 34px; }
.sync-card div { max-width: 620px; }
.sync-card h2 { margin-top: 8px; }
.sync-card p { margin: 0; font-size: 13px; }
.sync-card button { flex-shrink: 0; }
.result { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.result-head h2 { font-size: 16px; }
.result-head span { font-size: 11px; color: var(--muted); }
.result p { font-size: 13px; margin-bottom: 8px; }
.details { font-size: 12px; color: #c5c5cb; }
.info { padding-top: 28px; max-width: 790px; font-size: 12px; }
.info strong { font-weight: 500; }
.info p { margin-top: 8px; }
footer { font-size: 10px; color: #94949d; padding-top: 28px; padding-bottom: 16px; letter-spacing: .3px; }
.notice { border: 1px solid #4c292d; border-radius: 5px; background: #1d1113; color: #edc5c8; padding: 12px 16px; font-size: 13px; margin: 0 0 24px; }
.notice.error { background: #2d1115; border-color: #91343c; color: #ffb0b5; }
.error-text, #error { color: #ff8289; }
dialog { padding: 32px; max-width: 510px; background: #111113; color: var(--ink); border: 1px solid #45454c; border-radius: 10px; box-shadow: 0 24px 100px #000b; }
dialog::backdrop { background: #000b; }
dialog p { font-size: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
#automation-card { margin-bottom: 32px; }
#automation-card .dialog-actions { justify-content: flex-start; flex-wrap: wrap; }
#pair { display: inline-flex; align-items: center; padding: 12px 18px; min-height: 46px; border: 1px solid #45454c; border-radius: 5px; text-decoration: none; font-size: 13px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { max-width: 430px; width: 100%; padding: 42px; background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--red); border-radius: 10px; }
.login-card h1 { font-size: 35px; }
.arrow { color: var(--accent); }
.login-card p { font-size: 13px; }
form label { display: block; color: #ccc; font-size: 12px; margin: 24px 0 8px; }
input { width: 100%; background: #080809; color: #fff; border: 1px solid #494950; border-radius: 5px; padding: 12px; font-size: 16px; }
input:-webkit-autofill { -webkit-text-fill-color: #fff; box-shadow: 0 0 0 1000px #080809 inset; }
form#login button { width: 100%; margin-top: 16px; }
#error { margin-top: 18px; min-height: 20px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { button, .button { transition: none; } }
@media (max-width: 720px) {
  header { height: 72px; padding: 0 24px; }
  .brand { font-size: 11px; letter-spacing: 2px; }
  .brand span { margin: 0 8px; }
  .dashboard { padding: 32px 24px; }
  .cards { grid-template-columns: 1fr; }
  .card, .sync-card { padding: 24px; }
  .sync-card { flex-direction: column; align-items: stretch; gap: 20px; }
  .result-head { align-items: flex-start; flex-direction: column; gap: 0; }
  .login-card { padding: 30px; }
  dialog { margin: auto 16px; }
  .dialog-actions { flex-wrap: wrap; }
}
