/* Chart-room companion surfaces. Visibility and drawer state stay in app.js. */

.island-details,
.filter-drawer,
.chat-panel,
.crowd-modal__panel,
.favorites-modal__panel,
.topbar-more__menu {
  --profile-paper: #f6f1e6;
  --profile-white: #faf6ee;
  --profile-ink: #1b2430;
  --profile-green: #c4891a;
  --profile-muted: #6e655c;
  --profile-line: #e0d4c2;
  --profile-tint: #e7f1ef;
  color: var(--profile-ink);
  color-scheme: light;
}

/* Island profile: one clear reading column, one scroll owner. */
body[data-island-detail="open"] .sidebar {
  overflow-y: auto;
  overflow-x: hidden;
}

body[data-island-detail="open"] .island-details:not([hidden]) {
  display: block;
  flex: 0 0 auto;
  overflow: visible;
  min-height: 100%;
  background: #f6f1e6;
}

.island-details {
  padding: 0 36px 48px;
  background: #f6f1e6;
  isolation: isolate;
}

.island-details .details-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 76px;
  margin: 0 -36px 0;
  padding: 14px 36px;
  border-bottom: 1px solid var(--profile-line);
  background: rgba(246, 241, 230, .96);
  backdrop-filter: blur(14px);
}

.island-details .back-button {
  flex: 0 1 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--profile-ink);
  background: transparent;
  font-size: 14px;
}

.island-details .back-button:hover {
  color: var(--profile-green);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.island-details .profile-body {
  padding-top: 26px;
  contain: none;
  color: var(--profile-ink);
}

.island-details .details-hero {
  gap: 0;
  margin: 0 0 27px;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.island-details .details-hero__media {
  border-radius: 12px;
  overflow: hidden;
}

.island-details .details-hero__media::after {
  display: none;
}

.island-details .details-hero .hero-img {
  aspect-ratio: 16 / 10;
  height: auto;
  border: 0;
  border-radius: 12px;
  background: #e6ddd0;
  object-position: center 40%;
  transition: transform .6s cubic-bezier(.16, 1, .3, 1);
}
.island-details .details-hero .hero-img.is-letterboxed,
.interest-story__figure img.is-letterboxed,
.interest-feature__figure img.is-letterboxed {
  object-fit: contain;
  object-position: center;
  background: #e6ddd0;
}
.island-details .details-hero:hover .hero-img { transform: scale(1.035); }

.island-details .details-hero .hero-attrib {
  padding: 9px 0 0;
  color: var(--profile-muted);
  font-size: 11px;
  line-height: 1.5;
}

.island-details .hero-attrib a {
  color: var(--profile-muted);
}

.island-details .thumb-strip {
  gap: 8px;
  margin-top: 12px;
  padding-bottom: 4px;
}

.island-details .thumb-strip .thumb {
  flex-basis: 72px;
  height: 52px;
  border-radius: 6px;
  border-color: var(--profile-line);
  background: var(--profile-tint);
}

.island-details .thumb-strip .thumb.is-active {
  border-color: var(--profile-green);
  box-shadow: 0 0 0 2px var(--profile-green);
}

.island-details .details-title {
  font-size: clamp(36px, 4.2vw, 54px);
  line-height: 1.08;
  letter-spacing: -.035em;
  color: var(--profile-ink);
  text-wrap: pretty;
}

.island-details .details-location {
  margin: 10px 0 17px;
  color: var(--profile-muted);
  font-size: 14px;
  line-height: 1.5;
}

.island-details .details-subtitle,
.island-details .profile-lede,
.island-details .profile-story {
  margin: 0 0 16px;
  color: #3d4a56;
  font-size: 18px;
  line-height: 1.65;
}

.island-details .profile-names {
  margin: 0 0 16px;
}

.island-details .profile-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 0;
  margin: 0 0 24px;
  padding: 19px 0;
  border-top: 1px solid var(--profile-line);
  border-bottom: 1px solid var(--profile-line);
}

.island-details .profile-overview-stat {
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--profile-line);
  border-radius: 0;
  background: transparent;
}

.island-details .profile-overview-stat:first-child { padding-left: 0; }
.island-details .profile-overview-stat:last-child { border-right: 0; padding-right: 0; }

.island-details .profile-overview-stat__label {
  color: var(--profile-muted);
  font-size: 10px;
  letter-spacing: .1em;
  margin-bottom: 6px;
}

.island-details .profile-overview-stat__value {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--profile-ink);
}

.island-details .profile-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 22px;
}

.island-details :is(.profile-primary-btn, .profile-secondary-btn, .details-fav, .details-action-btn) {
  min-height: 44px;
  margin: 0;
  padding: 0 18px;
  justify-content: center;
  border-radius: 7px;
  border: 1px solid var(--profile-line);
  background: var(--profile-white);
  color: var(--profile-ink);
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
}

.island-details .profile-primary-btn {
  background: var(--profile-green);
  color: #1a1408;
  border-color: var(--profile-green);
}

.island-details :is(.profile-secondary-btn, .details-fav, .details-action-btn):hover,
.island-details .details-fav.is-favorite {
  background: #e8f2f1;
  border-color: #9bb8b8;
  color: var(--profile-green);
}

.island-details .profile-primary-btn:hover { background: #083640; }
.island-details .details-fav svg { width: 16px; height: 16px; }

.island-details .profile-jump {
  position: static;
  gap: 0 18px;
  margin: 0 0 28px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--profile-line);
  background: transparent;
}

.island-details .profile-jump__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--profile-muted);
  font-size: 13px;
  font-weight: 600;
}

