/* Settings pages (access tokens). Colours, type, buttons and dark mode come from Stopover's /assets/style.css. */

.settings-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; padding-top: max(12px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--sidebar) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.settings-bar .brand { padding: 0; }
.settings-main { max-width: 760px; margin: 0 auto; padding: 28px 24px 48px; }
.settings-header { margin-bottom: 20px; }
.settings-header h1 { margin-bottom: 6px; }
.settings-header p { margin: 0; font-size: 15px; }
.settings-error { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--red) 12%, var(--surface)); color: var(--red); }

.card { margin-bottom: 16px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card h2 { margin-bottom: 14px; font-size: 19px; }
.card h3 { margin: 20px 0 10px; }
.card.created { border-color: var(--accent); background: color-mix(in srgb, var(--pale) 55%, var(--surface)); }

.create-form { display: flex; align-items: flex-end; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.grow { flex: 1; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; }
.field input, .field select { min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-size: 15px; max-width: none; }
.field input:focus { outline: none; border-color: var(--green); }
.create-form .button { min-height: 42px; }

.secret-row { display: flex; align-items: stretch; gap: 8px; margin: 14px 0 4px; }
.secret-row code { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-size: 14px; word-break: break-all; }
.command { margin-bottom: 12px; }
.command-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 14px; }
.command pre { margin: 0; background: var(--surface); }
.created .small code { font-size: 12px; }

.token-list { margin: 0; padding: 0; list-style: none; }
.token-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.token-item:first-child { border-top: 0; padding-top: 0; }
.token-info { min-width: 0; }
.token-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.token-title strong { font-size: 15px; }
.token-meta { margin-top: 4px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.pill { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.active { background: var(--pale); color: var(--green); }
.pill.revoked { background: var(--surface-2); color: var(--muted); }
.button.danger { background: var(--red); border-color: var(--red); color: #fff; }
.empty-tokens { margin: 0; padding: 18px; border-radius: 10px; background: var(--surface-2); color: var(--muted); text-align: center; font-size: 14px; }

@media (max-width: 640px) {
  .settings-bar { padding: 10px 14px; }
  .settings-main { padding: 18px 14px 36px; }
  .card { padding: 18px 16px; }
  .create-form { flex-direction: column; align-items: stretch; }
  .field input { font-size: 16px; }  /* 16px stops iOS zooming on focus */
  .secret-row { flex-direction: column; }
  .token-item { flex-direction: column; align-items: stretch; }
  .token-item .button { width: 100%; }
}

/* OAuth consent page */
.consent-main { max-width: 560px; padding-top: 40px; }
.consent-card h1 { font-size: 24px; line-height: 1.3; margin-bottom: 8px; }
.consent-card h2 { font-size: 13px; font-weight: 650; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }
.consent-eyebrow { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--green); }
.consent-app { color: var(--green); }
.consent-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.consent-list li { position: relative; padding: 10px 12px 10px 38px; border-radius: 10px; background: var(--surface-2); font-size: 15px; }
.consent-list li::before { content: "✓"; position: absolute; left: 14px; top: 10px; color: var(--green); font-weight: 700; }
.consent-facts { display: grid; gap: 10px; margin: 20px 0 0; }
.consent-facts div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; font-size: 14px; }
.consent-facts dt { color: var(--muted); }
.consent-facts dd { margin: 0; overflow-wrap: anywhere; }
.consent-warning { margin: 16px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--amber-bg); color: var(--amber); font-size: 14px; }
.consent-actions { display: flex; gap: 10px; margin: 22px 0 14px; }
.consent-actions .button { flex: 1; min-height: 46px; font-size: 16px; }

/* Connected apps on the access tokens page */
.app-item .token-meta code { font-size: 12px; }

/* Sign-in chooser */
.login-choices { display: grid; gap: 10px; margin-top: 18px; }
.login-choices .button { min-height: 46px; font-size: 16px; }
.login-choices .button svg { width: 20px; height: 20px; flex: none; }

/* Plan card on the access tokens page */
.plan-usage { display: grid; gap: 14px; }
.meter-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.meter-bar { height: 8px; margin-top: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--green); }
.meter-fill.full { background: var(--red); }
.meter .small { margin: 4px 0 0; }

/* Account page */
.profile-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 20px; margin: 0 0 14px; }
.profile-list dt { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.profile-list dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.danger-card { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.danger-card h2 { color: var(--red); }
.delete-list { margin: 0 0 12px; padding-left: 20px; }
.delete-list li { margin-bottom: 4px; }
.button.danger:disabled { opacity: .45; cursor: not-allowed; }

/* Privacy policy and terms of service (/privacy, /terms). */
.legal { line-height: 1.6; }
.legal h1 { margin-bottom: 4px; }
.legal h2 { margin: 28px 0 8px; font-size: 19px; }
.legal p, .legal ul { margin: 0 0 12px; max-width: none; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal-table { overflow-x: auto; margin: 0 0 12px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 14px; }
.legal th, .legal td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal-footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
