@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@700;800&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ── Brand palette — Levantine Signal ── */
:root {
  --green:        #0B5B40;   /* Levant Green  */
  --green-dark:   #073C2A;   /* green-900     */
  --green-mid:    #14724F;   /* green-600     */
  --green-light:  #F0EDE5;   /* green-050     */
  --green-border: #C2D9CE;   /* green-100     */
  --brass:        #C2A14D;   /* Copper/Bronze */
  --brass-dim:    rgba(194,161,77,0.14);
  --brass-border: rgba(194,161,77,0.30);
  --stone:        #EDE7DA;   /* Damascus Stone */
  --stone-dim:    #D5CEC1;
  --stone-dark:   #DDD4C2;
  --basalt:       #15201B;   /* Basalt        */
  --muted:        #5A6661;   /* basalt-300    */
  --text:         #15201B;
  --border:       #DDD4C2;
  --card:         #FFFFFF;
  --bg:           #EDE7DA;
  --radius:       12px;
  --radius-sm:    6px;
  --header-h:     64px;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  color-scheme: light only;
  background-color: var(--bg);
}
h1, h2, h3 { font-family: 'Noto Kufi Arabic', 'IBM Plex Sans Arabic', sans-serif; }

body {
  margin: 0;
  font-family: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  direction: rtl;
  min-height: 100vh;
}

html[dir="ltr"] body {
  direction: ltr;
  font-family: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
}

html[dir="ltr"] h1,
html[dir="ltr"] h2,
html[dir="ltr"] h3 {
  font-family: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
}

a {
  color: var(--green);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--green-dark); }

