/* Taxt.ai — visual language modelled on Apple's platforms:
   neutral greys, one blue accent, system status colours used only for meaning,
   grouped inset lists, pill buttons, frosted navigation, generous whitespace. */

:root {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --label: #1d1d1f;
  --label-2: #6e6e73;
  --label-3: #86868b;
  --separator: rgba(60, 60, 67, 0.18);
  --fill: rgba(120, 120, 128, 0.12);
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --link: #0066cc;
  --green: #248a3d;
  --orange: #c93400;
  --orange-fill: #ff9500;
  --red: #d70015;
  --gray: #6e6e73;
  --nav-bg: rgba(245, 245, 247, 0.8);
  --radius-lg: 18px;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, system-ui, sans-serif;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --bg-elevated: #1c1c1e; --label: #f5f5f7; --label-2: #a1a1a6; --label-3: #86868b;
    --separator: rgba(84, 84, 88, 0.6); --fill: rgba(120, 120, 128, 0.24);
    --blue: #0a84ff; --blue-hover: #409cff; --link: #2997ff;
    --green: #30d158; --orange: #ff9f0a; --orange-fill: #ff9f0a; --red: #ff453a; --gray: #98989d;
    --nav-bg: rgba(22, 22, 23, 0.8); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --bg-elevated: #1c1c1e; --label: #f5f5f7; --label-2: #a1a1a6; --label-3: #86868b;
  --separator: rgba(84, 84, 88, 0.6); --fill: rgba(120, 120, 128, 0.24);
  --blue: #0a84ff; --blue-hover: #409cff; --link: #2997ff;
  --green: #30d158; --orange: #ff9f0a; --orange-fill: #ff9f0a; --red: #ff453a; --gray: #98989d;
  --nav-bg: rgba(22, 22, 23, 0.8); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--label);
  font-family: var(--font); font-size: 17px; line-height: 1.47; letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased; font-optical-sizing: auto;
}
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent); outline-offset: 2px; border-radius: 8px; }

/* Navigation: frosted glass bar */
.nav {
  position: sticky; top: 0; z-index: 10; background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--separator);
}
.nav__inner { max-width: 980px; margin: 0 auto; padding: 0 22px; height: 48px; display: flex; align-items: center; justify-content: space-between; }
.nav__brand { color: var(--label); font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.nav__brand:hover { text-decoration: none; }
.nav__item { font-size: 12px; color: var(--label-2); letter-spacing: -0.01em; }

main { max-width: 692px; margin: 0 auto; padding: 0 22px; min-height: 70vh; }
main.is-wide { max-width: 980px; }
.screen { animation: enter 0.45s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }

/* Type scale */
.display { font-size: clamp(40px, 7.5vw, 64px); line-height: 1.05; font-weight: 600; letter-spacing: -0.03em; }
.title-1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.1; font-weight: 600; letter-spacing: -0.025em; }
.title-2 { font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -0.02em; }
.lead { font-size: clamp(19px, 2.6vw, 21px); line-height: 1.4; color: var(--label-2); letter-spacing: -0.02em; }
.subhead { font-size: 15px; color: var(--label-2); letter-spacing: -0.01em; }
.center { text-align: center; }

/* Home */
.hero { padding: 88px 0 48px; text-align: center; }
.hero .lead { max-width: 520px; margin: 18px auto 0; }
.region { padding-bottom: 20px; }
.region__name { margin: 12px 4px 14px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding-bottom: 24px; }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr; } }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 168px; padding: 24px;
  background: var(--bg-elevated); border: 0; border-radius: var(--radius-lg); text-align: left; cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.search {
  position: relative; max-width: 420px; margin: 32px auto 0;
}
.search svg { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--label-3); pointer-events: none; }
.search input {
  width: 100%; height: 44px; padding: 0 16px 0 40px; border: 1px solid transparent; border-radius: 12px;
  background: var(--fill); color: var(--label); font: inherit; font-size: 17px; letter-spacing: -0.02em;
  transition: background 0.2s, border-color 0.2s;
}
.search input::placeholder { color: var(--label-3); }
.search input:focus { outline: none; background: var(--bg-elevated); border-color: var(--blue); }
.tile[hidden], .region[hidden] { display: none; }
.no-results { padding: 24px 4px 32px; text-align: center; color: var(--label-2); font-size: 17px; }
.no-results[hidden] { display: none; }
.tile:hover { transform: scale(1.015); box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08); }
.tile:active { transform: scale(0.99); }
.tile__name { font-size: 24px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
.tile__meta { margin-top: 6px; font-size: 14px; color: var(--label-2); }
.tile__cta { margin-top: auto; padding-top: 20px; font-size: 15px; color: var(--link); }
.tile__cta::after { content: " \203A"; }
.tile--soon {
  grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 24px; cursor: default; background: transparent; border: 1px solid var(--separator);
}
.tile--soon:hover { transform: none; box-shadow: none; }
.tile--soon .tile__name { font-size: 17px; letter-spacing: -0.02em; }
.tile--soon .tile__meta { margin: 0; flex: 1; }
.tile--soon .tile__cta { margin: 0; padding: 0; color: var(--label-3); font-size: 14px; }
.tile--soon .tile__cta::after { content: ""; }
@media (max-width: 760px) { .tile--soon { flex-wrap: wrap; } .tile--soon .tile__meta { flex-basis: 100%; order: 3; } }
.promise { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; padding: 24px 0 8px; font-size: 14px; color: var(--label-2); }
.promise span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--label-3); vertical-align: middle; }

