/* Classification page → 🌍 Atlas tab (2026-11-30). Everything is generated from the classification data:
   school region (lit_schools.countries) + each writer's country / years (lit_writers or the linked author).
   Tokens come from /library.css. Classes are la- prefixed. */

.la { --la-land: #222739; --la-ocean1: #0b1020; --la-ocean2: #101830; --la-line: rgba(255,255,255,.07);
  display: flex; flex-direction: column; gap: 12px; }
.la [hidden] { display: none !important; }

/* top strip: stats + search + toggles */
.la-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.la-stats { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.la-stat { display: inline-flex; align-items: baseline; gap: 5px; background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px; font-size: var(--fs-sm); color: var(--muted); }
.la-stat b { color: var(--text); font-size: var(--fs-md); }
button.la-stat { cursor: pointer; font: inherit; font-size: var(--fs-sm); }
button.la-stat.warn { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
button.la-stat.warn b { color: var(--warn); }
.la-find { position: relative; }
.la-find input { background: var(--card); border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: 7px 14px;
  font: 400 var(--fs-md) var(--font); width: 230px; }
.la-find input:focus { outline: none; border-color: var(--gold); }
.la-sugg { position: absolute; top: calc(100% + 4px); inset-inline-end: 0; width: 290px; max-height: 320px; overflow: auto; z-index: 30;
  background: var(--card2); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 4px; }
.la-sugg button { display: flex; width: 100%; align-items: center; gap: 8px; background: none; border: 0; color: var(--text); text-align: start;
  padding: 7px 9px; border-radius: 8px; cursor: pointer; font: 500 var(--fs-md) var(--font); }
.la-sugg button:hover, .la-sugg button.on { background: var(--gold-glow); }
.la-sugg i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.la-sugg small { color: var(--muted); font-size: var(--fs-xs); margin-inline-start: auto; }
.la-tg { background: var(--card); border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 6px 11px;
  font: 600 var(--fs-sm) var(--font); cursor: pointer; }
.la-tg.on { color: var(--text); border-color: var(--gold-dim); background: var(--gold-glow); }

/* body: legend | map (panel slides over the map) */
.la-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 12px; }
.la-legend { display: flex; flex-direction: column; gap: 8px; max-height: min(66vh, 640px); overflow: auto; padding-inline-end: 2px; }
.la-sc { --c: #888; position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; text-align: start;
  background: var(--card); border: 1px solid var(--border); border-inline-start: 4px solid var(--c); border-radius: 12px; padding: 7px;
  cursor: pointer; color: var(--text); font: inherit; transition: transform .15s, border-color .15s, opacity .25s, background .15s; }
.la-sc:hover, .la-sc.on { background: color-mix(in srgb, var(--c) 16%, var(--card)); border-color: color-mix(in srgb, var(--c) 70%, transparent); transform: translateX(-2px); }
.la-sc.off { opacity: .38; }
.la-sc .th { width: 56px; height: 46px; border-radius: 8px; background: var(--c) center 25% / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.la-sc .nm { display: block; font: 700 14.5px 'Noto Naskh Arabic', var(--font); line-height: 1.35; }
.la-sc .en { display: block; font-size: var(--fs-xs); color: var(--muted); }
.la-sc .cr { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px;
  font: 500 12px/1.5 'Noto Naskh Arabic', var(--font); color: color-mix(in srgb, var(--c) 45%, var(--text)); }
.la-sc .mt { display: flex; gap: 8px; font-size: var(--fs-xs); color: var(--muted); margin-top: 3px; flex-wrap: wrap; }
.la-sc .mt b { color: var(--text); font-weight: 600; }
.la-sc .bar { grid-column: 1 / -1; height: 4px; border-radius: 3px; background: rgba(255,255,255,.06); overflow: hidden; }
.la-sc .bar span { display: block; height: 100%; background: var(--c); border-radius: 3px; }
.la-sc .noreg { grid-column: 1 / -1; font-size: var(--fs-xs); color: var(--warn); }

.la-stage { position: relative; height: min(66vh, 640px); min-height: 380px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border);
  background: radial-gradient(ellipse at 50% 35%, var(--la-ocean2), var(--la-ocean1) 75%); touch-action: none; user-select: none; }
.la-stage:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.la-stage svg.la-map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.la-stage.dragging svg.la-map { cursor: grabbing; }
.la-cty { fill: var(--la-land); stroke: rgba(255,255,255,.10); stroke-width: .6; vector-effect: non-scaling-stroke; transition: fill .45s, opacity .35s; cursor: pointer; }
.la-cty.home { stroke: rgba(255,255,255,.28); }
.la-cty.pres { stroke-dasharray: 3 2; }
.la-cty:hover { stroke: #fff; stroke-width: 1.2; }
.la-cty.dim { opacity: .28; }
.la-cty.sel { stroke: var(--gold); stroke-width: 2; }
.la-grat { fill: none; stroke: var(--la-line); stroke-width: .5; vector-effect: non-scaling-stroke; pointer-events: none; }
.la-pin { cursor: pointer; transition: opacity .35s; }
.la-pin .dot { stroke: rgba(10,10,20,.85); stroke-width: 1.4; }
.la-pin .crit { fill: none; stroke: var(--gold); stroke-width: 2; }
.la-pin .rd { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; opacity: .9; }
.la-pin .halo { fill: var(--c); opacity: 0; }
.la-pin:hover .halo, .la-pin.sel .halo { opacity: .35; }
.la-pin.sel .halo { animation: la-pulse 1.6s ease-out infinite; }
@keyframes la-pulse { 0% { opacity: .55; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.9); } }
.la-pin.ghost { opacity: .16; }
.la-pin.ghost .crit { opacity: .5; }
.la-pin.dim { opacity: .12; }
.la-pin.born .halo { animation: la-born .9s ease-out 1; }
@keyframes la-born { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: scale(2.4); } }
.la-lbl { font: 700 12px 'Noto Naskh Arabic', var(--font); fill: #fff; paint-order: stroke; stroke: rgba(8,10,20,.9); stroke-width: 3.2px;
  stroke-linejoin: round; pointer-events: none; transition: opacity .3s; }
