/* Diriyah visitor guide: layout and components. Tokens and fonts come from ../shared/brand.css. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { font: 400 15px/1.45 var(--font-ui); -webkit-text-size-adjust: 100%; overflow: hidden; }
html[lang="zh"] body { font-family: var(--font-ui), 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', sans-serif; }
html[lang="ja"] body { font-family: var(--font-ui), 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif; }
html[lang="ko"] body { font-family: var(--font-ui), 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif; }
html[lang="hi"] body { font-family: var(--font-ui), 'Kohinoor Devanagari', 'Devanagari Sangam MN', 'Noto Sans Devanagari', sans-serif; }
html[lang="ur"] body { font-family: 'Noto Nastaliq Urdu', var(--font-ui), sans-serif; line-height: 1.9; }
html[lang="ar"] body { font-family: var(--font-ui); }
button, select, input { font: inherit; color: inherit; }
a { color: inherit; }
.sprite { position: absolute; width: 0; height: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------------ frame */
.app { height: 100dvh; display: flex; flex-direction: column; }
.hdr { position: relative; flex: none; color: var(--dr-cream); background: var(--dr-brown-deep); padding: 10px 16px 12px;
  padding-top: max(10px, env(safe-area-inset-top)); overflow: hidden; isolation: isolate; }
.hdr-strip { position: absolute; inset: 0; z-index: -2; background: url(img/header_strip.jpg) center 55% / cover no-repeat; }
.hdr-strip::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(61, 36, 25, 0.94) 0%, rgba(61, 36, 25, 0.78) 45%, rgba(61, 36, 25, 0.45) 100%); }
[dir="rtl"] .hdr-strip::after { background: linear-gradient(270deg, rgba(61, 36, 25, 0.94) 0%, rgba(61, 36, 25, 0.78) 45%, rgba(61, 36, 25, 0.45) 100%); }
.hdr-pattern { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; width: 100%; z-index: -1; }
.hdr-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.logo { display: block; width: 116px; height: 38px; color: var(--dr-cream); flex: none; }
.logo svg { width: 100%; height: 100%; display: block; }
.hdr-tools { display: flex; align-items: center; gap: 8px; }
.lang { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid rgba(253, 250, 247, 0.35); border-radius: var(--radius);
  background: rgba(28, 18, 13, 0.35); }
.lang select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; color: var(--dr-cream); font-size: 14px; padding: 0 2px; cursor: pointer; max-width: 120px; }
.lang select option { color: #222; }
.hdr-title { display: flex; align-items: center; gap: 12px; margin: 8px 0 8px; }
.hdr-title h1 { margin: 0; font-size: 24px; color: var(--dr-cream); font-weight: 700; }
[dir="rtl"] .hdr-title h1, html[lang="zh"] .hdr-title h1, html[lang="ja"] .hdr-title h1, html[lang="ko"] .hdr-title h1, html[lang="hi"] .hdr-title h1,
html[lang="ru"] .hdr-title h1 { font-family: inherit; font-weight: 500; font-size: 20px; }
.hdr-title .dr-ornament { flex: none; transform: scale(0.8); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; line-height: 1.5;
  background: rgba(253, 250, 247, 0.14); border: 1px solid rgba(253, 250, 247, 0.22); color: var(--dr-cream); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: #8fd19e; flex: none; }
.chip.closed .dot { background: #e98a7a; }
.chip .ico { width: 14px; height: 14px; }

.tabs { flex: none; order: 3; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--panel); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); backdrop-filter: blur(10px); z-index: 5; }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; border: 0; background: none; cursor: pointer;
  color: var(--ink-2); font-size: 11.5px; line-height: 1.2; min-height: 56px; }
.tabs button .ico { width: 23px; height: 23px; }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 500; }
.tabs button[aria-selected="true"] .ico { color: var(--accent); stroke-width: 2; }
.panels { flex: 1; min-height: 0; position: relative; order: 2; }
.panel { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 24px; display: none; -webkit-overflow-scrolling: touch; }
.panel.on { display: block; }
.mapwrap { position: relative; flex: 1; min-height: 0; order: 2; display: none; background: #2a1a13; overflow: hidden; }
.app[data-tab="map"] .panels { display: none; }
.app[data-tab="map"] .mapwrap { display: block; }
.app[data-tab="map"] .hdr-title { display: none; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 440px 1fr; grid-template-rows: auto auto 1fr; }
  .hdr { grid-column: 1; grid-row: 1; }
  .tabs { grid-column: 1; grid-row: 2; order: 0; border-top: 0; border-bottom: 1px solid var(--line); padding-bottom: 0; }
  .tabs button { flex-direction: row; justify-content: center; gap: 6px; font-size: 13px; min-height: 46px; }
  .tabs button .ico { width: 19px; height: 19px; }
  .panels { grid-column: 1; grid-row: 3; display: block !important; border-inline-end: 1px solid var(--line); }
  .mapwrap { grid-column: 2; grid-row: 1 / span 3; display: block !important; }
  .app[data-tab="map"] .hdr-title { display: flex; }
  .hdr-title h1 { font-size: 27px; }
}

