#dialog:is([data-kind="bells-brief"], [data-kind="bells-map"], [data-kind="bells-result"]) {
  width: min(92vw, 790px, calc(100% - var(--phone-left, 0px) - var(--phone-right, 0px)));
  border: 2px solid #34534e;
  border-radius: 16px;
  color: #254743;
  background: #f6f1df;
  box-shadow: 0 5px 0 #304944, 0 16px 60px #102f3557;
}
#dialog[data-kind^="bells-"] .dialog-content { padding: clamp(13px, 2.2vw, 23px); }
#dialog[data-kind^="bells-"] .dialog-close {
  z-index: 1;
  right: 9px;
  top: 8px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-color: transparent;
  color: #345950;
  background: transparent;
}
#dialog[data-kind^="bells-"] .dialog-close:hover { background: #e2e6d5; }
#dialog[data-kind^="bells-"] button:focus-visible { outline: 3px solid #177a75; outline-offset: 1px; }
#dialog[data-kind^="bells-"] h2 {
  margin: 0;
  color: #214b48;
  font-size: clamp(23px, 3.4vw, 36px);
  line-height: 1.15;
  letter-spacing: .025em;
}
.bell-brief-head, .bell-result-head {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 19px);
  padding-right: 38px;
  margin-bottom: 15px;
}
.bell-horn-plate {
  display: block;
  flex: none;
  width: clamp(90px, 16vw, 144px);
  height: auto;
  border-radius: 9px;
}
#dialog[data-kind^="bells-"] :is(.bell-brief-head, .bell-result-head) p {
  max-width: 37em;
  margin: 6px 0 0;
  color: #405b51;
  font-size: 13px;
  line-height: 1.55;
}
.bell-case-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.bell-case {
  display: flex;
  min-width: 0;
  min-height: 44px;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
  border: 1px solid #a9afa0;
  border-top: 3px solid #6b9b89;
  border-radius: 8px;
  color: #284b44;
  background: #fff9e9;
  text-align: left;
  box-shadow: 0 2px 0 #b6baa6;
}
.bell-case:nth-child(2) { border-top-color: #c19b62; }
.bell-case:nth-child(3) { border-top-color: #738f9c; }
.bell-case:hover { background: #fffdf2; border-color: #5b8475; }
.bell-case-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.bell-case-title strong { font-size: clamp(14px, 1.7vw, 18px); line-height: 1.25; }
.bell-case-art { display: block; flex: none; width: 40px; border-radius: 5px; background: #2b5456; }
.bell-case-story { color: #526458; font-size: 13px; line-height: 1.5; font-weight: 620; }
.bell-case-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; margin-top: auto; padding-top: 6px; border-top: 1px dashed #bbc1ab; }
.bell-case-foot b, .bell-result-foot :is(span, button), .bell-station-link { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.bell-case-foot b { color: #365e50; font-size: 12px; }
.bell-case-foot small { color: #566759; font-size: 11px; }
.bell-case-foot .glyph, .bell-result-foot .glyph { width: 16px; height: 16px; }

.bell-map-head { display: flex; align-items: center; min-height: 44px; gap: 12px; margin: -4px 40px 7px 0; }
.bell-map-head > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.bell-map-head small { color: #5b6e5c; font-size: 12px; font-weight: 730; }
.bell-station-link {
  flex: none;
  margin-left: auto;
  min-width: 44px;
  min-height: 44px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  color: #3f6257;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: .18em;
  font-size: 12px;
}
.bell-station-link:hover { background: #e6e8d8; }
.bell-atlas { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); align-items: center; gap: clamp(9px, 1.6vw, 18px); }
.bell-atlas figure { min-width: 0; margin: 0; }
.bell-chart { display: block; width: 100%; height: auto; overflow: hidden; border: 1px solid #2d4c46; border-radius: 9px; background: #23484c; }
.bell-deck-shadow { fill: #183b40; }
.bell-decks { fill: #67877a; stroke: #94aa92; stroke-width: .8; }
.bell-decks .bell-deck-plaza, .bell-decks .bell-deck-berth { fill: #729282; }
.bell-decks .bell-deck-highwalk { fill: #86a595; stroke: #c1ccb0; }
.bell-sector { fill-opacity: .23; stroke-width: 1.5; stroke-opacity: .94; stroke-dasharray: 4 2; }
.bell-chart-marks text { font: 850 13px/1 system-ui, sans-serif; }
.bell-chart-legend text { fill: #e2e6cc; font-size: 12px; font-weight: 780; }
.bell-atlas figcaption { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 3px 11px; padding-top: 6px; color: #496052; font-size: 11px; font-weight: 730; }
.bell-atlas figcaption span { display: inline-flex; gap: 5px; align-items: center; }
.bell-you-key { width: 10px; height: 10px; border: 2px solid #31584f; border-radius: 50%; background: #fffef1; }
.bell-wedge-key { width: 13px; height: 10px; background: #76a899; clip-path: polygon(0 100%, 75% 0, 100% 75%); }
.bell-box-key { width: 11px; height: 9px; border: 1.5px solid #765c3a; border-radius: 1px; background: #ffcd7d; }
.bell-directory { display: grid; gap: 11px; min-width: 0; align-content: center; }
.bell-directory section { min-width: 0; }
.bell-directory h3 { display: flex; align-items: baseline; gap: 6px; min-height: 18px; margin: 0 0 5px; color: #34564a; font-size: 15px; line-height: 1.25; }
.bell-directory h3 span, .bell-directory h3 small { font-size: 11px; color: #58695a; font-weight: 700; white-space: nowrap; }
.bell-directory h3 small { margin-left: auto; }
.bell-pin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.bell-pin {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 44px;
  min-height: 46px;
  padding: 4px 5px;
  text-align: left;
  color: #354e44;
  background: #fff8e6;
  border: 1px solid #b8bdab;
  border-radius: 6px;
}
.bell-pin:hover, .bell-pin[aria-pressed="true"] { border-color: #477266; background: #e2eddb; }
.bell-pin[aria-pressed="true"] { box-shadow: inset 0 0 0 1px #477266; }
.bell-pin-code {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 19px;
  border: 1px solid #876f47;
  border-radius: 2px;
  background: #f7d18d;
  color: #4b3d29;
  font: 850 12px/1 system-ui, sans-serif;
}
.bell-pin[data-state="receiver"] .bell-pin-code { height: 20px; border-radius: 50%; border-color: #34574e; background: #2e5153; color: var(--bell-pin-ink); }
.bell-pin:is([data-state="excluded"], [data-state="empty"]) .bell-pin-code { background: #e4e6d7; border: 1px dashed #6a796b; color: #42594d; }
.bell-pin[data-state="empty"] .bell-pin-code { text-decoration: line-through; }
.bell-pin-copy { display: grid; gap: 2px; min-width: 0; }
.bell-pin-copy b { font-size: 12px; line-height: 1.15; }
.bell-pin-copy small { color: #526657; font-size: 10px; line-height: 1.15; }

.bell-result-head .bell-case-art { width: clamp(54px, 8vw, 74px); border: 3px double #d4ba87; }
.bell-result-body { display: grid; gap: 12px; }
.bell-approach { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; padding: 10px 13px; border-radius: 7px; background: #dfe8d6; color: #345345; }
.bell-approach strong { font-size: 16px; }
.bell-approach span, .bell-approach small { font-size: 12px; }
.bell-approach span b { font: 800 16px system-ui, sans-serif; }
.bell-trace { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; padding: 0; list-style: none; }
.bell-trace li { display: flex; align-items: center; gap: 5px; font-size: 12px; line-height: 1.4; font-weight: 720; color: #455c50; }
.bell-trace li + li::before { content: '›'; color: #6d826f; }
.bell-trace i { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 3px; background: #d9ddcd; color: #41584b; font: 800 11px system-ui, sans-serif; }
.bell-trace .bell-trace-sample i { border-radius: 50%; background: #365a55; color: #fff5d8; }
.bell-trace .bell-trace-found i { background: #f0c77e; color: #4c402a; }
.bell-result-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.bell-result-foot > span { color: #695239; font-size: 12px; font-weight: 790; margin-right: auto; }
.bell-result-foot button { min-width: 44px; min-height: 44px; padding: 5px 12px; color: #36584b; background: #fcfaec; border: 1px solid #99a68e; border-radius: 7px; font-weight: 800; font-size: 13px; }
.bell-result-foot .bell-other-case { color: #fff4d8; background: #355c54; border-color: #355c54; }

#bells-hud {
  position: absolute;
  left: 50%;
  bottom: calc(var(--bottom) + 38px);
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 3px;
  width: max-content;
  max-width: min(45vw, 390px);
  padding: 6px 12px;
  color: #fff5dc;
  background: #204347f5;
  border: 1px solid #c6d4b2;
  border-radius: 8px;
  text-align: center;
  pointer-events: none;
}
#bells-hud[hidden] { display: none; }
.bell-hud-line { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #bde3d0; line-height: 1.2; font-weight: 760; }
.bell-hud-mark { display: flex; }
.bell-hud-mark .glyph { width: 14px; height: 14px; }
.bell-hud-hint { font-size: 13px; line-height: 1.3; }
.bell-hud-action { padding: 1px 6px; border-radius: 3px; color: #354639; background: #f2d396; font-size: 11px; line-height: 1.35; font-weight: 800; }
.bell-hud-action[hidden] { display: none; }
@media (orientation: landscape) and (max-height: 500px) {
  #dialog[data-kind^="bells-"] .dialog-content { padding: 6px 11px 9px; }
  #dialog[data-kind^="bells-"] .dialog-close { top: 2px; right: 4px; }
  #dialog[data-kind^="bells-"] h2 { font-size: 24px; }
  .bell-map-head { margin-block: -2px 1px; }
  .bell-atlas { grid-template-columns: minmax(0, 1fr) minmax(0, 1.03fr); gap: 9px; }
  .bell-chart { max-height: 61dvh; }
  .bell-atlas figcaption { padding-top: 3px; }
  .bell-directory { gap: 5px; }
  .bell-directory h3 { margin-bottom: 3px; font-size: 13px; min-height: 15px; }
  .bell-pin { min-height: 44px; gap: 3px; padding: 3px; }
  .bell-pin-code { width: 16px; height: 16px; }
  .bell-pin[data-state="receiver"] .bell-pin-code { height: 16px; }
  .bell-pin-copy { gap: 1px; }
  .bell-pin-copy b { font-size: 11px; }
  .bell-brief-head { margin-top: 3px; margin-bottom: 7px; }
  .bell-horn-plate { width: 90px; }
  .bell-case-grid { gap: 6px; }
  .bell-case { padding: 7px; gap: 5px; }
  .bell-case-story { font-size: 12px; line-height: 1.4; }
  .bell-case-title { gap: 4px; }
  .bell-case-title strong { font-size: 14px; }
  .bell-case-art { width: 30px; }
  .bell-result-head { margin-bottom: 6px; }
  .bell-result-head .bell-case-art { width: 51px; }
  #dialog[data-kind="bells-result"] .dialog-content { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 6px; }
  .bell-result-body { display: contents; }
  .bell-result-head, .bell-approach, .bell-trace { grid-column: 1 / -1; }
  .bell-result-foot { gap: 4px; }
  .bell-result-foot button { padding-inline: 7px; font-size: 12px; }
  #dialog[data-kind="bells-result"] .result-activity-footer { margin: 0; padding: 0; border: 0; }
  .bell-approach { padding: 5px 10px; }
}
@media (orientation: landscape) {
  #app.touch-hud #bells-hud { left: 45%; bottom: calc(var(--bottom) + 8px); max-width: min(39vw, 390px); }
}
@media (orientation: portrait) and (max-width: 570px) {
  .bell-atlas { grid-template-columns: minmax(0, 1fr); }
  .bell-chart { max-height: 34dvh; }
  .bell-case-grid { grid-template-columns: minmax(0, 1fr); }
  .bell-brief-head { align-items: flex-start; gap: 9px; }
  .bell-horn-plate { width: 62px; }
  .bell-case { padding: 8px 10px; gap: 4px; }
  .bell-case-title { flex-wrap: nowrap; }
  .bell-case-art { width: 30px; }
  .bell-case-foot { padding-top: 4px; }
  #bells-hud { bottom: calc(var(--bottom) + 120px); max-width: 87vw; }
}
