/* Tokens, reset and the shell's layout. Logical properties throughout, so Arabic (right to left) and English share one sheet.
   The phone is the narrowest case: the navigation is a bar at the bottom there and a column beside the screen on a desk. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #16202b;
  --muted: #5b6876;
  --line: #d9dee5;
  --accent: #1f5f8b;
  --accent-text: #ffffff;
  --danger: #a3262a;
  --ok: #1d6b45;
  --radius: 10px;
  --gap: 16px;
  --nav-height: 56px;
  font-family: system-ui, -apple-system, 'Segoe UI', Tahoma, 'Noto Naskh Arabic', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161c;
    --surface: #1a212a;
    --text: #e8edf2;
    --muted: #9aa8b6;
    --line: #2d3742;
    --accent: #6fb1dc;
    --accent-text: #0c1319;
    --danger: #f0797c;
    --ok: #66c795;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body { min-height: 100vh; }
h1, h2, h3, p { margin-block: 0 8px; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
a { color: var(--accent); }
.muted { color: var(--muted); font-size: 0.92rem; }
[hidden] { display: none !important; }

.shell { display: grid; grid-template-rows: auto 1fr auto; min-height: 100vh; }
.bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px max(var(--gap), env(safe-area-inset-left)); background: var(--surface); border-block-end: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 1.15rem; margin-inline-end: auto; }
.who { color: var(--muted); font-size: 0.92rem; }
.main { padding: var(--gap); min-width: 0; }
.screen { max-width: 760px; margin-inline: auto; }

.nav {
  display: flex; overflow-x: auto; background: var(--surface); border-block-start: 1px solid var(--line);
  padding-block-end: env(safe-area-inset-bottom); position: sticky; inset-block-end: 0;
}
.nav-item {
  flex: 1 0 auto; min-height: var(--nav-height); display: flex; align-items: center; justify-content: center; padding-inline: 14px;
  text-decoration: none; color: var(--muted); white-space: nowrap; border-block-start: 3px solid transparent;
}
.nav-item.is-current { color: var(--accent); border-block-start-color: var(--accent); font-weight: 700; }
.nav-item.is-soon { opacity: 0.75; }

@media (min-width: 900px) {
  .shell { grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; }
  .bar { grid-column: 1 / -1; }
  .nav { grid-column: 1; grid-row: 2; flex-direction: column; overflow: visible; border-block-start: 0; border-inline-end: 1px solid var(--line); position: static; align-content: start; }
  .nav-item { flex: 0 0 auto; justify-content: flex-start; min-height: 46px; border-block-start: 0; border-inline-start: 3px solid transparent; }
  .nav-item.is-current { border-inline-start-color: var(--accent); }
  .main { grid-column: 2; grid-row: 2; padding: 24px; }
}
