:root { color-scheme: dark; font-family: Georgia, 'Times New Roman', serif; background: #041217; color: #f3efdf; }
* { box-sizing: border-box; }
body { margin: 0; font-size: 17px; line-height: 1.4; }
a { color: inherit; text-underline-offset: 4px; }
a:focus-visible { outline: 3px solid #ffd47a; outline-offset: 5px; }
.guide { max-width: 640px; min-height: 100vh; margin: auto; padding: 0 26px; background: #03191f url('alt.jpeg') center top / 100% auto no-repeat; box-shadow: 0 0 45px #0009; }
.map-banner { aspect-ratio: 640 / 106; margin-inline: -26px; }
nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 13px; }
.back, .nav-label, .city-label, .item-label { background: #f4f1e4; color: #141913; border: 2px solid var(--city-color, #a9c6c8); border-radius: 12px 9px 12px 7px; box-shadow: inset 0 0 0 1px #fff, 1px 3px 4px #0007; font-weight: 700; }
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 13px; text-decoration: none; }
.back:hover { background: #fff9e7; }
.back span { font-family: Arial, sans-serif; font-size: 24px; }
.nav-label { padding: 5px 12px; font-size: 16px; }
header { padding: 5px 0 23px; text-align: center; }
.city-art { display: block; width: 240px; max-width: 65%; height: 128px; object-fit: contain; margin: auto; filter: drop-shadow(0 4px 3px #0009); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
section { margin-bottom: 28px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding-bottom: 9px; border-bottom: 1px dashed #91b4b570; }
h2 { margin: 0; color: #f3db9b; font-size: 24px; line-height: 1.2; text-shadow: 1px 2px 1px #000; }
.count { color: #d0dcd3; white-space: nowrap; font-size: 14px; text-shadow: 1px 1px #000; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
thead { background: #020c0ed9; color: #e3d8b8; }
th, td { text-align: left; padding: 10px; }
thead th { font-size: 15px; font-weight: 400; border-block: 1px solid #78929050; }
tbody th { font-weight: 400; }
tbody tr { border-bottom: 1px dashed #78929060; background: #00111765; }
.flights th:first-child { width: 67%; }
.flights td, .flights thead th:last-child { text-align: right; white-space: nowrap; }
.flights tbody th { padding: 5px 10px; }
.destination { display: inline-flex; align-items: center; min-height: 72px; max-width: 100%; border-radius: 8px; }
.destination img { display: block; width: 175px; max-width: 100%; height: 72px; object-fit: contain; object-position: left center; filter: drop-shadow(0 2px 2px #0008); }
.destination:hover { filter: brightness(1.15); }
.city-label { display: inline-block; margin-block: 14px; padding: 3px 14px; }
.flight-time { display: inline-block; color: #f9e9bd; font-size: 21px; font-weight: 700; text-shadow: 1px 2px #000; }
.stocks th:first-child { width: 58%; }
.stocks td, .stocks thead th:not(:first-child) { text-align: right; white-space: nowrap; }
.stocks td { font-size: 18px; font-weight: 700; text-shadow: 1px 2px #000; }
.stocks td:last-child { color: #ffe4a2; }
.item { display: flex; align-items: center; gap: 9px; }
.item img { width: 64px; height: 64px; flex-shrink: 0; object-fit: contain; filter: drop-shadow(0 3px 2px #0009); }
.item-label { padding: 3px 8px; font-size: 17px; line-height: 1.15; }
.note { margin: 12px 0 0; padding: 8px 10px; background: #021116b8; color: #c3d1cc; font: 14px/1.5 Arial, Helvetica, sans-serif; }
.unknown { color: #c3d1cc; font-size: 14px; font-weight: 400; }
.estimate { color: #ffdb84; padding-left: 3px; }
.empty { padding: 18px; margin: 0; background: #021116b8; border: 1px dashed #91b4b570; color: #e0e4d5; }
footer { border-top: 1px dashed #91b4b570; padding: 17px 0 24px; color: #b4c8c3; font: 13px/1.5 Arial, Helvetica, sans-serif; text-align: center; }
@media (max-width: 440px) {
  .guide { padding-inline: 14px; }
  .map-banner { margin-inline: -14px; }
  header { padding-bottom: 18px; }
  .city-art { width: 210px; height: 112px; }
  h2 { font-size: 21px; }
  th, td { padding-inline: 6px; }
  .flights tbody th { padding-inline: 6px; }
  .destination img { width: 155px; height: 66px; }
  .destination { min-height: 66px; }
  .flight-time { font-size: 19px; }
  .stocks th:first-child { width: 56%; }
  .item { gap: 5px; }
  .item img { width: 44px; height: 50px; }
  .item-label { font-size: 16px; padding: 3px 5px; }
  .stocks td { font-size: 16px; }
  .stocks thead th { font-size: 14px; }
  .nav-label { font-size: 14px; }
}
@media print {
  :root { color-scheme: light; background: white; color: black; }
  .guide { background: white; box-shadow: none; max-width: none; }
  nav, .map-banner { display: none; }
  h2, .flight-time, .stocks td, .note, .unknown, .count, footer { color: #222; text-shadow: none; }
  thead, tbody tr, .note, .empty { background: transparent; color: black; }
  tr { break-inside: avoid; }
}

/* Local items have a dedicated price row so ranges fit on narrow screens. */
.local-specialty { padding: 14px 12px; margin-bottom: 12px; background: #001117bf; border: 1px solid #78929070; border-radius: 7px; }
.local-specialty h3 { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-weight: 400; }
.local-specialty h3 img { width: 64px; height: 64px; flex-shrink: 0; object-fit: contain; filter: drop-shadow(0 3px 2px #0009); }
.local-specialty .item-label { font-size: 18px; }
.local-prices { display: grid; grid-template-columns: minmax(64px, 1fr) minmax(0, 3fr); gap: 14px; margin: 0; padding-top: 10px; border-top: 1px dashed #78929070; }
.local-prices > div:last-child { border-left: 1px solid #78929070; padding-left: 14px; }
.local-prices dt { color: #c3d1cc; font: 14px/1.4 Arial, Helvetica, sans-serif; margin-bottom: 5px; }
.local-prices dd { margin: 0; color: #ffe4a2; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.5; }
.range-low, .range-high { white-space: nowrap; }
.range-to { font-size: 14px; color: #c3d1cc; font-weight: 400; }
@media (max-width: 440px) {
  .local-specialty { padding: 12px 10px; }
  .local-prices { gap: 10px; }
  .local-prices > div:last-child { padding-left: 10px; }
  .local-prices dd { font-size: 18px; }
}
@media print {
  .local-specialty { background: white; }
  .local-prices dt, .local-prices dd, .range-to { color: #222; }
}

/* Other city shops remain compact until the reader opens a category. */
.shop-category { margin-bottom: 10px; border: 1px solid #78929070; border-radius: 7px; background: #001117e6; }
.shop-category summary { display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 10px 12px; cursor: pointer; list-style: none; }
.shop-category summary::-webkit-details-marker { display: none; }
.shop-category summary::after { content: '+'; color: #f3db9b; font: 24px/1 Arial, sans-serif; width: 18px; text-align: center; flex-shrink: 0; }
.shop-category[open] summary::after { content: '−'; }
.shop-category summary:hover { background: #ffffff08; }
.shop-category summary:focus-visible { outline: 3px solid #ffd47a; outline-offset: 3px; }
.shop-category summary img { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
.shop-category-name { color: #f3efdf; font-size: 19px; font-weight: 700; }
.shop-count { margin-left: auto; color: #becfc8; white-space: nowrap; font: 14px/1.3 Arial, sans-serif; }
.shop-items { padding: 0 14px; }
.shop-item { padding: 16px 0; border-top: 1px dashed #78929070; }
.shop-item-top { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.shop-item-art { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 3px 2px #0009); }
.shop-item h3 { margin: 0; font-size: 18px; line-height: 1.25; }
.shop-item .item-label { display: inline-block; font-size: 18px; }
.shop-price { margin: 0; text-align: right; }
.shop-price span { display: block; color: #becfc8; font: 13px/1.4 Arial, sans-serif; }
.shop-price strong { color: #ffe4a2; font-size: 20px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.shop-description { margin: 12px 0 0; color: #d5dfda; font: 15px/1.55 Arial, Helvetica, sans-serif; white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 440px) {
  .shop-category summary { padding: 10px; gap: 8px; }
  .shop-category-name { font-size: 17px; }
  .shop-count { font-size: 13px; }
  .shop-category summary img { width: 30px; height: 30px; }
  .shop-items { padding-inline: 12px; }
  .shop-item-top { grid-template-columns: 56px minmax(0, 1fr); gap: 5px 10px; }
  .shop-item-art { width: 56px; height: 62px; grid-row: 1 / 3; }
  .shop-item .item-label { font-size: 17px; }
  .shop-price { grid-column: 2; text-align: left; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
  .shop-price strong { font-size: 19px; }
}
@media print {
  .shop-category { background: white; }
  .shop-category-name, .shop-count, .shop-price span, .shop-price strong, .shop-description { color: #222; }
  .shop-item { break-inside: avoid; }
}

/* A labeled info control is easier to discover than an unexplained icon. */
.stock-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.stock-heading h3 { flex: 1; min-width: 0; margin: 0; }
.stock-info { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; flex-shrink: 0; min-width: 60px; min-height: 52px; padding: 4px; border: 0; background: transparent; color: #f1dfaf; cursor: pointer; }
.info-bubble { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #cfb878; border-radius: 50%; background: #f4f1e4; color: #172522; box-shadow: inset 0 0 0 1px #fff; font: bold 19px/1 Georgia, serif; }
.info-caption { font: 13px/1.25 Georgia, serif; white-space: nowrap; }
.stock-info:hover .info-bubble { background: #fff9e7; }
.stock-info:focus-visible, .sell-dialog button:focus-visible, .sell-scroll:focus-visible { outline: 3px solid #ffd47a; outline-offset: 2px; }
.sell-dialog { color-scheme: dark; width: min(480px, calc(100% - 24px)); max-width: none; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 0; border: 2px solid #7d9187; border-radius: 7px; background: #03191f url('alt.jpeg') center -130px / 640px auto no-repeat; color: #f3efdf; box-shadow: 0 8px 30px #000b; overflow: hidden; }
.sell-dialog::backdrop { background: #0009; }
.sell-panel { display: flex; flex-direction: column; max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px); }
.sell-dialog-heading { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 18px; border-bottom: 1px dashed #91b4b570; background: #020d1099; }
.sell-dialog-heading h2 { font-size: 24px; color: #f3db9b; }
.sell-dialog form { margin: 0; }
.dialog-close { display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--city-color, #a9c6c8); border-radius: 9px 7px 9px 6px; background: #f4f1e4; color: #172522; font: 30px/1 Arial, sans-serif; cursor: pointer; }
.sell-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px; }
.sell-item { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sell-item > img { width: 64px; height: 64px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 2px 2px #0009); }
.sell-item h3 { margin: 0 0 8px; font: bold 21px/1.2 Georgia, serif; }
.sell-item .item-label { display: inline-block; font-size: 20px; }
.sell-item p { margin: 0 0 2px; color: #cedad4; font: 15px/1.4 Georgia, serif; }
.sell-item strong { display: block; color: #ffe4a2; font-size: 17px; font-variant-numeric: tabular-nums; }
.sell-note { margin: 14px 4px 2px; color: #becdc5; font: italic 14px/1.45 Georgia, serif; text-align: center; }
.sell-table { table-layout: fixed; width: 100%; }
.sell-table th:first-child { width: 51%; }
.sell-table thead th { font: 15px/1.4 Georgia, serif; color: #e4d6af; padding: 9px 6px; }
.sell-table thead th:last-child, .sell-table td { text-align: right; }
.sell-table tbody th { padding: 4px; }
.sell-table tbody img { display: block; width: 150px; max-width: 100%; height: 64px; object-fit: contain; object-position: left center; }
.sell-table td { padding: 8px 5px; color: #ffe4a2; font-size: 18px; font-weight: 700; }
.sell-table .range-high { display: block; }
.sell-dialog-footer { flex-shrink: 0; padding: 10px 14px max(12px, env(safe-area-inset-bottom)); border-top: 1px dashed #91b4b570; background: #021216cc; text-align: center; }
.dialog-done { min-height: 44px; max-width: 100%; padding: 8px 20px; border: 2px solid var(--city-color, #a9c6c8); border-radius: 12px 9px 12px 7px; background: #f4f1df; color: #152020; font: bold 17px/1.3 Georgia, serif; cursor: pointer; box-shadow: inset 0 0 0 1px #fff; }
@media (max-width: 360px) {
  .stock-heading h3 { gap: 8px; }
  .stock-heading h3 img { width: 48px; height: 56px; }
  .stock-heading .item-label { font-size: 16px; }
  .sell-scroll { padding: 10px; }
  .sell-table td { font-size: 16px; }
}
@media print { .stock-info, .sell-dialog { display: none !important; } }
