/* Time.krd — Phase 1 foundation (RTL / Sorani Kurdish) */

@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn.woff2?v=601852eff0b1') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;

  --font-sans: 'Vazirmatn', Tahoma, Arial, sans-serif;
  --font-numeric: 'Vazirmatn', ui-monospace, 'Segoe UI Mono', monospace;

  --color-canvas: #f7f5ef;
  --color-canvas-alt: #eef3f8;
  --color-surface: #ffffff;
  --color-surface-raised: #fffdf8;
  --color-surface-soft: #f5f2ea;
  --color-text: #172033;
  --color-text-strong: #0b1325;
  --color-muted: #5e687a;
  --color-border: #dfe4eb;
  --color-border-strong: #cbd3df;
  --color-accent: #8f6a12;
  --color-accent-strong: #71530b;
  --color-accent-soft: #f7eac1;
  --color-focus: #1466d8;
  --color-danger: #b4232f;
  --color-header: rgba(255, 253, 248, 0.96);
  --color-skeleton: #e2e6ec;
  --color-skeleton-shine: #f4f6f8;
  --color-text-muted: var(--color-muted);
  --color-text-faint: color-mix(in srgb, var(--color-muted) 82%, transparent);
  --color-surface-muted: var(--color-surface-soft);
  --color-on-accent: #ffffff;

  --bakur: #2563eb;
  --rojava: #15803d;
  --basur: #d97706;
  --bashur: var(--basur);
  --rojhilat: #dc3545;
  --kurd-gold: #c89b24;
  --kurd-gold-ink: var(--color-accent-strong);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-9: 2.25rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --radius-sm: 0.625rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.125rem;
  --radius-xl: 1.5rem;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(18, 29, 50, 0.05), 0 5px 16px rgba(18, 29, 50, 0.05);
  --shadow-md: 0 14px 35px rgba(18, 29, 50, 0.09);
  --shadow-lg: 0 22px 54px rgba(18, 29, 50, 0.12);
  --shadow: var(--shadow-md);
  --shadow-soft: var(--shadow-sm);

  --container-main: 77.5rem;
  --container-gutter: clamp(1rem, 3vw, 2rem);
  --header-height: 5rem;
  --transition-fast: 150ms ease;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-lg: 1.125rem;

  /* Compatibility tokens used by the existing components. */
  --muted: var(--color-muted);
  --ink: var(--color-text-strong);
  --card-bg: var(--color-surface);
  --card-border: var(--color-border);
  --surface: var(--color-surface);
  --surface-raised: var(--color-surface-raised);
  --surface-muted: var(--color-surface-soft);
  --text: var(--color-text);
  --text-muted: var(--color-muted);
  --border: var(--color-border);
  --border-strong: var(--color-border-strong);
  --accent: var(--color-accent);
  --accent-2: var(--color-accent-strong);
  --accent-soft: var(--color-accent-soft);
  --on-accent: var(--color-on-accent);
  --success: var(--rojava);
  --shadow-xs: 0 1px 2px rgba(18, 29, 50, 0.06);
  --font-size-xs: var(--text-xs);
  --font-size-sm: var(--text-sm);
  --font-size-lg: var(--text-lg);
}

html[data-theme='dark'] {
  color-scheme: dark;
  --color-canvas: #0d1422;
  --color-canvas-alt: #111d2d;
  --color-surface: #172235;
  --color-surface-raised: #1b2940;
  --color-surface-soft: #202d42;
  --color-text: #e8edf5;
  --color-text-strong: #ffffff;
  --color-muted: #aab5c5;
  --color-border: #2d3c53;
  --color-border-strong: #40516a;
  --color-accent: #e7c35b;
  --color-accent-strong: #f6d77b;
  --color-accent-soft: #3c321c;
  --color-focus: #73a9ff;
  --color-danger: #ff8c98;
  --color-header: rgba(13, 20, 34, 0.96);
  --color-skeleton: #29384e;
  --color-skeleton-shine: #384961;
  --color-on-accent: #171204;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.18), 0 5px 16px rgba(0, 0, 0, 0.16);
  --shadow-md: 0 15px 38px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 22px 56px rgba(0, 0, 0, 0.3);
}

html[data-theme-initializing='true'],
html[data-theme-initializing='true'] * {
  transition: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: clip;
  direction: rtl;
  background:
    radial-gradient(70rem 30rem at 85% -8rem, color-mix(in srgb, var(--color-accent) 15%, transparent), transparent 68%),
    radial-gradient(58rem 28rem at 5% 12rem, color-mix(in srgb, var(--bakur) 8%, transparent), transparent 70%),
    linear-gradient(180deg, var(--color-canvas), var(--color-canvas-alt) 52%, var(--color-canvas));
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
canvas {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--color-accent-soft);
  color: var(--color-text-strong);
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  inset-block-start: var(--space-3);
  inset-inline-start: var(--space-3);
  z-index: 10000;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-text-strong);
  color: var(--color-surface);
  font-weight: 800;
  transform: translateY(-180%);
  transition: transform var(--transition-fast);
}

.skip-link:focus {
  transform: translateY(0);
}

.muted {
  color: var(--color-muted);
}

.container {
  width: min(var(--container-main), calc(100% - (2 * var(--container-gutter))));
  margin-inline: auto;
}

.main-content {
  padding-block: clamp(1.5rem, 4vw, 3rem) var(--space-16);
}

.cards-section,
.map-section,
.globe-section,
.lower-grid,
.converter-section {
  margin-block-end: clamp(2.75rem, 7vw, 5rem);
}

#kurdistan-map,
#globe,
#calendar-area,
#date-converter {
  scroll-margin-top: calc(var(--header-height) + var(--space-5));
}

/* Header */
.header {
  position: sticky;
  inset-block-start: 0;
  z-index: 1000;
  border-block-end: 1px solid var(--color-border);
  background: var(--color-header);
  box-shadow: 0 8px 28px rgba(18, 29, 50, 0.08);
}

.header-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--color-accent) 13%, transparent), transparent 35%),
    linear-gradient(-90deg, color-mix(in srgb, var(--rojava) 7%, transparent), transparent 30%);
  pointer-events: none;
}

.header-inner {
  display: grid;
  gap: var(--space-2);
  padding-block: 0.625rem;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-3);
  border-radius: var(--radius-md);
}

.brand img {
  width: 2.75rem;
  height: 1.875rem;
  flex: 0 0 auto;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.brand-text {
  display: grid;
  min-width: 0;
  gap: 0;
}

.brand-title {
  margin: 0;
  color: var(--color-text-strong);
  font-size: clamp(0.96rem, 1.6vw, 1.08rem);
  font-weight: 850;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.brand-sub {
  color: var(--color-muted);
  font-size: 0.75rem;
  line-height: 1.2;
  text-align: right;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-2);
}

.theme-toggle,
.menu-toggle {
  min-height: 2.75rem;
  padding-inline: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.79rem;
  font-weight: 750;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.theme-icon {
  color: var(--color-accent);
  font-size: 1.15rem;
  line-height: 1;
}

.menu-toggle {
  display: none;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
  width: 1.125rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  content: '';
}

.menu-icon {
  position: relative;
  display: inline-block;
}

.menu-icon::before,
.menu-icon::after {
  position: absolute;
  inset-inline-start: 0;
}

.menu-icon::before {
  inset-block-start: -0.33rem;
}

.menu-icon::after {
  inset-block-start: 0.33rem;
}

.region-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.pill {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  padding-inline: var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 750;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.pill:hover,
.pill:focus-visible {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-strong);
}

.tagline {
  margin: 0;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 0.76rem;
  line-height: 1.6;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Headings */
.section-title {
  max-width: 54rem;
  margin: 0 auto var(--space-6);
  color: var(--color-text-strong);
  font-size: clamp(1.2rem, 2.4vw, 1.72rem);
  font-weight: 850;
  letter-spacing: -0.025em;
  line-height: 1.45;
  text-align: center;
}

.section-note {
  max-width: 52rem;
  margin: var(--space-4) auto 0;
  color: var(--color-muted);
  font-size: 0.82rem;
  line-height: 1.8;
  text-align: center;
}

.section-title-card {
  margin-block-end: var(--space-5);
}

/* Stable first-load skeletons */
.is-loading {
  position: relative;
  min-height: 1em;
  color: transparent !important;
}

.is-loading::after {
  display: block;
  width: min(100%, 10rem);
  height: 0.9em;
  margin-inline: auto;
  border-radius: var(--radius-pill);
  background:
    linear-gradient(100deg, transparent 20%, var(--color-skeleton-shine) 45%, transparent 70%),
    var(--color-skeleton);
  background-size: 220% 100%;
  content: '';
  animation: skeleton-shimmer 1.6s linear infinite;
}

.time.is-loading::after {
  width: 7.1ch;
  height: 1em;
}

.date.is-loading::after {
  width: min(100%, 13rem);
}

.temp.is-loading::after {
  width: 3.2rem;
  height: 1.15rem;
}

.desc.is-loading::after {
  width: 6.5rem;
}

.cal-selected-line.is-loading::after,
.book-meta.is-loading::after {
  width: min(100%, 12rem);
}

@keyframes skeleton-shimmer {
  to {
    background-position: -220% 0;
  }
}

/* City clocks and weather */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.875rem, 1.8vw, 1.25rem);
}

.city-card {
  grid-column: span 3;
  min-width: 0;
  min-height: 18rem;
  padding: clamp(1.25rem, 2vw, 1.75rem);
  border: 1px solid var(--color-border);
  border-block-start-width: 4px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--color-surface-raised), var(--color-surface));
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  text-align: center;
  contain: layout paint;
}

.city-region {
  display: flex;
  width: 100%;
  justify-content: center;
}

.region-pill {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  justify-content: center;
  padding-inline: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 800;
}

.region-bakur {
  border-color: color-mix(in srgb, var(--bakur) 35%, var(--color-border));
  background: color-mix(in srgb, var(--bakur) 12%, var(--color-surface));
}

.region-rojava {
  border-color: color-mix(in srgb, var(--rojava) 35%, var(--color-border));
  background: color-mix(in srgb, var(--rojava) 12%, var(--color-surface));
}

.region-basur {
  border-color: color-mix(in srgb, var(--basur) 35%, var(--color-border));
  background: color-mix(in srgb, var(--basur) 13%, var(--color-surface));
}

.region-bashur {
  border-color: color-mix(in srgb, var(--basur) 35%, var(--color-border));
  background: color-mix(in srgb, var(--basur) 13%, var(--color-surface));
}

.region-rojhilat {
  border-color: color-mix(in srgb, var(--rojhilat) 35%, var(--color-border));
  background: color-mix(in srgb, var(--rojhilat) 12%, var(--color-surface));
}

.region-rojhelat {
  border-color: color-mix(in srgb, var(--rojhilat) 35%, var(--color-border));
  background: color-mix(in srgb, var(--rojhilat) 12%, var(--color-surface));
}

.city-card h3 {
  margin: 0;
  color: var(--color-text-strong);
  font-size: clamp(1.35rem, 2.2vw, 1.65rem);
  font-weight: 850;
  line-height: 1.35;
}

.time {
  display: block;
  min-width: 7.2ch;
  min-height: 1.25em;
  direction: ltr;
  color: var(--kurd-gold-ink);
  font-family: var(--font-numeric);
  font-size: clamp(2.15rem, 3.4vw, 3.05rem);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: center;
}

.city-card .date {
  min-height: 2.8rem;
  display: flex;
  align-items: center;
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.7;
}

.weather {
  width: 100%;
  min-height: 4.85rem;
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--space-1);
  color: var(--color-muted);
  font-weight: 700;
}

.weather .desc {
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: 0.82rem;
  line-height: 1.4;
}

.weather .w-icon {
  font-size: 1.55rem;
  line-height: 1;
}

.weather .w-icon img {
  display: block;
  width: 2.15rem;
  height: 2.15rem;
  object-fit: contain;
}

.weather .temp {
  min-height: 1.6rem;
  direction: ltr;
  color: var(--color-text-strong);
  font-family: var(--font-numeric);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.weather .weather-fallback {
  max-width: 13rem;
  color: var(--color-muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.card-bakur {
  border-block-start-color: var(--bakur);
}

.card-rojava {
  border-block-start-color: var(--rojava);
}

.card-basur {
  border-block-start-color: var(--basur);
}

.card-rojhilat {
  border-block-start-color: var(--rojhilat);
}

/* Shared panels */
.map-container,
.globe-panel,
.kurdistan-info,
.calendar-section,
.book-section,
.quote-section,
.converter-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.map-container {
  padding: clamp(0.65rem, 1.5vw, 1rem);
}

#map {
  position: relative;
  width: 100%;
  height: clamp(22rem, 46vw, 34rem);
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-soft);
  isolation: isolate;
}

.widget-loading {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 2;
  width: max-content;
  max-width: calc(100% - 2rem);
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 700;
  transform: translate(-50%, -50%);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-block-start: var(--space-3);
}

.map-legend-item {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding-inline: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface-raised);
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 750;
}

.map-legend-item:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}

.legend-dot {
  width: 0.65rem;
  height: 0.65rem;
  display: inline-block;
  border-radius: 50%;
}

.legend-dot.bakur {
  background: var(--bakur);
}

.legend-dot.rojava {
  background: var(--rojava);
}

.legend-dot.basur {
  background: var(--basur);
}

.legend-dot.rojhilat {
  background: var(--rojhilat);
}

.city-marker {
  border: none !important;
  background: transparent !important;
  display: grid !important;
  place-items: center;
}

.city-dot {
  width: 0.75rem;
  height: 0.75rem;
  display: block;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.map-popup {
  font-family: var(--font-sans);
}

.popup-weather {
  min-height: 2.4rem;
  margin-block-start: var(--space-2);
  padding-block-start: var(--space-2);
  border-block-start: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8rem;
}

.pw-icon {
  font-size: 1.1rem;
}

.pw-temp {
  direction: ltr;
  color: var(--kurd-gold-ink);
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.pw-desc {
  color: var(--color-muted);
  font-size: 0.75rem;
}

.leaflet-container {
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
}

.leaflet-control-layers {
  direction: rtl;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  border-radius: var(--radius-md) !important;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-sans);
}

.leaflet-control-layers-expanded {
  padding: var(--space-3);
}

.leaflet-control-layers label {
  min-height: 2rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-1) 0;
  color: #172033;
  font-size: 0.75rem;
  font-weight: 700;
}

.leaflet-control-layers-selector {
  width: 1rem;
  height: 1rem;
  accent-color: var(--kurd-gold);
}