.hidden { display: none !important; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  padding-inline: max(1.5rem, calc((100% - 1080px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(237, 231, 218, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--brass);
}

.site-header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--green-dark) !important;
  font-weight: 800;
  font-size: 1.2rem;
  text-decoration: none !important;
}
.site-logo:hover { color: var(--green) !important; }

.site-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.site-logo-icon svg {
  width: 28px;
  height: 28px;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-header nav a {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.site-header nav a:hover {
  background: var(--green-light);
  color: var(--green-dark);
}

/* ── Layout ── */
main {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
main.main-narrow { max-width: 640px; }

.home-grid-2 {
  display: grid;
  gap: 1.25rem;
}

.card-download {
  max-width: 36rem;
  margin-inline: auto;
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 0.75rem 1rem 1rem;
}

.hero-brand-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.hero-brand-icon svg {
  width: 56px;
  height: 56px;
  display: block;
}

.hero-brand-title {
  margin: 0;
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  font-weight: 800;
  color: var(--basalt);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-brand-tagline {
  margin: 0.4rem auto 0;
  max-width: 32rem;
  color: #7A6324;
  font-size: 1rem;
  font-weight: 500;
}

.hero-brass-rule {
  width: 40px;
  height: 2px;
  background: var(--brass);
  margin: 0.5rem auto 0;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.2rem, 6vw, 3rem);
  font-weight: 800;
  color: var(--green-dark);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero p {
  margin: 0 auto;
  max-width: 32rem;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 500;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.75rem;
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.legal-entity {
  border-color: var(--green-border);
  background: var(--green-light);
}

.legal-entity-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: var(--green-dark);
}

.legal-entity-list {
  margin: 0;
  padding-inline-start: 1.25rem;
}

.legal-entity-list li {
  margin-bottom: 0.35rem;
}

.card-search {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--green-border);
  border-radius: 20px;
}

.card-search-bar {
  height: 3px;
  background: var(--brass);
}

.card-search-body {
  padding: 1.125rem 1.25rem 1.25rem;
  text-align: center;
}

.card-search-label {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.search-form-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.search-form-col .search-input-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* ── Single-field code input (3×3 fixed slots) ── */
.code-input-single-box {
  position: relative;
  min-height: 4.25rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: text;
}

.code-input-single-box::before,
.code-input-single-box::after {
  content: '';
  position: absolute;
  top: 12%;
  bottom: 12%;
  width: 2px;
  background: #c8c0b4;
  pointer-events: none;
  z-index: 2;
}

.code-input-single-box::before {
  left: 33.333%;
}

.code-input-single-box::after {
  left: 66.666%;
}

.code-input-display {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  pointer-events: none;
  z-index: 3;
  direction: ltr;
  padding: 0 0.15rem;
}

.code-input-seg {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4em;
}

.code-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05em;
  font-family: 'IBM Plex Mono', 'SF Mono', 'Courier New', monospace;
  font-size: 1.45rem;
  line-height: 1;
}

.code-slot-ghost {
  color: #b5aea3;
  font-weight: 600;
}

.code-slot-digit {
  color: var(--green-dark);
  font-weight: 700;
}

.code-slot-caret {
  position: relative;
}

.code-slot-caret::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0.15em;
  bottom: 0.15em;
  width: 2px;
  margin-left: -1px;
  background: var(--green-dark);
  border-radius: 1px;
  animation: code-caret-blink 1s step-end infinite;
}

@keyframes code-caret-blink {
  50% { opacity: 0; }
}

.code-input-single-box:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(11, 91, 64, 0.12);
}

.code-input-single-field {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  background: transparent;
  min-height: 4.25rem;
  margin: 0;
  padding: 0;
  font-size: 1px;
  line-height: 1;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: transparent;
  direction: ltr;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0.01;
}

.code-input-single-field:focus {
  outline: none;
}

.search-form-col .search-input-icon {
  display: none;
}

.search-form-col .search-input {
  padding-inline: 1rem;
}

.btn-search {
  width: auto;
  min-width: 6rem;
  padding: 0.75rem 2rem;
  font-weight: 700;
  align-self: center;
}

.btn-search::before {
  display: none;
}

#search-error {
  margin: 0.75rem 0 0;
}

.recent-wrap {
  margin-top: 1.5rem;
}

.recent-label {
  margin: 0 0 0.6rem;
  font-weight: 600;
}

.card-title {
  margin: 0 0 1rem;
  color: var(--green-dark);
  font-size: 1.15rem;
  font-weight: 700;
}

.card-highlight {
  border: 1.5px solid var(--green-border);
}

/* ── Search ── */
.search-box {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.search-input-wrap {
  flex: 1;
  min-width: 12rem;
  position: relative;
}

.search-input {
  width: 100%;
  padding-block: 0.9rem;
  padding-inline: 2.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
  font-family: 'IBM Plex Mono', 'SF Mono', 'Courier New', monospace;
  font-weight: 600;
  letter-spacing: 0.12em;
  background: #fff;
  color: var(--green-dark);
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: center;
}

.search-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(11,91,64,0.12);
}

.search-input-icon {
  position: absolute;
  inset-inline-start: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 1.1rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: var(--green);
  color: #fff !important;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  font-family: inherit;
  transition: background 0.18s, transform 0.1s;
  white-space: nowrap;
  position: relative;
}

.btn::before {
  content: '';
  position: absolute;
  inset-inline-end: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 55%;
  background: var(--brass);
  border-radius: 999px 0 0 999px;
  opacity: 0.7;
}

.btn:hover {
  background: var(--green-mid);
  color: #fff !important;
  text-decoration: none !important;
  transform: translateY(-1px);
}

.btn:active {
  background: var(--green-dark);
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  color: var(--green) !important;
  border: 2px solid var(--green);
}

.btn-outline::before { display: none; }

.btn-outline:hover {
  background: var(--green-light);
  color: var(--green-dark) !important;
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--green-light);
  color: var(--green-dark) !important;
  border: 1px solid var(--green-border);
}

.btn-ghost::before { display: none; }

.btn-ghost:hover {
  background: #D7E5DE;
  transform: translateY(-1px);
}

.btn-brass {
  background: var(--brass);
  color: var(--basalt) !important;
}

.btn-brass::before { background: var(--green); }

.btn-brass:hover {
  background: #b08e3e;
  color: var(--basalt) !important;
}

.btn-disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
}

/* ── Code display ── */
.code-display {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  word-spacing: 0.35em;
  text-align: center;
  direction: ltr;
  color: var(--green);
  margin: 1rem 0;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  padding: 0.85rem 1rem;
  background: #fff;
  border-radius: var(--radius-sm);
  border: 2px solid var(--green);
}

/* ── Steps ── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-item {
  padding: 1.25rem;
  background: var(--stone);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  text-align: center;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.step-item h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--green-dark);
}

.step-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Store badges ── */
.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--stone);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

a.store-badge:hover {
  border-color: var(--green);
  background: #fff;
}

.store-badge--pending {
  color: var(--muted);
  cursor: default;
}

.store-badge svg {
  width: 22px;
  height: 22px;
  opacity: 0.85;
}

