/* Figgy web pages (connect, privacy, terms, OAuth sign-in). Tokens mirror mobile/theme/colors.ts
   (fig palette v2: fig-cast neutrals, dark "black-plum"); Fraunces for display, Figtree for text; radius 10/14/20. */
:root {
  color-scheme: light dark;
  --background: #F3EEEF; --surface: #FDFBFB; --surface-muted: #E9E1E2; --fill-pressed: rgba(36,26,30,0.06);
  --text: #241A1E; --text-2: #6C5F63;
  --primary-fill: #5C2E44; --primary-fill-pressed: #4C2538; --on-primary: #FFFFFF;
  --tint: #6E3852; --primary-tint: #F3EAED;
  --border: #DCD1D3; --border-strong: #D3C7CA; --control-border: #928084;
  --error: #AE2F34; --error-tint: #F9E5E6;
  --shadow: 0 1px 2px rgba(36,26,30,0.05), 0 8px 24px rgba(36,26,30,0.06);
  --r-control: 10px; --r-card: 14px; --r-sheet: 20px;
  --font-text: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #130F10; --surface: #1E1819; --surface-muted: #2B2325; --fill-pressed: rgba(245,239,240,0.07);
    --text: #F5EFF0; --text-2: #BBADB1;
    --primary-fill: #8E4D68; --primary-fill-pressed: #7A3F58; --on-primary: #FFFFFF;
    --tint: #D8AFC1; --primary-tint: #33242A;
    --border: #2F2629; --border-strong: #3D3236; --control-border: #806F75;
    --error: #EE7F86; --error-tint: #3A1C20;
    --shadow: 0 0 0 1px rgba(255,255,255,0.03);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--background); color: var(--text); }
body { font: 400 16px/1.55 var(--font-text); -webkit-font-smoothing: antialiased; min-height: 100vh; }
[hidden] { display: none !important; }
a { color: var(--tint); }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--text-2); }
.small { font-size: 14px; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--tint); }
.title { font-family: var(--font-display); font-weight: 600; font-size: 28px; line-height: 1.2; margin: 6px 0 12px; letter-spacing: -0.01em; }
.client { color: var(--tint); }
h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.25; margin: 32px 0 8px; }
h3 { font-size: 17px; margin: 20px 0 4px; }

/* Layout */
.center { display: grid; place-items: center; align-content: center; gap: 16px; min-height: 100vh; padding: 24px 16px; }
.card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sheet); padding: 28px 24px; box-shadow: var(--shadow); }
.stack { display: grid; gap: 12px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.foot { text-align: center; margin: 0; }
.page { max-width: 720px; margin: 0 auto; padding: 32px 16px 64px; }
.page header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.page header .brand { font-family: var(--font-display); font-weight: 600; font-size: 24px; text-decoration: none; color: var(--text); }
.page nav { display: flex; gap: 16px; font-size: 14px; }
.page ol, .page ul { padding-left: 22px; }
.page li { margin: 4px 0; }
.note { background: var(--primary-tint); border-radius: var(--r-card); padding: 14px 16px; margin: 16px 0; }
code, .url { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 14px; background: var(--surface-muted); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.copy-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 16px;
  border-radius: var(--r-control); border: 1px solid transparent; background: transparent; font: 600 16px/1 var(--font-text);
  color: inherit; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-lg { min-height: 50px; width: 100%; }
.btn-sm { min-height: 36px; padding: 0 10px; font-size: 14px; }
.btn-primary { background: var(--primary-fill); color: var(--on-primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-fill-pressed); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--fill-pressed); }
.btn-ghost { color: var(--tint); }
.btn-ghost:hover:not(:disabled) { background: var(--fill-pressed); }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.field input {
  min-height: 48px; padding: 0 14px; border-radius: var(--r-control); border: 1px solid var(--control-border);
  background: var(--background); font: 400 16px var(--font-text); color: var(--text);
}
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.account { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 12px; background: var(--surface-muted); border-radius: var(--r-control); }
.account .btn { margin-left: auto; }
.perms { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.error { background: var(--error-tint); color: var(--error); border-radius: var(--r-control); padding: 10px 12px; margin: 12px 0 0; }
@media (max-width: 380px) { .row { grid-template-columns: 1fr; } .card { padding: 24px 18px; } }

/* Legal pages (/privacy, /terms, /community-guidelines + Czech /cs/…): no third-party resources (audit S2-10) —
   'Figtree' / 'Fraunces' above are NOT loaded there, the stacks fall back to the system fonts. */
.lang { display: flex; gap: 10px; align-items: center; font-size: 14px; margin: 0 0 16px; }
.lang a[aria-current] { font-weight: 600; color: var(--text); text-decoration: none; }
.box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 14px 16px; margin: 16px 0; }
.box > :first-child { margin-top: 0; } .box > :last-child { margin-bottom: 0; }
.toc ol { margin: 0; columns: 2 220px; column-gap: 24px; }
.table-wrap { overflow-x: auto; margin: 12px 0; -webkit-overflow-scrolling: touch; }
.page table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 14px; line-height: 1.45; }
.page th, .page td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.page th { font-weight: 600; background: var(--surface-muted); }
.page h2 { scroll-margin-top: 16px; }
.page footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-2); }
@media print { .lang, .page nav { display: none; } }