.la-lbl.sm { font-size: 11px; font-weight: 600; fill: #dfe0ee; }
.la-clbl { font: 600 11px var(--font); fill: rgba(255,255,255,.55); paint-order: stroke; stroke: rgba(8,10,20,.8); stroke-width: 3px;
  pointer-events: none; }   /* no letter-spacing on Arabic: it breaks letter joining (Safari garbles it) */

.la-ctl { position: absolute; inset-inline-start: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; z-index: 5; }
.la-ctl button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: rgba(19,19,31,.86);
  color: var(--text); font-size: 16px; cursor: pointer; backdrop-filter: blur(6px); }
.la-ctl button:hover { border-color: var(--gold-dim); color: var(--gold); }
.la-key { position: absolute; inset-inline-start: 10px; bottom: 10px; z-index: 5; display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  background: rgba(19,19,31,.82); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; font-size: var(--fs-xs); color: var(--muted);
  backdrop-filter: blur(6px); max-width: calc(100% - 20px); }
.la-key span { display: inline-flex; align-items: center; gap: 5px; }
.la-key svg { flex: none; }
.la-era { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5; pointer-events: none;
  font: 700 26px var(--font-display); color: rgba(255,255,255,.88); text-shadow: 0 2px 18px rgba(0,0,0,.9); letter-spacing: .02em; transition: opacity .3s; }
.la-era small { display: block; text-align: center; font: 500 var(--fs-xs) var(--font); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

.la-tip { position: absolute; z-index: 20; pointer-events: none; background: rgba(18,18,32,.96); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 11px; font-size: var(--fs-sm); color: var(--text); box-shadow: var(--shadow); max-width: 270px;
  transform: translate(-50%, calc(-100% - 14px)); white-space: normal; }
.la-tip b { font: 700 15px 'Noto Naskh Arabic', var(--font); display: block; }
.la-tip small { color: var(--muted); display: block; font-size: var(--fs-xs); margin-top: 1px; }
.la-tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 5px; vertical-align: 1px; }

