/* Account prototype pages (sign-in, devices, settings, subscription). Builds on the firmware store's home.css
   and store.css and the shared site-chrome.css; same one-layer rule as the film bay: tone, not outlines. */
[hidden] { display: none !important; }
body { background: var(--bg); }

.proto-banner { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; padding: 10px var(--gx-gutter); background: #2a2416; color: var(--amber); font-size: 14px; line-height: 1.5; }
.proto-banner strong { font-weight: 620; }
.proto-banner span { color: var(--ink); }


.acct-wrap { padding-bottom: 0; }
.acct-wrap > :not(.store-intro) { max-width: 880px; margin-left: auto; margin-right: auto; }
.acct-wrap .store-intro.gx-open { padding-bottom: clamp(32px, 4vw, 56px); }

/* Sub navigation between the account pages */
.acct-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: clamp(32px, 4vw, 48px) !important; }
.acct-tabs a, .acct-tabs button { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--rule); border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 15px; text-decoration: none; cursor: pointer; }
.acct-tabs a:hover, .acct-tabs button:hover { border-color: var(--muted); color: var(--ink); }
.acct-tabs a[aria-current='page'] { border-color: var(--paper); background: var(--paper); color: var(--ink-on-light); }
.acct-tabs .acct-signout { margin-left: auto; border-color: transparent; }