/* Question flow */
.bar-row { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.back { display: inline-flex; align-items: center; gap: 2px; padding: 6px 0; border: 0; background: none; color: var(--link); font-size: 17px; cursor: pointer; }
.back svg { width: 12px; height: 20px; }
.back[hidden] { visibility: hidden; display: inline-flex; }
.count { font-size: 15px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.progress { height: 3px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--blue); border-radius: 3px; transition: width 0.5s var(--ease); }
.q { padding: 48px 0 28px; text-align: center; }
.q .subhead { max-width: 480px; margin: 12px auto 0; font-size: 17px; }

/* Inset grouped list (iOS Settings style) */
.group { margin: 0; padding: 0; list-style: none; background: var(--bg-elevated); border-radius: var(--radius); overflow: hidden; }
.group > li { position: relative; }
.group > li + li::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 1px solid var(--separator); z-index: 1; }
.group > li + li:has(.cell--warn)::before { left: 48px; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 12px 16px;
  background: none; border: 0; text-align: left; cursor: pointer; transition: background 0.15s;
}
.row:hover { background: var(--fill); }
.row:active { background: color-mix(in srgb, var(--fill) 200%, transparent); }
.row__text { flex: 1; min-width: 0; }
.row__title { display: block; font-size: 17px; }
.row__sub { display: block; margin-top: 1px; font-size: 13px; line-height: 1.35; color: var(--label-2); letter-spacing: -0.005em; }
.row__check { flex: none; width: 17px; height: 17px; color: var(--blue); opacity: 0; transition: opacity 0.15s; }
.row[aria-checked="true"] .row__check { opacity: 1; }
.row[aria-checked="true"] .row__title { font-weight: 500; }
.actions { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 32px 0 8px; }

/* Buttons */
.pill {
  display: inline-flex; align-items: center; justify-content: center; min-width: 220px; padding: 12px 24px;
  border: 0; border-radius: 980px; background: var(--blue); color: #fff; font-size: 17px; font-weight: 400; cursor: pointer;
  transition: background 0.2s;
}
.pill:hover { background: var(--blue-hover); }
.pill:disabled { opacity: 0.35; cursor: not-allowed; }
.text-btn { border: 0; background: none; color: var(--link); font-size: 17px; cursor: pointer; padding: 4px; }
.text-btn:hover { text-decoration: underline; }

/* Result */
.summary { padding: 56px 0 36px; text-align: center; }
.status-line { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; color: var(--label-2); margin-bottom: 14px; }
.status-line i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.status-line--med i { background: var(--orange-fill); }
.status-line--high i { background: var(--red); }
.summary .lead { max-width: 560px; margin: 14px auto 0; font-size: 19px; }
.facts-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; margin-top: 32px; background: var(--separator); border-radius: var(--radius); overflow: hidden; }
.facts-row div { padding: 16px; background: var(--bg-elevated); }
.facts-row dt { font-size: 13px; color: var(--label-2); }
.facts-row dd { margin: 2px 0 0; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.section { padding-top: 44px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 4px 12px; }
.section__note { font-size: 13px; color: var(--label-2); }
.cell { padding: 16px; }
.cell__top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.cell__title { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.cell__body { margin-top: 6px; font-size: 15px; line-height: 1.5; color: var(--label-2); letter-spacing: -0.01em; }
.cell__body b { color: var(--label); font-weight: 600; }
.badge { flex: none; font-size: 13px; font-weight: 500; white-space: nowrap; }
.badge--req { color: var(--green); }
.badge--cond { color: var(--orange); }
.badge--no { color: var(--gray); }
.cell--no .cell__title { color: var(--label-2); }
.cell--warn { display: flex; gap: 12px; align-items: flex-start; }
.cell--warn svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--orange-fill); }
.cell--warn .cell__body { margin-top: 0; color: var(--label); }
.src__value { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.src__meta { margin-top: 4px; font-size: 13px; color: var(--label-2); line-height: 1.4; }
.src__status { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--label-3); }
.src__status--verified { color: var(--green); font-weight: 500; }
.src__status--verified::before { content: "\2713\00a0"; }
.src__status--needs_update { color: var(--red); font-weight: 500; }
.fine { margin: 28px 4px 0; font-size: 12px; line-height: 1.5; color: var(--label-3); }

