@charset "UTF-8";

:root {
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  color-scheme: light;
  color: #1a253e;
  background: #f0f0f4;
  font-size: 125%;
  --ink: #1a253e;
  --muted: #505a71;
  --accent: #85412c;
  --gold: #f2cb86;
  --line: #cbd0dc;
  --panel: #fdfcfb;
  --dark: #172139;
  --label: #182541;
}
:root.large { font-size: 137.5%; }
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 12% 0%, #fff9f0 0%, #f3f2f5 47%, #ebedf4 100%); }
button, input, select { font: inherit; }
button, select { cursor: pointer; color: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #a7553b; outline-offset: 3px; }
a { color: inherit; text-underline-offset: .22em; }
[hidden] { display: none !important; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: absolute; top: 8px; left: 8px; background: var(--dark); color: white; padding: 12px; z-index: 20; }
h1, h2, h3, p { margin-top: 0; }

.masthead { border-bottom: 2px solid #bd8263; background: #172139; color: #fcf8f0; }
.masthead-inner, .layout { width: min(100%, 1680px); margin-inline: auto; padding-inline: clamp(18px, 3.1vw, 48px); }
.masthead-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 66px; }
.identity { display: flex; align-items: center; gap: 11px; line-height: 1.35; }
.identity strong { display: block; letter-spacing: .11em; }
.identity div span { display: block; margin-top: 2px; font-size: .8125rem; color: #d5d9e6; }
.monogram { height: 42px; width: 47px; display: grid; place-items: center; border: 1px solid #c89975; border-radius: 6px; color: #ffe2b3; background: #29344e; font-family: Georgia, serif; font-size: .875rem; letter-spacing: .08em; }
.header-actions { display: flex; align-items: center; gap: clamp(10px, 2vw, 24px); font-size: .875rem; }
.header-actions button, .header-actions a { padding: 8px 0; color: inherit; background: none; border: 0; white-space: nowrap; }
.header-actions button[aria-pressed="true"], .header-actions a:hover { color: var(--gold); }
.header-actions .outline { padding: 8px 12px; border: 1px solid #c99f83; border-radius: 7px; color: #ffe2bd; background: #bc846914; }
.header-actions .outline:hover { background: #bc846930; }
.intro { position: relative; isolation: isolate; min-height: 135px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 13px 24px; padding-block: 18px; }
.intro::before { content: ""; position: absolute; inset: 0 0 0 47%; z-index: -1; background: url("assets/shuinan-atlas.jpg") center 35% / cover; opacity: .31; mask-image: linear-gradient(to right, transparent, black 70%); }
.campus-name { margin: 0 0 6px; color: var(--gold); font-size: .875rem; font-weight: 700; letter-spacing: .11em; }
h1 { margin: 0; font-family: "Noto Serif TC", "PMingLiU", serif; font-size: clamp(2rem, 4.3vw, 3.85rem); line-height: 1.12; letter-spacing: .035em; color: var(--ink); }
h1 span { color: var(--accent); }

.workspace {
  display: grid;
  grid-template-columns: minmax(270px, 322px) minmax(0, 1fr);
  grid-template-rows: 1fr;
  background: var(--panel);
  border: 1px solid #b6bdcf;
  border-radius: 16px;
  overflow: clip;
  box-shadow: 0 20px 52px #28385828;
}
.search-panel, .browse { min-width: 0; padding-inline: 15px; }
.search-panel { padding-block: 11px; }
.browse { grid-column: 1; grid-row: 1; padding-block: 14px 16px; }
#search-form label { font-weight: 800; font-size: 1.0625rem; }
.search-box { display: flex; border: 1px solid #929eb6; border-radius: 8px; overflow: hidden; margin-top: 8px; background: #fff; }
.search-box:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-box input { min-width: 0; width: 100%; border: 0; background: transparent; padding: 10px 11px; outline: none; color: var(--ink); }
.search-box input::placeholder { color: #616a80; opacity: 1; }
.search-box button { width: 47px; flex: none; background: #273856; color: #fff9ed; border: 0; display: grid; place-items: center; }
.search-box button:hover { background: #40537c; }
.magnifier { width: 14px; height: 14px; border: 2px solid currentColor; border-radius: 50%; position: relative; }
.magnifier::after { content: ""; position: absolute; width: 6px; height: 2px; background: currentColor; transform: rotate(45deg); right: -5px; bottom: -3px; }
.quick { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.quick button { border-radius: 40px; padding: 4px 9px; color: #344665; background: #eef1f8; border: 1px solid #cbd4e5; font-size: .875rem; }
.quick button:hover { background: #e0e7f6; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-bottom: 7px; }
.section-title h2 { font-size: 1rem; margin: 0; }
.text-button { border: 0; background: none; color: var(--accent); border-radius: 5px; text-decoration: underline; text-underline-offset: .23em; font-weight: 700; padding: 4px; font-size: .875rem; }
.text-button:hover { background: #f6e6db; }
#identity-filter { width: 100%; border: 1px solid #9daac1; background: #fff; border-radius: 7px; padding: 8px; font-size: .9375rem; }
.topic-list { display: grid; gap: 5px; margin-top: 9px; }
.topic-button { width: 100%; min-height: 54px; display: flex; align-items: center; gap: 10px; text-align: left; background: linear-gradient(125deg, #fffdfa, #eff1f8); border: 1px solid #d0d6e3; padding: 6px 8px; border-radius: 9px; font-size: .95rem; line-height: 1.3; font-weight: 750; box-shadow: 0 2px 0 #dce0e9; transition: background-color .16s, box-shadow .16s, border-color .16s, translate .16s; }
.topic-button:hover, .topic-button[aria-pressed="true"] { border-color: #bc8e55; background: linear-gradient(125deg, #fff9ee, #f7e7c5); color: #643921; box-shadow: 0 3px 0 #dccaaf; }
.topic-button:hover { translate: 2px 0; }
.topic-button:active { translate: 1px 2px; box-shadow: none; }
.topic-count { margin-left: auto; padding: 2px 6px; color: #475573; background: #e8ecf7; border: 1px solid #d6dcee; border-radius: 6px; font-size: .8125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.topic-icon {
  flex: none;
  width: 42px;
  height: 42px;
  border: 1px solid #ba9d6a;
  border-color: color-mix(in srgb, var(--topic) 48%, #f3d59f);
  border-radius: 9px;
  background: #17233b url("assets/topic-inventory.jpg") var(--icon-x, 0%) var(--icon-y, 0%) / 300% 300% no-repeat;
}
.topic-icon[data-icon="suitcase"], .topic-icon[data-icon="dice"], .topic-icon[data-icon="compass"] { --icon-x: 50%; }
.topic-icon[data-icon="clipboard"], .topic-icon[data-icon="medal"], .topic-icon[data-icon="chat"] { --icon-x: 100%; }
.topic-icon[data-icon="stethoscope"], .topic-icon[data-icon="dice"], .topic-icon[data-icon="medal"] { --icon-y: 50%; }
.topic-icon[data-icon="id-card"], .topic-icon[data-icon="compass"], .topic-icon[data-icon="chat"] { --icon-y: 100%; }
#search-section { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
#search-status { color: var(--muted); font-size: .875rem; margin-bottom: 6px; }
#jump-to-map { margin-bottom: 6px; }
#search-results { display: grid; gap: 5px; }
.question-button { display: block; width: 100%; border: 1px solid #b8c3d7; text-align: left; border-radius: 8px; color: var(--ink); background: #f2f5fc; padding: 10px 12px; line-height: 1.5; font-size: .95rem; }
.question-button:hover { background: #e4ebfa; border-color: #7189b6; }
.question-button:active { background: #dbe4f8; }

.map-region { grid-column: 2; grid-row: 1; min-width: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: #222e48; }
.map { position: relative; height: clamp(540px, calc(100svh - 188px), 750px); overflow: clip; background: #303a54; isolation: isolate; touch-action: none; cursor: grab; }
.map:focus-visible { outline-offset: -4px; }
.map::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 36%, #526181, #26324c 76%); }
.map.is-dragging { cursor: grabbing; }
.map-plane { position: absolute; top: 0; left: 0; transform-origin: 0 0; user-select: none; }
.map-plane img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.map-pin {
  position: absolute;
  left: var(--pin-x);
  top: var(--pin-y);
  transform: translate(-50%, -50%) scale(var(--pin-scale, 1));
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  padding: 6px 15px 6px 7px;
  border: 2px solid #e9d7a7;
  border-radius: 10px;
  background-color: var(--label);
  background-image: linear-gradient(170deg, #53658d5e 0%, #18254100 65%);
  color: #fffdf7;
  box-shadow: 0 0 0 1px #171e34, 0 4px 0 #121a2d, 0 8px 16px #11192e94;
  font-size: clamp(.95rem, 2vw, 1.15rem);
  font-weight: 800;
  z-index: 1;
  transition: translate .16s cubic-bezier(.2, .75, .3, 1), background-color .16s, border-color .16s, box-shadow .16s;
}
.map-pin:hover, .map-pin:focus-visible { z-index: 4; translate: 0 calc(-3px * var(--pin-scale, 1)); background-color: #384b73; outline: 2px solid #ffe3a2; outline-offset: 2px; }
.map-pin:active { translate: 0 calc(2px * var(--pin-scale, 1)); box-shadow: 0 0 0 1px #171e34, 0 2px 7px #11192eb0; }
.map-pin.is-active { z-index: 3; background-color: #ffdb78; background-image: linear-gradient(170deg, #fff8d8b3, #ffd26f00 80%); border-color: #fffae9; color: #20273b; box-shadow: 0 0 0 2px #775320, 0 0 18px #ffe797b0, 0 5px 14px #11192eaa; }
.map-pin.is-chosen { z-index: 5; }
.map-pin.is-chosen::after { content: ""; position: absolute; inset: -4px; border: 2px solid #ffecb6; border-radius: inherit; pointer-events: none; animation: selection-glow .42s ease-out both; }
.map-pin .topic-icon { width: clamp(33px, 3.6vw, 48px); height: auto; aspect-ratio: 1; border-radius: 8px; box-shadow: 0 1px 2px #090e2355, inset 0 1px #fff3; }
.map-pin.is-muted:not(:focus-visible):not(:hover) { background-color: #46506b; border-color: #eeeadd; }
.map-meta, .map-controls {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  color: #fdf9e9;
  border: 1px solid #e5ddbd63;
  border-radius: 8px;
  background: #17233cf5;
  box-shadow: 0 4px 14px #12192d75;
}
.map-meta { bottom: 13px; left: 15px; padding: 0 8px; font-size: .8125rem; }
.map-caption { padding: 7px 5px 7px 2px; background: none; border: 0; font-weight: 750; }
.map-caption:hover { color: #ffe4a9; }
#zoom-level { border-left: 1px solid #e5ddbd50; margin-left: 2px; padding-left: 7px; font-variant-numeric: tabular-nums; }
.map-controls { right: 15px; bottom: 13px; padding: 3px; gap: 2px; }
.map-controls button { min-width: 42px; min-height: 42px; border: 0; border-radius: 5px; background: #364668; color: #fff7e3; font-size: 1.25rem; line-height: 1; }
.map-controls button:hover { background: #51658c; }
.map-controls button:disabled { color: #b8c1d6; background: #23314e; cursor: default; }
.map-help { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; padding: 8px 13px; margin: 0; background: #202c46; color: #e2e7f2; font-size: .8125rem; line-height: 1.5; }
.map-help a:hover { color: var(--gold); }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding: 13px 1px 18px; color: var(--muted); font-size: .8125rem; }

dialog { position: fixed; inset: 0 clamp(18px, 3vw, 44px) 0 auto; margin: auto 0; width: min(640px, calc(100vw - 52px)); max-width: 100%; max-height: min(85dvh, 820px); border: 2px solid #cfaf72; border-radius: 16px; padding: 0; color: var(--ink); background: #fbf6eb; box-shadow: 0 0 0 5px #15213b95, -8px 16px 65px #0d19399c; }
dialog[open] { display: flex; flex-direction: column; animation: open-topic .25s cubic-bezier(.2, .82, .24, 1) both; }
dialog::backdrop { background: #101b38aa; animation: fade-backdrop .2s ease-out both; }
.detail-heading { flex: none; display: flex; justify-content: space-between; align-items: start; gap: 12px; padding: 22px 23px 20px; background: linear-gradient(110deg, #172541fa 20%, #263b63e8 65%, #16233cc7), url("assets/shuinan-atlas.jpg") center 35% / cover; color: #fff8e5; border-bottom: 3px double #d4b876; }
.detail-identity { display: flex; align-items: center; gap: 14px; min-width: 0; overflow-wrap: anywhere; }
.detail-emblem { flex: none; padding: 3px; border-radius: 13px; border: 1px solid #eecb80; background: #f0cf8526; box-shadow: 0 0 16px #efc76b47; }
.detail-emblem .topic-icon { display: block; width: 64px; height: 64px; border-radius: 9px; }
.detail-heading h2 { margin: 0; font-family: "Noto Serif TC", "PMingLiU", serif; font-size: 1.55rem; line-height: 1.35; }
#close-details { width: 44px; height: 44px; flex: none; font-size: 1.6rem; border: 1px solid #d6bd88; border-radius: 8px; color: inherit; background: #142039bc; transition: background-color .16s, translate .16s; }
#close-details:hover { background-color: #46547b; }
#close-details:active { translate: 0 2px; }
#close-details:focus-visible { outline-color: #efcf8d; }
.detail-content { min-height: 0; padding: 19px 23px 24px; overflow: auto; overscroll-behavior: contain; scrollbar-color: #a28661 #fbf6eb; }
.detail-content :focus-visible { outline-color: #7f5a25; }
.detail-content p { line-height: 1.7; margin-bottom: 12px; overflow-wrap: anywhere; }
.question-group { margin: 0 0 19px; }
.question-group h3 { margin: 0 0 8px; font-size: 1rem; color: #4b5774; }
.faq-row { border: 1px solid #d9c9a7; border-radius: 10px; background: #fffdfa; margin-bottom: 10px; padding: 0 15px; box-shadow: 0 2px 0 #eee3cf; }
.faq-row:has(summary:hover), .faq-row[open] { border-color: #b69357; background: #fff9ea; }
.faq-row summary { display: grid; grid-template-columns: 11px minmax(0, 1fr) 12px; align-items: center; gap: 11px; list-style: none; cursor: pointer; font-weight: 750; line-height: 1.5; padding: 13px 0; }
.faq-row summary::-webkit-details-marker { display: none; }
.faq-row summary::before { content: ""; width: 7px; height: 7px; rotate: 45deg; border: 1px solid #aa7f42; background: #f6dca8; }
.faq-row summary::after { content: ""; justify-self: end; width: 7px; height: 7px; border: solid #8b5f2a; border-width: 0 2px 2px 0; rotate: 45deg; transition: rotate .17s; }
.faq-row[open] summary::after { rotate: 225deg; }
.faq-row[open] .answer { animation: reveal-answer .18s ease-out both; }
.answer { padding: 0 0 10px; }
.answer-status { display: inline-block; margin-bottom: 8px; background: #f3e5c2; color: #674c25; padding: 3px 8px; border-radius: 5px; font-size: .875rem; }
.next-step { padding: 9px 11px; background: #eef1fa; border-radius: 7px; }
.source-meta { color: #515e79; font-size: .875rem; }
.copy-answer { background: #eef1fa; border: 1px solid #cdd6ea; border-radius: 6px; padding: 6px 9px; font-size: .875rem; }
.official-links { display: grid; gap: 8px; }
.official-links a { display: block; background: #eef1fa; border-radius: 8px; padding: 9px 11px; }

.view-tabs { display: flex; gap: 6px; padding: 5px; background: #182540; border: 1px solid #a68750; border-radius: 12px; box-shadow: 0 4px 13px #26324b33; }
.view-tabs button { min-height: 43px; padding: 6px 16px; border: 1px solid #7b8293; border-radius: 7px; background: #293855; color: #fff5df; font-weight: 800; white-space: nowrap; }
.view-tabs button[aria-selected="true"] { border-color: #ffe5a3; color: #322136; background: linear-gradient(#fff0c6, #eab967); box-shadow: inset 0 0 0 2px #ffffff6b; }
.view-tabs button:hover:not([aria-selected="true"]) { border-color: #ebcc8e; background: #3c4c71; }
.search-panel { margin-bottom: 15px; background: #fffcf7; border: 1px solid #d9ccb3; border-radius: 12px; }
.search-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 15px; }
.search-tools form { flex: 1 1 16rem; min-width: 0; }
.search-tools .search-box, .search-tools .quick { margin-top: 0; }
.filter-tools { display: flex; align-items: center; gap: 8px; }
.filter-tools #identity-filter { width: auto; max-width: 100%; }
.filter-tools .text-button { white-space: nowrap; }
#search-results { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }

.atlas-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.23fr) minmax(0, 1fr);
  gap: 15px;
  align-items: start;
}
.collection, .handbook { min-width: 0; border: 1px solid #bc9d67; border-radius: 15px; box-shadow: 0 12px 30px #47354e29; }
.collection {
  padding: 17px;
  color: #fff5df;
  background:
    radial-gradient(ellipse at 50% 1%, #3f5177 0, transparent 70%),
    repeating-linear-gradient(142deg, #ffffff04 0 1px, transparent 1px 6px),
    #17243e;
  box-shadow: inset 0 0 0 4px #0f192e, inset 0 0 0 5px #a48854a8, 0 12px 30px #47354e29;
}
.collection-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 4px 12px; }
.collection-heading h2 { margin: 0; font-family: "Noto Serif TC", "PMingLiU", serif; font-size: 1.45rem; letter-spacing: .07em; }
#atlas-count { color: #e6c68c; font-size: .875rem; white-space: nowrap; }
.atlas-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.atlas-card {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  min-height: 177px;
  min-width: 0;
  padding: 9px 5px 11px;
  overflow-wrap: anywhere;
  border: 2px solid #917751;
  border-radius: 12px;
  color: #fff3db;
  background: radial-gradient(ellipse at 50% 32%, #405270, #192641 82%);
  box-shadow: inset 0 0 0 3px #111c32, inset 0 0 0 4px #c09b665c, 0 4px 0 #09142a;
  transition: translate .16s, border-color .16s, box-shadow .16s;
}
.atlas-card::before, .atlas-card::after { content: ""; position: absolute; top: 10px; width: 6px; height: 6px; border-top: 1px solid #f1c786; border-left: 1px solid #f1c786; }
.atlas-card::before { left: 10px; }
.atlas-card::after { right: 10px; rotate: 90deg; }
.atlas-card:hover { translate: 0 -2px; border-color: #f3d493; }
.atlas-card:active { translate: 0 2px; }
.atlas-card.has-match { border-color: #d9af67; }
.atlas-card[aria-pressed="true"] { border-color: #ffe4a0; background: radial-gradient(ellipse at 50% 28%, #705b52, #2b314f 76%); box-shadow: inset 0 0 0 2px #f4bc5b8c, 0 0 13px #eeb954ad, 0 4px 0 #7d5428; }
.atlas-card .topic-icon { display: block; width: clamp(70px, 7vw, 110px); height: auto; aspect-ratio: 1; border-radius: 10px; box-shadow: 0 3px 10px #0b14298f; }
.atlas-card strong { padding-inline: 2px; font-size: 1.045rem; line-height: 1.25; }
.atlas-card-count { font-size: .78rem; color: #e5c995; }
.handbook {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: clamp(530px, calc(100dvh - 320px), 800px);
  overflow: hidden;
  background: radial-gradient(ellipse at 90% 8%, #fff9e8, #f8edda 80%);
}
.handbook-header { padding: 17px 20px; color: #fff3dc; background: linear-gradient(95deg, #23314ff7, #273d63c9), url("assets/shuinan-atlas.jpg") center 35% / cover; border-bottom: 3px double #c9a565; }
.handbook-title-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.handbook-emblem .topic-icon { display: block; width: 63px; height: 63px; border-radius: 9px; box-shadow: 0 0 0 3px #c4a56533; }
.handbook-header h2 { margin: 0; font-family: "Noto Serif TC", "PMingLiU", serif; font-size: clamp(1.36rem, 2.4vw, 2rem); line-height: 1.16; }
.handbook-header h2:focus { outline: none; }
#back-to-cards { display: none; }
.handbook-content { padding: 16px 17px 5px 20px; overflow: auto; overscroll-behavior: contain; scrollbar-color: #b49a6a #f8ebd0; }
.handbook-content .question-group h3 { padding-bottom: 4px; border-bottom: 1px solid #dbc8a5; color: #5d432e; }
.handbook-footer { padding: 11px 16px; border-top: 1px solid #d3b785; background: #f4e4c7; }
#handbook-map, .map-to-atlas { display: block; border: 1px solid #bc9358; border-radius: 8px; padding: 8px 13px; background: #233353; color: #fff1d5; font-weight: 750; }
#handbook-map:hover, .map-to-atlas:hover { background: #3d4d70; }
.map-to-atlas { margin-bottom: 15px; }

@media (max-width: 980px) {
  .atlas-workspace { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .handbook { height: auto; }
  .handbook-content { max-height: min(60dvh, 550px); }
  #back-to-cards { display: inline-block; margin: -5px 0 9px; color: #ffe6ac; }
}

@media (max-width: 880px) {
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .map-region { grid-row: 1; grid-column: 1; border-left: 0; }
  .browse { grid-row: 2; grid-column: 1; padding-block: 12px; border-top: 1px solid var(--line); }
  .map { height: clamp(304px, 69vw, 510px); }
  .topic-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
}
@media (max-width: 550px) {
  .masthead-inner, .layout { padding-inline: 12px; }
  .masthead-inner { min-height: 56px; column-gap: 8px; }
  .monogram { width: 34px; height: 34px; font-size: .75rem; }
  .identity { gap: 7px; }
  .identity strong { font-size: .875rem; letter-spacing: .04em; }
  .identity div span { font-size: .69rem; }
  .header-actions { gap: 7px; font-size: .8125rem; }
  .header-actions button span, .header-actions > a { display: none; }
  .header-actions .outline { padding-inline: 7px; }
  .intro { display: grid; min-height: 0; gap: 9px; padding-block: 13px 10px; }
  .intro::before { inset-inline-start: 30%; }
  h1 { font-size: clamp(1.6rem, 9vw, 1.92rem); letter-spacing: .025em; }
  .campus-name { margin-bottom: 5px; }
  .workspace { border-radius: 11px; }
  .search-panel, .browse { padding-inline: 10px; }
  #search-form label { font-size: 1rem; }
  .search-box { margin-top: 5px; }
  .search-box input { padding-block: 8px; }
  .quick { margin-top: 6px; }
  .view-tabs { width: 100%; }
  .view-tabs button { flex: 1; padding-inline: 6px; }
  .search-panel { margin-bottom: 11px; }
  .search-tools { gap: 7px 12px; }
  .search-tools form { flex-basis: 100%; }
  .filter-tools { flex: 1 1 100%; justify-content: space-between; }
  .filter-tools #identity-filter { min-width: 0; }
  .collection { padding: 12px; }
  .collection-heading { padding: 2px 2px 9px; }
  .atlas-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .atlas-card { min-height: 140px; }
  .atlas-card .topic-icon { width: 72px; }
  .handbook-header { padding: 12px 14px; }
  .handbook-emblem .topic-icon { width: 50px; height: 50px; }
  .handbook-content { padding: 12px 13px 2px; }
  .map { height: clamp(325px, 78vw, 360px); }
  .map-pin {
    left: var(--pin-mobile-x);
    top: var(--pin-mobile-y);
    flex-direction: column;
    gap: 2px;
    width: clamp(91px, 29.25vw, 118px);
    border-radius: 9px;
    font-size: .9rem;
    line-height: 1.09;
    padding: 3px 1px;
    text-align: center;
    white-space: normal;
  }
  .map-pin .topic-icon { width: 35px; border-radius: 6px; }
  .map-meta { bottom: 7px; left: 7px; font-size: .75rem; }
  .map-controls { right: 7px; bottom: 7px; }
  .map-controls button { min-width: 34px; min-height: 33px; }
  .map-help { padding: 5px 9px; font-size: .75rem; }
  .topic-button { gap: 6px; padding-inline: 6px; font-size: .875rem; }
  .topic-button .topic-icon { width: 36px; height: 36px; }
  .topic-count { font-size: .8125rem; }
  dialog { inset: auto 0 0 0; margin: 0; width: 100%; max-height: 84dvh; border-radius: 16px 16px 0 0; border-width: 2px 0 0; }
  .detail-heading, .detail-content { padding-inline: 16px; }
  .detail-identity { gap: 10px; }
  .detail-emblem .topic-icon { width: 47px; height: 47px; }
  .detail-heading h2 { font-size: 1.36rem; }
}
@media (max-width: 360px) {
  .header-actions .outline { font-size: .75rem; }
}
@media (max-width: 349px) {
  .map-pin { font-size: .79rem; padding-block: 2px; }
  .map-pin .topic-icon { width: 31px; }
}

@keyframes selection-glow {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.28); }
}
@keyframes open-topic {
  from { opacity: 0; translate: 0 16px; scale: .97; }
  to { opacity: 1; translate: 0 0; scale: 1; }
}
@keyframes fade-backdrop { from { opacity: 0; } to { opacity: 1; } }
@keyframes reveal-answer { from { opacity: .15; translate: 0 4px; } to { opacity: 1; translate: 0 0; } }

@media (prefers-reduced-motion: reduce) {
  .topic-button, .atlas-card, .map-pin, #close-details, .faq-row summary::after { transition: none; }
  dialog[open], dialog::backdrop, .map-pin.is-chosen::after, .faq-row[open] .answer { animation: none; }
  .map-pin.is-chosen::after { opacity: 0; }
}