.leaflet-popup-content {
  margin: var(--space-3) var(--space-4);
}

.leaflet-popup-content-wrapper {
  border-radius: var(--radius-md);
}

/* Globe and facts */
.globe-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  align-items: stretch;
}

.globe-panel {
  grid-column: span 7;
  min-width: 0;
  padding: clamp(0.75rem, 1.5vw, 1rem);
  overflow: hidden;
}

.globe-grid > .globe-app {
  grid-column: span 7;
}

#globe-wrapper {
  position: relative;
  width: 100%;
  height: clamp(20rem, 38vw, 29rem);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(25rem 18rem at 30% 25%, rgba(255, 255, 255, 0.12), transparent 62%),
    linear-gradient(135deg, #131f34, #08111e);
  touch-action: none;
}

#globe-canvas {
  width: 100%;
  height: 100%;
}

.globe-hint,
.globe-emotion {
  max-width: 45rem;
  margin-inline: auto;
  color: var(--color-muted);
  text-align: center;
}

.globe-hint {
  margin-block: var(--space-3) var(--space-1);
  font-size: 0.76rem;
}

.globe-emotion {
  margin-block: 0;
  font-size: 0.84rem;
  line-height: 1.85;
}

.kurdistan-info {
  grid-column: span 5;
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.35rem);
}

.kurdistan-info h3,
.book-section h3,
.quote-section h3 {
  margin: 0 0 var(--space-4);
  color: var(--color-text-strong);
  font-size: 1rem;
  font-weight: 820;
  text-align: center;
}

.info-list {
  display: grid;
  gap: var(--space-3);
}

.info-card {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-raised);
}

.info-label {
  margin-block-end: var(--space-1);
  color: var(--color-muted);
  font-size: 0.76rem;
}

.info-value {
  color: var(--color-text-strong);
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.55;
}

.info-note {
  margin: var(--space-4) 0 0;
  color: var(--color-muted);
  font-size: 0.76rem;
  line-height: 1.8;
  text-align: center;
}

/* Calendar and editorial cards */
.lower-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  align-items: stretch;
}

.calendar-section {
  grid-column: span 7;
  min-width: 0;
  padding: clamp(0.75rem, 1.5vw, 1rem);
}

.sidebar-stack {
  grid-column: span 5;
  min-width: 0;
  display: grid;
  gap: var(--space-4);
}

.book-section,
.quote-section {
  min-width: 0;
  padding: var(--space-4);
  overflow: hidden;
}

.book-card,
.quote-card {
  min-height: 10rem;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-raised);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  text-align: center;
}

.book-title {
  color: var(--color-text-strong);
  font-size: 1rem;
  font-weight: 820;
}

.book-meta {
  min-height: 1.3rem;
  color: var(--color-muted);
  font-size: 0.78rem;
  line-height: 1.7;
}

.quote-mark {
  color: var(--color-accent);
  font-size: 2.4rem;
  line-height: 0.8;
}

.quote-text {
  min-height: 4rem;
  font-size: 0.91rem;
  line-height: 1.9;
}

.quote-author {
  color: var(--color-muted);
  font-size: 0.76rem;
}

.calendar {
  width: 100%;
  min-height: 34rem;
  margin-inline: auto;
  padding: clamp(0.75rem, 1.5vw, 1rem);
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-raised);
}