.island-details .profile-jump__link:hover { color: var(--profile-green); text-decoration: underline; text-underline-offset: 5px; }
.island-details [id^="profile-"] { scroll-margin-top: 90px; }

.island-details :is(.section, .ferry-section, .detail-map-section) {
  margin: 30px 0;
}

.island-details :is(.section, .ferry-section, .detail-map-section) > h3 {
  margin: 0 0 16px;
  color: var(--profile-ink);
  font-family: var(--font-display, "DM Serif Display", Georgia, serif);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.02em;
  text-transform: none;
}

.island-details .section p {
  color: #3d4a56;
  font-size: 15px;
  line-height: 1.75;
}

.island-details .section .section h3 { font-size: 21px; margin-bottom: 10px; }
.island-details .section .section { margin: 22px 0; }

.island-details :is(.names-languages, .profile-more-facts, .profile-secondary, .profile-provenance) {
  margin: 14px 0;
  border: 1px solid var(--profile-line);
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
}

.island-details :is(.names-languages, .profile-more-facts, .profile-secondary, .profile-provenance) > summary {
  min-height: 48px;
  padding: 14px 16px;
  color: var(--profile-ink);
  font-size: 14px;
  font-weight: 600;
}

.island-details :is(.names-languages, .profile-more-facts, .profile-provenance)[open] > summary {
  border-bottom-color: var(--profile-line);
}