/* ------------------------------------------------------------------ shared components */
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 18px 0 8px; }
.sec-h:first-child { margin-top: 2px; }
.sec-h h2 { margin: 0; font: 700 22px/1.1 var(--font-display); color: var(--ink); }
[dir="rtl"] .sec-h h2, html[lang="zh"] .sec-h h2, html[lang="ja"] .sec-h h2, html[lang="ko"] .sec-h h2, html[lang="hi"] .sec-h h2, html[lang="ru"] .sec-h h2 {
  font-family: inherit; font-weight: 500; font-size: 18px; }
.sec-h small { color: var(--ink-2); font-size: 12.5px; }
.seg { display: flex; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.seg button { flex: 1; border: 0; background: none; padding: 8px 6px; font-size: 13.5px; cursor: pointer; color: var(--ink-2); min-height: 40px; }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--dr-brown); color: var(--dr-cream); font-weight: 500; }
.lbl { font-size: 12.5px; color: var(--ink-2); margin: 0 0 6px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--bg-2);
  border: 1px solid var(--line); font-size: 14px; margin-bottom: 12px; }
.banner .ico { color: var(--accent); }
.banner a { margin-inline-start: auto; font-weight: 500; white-space: nowrap; }
.card { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 12px 12px 10px; margin: 0 0 10px;
  box-shadow: 0 1px 0 rgba(98, 60, 44, 0.04); }
