/* Customer portal (dashboard.zynoptes.com) — page-specific rules on top of /shell.css. */

#usage-root, #billing-root, #keys-root { display: grid; gap: 20px; }

/* Sign-in: Google, "or", then a code emailed */
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--ink-faint); font-size: 12px; line-height: 16px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
#code-email { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
#email-code input[name="code"] { font-family: var(--font-mono); font-size: 16px; letter-spacing: 0.12em; }

/* ZynoCode's sign-in, to approve: the code to check against ZynoCode's, and the choice */
#device-panel { border-color: rgba(0, 153, 255, 0.35); }
#device-ask, #device-confirm { display: grid; gap: 10px; }
#device-entry { margin-top: 6px; }
#device-entry input { font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.device-code { color: var(--ink-muted); }
#device-code { font-family: var(--font-mono); font-size: 22px; line-height: 32px; font-weight: 600; letter-spacing: 0.08em; color: var(--ink); margin-left: 6px; }
.device-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* Getting started: numbered steps, the first with the install command for the chosen platform */
.install { border-color: rgba(0, 153, 255, 0.35); }
.install-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 18px; }
.install-steps > li { counter-increment: step; position: relative; padding-left: 38px; display: grid; gap: 8px; min-width: 0; }
.install-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 600;
}
.install-step-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
/* The platform switch makes the first step's head 38px tall: its number sits level with the title, centred in it. */
.install-steps > li:has(> .install-step-head)::before { top: 7px; }
.install-step-title { font-size: 14px; line-height: 24px; font-weight: 600; color: var(--ink); }
.install-command { margin: 0; font-size: 13.5px; }
.install .hint code, .issued .hint code { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); background: #1a1a1d; border-radius: 4px; padding: 1px 5px; }
.install .hint button.link { font-size: inherit; }

@media (max-width: 700px) {
  .install-steps > li { padding-left: 0; padding-top: 32px; }
  .install-steps > li:has(> .install-step-head)::before { top: 0; }
  .install .keyrow { flex-direction: column; }
  .install .keyrow button { align-self: stretch; }
}

/* Activation */
.activate-form { max-width: 420px; margin: 0 auto; width: 100%; }

/* The credits card carries the one progress bar, beside the reset card */
#cards .metric:first-child { grid-column: span 3; }
.overage { margin: -6px 2px 0; font-size: 13px; color: var(--ink-muted); }
.overage:empty { display: none; }

/* CLI key forms */
.key-form { display: flex; gap: 10px; align-items: end; max-width: 520px; }
.key-form label { flex: 1; }
.key-form button { flex: none; }
.billing-actions { display: flex; gap: 10px; margin: 4px 0 18px; }
.billing-actions[hidden] { display: none; }
#invited button { margin-top: 12px; }
.issued { display: grid; gap: 8px; }
.issued-label { font-weight: 500; font-size: 13px; color: var(--ink-muted); }
#issued { margin: 0; }

@media (max-width: 700px) {
  #cards .metric:first-child { grid-column: auto; }
  .key-form { flex-direction: column; align-items: stretch; }
}

/* Tabs: Usage and CI/CD */
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--hairline-soft); border-radius: 9px; justify-self: start; }
.tabs .tab { background: transparent; color: var(--ink-muted); border: 0; border-radius: 6px; padding: 6px 14px; font-size: 13px; font-weight: 500; }
.tabs .tab:hover { background: transparent; color: var(--ink); }
.tabs .tab.active { background: #26262a; color: var(--ink); }

/* CI/CD */
.ci, .ci-main { display: grid; gap: 20px; }
.ci-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hint { font-size: 13px; color: var(--ink-muted); }
.table-foot { display: flex; justify-content: center; }
.table-foot button { min-width: 140px; }
.clickable-cell { cursor: pointer; }
.clickable-cell:hover { color: var(--ink); }
.button-link { display: inline-flex; align-items: center; padding: 7px 12px; border: 1px solid var(--hairline); border-radius: var(--radius); font-size: 13px; font-weight: 500; color: var(--ink); }
.button-link:hover { background: var(--surface-hover); text-decoration: none; }
.ci-run-status { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.ci-run-cases { display: grid; gap: 14px; }
.ci-case { border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 16px; display: grid; gap: 10px; }
.ci-case.blocking { border-color: rgba(255, 77, 94, 0.4); }
.ci-case-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.ci-case-head h3 { font-size: 14px; font-weight: 600; }
.ci-case-line { font-size: 13px; color: var(--ink-muted); }
.ci-case-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.ci-needs ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.ci-story { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 13px; }
.ci-story dt { color: var(--ink-faint); }
.ci-story dd { margin: 0; overflow-wrap: anywhere; }
.ci-case-line code, .ci-story code { font-family: var(--font-mono); font-size: 12px; color: var(--ink); overflow-wrap: anywhere; }
#ci-repos td:first-child, #ci-runs td:first-child { overflow-wrap: anywhere; }

@media (max-width: 700px) {
  .ci-story { grid-template-columns: 1fr; }
  .ci-story dd { margin-bottom: 6px; }
}

/* The native dialog supplies focus trapping and Escape; the notice remains readable on a narrow screen. */
.overage-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.overage-actions a { font-size: 13px; }
.overage-dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 24px; border: 1px solid var(--hairline); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); }
.overage-dialog::backdrop { background: rgba(0, 0, 0, 0.75); }
.overage-dialog h2 { font-size: 20px; }
#overage-notice { white-space: pre-wrap; overflow-wrap: anywhere; }
.overage-affirmation { display: flex; align-items: start; gap: 10px; color: var(--ink); }
.overage-affirmation input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
#overage-message:not(:empty) { margin-top: 14px; }

/* Billing and API keys: numbered pages, as the operator console's lists, and each row's links or revoke. */
.pager { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-items: center; }
.table-foot .pager button { min-width: 36px; padding: 6px 10px; }
.pager button[aria-current="page"] { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.pager .gap { color: var(--ink-muted); padding: 0 6px; }
td.links { white-space: nowrap; }
td.links a + a { margin-left: 12px; }
.revoke-controls { display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
#plan-next, #manage-hint, #billing-state:empty { margin: 0; }
#billing-state:empty { display: none; }