.acct-section { padding: 0 0 clamp(40px, 5vw, 64px); }
.acct-section + .acct-section { padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--rule); }
.acct-section h2 { margin: 0 0 8px; font-size: clamp(22px, 1rem + 1.2vw, 32px); font-weight: 560; letter-spacing: -.03em; line-height: 1.15; }
.acct-text { max-width: 40em; margin: 0; color: var(--ink); font-size: 17px; line-height: 1.6; }
.acct-muted { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.acct-link { min-height: 44px; padding: 0 2px; border: 0; background: none; color: var(--amber); font: inherit; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.acct-danger { color: var(--rose); }
.acct-wrap :focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* Forms */
.acct-card { max-width: 520px; padding: clamp(22px, 3vw, 32px); border-radius: var(--r-m); background: var(--surface-2); }
.acct-field { display: grid; gap: 8px; margin-top: 18px; }
.acct-field:first-child { margin-top: 0; }
.acct-field > label, .acct-field > .acct-label { color: var(--ink); font-size: 15px; font-weight: 600; }
.acct-field .acct-hint { color: var(--muted); font-size: 14px; line-height: 1.5; }
.acct-input, .acct-select, .acct-textarea { width: 100%; min-height: 48px; box-sizing: border-box; padding: 10px 14px; border: 1px solid var(--rule); border-radius: var(--r-s); background: var(--surface); color: var(--ink); font: inherit; font-size: 17px; }
.acct-textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.acct-input:focus-visible, .acct-select:focus-visible, .acct-textarea:focus-visible { border-color: var(--amber); outline: none; }
.acct-input[aria-invalid='true'] { border-color: var(--rose); }
.acct-otp { font: 600 30px var(--mono); letter-spacing: .5em; text-align: center; padding-left: .5em; }
.acct-code-row { display: flex; align-items: center; gap: 10px; }
.acct-code-row .acct-input { width: 120px; font: 600 21px var(--mono); letter-spacing: .14em; text-align: center; text-transform: uppercase; }
.acct-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 24px; }
.acct-actions .store-button, .acct-round { border-radius: 999px; }
.store-button.danger { border-color: var(--rose); color: var(--rose); }
.store-button.danger:hover:not(:disabled) { border-color: var(--rose); background: #2a1a1e; }
.acct-select-inline { width: auto; min-width: 180px; }
.acct-field-spaced { margin-top: 18px !important; }
.acct-caption { margin: 0 0 12px; }
.landing + .acct-caption { margin-top: 28px; }
.acct-error { margin: 10px 0 0; color: var(--rose); font-size: 15px; }
.acct-ok { margin: 10px 0 0; color: var(--ok); font-size: 15px; }
.acct-captcha { display: flex; align-items: center; gap: 12px; min-height: 64px; margin-top: 18px; padding: 0 16px; border: 1px dashed var(--rule); border-radius: var(--r-s); color: var(--muted); font-size: 14px; }
.acct-captcha::before { content: ""; width: 20px; height: 20px; border-radius: 50%; background: var(--ok); }
.acct-consent { margin-top: 18px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.acct-consent a { color: var(--ink); }

/* Sign-in split: form on the left, what an account gives you on the right */
.acct-split { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: start; max-width: 1100px !important; }
.acct-perks-head { margin: 0 0 18px; color: var(--muted); font-size: 15px; font-weight: 400; }
.acct-perks-foot { margin-top: 24px; }
.acct-perks { display: grid; gap: 22px; margin: 6px 0 0; padding: 0; list-style: none; }
.acct-perks li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px 12px; }
.acct-perks b { grid-column: 2; font-size: 17px; font-weight: 600; }
.acct-perks span { grid-column: 2; color: var(--muted); font-size: 15px; line-height: 1.6; }
.acct-perks i { grid-row: span 2; color: var(--amber); font-style: normal; font: 600 15px var(--mono); padding-top: 2px; }

/* Device library */
.dev-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.dev-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.dev-card { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 18px 22px; align-items: start; padding: 22px; border-radius: var(--r-m); background: var(--surface-2); }
.dev-badge { display: grid; place-items: center; height: 60px; border-radius: var(--r-s); background: var(--surface); color: var(--ink); font: 600 15px var(--mono); letter-spacing: .02em; }
.dev-badge.gr3x { color: var(--amber); }
.dev-badge.gr4 { color: var(--ember-text); }
.dev-title { margin: 0; font-size: 20px; font-weight: 620; letter-spacing: -.02em; }
.dev-title small { margin-left: 8px; color: var(--muted); font-size: 15px; font-weight: 400; }
.dev-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 18px; margin: 14px 0 0; }
.dev-meta div { display: grid; gap: 2px; }
.dev-meta dt { color: var(--muted); font-size: 13px; }
.dev-meta dd { margin: 0; color: var(--ink); font-size: 15px; }
.dev-meta .mono { font-family: var(--mono); letter-spacing: .06em; }
.dev-note { margin: 12px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.dev-go { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.dev-go a, .dev-go span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 14px; text-decoration: none; }
.dev-go a:hover { background: #262523; }
.dev-go span { color: var(--muted); }
.dev-tools { display: flex; gap: 4px; }
.dev-tools button { min-height: 36px; padding: 0 10px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.dev-tools button:hover { color: var(--ink); }
.dev-empty { padding: clamp(24px, 4vw, 40px); border: 1px dashed var(--rule); border-radius: var(--r-m); }
.dev-empty p { margin: 0 auto; max-width: 30em; color: var(--muted); font-size: 17px; line-height: 1.6; }
.dev-empty .store-button { margin-top: 18px; border-radius: 999px; }

/* Model picker in the dialog */
.model-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.model-pick label { position: relative; display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r-s); cursor: pointer; }
.model-pick input { position: absolute; opacity: 0; pointer-events: none; }
.model-pick b { font-size: 16px; }
.model-pick span { color: var(--muted); font-size: 13px; }
.model-pick label:has(input:checked) { border-color: var(--amber); background: #2a2416; }
.model-pick label:has(input:focus-visible) { outline: 2px solid var(--amber); outline-offset: 2px; }

dialog.acct-dialog { width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: var(--r-m); background: var(--surface-2); color: var(--ink); font-family: var(--font); }
dialog.acct-dialog::backdrop { background: rgb(0 0 0 / .7); }
.acct-dialog form { padding: clamp(22px, 3vw, 32px); }
.acct-dialog h2 { margin: 0 0 20px; font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.acct-dialog .acct-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.acct-dialog .acct-row .acct-field { margin-top: 18px; }

/* Settings */
.set-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 18px 0; border-top: 1px solid var(--rule); }
.set-row:first-of-type { border-top: 0; }
.set-row > div { flex: 1 1 320px; }
.set-row b { display: block; font-size: 17px; font-weight: 600; }
.set-row p { margin: 4px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.set-row .store-button { border-radius: 999px; }
.toggle { position: relative; display: inline-block; width: 48px; height: 28px; flex: none; }
.toggle input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: var(--rule); transition: background .18s var(--ease-out); pointer-events: none; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); transition: transform .18s var(--ease-out); }
.toggle input:checked + span { background: var(--amber); }
.toggle input:checked + span::after { transform: translateX(20px); background: var(--ink-on-light); }
.toggle input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips span { padding: 3px 10px; border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 13px; }
.session-list { margin: 0; padding: 0; list-style: none; }
.session-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 14px 0; border-top: 1px solid var(--rule); font-size: 15px; }
.session-list li:first-child { border-top: 0; }
.session-list small { color: var(--muted); font-size: 14px; }
.session-list .now { color: var(--ok); }

/* Subscription block and landing states */
.sub-block { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); padding: clamp(24px, 4vw, 40px); border-radius: var(--r-m); background: var(--surface-2); }
.sub-block h2 { margin: 0; font-size: clamp(24px, 1rem + 1.4vw, 36px); font-weight: 560; letter-spacing: -.03em; line-height: 1.15; }
.sub-block .acct-text { margin-top: 12px; }
.sub-models { display: flex; flex-wrap: wrap; gap: 6px; }
.sub-models label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 999px; font-size: 15px; cursor: pointer; }
.sub-models input { width: 16px; height: 16px; accent-color: var(--amber); }
.sub-models label:has(input:checked) { border-color: var(--amber); }
.landing { max-width: 560px; padding: clamp(28px, 4vw, 44px); border-radius: var(--r-m); background: var(--surface-2); }
.landing h2 { margin: 0 0 10px; font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.landing .mark { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-bottom: 16px; border-radius: 50%; background: var(--ok); color: var(--ink-on-light); font-size: 22px; font-weight: 700; }
.landing .mark.muted { background: var(--rule); color: var(--ink); }

/* Email previews: shown on a light "mail client" sheet */
.mail-grid { display: grid; gap: 28px; }
.mail { max-width: 600px; border-radius: var(--r-m); overflow: hidden; background: #f4f2ee; color: #1d1c1a; font-family: var(--font); }
.mail-head { padding: 14px 20px; background: #e6e3dc; color: #55524c; font-size: 13px; line-height: 1.7; }
.mail-head b { color: #1d1c1a; }
.mail-body { padding: 28px 28px 8px; font-size: 16px; line-height: 1.65; }
.mail-body h3 { margin: 0 0 12px; font-size: 22px; letter-spacing: -.02em; }
.mail-body p { margin: 0 0 14px; }
.mail-code { display: inline-block; margin: 6px 0 16px; padding: 12px 22px; border-radius: 8px; background: #1d1c1a; color: #f4f2ee; font: 600 30px var(--mono); letter-spacing: .3em; }
.mail-btn { display: inline-block; margin: 4px 0 18px; padding: 12px 22px; border-radius: 999px; background: #1d1c1a; color: #f4f2ee !important; font-weight: 600; text-decoration: none; }
.mail-body ul { margin: 0 0 14px; padding-left: 20px; }
.mail-foot { padding: 16px 28px 24px; border-top: 1px solid #dcd8d0; color: #6d6962; font-size: 13px; line-height: 1.7; }
.mail-foot a { color: #1d1c1a; }

@media (max-width: 760px) {
  .acct-split, .sub-block { grid-template-columns: 1fr; }
  .dev-card { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
  .dev-badge { width: 88px; height: 44px; }
  .dev-tools { position: absolute; top: 22px; right: 10px; }
  .dev-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dev-card { position: relative; }
  .model-pick { grid-template-columns: 1fr; }
  .acct-dialog .acct-row { grid-template-columns: 1fr; }
  .acct-tabs .acct-signout { margin-left: 0; }
  .gx-header-actions { min-width: 0; }
  .acct-entry .acct-entry-text { display: none; }
  .acct-entry { padding: 0 8px; }
}

/* Before the first camera: the way there, step by step */
.dev-empty h3 { margin: 0 0 14px; font-size: 20px; }
.dev-steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: step; text-align: left; }
.dev-steps li { display: grid; grid-template-columns: 32px 1fr; gap: 4px 12px; align-items: start; counter-increment: step; }
.dev-steps li::before { content: counter(step); grid-row: span 3; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--rule); border-radius: 50%; color: var(--muted); font-size: 14px; }
.dev-steps li.done::before { content: "✓"; border-color: var(--ok); color: var(--ok); }
.dev-steps b { font-size: 16px; }
.dev-steps span { color: var(--muted); font-size: 15px; line-height: 1.5; }
.dev-steps a { color: var(--amber); font-size: 15px; }
.dev-steps .store-button { justify-self: start; margin-top: 4px; }

/* Mail notifications: switches on the account page and the email page */
.mail-prefs .set-row:first-of-type { border-top: 0; }
.mail-models { align-items: center; margin-top: 12px; transition: opacity .18s var(--ease-out); }
.mail-models label { min-height: 34px; padding: 0 12px; font-size: 14px; }
.mail-models-label { color: var(--muted); font-size: 14px; }
.mail-firmware-off .mail-models { opacity: .4; pointer-events: none; }
/* GR IV support note under the model filter; the GR IV choice doubles as its "support is ready" notice. */
.mail-prefs .mail-gr4-note { margin: 8px 0 0; color: var(--amber); font-size: 14px; line-height: 1.5; transition: opacity .18s var(--ease-out); }
.mail-firmware-off .mail-gr4-note { opacity: .4; }
.mail-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: clamp(28px, 4vw, 40px) !important; padding: 18px 22px; border-radius: var(--r-m); background: #2a2416; }
.mail-notice-text { display: grid; gap: 4px; margin: 0; font-size: 15px; line-height: 1.6; }
.mail-notice-text b { color: var(--amber); font-size: 15px; }
.mail-notice-actions { display: flex; align-items: center; gap: 12px 18px; }
.mail-landing { margin-bottom: clamp(32px, 4vw, 48px) !important; }
.mail-leave { padding-top: 18px; border-top: 1px solid var(--rule); }