.card.sel { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(199, 150, 103, 0.35); }
.card-top { display: flex; gap: 10px; align-items: flex-start; }
.badge { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border-radius: 6px;
  font: 700 15px/1 var(--font-ui); color: #fff; background: var(--dr-blue); }
.badge.valet { background: var(--dr-mauve); } .badge.dropoff { background: var(--dr-green); } .badge.osm { background: #6b7c93; }
.badge .ico { width: 20px; height: 20px; color: #fff; }
.card h3 { margin: 0; font-size: 16px; font-weight: 500; line-height: 1.25; }
.card .alt { display: block; font-size: 13px; color: var(--ink-2); margin-top: 1px; }
.card .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.walk { margin-inline-start: auto; text-align: end; flex: none; }
.walk b { display: block; font: 500 20px/1 var(--font-num); color: var(--ink); white-space: nowrap; }
.walk span { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.price { margin: 9px 0 0; padding: 7px 9px; border-radius: var(--radius); background: var(--bg-2); font-size: 13.5px; }
.price .now { font-weight: 500; color: var(--ink); }
.price p { margin: 2px 0; }
.note { font-size: 12.5px; color: var(--ink-2); margin: 6px 0 0; }
.note.warn { color: var(--dr-burgundy); }
.note.warn { border-inline-start: 2px solid currentColor; padding-inline-start: 8px; }
[data-theme="dark"] .note.warn { color: var(--dr-blush); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .note.warn { color: var(--dr-blush); } }
.src { font-size: 11.5px; color: var(--ink-2); margin: 5px 0 0; }
.list-plain + .src, article + .src { margin: -4px 2px 12px; }
.tagrow { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); color: var(--ink-2); }
.acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.act { display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg);
  font-size: 13px; text-decoration: none; cursor: pointer; min-height: 36px; color: var(--ink); }
.act .ico { width: 16px; height: 16px; }
.act.pri { background: var(--btn-grad); color: #fff; border-color: transparent; }
.more { width: 100%; padding: 10px; border: 1px dashed var(--line); background: none; border-radius: 6px; cursor: pointer; color: var(--ink-2); margin-bottom: 10px; }
.chips2 { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips2::-webkit-scrollbar { display: none; }
.chips2 button { flex: none; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-size: 13px; cursor: pointer; color: var(--ink-2); }
.chips2 button[aria-pressed="true"] { background: var(--dr-brown); color: var(--dr-cream); border-color: var(--dr-brown); }
.vcard { display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: start; }
.thumb { position: relative; width: 84px; height: 64px; border-radius: 4px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s; }
.thumb img.ok { opacity: 1; }
.thumb .placeholder-size { position: absolute; inset: auto 0 4px; text-align: center; color: var(--ink-2); }
.thumb::before { content: ""; position: absolute; inset: 0; background:
  repeating-linear-gradient(135deg, transparent 0 7px, rgba(199, 150, 103, 0.18) 7px 8px); }
.list-plain { margin: 0; padding: 0; list-style: none; }
.list-plain li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list-plain li:last-child { border-bottom: 0; }
.list-plain li .k { flex: none; width: 46%; color: var(--ink-2); }
.list-plain li .v { flex: 1; text-align: end; font-variant-numeric: tabular-nums; }
.hours-row { display: flex; justify-content: space-between; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: #e3f2e6; color: #1f5f34; }
.pill.closed { background: #f7e1dc; color: #7d2a1c; }
.rules li { display: block; }
.foot { margin: 22px 0 8px; font-size: 12px; color: var(--ink-2); }
.foot a { color: var(--ink); }
.twin-link { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 6px; background: var(--dr-brown); color: var(--dr-cream); text-decoration: none; margin-top: 14px; }
.twin-link .ico { color: var(--dr-sand); width: 26px; height: 26px; }
.twin-link small { display: block; opacity: 0.8; font-size: 12px; }

/* ------------------------------------------------------------------ map */
.map { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; display: block; }
.map.drag { cursor: grabbing; }
.map-layers { position: absolute; top: 10px; inset-inline: 10px 60px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; z-index: 2; }
.map-layers::-webkit-scrollbar { display: none; }
.map-layers button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(253, 250, 247, 0.92); color: #4a2e22; font-size: 12.5px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
.map-layers button i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.map-layers button[aria-pressed="false"] { opacity: 0.55; }
.map-ctl { position: absolute; top: 10px; inset-inline-end: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.mbtn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 6px; border: 0; background: rgba(253, 250, 247, 0.94); color: #4a2e22;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); cursor: pointer; }
.map-route { position: absolute; inset-inline-start: 10px; top: 52px; z-index: 2; padding: 6px 10px; border-radius: var(--radius); background: rgba(61, 36, 25, 0.88);
  color: var(--dr-cream); font-size: 13px; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 80px); }
.map-route .ico { width: 16px; height: 16px; color: var(--dr-sand); }
.map-credit { position: absolute; inset-inline: 6px; bottom: 3px; z-index: 1; font-size: 9.5px; line-height: 1.25; color: rgba(255, 255, 255, 0.85); text-shadow: 0 1px 2px #000;
  max-width: 70%; text-align: end; pointer-events: none; }
.sheet { position: absolute; inset-inline: 10px; bottom: 22px; z-index: 3; background: var(--panel); color: var(--ink); border-radius: 8px; padding: 12px 12px 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35); max-height: 52%; overflow-y: auto; }
.sheet .x { position: absolute; top: 6px; inset-inline-end: 6px; width: 34px; height: 34px; border: 0; background: none; cursor: pointer; color: var(--ink-2); }
.sheet h3 { margin: 0 34px 0 0; font-size: 16px; font-weight: 500; }
[dir="rtl"] .sheet h3 { margin: 0 0 0 34px; }
@media (min-width: 900px) { .sheet { inset-inline: auto 14px; width: 360px; bottom: 26px; } }
.toast { position: absolute; left: 50%; transform: translateX(-50%); bottom: 26px; z-index: 4; background: rgba(28, 18, 13, 0.9); color: var(--dr-cream);
  padding: 8px 12px; border-radius: 6px; font-size: 13px; max-width: 90%; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 13px; margin: 8px 0 0; }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 16px; height: 16px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; color: #fff; font: 700 9px/1 var(--font-ui); font-style: normal; }
.loading { padding: 40px 16px; text-align: center; color: var(--ink-2); }
.sheet .card { border: 0; padding: 0; margin: 0; box-shadow: none; background: none; }
.sheet .card.sel { box-shadow: none; }
.map-route[hidden], .sheet[hidden], .toast[hidden] { display: none !important; }
.sheet { background: var(--bg); }
.sheet .walk { margin-inline-end: 30px; }
@media (max-width: 899px) {
  .hdr-title { margin: 4px 0 6px; }
  .hdr-title h1 { font-size: 20px; }
  [dir="rtl"] .hdr-title h1, html[lang="zh"] .hdr-title h1, html[lang="ja"] .hdr-title h1, html[lang="ko"] .hdr-title h1, html[lang="hi"] .hdr-title h1, html[lang="ru"] .hdr-title h1 { font-size: 17px; }
  .chip { font-size: 12px; padding: 2px 8px; }
  .logo { width: 104px; height: 34px; }
}
[dir="rtl"] .list-plain li .v[dir="ltr"] { text-align: left; }