/* side panel (over the map, inline-end side) */
.la-panel { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: min(370px, 92%); z-index: 10; overflow: auto;
  background: rgba(20,20,34,.95); border-inline-start: 1px solid var(--border); backdrop-filter: blur(10px);
  transform: translateX(105%); transition: transform .32s cubic-bezier(.2,.8,.2,1); box-shadow: -18px 0 40px rgba(0,0,0,.45); }
[dir=rtl] .la-panel { transform: translateX(-105%); }
.la-panel.open { transform: none; }
.la-x { position: sticky; top: 8px; float: inline-end; margin: 8px; z-index: 2; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border); background: rgba(0,0,0,.55); color: var(--text); cursor: pointer; font-size: 15px; }
.la-hero { position: relative; height: 150px; background: var(--c) center 25% / cover no-repeat; }
.la-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 30%, rgba(20,20,34,1)); }
.la-hero.flat { height: 70px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 40%, #000)); }
.la-hero figcaption { position: absolute; bottom: 6px; inset-inline-start: 10px; z-index: 1; font-size: var(--fs-xs); color: rgba(255,255,255,.6); }
.la-pb { padding: 4px 18px 18px; }
.la-pb h3 { font: 700 23px 'Noto Naskh Arabic', var(--font-display); line-height: 1.35; margin-top: -6px; position: relative; }
.la-pb h3 + .en { color: var(--muted); font-size: var(--fs-sm); margin-bottom: 10px; }
.la-sec { margin-top: 16px; }
.la-sec > h4 { font: 700 var(--fs-xs) var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px; }
.la-sec > h4 bdi { letter-spacing: 0; text-transform: none; font-size: 13px; }
.la-sec > h4::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.la-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.la-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px; text-align: center; }
.la-kpi b { display: block; font: 700 19px var(--font); color: var(--text); }
.la-kpi small { font-size: var(--fs-xs); color: var(--muted); }
.la-chiprow { display: flex; flex-wrap: wrap; gap: 5px; }
.la-chip { --c: var(--gold); display: inline-flex; align-items: center; gap: 5px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: 999px; padding: 3px 10px; font: 500 var(--fs-sm) var(--font); cursor: pointer; text-decoration: none; }
.la-chip:hover { border-color: var(--c); }
.la-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.la-badge { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); font-weight: 600; border-radius: 999px; padding: 2px 9px;
  background: var(--gold-glow); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); }