.store-badge--pending svg {
  opacity: 0.6;
}

.download-hint {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

/* ── Misc ── */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.error {
  color: #B3471F;
  text-align: center;
  font-weight: 500;
}

.recent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.recent-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  background: var(--brass-dim);
  color: var(--basalt);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  border: 1px solid var(--brass-border);
  text-decoration: none !important;
  transition: background 0.15s;
  font-family: 'SF Mono', monospace;
  direction: ltr;
}

.recent-chip:hover {
  background: rgba(194,161,77,0.22);
  color: var(--basalt) !important;
}

.hint-link {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  background: var(--stone);
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  direction: ltr;
  border: 1px solid var(--border);
  color: var(--green-dark);
}

/* ── Brass rule ── */
.brass-rule {
  display: block;
  width: 48px;
  height: 2px;
  background: var(--brass);
  margin: 0.75rem auto;
  border: none;
}

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 2.5rem max(1.5rem, calc((100% - 1080px) / 2));
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  background: rgba(237,231,218,0.7);
}

.site-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
}

.site-footer p { margin: 0.35rem 0; }

.site-footer a {
  margin: 0 0.4rem;
  color: var(--muted);
}

.site-footer a:hover { color: var(--green); }

/* ── Lookup page ── */
.lookup-card {
  text-align: center;
  padding: 2.5rem 1.75rem;
}

.lookup-title {
  margin: 0 0 0.5rem;
  color: var(--green-dark);
  font-size: 1.4rem;
  font-weight: 700;
}

.lookup-form {
  text-align: right;
  max-width: 340px;
  margin: 1.25rem auto 0;
}

.lookup-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  color: var(--green-dark);
}

.pin-form {
  text-align: center;
  max-width: 22rem;
}

.pin-form label {
  display: block;
  text-align: center;
  margin-bottom: 1.25rem;
  line-height: 1.6;
  font-size: 1.05rem;
}

.pin-input-single-box {
  width: 100%;
  max-width: 100%;
  min-height: 64px;
  margin: 0 auto 1.25rem;
  position: relative;
  border: none;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.pin-input-single-box::before,
.pin-input-single-box::after {
  display: none;
}

.pin-input-single-box:focus-within {
  box-shadow: none;
  border-color: transparent;
}

.pin-input-display {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  align-items: stretch;
  pointer-events: none;
  z-index: 3;
  direction: ltr;
}

.pin-input-display .code-slot {
  width: auto;
  max-width: none;
  min-width: 0;
  margin: 0;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', 'SF Mono', 'Courier New', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pin-input-display .code-slot-ghost {
  color: transparent;
}

.pin-input-display .code-slot-caret {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(11, 91, 64, 0.12);
}

.pin-input-display .code-slot-caret::after {
  left: 50%;
  right: auto;
  margin-left: -1px;
}

.pin-input-display .code-slot-digit {
  border-color: var(--green-border);
  color: var(--green-dark);
}

.pin-input-display .code-slot-masked {
  font-size: 1.2rem;
  color: var(--green-dark);
}

.pin-has-error .pin-input-display .code-slot {
  border-color: #E24B4A;
  background: #FFF5F5;
}

.pin-has-error .pin-input-display .code-slot-digit {
  border-color: #E24B4A;
  color: #A32D2D;
}

.pin-input-single-field {
  min-height: 64px;
}

.lookup-form input:not(.code-input-single-field) {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  margin-bottom: 0.85rem;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.lookup-form input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(11,91,64,0.10);
}

.meta-list {
  text-align: right;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  background: var(--stone);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.meta-list li {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.meta-list li:last-child { border-bottom: none; }
.meta-list strong { color: var(--green-dark); }

html[dir="ltr"] .meta-list { text-align: left; }

.meta-phone-call {
  padding: 0 !important;
  border-bottom: none !important;
}

.meta-phone-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: inherit;
  text-decoration: none;
  background: rgba(11, 91, 64, 0.08);
  transition: background 0.15s;
}

.meta-phone-link:hover {
  background: rgba(11, 91, 64, 0.14);
  color: var(--green-dark);
}

.meta-phone-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--green-light);
  color: var(--green);
  flex-shrink: 0;
}

.meta-phone-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  min-width: 0;
}

.meta-phone-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.meta-phone-number {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
  direction: ltr;
  unicode-bidi: isolate;
}