.foot { max-width: 980px; margin: 64px auto 0; padding: 20px 22px 40px; border-top: 1px solid var(--separator); font-size: 12px; color: var(--label-3); }
.foot p + p { margin-top: 6px; }
.error { padding: 80px 0; text-align: center; color: var(--red); }

@media (max-width: 480px) {
  .hero { padding-top: 56px; }
  .pill { width: 100%; }
  .q { padding-top: 36px; }
}

/* Navigation links */
.nav__links { display: flex; gap: 20px; }
.nav__links .nav__item { color: var(--label-2); }
.nav__links .nav__item[aria-current="page"] { color: var(--label); }
.nav__links .nav__item:hover { color: var(--label); text-decoration: none; }

/* Guides */
.guide-main { max-width: 760px; }
a.tile { color: inherit; }
a.tile:hover { text-decoration: none; }
.eyebrow { font-size: 15px; font-weight: 500; color: var(--label-2); margin-bottom: 10px; }
.guide__hero { padding: 72px 0 8px; text-align: center; }
.guide__hero .lead { max-width: 640px; margin: 18px auto 0; }
.guide__meta { margin-top: 18px; font-size: 13px; color: var(--label-3); }
.guide__cta { margin-top: 26px; }
.guide__cta .pill:hover { text-decoration: none; }
.guide__h { margin: 0 4px 14px; }
.glance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0; background: var(--separator); border-radius: var(--radius); overflow: hidden; }
@media (max-width: 640px) { .glance { grid-template-columns: repeat(2, 1fr); } }
.glance div { padding: 18px 16px; background: var(--bg-elevated); }
.glance dt { font-size: 13px; color: var(--label-2); }
.glance dd { margin: 4px 0 0; font-size: 28px; font-weight: 600; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.glance p { margin-top: 6px; font-size: 13px; line-height: 1.4; color: var(--label-2); }
.toc { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 36px; }
.toc a { padding: 7px 14px; border-radius: 980px; background: var(--fill); color: var(--label); font-size: 14px; }
.toc a:hover { text-decoration: none; background: color-mix(in srgb, var(--fill) 200%, transparent); }
.guide__section { scroll-margin-top: 64px; }
.guide__p { margin: 0 4px 14px; font-size: 17px; line-height: 1.6; }
.guide__p b, .guide__points b { font-weight: 600; }
.guide__points { margin: 0; padding: 4px 16px; list-style: none; background: var(--bg-elevated); border-radius: var(--radius); }
.guide__points li { position: relative; padding: 12px 0 12px 18px; font-size: 16px; line-height: 1.5; }
.guide__points li + li { border-top: 1px solid var(--separator); }
.guide__points li::before { content: ""; position: absolute; left: 2px; top: 21px; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.cal { display: grid; grid-template-columns: 180px 1fr; gap: 16px; }
@media (max-width: 560px) { .cal { grid-template-columns: 1fr; gap: 2px; } }
.cal__when { font-weight: 600; font-size: 15px; }
.cal__what { font-size: 15px; color: var(--label-2); line-height: 1.45; }
#calendar, #sources { scroll-margin-top: 64px; }
.guide-link { padding-top: 28px; text-align: center; font-size: 17px; }
.guide-link a::after { content: " \203A"; }

/* Arabic and right-to-left pages */
html[lang="ar"] body { font-family: "SF Arabic", "Geeza Pro", "Noto Sans Arabic", "Segoe UI", Tahoma, var(--font); }
html[lang="ar"] body, html[lang="ar"] .display, html[lang="ar"] .title-1, html[lang="ar"] .title-2, html[lang="ar"] .lead,
html[lang="ar"] .tile__name, html[lang="ar"] .region__name, html[lang="ar"] .glance dd, html[lang="ar"] .nav__brand { letter-spacing: 0; }
html[lang="ar"] .guide__p { line-height: 1.85; }
html[lang="ar"] .lead { line-height: 1.7; }
.nav__lang { font-weight: 500; }
[dir="rtl"] .tile { text-align: right; }
[dir="rtl"] .tile__cta::after, [dir="rtl"] .guide-link a::after { content: " \2039"; }
[dir="rtl"] .group > li + li::before { left: 0; right: 16px; }
[dir="rtl"] .guide__points li { padding: 12px 18px 12px 0; }
[dir="rtl"] .guide__points li::before { left: auto; right: 2px; }
[dir="rtl"] .src__value, [dir="rtl"] .glance dd { direction: ltr; unicode-bidi: isolate; }
/* Long worded values (e.g. conditions, dates with notes) wrap instead of running off the card */
.cell__top > span:first-child { flex: 1 1 auto; min-width: 0; }
.src__value { max-width: 55%; white-space: normal; text-align: end; }

.glance dd.glance__long { font-size: 19px; line-height: 1.3; letter-spacing: -0.015em; }

/* Grid columns may shrink below their content; long values wrap rather than widen the page */
.glance { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.glance dd { overflow-wrap: anywhere; }
