/* Landing styles. The embedded client, account pages and remote viewer
   keep their existing layout. */
:where(.home-page:not(.desktop-client):not(.desktop-help)) {
  --home-panel: #121d30;
  --home-inset: #0c1627;
  --home-edge: #2b3b55;
  --home-gap: clamp(16px, 2vw, 24px);
  --home-pad: clamp(18px, 2.8vw, 34px);
  --home-radius: 20px;

  background:
    radial-gradient(ellipse 620px 340px at 79% 7%, #17367168, transparent),
    radial-gradient(ellipse 760px 460px at 12% 48%, #10214447, transparent);

  .header {
    gap: 16px;
    padding-block: 20px;
  }

  .header-nav { gap: 22px; }
  .header-nav > a:first-child {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--home-edge);
    border-radius: 9px;
    background: var(--home-inset);
  }
  .header-nav > a:first-child:hover {
    background: #182740;
    border-color: #4b6a98;
    text-decoration: none;
  }

  .intro {
    grid-template-columns: minmax(0, 1fr) minmax(216px, 30%);
    gap: var(--home-gap);
    margin-bottom: clamp(24px, 4vw, 45px);
  }
  .intro h1 {
    font-size: clamp(2.5rem, 4.75vw, 4.1rem);
    font-weight: 670;
    line-height: 1.06;
    letter-spacing: -.045em;
  }
  .intro h1 span { color: var(--accent-text); }
  .intro .lead {
    max-width: 46ch;
    margin-top: 14px;
    font-size: clamp(.94rem, 1.4vw, 1.06rem);
    line-height: 1.55;
    text-wrap: pretty;
  }
  .connection-art { padding: 0; }
  .connection-art img { max-width: 368px; margin-inline: auto; }

  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(285px, .54fr);
    gap: var(--home-gap);
    align-items: start;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .connection-card, .explanation {
    padding: var(--home-pad);
    border: 1px solid var(--home-edge);
    border-radius: var(--home-radius);
  }
  .connection-card {
    background: linear-gradient(150deg, #15243b, var(--home-panel) 55%);
    box-shadow: 0 18px 42px #04081145;
  }
  .role-tabs {
    gap: 6px;
    padding: 5px;
    border: 1px solid var(--home-edge);
    border-radius: 13px;
    background: var(--home-inset);
  }
  .role-tabs button {
    min-height: 60px;
    border-radius: 9px;
    gap: clamp(7px, 1.4vw, 13px);
    padding: 10px clamp(8px, 1.5vw, 14px);
  }
  .role-tabs [aria-selected="true"] {
    color: var(--ink);
    background: #1c3152;
    border-color: #4c77bd;
    box-shadow: inset 0 1px #86b5ff16;
  }
  .tab-copy strong { font-size: .9rem; white-space: normal; }
  .tab-copy small { font-size: .73rem; line-height: 1.35; white-space: normal; }

  .role-panel { padding: clamp(23px, 3.2vw, 34px) 0 0; }
  .role-panel h2 { margin: 0 0 8px; font-size: clamp(1.55rem, 2.8vw, 2rem); }
  .card-body { max-width: 52ch; margin: 0 0 20px; font-size: .94rem; line-height: 1.6; }
  .role-panel label { margin: 16px 0 8px; font-size: .83rem; }
  .role-panel #helpCode {
    min-height: 60px;
    padding: 10px 12px;
    border-color: #4c6892;
    background: var(--home-inset);
    color: var(--ink);
    font: 550 clamp(1.18rem, 4.4vw, 2rem)/1.25 "Cascadia Mono", Consolas, monospace;
    letter-spacing: .055em;
  }
  .role-panel #helpCode:focus { border-color: var(--accent-text); }
  .fine-print { font-size: .79rem; line-height: 1.5; margin-top: 8px; }

  #connectForm .password-access {
    margin: 16px 0;
    padding: 0 12px;
    border: 1px solid var(--home-edge);
    border-radius: 9px;
    background: #0d1929;
  }
  #connectForm .password-access[open] { padding-bottom: 13px; }
  #connectForm .password-access summary { font-size: .82rem; padding-block: 9px; }
  #connectForm .password-access label { margin-top: 6px; }
  #connectForm #devicePassword {
    margin: 0;
    padding: 10px 12px;
    color: var(--ink);
    border-color: #4c6892;
    font-size: 1rem;
    letter-spacing: normal;
    text-align: left;
  }
  #connectForm .download-choice {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 10px;
  }
  .role-panel .button { min-height: 48px; padding: 12px 14px; }
  #connectForm .download-choice > .button { min-width: 0; white-space: normal; text-align: center; }
  .role-panel .secondary { background: #182840; color: var(--ink); border-color: #405d85; }
  .role-panel .secondary:hover { background: #203657; border-color: #6385b9; }
  .panel-note { margin: 14px 0 0; font-size: .79rem; line-height: 1.5; }
  #receivePanel .receive-steps { margin-block: 21px; }
  #receivePanel .fine-print { max-width: 55ch; }
  .connection-status:not(:has(.notice:empty):has(#stop[hidden])) {
    min-height: auto;
    margin-top: 16px;
    padding: 12px 0 0;
  }
  .notice { font-size: .82rem; }

  .explanation { background: #101a2c; }
  .explanation h2 { display: block; margin: 0 0 21px; font-size: 1.3rem; font-weight: 650; }
  .timeline h3 { font-size: .86rem; }
  .timeline p { max-width: 34ch; font-size: .81rem; line-height: 1.55; }
  .privacy-note { padding-top: 16px; }
  .privacy-note p { font-size: .79rem; line-height: 1.55; }
  .reassurance { font-size: .78rem; }
}

@media (min-width: 801px) and (max-height: 780px) {
  :where(.home-page:not(.desktop-client):not(.desktop-help)) {
    --home-pad: 20px;

    .header { padding-block: 14px; }
    main { margin-top: 8px; }
    .intro { margin-bottom: 16px; }
    .intro h1 { font-size: clamp(2.4rem, 4vw, 3.5rem); }
    .connection-art img { max-width: 300px; }
    .role-panel { padding-top: 16px; }
    .card-body { margin-bottom: 12px; }
    .role-panel label { margin-top: 12px; }
    .role-panel #helpCode { min-height: 54px; }
    #connectForm .password-access { margin-block: 10px; }
  }
}

@media (max-width: 800px) {
  :where(.home-page:not(.desktop-client):not(.desktop-help)) {
    .intro { grid-template-columns: minmax(0, 1fr) minmax(180px, 29%); }
    .workspace { grid-template-columns: minmax(0, 1fr); }
    .explanation { padding: var(--home-pad); }
  }
}

@media (max-width: 600px) {
  :where(.home-page:not(.desktop-client):not(.desktop-help)) {
    .header { padding: 14px 16px; }
    .header-nav { gap: 9px; }
    .header-nav > a:first-child { min-height: 36px; padding-inline: 10px; white-space: nowrap; }
    .intro { padding: 0; margin-bottom: 22px; }
    .intro h1 { font-size: clamp(2.15rem, 9vw, 3.05rem); }
    .intro .lead { font-size: .91rem; }
    .role-tabs button { min-height: 52px; }
    .tab-copy small { font-size: .67rem; }
    .reassurance { justify-content: flex-start; padding-left: 0; }
  }
}

@media (max-width: 500px) {
  :where(.home-page:not(.desktop-client):not(.desktop-help)) {
    #connectForm .download-choice { grid-template-columns: minmax(0, 1fr); }
    #receivePanel > .button { width: 100%; }
  }
}

@media (max-width: 400px) {
  :where(.home-page:not(.desktop-client):not(.desktop-help)) {
    .platform-badge, .tab-copy small { display: none; }
    .tab-icon { display: grid; width: 25px; height: 25px; }
    .tab-icon .icon { width: 16px; height: 16px; }
    .role-tabs button { justify-content: flex-start; gap: 5px; padding-inline: 6px; }
    .tab-copy strong { font-size: .81rem; }
  }
}
