/* Interlude: find tea markets in the city. Scoped to the map chapter. */
.tea-map-section {
  width: min(calc(100% - var(--page-margin) * 2), 1536px);
  margin-inline: auto;
  padding-block: clamp(88px, 8vw, 128px) clamp(72px, 8vw, 120px);
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-height) + 24px);
}
.tea-map-opening { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px 24px; }
.tea-map-kicker { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; margin: 0; font-size: 11px; line-height: 1.8; letter-spacing: .12em; color: var(--secondary); }
.tea-map-kicker span:last-child { font-family: var(--english-serif); font-size: 14px; letter-spacing: .02em; }
.tea-map-heading-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px 24px; align-items: end; }
.tea-map-display { grid-column: 1 / 8; margin: 0; font: clamp(58px, 8.4vw, 142px)/.92 var(--english-serif); letter-spacing: -.055em; color: var(--accent); }
.tea-map-title-block { grid-column: 8 / -1; display: grid; gap: 32px; align-content: end; }
.tea-map-title-block h2 { margin: 0; font: 400 clamp(30px, 3.35vw, 52px)/1.55 var(--serif); letter-spacing: .025em; }
.tea-map-intro { margin: 0; max-width: 32em; font-size: 15px; line-height: 2.05; color: var(--secondary); }
.tea-map-interactive { margin-top: clamp(64px, 8vw, 112px); border-top: 1px solid var(--line); }
.tea-map-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 66px; border-bottom: 1px solid var(--line); }
.tea-map-status { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 12px; line-height: 1.8; letter-spacing: .06em; color: var(--secondary); }
.tea-map-status::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #b39a69; box-shadow: 0 0 0 5px rgba(179,154,105,.1); }
.tea-map-status[data-state="ready"]::before { background: #52724f; box-shadow: 0 0 0 5px rgba(82,114,79,.1); }
.tea-map-status[data-state="loading"]::before { background: #8b7745; animation: tea-map-pulse 1.2s ease-in-out infinite; }
.tea-map-status[data-state="error"]::before { background: #9e4534; box-shadow: 0 0 0 5px rgba(158,69,52,.1); }
.tea-map-config-button { min-height: 44px; display: inline-flex; align-items: center; gap: 16px; padding: 0; background: none; color: var(--accent); font-size: 12px; letter-spacing: .08em; white-space: nowrap; }
.tea-map-config-button::after { content: "↗"; font-family: var(--sans); font-size: 16px; }
.tea-map-config-button:hover { text-decoration: underline; text-underline-offset: 5px; }

.tea-map-search-form { padding-block: 36px 20px; }
.tea-map-field-label { display: block; margin-bottom: 12px; font-size: 11px; line-height: 1.7; letter-spacing: .1em; color: var(--secondary); }
.tea-map-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: stretch; }
.tea-map-city-input { width: 100%; min-height: 58px; padding: 0 18px; border: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); font: 400 20px/1.4 var(--serif); letter-spacing: .1em; outline: none; transition: border-color 180ms ease, background-color 180ms ease; }
.tea-map-city-input::placeholder { color: #899188; font-size: 15px; letter-spacing: .04em; }
.tea-map-city-input:hover { border-color: #aeb7ad; }
.tea-map-city-input:focus { border-color: var(--accent); background: rgba(255,255,255,.22); }
.tea-map-city-input[aria-invalid="true"] { border-color: #9e4534; }
.tea-map-button { min-height: 58px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 0 26px; border: 1px solid var(--accent); background: var(--accent); color: var(--ivory); font-size: 13px; letter-spacing: .1em; transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease; }
.tea-map-button:hover { border-color: #18362a; background: #18362a; }
.tea-map-button[data-variant="ghost"] { background: transparent; border-color: var(--line); color: var(--ink); }
.tea-map-button[data-variant="ghost"]:hover { border-color: var(--accent); background: rgba(40,76,61,.05); color: var(--accent); }
.tea-map-button:disabled { opacity: .55; }
.tea-map-button[data-variant="ghost"]::before { content: "◎"; font-size: 15px; color: var(--accent); }

.tea-map-city-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-block: 0 38px; }
.tea-map-city-options { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.tea-map-city-label { margin-right: 8px; font-size: 10px; letter-spacing: .1em; color: var(--secondary); }
.tea-map-city-chip { min-height: 34px; padding: 0 13px; border: 1px solid var(--line); background: transparent; color: var(--secondary); font-size: 12px; letter-spacing: .08em; transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease; }
.tea-map-city-chip:hover,.tea-map-city-chip[aria-pressed="true"] { border-color: var(--accent); background: rgba(40,76,61,.06); color: var(--accent); }

.tea-map-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 370px); border: 1px solid var(--line); background: var(--ivory); }
.tea-map-stage { min-width: 0; border-right: 1px solid var(--line); }
.tea-market-map { position: relative; width: 100%; height: clamp(460px, 46vw, 600px); overflow: hidden; background: #dfe5da; }
.tea-map-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; padding: 48px 28px; text-align: center; background: radial-gradient(circle at 26% 30%, rgba(40,76,61,.13), transparent 32%), radial-gradient(circle at 72% 72%, rgba(179,154,105,.15), transparent 35%), linear-gradient(rgba(40,76,61,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(40,76,61,.055) 1px, transparent 1px), #dfe5da; background-size: auto, auto, 44px 44px, 44px 44px, auto; }
.tea-map-placeholder::before,.tea-map-placeholder::after { content: ""; position: absolute; border: 1px solid rgba(40,76,61,.16); border-radius: 50%; pointer-events: none; }
.tea-map-placeholder::before { width: min(58vw, 480px); height: min(58vw, 480px); }
.tea-map-placeholder::after { width: min(30vw, 240px); height: min(30vw, 240px); }
.tea-map-placeholder-mark { position: relative; z-index: 1; display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 22px; border: 1px solid rgba(40,76,61,.4); border-radius: 50%; color: var(--accent); font: 20px/1 var(--serif); }
.tea-map-placeholder h3 { position: relative; z-index: 1; margin: 0; font: 400 clamp(21px, 2.2vw, 30px)/1.6 var(--serif); letter-spacing: .06em; }
.tea-map-placeholder p { position: relative; z-index: 1; max-width: 34em; margin: 12px 0 0; color: var(--secondary); font-size: 13px; line-height: 1.95; }
.tea-map-placeholder button { position: relative; z-index: 1; margin-top: 24px; }
.tea-map-stage-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; min-height: 42px; padding-inline: 15px; border-top: 1px solid var(--line); color: var(--secondary); font-size: 10px; letter-spacing: .05em; }
.tea-map-stage-foot a { text-underline-offset: 3px; }

.tea-map-results-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; background: rgba(255,255,255,.16); }
.tea-map-results-head { padding: 24px 22px 20px; border-bottom: 1px solid var(--line); }
.tea-map-results-head p { margin: 0 0 12px; font: 11px/1.5 var(--english-serif); letter-spacing: .07em; color: var(--secondary); }
.tea-map-results-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.tea-map-results-heading h3 { margin: 0; font: 400 22px/1.5 var(--serif); letter-spacing: .05em; }
.tea-map-results-count { color: var(--secondary); font-size: 10px; letter-spacing: .07em; white-space: nowrap; }
.tea-map-results { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #b8c0b6 transparent; }
.tea-map-empty { display: grid; place-content: center; justify-items: center; min-height: 100%; padding: 40px 28px; text-align: center; }
.tea-map-empty strong { font: 400 20px/1.6 var(--serif); letter-spacing: .04em; }
.tea-map-empty p { margin: 12px 0 0; max-width: 28em; font-size: 12px; line-height: 1.95; color: var(--secondary); }
.tea-map-results-loading { display: grid; justify-items: center; gap: 14px; padding: 80px 24px; color: var(--secondary); font-size: 12px; letter-spacing: .08em; text-align: center; }
.tea-map-results-loading::before { content: ""; width: 24px; height: 24px; border: 1px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: tea-map-spin .8s linear infinite; }
.tea-map-result-card { width: 100%; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; padding: 20px 16px; border-bottom: 1px solid var(--line); background: transparent; text-align: left; transition: background-color 160ms ease; }
.tea-map-result-card:hover,.tea-map-result-card[aria-current="true"] { background: rgba(40,76,61,.06); }
.tea-map-result-index { padding-top: 2px; color: var(--secondary); font: 10px/1.6 var(--sans); letter-spacing: .05em; }
.tea-map-result-body { min-width: 0; }
.tea-map-result-tag { display: inline-block; margin-bottom: 7px; color: var(--accent); font-size: 9px; line-height: 1.4; letter-spacing: .08em; border: 1px solid rgba(40,76,61,.35); padding: 2px 5px; }
.tea-map-result-name { display: block; font: 400 15px/1.65 var(--serif); letter-spacing: .03em; overflow-wrap: anywhere; }
.tea-map-result-address,.tea-map-result-tel { display: block; margin-top: 6px; color: var(--secondary); font-size: 11px; line-height: 1.75; overflow-wrap: anywhere; }
.tea-map-result-tel { color: var(--accent); }
.tea-map-result-tel::before { content: "TEL "; font: 8px/1 var(--sans); letter-spacing: .1em; opacity: .65; }

.tea-map-reading-note { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, .55fr); gap: 32px; padding-block: 28px 0; }
.tea-map-reading-note p { margin: 0; color: var(--secondary); font-size: 11px; line-height: 1.95; }
.tea-map-reading-note p:last-child { text-align: right; }
.tea-map-next { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 32px; margin-top: clamp(64px, 8vw, 104px); padding-top: 24px; border-top: 1px solid var(--line); }
.tea-map-next a { min-height: 44px; display: inline-flex; align-items: center; gap: 14px; font-size: 12px; letter-spacing: .08em; text-underline-offset: 4px; }
.tea-map-next p { margin: 0; color: var(--secondary); font-size: 11px; line-height: 1.8; }
.tea-map-next p:last-child { font-family: var(--serif); font-size: 15px; color: var(--ink); }

/* AMap content is injected outside the section's normal DOM tree, so keep these selectors global. */
.tea-map-marker { position: relative; display: block; width: 26px; height: 34px; filter: drop-shadow(0 3px 5px rgba(20,35,27,.2)); }
.tea-map-marker::before { content: ""; position: absolute; top: 1px; left: 1px; width: 24px; height: 24px; border: 2px solid var(--ivory); border-radius: 50% 50% 50% 0; background: var(--accent); transform: rotate(-45deg); }
.tea-map-marker::after { content: ""; position: absolute; top: 8px; left: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--ivory); }
.tea-map-info { min-width: 190px; max-width: 270px; padding: 7px 9px; color: var(--ink); font-family: var(--sans); line-height: 1.7; }
.tea-map-info strong { display: block; margin-bottom: 4px; font-family: var(--serif); font-size: 15px; font-weight: 500; }
.tea-map-info p { margin: 0; color: #59665d; font-size: 11px; }
.tea-map-info p + p { margin-top: 4px; color: #284c3d; }

.tea-map-config-dialog { width: min(520px, calc(100vw - 40px)); max-height: calc(100dvh - 40px); margin: auto; padding: 0; border: 1px solid var(--line); background: var(--ivory); color: var(--ink); box-shadow: 0 30px 100px rgba(20,35,27,.24); }
.tea-map-config-dialog::backdrop { background: rgba(20,35,27,.45); backdrop-filter: blur(3px); }
.tea-map-config-dialog[open] { animation: tea-map-dialog-in 180ms ease-out; }
.tea-map-config-form { padding: 32px; }
.tea-map-config-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 12px; }
.tea-map-config-header p { margin: 0 0 8px; font: 11px/1.5 var(--english-serif); letter-spacing: .08em; color: var(--secondary); }
.tea-map-config-header h2 { margin: 0; font: 400 27px/1.5 var(--serif); letter-spacing: .05em; }
.tea-map-config-close { min-width: 44px; min-height: 44px; margin: -8px -8px 0 0; padding: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--secondary); }
.tea-map-config-close:hover { color: var(--ink); }
.tea-map-config-help { margin: 0 0 24px; color: var(--secondary); font-size: 12px; line-height: 1.95; }
.tea-map-config-help a { text-underline-offset: 4px; }
.tea-map-config-field { display: block; margin-top: 18px; }
.tea-map-config-field span { display: block; margin-bottom: 8px; font-size: 11px; line-height: 1.6; letter-spacing: .08em; color: var(--secondary); }
.tea-map-config-field input { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 0; background: rgba(255,255,255,.28); color: var(--ink); font: 13px/1.5 var(--sans); outline: none; }
.tea-map-config-field input:focus { border-color: var(--accent); }
.tea-map-config-field input[aria-invalid="true"] { border-color: #9e4534; }
.tea-map-config-error { min-height: 1.8em; margin: 14px 0 0; color: #8f3829; font-size: 11px; line-height: 1.8; }
.tea-map-config-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.tea-map-config-actions .tea-map-button { min-height: 48px; padding-inline: 22px; }
.tea-map-config-note { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--secondary); font-size: 10px; line-height: 1.85; }

@keyframes tea-map-pulse { 50% { opacity: .35; transform: scale(.78); } }
@keyframes tea-map-spin { to { transform: rotate(360deg); } }
@keyframes tea-map-dialog-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1023px) {
  .tea-map-display { grid-column: 1 / 7; }
  .tea-map-title-block { grid-column: 7 / -1; }
  .tea-map-workspace { grid-template-columns: minmax(0, 1fr) 310px; }
}
@media (max-width: 860px) {
  .tea-map-display,.tea-map-title-block { grid-column: 1 / -1; }
  .tea-map-display { max-width: 8em; }
  .tea-map-title-block { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .tea-map-workspace { grid-template-columns: 1fr; }
  .tea-map-stage { border-right: 0; border-bottom: 1px solid var(--line); }
  .tea-market-map { height: 430px; }
  .tea-map-reading-note { grid-template-columns: 1fr; gap: 12px; }
  .tea-map-reading-note p:last-child { text-align: left; }
}
@media (max-width: 767px) {
  .tea-map-section { padding-block: 72px 84px; }
  .tea-map-opening { gap: 24px; }
  .tea-map-heading-grid { gap: 24px; }
  .tea-map-display { font-size: clamp(50px, 15.2vw, 72px); }
  .tea-map-title-block h2 { font-size: 30px; }
  .tea-map-intro { font-size: 14px; }
  .tea-map-interactive { margin-top: 56px; }
  .tea-map-toolbar { align-items: flex-start; padding-block: 16px; }
  .tea-map-status { max-width: 24em; }
  .tea-map-search-form { padding-top: 26px; }
  .tea-map-search-row { grid-template-columns: 1fr 1fr; }
  .tea-map-search-row .tea-map-city-input { grid-column: 1 / -1; }
  .tea-map-button { padding-inline: 16px; }
  .tea-map-city-list { padding-bottom: 28px; }
  .tea-map-city-label { width: 100%; margin-bottom: 2px; }
  .tea-map-city-chip { min-height: 40px; }
  .tea-market-map { height: 390px; }
  .tea-map-results-head { padding: 20px 18px 16px; }
  .tea-map-stage-foot { padding-block: 10px; }
  .tea-map-reading-note { padding-top: 22px; }
  .tea-map-next { margin-top: 56px; }
  .tea-map-config-form { padding: 24px 20px; }
  .tea-map-config-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .tea-map-config-actions .tea-map-button { width: 100%; }
}
@media (max-width: 374px) {
  .tea-map-search-row { grid-template-columns: 1fr; }
  .tea-map-search-row .tea-map-city-input { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .tea-map-section *, .tea-map-section *::before, .tea-map-config-dialog, .tea-map-config-dialog::backdrop { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .tea-map-status::before,.tea-map-result-tag,.tea-map-city-chip[aria-pressed="true"] { border: 1px solid ButtonText; }
  .tea-map-button { border: 1px solid ButtonText; }
}