.la-badge.lib { background: rgba(56,189,248,.1); color: var(--info); border-color: rgba(56,189,248,.35); }
.la-crit { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.la-crit li { display: flex; align-items: center; gap: 9px; background: color-mix(in srgb, var(--c) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); border-radius: 10px; padding: 8px 11px;
  font: 600 14.5px/1.55 'Noto Naskh Arabic', var(--font); color: var(--text); }
.la-crit li::before { content: '◆'; color: var(--c); font-size: 11px; flex: none; }
.la-traits { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.la-traits li { background: #f8f6f0; color: #1d1b16; border-radius: 10px; padding: 8px 11px; font-size: 14px; line-height: 1.65;
  border-inline-start: 4px solid var(--c); }
.la-life { position: relative; height: 26px; margin-top: 4px; }
.la-life .ax { position: absolute; inset: 12px 0 auto; height: 2px; background: var(--border); border-radius: 2px; }
.la-life .sp { position: absolute; top: 9px; height: 8px; border-radius: 6px; background: var(--c); box-shadow: 0 0 12px color-mix(in srgb, var(--c) 60%, transparent); }
.la-life small { position: absolute; top: -4px; font-size: var(--fs-xs); color: var(--muted); }
.la-prog { height: 7px; border-radius: 5px; background: var(--surface); overflow: hidden; margin-top: 6px; }
.la-prog span { display: block; height: 100%; background: linear-gradient(90deg, var(--success), #7be3b4); }
.la-ws { display: flex; flex-direction: column; gap: 2px; }
.la-w { --c: #888; display: grid; grid-template-columns: 1fr 112px; gap: 8px; align-items: center; background: none; border: 0; color: var(--text);
  text-align: start; padding: 6px 7px; border-radius: 8px; cursor: pointer; font: inherit; }
.la-w:hover { background: var(--surface); }
.la-w .n { font: 600 14px 'Noto Naskh Arabic', var(--font); display: flex; align-items: center; gap: 6px; min-width: 0; }
.la-w .n span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.la-w .n small { color: var(--muted); font: 500 var(--fs-xs) var(--font); flex: none; }
.la-w .n .st { color: var(--gold); flex: none; font-size: 12px; }
.la-w .ln { position: relative; height: 6px; background: rgba(255,255,255,.04); border-radius: 4px; }
.la-w .ln span { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--c); min-width: 3px; }
.la-w .ln.und::after { content: 'undated'; position: absolute; inset: -5px 0 auto; font-size: 11px; color: var(--muted); text-align: center; }
.la-note { font-size: var(--fs-sm); color: var(--muted); line-height: 1.6; }
.la-ins { display: flex; flex-direction: column; gap: 8px; }
.la-in { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; font-size: var(--fs-sm); color: var(--muted); line-height: 1.55; }
.la-in b { color: var(--text); }
.la-in button { background: none; border: 0; padding: 0; color: var(--gold); font: 600 var(--fs-sm) var(--font); cursor: pointer; }
.la-rank { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 8px; align-items: center; font-size: var(--fs-sm); }
.la-rank .nm { font: 600 13.5px 'Noto Naskh Arabic', var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.la-rank .br { height: 9px; border-radius: 5px; background: rgba(255,255,255,.05); position: relative; overflow: hidden; }
.la-rank .br span { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--c); opacity: .45; }
.la-rank .br em { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--c); }
.la-rank small { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }
.la-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--gold); color: #1a1408; border: 0; border-radius: 9px;
  padding: 7px 13px; font: 700 var(--fs-sm) var(--font); cursor: pointer; text-decoration: none; }
.la-btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

/* timeline */
.la-time { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 10px 12px 6px; }
.la-time-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.la-time-hd h4 { font: 700 var(--fs-xs) var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.la-time-hd .win { font: 700 var(--fs-md) var(--font); color: var(--text); }
.la-time-hd .sp { flex: 1; }
.la-time-hd small { color: var(--muted); font-size: var(--fs-xs); }
.la-time svg { display: block; width: 100%; touch-action: none; user-select: none; }
.la-tl-life { stroke-linecap: round; transition: opacity .3s; cursor: pointer; }
.la-tl-life:hover { stroke-width: 6; }
.la-tl-lane { font: 600 11px 'Noto Naskh Arabic', var(--font); fill: var(--muted); }
.la-tl-ax { font: 500 11px var(--font); fill: var(--muted); }
.la-tl-brk { stroke: var(--muted); stroke-width: 1; opacity: .6; }
.la-brush { fill: rgba(200,150,30,.10); stroke: var(--gold); stroke-width: 1.2; cursor: grab; }
.la-brush-h { fill: var(--gold); cursor: ew-resize; }
.la-shade { fill: rgba(5,5,12,.55); pointer-events: none; }

@media (max-width: 900px) {
  .la-body { grid-template-columns: 1fr; }
  .la-legend { flex-direction: row; overflow-x: auto; max-height: none; padding-bottom: 4px; }
  .la-sc { min-width: 220px; }
  .la-stage { height: 60vh; min-height: 320px; }
  .la-find input { width: 100%; }
  .la-find { flex: 1 1 100%; }
  .la-panel { width: 100%; top: auto; height: 62%; border-inline-start: 0; border-top: 1px solid var(--border); border-radius: 16px 16px 0 0;
    transform: translateY(105%) !important; }
  .la-panel.open { transform: none !important; }
  .la-era { font-size: 19px; }
  .la-key { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .la-pin.sel .halo, .la-pin.born .halo { animation: none; }
  .la-panel, .la-cty, .la-pin { transition: none; }
}
