:root {
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: #173c3b;
  background: #f3f7f6;
  font-size: 16px;
  line-height: 1.7;
  color-scheme: light;
  --accent: #087b70;
  --border: #dce7e4;
  --muted: #5b726e;
}
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 1100px; margin: auto; padding: 28px 32px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 24px; margin-bottom: 36px; border-bottom: 1px solid var(--border); }
.brand { font-size: 32px; font-weight: 750; text-decoration: none; color: #08786e; line-height: 1.4; }
.brand span { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
h1 { font-size: 36px; line-height: 1.35; margin: 8px 0 12px; }
h2 { font-size: 21px; margin: 0; }
h3 { font-size: 19px; margin: 0; overflow-wrap: anywhere; }
p { color: var(--muted); margin: 8px 0 20px; overflow-wrap: anywhere; }
.eyebrow { font-size: 13px; font-weight: 650; color: #08786e; }
.card { min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 26px; box-shadow: 0 5px 24px #153b3205; }
.narrow { max-width: 450px; margin: 55px auto; padding: 32px; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.introCopy { min-width: 0; }
.intro p { margin: 0 0 10px; }
.intro .accountEmail { display: inline-block; max-width: 100%; color: #41605a; font-size: 13px; border: 1px solid var(--border); border-radius: 6px; background: #eaf1ee; padding: 3px 9px; margin: 0; text-align: start; }
.addDevice { flex-shrink: 0; }
.addDevice span { font-size: 20px; line-height: 1; }
label { display: block; font-weight: 600; font-size: 14px; margin: 18px 0 6px; }
input { font: inherit; background: #fcfdfd; color: #173c3b; width: 100%; min-width: 0; min-height: 48px; padding: 10px 14px; border: 1px solid #afc5bf; border-radius: 10px; }
input::placeholder { color: #748982; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; font: inherit; font-size: 15px; font-weight: 600; line-height: 1.6; border: 1px solid transparent; border-radius: 10px; background: var(--accent); color: #fff; padding: 10px 17px; cursor: pointer; text-decoration: none; text-align: center; overflow-wrap: anywhere; }
button:hover, .button:hover { background: #056357; }
button:disabled { opacity: .55; cursor: wait; }
.quiet { background: transparent; color: #42625a; border-color: #cbdad4; }
.quiet:hover { background: #eaf2ef; color: #163d34; }
.danger { color: #a23d37; border-color: transparent; }
.danger:hover { color: #8e2924; background: #fff0ee; border-color: #efd6d2; }
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #62b6a7; outline-offset: 3px; }
#loginButton { width: 100%; margin-top: 24px; }
.sectionTitle { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0 0 18px; }
.sectionTitle > div { min-width: 0; }
.sectionTitle > button { flex-shrink: 0; }
.sectionHint { font-size: 13px; margin: 3px 0 0; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; min-height: 26px; font-size: 13px; font-weight: 600; padding: 0 7px; margin-inline-start: 5px; vertical-align: middle; color: #42625a; background: #e4eeea; border-radius: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr)); gap: 18px; }
.device { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 24px; }
.device h3 { max-width: 100%; line-height: 1.5; }
.device p { max-width: 100%; font-size: 12px; margin: 0; color: #6b807b; }
.device .actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; padding-top: 18px; margin-top: auto; border-top: 1px solid #edf2ef; }
.device .actions .button { flex: 1 1 auto; }
.device .actions button { flex: 1 1 auto; font-size: 13px; padding-inline: 10px; }
.state { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: #5b726c; background: #f0f4f2; border-radius: 6px; padding: 3px 8px; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.state.online { color: #087153; background: #e8f6ef; }
.state.busy { color: #906016; background: #fff4df; }
.empty { text-align: center; padding: 38px 24px; border-style: dashed; box-shadow: none; }
.emptyIcon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 14px; color: var(--accent); background: #e8f4ef; font-size: 29px; line-height: 1; }
.empty p { max-width: 430px; margin: 8px auto 20px; font-size: 14px; }
.pairing { margin-top: 28px; padding: 0; box-shadow: none; }
.pairing summary { position: relative; cursor: pointer; list-style: none; padding: 20px 24px 20px 52px; border-radius: 18px; }
.pairing summary::-webkit-details-marker { display: none; }
.pairing summary::after { content: "+"; position: absolute; left: 24px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 24px; line-height: 1; }
.pairing[open] summary::after { content: "−"; }
.pairingTitle { display: block; font-size: 17px; font-weight: 650; }
.pairingHint { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.pairBody { margin: 0 24px; padding: 4px 0 24px; border-top: 1px solid var(--border); }
.pairBody > p { max-width: 660px; font-size: 14px; margin-top: 18px; }
.row { display: flex; gap: 12px; max-width: 540px; }
.row input { flex: 1; text-transform: uppercase; letter-spacing: 1px; }
.row input::placeholder { text-transform: none; letter-spacing: 0; }
.row button { white-space: nowrap; }
#pairReview { background: #edf8f4; border: 1px solid #cce5db; padding: 22px; margin-top: 22px; border-radius: 12px; }
#pairName { margin-top: 5px; }
#pairReview p { font-size: 14px; }
.code { display: block; width: fit-content; max-width: 100%; font-family: Consolas, monospace; font-size: 27px; font-weight: 600; letter-spacing: 3px; overflow-wrap: anywhere; background: #fff; border: 1px solid #cce5db; border-radius: 8px; padding: 5px 12px; }
#pairId.muted { font-size: 12px; margin: 10px 0 20px; text-align: right; }
.reviewActions { display: flex; flex-wrap: wrap; gap: 10px; }
#notice:empty { display: none; }
#notice:not(:empty) { background: #fff2df; border: 1px solid #edd4ac; border-radius: 10px; padding: 12px 16px; color: #79501d; font-size: 14px; margin-bottom: 24px; }
footer { display: flex; gap: 9px; align-items: baseline; font-size: 12px; margin: 32px 0 12px; color: #627a71; max-width: 760px; }
.footerMark { color: #559c85; flex-shrink: 0; font-size: 8px; }
[hidden] { display: none !important; }
@media (max-width: 600px) {
  main { padding: 20px 18px; }
  header { margin-bottom: 28px; gap: 10px; }
  .brand { font-size: 29px; }
  .brand span { font-size: 11px; }
  #logout { font-size: 13px; padding-inline: 12px; }
  h1 { font-size: 30px; }
  h2 { font-size: 19px; }
  .card { padding: 20px; }
  .narrow { margin: 30px auto; }
  .intro { align-items: stretch; flex-direction: column; gap: 18px; margin-bottom: 28px; }
  .intro p { font-size: 14px; }
  .addDevice { align-self: flex-start; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .device { padding: 20px; }
  .pairing { padding: 0; }
  .pairing summary { padding: 18px 20px 18px 44px; }
  .pairing summary::after { left: 20px; }
  .pairBody { margin-inline: 20px; padding-bottom: 20px; }
  .row { flex-direction: column; }
  #pairReview { padding: 16px; }
  .code { font-size: 22px; letter-spacing: 2px; padding-inline: 8px; }
  .reviewActions { flex-direction: column; }
  .empty { padding: 30px 20px; }
}