.btn-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--green-light);
  border: 2px solid var(--green);
  color: var(--green-dark) !important;
}

.btn-phone::before { display: none; }

.btn-phone:hover {
  background: #D7E5DE;
  color: var(--green-dark) !important;
}

.lookup-photo {
  margin: 1.25rem 0 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border, #d5cec1);
  background: #f8f6f1;
}

.lookup-photo img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

/* ── Lookup icon (replace emoji) ── */
.lookup-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lookup-icon svg {
  width: 72px;
  height: 72px;
}

.lookup-download-cta {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.lookup-download-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  color: var(--green-dark);
  font-size: 0.95rem;
}

.lookup-download-body {
  margin: 0 0 0.85rem;
  font-size: 0.86rem;
  line-height: 1.5;
}

/* ── Spinner ── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--green-light);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Legal prose ── */
.prose h2 {
  color: var(--green-dark);
  font-size: 1.25rem;
  margin-top: 1.5rem;
  font-weight: 700;
}

.prose ul { padding-inline-start: 1.25rem; }

/* ── Responsive ── */
@media (min-width: 900px) {
  main { padding: 3rem 2rem 5rem; }

  .hero { padding: 1rem 2rem 1.25rem; }
  .hero-brand-icon svg { width: 72px; height: 72px; }
  .hero-brand-title { font-size: 2rem; }
  .hero-brand-tagline { font-size: 1.05rem; }

  .card-search {
    max-width: 520px;
    margin-inline: auto;
  }

  .card-highlight {
    max-width: 600px;
    margin-inline: auto;
  }

  .search-box { flex-wrap: nowrap; }
  .search-box .btn { min-width: 7rem; flex-shrink: 0; }

  .steps { grid-template-columns: repeat(3, 1fr); }

  .home-grid-2 { grid-template-columns: 1fr 1fr; }
  .home-grid-2 .card {
    margin-bottom: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .lookup-card {
    max-width: 580px;
    margin-inline: auto;
  }

  .meta-list {
    max-width: 480px;
    margin-inline: auto;
  }
}

@media (max-width: 600px) {
  .site-header { padding: 0 1rem; }
  .site-header nav a { font-size: 0.8rem; padding: 0.35rem 0.5rem; }
  .code-slot { font-size: 1.3rem; }
  main { padding: 1.5rem 1rem 3rem; }
  .card { padding: 1.25rem; }
  .card-search-body { padding: 1rem; }
}

/* Brand is light-only (Damascus Stone). Block browser auto-darkening on mobile. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light only;
  }

  html,
  body {
    background: var(--bg) !important;
    color: var(--text) !important;
  }

  .site-header {
    background: rgba(237, 231, 218, 0.92) !important;
    border-bottom-color: var(--brass) !important;
  }

  .card,
  .search-input,
  .lookup-form input {
    background: var(--card) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
  }

  .btn-outline {
    background: transparent !important;
    color: var(--green-dark) !important;
    border-color: var(--green-border) !important;
  }
}

/* ── Contact form (floating + modal) ── */
.contact-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 120;
  border: 1px solid var(--green-border);
  background: #fff;
  color: var(--green);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(21, 32, 27, 0.12);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.contact-fab:hover {
  background: var(--green-light);
  color: var(--green-dark);
  border-color: var(--green);
}

.lang-fab {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 120;
  min-width: 3.5rem;
  min-height: 2.5rem;
  border: 1px solid var(--green-border);
  background: #fff;
  color: var(--green);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(21, 32, 27, 0.12);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.lang-fab:hover {
  background: var(--green-light);
  color: var(--green-dark);
  border-color: var(--green);
}

body.has-contact-fab {
  padding-bottom: 4rem;
}

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(21, 32, 27, 0.45);
}

.contact-modal-card {
  width: min(100%, 28rem);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem;
  box-shadow: 0 12px 40px rgba(21, 32, 27, 0.18);
}

.contact-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.contact-modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--green-dark);
}

.contact-modal-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}

.contact-modal-sub {
  margin: 0.35rem 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.contact-form {
  display: grid;
  gap: 0.85rem;
}

.contact-field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text);
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.contact-field textarea {
  resize: vertical;
  min-height: 7rem;
}

.contact-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.contact-submit {
  width: 100%;
  margin-top: 0.25rem;
}

.contact-success {
  margin: 0;
  color: var(--green);
  font-weight: 600;
  text-align: center;
}