.island-details .profile-secondary__body { padding: 4px 16px 18px; }
.island-details .stat-grid { gap: 9px; margin: 0; }
.island-details .stat { border-color: var(--profile-line); background: var(--profile-white); border-radius: 6px; box-shadow: none; }
.island-details :is(.stat__label, .profile-key-facts__label, .alt-name__lang, .trust-quiet, .poly-loading) { color: var(--profile-muted); }
.island-details :is(.stat__value, .alt-name__val, .profile-key-facts__value) { color: var(--profile-ink); }
.island-details :is(.alt-name, .subtype-chip, .tag) { border-color: var(--profile-line); color: var(--profile-green); background: #e8f2f1; }
.island-details .alt-name { border-radius: 5px; }

.island-details :is(.ferry-group, .ferry-card, .causeway-card, .correction-report, .profile-key-facts__item) {
  background: var(--profile-white);
  border-color: var(--profile-line);
  box-shadow: none;
  border-radius: 8px;
}

.island-details .ferry-group__header { background: #e8f2f1; border-color: var(--profile-line); padding: 15px 17px; }
.island-details .ferry-card { padding: 17px; gap: 12px; }
.island-details .ferry-card__route { font-size: 17px; color: var(--profile-ink); }
.island-details :is(.ferry-card__op, .ferry-card__notes, .ferry-group__op, .ferry-subtitle, .ferry-tech, .ferry-card__foot, .ferry-card__verified, .ferry-disclosure) { color: var(--profile-muted); }
.island-details :is(.ferry-card__meta li, .ferry-card__drive-pill) { background: #f3eee4; border-color: var(--profile-line); color: #3d4a56; }
.island-details :is(.ferry-card__book, .correction-report__btn--primary) { background: var(--profile-green); border-color: var(--profile-green); color: #fff; }
.island-details :is(.ferry-card__book, .ferry-card__affiliate, .correction-report__btn) { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 15px; border-radius: 6px; }
.island-details :is(.ferry-card__affiliate, .ferry-card__foot a, .causeway-card__source, .correction-report__btn--ghost, .external-links a) { color: var(--profile-green); border-color: var(--profile-line); }
.island-details .ferry-card__book:hover { background: #083640; }
.island-details .external-links a { min-height: 44px; display: inline-flex; align-items: center; background: var(--profile-white); }
.island-details .causeway-card__warning { color: #8a5c22; background: #faf1dd; border-color: #e8d6ae; }
.island-details .unnamed-banner { background: #f9f1df; border-color: #e6d8b8; color: #735d31; }

.island-details .related-island { flex-basis: 150px; padding: 9px; background: var(--profile-white); border-color: var(--profile-line); border-radius: 8px; color: var(--profile-ink); }
.island-details :is(.related-island__img, .related-island__placeholder) { height: 92px; border-radius: 5px; }
.island-details .related-island__name { color: var(--profile-ink); font-size: 14px; }
.island-details .related-island__meta { color: var(--profile-muted); }
.island-details .detail-map { height: 330px; border-color: var(--profile-line); border-radius: 8px; }
.island-details .detail-map__switcher button { min-height: 44px; background: var(--profile-white); border-color: var(--profile-line); color: var(--profile-ink); }
.island-details .detail-map__switcher button.is-active { background: var(--profile-green); color: #fff; border-color: var(--profile-green); }
.island-details .detail-map__hint { color: var(--profile-muted); }
.island-details .hero-placeholder { background: #e6ddd0; color: #6e655c; border-color: var(--profile-line); aspect-ratio: 16 / 9; }

/* Filters are one calm form with a persistent action row. */
.filter-drawer.topbar-controls,
.topbar--atlas .filter-drawer.topbar-controls {
  top: calc(var(--topbar-h, 80px) + 12px);
  right: 24px;
  width: min(440px, calc(100vw - 32px));
  max-height: min(78dvh, 760px);
  border: 1px solid #e0d4c2;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 20px 70px rgba(27, 36, 48, .12);
  z-index: 1200;
}

.filter-drawer .filter-drawer__header { padding: 20px 24px 16px; border-color: var(--profile-line); }
.filter-drawer .filter-drawer__title { font-size: 29px; color: var(--profile-ink); }
.filter-drawer .filter-drawer__close { color: var(--profile-ink); border-radius: 6px; }
.filter-drawer .filter-drawer__close:hover { background: var(--profile-tint); }
.filter-drawer .filter-drawer__body { min-height: 0; padding: 22px 24px; gap: 26px; }
.filter-drawer .filter-group { gap: 10px; }
.filter-drawer .filter-group legend { padding-bottom: 12px; color: var(--profile-muted); font-size: 11px; letter-spacing: .1em; }
.filter-drawer :is(select, input:not([type="checkbox"])) { min-height: 46px; border: 1px solid var(--profile-line); border-radius: 7px; background-color: #f6f1e6; color: var(--profile-ink); padding: 9px 12px; font-size: 15px; box-shadow: none; }
.filter-drawer .toggle { display: flex; align-items: center; min-height: 44px; gap: 10px; color: var(--profile-ink); font-size: 15px; }
.filter-drawer .toggle input { accent-color: var(--profile-green); width: 18px; height: 18px; }
.filter-drawer .filter-drawer__footer { flex-shrink: 0; gap: 10px; padding: 17px 24px 22px; border-color: var(--profile-line); background: #fff; }
.filter-drawer .filter-apply-btn { min-height: 46px; background: var(--profile-green); color: #fff; border-radius: 7px; }
.filter-drawer .filter-reset-btn { border-color: var(--profile-line); color: var(--profile-ink); border-radius: 7px; }
.filter-drawer .filter-reset-btn:hover { background: var(--profile-paper); }

/* Island finder: a small, welcoming conversation window. */
.chat-panel {
  width: min(440px, calc(100vw - 40px));
  height: min(690px, calc(100dvh - 116px));
  border-color: #e0d4c2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 70px rgba(27, 36, 48, .16);
}

.chat-panel .chat-panel__header { flex-shrink: 0; min-height: 92px; padding: 22px 24px 17px; background: #f6f1e6; border-color: var(--profile-line); }
.chat-panel .chat-panel__header h2 { padding-right: 120px; font-family: var(--font-display, "DM Serif Display", Georgia, serif); font-size: 27px; line-height: 1.1; font-weight: 400; color: var(--profile-ink); }
.chat-panel .chat-panel__sub { max-width: 260px; font-size: 13px; line-height: 1.5; color: var(--profile-muted); }
.chat-panel .chat-panel__close { top: 14px; right: 12px; width: 44px; height: 44px; color: var(--profile-ink); }
.chat-panel .chat-panel__ai-btn { top: 15px; right: 61px; height: 44px; padding: 0 12px; background: #fff; border-color: var(--profile-line); color: var(--profile-ink); }
.chat-panel .chat-settings { flex-shrink: 0; background: #f6f1e6; border-color: var(--profile-line); padding: 16px 22px; max-height: 48%; overflow: auto; }
.chat-panel .chat-settings :is(input, select) { min-height: 44px; min-width: 0; background: #fff; color: var(--profile-ink); border-color: var(--profile-line); font-size: 14px; }
.chat-panel .chat-settings__row label { color: var(--profile-muted); }
.chat-panel .chat-settings__keyrow { border-color: var(--profile-line); background: #e8f2f1; }
.chat-panel .chat-settings__actions button { min-height: 44px; color: var(--profile-ink); background: #fff; border-color: var(--profile-line); }
.chat-panel .chat-settings__note { color: var(--profile-muted); }
.chat-panel .chat-starters { padding: 16px 22px 0; gap: 8px; }
.chat-panel :is(.chat-starter, .chat-suggestions button) { min-height: 44px; padding: 8px 12px; background: #f6f1e6; color: var(--profile-green); border-color: var(--profile-line); font-size: 13px; }
.chat-panel .chat-panel__messages { min-height: 0; padding: 20px 22px; gap: 14px; }
.chat-panel .chat-msg { font-size: 15px; line-height: 1.6; padding: 13px 15px; border-radius: 11px; }
.chat-panel .chat-msg--bot { background: #f6f1e6; color: var(--profile-ink); border-color: var(--profile-line); }
.chat-panel .chat-msg--user { background: var(--profile-green); color: #fff; }
.chat-panel .chat-msg--system { color: var(--profile-muted); }
.chat-panel .chat-msg__badge { background: #e7f1ef; color: var(--profile-green); border-color: var(--profile-line); }
.chat-panel .chat-result { grid-template-columns: 64px minmax(0, 1fr); background: #fff; color: var(--profile-ink); border-color: var(--profile-line); padding: 10px; border-radius: 8px; }
.chat-panel .chat-result__thumb { width: 64px; height: 74px; background-color: #e6ddd0; border-radius: 5px; }
.chat-panel .chat-result__body strong { font-size: 16px; color: var(--profile-ink); }
.chat-panel :is(.chat-result__meta, .chat-result__causeway) { color: var(--profile-muted); font-size: 12px; }
.chat-panel .chat-result__source { color: var(--profile-green); font-size: 12px; }
.chat-panel .chat-ferry-snippet { background: #f6f1e6; color: var(--profile-ink); border-color: var(--profile-line); }
.chat-panel :is(.chat-result__map-btn, .chat-result__detail-btn) { min-height: 44px; background: #e8f2f1; color: var(--profile-green); border-color: var(--profile-line); font-size: 12px; }
.chat-panel .chat-panel__form { flex-shrink: 0; padding: 16px 20px; gap: 10px; background: #fff; border-color: var(--profile-line); }
.chat-panel .chat-panel__form input { min-width: 0; min-height: 48px; padding: 12px 15px; background: #f6f1e6; border-color: var(--profile-line); color: var(--profile-ink); font-size: 15px; }
.chat-panel .chat-panel__form button { flex: 0 0 48px; width: 48px; height: 48px; background: var(--profile-green); color: #fff; }

/* Menus and dialogs share the same material palette. */
.topbar-more__menu { padding: 7px; background: #fff; border: 1px solid #e0d4c2; border-radius: 10px; box-shadow: 0 16px 44px rgba(27, 36, 48, .12); }
.topbar-more__menu .topbar-more__item { min-height: 44px; padding: 10px 14px; border-radius: 5px; color: var(--profile-ink); font-size: 14px; }
.topbar-more__menu .topbar-more__item:hover { background: #e8f2f1; color: var(--profile-green); }
.crowd-modal__backdrop,
.favorites-modal__backdrop { background: rgba(16, 24, 32, .48); backdrop-filter: blur(5px); }
.crowd-modal__panel,
.favorites-modal__panel { padding: 30px; background: #f6f1e6; border: 1px solid #e0d4c2; border-radius: 14px; box-shadow: 0 25px 90px rgba(16, 24, 32, .22); }
.favorites-modal__panel { width: min(100%, 420px); max-height: calc(100dvh - 32px); overflow-y: auto; }
:is(.crowd-modal__title, .favorites-modal__title) { color: #1b2430; font-family: var(--font-display, "DM Serif Display", Georgia, serif); font-size: 32px; font-weight: 400; letter-spacing: -.02em; }
:is(.crowd-modal__lead, .favorites-modal__lead) { color: #3d4a56; font-size: 15px; line-height: 1.65; }
.crowd-modal__fine { color: #6e655c; line-height: 1.6; }
:is(.crowd-field, .favorites-field) { color: #3d4a56; font-size: 14px; }
:is(.crowd-source, .crowd-more) > summary { color: #0e4c5c; font-size: 14px; }
.crowd-field span { color: #1b2430; }
.crowd-field span.crowd-field__help { color: #6e655c; font-weight: 400; font-size: 13px; }
:is(.crowd-field input:not([type="checkbox"]), .crowd-field textarea, .favorites-field input) { min-height: 46px; background: #fff; color: #1b2430; border-color: #e0d4c2; border-radius: 7px; font-size: 15px; }
:is(.crowd-modal__btn, .favorites-modal__btn) { min-height: 44px; padding: 10px 16px; border-radius: 7px; border-color: #e0d4c2; background: #fff; color: #1b2430; font-size: 14px; }
:is(.crowd-modal__btn--primary, .favorites-modal__btn--primary) { background: #0e4c5c; color: #fff; border-color: #0e4c5c; }
:is(.crowd-modal__btn--ghost, .favorites-modal__btn--ghost) { background: transparent; color: #0e4c5c; }
:is(.crowd-form-error, .favorites-access-error) { color: #934c3d; background: #fbede6; border-color: #e9ccbf; }
.crowd-modal .contribute-hub__card { min-height: 84px; border-color: #e0d4c2; background: #fff; border-radius: 8px; }
.crowd-modal .contribute-hub__card:hover { border-color: #9bb8b8; background: #e8f2f1; }
.crowd-modal .contribute-hub__title { color: #1b2430; }
.crowd-modal .contribute-hub__desc { color: #6e655c; }
.crowd-modal :is(.contribute-hub__badge, .crowd-context-banner) { background: #e8f2f1; border-color: #e0d4c2; color: #0e4c5c; }
.lightbox__backdrop { background: rgba(22, 39, 31, .91); }
.lightbox__close { width: 44px; height: 44px; top: 10px; right: 10px; background: #f6f1e6; color: #1b2430; box-shadow: 0 2px 15px rgba(0, 0, 0, .15); }
.lightbox__caption { color: #edf1e8; line-height: 1.5; }

:is(.island-details, .filter-drawer, .chat-panel, .crowd-modal__panel, .favorites-modal__panel, .topbar-more__menu) :is(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid #0e4c5c;
  outline-offset: 3px;
}

@media (max-width: 1100px) and (min-width: 901px) {
  .island-details { padding-right: 26px; padding-left: 26px; }
  .island-details .details-toolbar { margin-left: -26px; margin-right: -26px; padding-left: 26px; padding-right: 26px; }
  .island-details .profile-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 0; }
  .island-details .profile-overview-stat:nth-child(2) { border-right: 0; }
  .island-details .profile-overview-stat:nth-child(3) { padding-left: 0; }
}

@media (max-width: 900px) {
  .island-details { padding: 0 22px calc(30px + var(--safe-bottom, 0px)); }
  body[data-island-detail="open"] .island-details:not([hidden]) { overflow: visible; }
  body[data-mobile-view="islands"][data-island-detail="open"] .island-details {
    position: relative;
    inset: auto;
    min-height: 100%;
    padding: 0 22px calc(30px + var(--safe-bottom, 0px));
  }
  .island-details .details-toolbar { min-height: 66px; margin: 0 -22px; padding: 11px 22px; background: rgba(246, 241, 230, .96); }
  body[data-mobile-view="islands"][data-island-detail="open"] .details-toolbar { min-height: 66px; margin: 0 -22px; padding: 11px 22px; background: rgba(246, 241, 230, .96); z-index: 10; }
  .island-details .profile-body { padding-top: 20px; }
  .island-details .details-title { font-size: clamp(36px, 8vw, 48px); }
  .island-details .details-subtitle { font-size: 17px; }
  body[data-mobile-view="islands"][data-island-detail="open"] .details-title { font-size: clamp(36px, 8vw, 48px); line-height: 1.08; }
  body[data-mobile-view="islands"][data-island-detail="open"] .details-subtitle { font-size: 17px; line-height: 1.65; }
  .island-details .details-hero .hero-img { aspect-ratio: 4 / 3; max-height: 460px; }
  body[data-mobile-view="islands"][data-island-detail="open"] .details-hero { margin-top: 0; }
  body[data-mobile-view="islands"][data-island-detail="open"] .details-hero .hero-img { aspect-ratio: 4 / 3; max-height: 460px; }
  .island-details .profile-overview-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .island-details .profile-overview-stat { padding: 0 9px; }
  .island-details .profile-overview-stat__value { font-size: 13px; }
  .island-details .profile-jump { flex-wrap: nowrap; gap: 20px; overflow-x: auto; scrollbar-width: none; }
  .island-details .profile-jump__link { flex-shrink: 0; }
  .island-details .detail-map { height: 280px; }
  .filter-drawer.topbar-controls,
  .topbar--atlas .filter-drawer.topbar-controls {
    top: auto;
    bottom: var(--mobile-nav-h, 64px);
    left: 10px;
    right: 10px;
    width: auto;
    max-height: calc(100dvh - var(--mobile-nav-h, 64px) - 100px);
    border-radius: 15px 15px 0 0;
  }
  .chat-panel { right: 0; left: 0; bottom: var(--mobile-nav-h, 64px); width: auto; height: calc(100dvh - var(--mobile-nav-h, 64px) - var(--topbar-h, 84px)); border-radius: 0; }
  .chat-panel .chat-panel__header { min-height: 88px; padding: 19px 22px 14px; }
  .chat-panel .chat-panel__messages { padding: 18px 20px; }
  :is(.crowd-modal__panel, .favorites-modal__panel) { padding: 24px; }
}

@media (max-width: 440px) {
  .island-details .profile-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 0; }
  .island-details .profile-overview-stat:nth-child(2) { border-right: 0; }
  .island-details .profile-overview-stat:nth-child(3) { padding-left: 0; }
  .island-details .profile-overview-stat__value { font-size: 14px; }
  .island-details .profile-hero-actions .profile-primary-btn { width: 100%; }
  .island-details .profile-hero-actions .profile-secondary-btn { flex: 1; }
  .filter-drawer .filter-drawer__body { padding: 20px; }
  .filter-drawer .filter-drawer__header { padding-left: 20px; padding-right: 20px; }
  .filter-drawer .filter-drawer__footer { padding-left: 20px; padding-right: 20px; }
  .chat-panel .chat-panel__header h2 { font-size: 25px; }
  .chat-panel .chat-panel__sub { max-width: 220px; }
  .chat-panel .chat-panel__ai-btn { right: 56px; padding: 0 9px; }
}

/* The shell already supplies horizontal gutters. */
.island-details { padding-left:0; padding-right:0; }
.island-details .details-toolbar { margin-left:0; margin-right:0; padding-left:0; padding-right:0; }
@media (max-width:900px) {
 body[data-mobile-view="islands"][data-island-detail="open"] .island-details { padding-left:0; padding-right:0; }
 body[data-mobile-view="islands"][data-island-detail="open"] .details-toolbar { margin-left:0; margin-right:0; padding-left:0; padding-right:0; }
}

/* Drawer structure is independent of the header's grid. */
.topbar--atlas .filter-drawer.topbar-controls {
  position:fixed; left:auto; display:none; flex-direction:column; flex-wrap:nowrap;
  align-items:stretch; gap:0; padding:0; margin:0; overflow:hidden;
}
body.filters-open .topbar--atlas .filter-drawer.topbar-controls { display:flex; }
.filter-drawer__header { display:flex; flex-shrink:0; align-items:center; justify-content:space-between; border-bottom:1px solid var(--profile-line); }
.filter-drawer__title { margin:0; font-family:var(--font-display); font-weight:400; }
.filter-drawer__close { display:grid; place-items:center; width:44px; height:44px; padding:12px; border:0; background:transparent; cursor:pointer; }
.filter-drawer__close svg { width:20px; height:20px; }
.filter-drawer__body { display:flex; flex-direction:column; overflow-y:auto; overscroll-behavior:contain; }
.filter-drawer .filter-group { display:grid; grid-template-columns:1fr; margin:0; padding:0; min-width:0; border:0; flex-shrink:0; }
.filter-drawer .filter-group select { width:100%; min-width:0; }
.filter-drawer .toggle { justify-content:flex-start; padding:0; background:transparent; border:0; border-radius:0; font-weight:400; }
.filter-drawer .toggle input[type="checkbox"] { flex:0 0 18px; width:18px; height:18px; min-height:18px; padding:0; margin:0; }
.filter-drawer__footer { display:flex; border-top:1px solid var(--profile-line); }
.filter-drawer__footer button { flex:1; font-family:inherit; border:1px solid var(--profile-line); cursor:pointer; }
@media (max-width:900px) {
 .topbar--atlas .filter-drawer.topbar-controls { top:calc(var(--topbar-h) + 12px); bottom:calc(var(--mobile-nav-h) + var(--safe-bottom,0px) + 12px); left:12px; right:12px; max-height:none; width:auto; }
}
.filter-drawer .toggle input[type="checkbox"] { min-width:18px; max-width:18px; }
.filter-drawer .toggle span { flex:1; }
.island-details .profile-body { padding-left:0; padding-right:0; }
.chat-panel:has(.chat-msg--user) .chat-starters { display:none; }
@media (max-width:900px) {
 body[data-mobile-view="islands"][data-island-detail="open"] .details-hero { width:100%; margin-left:0; margin-right:0; }
 .map-island-peek { bottom:80px; }
}
.interest-feature { margin: 4px 0 22px; }
.interest-feature__figure { margin: 0 0 12px; }
.interest-feature__figure img {
  display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; background: var(--profile-line, #e6e1d6);
}
.interest-feature__figure figcaption { margin-top: 6px; color: var(--profile-muted); font-size: 11px; line-height: 1.45; }
.interest-feature__figure a { color: inherit; }
.interest-feature h3 {
  margin: 0 0 8px; font-family: Fraunces, Georgia, serif; font-size: 28px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.15;
}
.interest-feature__story { margin: 0 0 10px; font-size: 16px; line-height: 1.55; }
.interest-feature__tie,
.interest-story__tie { margin: 0 0 10px; font-size: 15px; line-height: 1.5; }
.interest-stories { margin: 28px 0 8px; }
.interest-stories h3 {
  margin: 0 0 6px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 28px;
  font-weight: 460;
  letter-spacing: -0.03em;
  color: var(--profile-ink);
}
.interest-stories__intro { margin: 0 0 16px; color: var(--profile-muted); font-size: 14px; line-height: 1.5; }
.interest-story { margin: 0 0 22px; }
.interest-story__figure { margin: 0 0 10px; }
.interest-story__figure img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  background: var(--profile-tint);
}
.interest-story__figure figcaption { margin-top: 6px; color: var(--profile-muted); font-size: 11px; line-height: 1.45; }
.interest-story__figure a { color: inherit; }
.interest-story__kicker {
  margin: 0 0 4px;
  color: var(--profile-green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.interest-story h4 { margin: 0 0 8px; font-size: 18px; line-height: 1.3; }
.interest-story p { margin: 0 0 8px; font-size: 15px; line-height: 1.55; }
.interest-story__more { color: var(--profile-green); font-size: 14px; font-weight: 650; }

.island-details .details-hero,
.island-details .details-hero__media,
.island-details .details-hero .hero-img,
.interest-feature__figure img,
.interest-story__figure img { border-radius: 3px; }
.island-details :is(.profile-primary-btn, .profile-secondary-btn, .details-fav, .details-action-btn),
.filter-drawer.topbar-controls,
.chat-panel,
.topbar-more__menu { border-radius: 4px; }
.interest-story__kicker { color: #c4891a; }
.filter-drawer .filter-apply-btn,
.chat-panel .chat-msg--user,
.chat-panel .chat-panel__form button,
:is(.crowd-modal__btn--primary, .favorites-modal__btn--primary) { color: #1a1408; }
.filter-drawer .filter-drawer__title,
.chat-panel .chat-panel__header h2,
:is(.crowd-modal__title, .favorites-modal__title) {
  font-variation-settings: "SOFT" 30, "opsz" 48, "WONK" 1;
}

/* Motion on the surfaces that open after the first page. */
.island-details .back-button { transition: color .15s ease, transform .2s cubic-bezier(.16, 1, .3, 1); }
.island-details .back-button:hover { transform: translateX(-3px); }
.island-details.is-arriving .profile-body { animation: profile-in .42s cubic-bezier(.16, 1, .3, 1); }
@keyframes profile-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.island-details .thumb-strip .thumb { transition: transform .2s cubic-bezier(.16, 1, .3, 1); }
.island-details .thumb-strip .thumb:hover { transform: translateY(-2px); }
.island-details .related-island { transition: transform .22s cubic-bezier(.16, 1, .3, 1), border-color .22s ease; }
.island-details .related-island:hover { transform: translateY(-3px); }
.details-fav.is-just-saved { animation: heart-pop .45s cubic-bezier(.16, 1, .3, 1); }
.filter-drawer,
.chat-panel {
  transition: opacity .28s cubic-bezier(.16, 1, .3, 1), transform .28s cubic-bezier(.16, 1, .3, 1);
}
body.filters-open .filter-drawer,
.chat-panel.is-open {
  @starting-style {
    opacity: 0;
    transform: translateY(8px);
  }
}
.chat-msg.is-arriving { animation: msg-in .32s cubic-bezier(.16, 1, .3, 1); }
@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.chat-panel :is(.chat-starter, .chat-suggestions button, .chat-result) {
  transition: transform .16s cubic-bezier(.16, 1, .3, 1), background .16s ease, border-color .16s ease;
}
.chat-panel :is(.chat-starter, .chat-suggestions button, .chat-result):hover { transform: translateY(-1px); }
.chat-panel :is(.chat-starter, .chat-suggestions button):active { transform: scale(.98); }
.contribute-hub__card { transition: transform .2s cubic-bezier(.16, 1, .3, 1), border-color .2s ease; }
.contribute-hub__card:hover { transform: translateY(-2px); }
.filter-drawer .filter-apply-btn,
.island-details :is(.profile-primary-btn, .profile-secondary-btn, .details-fav) {
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .14s cubic-bezier(.16, 1, .3, 1);
}
.filter-drawer .filter-apply-btn:active,
.island-details :is(.profile-primary-btn, .profile-secondary-btn, .details-fav):active { transform: scale(.98); }
.island-details .detail-map__switcher button {
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .14s cubic-bezier(.16, 1, .3, 1);
}
.island-details .detail-map__switcher button:active { transform: scale(.98); }
.interest-story__figure img { transition: transform .5s cubic-bezier(.16, 1, .3, 1); }
.interest-story__figure:hover img { transform: scale(1.03); }
.filter-drawer__close,
.chat-panel__close,
.lightbox__close,
:is(.crowd-modal__btn, .favorites-modal__btn) {
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .16s cubic-bezier(.16, 1, .3, 1);
}
.filter-drawer__close:hover,
.chat-panel__close:hover,
.lightbox__close:hover { transform: scale(1.06); }
.filter-drawer__close:active,
.chat-panel__close:active,
.lightbox__close:active,
:is(.crowd-modal__btn, .favorites-modal__btn):active { transform: scale(.97); }
.crowd-modal.is-from,
.favorites-modal.is-from,
.lightbox.is-from { opacity: 0; transform: translateY(8px); }
.crowd-modal.is-in,
.favorites-modal.is-in,
.lightbox.is-in { transition: opacity .28s cubic-bezier(.16, 1, .3, 1), transform .28s cubic-bezier(.16, 1, .3, 1); }
.crowd-modal:not(.is-from),
.favorites-modal:not(.is-from),
.lightbox:not(.is-from) { transform: none; }

/* A language name is a line of type, not a chip. The story sits above the measurements. */
.island-details .alt-names {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 18px;
}
.island-details .alt-name {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--profile-ink);
}
.island-details .alt-name__lang {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--profile-muted);
}
.island-details .alt-name__val {
  font-family: var(--font-display, Newsreader, Georgia, serif);
  font-style: italic;
  font-size: 18px;
  color: var(--profile-ink);
}
.island-details .profile-name-line {
  margin: 2px 0 12px;
  font-family: var(--font-display, Newsreader, Georgia, serif);
  font-size: 20px;
  line-height: 1.25;
  color: var(--profile-ink);
}
.island-details .profile-name-line__lang {
  margin-right: 10px;
  font-family: var(--font-body, "Familjen Grotesk", sans-serif);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--profile-muted);
}
.island-details .profile-name-line__val { font-style: italic; }
.island-details .alt-names-more { margin: 0 0 16px; }
.island-details .alt-names-more > summary {
  cursor: pointer;
  color: var(--profile-muted);
  font-size: 13px;
  font-weight: 600;
}
.island-details .alt-names-more[open] > summary { margin-bottom: 8px; }
.island-details .interest-stories > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--profile-line, rgba(27, 36, 48, .12));
  cursor: pointer;
  list-style: none;
  font-family: Fraunces, Georgia, serif;
  font-size: 22px;
  font-weight: 460;
  letter-spacing: -0.02em;
  color: var(--profile-ink);
}
.island-details .interest-stories > summary::-webkit-details-marker { display: none; }
.island-details .interest-stories__count {
  font-family: var(--font-body, "Familjen Grotesk", sans-serif);
  font-size: 13px;
  font-weight: 560;
  letter-spacing: .04em;
  color: var(--profile-muted);
}
.island-details .interest-stories[open] > summary { margin-bottom: 12px; }
.island-details .interest-stories__more {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  background: none;
  color: #1c3d36;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chat-panel .chat-msg--user {
  align-self: stretch;
  max-width: none;
  margin: 0;
  padding: 2px 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--profile-ink);
  font-family: var(--font-display, Newsreader, Georgia, serif);
  font-style: italic;
  font-weight: 450;
  font-size: 22px;
  line-height: 1.25;
}
.chat-panel .chat-msg--bot {
  align-self: stretch;
  max-width: none;
  margin: 0;
  padding: 12px 0 4px;
  border: 0;
  border-top: 1px solid var(--profile-line);
  border-radius: 0;
  background: transparent;
  color: var(--profile-ink);
}

.island-details .name-island {
  margin: 0 0 22px;
}

.island-details .name-island__title {
  margin: 0;
  font-family: var(--font-display, Newsreader, Georgia, serif);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 450;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--profile-ink);
}

.island-details .name-island__lead,
.island-details .name-island__how,
.island-details .name-island__note,
.island-details .name-island__credit {
  margin: 10px 0 0;
  color: var(--profile-muted);
  font-size: 16px;
  line-height: 1.5;
}

.island-details .name-island__how,
.island-details .name-island__note,
.island-details .name-island__credit {
  font-size: 14px;
}

.island-details .name-island label {
  display: block;
  margin: 16px 0 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--profile-ink);
}

.island-details .name-island__label-name {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.island-details .name-island__called {
  margin-top: 18px;
  min-height: 56px;
  font-family: var(--font-display, Newsreader, Georgia, serif);
  font-size: 22px;
}

.island-details .name-island label em {
  font-style: normal;
  font-weight: 500;
  color: var(--profile-muted);
}

.island-details .name-island input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--profile-line);
  border-radius: 7px;
  background: #fff;
  color: var(--profile-ink);
  font: inherit;
  font-size: 16px;
}

.island-details .name-island input:focus {
  outline: 2px solid var(--profile-green);
  outline-offset: 1px;
}

.island-details .name-island__error {
  margin: 12px 0 0;
  color: #8a2e2e;
  font-size: 14px;
  line-height: 1.4;
}

.island-details .name-island__submit {
  width: 100%;
  margin-top: 16px;
}

.island-details .name-island__change {
  display: inline-block;
  margin: 8px 0 18px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--profile-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.island-details .name-island__credit a {
  color: inherit;
}

.island-details .island-note {
  margin: 28px 0 8px;
  padding-top: 18px;
  border-top: 1px solid var(--profile-line);
}

.island-details .island-note__title {
  margin: 0;
  font-family: var(--font-display, Newsreader, Georgia, serif);
  font-size: 28px;
  font-weight: 450;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--profile-ink);
}

.island-details .island-note__lead,
.island-details .island-note__note,
.island-details .island-note__kicker,
.island-details .island-note__by,
.island-details .island-note__hint,
.island-details .island-note__reassure {
  margin: 8px 0 0;
  color: var(--profile-muted);
  font-size: 15px;
  line-height: 1.45;
}

.island-details #island-note-list .island-note__kicker {
  margin-top: 22px;
}

.island-details .island-note__kicker {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.island-details .island-note__list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.island-details .island-note__list li {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--profile-line);
}

.island-details .island-note__list p {
  margin: 0 0 4px;
  color: var(--profile-ink);
  font-size: 16px;
  line-height: 1.45;
}

.island-details .island-note__list span {
  font-weight: 650;
}

.island-details .island-note__where {
  font-weight: 500;
}

.island-details .island-note__form {
  margin-top: 14px;
  padding: 4px 14px 14px;
  border: 1px solid var(--profile-line);
  border-radius: 12px;
  background: var(--profile-white);
}

.island-details .island-note__hint,
.island-details .island-note__reassure,
.island-details .island-note__note {
  font-size: 13px;
  line-height: 1.4;
}

.island-details .island-note__note {
  margin-top: 10px;
}

.island-details .island-note__private {
  margin-left: 6px;
  color: var(--profile-muted);
  font-weight: 650;
}

.island-details .island-note__status {
  margin: 12px 0 0;
  color: var(--profile-ink);
  font-size: 14px;
  line-height: 1.4;
}

.island-details .island-note label {
  display: block;
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--profile-ink);
}

.island-details .island-note textarea,
.island-details .island-note input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--profile-line);
  border-radius: 7px;
  background: #fff;
  color: var(--profile-ink);
  font: inherit;
  font-size: 16px;
  resize: vertical;
}

.island-details .island-note input {
  min-height: 44px;
  padding: 0 12px;
}

.island-details .island-note textarea::placeholder,
.island-details .island-note input::placeholder {
  color: #9a8f84;
}

.island-details .island-note textarea:focus,
.island-details .island-note input:focus {
  outline: 2px solid var(--profile-green);
  outline-offset: 1px;
}

.island-details .island-note__error {
  margin: 12px 0 0;
  color: #8a2e2e;
  font-size: 14px;
  line-height: 1.4;
}

.island-details .island-note .profile-primary-btn {
  width: 100%;
  margin-top: 16px;
}

.island-details .island-note .profile-primary-btn:disabled {
  opacity: 0.7;
}

/* The name is set into the photograph. Facts sit on the paper under it. */
.island-details .profile-body { padding-top: 16px; }
.island-details .details-toolbar__actions { flex-wrap: wrap; justify-content: flex-end; }
.island-details .details-hero:has(.profile-mast) {
  position: relative;
  margin: 0 0 14px;
}
.island-details .details-hero:has(.profile-mast) .details-hero__media { display: grid; border-radius: 0; }
.island-details .details-hero:has(.profile-mast) .hero-img,
.island-details .details-hero:has(.profile-mast) .profile-mast { grid-area: 1 / 1; }
.island-details .details-hero:has(.profile-mast) .hero-img {
  aspect-ratio: 3 / 2;
  width: 100%;
  height: auto;
  max-height: 440px;
  border-radius: 0;
  object-fit: cover;
}
.island-details .profile-mast {
  align-self: end;
  z-index: 2;
  padding: 56px 2px 16px;
  background: linear-gradient(180deg, rgba(8, 12, 10, 0) 0%, rgba(8, 12, 10, 0.84) 32%, rgba(8, 12, 10, 0.94) 100%);
  pointer-events: none;
}
.island-details .profile-mast .details-title {
  margin: 0;
  color: #f6f1e6;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.02;
  text-shadow: 0 1px 14px rgba(8, 12, 10, 0.45);
}
.island-details .profile-mast .details-location {
  margin: 8px 0 0;
  color: rgba(246, 241, 230, 0.84);
}
.island-details .profile-mast .profile-name-line {
  margin: 8px 0 0;
  color: #f6f1e6;
  font-size: 18px;
}
.island-details .profile-mast .profile-name-line__lang { color: #e4a322; }
.island-details .details-hero:has(.profile-mast) .hero-attrib {
  position: absolute;
  top: 10px;
  left: 0;
  right: auto;
  z-index: 3;
  max-width: calc(100% - 8px);
  margin: 0;
  padding: 3px 8px;
  background: rgba(8, 12, 10, 0.62);
  color: rgba(246, 241, 230, 0.94);
  text-shadow: none;
}
.island-details .details-hero:has(.profile-mast) .hero-attrib a { color: inherit; }
.island-details .profile-overview-stat__value {
  font-family: var(--font-display, Newsreader, Georgia, serif);
  font-size: 26px;
  font-weight: 450;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
@media (max-width: 900px) {
  .island-details .details-hero:has(.profile-mast) .hero-img { max-height: 300px; }
  .island-details .profile-mast .details-title { font-size: clamp(32px, 8vw, 42px); }
}

.island-details .details-hero .hero-img.is-letterboxed,
.island-details .details-hero:has(.profile-mast) .hero-img.is-letterboxed,
.interest-story__figure img.is-letterboxed,
.interest-feature__figure img.is-letterboxed {
  object-fit: contain;
  object-position: center;
}
