/* ==========================================================================
   AL-WASET First Company — site stylesheet
   ========================================================================== */

:root {
  --navy-950: #070d18;
  --navy-900: #0c1524;
  --navy-800: #14243c;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --paper: #ffffff;
  --page: #f5f7fa;
  --accent: #0ea5e9;
  --accent-dark: #0284c7;
  --accent-soft: #e0f2fe;
  --amber: #f59e0b;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --measure: 74ch;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.68;
  color: var(--slate-700);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  color: var(--slate-900);
  line-height: 1.24;
  letter-spacing: -0.015em;
  margin: 0 0 .5em;
  font-weight: 650;
}

h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.95rem); }
h3 { font-size: 1.14rem; }
h4 { font-size: 1rem; }

p { margin: 0 0 1em; }

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
li { margin-bottom: .35em; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: .6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.wrap {
  width: min(1180px, 100% - 2.5rem);
  margin-inline: auto;
}

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 13, 24, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: #fff;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--accent), #0369a1);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .02em;
  flex: 0 0 auto;
}

.brand-name { font-weight: 650; font-size: 1rem; display: block; line-height: 1.2; }
.brand-sub { display: block; font-size: .74rem; color: var(--slate-400); letter-spacing: .06em; text-transform: uppercase; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, .4);
  color: #e2e8f0;
  border-radius: 10px;
  padding: .45rem .7rem;
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}