.cal-top {
  min-height: 7.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.icon-btn {
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  color: var(--color-text-strong);
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 850;
}

.cal-top-center {
  min-width: 0;
  flex: 1;
  text-align: center;
}

.cal-month-year {
  min-height: 2rem;
  color: var(--color-text-strong);
  font-size: 1.12rem;
  font-weight: 820;
}

.cal-selected {
  min-height: 4.8rem;
  margin-block-start: var(--space-2);
  display: grid;
  align-content: center;
  gap: var(--space-1);
}

.cal-selected-line {
  min-height: 1.25rem;
  color: var(--color-muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.cal-selected-ku {
  color: var(--color-text);
  font-size: 0.8rem;
  font-weight: 750;
}

.today-btn,
.convert-btn {
  min-height: 2.75rem;
  border: 1px solid color-mix(in srgb, var(--color-accent) 42%, var(--color-border));
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f1d27e, #d3a93a);
  box-shadow: 0 8px 22px rgba(156, 116, 24, 0.2);
  color: #172033;
  cursor: pointer;
  font-weight: 820;
}

.today-btn {
  width: 100%;
  margin-block-start: var(--space-2);
  padding-inline: var(--space-4);
}

.today-btn:hover,
.convert-btn:hover {
  filter: brightness(1.04);
}

.cal-grid {
  margin-block-start: var(--space-3);
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(0.25rem, 0.8vw, 0.5rem);
  direction: rtl;
}

.cal-row {
  display: contents;
}

.cal-cell {
  min-width: 0;
  min-height: 3.25rem;
  padding: var(--space-2) var(--space-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  display: grid;
  place-items: center;
}

.cal-head {
  min-height: 2.75rem;
  background: var(--color-surface-soft);
  color: var(--color-muted);
  font-size: clamp(0.58rem, 1.2vw, 0.72rem);
  font-weight: 800;
}

.cal-empty {
  border-color: transparent;
  background: transparent;
}

.cal-day {
  color: var(--color-text);
  cursor: pointer;
}

.cal-day:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}

.cal-day .g-day {
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.cal-day .j-day {
  margin-block-start: 1px;
  color: var(--color-muted);
  font-size: 0.67rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.cal-day.is-today {
  border-color: var(--color-accent);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

.cal-day.is-selected {
  border-color: var(--color-focus);
  background: color-mix(in srgb, var(--color-focus) 9%, var(--color-surface));
}

.cal-day.is-weekend .g-day {
  color: var(--color-danger);
}

/* Converter */
.converter-card {
  padding: clamp(0.75rem, 1.5vw, 1rem);
}

.convert-form {
  padding: clamp(0.75rem, 1.5vw, 1rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-raised);
}

.convert-row {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 1fr 0.7fr auto;
  gap: var(--space-3);
  align-items: end;
}

.convert-field {
  min-width: 0;
  display: grid;
  gap: var(--space-2);
}

.label {
  color: var(--color-muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.convert-field input,
.convert-field select {
  width: 100%;
  min-height: 2.75rem;
  padding-inline: var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  outline: none;
  font-weight: 700;
}

.convert-field input:focus,
.convert-field select:focus {
  border-color: var(--color-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-focus) 22%, transparent);
}

.convert-btn {
  padding-inline: var(--space-6);
}

.convert-hint {
  margin-block-start: var(--space-3);
  color: var(--color-muted);
  font-size: 0.77rem;
  text-align: center;
}

.convert-results {
  margin-block-start: var(--space-3);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.result-card {
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-raised);
  text-align: center;
}

.result-label {
  margin-block-end: var(--space-2);
  color: var(--color-muted);
  font-size: 0.76rem;
}

.result-value {
  color: var(--color-text-strong);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

/* Footer */
.footer {
  margin-block-start: var(--space-12);
  border-block-start: 1px solid #27354a;
  background: #0e1727;
  color: rgba(255, 255, 255, 0.9);
}

.footer-inner {
  padding-block: var(--space-10) var(--space-5);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-8);
  align-items: start;
}

.footer h4 {
  margin: 0 0 var(--space-3);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 820;
}

.footer p,
.footer li {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  line-height: 1.9;
}

.footer-small {
  margin-block-start: var(--space-3);
}

.footer-links {
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
  list-style: none;
}

.footer-links a {
  display: inline-block;
  min-height: 2.25rem;
  padding-block: var(--space-1);
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-bottom {
  padding: var(--space-4) var(--container-gutter);
  border-block-start: 1px solid rgba(255, 255, 255, 0.09);
  display: grid;
  gap: var(--space-2);
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.76rem;
  text-align: center;
}

.footer-closing-primary {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.82rem;
  font-weight: 750;
}

.footer-closing-warm {
  font-size: 0.7rem;
}

.footer-made {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.footer-flag {
  width: 1.4rem;
  height: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.25rem;
  object-fit: cover;
}

/* Back to top */
.to-top {
  position: fixed;
  inset-inline-end: calc(1rem + env(safe-area-inset-right));
  inset-block-end: calc(1rem + env(safe-area-inset-bottom));
  z-index: 1100;
  width: 3rem;
  height: 3rem;
  overflow: hidden;
  border: 2px solid var(--color-surface);
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.75rem);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.to-top-flag {
  position: absolute;
  inset: 0;
  background: url('../assets/flag.png') center / cover no-repeat;
}

@media (min-width: 82.01rem) {
  .header-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .header-top {
    display: contents;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .region-pills {
    grid-column: 2;
    grid-row: 1;
  }

  .header-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .tagline {
    grid-column: 1 / -1;
  }
}

/* Tablet */
@media (max-width: 67.5rem) {
  :root {
    --header-height: 4.5rem;
  }

  .tagline {
    display: none;
  }

  .header-inner {
    padding-block-start: calc(0.625rem + env(safe-area-inset-top));
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
  }

  .theme-toggle span:last-child,
  .menu-toggle span:last-child {
    display: none;
  }

  html.js .region-pills {
    display: none;
  }

  html.js .region-pills[data-open='true'] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-block: var(--space-2) var(--space-1);
  }

  .pill {
    border-color: var(--color-border);
    background: var(--color-surface);
  }

  .city-card {
    grid-column: span 6;
  }

  .globe-panel,
  .globe-grid > .globe-app,
  .kurdistan-info,
  .calendar-section,
  .sidebar-stack {
    grid-column: 1 / -1;
  }

  .sidebar-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .convert-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .convert-btn {
    grid-column: 1 / -1;
  }

  .convert-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Compact header and mobile navigation */
@media (max-width: 47.99rem) {
  :root {
    --header-height: 4.5rem;
  }

  .header-inner {
    padding-block-start: calc(0.625rem + env(safe-area-inset-top));
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
  }

  .theme-toggle span:last-child,
  .menu-toggle span:last-child {
    display: none;
  }

  html.js .region-pills {
    display: none;
  }

  html.js .region-pills[data-open='true'] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-block: var(--space-2) var(--space-1);
  }

  .pill {
    border-color: var(--color-border);
    background: var(--color-surface);
  }

  .section-title {
    margin-block-end: var(--space-5);
    text-align: right;
  }

  .city-card {
    min-height: 16rem;
  }

  #map {
    height: clamp(20rem, 90vw, 27rem);
  }

  #globe-wrapper {
    height: clamp(19rem, 86vw, 25rem);
  }

  .map-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-legend-item {
    width: 100%;
    justify-content: center;
  }

  .calendar {
    min-height: 32rem;
  }

  .cal-cell {
    min-height: 3rem;
    border-radius: var(--radius-sm);
  }

  .cal-head {
    min-height: 2.4rem;
  }

  .sidebar-stack {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* Small mobile */
@media (max-width: 32.5rem) {
  :root {
    --container-gutter: 0.75rem;
  }

  .brand {
    gap: var(--space-2);
  }

  .brand img {
    width: 2.4rem;
    height: 1.65rem;
  }

  .brand-title {
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .city-card {
    grid-column: 1 / -1;
    padding-inline: var(--space-4);
  }

  .time {
    font-size: clamp(2.3rem, 14vw, 2.85rem);
  }

  .map-container,
  .globe-panel,
  .globe-grid > .globe-app,
  .calendar-section,
  .converter-card {
    border-radius: var(--radius-lg);
  }

  .calendar {
    padding: var(--space-2);
  }

  .cal-top {
    min-height: 8rem;
    gap: var(--space-2);
  }

  .cal-grid {
    gap: 0.2rem;
  }

  .cal-cell {
    min-height: 2.8rem;
    padding-inline: 0;
  }

  .cal-head {
    font-size: 0.56rem;
  }

  .convert-row,
  .convert-results {
    grid-template-columns: 1fr;
  }

  .convert-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   Phase 6: command palette, install/update state, and sharing
   ========================================================= */
.command-trigger {
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-3);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
}

.command-trigger kbd,
.command-palette kbd {
  padding: 0.1rem 0.35rem;
  color: var(--text-muted);
  font: 600 0.72rem/1.3 ui-monospace, "SFMono-Regular", Consolas, monospace;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  direction: ltr;
}

.command-palette {
  width: min(44rem, calc(100% - 2rem));
  max-height: min(44rem, calc(100dvh - 2rem));
  padding: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
}

.command-palette::backdrop {
  background: rgb(4 12 18 / 68%);
  backdrop-filter: blur(5px);
}

.command-palette-panel {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(4rem, 1fr) auto;
  max-height: min(44rem, calc(100dvh - 2rem));
}

.command-palette-header {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-5);
  border-block-end: 1px solid var(--border);
}

.command-palette-header h2,
.command-palette-header p {
  margin: 0;
}

.command-palette-close {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 1.45rem;
}

.command-search-label {
  padding: var(--space-4) var(--space-5) var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.command-search-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  margin-inline: var(--space-5);
  padding-inline: var(--space-4);
  background: var(--surface-muted);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
}

.command-search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent);
}

.command-search-wrap input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}

.command-help,
.command-status {
  margin: var(--space-2) var(--space-5) 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.command-status {
  min-height: 1.5em;
}

.command-results {
  display: grid;
  gap: var(--space-1);
  align-content: start;
  padding: var(--space-3) var(--space-5) var(--space-5);
  overflow-y: auto;
}

.command-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--space-3);
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: var(--space-3);
  color: var(--text);
  text-align: start;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
}

.command-result span {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.command-result[aria-selected="true"],
.command-result:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.command-result-arrow {
  font-size: 1.1rem !important;
}

.command-palette-footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  padding: var(--space-3) var(--space-5);
  color: var(--text-muted);
  background: var(--surface-muted);
  border-block-start: 1px solid var(--border);
  font-size: var(--text-xs);
}

.dashboard-share {
  display: grid;
  gap: var(--space-1);
  justify-items: start;
}

.dashboard-share [role="status"] {
  min-height: 1.25em;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.pwa-status-stack {
  position: fixed;
  z-index: 1250;
  inset-inline-end: max(var(--space-4), env(safe-area-inset-left));
  inset-block-end: max(var(--space-4), env(safe-area-inset-bottom));
  display: grid;
  gap: var(--space-2);
  width: min(24rem, calc(100vw - 2rem));
  pointer-events: none;
}

.pwa-status-stack > * {
  pointer-events: auto;
}

.pwa-install,
.pwa-update,
.offline-indicator {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.pwa-install {
  justify-self: start;
  color: var(--on-accent);
  background: var(--accent);
}

.pwa-update p {
  margin-block: 0 0.6rem;
}

.pwa-update div {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.offline-indicator {
  color: var(--text);
  background: var(--accent-soft);
}

[data-kurdistan-map][data-network="offline"] .map-stage::after,
[data-kurdistan-globe][data-network="offline"] .globe-stage::after {
  position: absolute;
  z-index: 500;
  inset-inline: var(--space-3);
  inset-block-end: var(--space-3);
  padding: var(--space-2) var(--space-3);
  color: var(--text);
  content: "ئۆفلاینی؛ وێنەی جێگرەوە و لیستی شارەکان بەردەستن.";
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: var(--text-sm);
  pointer-events: none;
}

.map-canvas.map-offline-fallback {
  background:
    linear-gradient(rgb(8 24 34 / 12%), rgb(8 24 34 / 12%)),
    url("/assets/kurdistan-map.png") center / cover no-repeat;
}

.offline-page {
  display: grid;
  gap: var(--space-5);
  width: min(48rem, 100%);
  min-height: 60vh;
  margin-inline: auto;
  align-content: center;
  text-align: center;
}

.offline-page h1,
.offline-page p {
  margin: 0;
}

.offline-page nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

@media (max-width: 768px) {
  .command-trigger kbd {
    display: none;
  }

  .command-trigger {
    width: 44px;
    padding: 0;
    justify-content: center;
  }

  .command-trigger span:last-of-type {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .command-palette {
    width: 100%;
    max-width: none;
    max-height: min(86dvh, 48rem);
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .command-palette-panel {
    max-height: min(86dvh, 48rem);
    padding-block-end: env(safe-area-inset-bottom);
  }

  .command-palette-header,
  .command-results {
    padding-inline: var(--space-4);
  }

  .command-search-label {
    padding-inline: var(--space-4);
  }

  .command-search-wrap,
  .command-help,
  .command-status {
    margin-inline: var(--space-4);
  }

  .command-palette-footer {
    display: none;
  }

  .pwa-status-stack {
    inset-inline-start: var(--space-3);
    inset-inline-end: var(--space-3);
    inset-block-end: calc(var(--space-3) + env(safe-area-inset-bottom));
    width: auto;
  }
}

/* Phase 2: indexable landing pages and internal-link architecture */
.home-intro {
  position: relative;
  overflow: hidden;
  margin-block-end: var(--space-7);
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--kurd-gold) 24%, transparent), transparent 34%),
    linear-gradient(135deg, var(--color-surface), var(--color-surface-muted));
  box-shadow: var(--shadow-md);
}

.home-intro::after {
  position: absolute;
  inset-block-start: -4.5rem;
  inset-inline-end: -4.5rem;
  width: 11rem;
  height: 11rem;
  border: 1.25rem solid color-mix(in srgb, var(--kurd-gold) 18%, transparent);
  border-radius: 50%;
  content: '';
  pointer-events: none;
}

.home-intro h1,
.seo-hero h1 {
  max-width: 22ch;
  margin: 0;
  color: var(--color-text);
  font-size: clamp(2rem, 5vw, 3.75rem);
  line-height: 1.2;
  text-wrap: balance;
}

.home-intro > p:not(.eyebrow) {
  max-width: 66ch;
  margin-block: var(--space-4) var(--space-5);
  color: var(--color-text-muted);
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  line-height: 2;
}

.eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--color-accent-strong);
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.home-intro-links,
.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.home-intro-links a,
.primary-link,
.related-links a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 750;
  text-decoration: none;
}

.home-intro-links .primary-link,
.primary-link {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.home-intro-links a:hover,
.primary-link:hover,
.related-links a:hover {
  border-color: var(--color-accent);
  transform: translateY(-1px);
}

.landing-page .main-content {
  min-height: 65vh;
}

.seo-page {
  padding-block-end: var(--space-9);
}

.breadcrumbs {
  margin-block-end: var(--space-5);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li + li::before {
  margin-inline-end: var(--space-2);
  color: var(--color-text-faint);
  content: '←';
}

.breadcrumbs a {
  color: var(--color-accent-strong);
}

.seo-hero {
  position: relative;
  overflow: hidden;
  margin-block-end: var(--space-7);
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 8% 15%, color-mix(in srgb, var(--kurd-gold) 20%, transparent), transparent 30%),
    var(--color-surface);
  box-shadow: var(--shadow-md);
}

.answer-summary {
  max-width: 72ch;
  margin-block: var(--space-4);
  color: var(--color-text-muted);
  font-size: clamp(1.02rem, 1.6vw, 1.16rem);
  line-height: 2;
}

.updated-at {
  margin: 0;
  color: var(--color-text-faint);
  font-size: var(--text-sm);
}

.seo-content {
  display: grid;
  gap: var(--space-7);
}

.seo-content > *,
[data-city-page] {
  min-width: 0;
}

.seo-content > section,
.methodology-note {
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.seo-content h2 {
  margin: 0 0 var(--space-4);
  color: var(--color-text);
  font-size: clamp(1.35rem, 2.8vw, 1.8rem);
  line-height: 1.45;
}

.seo-content h3 {
  margin-block: var(--space-3) var(--space-2);
}

.seo-content p,
.seo-content li {
  color: var(--color-text-muted);
  line-height: 1.95;
}

.seo-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.seo-city-card {
  min-width: 0;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-muted);
}

.seo-city-card h2,
.seo-city-card h3 {
  margin-block: var(--space-4) var(--space-2);
}

.seo-city-card p {
  margin: var(--space-2) 0;
  font-size: var(--text-sm);
}

.seo-live-time {
  display: block;
  min-height: 2.75rem;
  color: var(--color-text);
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  font-weight: 800;
  direction: ltr;
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.facts-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.facts-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface-muted);
}

.facts-table caption {
  padding: var(--space-3) var(--space-4);
  color: var(--color-text);
  font-weight: 800;
  text-align: start;
}

.facts-table th,
.facts-table td {
  padding: 0.8rem 1rem;
  border-block-start: 1px solid var(--color-border);
  color: var(--color-text-muted);
  text-align: start;
  vertical-align: top;
}

.facts-table th {
  width: min(42%, 18rem);
  color: var(--color-text);
}

.source-list,
.content-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding-inline-start: 1.25rem;
}

.source-list a {
  color: var(--color-accent-strong);
  overflow-wrap: anywhere;
}

.related-links {
  padding-block: var(--space-2);
}

.city-index-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

.city-index-region {
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.city-index-region h2 {
  margin-block-start: 0;
}

.city-index-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.city-index-list li {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
}

.city-index-list span {
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  direction: ltr;
  text-align: start;
}

.popup-city-link {
  display: inline-block;
  margin-block-start: 0.45rem;
  color: #1d4ed8;
  font-weight: 700;
}

.footer h2 {
  margin-block: 0 var(--space-3);
  color: #ffffff;
  font-size: var(--text-lg);
}

@media (max-width: 980px) {
  .seo-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .home-intro,
  .seo-hero {
    padding: var(--space-5);
  }

  .home-intro h1,
  .seo-hero h1 {
    font-size: clamp(1.75rem, 9vw, 2.6rem);
  }

  .home-intro-links a {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
  }

  .city-index-grid,
  .seo-card-grid,
  .city-index-list {
    grid-template-columns: 1fr;
  }

  .facts-table th,
  .facts-table td {
    padding: 0.7rem 0.75rem;
  }
}

/* =========================================================
   Phase 3 — city product, weather, map, globe, and tools
   ========================================================= */
.daily-dashboard,
.city-dashboard-hero,
.time-city-panel,
.weather-panel,
.map-app,
.globe-app,
.time-difference-tool {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.daily-dashboard {
  margin-block: var(--space-8);
  padding: clamp(var(--space-4), 3vw, var(--space-8));
}

.dashboard-heading,
.weather-current,
.city-dashboard-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.dashboard-heading h2,
.weather-current h2,
.weather-current h3,
.city-dashboard-hero h2 {
  margin: 0;
}

.city-selector {
  display: grid;
  gap: var(--space-2);
  min-width: min(100%, 16rem);
  font-weight: 700;
}

.city-selector select,
.map-toolbar input,
.map-toolbar button,
.time-difference-tool input,
.time-difference-tool select,
.time-difference-tool button {
  min-height: 2.75rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-5);
  margin-block-start: var(--space-5);
}

.dashboard-time-card {
  grid-column: span 4;
  display: grid;
  align-content: center;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}

.dashboard-time-card > p:first-child {
  margin: 0;
  color: var(--text-muted);
  font-weight: 800;
}

.dashboard-clock,
.city-page-clock {
  display: block;
  min-height: 1.3em;
  font: 800 clamp(2.15rem, 6vw, 4.8rem) / 1 var(--font-sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  direction: ltr;
}

.dashboard-time-card nav,
.city-actions,
.tool-actions,
.calendar-actions,
.converter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.dashboard-time-card nav a,
.city-actions > *,
.tool-actions > *,
.calendar-actions > button,
.converter-actions > button {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.primary-button,
.city-actions .primary-button {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.weather-panel {
  padding: clamp(var(--space-4), 2.5vw, var(--space-6));
  overflow: hidden;
}

.dashboard-grid > .weather-panel {
  grid-column: span 8;
}

.weather-current {
  padding-block-end: var(--space-4);
  border-block-end: 1px solid var(--border);
}

.weather-current p {
  margin: var(--space-2) 0 0;
}

.weather-main-temp {
  min-width: 3.5ch;
  min-height: 1em;
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.weather-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  margin: var(--space-4) 0;
}

.weather-facts > div {
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.weather-facts dt {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.weather-facts dd {
  margin: 0.2rem 0 0;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.weather-forecast {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

.forecast-day {
  display: grid;
  place-items: center;
  gap: 0.25rem;
  min-width: 0;
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  text-align: center;
}

.weather-status,
.weather-updated,
.action-status {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

[data-weather-state="stale"] {
  border-color: var(--warning);
}

[data-weather-state="error"] {
  min-height: 14rem;
}

.weather-region-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

.city-dashboard-hero,
.time-city-panel {
  min-width: 0;
  padding: clamp(var(--space-5), 4vw, var(--space-8));
}

.city-dashboard-hero > * {
  min-width: 0;
}

.city-dashboard-hero .city-actions {
  max-width: 26rem;
  justify-content: flex-end;
}

.alias-list,
.nearby-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

.alias-list li,
.nearby-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.nearby-list span {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.city-link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.city-link-grid a {
  display: grid;
  gap: 0.25rem;
  min-height: 4rem;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
}

.city-link-grid span {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.region-bashur {
  color: var(--basur-strong);
  background: var(--basur-soft);
}

.map-app {
  position: relative;
  padding: clamp(var(--space-3), 2vw, var(--space-5));
}

.map-toolbar {
  display: grid;
  gap: var(--space-2);
  margin-block-end: var(--space-3);
}

.map-toolbar > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
}

.map-region-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-block-end: var(--space-3);
}

.map-region-filters button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.map-region-filters button[aria-pressed="false"] {
  opacity: 0.55;
  text-decoration: line-through;
}

.map-stage {
  position: relative;
}

.map-canvas {
  width: 100%;
  height: clamp(28rem, 58vw, 42rem);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}

/* Leaflet renderers are positioned inside zero-sized panes; the global media
   max-width rule must not collapse their drawing surface. */
.map-canvas .leaflet-pane canvas,
.map-canvas .leaflet-pane svg {
  max-width: none;
}

.map-stage > [data-map-status] {
  position: absolute;
  inset: var(--space-3) auto auto 50%;
  z-index: 500;
  transform: translateX(-50%);
  max-width: min(90%, 36rem);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.map-city-marker-shell,
.map-cluster-shell {
  border: 0;
  background: transparent;
}

.map-city-marker {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.6rem;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--marker-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--marker-color) 45%, transparent), 0 4px 10px rgb(0 0 0 / 0.3);
}

.map-city-marker.is-selected {
  width: 1.45rem;
  height: 1.45rem;
  margin: 0.42rem;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--marker-color) 45%, transparent), 0 0 18px var(--marker-color);
}

.map-cluster {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-md);
  font-weight: 900;
}

.map-popup h3 {
  margin: var(--space-2) 0;
}

.map-popup time {
  direction: ltr;
  display: block;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.map-city-fallback {
  margin-block-start: var(--space-4);
  border-block-start: 1px solid var(--border);
  padding-block-start: var(--space-3);
}

.map-city-fallback summary {
  min-height: 2.75rem;
  cursor: pointer;
  font-weight: 800;
}

.map-city-fallback ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  max-height: 24rem;
  overflow: auto;
  padding: var(--space-2);
  list-style: none;
}

.map-city-fallback a {
  display: grid;
  min-height: 3.5rem;
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
}

.map-city-fallback a span {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.globe-app {
  min-width: 0;
  padding: var(--space-4);
}

.globe-stage {
  position: relative;
  height: clamp(24rem, 48vw, 38rem);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle, #142c52 0%, #07111f 58%, #03070e 100%);
}

.globe-stage canvas,
.globe-stage img {
  display: block;
  width: 100%;
  height: 100%;
}

.globe-stage canvas {
  touch-action: none;
}

.globe-stage img {
  object-fit: cover;
}

.globe-stage [data-globe-status] {
  position: absolute;
  inset: auto 50% var(--space-4) auto;
  z-index: 2;
  transform: translateX(50%);
  max-width: calc(100% - 2rem);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  background: rgb(3 8 18 / 0.78);
  color: #fff;
  text-align: center;
}

.globe-app > button {
  min-height: 2.75rem;
  margin-block-start: var(--space-3);
}

.time-difference-tool {
  padding: clamp(var(--space-4), 3vw, var(--space-7));
}

.time-difference-tool form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: var(--space-3);
}

.time-difference-tool label {
  display: grid;
  gap: var(--space-2);
  font-weight: 750;
}

.time-difference-output {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-block: var(--space-4);
}

.time-difference-output article {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}

.time-difference-output h2 {
  margin-block-start: 0;
}

.time-difference-output time,
.time-difference-output bdi {
  display: block;
  margin-block-start: var(--space-2);
}

.time-overlap-timeline {
  display: grid;
  grid-template-columns: repeat(24, minmax(2.25rem, 1fr));
  gap: 2px;
  overflow-x: auto;
  padding: var(--space-2);
  direction: ltr;
  list-style: none;
}

.time-overlap-timeline li {
  display: grid;
  gap: 0.2rem;
  padding: 0.45rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.time-overlap-timeline li.is-overlap {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 18%, var(--surface));
}

.timeline-key {
  display: flex;
  gap: var(--space-4);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.converter-actions > button {
  border-radius: var(--radius-md);
}

.form-error {
  min-height: 1.5em;
  color: var(--danger);
}

.calendar-actions,
.converter-actions {
  margin-block-start: var(--space-4);
}

.cal-day[aria-selected="true"] {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

@media (max-width: 67.5rem) {
  .dashboard-time-card,
  .dashboard-grid > .weather-panel {
    grid-column: span 12;
  }

  .weather-region-grid,
  .city-link-grid,
  .map-city-fallback ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .time-difference-tool form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 47.99rem) {
  .dashboard-heading,
  .weather-current,
  .city-dashboard-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .city-selector {
    width: 100%;
  }

  .weather-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weather-forecast {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .forecast-day {
    flex: 0 0 7.6rem;
    scroll-snap-align: start;
  }

  .alias-list,
  .nearby-list,
  .weather-region-grid,
  .city-link-grid,
  .map-city-fallback ul,
  .time-difference-output,
  .time-difference-tool form {
    grid-template-columns: 1fr;
  }

  .map-region-filters {
    position: sticky;
    z-index: 600;
    bottom: env(safe-area-inset-bottom, 0);
    padding: var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: var(--shadow-md);
  }

  .map-region-filters button {
    flex: 1 1 8rem;
  }

  .map-canvas {
    height: 31rem;
  }

  .globe-stage {
    height: 26rem;
  }
}

@media (max-width: 22rem) {
  .feedback-fab {
    width: 3rem;
    padding: 0;
  }

  .feedback-fab span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .home-intro,
  .seo-hero {
    padding: var(--space-4);
  }

  .home-intro-links {
    display: grid;
    width: 100%;
  }

  .home-intro-links a {
    width: 100%;
  }
}

@media (max-width: 22rem) {
  .weather-facts {
    grid-template-columns: 1fr;
  }

  .map-toolbar > div {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Phase 4 — people, books, and source-based stories
   ========================================================= */
[hidden] {
  display: none !important;
}

.lower-grid-calendar {
  grid-template-columns: minmax(0, 1fr);
}

.lower-grid-calendar .calendar-section {
  max-width: none;
}

.cultural-home {
  margin-block: var(--space-8);
  padding: clamp(var(--space-5), 3vw, var(--space-8));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: clip;
  scroll-margin-top: calc(var(--header-height) + var(--space-5));
}

.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.section-heading-row h2 {
  margin: 0;
}

.people-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(10.5rem, 12rem);
  gap: var(--space-4);
  padding: var(--space-1) var(--space-1) var(--space-4);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  scrollbar-color: var(--accent) transparent;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-5);
}

.person-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  overflow: hidden;
  scroll-snap-align: start;
  box-shadow: var(--shadow-xs);
}

.person-card-image {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--surface-muted);
}

.person-card-image img,
.person-profile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.88) contrast(1.02);
}

.person-card-image img[src*='hajar-mukriyani'] {
  object-position: left center;
}

.person-card-body {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
}

.person-card-body h3,
.person-card-body p,
.person-card-body .media-credit {
  margin: 0;
}

.person-card-body h3 {
  font-size: var(--font-size-lg);
}

.person-card-body > p {
  color: var(--text-muted);
}

.person-lifespan {
  font-variant-numeric: tabular-nums;
}

.editorial-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.editorial-pills .region-pill {
  min-height: 1.75rem;
  padding: 0.2rem 0.55rem;
  font-size: var(--font-size-xs);
}

.media-credit {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  line-height: 1.55;
}

.editorial-directory,
[data-books-directory],
[data-stories-directory] {
  display: grid;
  gap: var(--space-5);
}

.editorial-search {
  display: grid;
  gap: var(--space-2);
  max-width: 38rem;
}

.editorial-search input {
  min-height: 2.75rem;
  padding-inline: var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.filter-bar button {
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.filter-bar button[aria-pressed='true'] {
  border-color: var(--color-accent-strong);
  background: var(--color-accent-strong);
  color: var(--color-on-accent);
}

.person-profile {
  display: grid;
  grid-template-columns: minmax(15rem, 22rem) minmax(0, 1fr);
  gap: var(--space-6);
}

.person-profile > :not(.person-profile-media),
.book-profile > section,
.story-byline {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.person-profile-media {
  grid-row: span 2;
  align-self: start;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.person-profile-media img {
  display: block;
  aspect-ratio: 4 / 5;
}

.person-profile-media .media-credit {
  margin: 0;
  padding: var(--space-3);
}

.profile-facts,
.story-byline dl {
  display: grid;
  gap: var(--space-3);
  margin: 0;
}

.profile-facts div,
.story-byline dl div {
  display: grid;
  grid-template-columns: minmax(7rem, 0.35fr) minmax(0, 1fr);
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.profile-facts dt,
.story-byline dt {
  color: var(--text-muted);
  font-weight: 700;
}

.profile-facts dd,
.story-byline dd {
  margin: 0;
}

.profile-timeline {
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-timeline li {
  position: relative;
  padding-inline-start: var(--space-6);
}

.profile-timeline li::before {
  position: absolute;
  inset-inline-start: 0;
  top: 0.5rem;
  width: 0.75rem;
  height: 0.75rem;
  border: 3px solid var(--surface-raised);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  content: '';
}

.profile-timeline time {
  font-weight: 800;
}

.profile-timeline p {
  margin: var(--space-1) 0 0;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.editorial-book-card {
  display: grid;
  grid-template-columns: minmax(7rem, 0.42fr) minmax(0, 1fr);
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-xs);
}

.editorial-book-card h3,
.editorial-book-card p {
  margin-block: 0 0.45rem;
}

.editorial-book-card > div:last-child {
  min-width: 0;
}

.book-visual {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 3 / 4;
  min-height: 11rem;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 72%, #111), color-mix(in srgb, var(--accent-2) 58%, #111));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%);
}

.book-visual strong {
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.45;
}

.book-category-history {
  background: linear-gradient(145deg, #633d2f, #b5763c);
}

.book-category-culture {
  background: linear-gradient(145deg, #185f5a, #458e79);
}

.book-category-research {
  background: linear-gradient(145deg, #304b7a, #6a72a9);
}

.book-category-fiction {
  background: linear-gradient(145deg, #6f3159, #b65d68);
}

.book-category-classics {
  background: linear-gradient(145deg, #5a4123, #b38b2f);
}

.daily-book-feature {
  margin-bottom: var(--space-6);
}

.daily-book-feature .editorial-book-card {
  grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr);
  max-width: 52rem;
}

.book-profile {
  display: grid;
  grid-template-columns: minmax(13rem, 18rem) minmax(0, 1fr);
  gap: var(--space-6);
}

.book-profile > .book-visual {
  grid-row: span 2;
  min-height: 24rem;
}

.book-profile > section:last-child {
  grid-column: 1 / -1;
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.story-card {
  min-width: 0;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-xs);
}

.story-card h3,
.story-card p {
  margin-block: 0 0.65rem;
}

.story-card-featured {
  background:
    linear-gradient(125deg, color-mix(in srgb, var(--accent-soft) 70%, var(--surface-raised)), var(--surface-raised));
}

.story-meta {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.home-stories-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 0.8fr) minmax(0, 1.5fr);
  gap: var(--space-5);
}

.evergreen-guide {
  grid-column: 1 / -1;
  padding: var(--space-4);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}

.evergreen-guide > .eyebrow {
  margin-block-start: 0;
}

.story-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 0.32fr) minmax(0, 1fr);
  gap: var(--space-6);
}

.story-byline {
  align-self: start;
  position: sticky;
  top: calc(var(--header-height, 5rem) + var(--space-4));
}

.story-prose {
  max-width: 72ch;
  font-size: var(--font-size-lg);
  line-height: 1.95;
}

.story-prose h2 {
  margin-top: var(--space-8);
  scroll-margin-top: 8rem;
}

.story-layout > .related-links,
.story-layout > section {
  grid-column: 2;
}

.source-list li {
  gap: var(--space-1);
}

.source-list li span {
  display: block;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

@media (max-width: 68rem) {
  .people-grid,
  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-stories-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 48rem) {
  .section-heading-row {
    align-items: start;
    flex-direction: column;
  }

  .people-grid,
  .books-grid,
  .stories-grid,
  .person-profile,
  .book-profile,
  .story-layout {
    grid-template-columns: 1fr;
  }

  .person-profile-media,
  .book-profile > .book-visual,
  .book-profile > section:last-child,
  .story-layout > .related-links,
  .story-layout > section {
    grid-column: auto;
    grid-row: auto;
  }

  .person-profile-media {
    max-width: 24rem;
  }

  .story-byline {
    position: static;
  }

  .editorial-book-card,
  .daily-book-feature .editorial-book-card {
    grid-template-columns: minmax(6.5rem, 8rem) minmax(0, 1fr);
  }

  .book-visual {
    min-height: 10rem;
  }
}

@media (max-width: 30rem) {
  .cultural-home {
    padding-inline: var(--space-4);
  }

  .people-rail {
    grid-auto-columns: minmax(9.75rem, 74vw);
  }

  .editorial-book-card,
  .daily-book-feature .editorial-book-card {
    grid-template-columns: 1fr;
  }

  .book-visual {
    width: min(12rem, 100%);
  }

  .profile-facts div,
  .story-byline dl div {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Phase 5 — secure feedback UI
   ========================================================= */
.feedback-home,
.feedback-page-panel,
.report-error {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.feedback-home {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  margin-block: var(--space-8);
  padding: clamp(var(--space-5), 3vw, var(--space-8));
}

.feedback-home h2,
.feedback-home p {
  margin-block: 0;
}

.feedback-home .eyebrow {
  margin-block-end: var(--space-2);
}

.feedback-home .primary-link {
  flex: none;
}

.feedback-fab {
  position: fixed;
  z-index: 1190;
  inset-inline-start: calc(1rem + env(safe-area-inset-left));
  inset-block-end: calc(1rem + env(safe-area-inset-bottom));
  min-width: 3rem;
  min-height: 3rem;
  padding: var(--space-2) var(--space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border));
  border-radius: var(--radius-pill);
  background: var(--accent-2);
  color: var(--on-accent);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  font-weight: 800;
}

.feedback-fab:hover {
  filter: brightness(1.06);
}

.feedback-dialog {
  width: min(44rem, calc(100% - 2rem));
  max-width: none;
  max-height: min(52rem, calc(100dvh - 2rem));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.feedback-dialog::backdrop {
  background: rgb(5 11 22 / 68%);
  backdrop-filter: blur(0.2rem);
}

.feedback-dialog-panel {
  max-height: min(52rem, calc(100dvh - 2rem));
  padding: clamp(var(--space-5), 3vw, var(--space-8));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.feedback-dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-4);
}

.feedback-dialog-header h2,
.feedback-dialog-header p,
.feedback-dialog-panel > p {
  margin-block: 0;
}

.feedback-dialog-panel > p {
  margin-block: var(--space-2) var(--space-5);
  color: var(--text-muted);
}

.feedback-close {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--text-strong);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.feedback-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.feedback-field {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: var(--space-2);
}

.feedback-field:has(textarea),
.feedback-privacy-note,
.feedback-status,
.feedback-submit,
.feedback-turnstile {
  grid-column: 1 / -1;
}

.feedback-field label {
  color: var(--text-strong);
  font-weight: 780;
}

.feedback-field input,
.feedback-field textarea {
  width: 100%;
  min-height: 3rem;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

.feedback-field textarea {
  min-height: 9rem;
  resize: vertical;
  direction: rtl;
}

.feedback-field input[dir='ltr'] {
  text-align: left;
}

.feedback-field [aria-invalid='true'] {
  border-color: var(--color-danger);
}

.field-hint,
.field-error {
  min-height: 1.35rem;
  font-size: var(--font-size-xs);
  line-height: 1.5;
}

.field-hint {
  color: var(--text-muted);
}

.field-error,
.feedback-status.is-error {
  color: var(--color-danger);
}

.feedback-honeypot {
  position: absolute !important;
  inset-inline-start: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.feedback-privacy-note,
.feedback-status {
  margin: 0;
  font-size: var(--font-size-sm);
}

.feedback-privacy-note {
  color: var(--text-muted);
}

.feedback-privacy-note a {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.feedback-status {
  min-height: 1.75rem;
  font-weight: 700;
}

.feedback-status.is-success {
  color: var(--success);
}

.feedback-success-toast {
  position: fixed;
  z-index: 1200;
  inset-inline: max(var(--space-4), env(safe-area-inset-right)) auto;
  inset-block-end: max(var(--space-4), env(safe-area-inset-bottom));
  max-width: min(28rem, calc(100vw - var(--space-6)));
  padding: var(--space-4);
  border: 1px solid color-mix(in srgb, var(--success) 45%, var(--border));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 90%, #dff5e7);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.feedback-success-toast p { margin: 0 0 var(--space-3); }
.feedback-success-toast button { min-height: 2.35rem; padding-inline: var(--space-3); }

.feedback-submit {
  min-height: 3rem;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--accent-2);
  color: var(--on-accent);
  cursor: pointer;
  font-weight: 820;
}

.feedback-submit:disabled {
  cursor: wait;
  opacity: 0.7;
}

.feedback-page-panel {
  max-width: 50rem;
  margin-inline: auto;
  padding: clamp(var(--space-5), 3vw, var(--space-8));
}

.feedback-page-panel h2 {
  margin-block-start: 0;
}

.feedback-turnstile {
  min-height: 4.1rem;
}

.feedback-turnstile[hidden] {
  min-height: 0;
}

.report-error {
  margin-block-start: var(--space-8);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.report-error p {
  margin: 0;
}

.report-error a {
  flex: none;
  color: var(--accent-2);
  font-weight: 780;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

body.feedback-open {
  overflow: hidden;
}

@media (max-width: 47.99rem) {
  .feedback-home,
  .report-error {
    align-items: stretch;
    flex-direction: column;
  }

  .feedback-home .primary-link {
    width: 100%;
    justify-content: center;
  }

  .feedback-fab {
    min-width: 2.9rem;
    padding-inline: var(--space-3);
  }

  .feedback-dialog {
    width: 100%;
    max-height: min(90dvh, 50rem);
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .feedback-dialog-panel {
    max-height: min(90dvh, 50rem);
    padding-block-end: calc(var(--space-8) + env(safe-area-inset-bottom));
  }

  .feedback-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .feedback-field,
  .feedback-privacy-note,
  .feedback-status,
  .feedback-submit,
  .feedback-turnstile {
    grid-column: 1;
  }
}

/* =========================================================
   Phase 8 — production refinement
   ========================================================= */
:root {
  --container-main: 96rem;
  --phase8-gold: #d4a51f;
  --phase8-gold-soft: color-mix(in srgb, var(--phase8-gold) 18%, transparent);
  --phase8-red: #8d2f3b;
  --phase8-green: #176b52;
}

.header .container,
.footer .container {
  width: min(96rem, calc(100% - (2 * var(--container-gutter))));
}

.header {
  isolation: isolate;
}

.header-inner {
  min-height: 4.75rem;
}

.primary-navigation {
  position: relative;
  min-width: 0;
}

.mobile-navigation-drawer {
  display: none;
}

.primary-navigation .pill[aria-current='page'] {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--text-strong);
}

.nav-more-trigger {
  border-color: var(--border);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
}

.nav-more-panel {
  position: absolute;
  inset-block-start: calc(100% + 0.55rem);
  inset-inline-end: 0;
  z-index: 20;
  width: min(20rem, calc(100vw - 2rem));
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.nav-more-panel a {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  padding-inline: 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text);
  font-weight: 750;
}

.nav-more-panel a:hover,
.nav-more-panel a:focus-visible {
  background: var(--surface-muted);
  color: var(--text-strong);
}

@media (min-width: 62rem) {
  .header-inner {
    display: grid;
    grid-template-columns: minmax(11rem, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(0.5rem, 1.25vw, 1.3rem);
    padding-block: 0.55rem;
  }

  .header-top {
    display: contents;
  }

  .brand {
    grid-column: 1;
  }

  .primary-navigation {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    flex-wrap: nowrap;
    justify-content: center;
    gap: clamp(0.2rem, 0.55vw, 0.55rem);
  }

  html.js .header .primary-navigation {
    display: flex;
  }

  .desktop-navigation-links {
    display: contents;
  }

  .primary-navigation .pill {
    min-height: 2.55rem;
    padding-inline: clamp(0.55rem, 0.8vw, 0.9rem);
    white-space: nowrap;
  }

  .header-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .menu-toggle {
    display: none !important;
  }

  .tagline {
    display: none;
  }
}

@media (min-width: 90rem) {
  .nav-more-trigger {
    display: none;
  }

  .nav-more-panel {
    position: static;
    display: contents;
  }

  .nav-more-panel a {
    min-height: 2.55rem;
    padding-inline: 0.72rem;
    border-radius: var(--radius-pill);
    color: var(--color-muted);
    font-size: 0.82rem;
  }
}

@media (min-width: 62rem) and (max-width: 89.99rem) {
  .brand-sub,
  .command-trigger kbd,
  .command-trigger > span:not(:first-child),
  .theme-toggle #theme-label {
    display: none;
  }

  .brand-title {
    font-size: 0.94rem;
  }

  .command-trigger,
  .theme-toggle {
    width: 2.75rem;
    padding: 0;
    justify-content: center;
  }
}

@media (max-width: 61.99rem) {
  body.navigation-open {
    overflow: hidden;
  }

  .header-inner {
    gap: 0;
    padding-block: 0.5rem;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }

  .primary-navigation {
    position: fixed;
    z-index: 200;
    inset: 0;
    display: none;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    padding: 0;
    border-radius: 0;
    background: color-mix(in srgb, var(--surface-raised) 92%, transparent);
    backdrop-filter: blur(12px);
  }

  html.js .header .primary-navigation[data-open='true'] {
    display: block;
    grid-template-columns: none;
    padding: 0;
  }

  .desktop-navigation-links {
    display: none;
  }

  .mobile-navigation-drawer {
    display: block;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  }

  .mobile-navigation-panel {
    width: min(100%, 39rem);
    min-height: 100%;
    margin-inline: auto;
    padding: clamp(0.9rem, 4vw, 1.5rem);
    border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
    border-radius: clamp(1.25rem, 5vw, 2rem);
    background:
      radial-gradient(circle at 90% 0%, var(--phase8-gold-soft), transparent 34%),
      var(--surface-raised);
    box-shadow: var(--shadow-lg);
  }

  .mobile-navigation-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .mobile-navigation-home {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-strong);
  }

  .mobile-navigation-home img {
    width: 2.8rem;
    height: 1.9rem;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    object-fit: cover;
  }

  .mobile-navigation-home span {
    display: grid;
    gap: 0.1rem;
  }

  .mobile-navigation-home strong {
    font-size: 1rem;
  }

  .mobile-navigation-home small {
    color: var(--text-muted);
    font-size: 0.77rem;
  }

  .mobile-navigation-close {
    display: inline-grid;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-strong);
    cursor: pointer;
    font: inherit;
    font-size: 1.65rem;
    line-height: 1;
  }

  .mobile-navigation-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    padding-block: 1rem;
  }

  .mobile-navigation-actions :is(a, button) {
    display: inline-flex;
    min-height: 3rem;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-strong);
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    text-align: center;
  }

  .mobile-navigation-actions :is(a, button):first-child {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  }

  .mobile-navigation-group {
    padding-block: 0.9rem;
    border-top: 1px solid var(--border);
  }

  .mobile-navigation-group h2 {
    margin: 0 0 0.6rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 800;
  }

  .mobile-navigation-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .mobile-navigation-links a {
    display: flex;
    min-height: 3.25rem;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 780;
  }

  .mobile-navigation-links a > span {
    display: inline-grid;
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 0.45rem;
    background: var(--surface-muted);
    color: var(--accent);
  }

  .mobile-navigation-links a[aria-current='page'] {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    color: var(--text-strong);
  }

  .mobile-navigation-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
  }

  .mobile-navigation-footer-links a {
    min-height: 2.75rem;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 700;
  }

  .mobile-navigation-panel :is(a, button):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 58%, transparent);
    outline-offset: 2px;
  }
}

@media (max-width: 36rem) {
  .brand-title {
    font-size: 0.88rem;
  }

  .brand-sub,
  .command-trigger kbd,
  .command-trigger > span:nth-child(2),
  .theme-toggle #theme-label,
  .menu-toggle > span:last-child {
    display: none;
  }

  .command-trigger,
  .theme-toggle,
  .menu-toggle {
    width: 2.65rem;
    padding-inline: 0;
    justify-content: center;
  }
}

/* Shared digital and analog clocks */
.timekrd-clock {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
  padding: clamp(var(--space-4), 3vw, var(--space-7));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 90% 5%, var(--phase8-gold-soft), transparent 34%),
    var(--surface-raised);
  box-shadow: var(--shadow-md);
}

.dashboard-grid > .timekrd-clock {
  grid-column: span 4;
  overflow: hidden;
}

.dashboard-grid > .timekrd-clock .timekrd-clock-heading {
  display: grid;
}

.timekrd-clock-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.timekrd-clock-heading h2,
.timekrd-clock-heading h3,
.timekrd-clock-heading p,
.timekrd-clock > p {
  margin: 0;
}

.segmented-control,
.hour-cycle-control {
  display: inline-flex;
  width: fit-content;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
}

.segmented-control button,
.hour-cycle-control button {
  min-height: 2.2rem;
  padding-inline: 0.75rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 750;
  cursor: pointer;
}

.segmented-control button[aria-pressed='true'],
.hour-cycle-control button[aria-pressed='true'] {
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--text-strong);
}

.timekrd-clock[data-clock-mode='digital'] [data-clock-view='analog'],
.timekrd-clock[data-clock-mode='analog'] [data-clock-view='digital'] {
  display: none;
}

.timekrd-clock-digital {
  min-height: clamp(4.5rem, 9vw, 7.2rem);
  display: grid;
  place-items: center;
}

.timekrd-clock .dashboard-clock {
  color: var(--text-strong);
  font-size: clamp(2.7rem, 5vw, 4.6rem);
}

.timekrd-clock-analog {
  width: min(100%, 19rem);
  margin-inline: auto;
}

.timekrd-clock-analog svg {
  display: block;
  width: 100%;
  filter: drop-shadow(0 0.5rem 1.4rem rgb(16 25 40 / 0.14));
}

.clock-dial {
  fill: var(--surface);
  stroke: var(--phase8-gold);
  stroke-width: 2;
}

.clock-sun,
.clock-ticks {
  fill: none;
  stroke: color-mix(in srgb, var(--phase8-gold) 78%, var(--text));
  stroke-linecap: round;
  stroke-width: 1.7;
}

.clock-hand {
  stroke: var(--text-strong);
  stroke-linecap: round;
}

.clock-hand-hour {
  stroke-width: 4;
}

.clock-hand-minute {
  stroke-width: 2.7;
}

.clock-hand-second {
  stroke: var(--phase8-red);
  stroke-width: 1.3;
}

.clock-pin {
  fill: var(--phase8-gold);
}

.clock-meta {
  min-height: 1.5em;
  color: var(--text-muted);
}

.dashboard-clock-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.dashboard-clock-links a {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-strong);
  font-size: var(--text-sm);
  font-weight: 750;
}

.clock-region-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.timekrd-clock-compact {
  padding: var(--space-4);
}

.timekrd-clock-compact .timekrd-clock-heading {
  display: grid;
}

.timekrd-clock-compact .dashboard-clock {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
}

.timekrd-clock-compact .timekrd-clock-digital {
  min-height: 4rem;
}

.timekrd-clock-compact .segmented-control button,
.timekrd-clock-compact .hour-cycle-control button {
  padding-inline: 0.55rem;
  font-size: 0.72rem;
}

@media (max-width: 68rem) {
  .dashboard-grid > .timekrd-clock {
    grid-column: span 12;
  }

  .clock-region-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 40rem) {
  .clock-region-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .timekrd-clock-heading {
    display: grid;
  }
}

/* Stable weather presentation */
.weather-condition {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.weather-icon-shell {
  display: inline-grid;
  width: clamp(3.6rem, 8vw, 6rem);
  height: clamp(3.6rem, 8vw, 6rem);
  flex: none;
  place-items: center;
}

.weather-condition-icon,
.weather-forecast-icon {
  width: clamp(3.6rem, 8vw, 6rem);
  height: clamp(3.6rem, 8vw, 6rem);
  flex: none;
  object-fit: contain;
  animation: weather-float 5s ease-in-out infinite;
}

.forecast-day .weather-forecast-icon {
  width: 2.4rem;
  height: 2.4rem;
}

.weather-date {
  min-height: 1.6em;
  color: var(--text-muted);
  font-weight: 700;
}

.weather-panel[aria-busy='true'] {
  min-height: 24rem;
}

.weather-region-grid .weather-panel {
  min-width: 0;
}

/* Phase 8.7 — Kurdistan weather intelligence */
.weather-intelligence {
  display: grid;
  gap: var(--space-6);
  margin-block: var(--space-7);
}

.weather-intelligence-section,
.weather-intelligence-method,
.weather-advisories {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-block-end: var(--space-4);
}

.section-heading > * { margin: 0; }
.section-heading > p { max-width: 38rem; color: var(--text-muted); font-size: var(--text-sm); }

.weather-extremes-grid,
.weather-region-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.weather-intelligence-card,
.weather-insight-card,
.weather-region-summary,
.weather-intelligence-method,
.weather-temperature-map,
.weather-map-city-fallback,
.weather-advisories {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.weather-intelligence-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 15.5rem;
  padding: clamp(var(--space-4), 3vw, var(--space-6));
  overflow: hidden;
}

.weather-intelligence-card.is-warm { border-color: color-mix(in srgb, #c98727 38%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, #fff7df 72%, var(--surface)), var(--surface)); }
.weather-intelligence-card.is-cool { border-color: color-mix(in srgb, #377ea9 38%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, #e5f3fa 66%, var(--surface)), var(--surface)); }
[data-theme='dark'] .weather-intelligence-card.is-warm { background: linear-gradient(135deg, #342715, var(--surface)); }
[data-theme='dark'] .weather-intelligence-card.is-cool { background: linear-gradient(135deg, #132938, var(--surface)); }

.weather-intelligence-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.weather-card-kicker { margin: 0 0 var(--space-1); color: var(--text-muted); font-size: var(--text-sm); font-weight: 800; }
.weather-intelligence-card h3, .weather-insight-card h3, .weather-region-summary h3 { margin: 0; font-size: var(--text-xl); }
.weather-intelligence-card h3 a, .weather-insight-card h3 a, .weather-region-summary a { color: inherit; text-decoration: none; }
.weather-intelligence-card h3 a:hover, .weather-insight-card h3 a:hover, .weather-region-summary a:hover { text-decoration: underline; }
.weather-card-region, .weather-card-condition { margin: var(--space-1) 0 0; color: var(--text-muted); }
.weather-intelligence-icon { width: 4rem; height: 4rem; object-fit: contain; flex: none; }
.weather-extreme-metric { margin: var(--space-4) 0 0; color: var(--text-muted); font-size: var(--text-sm); font-weight: 700; }
.weather-intelligence-value { display: block; margin-block: var(--space-2); direction: ltr; text-align: right; }
.weather-temperature-value { display: inline-flex; align-items: flex-start; gap: 0.14em; direction: ltr; font-variant-numeric: tabular-nums; unicode-bidi: isolate; white-space: nowrap; }
.weather-temperature-number { font-size: clamp(2.2rem, 5vw, 3.65rem); font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.weather-temperature-unit { display: inline-flex; gap: 0.015em; margin-block-start: 0.15em; color: var(--text-muted); font-family: Arial, sans-serif; font-size: clamp(1.2rem, 2.7vw, 2rem); font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.weather-temperature-value.is-compact { gap: 0.1em; }
.weather-temperature-value.is-compact .weather-temperature-number { font-size: 1rem; letter-spacing: -0.02em; }
.weather-temperature-value.is-compact .weather-temperature-unit { margin-block-start: 0.1em; font-size: 0.72em; }
.weather-intelligence-card footer { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-block-start: var(--space-3); color: var(--text-muted); font-size: var(--text-sm); }
.weather-intelligence-empty { align-content: center; }

.weather-intelligence-skeleton { position: relative; min-height: 15.5rem; overflow: hidden; background: var(--surface-muted); }
.weather-intelligence-skeleton > span { display: block; width: 62%; height: 1rem; margin-block: var(--space-3); border-radius: var(--radius-pill); background: color-mix(in srgb, var(--border) 72%, transparent); }
.weather-intelligence-skeleton > span:nth-child(2) { width: 42%; height: 3rem; }
.weather-intelligence-skeleton > span:nth-child(3) { width: 80%; }
.weather-intelligence-skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, #fff 35%, transparent), transparent); animation: weather-overview-shimmer 1.8s infinite; }
@keyframes weather-overview-shimmer { to { transform: translateX(-100%); } }

.weather-advisories { padding: var(--space-4); border-inline-start: 4px solid var(--accent); }
.weather-advisories-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.weather-advisories h2 { margin: 0 0 var(--space-3); font-size: var(--text-lg); }
.weather-advisories-heading .eyebrow { margin: 0 0 0.2rem; }
.weather-advisory-dismiss { display: grid; width: 2.5rem; height: 2.5rem; flex: none; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text); font-size: 1.55rem; line-height: 1; }
.weather-advisory-restore { display: inline-flex; min-height: 2.75rem; align-items: center; justify-content: center; gap: 0.5rem; margin-block-end: var(--space-4); padding: 0.5rem 0.8rem; border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border)); border-radius: var(--radius-pill); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); box-shadow: var(--shadow-sm); color: var(--text); font: inherit; font-size: var(--text-sm); font-weight: 800; cursor: pointer; touch-action: manipulation; }
.weather-advisory-restore svg { width: 1.15rem; height: 1.15rem; flex: none; fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.weather-advisory-restore:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }.weather-advisory-restore:active { transform: translateY(1px); }.weather-advisory-restore:focus-visible, .weather-map-fullscreen:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 72%, transparent); outline-offset: 3px; }
.weather-advisory { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface-muted); }
.weather-advisory + .weather-advisory { margin-block-start: var(--space-2); }
.weather-advisory-icon { display: grid; width: 1.8rem; height: 1.8rem; flex: none; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 900; }
.weather-advisory.severity-high .weather-advisory-icon { background: #a64a2f; }
.weather-advisory.severity-important .weather-advisory-icon { background: #a77818; }
.weather-advisory p { margin: 0; }
.weather-advisory p + p { margin-block-start: 0.25rem; color: var(--text-muted); }
.weather-advisory-level { margin-inline-start: var(--space-2); color: var(--text-muted); font-size: var(--text-sm); font-weight: 700; }

.weather-temperature-map { position: relative; overflow: hidden; padding: var(--space-3); }
.weather-temperature-map-canvas { height: clamp(23rem, 55vw, 37rem); border-radius: calc(var(--radius-lg) - var(--space-2)); background: var(--surface-muted); }
.weather-map-fullscreen-control { margin-top: 0.65rem; overflow: hidden; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.weather-map-fullscreen { display: grid; width: 2.75rem; height: 2.75rem; place-items: center; border: 0; border-radius: 0; background: color-mix(in srgb, var(--surface) 94%, transparent); color: var(--text); cursor: pointer; touch-action: manipulation; }
.weather-map-fullscreen svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.weather-map-fullscreen:hover { border-color: var(--accent); color: var(--accent); }.weather-map-fullscreen:active { transform: translateY(1px); }
.weather-map-skeleton { position: absolute; inset: var(--space-3); z-index: 800; display: grid; place-content: center; gap: 1rem; overflow: hidden; border-radius: calc(var(--radius-lg) - var(--space-2)); background: linear-gradient(135deg, color-mix(in srgb, var(--surface-muted) 90%, #e5b82b 10%), var(--surface-muted)); }
.weather-map-skeleton span { display: block; width: min(52vw, 24rem); height: 0.8rem; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--border) 75%, transparent); }
.weather-map-skeleton span:nth-child(2) { width: min(34vw, 15rem); }.weather-map-skeleton span:nth-child(3) { width: min(44vw, 20rem); }
.weather-map-skeleton::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.28), transparent); animation: weather-overview-shimmer 1.8s infinite; }
.weather-map-layer-note { margin: var(--space-2) 0 0; color: var(--text-muted); font-size: var(--text-sm); }
[data-weather-map-state='fallback'] .weather-temperature-map-canvas { height: 8rem; opacity: 0.55; }
.weather-map-status { min-height: 1.5em; margin: var(--space-2) 0 0; color: var(--text-muted); font-size: var(--text-sm); }
.weather-temperature-legend { display: inline-flex; align-items: center; gap: var(--space-2); margin-block-start: var(--space-2); padding: 0.35rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-pill); background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--text-muted); font-size: var(--text-sm); }
.weather-temperature-legend i { width: 5.5rem; height: 0.55rem; border-radius: var(--radius-pill); background: linear-gradient(90deg, hsl(210 56% 43%), hsl(35 56% 47%)); }
.weather-temperature-marker-shell { background: transparent; border: 0; }
.weather-temperature-marker { display: grid; width: 3rem; height: 3rem; place-items: center; border: 3px solid var(--surface); border-radius: 50%; background: var(--temperature-color); box-shadow: 0 3px 10px rgb(0 0 0 / 0.28); color: #fff; direction: ltr; font-size: 0.86rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.weather-temperature-marker.is-cluster { border-radius: var(--radius-md); }
.weather-temperature-map .leaflet-control-attribution a { color: #005f86; text-decoration: underline; text-decoration-thickness: 1px; }
[data-theme='dark'] .weather-temperature-map .leaflet-control-attribution a { color: #8ed5ef; }
.weather-map-popup > div { display: flex; gap: var(--space-2); align-items: center; }
.weather-map-popup h3, .weather-map-popup p { margin: 0; }
.weather-map-popup p { color: var(--text-muted); }
.weather-map-popup-icon { width: 3rem; height: 3rem; object-fit: contain; }
.weather-map-popup dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.25rem; margin: var(--space-3) 0; }
.weather-map-popup dl div { padding: 0.35rem; border-radius: 0.4rem; background: var(--surface-muted); }
.weather-map-popup dt { color: var(--text-muted); font-size: 0.72rem; }.weather-map-popup dd { margin: 0.2rem 0 0; direction: ltr; font-weight: 800; }
.weather-map-popup dd .weather-temperature-value { vertical-align: top; }
.weather-map-city-fallback { margin-block-start: var(--space-3); padding: var(--space-3); }
.weather-map-city-fallback summary { cursor: pointer; font-weight: 800; }
.weather-map-city-fallback ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin: var(--space-3) 0 0; padding: 0; list-style: none; }
.weather-map-city-fallback a { display: grid; gap: 0.2rem; min-height: 3.5rem; padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-md); color: inherit; text-decoration: none; }.weather-map-city-fallback a span { color: var(--text-muted); font-size: var(--text-sm); direction: ltr; text-align: right; }

.weather-insight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.weather-insight-card { display: flex; min-height: 10rem; gap: var(--space-3); padding: var(--space-4); }.weather-insight-icon { width: 3.1rem; height: 3.1rem; flex: none; fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }.weather-insight-card.is-rain .weather-insight-icon { stroke: #367aa1; }.weather-insight-card.is-wind .weather-insight-icon { stroke: #537f7b; }.weather-insight-card.is-range .weather-insight-icon { stroke: #ad7b17; }.weather-insight-card strong { display: block; margin-block: var(--space-2); font-size: var(--text-xl); direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }.weather-insight-card p:last-child { margin: 0; color: var(--text-muted); font-size: var(--text-sm); }
.weather-region-summary { min-height: 15rem; padding: var(--space-4); border-inline-start: 4px solid var(--accent); }.weather-region-summary.region-rojhilat { border-color: #d55252; }.weather-region-summary.region-bashur { border-color: #d59116; }.weather-region-summary.region-bakur { border-color: #2376ba; }.weather-region-summary.region-rojava { border-color: #2d9b60; }.weather-region-summary dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); margin: var(--space-4) 0; }.weather-region-summary dl div { padding: var(--space-2); border-radius: var(--radius-md); background: var(--surface-muted); }.weather-region-summary dt { color: var(--text-muted); font-size: var(--text-sm); }.weather-region-summary dd { margin: 0.2rem 0 0; font-weight: 800; }.weather-region-summary > p { margin: 0; color: var(--text-muted); }.weather-region-summary small { display: block; margin-block-start: var(--space-2); color: var(--text-muted); }
.weather-intelligence-method { padding: var(--space-5); }.weather-intelligence-method h2 { margin: 0 0 var(--space-2); }.weather-intelligence-method p { color: var(--text-muted); }.weather-intelligence-method button { margin-block-start: var(--space-2); }
.weather-city-explorer { padding: clamp(var(--space-4), 3vw, var(--space-6)); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.weather-city-explorer-controls { display: grid; grid-template-columns: minmax(13rem, 2fr) minmax(10rem, 1fr) minmax(10rem, 1fr) auto; gap: var(--space-3); align-items: end; margin-block: var(--space-4); }
.weather-city-explorer-controls label { display: grid; gap: 0.35rem; color: var(--text-muted); font-size: var(--text-sm); font-weight: 800; }.weather-city-explorer-controls input, .weather-city-explorer-controls select { min-height: 2.8rem; width: 100%; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); padding-inline: 0.7rem; font: inherit; }
.weather-city-explorer-controls button { min-height: 2.8rem; white-space: nowrap; }
.weather-city-explorer-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.weather-city-explorer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; min-height: 8.5rem; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-muted); }
.weather-city-explorer-row > div { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }.weather-city-explorer-icon { width: 2.7rem; height: 2.7rem; flex: none; }.weather-city-explorer-row h3, .weather-city-explorer-row p { margin: 0; }.weather-city-explorer-row h3 a { color: inherit; text-decoration: none; }.weather-city-explorer-row p, .weather-city-explorer-row small { color: var(--text-muted); font-size: var(--text-sm); }.weather-city-explorer-row dl { display: grid; grid-template-columns: repeat(2, minmax(3.8rem, 1fr)); gap: 0.25rem; margin: 0; }.weather-city-explorer-row dl div { padding: 0.2rem; text-align: center; }.weather-city-explorer-row dt { color: var(--text-muted); font-size: 0.7rem; }.weather-city-explorer-row dd { margin: 0.1rem 0 0; direction: ltr; font-size: var(--text-sm); font-weight: 800; font-variant-numeric: tabular-nums; }.weather-city-explorer-row small { grid-column: 1 / -1; }.weather-city-explorer-empty { margin: 0; padding: var(--space-4); border: 1px dashed var(--border); border-radius: var(--radius-md); color: var(--text-muted); }
[data-weather-intelligence-state='stale'] .weather-intelligence-card { outline: 1px dashed var(--warning); outline-offset: -0.4rem; }

body.weather-map-fullscreen-lock { overflow: hidden; overscroll-behavior: none; }
.weather-temperature-map:fullscreen, .weather-temperature-map.is-css-fullscreen { position: fixed; inset: 0; z-index: 5000; box-sizing: border-box; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: var(--space-2); width: 100vw; height: 100dvh; min-height: 100dvh; padding: max(0.8rem, env(safe-area-inset-top)) max(0.8rem, env(safe-area-inset-right)) max(0.8rem, env(safe-area-inset-bottom)) max(0.8rem, env(safe-area-inset-left)); overflow: hidden; border: 0; border-radius: 0; background: var(--surface); }
.weather-temperature-map:fullscreen .weather-temperature-map-canvas, .weather-temperature-map.is-css-fullscreen .weather-temperature-map-canvas { height: 100%; min-height: 0; border-radius: var(--radius-md); }
.weather-temperature-map:fullscreen .weather-map-fullscreen-control, .weather-temperature-map.is-css-fullscreen .weather-map-fullscreen-control { margin-top: 0.65rem; }
.weather-temperature-map:fullscreen .weather-map-status, .weather-temperature-map.is-css-fullscreen .weather-map-status { margin: 0; }.weather-temperature-map:fullscreen .weather-temperature-legend, .weather-temperature-map.is-css-fullscreen .weather-temperature-legend { margin: 0; justify-self: start; }

@media (max-width: 67.5rem) { .weather-insight-grid { grid-template-columns: 1fr; }.weather-map-city-fallback ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }.weather-city-explorer-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }.weather-city-explorer-list { grid-template-columns: 1fr; } }
@media (max-width: 47.99rem) { .section-heading { align-items: flex-start; flex-direction: column; }.weather-extremes-grid, .weather-region-summary-grid, .weather-map-city-fallback ul { grid-template-columns: 1fr; }.weather-temperature-map-canvas { height: 25rem; }.weather-advisory-level { display: block; margin: 0.2rem 0 0; }.weather-region-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }.weather-city-explorer-controls { grid-template-columns: 1fr; }.weather-city-explorer-controls button { width: 100%; }.weather-city-explorer-row { grid-template-columns: 1fr; }.weather-city-explorer-row dl { grid-template-columns: repeat(4, minmax(0, 1fr)); }.weather-map-skeleton span { width: min(70vw, 20rem); }.weather-temperature-map:fullscreen, .weather-temperature-map.is-css-fullscreen { gap: 0.45rem; }.weather-temperature-map:fullscreen .weather-temperature-legend, .weather-temperature-map.is-css-fullscreen .weather-temperature-legend { max-width: calc(100vw - 1.6rem); font-size: 0.75rem; } }
@media (prefers-reduced-motion: reduce) { .weather-intelligence-skeleton::after, .weather-condition-icon, .weather-forecast-icon { animation: none; } }

@keyframes weather-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-0.2rem);
  }
}

/* Accessible searchable selects */
.native-select-fallback {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.timekrd-combobox {
  position: relative;
  min-width: 0;
}

.timekrd-combobox > input {
  width: 100%;
  min-height: 2.75rem;
  padding-inline: 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.timekrd-combobox-list {
  position: absolute;
  inset-block-start: calc(100% + 0.3rem);
  inset-inline: 0;
  z-index: 50;
  max-height: 19rem;
  overflow-y: auto;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.timekrd-combobox-option {
  display: grid;
  width: 100%;
  min-height: 2.65rem;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.timekrd-combobox-option small {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 650;
  text-align: start;
}

.timekrd-combobox-option:hover,
.timekrd-combobox-option.is-active,
.timekrd-combobox-option.is-selected {
  background: var(--surface-muted);
}

.timekrd-combobox-group + .timekrd-combobox-group {
  margin-block-start: 0.35rem;
  padding-block-start: 0.35rem;
  border-block-start: 1px solid var(--border);
}

.timekrd-combobox-group-label {
  position: sticky;
  inset-block-start: -0.35rem;
  z-index: 1;
  margin: 0;
  padding: 0.55rem 0.7rem 0.35rem;
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.city-selector small {
  display: block;
  margin-block-start: 0.3rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.selector-helper {
  margin-block: 0.45rem 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

/* City refinements */
.city-page > section {
  min-width: 0;
}

.city-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 36rem);
}

.city-actions > * {
  width: 100%;
  min-height: 3.5rem;
  gap: 0.45rem;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-md);
  white-space: normal;
  line-height: 1.45;
}

.city-dashboard-hero .city-actions {
  max-width: 36rem;
  align-items: stretch;
  justify-content: stretch;
}

.city-actions > :nth-child(1) .city-action-icon { color: var(--color-on-accent); }
.city-actions > :nth-child(2) .city-action-icon { color: var(--bakur); }
.city-actions > :nth-child(3) .city-action-icon { color: var(--kurd-gold-ink); }
.city-actions > :nth-child(4) .city-action-icon { color: var(--rojava); }
.city-actions > :nth-child(5) .city-action-icon { color: var(--basur); }
.city-actions > :nth-child(6) .city-action-icon { color: #7c3aed; }

.city-actions .city-map-action {
  border-color: color-mix(in srgb, var(--kurd-gold) 55%, var(--border));
  background: color-mix(in srgb, var(--kurd-gold) 8%, var(--surface));
}

.city-action-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.city-page-naqadeh {
  --accent: var(--phase8-red);
  --accent-2: var(--phase8-gold);
}

.city-page-naqadeh .city-dashboard-hero {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--phase8-gold) 55%, var(--border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--phase8-red) 16%, transparent), transparent 58%),
    var(--surface-raised);
}

.city-page-naqadeh .city-dashboard-hero::after {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(30deg, transparent 44%, color-mix(in srgb, var(--phase8-gold) 18%, transparent) 45% 48%, transparent 49%),
    linear-gradient(150deg, transparent 44%, color-mix(in srgb, var(--phase8-red) 12%, transparent) 45% 48%, transparent 49%);
  background-size: 3rem 3rem;
  content: '';
  pointer-events: none;
}

.city-page-naqadeh .city-dashboard-hero > * {
  position: relative;
  z-index: 1;
}

.city-editorial-links {
  border-inline-start: 0.3rem solid var(--phase8-gold);
}

@media (max-width: 47.99rem) {
  .city-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
}

/* Map emphasis and legibility */
.map-layer-note {
  padding: var(--space-3) var(--space-4);
  border-inline-start: 0.22rem solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--text-muted);
}

.map-editorial-note {
  margin: var(--space-3) 0 var(--space-4);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: 1.8;
  text-align: start;
}

.map-fullscreen-control {
  margin-top: 0.65rem;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.map-fullscreen {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
}

.map-fullscreen svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.map-fullscreen:hover { color: var(--accent); }
.map-fullscreen:active { transform: translateY(1px); }
.map-fullscreen:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 72%, transparent);
  outline-offset: 3px;
}

body.map-fullscreen-lock { overflow: hidden; overscroll-behavior: none; }

.map-app:fullscreen,
.map-app.is-css-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 5000;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: var(--space-2);
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  padding: max(0.8rem, env(safe-area-inset-top)) max(0.8rem, env(safe-area-inset-right)) max(0.8rem, env(safe-area-inset-bottom)) max(0.8rem, env(safe-area-inset-left));
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--surface);
}

.map-app:fullscreen .map-toolbar,
.map-app.is-css-fullscreen .map-toolbar,
.map-app:fullscreen .map-region-filters,
.map-app.is-css-fullscreen .map-region-filters { margin: 0; }

.map-app:fullscreen .map-region-filters,
.map-app.is-css-fullscreen .map-region-filters { overflow: auto hidden; white-space: nowrap; }

.map-app:fullscreen .map-stage,
.map-app.is-css-fullscreen .map-stage {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.map-app:fullscreen .map-canvas,
.map-app.is-css-fullscreen .map-canvas {
  height: auto;
  min-height: 0;
  flex: 1 1 auto;
  border-radius: var(--radius-md);
}

.map-app:fullscreen .map-city-fallback,
.map-app:fullscreen .map-editorial-note,
.map-app:fullscreen .map-layer-note,
.map-app.is-css-fullscreen .map-city-fallback,
.map-app.is-css-fullscreen .map-editorial-note,
.map-app.is-css-fullscreen .map-layer-note { display: none; }

@media (max-width: 47.99rem) {
  .map-app:fullscreen,
  .map-app.is-css-fullscreen { gap: 0.45rem; }
  .map-app:fullscreen .map-toolbar label,
  .map-app.is-css-fullscreen .map-toolbar label { display: none; }
  .map-app:fullscreen .map-toolbar > div,
  .map-app.is-css-fullscreen .map-toolbar > div { grid-template-columns: minmax(0, 1fr) auto; }
}

.map-cluster {
  position: relative;
  width: 3.25rem;
  height: 3.25rem;
  border-width: 4px;
  background: color-mix(in srgb, var(--surface) 92%, var(--accent));
  color: var(--text-strong);
  box-shadow:
    0 0 0 2px var(--phase8-gold),
    0 0.55rem 1.2rem rgb(14 23 39 / 0.28);
}

.map-cluster b {
  position: relative;
  z-index: 2;
}

.map-cluster-regions {
  position: absolute;
  inset: 0.22rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.12rem;
  pointer-events: none;
}

.map-cluster-regions i {
  width: 0.43rem;
  height: 0.43rem;
  border-radius: 50%;
  background: var(--cluster-region);
}

.map-city-label,
.map-cluster-label {
  border: 1px solid var(--border) !important;
  background: var(--surface-raised) !important;
  box-shadow: var(--shadow-xs) !important;
  color: var(--text-strong) !important;
  font-family: var(--font-sans);
  font-weight: 750;
}

.map-city-label::before,
.map-cluster-label::before {
  display: none;
}

/* Editorial hierarchy */
.archive-cta {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-strong);
  box-shadow: var(--shadow-xs);
  font-weight: 800;
}

.archive-cta:hover,
.archive-cta:focus-visible {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}

.editorial-book-card {
  display: block;
  padding: 0;
  overflow: hidden;
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.editorial-book-card:hover,
.editorial-book-card:focus-within {
  transform: translateY(-0.18rem);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: var(--shadow-md);
}

.book-card-link {
  display: grid;
  grid-template-columns: minmax(7.4rem, 0.42fr) minmax(0, 1fr);
  gap: var(--space-4);
  min-height: 100%;
  padding: var(--space-4);
  color: inherit;
  text-decoration: none;
}

.book-card-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.book-card-copy h3,
.book-card-copy p {
  margin-block: 0 0.55rem;
}

.book-card-copy [data-book-reason] {
  flex: 1;
}

.book-card-affordance {
  margin-block-start: auto;
  color: var(--accent);
  font-weight: 800;
}

.book-category-academic {
  background: linear-gradient(145deg, #304b7a, #6a72a9);
}

.book-category-language {
  background: linear-gradient(145deg, #3d4564, #7f6ca5);
}

.book-category-memoir {
  background: linear-gradient(145deg, #694052, #a8646b);
}

.book-category-biography {
  background: linear-gradient(145deg, #405f50, #7a946a);
}

.people-rail .person-card {
  flex: 0 0 clamp(11.25rem, 17vw, 14rem);
}

.people-rail .person-card-body {
  padding: var(--space-3);
}

.people-rail .person-card-body h3 {
  font-size: 1rem;
}

@media (max-width: 58rem) {
  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 40rem) {
  .books-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .book-card-link {
    grid-template-columns: minmax(6.7rem, 0.36fr) minmax(0, 1fr);
  }

  .section-heading-row {
    align-items: stretch;
    flex-direction: column;
  }

  .archive-cta {
    width: 100%;
    justify-content: center;
  }
}

/* Kurdish months */
.kurdish-months-tool {
  display: grid;
  gap: var(--space-6);
}

.month-year-selector {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}

.month-year-selector label {
  width: 100%;
  font-weight: 800;
}

.month-year-selector input,
.month-year-selector button {
  min-height: 2.75rem;
  padding-inline: 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.month-year-selector button {
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.kurdish-month-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.kurdish-month-card {
  min-width: 0;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-block-start: 0.3rem solid var(--phase8-gold);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-xs);
}

.kurdish-month-card:nth-child(n + 4):nth-child(-n + 6) {
  border-block-start-color: var(--phase8-red);
}

.kurdish-month-card:nth-child(n + 7):nth-child(-n + 9) {
  border-block-start-color: #ba7639;
}

.kurdish-month-card:nth-child(n + 10) {
  border-block-start-color: #4676a5;
}

.kurdish-month-card h2,
.kurdish-month-card p {
  margin-block-start: 0;
}

.month-number {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 800;
}

.kurdish-month-card dl {
  display: grid;
  gap: var(--space-3);
  margin: 0;
}

.kurdish-month-card dl > div {
  padding-block-start: var(--space-2);
  border-block-start: 1px solid var(--border);
}

.kurdish-month-card dt {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.kurdish-month-card dd {
  margin: 0.2rem 0 0;
  font-weight: 700;
}

.responsive-table {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.kurdish-month-table {
  width: 100%;
  min-width: 48rem;
  border-collapse: collapse;
  background: var(--surface);
}

.kurdish-month-table caption {
  padding: var(--space-4);
  color: var(--text-strong);
  font-weight: 850;
  text-align: start;
}

.kurdish-month-table th,
.kurdish-month-table td {
  padding: 0.75rem;
  border-block-start: 1px solid var(--border);
  text-align: start;
}

.kurdish-month-table thead {
  background: var(--surface-muted);
}

@media (max-width: 64rem) {
  .kurdish-month-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 38rem) {
  .kurdish-month-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Time-difference layout and horizontal timeline */
.time-difference-tool form {
  grid-template-columns: minmax(12rem, 1fr) auto minmax(12rem, 1fr) minmax(13rem, 0.9fr) auto;
  align-items: end;
}

.time-swap {
  align-self: end;
  width: 2.75rem;
  padding: 0;
  border-radius: 50% !important;
  font-size: 1.25rem !important;
}

.time-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.answer-summary:empty {
  display: none;
}

.time-overlap-timeline {
  max-width: 100%;
  overflow-x: auto;
  scroll-snap-type: inline proximity;
}

@media (max-width: 72rem) {
  .time-difference-tool form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .time-swap {
    grid-column: 1 / -1;
    justify-self: center;
  }
}

@media (max-width: 42rem) {
  .time-difference-tool form {
    grid-template-columns: minmax(0, 1fr);
  }

  .time-swap {
    grid-column: auto;
  }
}

/* Balanced footer */
.footer {
  margin-block-start: clamp(3rem, 7vw, 6rem);
}

.footer-inner {
  padding-block: clamp(2.2rem, 5vw, 4rem);
}

.footer-grid {
  grid-template-columns: minmax(15rem, 1.5fr) repeat(3, minmax(10rem, 1fr));
  gap: clamp(1.5rem, 4vw, 4rem);
}

.footer h2 {
  margin-block: 0 var(--space-3);
  color: #fff;
  font-size: 1rem;
}

.footer-links {
  gap: 0.1rem;
}

.footer-links a {
  min-height: 2rem;
}

@media (max-width: 64rem) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 36rem) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-6);
  }

  .footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
   Phase 8.1 — manual QA corrections
   ========================================================= */
.digital-time-line {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  justify-content: center;
  gap: 0.55rem;
  direction: ltr;
}

.clock-day-period {
  color: var(--text-muted);
  font-size: clamp(0.78rem, 1.6vw, 1rem);
  font-weight: 850;
  direction: rtl;
}

.timekrd-clock-digital {
  min-height: clamp(4rem, 7vw, 6.2rem);
}

.timekrd-clock .dashboard-clock {
  font-size: clamp(2.45rem, 4.6vw, 4.15rem);
  letter-spacing: 0.015em;
}

.timekrd-clock-analog {
  width: min(100%, 17.5rem);
  padding: 0.65rem;
}

.timekrd-clock-analog svg {
  filter: drop-shadow(0 0.75rem 1.6rem rgb(16 25 40 / 0.11));
}

.clock-dial {
  fill: color-mix(in srgb, var(--surface) 96%, var(--phase8-gold));
  stroke: color-mix(in srgb, var(--text-muted) 40%, var(--border));
  stroke-width: 1.2;
}

.clock-inner-ring {
  fill: none;
  stroke: color-mix(in srgb, var(--phase8-gold) 22%, var(--border));
  stroke-width: 0.7;
}

.clock-ticks {
  stroke: color-mix(in srgb, var(--phase8-gold) 68%, var(--text-strong));
  stroke-width: 1.35;
}

.clock-hand-hour {
  stroke-width: 3.6;
}

.clock-hand-minute {
  stroke-width: 2.35;
}

.clock-hand-second {
  stroke: var(--phase8-red);
  stroke-width: 1;
}

.weather-metric-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.weather-facts > div {
  position: relative;
  display: block;
  overflow: hidden;
  padding-inline-end: 4.5rem;
}

.weather-facts dd {
  position: relative;
  z-index: 1;
}

.weather-metric-icon {
  position: absolute;
  inset-inline-end: 0.55rem;
  inset-block-start: 50%;
  width: 3.8rem;
  height: 3.8rem;
  transform: translateY(-50%);
  fill: none;
  stroke: color-mix(in srgb, var(--phase8-gold) 72%, var(--text-muted));
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
  opacity: 0.13;
}

.lower-grid-calendar .calendar-section,
body[data-page-kind='calendar'] .calendar-section,
.page-body > .calendar-section {
  width: min(100%, 960px);
  margin-inline: auto;
}

.calendar-section .cal-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.globe-grid-refined {
  align-items: center;
}

.globe-grid-refined > .globe-app {
  grid-column: span 8;
}

.globe-grid-refined > .anthem-discovery-card {
  grid-column: span 4;
  align-self: center;
  border: 1px solid color-mix(in srgb, var(--phase8-gold) 34%, var(--border));
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 82% 12%, color-mix(in srgb, var(--phase8-gold) 16%, transparent), transparent 35%),
    var(--surface-raised);
  box-shadow: var(--shadow-sm);
}

.anthem-discovery-card h3 {
  margin-block: 0.3rem var(--space-3);
  text-align: start;
}

.anthem-discovery-card p:not(.eyebrow) {
  line-height: 1.9;
}

.globe-instruction,
.kurdistan-heartline {
  max-width: 48rem;
  margin-inline: auto;
  text-align: center;
}

.kurdistan-heartline {
  color: var(--text-strong);
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 850;
}

@media (prefers-reduced-motion: reduce) {
  .clock-hand-second {
    display: none;
  }
}

@media (max-width: 68rem) {
  .globe-grid-refined > .globe-app,
  .globe-grid-refined > .anthem-discovery-card {
    grid-column: 1 / -1;
  }

  .globe-grid-refined > .anthem-discovery-card {
    width: min(100%, 44rem);
    margin-inline: auto;
  }
}

@media (max-width: 30rem) {
  .city-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .timekrd-clock .dashboard-clock {
    font-size: clamp(2.15rem, 12vw, 3.1rem);
  }
}

/* Defer below-the-fold layout work without changing the accessible document tree. */
@supports (content-visibility: auto) {
  body:not(.landing-page) .cards-section,
  body:not(.landing-page) .map-section,
  body:not(.landing-page) .globe-section,
  body:not(.landing-page) .lower-grid-calendar,
  body:not(.landing-page) .cultural-home,
  body:not(.landing-page) .converter-section {
    content-visibility: auto;
  }

  body:not(.landing-page) .cards-section {
    contain-intrinsic-size: auto 28rem;
  }

  body:not(.landing-page) .map-section,
  body:not(.landing-page) .globe-section {
    contain-intrinsic-size: auto 48rem;
  }

  body:not(.landing-page) .lower-grid-calendar {
    contain-intrinsic-size: auto 46rem;
  }

  body:not(.landing-page) .people-home {
    contain-intrinsic-size: auto 34rem;
  }

  body:not(.landing-page) .books-home {
    contain-intrinsic-size: auto 66rem;
  }

  body:not(.landing-page) .stories-home {
    contain-intrinsic-size: auto 42rem;
  }

  body:not(.landing-page) .converter-section {
    contain-intrinsic-size: auto 36rem;
  }

  @media (max-width: 36rem) {
    body:not(.landing-page) .cards-section {
      contain-intrinsic-size: auto 90rem;
    }

    body:not(.landing-page) .people-home {
      contain-intrinsic-size: auto 44rem;
    }

    body:not(.landing-page) .books-home {
      contain-intrinsic-size: auto 235rem;
    }

    body:not(.landing-page) .stories-home {
      contain-intrinsic-size: auto 130rem;
    }

    body:not(.landing-page) .converter-section {
      contain-intrinsic-size: auto 66rem;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .weather-condition-icon,
  .weather-forecast-icon {
    animation: none;
  }

  .editorial-book-card {
    transition: none;
  }
}

/* Phase 8.1 cultural and editorial refinements */
.martyr-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.2rem 0.65rem;
  border: 1px solid color-mix(in srgb, #a53a3a 36%, transparent);
  border-radius: 999px;
  color: #8f2727;
  background: color-mix(in srgb, #a53a3a 8%, var(--color-surface));
  font-size: var(--text-xs);
  font-weight: 800;
}

[data-theme='dark'] .martyr-badge { color: #ffb4b4; }

.anthem-page {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  max-width: 960px;
  margin-inline: auto;
}

.anthem-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(150px, 0.45fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
  overflow: hidden;
  padding: clamp(1.25rem, 4vw, 3rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: radial-gradient(circle at 20% 35%, color-mix(in srgb, var(--kurd-gold) 20%, transparent), transparent 42%), var(--color-surface);
  box-shadow: var(--shadow-lg);
}

.anthem-hero::after {
  position: absolute;
  inset-inline-end: -4rem;
  inset-block-end: -5rem;
  z-index: -1;
  width: 17rem;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--kurd-gold) 24%, transparent);
  border-radius: 50%;
  content: '';
}

.anthem-flag { display: grid; place-items: center; padding: 1rem; }
.anthem-flag img {
  width: min(100%, 180px);
  height: auto;
  border-radius: 0.55rem;
  filter: drop-shadow(0 1rem 1.5rem rgba(15, 23, 42, 0.16));
}
.anthem-hero-copy h2,
.anthem-lyrics h2 { margin-block: 0.2rem 0.75rem; }
.anthem-audio {
  display: block;
  width: min(100%, 34rem);
  margin-block: 1rem 0.65rem;
  accent-color: var(--color-accent-strong);
}

.anthem-lyrics {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 5vw, 4rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-surface) 94%, transparent), var(--color-surface)), url('/assets/flag.png') center 10% / 58% auto no-repeat;
  box-shadow: var(--shadow-md);
}
.anthem-lyrics::before,
.anthem-lyrics::after {
  position: absolute;
  inset-block: 1.5rem;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(#d52b1e 0 33%, #fff 33% 66%, #278e43 66%);
  content: '';
}
.anthem-lyrics::before { inset-inline-start: 1rem; }
.anthem-lyrics::after { inset-inline-end: 1rem; }
.anthem-lyrics > p:not(.eyebrow) {
  display: grid;
  gap: 0.28rem;
  margin: clamp(1.4rem, 4vw, 2.4rem) auto;
  color: var(--text-strong);
  font-size: clamp(1.18rem, 2.2vw, 1.65rem);
  font-weight: 680;
  line-height: 1.95;
}
.anthem-lyrics span { display: block; }
.anthem-history,
.anthem-sources { padding-inline: clamp(0.25rem, 2vw, 1.5rem); }
.anthem-history p { line-height: 2; }

@media (max-width: 680px) {
  .anthem-hero { grid-template-columns: 1fr; text-align: center; }
  .anthem-audio { margin-inline: auto; }
  .anthem-lyrics { padding-inline: 1.35rem; }
  .anthem-lyrics::before,
  .anthem-lyrics::after { inset-block: 1rem; width: 2px; }
  .anthem-lyrics::before { inset-inline-start: 0.55rem; }
  .anthem-lyrics::after { inset-inline-end: 0.55rem; }
}

/* =========================================================
   Phase 8.2 — manual QA corrections
   ========================================================= */
.timekrd-clock-analog {
  container-type: inline-size;
  width: min(100%, 21.5rem);
  padding: clamp(0.35rem, 1.2vw, 0.85rem);
}

.timekrd-clock-analog .wall-clock {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  isolation: isolate;
  shape-rendering: geometricPrecision;
  filter: drop-shadow(0 1rem 1.25rem rgb(15 23 42 / 0.2));
}

.clock-frame-shadow {
  fill: rgb(15 23 42 / 0.16);
  transform: scale(0.985);
  transform-origin: 50% 50%;
}

.clock-frame {
  fill: #7e8288;
  stroke: #4d5157;
  stroke-width: 0.8;
}

.clock-frame-highlight {
  fill: #c8cbd0;
  stroke: #f3f4f6;
  stroke-width: 0.75;
}

.clock-dial {
  fill: #fbfaf5;
  stroke: #777b80;
  stroke-width: 0.55;
}

.clock-markers {
  fill: none;
  stroke: #39404a;
  stroke-linecap: round;
}

.clock-marker {
  stroke-width: 0.42;
  opacity: 0.74;
}

.clock-marker-hour {
  stroke-width: 1.15;
  opacity: 1;
}

.clock-numeral {
  fill: #202631;
  font-family: var(--font-sans);
  font-size: 5.2px;
  font-weight: 850;
  text-anchor: middle;
  dominant-baseline: middle;
}

.clock-city-label {
  fill: #5b4630;
  font-family: var(--font-sans);
  font-size: 3.65px;
  font-weight: 850;
  direction: rtl;
  text-anchor: middle;
  unicode-bidi: plaintext;
}

.clock-city-label-long {
  font-size: 3.05px;
}

.clock-hand {
  visibility: visible;
  opacity: 1;
  filter: drop-shadow(0.6px 1px 0.65px rgb(15 23 42 / 0.32));
}

.clock-hand-hour,
.clock-hand-minute {
  fill: #202631;
  stroke: #0f141c;
  stroke-linejoin: round;
}

.clock-hand-hour {
  stroke-width: 0.5;
}

.clock-hand-minute {
  stroke-width: 0.38;
}

.clock-hand-second {
  fill: #9e2430;
  stroke: #9e2430;
  stroke-linecap: round;
  stroke-width: 0.72;
}

.clock-pin-shadow {
  fill: rgb(15 23 42 / 0.34);
}

.clock-pin {
  fill: #b99020;
  stroke: #755b13;
  stroke-width: 0.55;
}

.clock-pin-highlight {
  fill: #fff4b8;
  opacity: 0.88;
}

[data-theme='dark'] .clock-frame {
  fill: #555d68;
  stroke: #242b35;
}

[data-theme='dark'] .clock-frame-highlight {
  fill: #8a929d;
  stroke: #bbc1c9;
}

[data-theme='dark'] .clock-dial {
  fill: #ece9df;
  stroke: #343a44;
}

@media (max-width: 30rem) {
  .timekrd-clock-analog {
    width: min(100%, 18.75rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .clock-hand {
    transition: none !important;
  }

  .clock-hand-second {
    display: inline;
  }
}

.globe-grid-refined > .globe-info-stack {
  grid-column: span 4;
  align-self: stretch;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
  gap: var(--space-5);
  min-width: 0;
}

.globe-grid-refined {
  align-items: stretch;
}

.globe-grid-refined > .globe-app {
  height: 100%;
  align-content: start;
}

.globe-info-stack .info-list {
  align-content: space-between;
}

.globe-info-stack .globe-facts {
  display: grid;
  gap: var(--space-3);
}

.globe-info-stack .anthem-discovery-card {
  margin: 0;
  padding: clamp(var(--space-5), 2.5vw, var(--space-7));
  border: 1px solid color-mix(in srgb, var(--phase8-gold) 34%, var(--border));
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 82% 12%, color-mix(in srgb, var(--phase8-gold) 16%, transparent), transparent 35%),
    var(--surface-raised);
  box-shadow: var(--shadow-sm);
}

.city-page {
  display: grid;
  gap: clamp(var(--space-5), 2.2vw, var(--space-8));
}

.city-page > section {
  margin: 0;
}

.city-editorial-section {
  padding: clamp(var(--space-5), 2.5vw, var(--space-7));
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.city-editorial-section h2 {
  margin-block: 0 var(--space-3);
}

.city-editorial-section > p {
  max-width: 74ch;
  margin-block: 0 var(--space-4);
  line-height: 1.9;
}

.city-map-cta {
  width: fit-content;
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border: 1px solid color-mix(in srgb, var(--accent-2) 42%, var(--border));
  border-radius: var(--radius-pill);
  background: var(--accent-2);
  color: var(--on-accent);
  font-weight: 820;
  text-decoration: none;
}

.city-map-cta svg {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: currentColor;
}

.fact-source-note {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.population-fact th,
.population-fact td {
  background: color-mix(in srgb, var(--phase8-gold) 9%, var(--surface));
}

.population-fact td {
  display: grid;
  gap: 0.2rem;
}

.population-fact strong {
  color: var(--text-strong);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.population-detail {
  font-weight: 740;
}

@media (min-width: 68.01rem) {
  .city-page > .timekrd-clock {
    grid-template-columns: minmax(12rem, 0.8fr) minmax(15rem, 19rem) minmax(12rem, 0.8fr);
    grid-template-areas:
      'heading analog date'
      'heading analog meta'
      'mode analog cycle';
    align-items: center;
    gap: var(--space-3) clamp(var(--space-5), 3vw, var(--space-8));
    min-height: 0;
    padding: clamp(var(--space-5), 2.5vw, var(--space-7));
  }

  .city-page > .timekrd-clock .timekrd-clock-heading { grid-area: heading; }
  .city-page > .timekrd-clock .timekrd-clock-digital { grid-area: analog; }
  .city-page > .timekrd-clock .timekrd-clock-analog {
    grid-area: analog;
    width: min(100%, 18rem);
    padding: 0;
  }
  .city-page > .timekrd-clock [data-clock-date-timezone] { grid-area: date; }
  .city-page > .timekrd-clock .clock-meta { grid-area: meta; }
  .city-page > .timekrd-clock .segmented-control { grid-area: mode; }
  .city-page > .timekrd-clock .hour-cycle-control { grid-area: cycle; }
}

.feedback-form-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2) var(--space-4);
}

.feedback-form-actions .feedback-privacy-note {
  grid-column: 1;
}

.feedback-form-actions .feedback-status {
  grid-column: 1 / -1;
  grid-row: 2;
}

.feedback-form-actions .feedback-submit {
  grid-column: 2;
  grid-row: 1;
  min-width: 12rem;
}

.feedback-page-panel {
  width: 100%;
  max-width: none;
}

.feedback-dialog {
  width: min(58rem, calc(100% - 1rem));
  max-height: calc(100dvh - 1rem);
}

.feedback-dialog-panel {
  max-height: calc(100dvh - 1rem);
  padding: clamp(var(--space-4), 2vw, var(--space-6));
  scroll-padding-block-end: 9rem;
}

.feedback-dialog .feedback-dialog-header {
  position: sticky;
  z-index: 3;
  inset-block-start: calc(-1 * var(--space-4));
  padding-block: var(--space-2);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}

.feedback-dialog-panel > p {
  margin-block: var(--space-1) var(--space-3);
}

.feedback-dialog .feedback-form {
  gap: var(--space-2) var(--space-4);
}

.feedback-dialog .feedback-field {
  gap: var(--space-1);
}

.feedback-dialog .feedback-field textarea {
  min-height: 5.5rem;
}

.feedback-dialog .field-error:empty {
  min-height: 0;
}

.feedback-dialog .feedback-form-actions {
  position: sticky;
  z-index: 2;
  inset-block-end: calc(-1 * var(--space-4));
  padding-block: var(--space-2);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 -0.65rem 1rem color-mix(in srgb, var(--surface) 82%, transparent);
}

@media (max-width: 68rem) {
  .globe-grid-refined > .globe-info-stack {
    grid-column: 1 / -1;
    width: min(100%, 48rem);
    margin-inline: auto;
  }

  .globe-grid-refined > .globe-app,
  .globe-grid-refined > .globe-info-stack {
    height: auto;
  }
}

@media (max-width: 47.99rem) {
  .feedback-dialog {
    width: 100%;
    max-height: min(94dvh, 50rem);
  }

  .feedback-dialog-panel {
    max-height: min(94dvh, 50rem);
    padding-block-end: calc(var(--space-4) + env(safe-area-inset-bottom));
  }

  .feedback-form-actions,
  .feedback-form-actions .feedback-privacy-note,
  .feedback-form-actions .feedback-status,
  .feedback-form-actions .feedback-submit {
    grid-column: 1;
  }

  .feedback-form-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .feedback-form-actions .feedback-status {
    grid-row: 2;
  }

  .feedback-form-actions .feedback-submit {
    grid-row: 3;
    width: 100%;
    min-width: 0;
  }
}
