/* Harbour chapter: only runtime-created tokens and slots represent quantities. */
.arz-adventure[data-adventure-mode="harbor"] {
  color: #2d4a5e; background: #f1f7fb;
}
.arz-adventure[data-adventure-mode="harbor"] > header { background: #fff; color: #365365; border-bottom: 1px solid #dce8f0; }
.arz-adventure[data-adventure-mode="harbor"] > header nav { min-height: 48px; }
.arz-adventure[data-adventure-mode="harbor"] > header .brand { color: #176b68; letter-spacing: -.045em; }
.arz-adventure[data-adventure-mode="harbor"] main { max-width: 1200px; }
.arz-adventure[data-adventure-mode="harbor"] .intro { align-items: center; gap: 1rem; padding: 1.05rem 0 .85rem; }
.arz-adventure[data-adventure-mode="harbor"] .intro h1 {
  color: #294e66; font-family: var(--adv-rounded); font-weight: 850;
  font-size: clamp(1.9rem, 3.6vw, 2.75rem); line-height: 1.07; letter-spacing: -.045em;
}
.arz-adventure[data-adventure-mode="harbor"] .intro .adv-eyebrow {
  color: #597189; font-size: .73rem; line-height: 1.3; font-weight: 760;
  letter-spacing: .035em; text-transform: none; margin: 0 0 .25rem;
}
.arz-adventure[data-adventure-mode="harbor"] .intro .adv-subtitle {
  color: #597186; font-size: .95rem; line-height: 1.4; margin-top: .38rem;
}
.arz-adventure #division-harbor { margin: 0 0 1rem; }
.arz-adventure #harbor-play { display: grid; gap: .65rem; color: #345469; }
.arz-adventure .hb-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .3rem .8rem; background: transparent; color: inherit; }
.arz-adventure .hb-header h2 { color: #365d73; font: 800 1.2rem/1.25 var(--adv-rounded); letter-spacing: -.025em; }
.arz-adventure .hb-header h2 {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.arz-adventure .hb-intro { max-width: 75ch; color: #566e84; font-size: .9rem; line-height: 1.45; }
.arz-adventure .hb-missions { border: 1px solid #d3e2e9; border-radius: 12px; background: #fff; box-shadow: 0 2px 0 #e3edf3; overflow: clip; }
.arz-adventure .hb-missions > summary { min-height: 46px; padding: .65rem .85rem; color: #426d7c; font-size: .9rem; }
.arz-adventure .hb-missions[open] > summary { border-bottom: 1px solid #e1eaf1; }
.arz-adventure .hb-mission-list {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem;
  margin: 0; padding: .65rem; min-height: 0; max-width: none;
}
.arz-adventure .hb-mission {
  display: grid; align-content: center; align-items: start; gap: .2rem;
  min-width: 0; min-height: 48px; padding: .55rem .65rem;
  border: 1px solid #d8e4eb; border-radius: 8px; background: #f8fbff;
  color: #426477; font-size: .85rem; line-height: 1.35; text-decoration: none;
}
.arz-adventure .hb-mission small, .arz-adventure .hb-mission span { color: #566e84; font-size: .77rem; }
.arz-adventure .hb-mission:hover { background: #ecf6f8; border-color: #90b7c6; text-decoration: none; }
.arz-adventure .hb-mission[aria-current] { border: 2px solid #4a8e95; background: #eaf7f7; padding: calc(.55rem - 1px) calc(.65rem - 1px); }
.arz-adventure .hb-mission[data-complete="true"] { background: #ecf8f1; border-color: #b7daca; }
.arz-adventure .hb-progress { display: flex; align-items: center; gap: .4rem .8rem; flex-wrap: wrap; color: #566e84; font-size: .8rem; }
.arz-adventure .hb-progress progress { width: 8rem; height: .45rem; accent-color: #36888c; }
.arz-adventure .hb-topline { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.arz-adventure .hb-board {
  min-width: 0; padding: clamp(16px, 2.6vw, 30px); border: 1px solid #d4e3eb;
  border-top: 5px solid #6aa7b3; border-radius: 18px; background: #fff;
  box-shadow: 0 5px 0 #e0eaf1, 0 16px 30px #365b740c;
}
.arz-adventure .hb-board > header { background: transparent; color: inherit; }
.arz-adventure .hb-step { color: #60738a; font-size: .77rem; font-weight: 700; line-height: 1.4; }
.arz-adventure .hb-title {
  color: #305570; font: 800 clamp(1.4rem, 2.8vw, 2rem)/1.16 var(--adv-rounded);
  letter-spacing: -.035em; margin: .35rem 0 .6rem; overflow-wrap: break-word;
  scroll-margin-top: .75rem;
}
.arz-adventure .hb-prompt { max-width: 72ch; color: #3d5c72; font-size: 1rem; line-height: 1.48; margin: .6rem 0; }
.arz-adventure .hb-stock {
  display: grid; gap: .3rem; min-width: 0; margin: .8rem 0 .65rem; padding: .6rem .75rem;
  background: #edf6ff; border: 1px solid #c8ddeb; border-bottom: 4px solid #b9d0e3;
  border-radius: 11px; box-shadow: inset 0 2px 0 #f8fcff;
}
.arz-adventure .hb-stock-label { color: #526d86; font-size: .85rem; line-height: 1.35; font-weight: 700; }
.arz-adventure .hb-tokens { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-height: 30px; }
.arz-adventure .hb-token {
  display: inline-grid; place-items: center; flex: 0 0 auto; min-width: 27px; min-height: 29px;
  font: 1.45rem/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.arz-adventure .hb-targets {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  align-items: stretch; gap: .65rem; margin: .7rem 0 .8rem;
}
.arz-adventure .hb-target {
  min-width: 0; display: flex; flex-direction: column; gap: .2rem; padding: .4rem;
  background: #eaf5f7; border: 1px solid #c6dde3; border-top: 4px solid #b3d0d9;
  border-bottom: 4px solid #aeced8; border-radius: 14px;
}
.arz-adventure .hb-place {
  display: flex; flex: 1; flex-direction: column; align-items: stretch; gap: .2rem;
  width: 100%; min-height: 76px; padding: .5rem; text-align: left;
  color: #426a7d; background: #fff; border: 1px dashed #c7dbe2; border-radius: 7px;
  transition: background-color .15s ease, transform .12s ease;
}
.arz-adventure .hb-place:enabled:hover { border-color: #78a4b4; background: #f5fbff; }
.arz-adventure .hb-place:enabled:active { transform: scale(.97); }
.arz-adventure .hb-place:disabled { opacity: 1; color: #526a7f; background: #f7fafc; cursor: default; }
.arz-adventure .hb-target-label { display: block; font-size: .92rem; font-weight: 750; line-height: 1.3; }
.arz-adventure .hb-capacity { display: block; color: #587186; font-size: .73rem; line-height: 1.4; font-weight: 600; }
.arz-adventure .hb-slots { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 28px; margin-top: .3rem; }
.arz-adventure .hb-slot {
  display: grid; place-items: center; flex: 0 0 27px; width: 27px; height: 29px;
  background: #eef3fa; border: 1px dashed #b6cbd9; border-radius: 5px;
}
.arz-adventure .hb-slot[data-filled="true"] { background: #fff3d6; border: 1px solid #ddc791; }
.arz-adventure .hb-slot .hb-token { width: 100%; min-width: 0; min-height: 0; font-size: 1.2rem; }
.arz-adventure .hb-return {
  width: 100%; min-height: 44px; padding: .2rem .35rem; border-color: transparent;
  background: transparent; color: #526e84; font-size: .8rem;
}
.arz-adventure .hb-return:enabled:hover { background: #ffffffad; border-color: #c1d9e3; }
.arz-adventure .hb-actions, .arz-adventure .hb-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; margin: .8rem 0 .1rem; }
.arz-adventure #harbor-play button { min-height: 44px; overflow-wrap: break-word; }
.arz-adventure .hb-actions button, .arz-adventure .hb-controls button { font-size: .88rem; line-height: 1.3; }
.arz-adventure .hb-primary, .arz-adventure #harbor-play button.hb-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 46px; padding: .55rem .85rem; border: 1px solid #226c74;
  border-radius: 13px; background: #2b7a81; color: #fff;
  box-shadow: 0 3px 0 #1d5f66; font-weight: 750; text-decoration: none;
}
.arz-adventure .hb-primary:hover, .arz-adventure #harbor-play button.hb-primary:hover { background: #226b73; text-decoration: none; }
.arz-adventure .hb-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #1d5f66; }
.arz-adventure .hb-feedback { color: #6e5e3c; font-size: .91rem; line-height: 1.45; margin: 0; }
.arz-adventure .hb-feedback:not(:empty) {
  margin: .7rem 0 .1rem; padding: .6rem .75rem; background: #fff7e4;
  border-left: 4px solid #d9bd80; border-radius: 3px 9px 9px 3px;
}
.arz-adventure .hb-hint { margin: .7rem 0; padding: .65rem .8rem; color: #546b82; background: #f0f4fc; border: 1px solid #d6dff0; border-radius: 10px; font-size: .92rem; }
.arz-adventure .hb-answer { display: flex; align-items: end; flex-wrap: wrap; gap: .65rem; margin: .85rem 0 .3rem; }
.arz-adventure .hb-field { display: grid; gap: .35rem; flex: 1 1 230px; min-width: 0; font-size: 1rem; font-weight: 700; color: #3e6379; }
.arz-adventure .hb-field label { display: grid; gap: .35rem; }
.arz-adventure .hb-field input, .arz-adventure .hb-input, .arz-adventure .hb-sandbox-controls input {
  width: 6rem; max-width: 100%; min-height: 46px; padding: .4rem .55rem;
  border: 1.5px solid #93b2c3; border-radius: 8px; background: #fff;
  color: #375f79; font: 700 1.3rem/1.2 system-ui, sans-serif;
}
.arz-adventure #harbor-play input[aria-invalid="true"] { border: 2px solid #b56a46; background: #fff8ed; }
.arz-adventure .hb-summary { margin: .8rem 0; padding: .8rem; border: 1px solid #c7dfd7; border-radius: 12px; background: #f0faf4; }
.arz-adventure .hb-result {
  margin: .75rem 0; padding: 1rem; color: #3b745c; border: 1px solid #bfdecb;
  border-radius: 13px; background: #effaf4; box-shadow: 0 3px 0 #e0f0e6;
  animation: hb-arrive .25s ease-out both;
}
.arz-adventure .hb-result h3, .arz-adventure .hb-result strong { color: #3b735c; }
.arz-adventure .hb-equation {
  margin: .65rem 0; color: #356f7a; font: 750 clamp(1.2rem, 2.8vw, 1.75rem)/1.4 ui-monospace, monospace;
  overflow-wrap: break-word; font-variant-numeric: tabular-nums;
}
.arz-adventure .hb-explanation { color: #587489; line-height: 1.48; font-size: .96rem; margin: .5rem 0; }
.arz-adventure .hb-sandbox { margin: .4rem 0; border: 1px solid #d1e0eb; border-radius: 13px; overflow: clip; background: #f7faff; }
.arz-adventure .hb-sandbox > summary { color: #4b6f85; min-height: 48px; padding: .75rem .9rem; font-size: .95rem; }
.arz-adventure .hb-sandbox[open] > summary { border-bottom: 1px solid #dce6f0; }
.arz-adventure .hb-sandbox > p { margin: .75rem .9rem; color: #566e84; font-size: .91rem; line-height: 1.45; }
.arz-adventure .hb-sandbox-controls { display: flex; align-items: end; flex-wrap: wrap; gap: .65rem 1rem; padding: .85rem .9rem; }
.arz-adventure .hb-sandbox-controls label { display: grid; gap: .35rem; min-width: 0; color: #4b6a80; font-size: .86rem; font-weight: 700; }
.arz-adventure .hb-sandbox-control { display: grid; grid-template-columns: minmax(0, 1fr); flex: 1 1 150px; gap: .2rem; min-width: 0; }
.arz-adventure .hb-sandbox-controls .hb-slider {
  width: 100%; min-width: 0; max-width: 100%; height: 44px; min-height: 44px; margin: 0;
  padding: 0; border: 0; border-radius: 0; background: transparent;
  accent-color: #2c7c84; cursor: pointer;
}
.arz-adventure .hb-sandbox-model { display: flex; flex-wrap: wrap; align-items: start; gap: .6rem; padding: 0 .9rem .85rem; }
.arz-adventure .hb-sandbox-model .hb-target { flex: 0 1 9rem; padding: .65rem; }
.arz-adventure .hb-sandbox-remainder {
  display: flex; align-items: center; flex-wrap: wrap; gap: .35rem;
  margin: 0 .9rem .85rem; padding: .65rem .75rem; color: #526d81;
  background: #fff5e7; border: 1px solid #eadbc0; border-radius: 12px;
  font-size: .87rem;
}
.arz-adventure .hb-interpretations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; padding: 0 .9rem .9rem; }
.arz-adventure .hb-interpretations p {
  min-width: 0; margin: 0; padding: .7rem .8rem; background: #fff; border: 1px solid #dce4ed;
  border-left: 4px solid #8dbbb3; border-radius: 3px 9px 9px 3px; color: #526c82; font-size: .88rem; line-height: 1.45;
}
.arz-adventure .hb-interpretations p:nth-child(2) { border-left-color: #d9bf91; }
.arz-adventure .hb-interpretations p:nth-child(3) { border-left-color: #91b8c9; }
.arz-adventure .hb-interpretations p:nth-child(4) { border-left-color: #b5a0ca; }
.arz-adventure .adv-harbor-stop {
  display: flex; align-items: center; gap: .75rem; min-height: 58px;
  margin: .85rem 0; padding: .65rem .85rem; border: 1px solid #b9d7e4;
  border-bottom: 3px solid #9dc5d5; border-radius: 12px; background: #edf8fc;
  color: #376b82; text-decoration: none; font-weight: 720; line-height: 1.35;
}
.arz-adventure .adv-harbor-stop::before {
  content: ''; flex: 0 0 38px; width: 38px; height: 38px;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M6 29h36l-9 11H16Z' fill='%23e8bf65' stroke='%23856e40' stroke-width='1.5'/%3E%3Cpath d='M24 7v22M23 8 9 25h14Z' fill='%23fff7d8' stroke='%234d786e' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='m27 12 12 13H27Z' fill='%23c9dfc5' stroke='%234d786e' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M4 43c4-3 8 3 12 0s8 3 12 0 8 3 16 0' stroke='%23699a94' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
.arz-adventure .adv-harbor-stop:hover { background: #e2f2fa; border-color: #7eaabd; text-decoration: underline; }
.arz-adventure .adv-harbor-stop span { color: inherit; }
.arz-adventure .adv-harbor-stop > span:nth-child(2) { display: grid; gap: .2rem; min-width: 0; }
.arz-adventure .adv-harbor-stop strong { color: #345f76; font: 800 1rem/1.3 var(--adv-rounded); }
.arz-adventure .adv-harbor-stop > span:nth-child(2) > span { color: #516e84; font-size: .85rem; font-weight: 500; }
.arz-adventure .adv-harbor-stop small { color: #516e84; font-size: .75rem; font-weight: 600; }
.arz-adventure .adv-harbor-stop > span:last-child { margin-left: auto; }
.arz-adventure .adv-harbor-stop:has(.adv-scene)::before { display: none; }
.arz-adventure .adv-harbor-stop .adv-scene {
  display: grid; place-items: center; width: 70px; height: 70px; margin: -.3rem 0;
  font-size: 2.5rem;
  filter: drop-shadow(0 4px 3px #395d7320);
}
html.arz-world-ready .arz-adventure .adv-harbor-stop .adv-scene { color: transparent; font-size: 0; }
.arz-adventure #harbor-play :focus-visible { outline: 3px solid #8e6bc4; outline-offset: 3px; }
.arz-adventure .hb-missions > summary:focus-visible, .arz-adventure .hb-sandbox > summary:focus-visible { outline-offset: -4px; }

@keyframes hb-arrive { from { opacity: .4; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 760px) {
  .arz-adventure[data-adventure-mode="harbor"] .intro { align-items: stretch; padding: .75rem 0 .65rem; gap: .6rem; }
  .arz-adventure[data-adventure-mode="harbor"] .intro h1 { font-size: clamp(1.6rem, 5.4vw, 2rem); }
  .arz-adventure[data-adventure-mode="harbor"] .adv-mascot { width: 60px; }
  .arz-adventure .hb-mission-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .arz-adventure .hb-board { border-radius: 14px; padding: 16px; }
  .arz-adventure .hb-title { font-size: 1.5rem; }
  .arz-adventure .hb-interpretations { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .arz-adventure[data-adventure-mode="harbor"] main { padding-left: 12px; padding-right: 12px; }
  .arz-adventure[data-adventure-mode="harbor"] > header nav {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .5rem;
    min-height: 46px; padding-top: .1rem; padding-bottom: .1rem;
  }
  .arz-adventure[data-adventure-mode="harbor"] > header nav > span { display: none; }
  .arz-adventure[data-adventure-mode="harbor"] > header nav a { min-height: 44px; font-size: .78rem; line-height: 1.22; }
  .arz-adventure[data-adventure-mode="harbor"] > header nav .brand { font-size: .98rem; }
  .arz-adventure[data-adventure-mode="harbor"] .intro { padding: .65rem 0 .55rem; }
  .arz-adventure[data-adventure-mode="harbor"] .intro h1 { font-size: 1.62rem; line-height: 1.07; }
  .arz-adventure[data-adventure-mode="harbor"] .intro .adv-eyebrow { font-size: .65rem; letter-spacing: .07em; margin: 0 0 .18rem; }
  .arz-adventure[data-adventure-mode="harbor"] .intro .adv-subtitle { font-size: .82rem; line-height: 1.35; margin-top: .25rem; padding-right: 54px; }
  .arz-adventure[data-adventure-mode="harbor"] .adv-heading { display: block; position: relative; }
  .arz-adventure[data-adventure-mode="harbor"] .adv-heading > .adv-mascot { position: absolute; right: 0; bottom: 0; width: 42px; height: 42px; line-height: 42px; }
  .arz-adventure #harbor-play { gap: .55rem; }
  .arz-adventure .hb-header h2 { font-size: 1.08rem; }
  .arz-adventure .hb-intro { font-size: .85rem; line-height: 1.38; }
  .arz-adventure .hb-missions > summary { min-height: 44px; font-size: .86rem; padding: .6rem .75rem; }
  .arz-adventure .hb-mission-list { padding: .5rem; gap: .4rem; }
  .arz-adventure .hb-mission { padding: .5rem; font-size: .8rem; }
  .arz-adventure .hb-mission[aria-current] { padding: calc(.5rem - 1px); }
  .arz-adventure .hb-progress { gap: .35rem .65rem; font-size: .75rem; }
  .arz-adventure .hb-progress progress { width: 5rem; }
  .arz-adventure .hb-board { padding: 12px; }
  .arz-adventure .hb-step { font-size: .71rem; }
  .arz-adventure .hb-title { font-size: 1.34rem; margin: .3rem 0 .5rem; }
  .arz-adventure .hb-prompt { font-size: 1rem; line-height: 1.42; }
  .arz-adventure .hb-stock { padding: .5rem .6rem; margin: .65rem 0 .55rem; }
  .arz-adventure .hb-stock-label { font-size: .8rem; }
  .arz-adventure .hb-targets { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .arz-adventure .hb-target { padding: .3rem; }
  .arz-adventure .hb-place { padding: .4rem; }
  .arz-adventure .hb-target-label { font-size: .83rem; }
  .arz-adventure .hb-capacity { font-size: .7rem; }
  .arz-adventure .hb-slot { flex-basis: 25px; width: 25px; height: 27px; }
  .arz-adventure .hb-slot .hb-token { font-size: 1.1rem; }
  .arz-adventure .hb-actions button, .arz-adventure .hb-controls button { font-size: .83rem; padding: .45rem .65rem; }
  .arz-adventure .hb-field { flex-basis: 100%; font-size: .95rem; }
  .arz-adventure .hb-result { padding: .8rem; }
  .arz-adventure .hb-explanation { font-size: .92rem; }
  .arz-adventure .hb-sandbox-controls { gap: .65rem; padding: .75rem; }
  .arz-adventure .hb-sandbox-controls label { flex: 1 1 105px; font-size: .82rem; }
  .arz-adventure .hb-sandbox-control { flex-basis: 100%; }
  .arz-adventure .hb-sandbox-model { padding: 0 .75rem .75rem; gap: .5rem; }
  .arz-adventure .hb-sandbox-model .hb-target { flex: 1 1 105px; }
  .arz-adventure .hb-interpretations { padding: 0 .75rem .75rem; }
  .arz-adventure .adv-harbor-stop { font-size: .9rem; padding: .65rem .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .arz-adventure #harbor-play *, .arz-adventure #harbor-play *::before, .arz-adventure #harbor-play *::after {
    animation: none !important; transition: none !important; scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  .arz-adventure .hb-target, .arz-adventure .hb-place, .arz-adventure .hb-slot,
  .arz-adventure .hb-stock, .arz-adventure .hb-mission, .arz-adventure .hb-result { border-color: CanvasText; }
  .arz-adventure .hb-mission[aria-current] { outline: 2px solid Highlight; }
  .arz-adventure .hb-token { forced-color-adjust: none; }
}
