/* Aoken design language v1 (Company OS, Design Studio).
   Single source: platform/design/aoken.css. Copies live in the site and the
   product template; edit this file, then run `python3 platform/design/sync.py`.
   A product themes itself in its own style.css by overriding tokens (usually
   only --accent and --accent-fg; keep 4.5:1 contrast for text on them). */

/* ---- Tokens ---- */
:root {
  /* color */
  --bg: #ffffff;
  --fg: #101828;
  --muted: #475467;
  --line: #e4e7ec;
  --line-strong: #667085;
  --panel: #f9fafb;
  --accent: #0e7c66;
  --accent-fg: #ffffff;
  /* type */
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Arabic', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.15rem;
  --text-h3: 1.1rem;
  --text-h2: 1.5rem;
  --text-h1: clamp(1.9rem, 5vw, 2.75rem);
  --leading: 1.6;
  /* space */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  /* shape */
  --radius: 12px;
  --radius-sm: 8px;
  --content-width: 960px;
  --target-min: 44px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #080d17; /* = the background of the official dark logo file, so the header logo has no visible box */
    --fg: #f5f5f6;
    --muted: #94969c;
    --line: #1f242f;
    --line-strong: #85888e;
    --panel: #161b26;
    --accent: #32d5ad;
    --accent-fg: #0c111d;
  }
}

/* ---- Base ---- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: var(--text-base)/var(--leading) var(--font-sans);
}

a { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1 { font-size: var(--text-h1); line-height: 1.15; margin: 0 0 var(--space-4); letter-spacing: -0.02em; }
h2 { font-size: var(--text-h2); margin: var(--space-10) 0 var(--space-3); }
h3 { font-size: var(--text-h3); margin: var(--space-6) 0 var(--space-2); }
p, ul, ol { margin: 0 0 var(--space-4); }

[dir='rtl'] { font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif; }

/* ---- Components ---- */
.wrap { width: 100%; max-width: var(--content-width); margin: 0 auto; padding: 0 var(--space-4); }

.lead { font-size: var(--text-lg); color: var(--muted); max-width: 40rem; }
.muted, .note { color: var(--muted); }
.note { font-size: var(--text-sm); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.notice {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-6) 0;
}

.grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: var(--space-4) 0; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); background: var(--bg); }
.card h3 { margin-top: 0; }

.price { font-size: 2rem; font-weight: 700; margin: var(--space-1) 0; }
.price small { font-size: 0.95rem; font-weight: 400; color: var(--muted); }

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-fg);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.2rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}
button.button { cursor: pointer; }
.button[aria-disabled='true'], button.button:disabled { opacity: 0.55; cursor: not-allowed; }

fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3) var(--space-5) 0; margin: 0 0 var(--space-4); }

.field { margin: 0 0 var(--space-4); }
.field label { display: block; font-weight: 600; margin: 0 0 var(--space-1); }
.input {
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.55rem var(--space-3);
  min-height: var(--target-min);
  width: 100%;
  max-width: 22rem;
}
/* Selects and file pickers match the shared field (design review 2026-10-09):
   16 px text, 44 px targets, the picker's button looks like a quiet .button. */
select {
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.5rem var(--space-3);
  min-height: var(--target-min);
  max-width: 100%;
}
input[type='file'] { font: inherit; max-width: 100%; }
input[type='file']::file-selector-button {
  font: inherit;
  font-weight: 600;
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  min-height: var(--target-min);
  margin-inline-end: var(--space-3);
  cursor: pointer;
}
/* Several buttons in a row wrap with a gap instead of touching. */
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
textarea.input { max-width: none; min-height: 10rem; font: var(--text-sm)/1.4 var(--font-mono); }

.output {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  font: var(--text-sm)/1.4 var(--font-mono);
}

table { border-collapse: collapse; width: 100%; margin: var(--space-4) 0; }
th, td { text-align: start; padding: var(--space-2); border-bottom: 1px solid var(--line); vertical-align: top; }
/* Wide tables scroll inside their own box on phones instead of widening the page. */
/* Numbers right-aligned with equal-width digits; dates never break. */
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
.table-scroll { overflow-x: auto; margin: var(--space-4) 0; }
.table-scroll table { margin: 0; }
@media (max-width: 480px) { th, td { padding: var(--space-2) var(--space-1); } }