.site-nav ul {
  display: flex;
  gap: .35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: .5rem .85rem;
  border-radius: 10px;
  color: #cbd5e1;
  font-size: .92rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { background: rgba(148, 163, 184, .14); color: #fff; text-decoration: none; }
.site-nav a[aria-current="page"] { background: rgba(14, 165, 233, .18); color: #fff; }

/* ------------------------------------------------------------- utilities */
.section { padding: 3.2rem 0; }
.section--tight { padding: 2.2rem 0; }
.section--paper { background: var(--paper); border-block: 1px solid var(--slate-200); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .72rem;
  font-weight: 650;
  color: var(--accent-dark);
  margin: 0 0 .6rem;
}

.lede { font-size: 1.05rem; color: var(--slate-600); max-width: var(--measure); }

.grid { display: grid; gap: 1.1rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); }

.card {
  background: var(--paper);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card--accent { border-top: 3px solid var(--accent); }
.card--muted { background: var(--slate-50); }

.card-meta {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--slate-500);
  font-weight: 650;
  margin-bottom: .4rem;
}

.tag {
  display: inline-block;
  font-size: .74rem;
  font-weight: 650;
  letter-spacing: .04em;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #075985;
}
.tag--amber { background: #fef3c7; color: #92400e; }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .68rem 1.25rem;
  border-radius: 999px;
  font-size: .93rem;
  font-weight: 650;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: #04121f; }
.btn--primary:hover { background: #38bdf8; }
.btn--ghost { border-color: rgba(148, 163, 184, .55); color: var(--slate-900); background: transparent; }
.btn--ghost:hover { background: var(--slate-100); }
.btn--light { background: #fff; color: var(--navy-900); }
.btn--light:hover { background: var(--slate-100); }
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }

/* ------------------------------------------------------------------ hero */
.hero {
  background:
    radial-gradient(1100px 420px at 12% -10%, rgba(14, 165, 233, .22), transparent 60%),
    linear-gradient(160deg, var(--navy-950), var(--navy-800) 70%, #122036);
  color: #e2e8f0;
  padding: 3.4rem 0 3.6rem;
}
.hero h1 { color: #fff; max-width: 22ch; }
.hero p { color: #cbd5e1; max-width: 62ch; }
.hero-grid { display: grid; gap: 2.2rem; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; }
.hero-panel {
  background: rgba(8, 15, 28, .72);
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
}
.hero-panel h3 { color: #fff; font-size: 1rem; }
.hero-panel ul { list-style: none; padding: 0; margin: 0; }
.hero-panel li {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  font-size: .9rem;
  color: #cbd5e1;
  padding: .45rem 0;
  border-bottom: 1px dashed rgba(148, 163, 184, .22);
}
.hero-panel li:last-child { border-bottom: 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-top: .55rem; flex: 0 0 auto; }

.hero-stats { display: flex; flex-wrap: wrap; gap: 1.6rem; margin-top: 1.9rem; }
.hero-stats div { min-width: 110px; }
.hero-stats strong { display: block; font-size: 1.5rem; color: #fff; line-height: 1.1; }
.hero-stats span { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--slate-400); }

/* --------------------------------------------------------------- contact */
.contact-grid { display: grid; gap: 1.6rem; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: start; }

.field { margin-bottom: .9rem; }
.field label { display: block; font-size: .8rem; font-weight: 650; color: var(--slate-700); margin-bottom: .3rem; }
.field input, .field textarea {
  width: 100%;
  padding: .62rem .75rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .95rem;
  color: var(--slate-900);
  background: #fff;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.form-status { margin-top: .8rem; font-size: .88rem; }
.form-status[data-state="success"] { color: #047857; }
.form-status[data-state="error"] { color: #b91c1c; }
.form-status[data-state="pending"] { color: var(--slate-500); }

.contact-details { list-style: none; padding: 0; margin: 0; }
.contact-details li { padding: .8rem 0; border-bottom: 1px solid var(--slate-200); }
.contact-details li:last-child { border-bottom: 0; }
.contact-details .card-meta { margin-bottom: .15rem; }

/* ---------------------------------------------------- legislation layout */
.doc-layout {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 268px) minmax(0, 1fr);
  align-items: start;
  padding: 2.2rem 0 3.5rem;
}

.doc-toc {
  position: sticky;
  top: 84px;
  background: var(--paper);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 120px);
  overflow: auto;
}
.doc-toc h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--slate-500); margin-bottom: .6rem; }
.doc-toc ol { list-style: none; padding: 0; margin: 0; font-size: .87rem; counter-reset: none; }
.doc-toc li { margin: 0; }
.doc-toc a {
  display: block;
  padding: .3rem .5rem;
  border-radius: 8px;
  color: var(--slate-600);
  border-left: 2px solid transparent;
}
.doc-toc a:hover { background: var(--slate-100); text-decoration: none; }
.doc-toc a.is-active { color: var(--accent-dark); border-left-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.doc-toc .toc-group { margin-top: .8rem; font-weight: 650; color: var(--slate-700); font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; }

.doc-body { min-width: 0; }

.doc-intro {
  background: var(--paper);
  border: 1px solid var(--slate-200);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.4rem;
}
.doc-intro h2 { margin-bottom: .35rem; }
.doc-sub { color: var(--slate-600); margin: 0; font-size: .95rem; }

.source-note {
  font-size: .84rem;
  color: var(--slate-500);
  background: var(--slate-50);
  border: 1px dashed var(--slate-200);
  border-radius: var(--radius-sm);
  padding: .7rem .9rem;
  margin: 0 0 1.6rem;
}

.article-list { display: block; }

.article {
  background: var(--paper);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem 1rem;
  margin-bottom: .9rem;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 92px;
}
.article-head {
  font-size: 1rem;
  margin: 0 0 .5rem;
  color: var(--navy-900);
  display: flex;
  align-items: baseline;
  gap: .45rem;
  flex-wrap: wrap;
}
.article-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent-dark);
  font-weight: 700;
}
.article-title {
  font-weight: 650;
  color: var(--slate-900);
  margin: 0 0 .6rem;
}
.article p { margin: 0 0 .75rem; }
.article p:last-child { margin-bottom: 0; }
.article .sub-heading { margin: .9rem 0 .4rem; color: var(--slate-900); }
.legal-list { margin: 0 0 .8rem; padding-left: 1.35rem; }
.legal-list li { margin-bottom: .3rem; }

.doc-heading {
  font-size: 1.1rem;
  margin: .4rem 0 .8rem;
  padding-top: .4rem;
  color: var(--navy-900);
}
.note-heading { color: #92400e; }
.doc-divider { border: 0; border-top: 1px dashed var(--slate-200); margin: 2.4rem 0; }

.callout {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
  font-size: .88rem;
  color: #78350f;
  margin: 0 0 1.4rem;
}
.callout strong { color: #78350f; }

.doc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--slate-200);
}
.doc-nav a { font-size: .9rem; }

.doc-search {
  background: var(--paper);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.doc-search label { display: block; font-size: .8rem; font-weight: 650; color: var(--slate-700); margin-bottom: .35rem; }
.doc-search input {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .95rem;
  background: #fff;
  color: var(--slate-900);
}
.doc-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.doc-search-status { display: block; margin-top: .45rem; font-size: .82rem; color: var(--slate-500); }
.article[hidden] { display: none; }

/* keep anchored sections clear of the sticky header */
.article, section[id], h2[id], h3[id], h4[id] { scroll-margin-top: 96px; }
.doc-toc li[hidden] { display: none; }

/* ---------------------------------------------------------------- footer */
.site-footer {
  background: var(--navy-950);
  color: var(--slate-400);
  padding: 2.4rem 0 1.6rem;
  margin-top: 1rem;
  font-size: .9rem;
}
.footer-grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-footer h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .14em; margin-bottom: .6rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer a { color: #cbd5e1; }
.footer-bottom {
  margin-top: 1.8rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, .18);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.2rem;
  justify-content: space-between;
  font-size: .82rem;
}

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: var(--navy-900);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: .55rem .9rem;
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 900px) {
  .hero-grid, .contact-grid, .doc-layout { grid-template-columns: 1fr; }
  .doc-toc { position: static; max-height: none; }
  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none;
    width: 100%;
    padding-bottom: .6rem;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: .15rem; }
  .site-nav a { padding: .6rem .7rem; }
  .header-inner { flex-wrap: wrap; }
}

@media print {
  .site-header, .site-footer, .doc-toc, .back-to-top, .btn-row { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .article { break-inside: avoid; border: 0; box-shadow: none; padding: 0 0 .6rem; }
  .doc-layout { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Legislation API widgets (search, newsletter, feedback, counters)
   ========================================================================== */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.api-stats { margin: 1rem 0 0; font-size: .88rem; }
.api-stats strong { color: #fff; }

/* footer newsletter band */
.footer-news {
  margin-top: 1.8rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: var(--radius);
  display: grid;
  gap: .9rem 1.6rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: center;
  background: rgba(255, 255, 255, .02);
}
.footer-news h4 { margin-bottom: .3rem; }
.footer-news p { margin: 0; font-size: .88rem; }
.newsletter-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.newsletter-form input[type="email"] {
  flex: 1 1 220px;
  min-width: 0;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, .35);
  background: #0b1424;
  color: var(--slate-200);
  font: inherit;
}
.newsletter-form input[type="email"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.newsletter-form .form-status { flex: 1 1 100%; margin: 0; font-size: .82rem; }
.site-footer .form-status { color: var(--slate-400); }

/* API-backed search results */
.api-search-results { margin-top: .8rem; display: grid; gap: .55rem; }
.api-hit {
  display: grid;
  gap: .1rem;
  padding: .7rem .85rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--slate-50);
  text-decoration: none;
}
.api-hit:hover, .api-hit:focus { border-color: var(--accent); background: var(--accent-soft); }
.api-hit-doc { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--slate-500); }
.api-hit-title { font-weight: 650; color: var(--slate-900); }
.api-hit-snippet { font-size: .9rem; color: var(--slate-600); }
.api-hit mark { background: #fef3c7; color: inherit; padding: 0 .1em; border-radius: 3px; }

/* feedback widget */
.feedback-widget {
  margin-top: 2.2rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.feedback-widget p { margin: 0 0 .7rem; }
.feedback-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.feedback-more { margin-top: .9rem; display: grid; gap: .5rem; }
.feedback-more label { font-size: .8rem; font-weight: 650; color: var(--slate-700); }
.feedback-more textarea {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .95rem;
}
.feedback-more textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* inline statuses */
.form-status[data-state="success"] { color: #16a34a; }
.form-status[data-state="error"] { color: #b91c1c; }
.site-footer .form-status[data-state="success"] { color: #86efac; }
.site-footer .form-status[data-state="error"] { color: #fca5a5; }
.site-footer .form-status[data-state="pending"] { color: var(--slate-400); }

/* ==========================================================================
   Legislation assistant (AI chat widget)
   ========================================================================== */
.ai-chat { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 60; font-size: .95rem; }
.ai-chat-launch {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid var(--accent-dark);
  background: var(--accent);
  color: #fff; font: inherit; font-weight: 600;
  padding: .7rem 1.05rem; border-radius: 999px; cursor: pointer;
  box-shadow: 0 10px 24px rgba(2, 132, 199, .35);
}
.ai-chat-launch:hover { background: var(--accent-dark); }
.ai-chat-launch::before { content: "✦"; font-size: .95em; }

.ai-chat-panel {
  position: absolute; right: 0; bottom: 3.6rem;
  width: min(420px, calc(100vw - 2.2rem));
  background: var(--paper);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.ai-chat-head {
  display: flex; align-items: flex-start; gap: .5rem;
  padding: .8rem .95rem;
  background: var(--navy-950); color: #fff;
}
.ai-chat-head strong { display: block; font-size: .95rem; }
.ai-chat-sub { display: block; font-size: .74rem; color: var(--slate-400); }
.ai-chat-close {
  margin-left: auto; background: transparent; border: 0; color: var(--slate-400);
  font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 .2rem;
}
.ai-chat-close:hover { color: #fff; }

.ai-chat-log {
  padding: .9rem; display: flex; flex-direction: column; gap: .6rem;
  max-height: min(46vh, 380px); overflow-y: auto; background: var(--slate-50);
}
.ai-msg { display: flex; }
.ai-msg--user { justify-content: flex-end; }
.ai-msg-body {
  max-width: 92%;
  padding: .6rem .75rem;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--slate-200);
  white-space: pre-wrap;
  color: var(--slate-700);
}
.ai-msg--user .ai-msg-body { background: var(--accent-soft); border-color: #bae6fd; color: var(--navy-900); }
.ai-msg--error .ai-msg-body { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.ai-msg-body.is-streaming::after { content: "▌"; color: var(--accent); animation: ai-blink 1s steps(2, start) infinite; }
@keyframes ai-blink { to { opacity: 0; } }

.ai-sources { margin-top: .5rem; display: grid; gap: .25rem; }
.ai-sources-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--slate-500); }
.ai-source {
  font-size: .8rem; color: var(--accent-dark); text-decoration: none;
  border-left: 2px solid var(--accent-soft); padding-left: .45rem;
}
.ai-source:hover { text-decoration: underline; }

.ai-chat-actions { display: flex; flex-wrap: wrap; gap: .4rem; padding: .6rem .8rem 0; }
.ai-chat-actions button {
  font: inherit; font-size: .8rem; cursor: pointer;
  border: 1px solid var(--slate-200); background: var(--paper); color: var(--slate-600);
  padding: .3rem .6rem; border-radius: 999px;
}
.ai-chat-actions button:hover { border-color: var(--accent); color: var(--accent-dark); }

.ai-chat-form { display: flex; gap: .5rem; padding: .6rem .8rem .2rem; align-items: flex-end; }
.ai-chat-form textarea {
  flex: 1; resize: none; font: inherit; font-size: .92rem;
  padding: .55rem .7rem; border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1; color: var(--slate-900);
}
.ai-chat-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ai-chat-note { margin: .5rem .8rem .8rem; font-size: .72rem; color: var(--slate-500); }
.ai-chat-note a { color: var(--accent-dark); }

@media (max-width: 520px) {
  .ai-chat { right: .7rem; bottom: .7rem; }
  .ai-chat-panel { position: fixed; inset: auto .5rem .5rem .5rem; width: auto; bottom: 3.4rem; }
  .ai-chat-log { max-height: 42vh; }
}

/* ==========================================================================
   Arabic edition: language switcher, RTL corrections, reference-text notice
   ========================================================================== */
.lang-switch {
  display: flex; align-items: center; gap: .4rem;
  font-size: .82rem; white-space: nowrap; margin-inline-start: .8rem;
}
.lang-switch a { color: var(--slate-400); text-decoration: none; }
.lang-switch a:hover { color: #fff; text-decoration: underline; }
.lang-switch a.is-active { color: #fff; font-weight: 650; }
.site-header .header-inner { flex-wrap: wrap; gap: .4rem .8rem; }

.reference-notice {
  background: var(--accent-soft);
  border: 1px solid #bae6fd;
  border-radius: var(--radius);
  padding: .9rem 1.05rem;
  font-size: .92rem;
}
.reference-notice strong { display: block; margin-bottom: .25rem; color: var(--navy-900); }
.reference-notice span { color: var(--slate-600); }
.reference-notice a { color: var(--accent-dark); }

/* The published legislation text is English: keep it LTR inside Arabic pages. */
[dir="rtl"] .article,
[dir="rtl"] .doc-body,
[dir="rtl"] .doc-toc,
[dir="rtl"] .doc-toc ul,
[dir="rtl"] .source-note,
[dir="rtl"] .legal-list { direction: ltr; text-align: left; }
[dir="rtl"] .doc-toc { padding-left: 0; }
[dir="rtl"] .article-head, [dir="rtl"] .article-title { text-align: left; }

/* physical properties used by the English layout */
[dir="rtl"] .back-to-top { right: auto; left: 1.1rem; }
[dir="rtl"] .skip-link { left: auto; right: 1rem; }
[dir="rtl"] .ai-source { border-left: 0; border-right: 2px solid var(--accent-soft); padding-left: 0; padding-right: .45rem; }
[dir="rtl"] .doc-nav { border-left: 0; border-right: 1px solid var(--slate-200); }
[dir="rtl"] .footer-bottom { direction: rtl; }
[dir="rtl"] input, [dir="rtl"] textarea { text-align: right; }
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="search"] { direction: ltr; text-align: left; }

/* ==========================================================================
   Chinese edition typography
   ========================================================================== */
[lang="zh-Hans"] {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Hiragino Sans GB",
               "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
}
[lang="zh-Hans"] h1, [lang="zh-Hans"] h2, [lang="zh-Hans"] h3, [lang="zh-Hans"] h4 { letter-spacing: 0; line-height: 1.35; }
[lang="zh-Hans"] .eyebrow { letter-spacing: .06em; }
[lang="zh-Hans"] .lede, [lang="zh-Hans"] p, [lang="zh-Hans"] li { line-height: 1.9; }
[lang="zh-Hans"] .brand-name { font-size: 1.02rem; }
[lang="zh-Hans"] .doc-toc, [lang="zh-Hans"] .article { direction: ltr; text-align: left; }
[lang="zh-Hans"] .reference-notice strong { display: block; }

/* ==========================================================================
   Photography (real project, warehouse, office and event photos)
   ========================================================================== */
.photo-strip { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 1.4rem; }
.photo-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 1.6rem; }
.photo { margin: 0; }
.photo img {
  width: 100%; height: 240px; object-fit: cover; display: block;
  border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--slate-100);
}
.photo-grid .photo img { height: 250px; }
.photo figcaption { margin-top: .55rem; font-size: .82rem; color: var(--slate-500); line-height: 1.55; }
[dir="rtl"] .photo figcaption { text-align: right; }
[lang="zh-Hans"] .photo figcaption { line-height: 1.7; }
@media (max-width: 560px) { .photo img, .photo-grid .photo img { height: 210px; } }
@media print { .photo img { box-shadow: none; } }

/* ------------------------------------------------------- hero banner photo */
.hero-banner { padding-bottom: 0; }
.hero-banner img {
  width: 100%;
  height: clamp(190px, 27vw, 340px);
  object-fit: cover;
  object-position: center 58%;
  display: block;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--slate-100);
}
@media (max-width: 640px) { .hero-banner img { height: 180px; border-radius: var(--radius-sm); } }
@media print { .hero-banner img { box-shadow: none; } }

/* ------------------------------------------------------- RFQ item rows */
.rfq-items { border: 1px solid var(--slate-200); border-radius: var(--radius-sm); padding: .7rem .8rem .9rem; margin: 0 0 1rem; }
.rfq-items legend { font-size: .8rem; font-weight: 650; color: var(--slate-700); padding: 0 .3rem; }
.rfq-row { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, .7fr) minmax(0, .7fr) auto; gap: .5rem; margin-bottom: .5rem; align-items: center; }
.rfq-row input { width: 100%; padding: .55rem .7rem; border: 1px solid #cbd5e1; border-radius: var(--radius-sm); font: inherit; font-size: .92rem; }
.rfq-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.rfq-remove { border: 1px solid var(--slate-200); background: #fff; color: var(--slate-500); border-radius: 8px; width: 2.1rem; height: 2.1rem; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.rfq-remove:hover { border-color: #fca5a5; color: #b91c1c; }
@media (max-width: 620px) { .rfq-row { grid-template-columns: 1fr 1fr; } .rfq-row input[name="item_description"] { grid-column: 1 / -1; } }
