:root {
  color-scheme: light;
  --paper: #f7f5ee;
  --white: #fffdf8;
  --ink: #24231f;
  --muted: #5c5c54;
  --line: #ddd8ca;
  --accent: #9b382b;
  --accent-dark: #782a22;
  --forest: #212721;
  --title: "Songti SC", "Noto Serif SC", "Source Han Serif SC", SimSun, STSong, serif;
  --body: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.65 var(--body); }
body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; text-underline-offset: .2em; }
img { display: block; width: 100%; }
figure, p, h1, h2, h3, h4, dl, dd { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a, button, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #a64936; outline-offset: 4px; }
section[id] { scroll-margin-top: 24px; }
.shell { margin-inline: auto; width: min(1240px, calc(100% - 112px)); }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 20; padding: .5rem 1rem; background: white; }

.site-header { background: var(--paper); }
.header-inner { min-height: 76px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; }
.brand { justify-self: start; display: flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 700; font-size: .98rem; line-height: 1.28; white-space: nowrap; }
.brand-sub { display: block; color: var(--muted); font-size: .75rem; letter-spacing: .15em; margin-block-start: 3px; font-weight: 500; }
.seal { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 3px; background: var(--accent); color: #fff6e8; box-shadow: inset 0 0 0 3px var(--accent), inset 0 0 0 4px #e2a491; font: 700 1rem/1 var(--title); letter-spacing: .04em; }
.primary-nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 46px); align-self: stretch; }
.primary-nav a { display: grid; align-content: center; position: relative; text-decoration: none; font-size: .9rem; color: var(--muted); white-space: nowrap; }
.primary-nav a:hover, .primary-nav a[aria-current] { color: var(--accent-dark); }
.primary-nav a[aria-current]::after { position: absolute; inset: auto 0 0; height: 3px; background: var(--accent); content: ""; }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 9px; }
.saved-link { justify-self: end; display: inline-flex; align-items: center; min-height: 42px; gap: 7px; padding: 0 13px; border: 1px solid var(--line); border-radius: 3px; font-size: .875rem; text-decoration: none; }
.saved-link:hover { border-color: var(--accent); color: var(--accent-dark); }
.star-outline { font-size: 1.23rem; line-height: 1; }
.saved-count { min-width: 19px; padding-inline: 3px; text-align: center; font-size: .75rem; border-radius: 20px; background: #efe1d9; color: var(--accent-dark); }

.hero { color: #fffaf0; background: linear-gradient(105deg, #242921, #30382d); }
.hero-layout { min-height: 350px; display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.55fr);
  align-items: center; gap: clamp(22px, 3vw, 48px); padding-block: 35px; }
.hero-kicker { color: #f3d7b4; font-size: .9rem; font-weight: 600; letter-spacing: .22em; margin-bottom: 12px; }
.hero-kicker span { margin-inline: 3px; }
.hero h1 { font: 700 clamp(2.4rem, 4.25vw, 4.1rem)/1.13 var(--title); letter-spacing: .04em; }
.hero-description { margin-top: 16px; color: #e8dfcf; line-height: 1.65; font-size: clamp(.96rem, 1.25vw, 1.12rem); }
.hero-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-covers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; min-width: 0; }
.hero-cover { display: block; overflow: clip; background: #3b4336; border: 1px solid #626f5b; border-radius: 4px;
  color: #fff9ed; text-decoration: none; }
.hero-cover:hover { border-color: #dfb98c; }
.hero-cover:focus-visible { outline-color: #f6c890; }
.hero-cover figure { height: 100%; }
.hero-cover img { height: auto; aspect-ratio: 1.48; object-fit: cover; }
.hero-cover figcaption { display: grid; gap: 3px; padding: 10px 13px 12px; }
.hero-cover figcaption span { font-size: .83rem; color: #e5dbc8; }
.hero-cover figcaption strong { font: 700 clamp(1.05rem, 1.5vw, 1.32rem)/1.4 var(--title); }
.button { display: inline-flex; min-height: 45px; padding: 9px 21px; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 3px; text-decoration: none; font-size: .9rem; font-weight: 650; background: transparent; text-align: center; }
.button-primary { background: var(--accent); color: #fffaf1; }
.button-primary:hover { background: var(--accent-dark); }
.button-light { border-color: #fffaedd0; background: #16160e28; color: #fffaf1; }
.button-light:hover { background: #ffffff24; }
.button-secondary { border-color: #a69e8d; background: var(--white); }
.button-secondary:hover { border-color: var(--accent); color: var(--accent-dark); }

.atlas-summary { background: #f0ecdf; border-bottom: 1px solid #dfdacc; }
.summary-inner { display: grid; grid-template-columns: repeat(3, 1fr); padding-block: 15px; }
.summary-inner p { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 7px; padding: 0 8px; color: var(--muted); }
.summary-inner p + p { border-left: 1px solid #d4cbbc; }
.summary-inner strong { color: var(--accent-dark); font: 600 clamp(1.35rem, 2.3vw, 2.25rem)/1.1 Georgia, serif; }
.summary-inner span { font-size: .88rem; }
.section { padding-block: 60px; }
.catalog-section { padding-top: 37px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 21px; }
.section-heading h2 { font: 700 clamp(1.95rem, 3vw, 2.75rem)/1.2 var(--title); letter-spacing: .055em; }
.split-heading { align-items: center; }
.split-heading p { color: var(--muted); font-size: .94rem; max-width: 36rem; }
.catalog-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding-block: 5px 16px; }
.search-box { position: relative; width: min(360px, 100%); }
.search-box::before { content: ""; position: absolute; top: 15px; left: 15px; width: 12px; height: 12px; border: 1.5px solid #68675d; border-radius: 50%; pointer-events: none; }
.search-box::after { content: ""; position: absolute; top: 27px; left: 25px; width: 6px; height: 1.5px; transform: rotate(48deg); background: #68675d; pointer-events: none; }
.search-box input { width: 100%; min-height: 44px; background: var(--white); border: 1px solid #d4cdbf; border-radius: 3px; padding: 6px 12px 6px 39px; font-size: .88rem; }
.search-box input::placeholder { color: #716b60; }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 4px; background: #eee9dc; }
.segmented button, .pair-picker a, .library-nav a { min-height: 38px; padding: 5px 18px; background: transparent; border: 1px solid transparent; border-radius: 3px; color: #4d4b44; font-size: .91rem; white-space: nowrap; }
.segmented button:hover, .pair-picker a:hover, .library-nav a:hover { color: var(--accent-dark); }
.segmented button[aria-pressed="true"], .pair-picker a[aria-current], .library-nav a[aria-current] { background: var(--accent); border-color: var(--accent); color: #fff8ec; }
.select-wrap { position: relative; }
.select-wrap::after { content: ""; width: 7px; height: 7px; border: solid #545046; border-width: 0 1.5px 1.5px 0; position: absolute; bottom: 19px; right: 14px; transform: rotate(45deg); pointer-events: none; }
.select-wrap select { appearance: none; min-height: 44px; border: 1px solid #d4cdbf; border-radius: 3px; padding: 5px 35px 5px 12px; font-size: .88rem; background: var(--white); }
.catalog-status { display: flex; gap: 18px; align-items: center; min-height: 33px; margin: 0 0 10px; color: var(--muted); font-size: .85rem; }
.text-button { background: transparent; border: 0; padding: 0; color: var(--accent-dark); text-decoration: underline; text-underline-offset: .2em; font-size: inherit; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 23px; }
.catalog-views { margin-inline-start: auto; }
.catalog-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 5px; background: var(--white); }
.catalog-table { width: 100%; min-width: 685px; table-layout: fixed; border-collapse: collapse; text-align: left; }
.catalog-table .col-building { width: 27%; }
.catalog-table .col-place { width: 18%; }
.catalog-table .col-kind { width: 11%; }
.catalog-table .col-saved { width: 70px; }
.catalog-table th, .catalog-table td { padding: 10px 13px; overflow-wrap: anywhere; }
.catalog-table thead { background: #eee9dc; color: #50493d; font-size: .88rem; }
.catalog-table tbody tr + tr { border-top: 1px solid #ebe5da; }
.catalog-table tbody tr:hover { background: #f8f3e8; }
.catalog-table tbody th, .catalog-table tbody td { vertical-align: middle; }
.catalog-table tbody td { color: var(--muted); font-size: .89rem; line-height: 1.45; }
.catalog-table tbody th a { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.catalog-table tbody th a:hover { color: var(--accent-dark); text-decoration: underline; }
.catalog-table tbody th img { flex: 0 0 52px; width: 52px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; }
.catalog-table th:last-child, .catalog-table td:last-child { text-align: center; }
.catalog-table .favorite-icon { position: static; margin-inline: auto; width: 34px; height: 34px; }
.building-card { position: relative; min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: 5px; overflow: clip; box-shadow: 0 2px 3px #39271a0a; transition: box-shadow .18s, transform .18s; }
.building-card:hover { box-shadow: 0 6px 16px #39271a16; transform: translateY(-2px); }
.card-link { display: block; height: 100%; color: inherit; text-decoration: none; }
.card-link:focus-visible { outline-offset: -3px; }
.card-photo { position: relative; aspect-ratio: 16 / 9; background: #d9d7c7; overflow: hidden; }
.card-photo img { height: 100%; object-fit: cover; transition: transform .25s; }
.building-card:hover img { transform: scale(1.035); }
.card-tag { position: absolute; inset: 12px auto auto 12px; padding: 2px 9px; border-radius: 2px; background: #fff8eb; font-size: .77rem; font-weight: 650; }
.card-body { padding: 15px 17px 17px; display: grid; gap: 4px; }
.card-meta { color: var(--accent-dark); font-size: .8rem; font-weight: 600; }
.card-body h3 { font: 700 clamp(1.18rem, 1.65vw, 1.55rem)/1.35 var(--title); overflow-wrap: anywhere; }
.card-brief { color: var(--muted); font-size: .875rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-mark { font-size: .75rem; color: #5c5a50; border-top: 1px solid #ebe5da; margin-top: 7px; padding-top: 8px; }
.favorite-icon { position: absolute; top: 10px; right: 10px; width: 39px; height: 39px; display: grid; place-items: center; background: #fff9ee; border: 1px solid #988f8047; border-radius: 50%; font-size: 1.27rem; line-height: 1; }
.favorite-icon:hover, .favorite-icon[aria-pressed="true"] { color: var(--accent-dark); background: #f9e6db; }
.empty-state { border: 1px dashed #c9c1b3; border-radius: 4px; color: var(--muted); background: var(--white); padding: 32px 18px; text-align: center; }
.load-more { margin: 28px auto 0; display: flex; }

.compare-section { background: #ece7db; border-block: 1px solid var(--line); }
.pair-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pair-picker a[data-pair="custom"]:not([aria-current]) { color: var(--accent-dark); border-color: var(--accent); }
.custom-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 15px; }
.custom-pair .select-wrap { min-width: 0; display: grid; gap: 4px; }
.custom-pair label { color: var(--accent-dark); font-size: .88rem; font-weight: 650; }
.custom-pair select { min-width: 0; width: 100%; }
.pair-picker a, .library-nav a { display: inline-flex; align-items: center; text-decoration: none; border-color: #d1c7b7; background: #f9f6ee; padding-inline: 13px; }
.library-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-bottom: 16px; }
.library-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.library-nav a { gap: 8px; min-height: 44px; }
.library-nav span { font-variant-numeric: tabular-nums; font-size: .84rem; }
.library-search-status { color: var(--muted); font-size: .875rem; }
.library-search-status:not(:empty) { margin-bottom: 12px; }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.recent-list > li { display: flex; flex-wrap: wrap; align-items: center; column-gap: 16px;
  padding: 9px 13px; border: 1px solid var(--line); border-radius: 4px; background: var(--white); }
.recent-list > li:focus-within, .recent-list > li:hover { border-color: var(--accent); }
.recent-entry { flex: 1 1 245px; display: grid; grid-template-columns: 80px minmax(0, 1fr) auto;
  align-items: center; gap: 14px; text-decoration: none; }
.recent-entry:hover strong { color: var(--accent-dark); }
.recent-list [data-favorite] { margin-block: 3px; white-space: nowrap; font-size: .875rem; }
.recent-list [aria-pressed="true"] { background: #f9e6db; color: var(--accent-dark); }
.recent-entry img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; }
.recent-building { min-width: 0; display: grid; gap: 3px; }
.recent-building strong { font: 700 1.17rem/1.4 var(--title); overflow-wrap: anywhere; }
.recent-building > span, .recent-entry time { color: var(--muted); font-size: .86rem; }
.pair-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: #d5cbba; border: 1px solid #d5cbba; border-radius: 5px; overflow: hidden; }
.pair-title { grid-column: 1/-1; padding: 13px 20px; background: #312f27; color: #fff6e8; font: 700 1.25rem/1.5 var(--title); letter-spacing: .06em; }
.pair-record { min-width: 0; background: var(--white); padding-bottom: 18px; display: flex; flex-direction: column; }
.pair-record img { aspect-ratio: 2.18; object-fit: cover; }
.pair-info { padding: 16px 21px 8px; display: grid; gap: 10px; }
.pair-info h4 { margin-block: 4px 0; font: 700 1.5rem/1.3 var(--title); }
.pair-info h4 a { text-decoration: none; }
.pair-info h4 a:hover { text-decoration: underline; }
.pair-info .pair-location { color: var(--accent-dark); font-size: .87rem; }
.pair-entry { align-self: flex-start; margin: auto 21px 0; color: var(--accent-dark); font-size: .88rem; }
.pair-fields { grid-column: 1/-1; display: grid; gap: 1px; }
.pair-field { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; }
.pair-field dt { grid-column: 1/-1; padding: 6px 21px; background: #efe8d9; color: var(--accent-dark);
  font-size: .86rem; font-weight: 700; }
.pair-field dd { min-width: 0; padding: 10px 21px 12px; background: var(--white); color: var(--muted);
  font-size: .94rem; overflow-wrap: anywhere; }

.geography-layout { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); gap: 20px; }
.map-panel, .place-panel { border: 1px solid var(--line); border-radius: 5px; background: var(--white); min-width: 0; overflow: hidden; }
.map-frame { background: #e6edeb; position: relative; aspect-ratio: 1.46; }
.map-frame canvas, .map-pins { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-pin { position: absolute; min-width: 27px; min-height: 27px; padding: 0 4px; border: 2px solid #fff9ee; border-radius: 20px; font-size: .75rem; font-weight: 700; transform: translate(-50%, -50%); color: #fffaf0; background: #9e402f; box-shadow: 0 2px 7px #35422b50; }
.map-pin[data-region="tw"] { background: #32604f; }
.map-pin[aria-pressed="true"], .map-pin:hover { z-index: 1; background: #292a20; outline: 2px solid #292a20; }
.map-panel small { display: block; margin: 6px 14px; color: var(--muted); font-size: .74rem; }
.place-panel { padding: 19px 20px; }
.place-panel .select-wrap { display: grid; gap: 6px; margin-bottom: 10px; }
.place-panel label { font-size: .88rem; font-weight: 650; }
.place-panel select { width: 100%; }
.place-title { font: 700 1.4rem/1.5 var(--title); }
.place-count { color: var(--muted); font-size: .83rem; margin-bottom: 6px; }
.place-list { margin: 0 0 14px; padding: 0; list-style: none; }
.place-list a { display: block; text-decoration: none; padding-block: 7px; border-bottom: 1px solid #ebe5da; font-size: .88rem; }
.place-list a:hover { color: var(--accent-dark); text-decoration: underline; }
.place-more { font-size: .86rem; color: var(--accent-dark); }

.site-footer { padding-block: 22px; border-top: 1px solid var(--line); background: #efebdf; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; font-size: .85rem; }
.footer-title { font-family: var(--title); font-weight: 700; }
.footer-note { color: var(--muted); }
.site-icp { margin-top: 14px; text-align: center; color: var(--muted); font-size: .82rem; }
.footer-inner > a { margin-left: auto; color: var(--accent-dark); }

.account-trigger { background: var(--accent); color: #fff8ec; min-height: 42px; padding-inline: 17px; max-width: 132px; overflow: hidden; }
.account-trigger:hover { background: var(--accent-dark); }
.account-trigger span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-dialog { width: min(440px, calc(100% - 42px)); max-width: none; max-height: calc(100% - 36px); padding: 0;
  background: var(--white); color: var(--ink); border: 1px solid #a49886; border-radius: 7px; box-shadow: 0 16px 64px #17161180; }
.account-dialog::backdrop { background: #151810a3; }
.signin-screen { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: clamp(16px, 5vw, 56px);
  background: radial-gradient(ellipse at 12% 18%, #fffaf0 0%, transparent 58%), #ece6d9; }
.signin-layout { display: grid; grid-template-columns: minmax(0, 1.17fr) minmax(400px, .83fr);
  min-height: 100vh; min-height: 100dvh; }
.signin-visual { position: relative; display: grid; align-items: end; min-width: 0; overflow: hidden;
  padding: clamp(32px, 5.4vw, 86px); background: #443125; color: #fff7e8; }
.signin-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 52%; }
.signin-visual::after { position: absolute; inset: 0; content: "";
  background: linear-gradient(0deg, #1b120ed1 0%, #21150d72 26%, transparent 59%); }
.signin-identity { position: relative; z-index: 1; display: grid; justify-items: start; gap: 20px; }
.signin-seal { background: #9d3e32; box-shadow: inset 0 0 0 3px #9d3e32, inset 0 0 0 4px #edbca7; }
.signin-brand { font: 700 clamp(2.35rem, 4.35vw, 5rem)/1.13 var(--title); letter-spacing: .045em; }
.signin-brand span { display: block; margin-top: .12em; }
.signin-content { display: grid; place-items: center; min-width: 0; padding: clamp(32px, 5.5vw, 84px) clamp(28px, 5vw, 76px);
  background: linear-gradient(150deg, #fbf8f1, #f4efe4); }
.signin-panel { width: min(100%, 410px); min-width: 0; }
.signin-panel h1 { font: 700 clamp(2.15rem, 3.5vw, 3.2rem)/1.15 var(--title); letter-spacing: .035em; }
.signin-intro { margin: 11px 0 29px; color: #5d5349; font-size: .95rem; }
.signin-switch { margin-top: 23px; padding-top: 17px; border-top: 1px solid #dcd1c2; color: #5d5349;
  font-size: .93rem; text-align: center; }
.signin-switch a { display: inline-block; padding: 4px; color: #79362d; font-weight: 700; text-underline-offset: .25em; }
.signin-switch a:hover { color: #54261e; }
.account-fallback { width: min(440px, 100%); background: var(--white); border: 1px solid var(--line); border-radius: 7px; }
.account-fallback .button { margin-top: 14px; }
.account-panel { position: relative; min-width: 0; padding: 25px 33px 22px; }
.account-panel h2 { margin: 4px 35px 14px 0; font: 700 2rem/1.2 var(--title); }
.account-close { position: absolute; top: 12px; right: 12px; }
#account-form { display: grid; gap: 17px; }
.account-field { display: grid; gap: 6px; }
.account-field label { color: #3e342d; font-size: .94rem; font-weight: 650; }
#account-form input { width: 100%; min-height: 50px; padding: 8px 13px; border: 1px solid #988979; border-radius: 6px;
  background: #fffcf6; color: var(--ink); font-size: 1rem; }
#account-form input:not(:disabled):hover { border-color: #695748; }
#account-form input:focus-visible { outline: 2px solid #963f33; outline-offset: 2px; }
#account-form input[aria-invalid="true"] { border: 2px solid #963f33; }
#account-form button { min-height: 51px; margin-top: 5px; border-radius: 6px; font-size: 1rem; }
#account-form button:disabled { opacity: .58; cursor: default; }
.account-message { margin: 0 0 12px; padding: 8px 11px; border-left: 3px solid var(--accent);
  background: #f8ebe0; color: var(--accent-dark); font-size: .89rem; }
.account-message:empty { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; border: 0; clip-path: inset(50%); }
.account-hint { color: var(--muted); font-size: .84rem; font-weight: 400; }
.account-profile-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
#account-current-name { overflow-wrap: anywhere; }
#account-profile-message:not(:empty) { margin-block: 11px 0; }

.building-dialog { width: min(1120px, calc(100% - 40px)); max-width: none; max-height: calc(100% - 44px); padding: 0; background: var(--white); color: var(--ink); border: 1px solid #a9a08e; border-radius: 7px; box-shadow: 0 12px 70px #15150e55; }
.building-dialog::backdrop { background: #151810a3; }
.dialog-top { display: flex; position: sticky; z-index: 2; top: 0; min-height: 52px; padding: 5px 20px; align-items: center; justify-content: space-between; background: #f1ebdf; color: var(--accent-dark); border-bottom: 1px solid var(--line); font-size: .87rem; font-weight: 650; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; line-height: 1; font-size: 1.45rem; border: 1px solid transparent; background: transparent; border-radius: 3px; }
.icon-button:hover { background: #e7decf; }
#building-content { padding: 22px 27px 26px; }
.detail-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 13px; margin-bottom: 17px; }
.detail-heading h2 { font: 700 clamp(1.9rem, 4vw, 3rem)/1.2 var(--title); margin-top: 5px; overflow-wrap: anywhere; }
.detail-kicker { color: var(--accent-dark); font-size: .88rem; font-weight: 650; }
.detail-heading .button { padding-inline: 12px; }
.detail-heading button[aria-pressed="true"] { color: var(--accent-dark); border-color: var(--accent); }
.detail-visuals { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 19px; align-items: start; }
.detail-media { min-width: 0; }
.media-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
.media-tabs button { background: #f3ecde; border: 1px solid var(--line); min-height: 38px; padding: 5px 12px; font-size: .86rem; border-radius: 3px; }
.media-tabs button[aria-pressed="true"] { background: var(--accent); color: #fff8ec; border-color: var(--accent); }
.detail-photo { background: #e6e3d9; border-radius: 4px; overflow: hidden; }
.detail-photo img { object-fit: contain; aspect-ratio: 4 / 3; }
.photo-thumbs { display: flex; gap: 7px; margin-top: 8px; }
.photo-thumbs button { border: 2px solid transparent; background: transparent; padding: 2px; width: 64px; }
.photo-thumbs button[aria-pressed="true"] { border-color: var(--accent); }
.detail-facts { display: grid; gap: 12px; margin-top: 47px; padding: 15px 16px; border: 1px solid var(--line); background: #f4efe5; border-radius: 4px; }
.detail-facts dt { color: var(--accent-dark); font-size: .8rem; font-weight: 700; }
.detail-facts dd { font-size: .9rem; overflow-wrap: anywhere; }
.detail-copy { margin-top: 19px; max-width: 60rem; display: grid; gap: 16px; }
.detail-copy h3 { margin-bottom: 5px; font: 700 1.25rem/1.45 var(--title); }
.detail-copy p, .detail-copy li { color: #3e3d35; line-height: 1.83; overflow-wrap: anywhere; }
.detail-copy ul { margin: 0; padding-inline-start: 1.3em; }
.detail-related { border-top: 1px solid var(--line); padding-top: 13px; }
.detail-related a { color: var(--accent-dark); font-size: .9rem; }
.print-notes { border-top: 1px solid var(--line); padding-top: 11px; font-size: .88rem; }
.print-notes summary { cursor: pointer; color: var(--accent-dark); font-weight: 650; }
.print-notes ul { margin-top: 6px; }
.viewer-box { min-width: 0; }
.viewer-stage { aspect-ratio: 4 / 3; position: relative; overflow: hidden; border-radius: 4px; background: #292e27; color: #fff9ed; display: grid; place-items: center; }
.viewer-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; }
.viewer-status { position: relative; z-index: 1; padding: 15px; text-align: center; font-size: .88rem; }
.viewer-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-top: 7px; color: var(--muted); font-size: .8rem; }
.viewer-controls { display: flex; flex-wrap: wrap; gap: 5px; }
.viewer-tools button { min-width: 38px; min-height: 38px; padding: 5px 10px; font-size: .82rem; }
.viewer-tools button:disabled { cursor: wait; opacity: .55; }

@media (max-width: 960px) {
  .shell { width: min(800px, calc(100% - 56px)); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
  .section { padding-block: 48px; }
}
@media (max-width: 650px) {
  .shell { width: calc(100% - 34px); }
  .header-inner { grid-template-columns: 1fr auto; gap: 0 8px; min-height: 0; }
  .brand { min-height: 62px; }
  .seal { width: 35px; height: 35px; }
  .header-actions { grid-column: 2; grid-row: 1; }
  .saved-link { padding: 0 9px; min-height: 36px; }
  .primary-nav { grid-column: 1/-1; justify-content: space-between; gap: 8px; border-top: 1px solid #e5ded1; }
  .primary-nav a { min-height: 42px; }
  .hero-layout { grid-template-columns: 1fr; min-height: 0; gap: 22px; padding-block: 30px; }
  .hero h1 { font-size: clamp(2.43rem, 9vw, 3.4rem); letter-spacing: .055em; }
  .hero-covers { gap: 8px; }
  .hero-cover figcaption { padding: 8px; }
  .hero-kicker { margin-bottom: 10px; font-size: .87rem; }
  .hero-description { margin-top: 14px; font-size: .96rem; }
  .hero-actions { gap: 8px; margin-top: 20px; }
  .hero-actions .button { min-height: 42px; padding-inline: 16px; }
  .summary-inner { width: 100%; padding-block: 10px; }
  .summary-inner p { gap: 2px; flex-direction: column; align-items: center; justify-content: center; }
  .summary-inner span { font-size: .74rem; white-space: nowrap; }
  .section { padding-block: 36px; }
  .section-heading { display: grid; gap: 11px; margin-bottom: 13px; }
  .section-heading h2 { font-size: 1.93rem; }
  .search-box { width: 100%; }
  .catalog-controls { gap: 8px; padding-bottom: 10px; }
  .segmented button { padding-inline: 11px; }
  .card-grid { gap: 11px; }
  .card-body { padding: 9px 9px 11px; }
  .card-body h3 { font-size: 1.12rem; }
  .card-meta, .card-mark { font-size: .74rem; }
  .card-brief { font-size: .78rem; }
  .card-tag { inset: 7px auto auto 7px; font-size: .69rem; padding-inline: 5px; }
  .favorite-icon { top: 6px; right: 6px; width: 34px; height: 34px; }
  .pair-picker { gap: 6px; }
  .pair-picker a { padding-inline: 9px; font-size: .83rem; }
  .recent-entry { grid-template-columns: 65px minmax(0, 1fr); gap: 2px 10px; }
  .recent-entry img { grid-row: span 2; }
  .recent-building strong { font-size: 1.08rem; }
  .pair-info { padding: 10px 10px 7px; }
  .pair-info h4 { font-size: 1.12rem; }
  .pair-field dt, .pair-field dd { padding-inline: 10px; }
  .pair-entry { margin-inline: 10px; }
  .pair-title { font-size: 1.08rem; padding: 9px 11px; }
  .pair-record img { aspect-ratio: 4 / 3; }
  .geography-layout { grid-template-columns: 1fr; gap: 12px; }
  .map-frame { aspect-ratio: 1.08; }
  .place-panel { padding: 13px; }
  .building-dialog { width: calc(100% - 16px); max-height: calc(100% - 16px); }
  .account-panel { padding-inline: 20px; }
  #building-content { padding: 15px; }
  .detail-visuals { grid-template-columns: 1fr; gap: 10px; }
  .detail-facts { margin-top: 0; }
  .detail-copy p, .detail-copy li { font-size: .94rem; }
}
@media (max-width: 800px) {
  .signin-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .signin-visual { min-height: clamp(215px, 42vw, 345px); padding: 24px clamp(21px, 6vw, 56px); }
  .signin-visual img { object-position: center 45%; }
  .signin-visual::after { background: linear-gradient(0deg, #1b120eda 0%, #21150d55 58%, transparent 92%); }
  .signin-identity { display: flex; align-items: end; gap: 12px; }
  .signin-seal { width: 36px; height: 36px; font-size: .88rem; }
  .signin-brand { font-size: clamp(1.55rem, 5vw, 2.55rem); }
  .signin-content { align-items: start; padding: 28px clamp(21px, 6vw, 56px) 35px; }
  .signin-panel h1 { font-size: 2rem; }
  .signin-intro { margin: 8px 0 23px; }
  .signin-switch { margin-top: 19px; padding-top: 12px; }
}

@media (max-width: 350px) {
  .saved-label { display: none; }
  .hero h1 { font-size: 2.2rem; }
  .card-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

