/* GRAVETIDE interface kit, the windows (docs/23 phase 6): every window a bottom sheet on a phone held sideways; one
   set of parts — a band (name, figures, the close button), big icon tabs (a rail down the left), a second row of
   chips, one-tap actions, «было → стало» cards, a slider, folds («Подробнее»), big tiles, finger-wide rows — on the
   phone and on the desk alike (window.ts). Loaded after kit.css: the tokens are its. */

/* ---------- The window as a sheet on a phone */
.w-grip { display: none; }
@media (max-height: 520px), (max-width: 699px) {
  #modal { align-items: flex-end; background: var(--k-scrim); }
  #modal-panel { width: 100vw; height: 90dvh; max-height: none; border-radius: var(--k-r-2) var(--k-r-2) 0 0; transition: transform var(--k-dur-3) var(--k-ease-out); }
  .skinned #modal-panel { border-width: 12px 12px 0; border-image-width: 12px 12px 0; }
  #modal.w-from #modal-panel { transform: translateY(105%); transition: none; }
  #modal-panel.k-dragging { transition: none; }
  #modal-panel .w-grip { display: flex; position: absolute; z-index: 6; top: 0; left: 50%; transform: translateX(-50%); width: 120px; height: 12px; align-items: flex-start; justify-content: center; padding-top: 3px; box-sizing: border-box; cursor: grab; touch-action: none; pointer-events: none; }
  #modal-panel .w-grip i { width: 40px; height: 4px; border-radius: var(--k-r-round); background: var(--k-brass); opacity: 0.8; }
  #modal-panel.w-answer .w-grip { display: none; }
  #modal-panel .modal-head { touch-action: none; }
  #modal-panel .x-btn { width: 44px; height: 44px; right: 2px; }
}

/* ---------- The band: one line — the window's name, its figures; the close button keeps its corner */
.w-head.modal-head { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--k-sp-2); min-height: var(--k-h-2); padding: var(--k-sp-1) 56px var(--k-sp-1) var(--k-sp-3); box-sizing: border-box; }
.w-title { display: flex; align-items: center; gap: var(--k-sp-2); min-width: 0; margin: 0; font: 400 22px/1.15 var(--k-font-display); letter-spacing: 0.03em; color: var(--k-bone); white-space: nowrap; }
.w-title > span { overflow: hidden; text-overflow: ellipsis; }
.skinned .w-head h2.w-title { border: 0; border-image: none; padding: 0; font-size: 22px; }
.w-crest { width: 28px; height: 28px; object-fit: contain; flex: none; margin: 0; filter: drop-shadow(0 2px 3px #000); }
.w-sub { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--k-haze); font: italic 14px var(--k-font-serif); }
.w-figs { display: flex; align-items: center; gap: var(--k-sp-2); margin-left: auto; flex: none; }
.w-fig { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border: 1px solid rgba(140, 107, 58, 0.45); border-radius: 15px; background: rgba(8, 9, 11, 0.7); font: 600 var(--k-fs-2) var(--k-font-sans); color: var(--k-bone); font-variant-numeric: tabular-nums; white-space: nowrap; }
.w-fig.gold { color: var(--k-gold); }
.w-fig-ico { width: 18px; height: 18px; object-fit: contain; margin: 0; }
@media (max-height: 520px), (max-width: 699px) {
  .w-head.modal-head { min-height: var(--k-h-2); padding: 0 56px 0 var(--k-sp-2); border-bottom-color: rgba(140, 107, 58, 0.35); }
  .w-title, .skinned .w-head h2.w-title { font-size: 18px; }
  .w-crest { width: 24px; height: 24px; }
  .w-fig { height: 28px; padding: 0 8px; }
}
@media (max-width: 699px) { .w-sub { display: none; } }
/* The second row in the band (a window with few places of its own). */
.w-head--chips .w-chips { flex: 1 1 auto; min-width: 0; padding: 2px 0; border: 0; }
.w-head--chips .w-sub { flex: 0 1 auto; max-width: 30%; }
/* …in two lines where one does not hold it (the chart's «Нанесено на карту: 2 острова · щелчок по морю ставит отметку ·
   тащите — сдвиг, колесо — масштаб» showed its first 297 of 566 px at 1500×600, QA 2026-10-09). */
.w-head--chips .w-sub { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; font-size: 12.5px; line-height: 1.25; }
@media (max-height: 520px), (max-width: 699px) { .w-head--chips .w-sub { display: none; } }

/* ---------- The frame under the band: the rail of big tabs, and the pane (the chips, the page) */
.w-frame { flex: 1 1 auto; min-height: 0; display: flex; }
.w-pane { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.w-pane > .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.w-rail { flex: none; width: 104px; display: flex; flex-direction: column; gap: var(--k-sp-1); padding: var(--k-sp-2) var(--k-sp-1); box-sizing: border-box; border-right: 1px solid rgba(140, 107, 58, 0.3); overflow-y: auto; scrollbar-width: none; }
.w-rail::-webkit-scrollbar { display: none; }
.w-tab { position: relative; flex: 0 0 auto; height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px 2px; border: 1px solid transparent; border-radius: var(--k-r-1); background: none; color: var(--k-haze);
  font: 600 var(--k-fs-1)/1.35 var(--k-font-sans); letter-spacing: 0.01em; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform var(--k-dur-1) var(--k-ease-out), color var(--k-dur-2) var(--k-ease-out), background var(--k-dur-2) var(--k-ease-out); }
.w-tab-ico { width: 30px; height: 30px; object-fit: contain; margin: 0; filter: saturate(0.6) brightness(0.85); transition: filter var(--k-dur-2) var(--k-ease-out); }
.w-tab-ico.glyph { display: flex; align-items: center; justify-content: center; font-size: 22px; }
.w-tab-l { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-tab.on { color: var(--k-gold); border-color: var(--k-brass-dim); background: linear-gradient(90deg, rgba(224, 184, 98, 0.12), rgba(224, 184, 98, 0.02)); box-shadow: inset 3px 0 0 var(--k-gold); }
.w-tab.on .w-tab-ico { filter: none; }
.w-tab:active:not(:disabled) { transform: scale(0.96); }
.w-tab:focus { outline: none; }
.w-tab:focus-visible { outline: 2px solid var(--k-gold); outline-offset: -2px; }
.w-tab:disabled { opacity: 0.4; cursor: default; }
.w-tab .k-badge { top: 2px; right: 8px; }
/* The rail's gold one is an order, not a place («В море»): it stands apart at the bottom. */
.w-tab--go { height: auto; min-height: 58px; margin-top: auto; color: var(--k-gold); border-color: var(--k-brass); background: linear-gradient(180deg, #2a2521, #17140f); text-shadow: 0 0 8px rgba(224, 184, 98, 0.35); }
.w-tab--go .w-tab-ico { filter: none; width: 26px; height: 26px; }
.skinned .w-tab--go { border-style: solid; border-color: transparent; border-width: 4px 6px; border-image: var(--ui-button) 40 fill / 4px 6px stretch; background: none; }
@media (max-height: 520px), (max-width: 699px) {
  .w-rail { width: 88px; padding: var(--k-sp-1) 2px; gap: 2px; }
  .w-tab { height: 50px; padding: 2px; gap: 1px; font-size: 11px; letter-spacing: 0; }
  .w-tab-ico { width: 26px; height: 26px; }
  .w-tab--go { min-height: 50px; }
  .w-tab--go .w-tab-ico { width: 22px; height: 22px; }
}
/* The second row: chips, one line that scrolls sideways when it must. */
.w-chips { flex: none; display: flex; gap: var(--k-sp-1); padding: var(--k-sp-1) var(--k-sp-2); overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid rgba(140, 107, 58, 0.25); }
.w-chips::-webkit-scrollbar { display: none; }
.w-chip { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: var(--k-h-2); padding: 0 12px 0 8px; border: 1px solid rgba(140, 107, 58, 0.35); border-radius: 22px; background: rgba(8, 9, 11, 0.6); color: var(--k-bone);
  font: 600 var(--k-fs-2)/1 var(--k-font-sans); white-space: nowrap; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform var(--k-dur-1) var(--k-ease-out), border-color var(--k-dur-2) var(--k-ease-out); }
.w-chip-ico { width: 24px; height: 24px; object-fit: contain; margin: 0; }
.w-chip.on { border-color: var(--k-gold); color: var(--k-gold); background: rgba(224, 184, 98, 0.1); }
.w-chip:active:not(:disabled) { transform: scale(0.96); }
.w-chip:focus { outline: none; }
.w-chip:focus-visible { outline: 2px solid var(--k-gold); outline-offset: 1px; }
.w-chip:disabled { opacity: 0.45; cursor: default; }
.w-chip .k-badge { top: -4px; right: -4px; }
@media (hover: hover) and (pointer: fine) { .w-tab:hover:not(.on) { color: var(--k-bone); } .w-tab:hover .w-tab-ico { filter: none; } .w-chip:hover { border-color: var(--k-brass); } }

/* ---------- One-tap actions, big, in a row */
.w-quick { display: flex; flex-wrap: wrap; gap: var(--k-sp-2); margin: 0 0 var(--k-sp-3); }
.w-quick > .w-qbtn { flex: 1 1 0; min-width: 150px; }
.w-qbtn { justify-content: flex-start; text-align: left; }
.w-qtext { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.w-qsub { display: inline-flex; align-items: center; gap: 4px; font: 600 var(--k-fs-1)/1.2 var(--k-font-sans); color: var(--k-haze); letter-spacing: 0; text-shadow: none; white-space: nowrap; }
.w-qsub .money { color: var(--k-gold); }
.w-qbtn .k-btn-ico { width: 28px; height: 28px; }

/* ---------- «Было → стало»: an upgrade in one card, one button */
.w-wb { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--k-sp-2) var(--k-sp-3); align-items: center; }
.w-wb-h { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--k-sp-2); }
.w-wb-art { flex: none; display: flex; }
.w-wb-art img, .w-wb-art .ico { width: 44px; height: 44px; object-fit: contain; margin: 0; }
.w-wb-t { display: flex; flex-direction: column; min-width: 0; }
.w-wb-t b { font: 600 16px/1.2 var(--k-font-serif); }
.w-wb-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px var(--k-sp-3); }
.w-wb-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 5px; align-items: center; font: 500 var(--k-fs-2)/1.3 var(--k-font-sans); font-variant-numeric: tabular-nums; }
.w-wb-k { display: flex; align-items: center; gap: 4px; color: var(--k-haze); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.w-wb-was { color: var(--k-haze); }
.w-wb-arrow { color: var(--k-brass); }
.w-wb-new { color: var(--k-bone); }
.w-wb-new.better { color: var(--k-good); }
.w-wb-new.worse { color: var(--k-bad); }
.w-wb-note { grid-column: 1; margin: 0; font-size: var(--k-fs-1); }
.w-wb > .w-qbtn { grid-column: 2; grid-row: 2 / span 2; align-self: end; min-width: 150px; }
@media (max-width: 560px) { .w-wb { grid-template-columns: minmax(0, 1fr); } .w-wb > .w-qbtn { grid-column: 1; grid-row: auto; } }

/* ---------- A slider and its number */
.w-range { display: flex; align-items: center; gap: var(--k-sp-3); min-height: var(--k-h-3); font: 600 var(--k-fs-2) var(--k-font-sans); color: var(--k-bone); }
.w-range-l { flex: none; color: var(--k-haze); }
.w-range input[type=range] { flex: 1 1 auto; min-width: 0; height: var(--k-h-2); margin: 0; accent-color: var(--k-gold); background: none; }
.w-range-v { flex: none; min-width: 3.2em; text-align: right; font: 700 22px/1 var(--k-font-sans); color: var(--k-gold); font-variant-numeric: tabular-nums; }
.w-range-v small { font-size: var(--k-fs-1); color: var(--k-haze); }

/* ---------- A section's heading, and the fold («Подробнее») */
.w-sec { margin: var(--k-sp-3) 0 var(--k-sp-2); font: 700 var(--k-fs-1)/1.2 var(--k-font-sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--k-brass); }
.w-sec:first-child { margin-top: 0; }
.w-sec-n { color: var(--k-haze); font-weight: 600; }
.w-more { margin: var(--k-sp-3) 0 0; }
.w-more > .w-more-s { width: 100%; }
.w-more > .w-more-s::after { content: '▾'; margin-left: var(--k-sp-1); color: var(--k-brass); transition: transform var(--k-dur-2) var(--k-ease-out); }
.w-more.open > .w-more-s::after { transform: rotate(180deg); }
.w-more-b[hidden] { display: none; }
.w-more-b { padding-top: var(--k-sp-3); }

/* ---------- Big tiles (an island's buildings): a picture over one or two words */
.w-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: var(--k-sp-2); }
.w-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 92px; padding: 8px 4px 6px; border: 1px solid rgba(140, 107, 58, 0.4); border-radius: var(--k-r-1); background: rgba(8, 8, 9, 0.6); color: var(--k-bone);
  font: 600 var(--k-fs-2)/28px var(--k-font-serif); text-align: center; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform var(--k-dur-1) var(--k-ease-out), border-color var(--k-dur-2) var(--k-ease-out); }
.w-tile:active:not(:disabled) { transform: scale(0.97); }
.w-tile:focus { outline: none; }
.w-tile:focus-visible { outline: 2px solid var(--k-gold); outline-offset: 1px; }
.w-tile.on { border-color: var(--k-gold); }
.w-tile.ready { border-color: var(--k-good); box-shadow: inset 0 0 14px rgba(127, 181, 138, 0.18); }
.w-tile-ico { width: 48px; height: 48px; object-fit: contain; margin: 0; }
.w-tile-l { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.w-tile-s { font: 600 var(--k-fs-1)/1.2 var(--k-font-sans); color: var(--k-haze); font-variant-numeric: tabular-nums; }
.w-tile .k-badge { top: 4px; right: 4px; }

/* ---------- A row of a list a finger can work: picture, words, a figure, buttons of 44 px */
.w-row { display: flex; align-items: center; gap: var(--k-sp-2); min-height: 52px; padding: 4px var(--k-sp-1); border-bottom: 1px solid rgba(140, 107, 58, 0.18); }
.w-row-ico { width: 34px; height: 34px; object-fit: contain; flex: none; margin: 0; }
.w-row-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.w-row-t > b { font: 600 var(--k-fs-3)/1.2 var(--k-font-serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-row-t > small { font: 500 var(--k-fs-1)/1.25 var(--k-font-sans); color: var(--k-haze); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-row-n { flex: none; display: flex; flex-direction: column; align-items: flex-end; font: 600 var(--k-fs-2) var(--k-font-sans); font-variant-numeric: tabular-nums; color: var(--k-bone); text-align: right; }
.w-row-n small { font-size: var(--k-fs-1); color: var(--k-haze); }
.w-row-b { flex: none; display: flex; gap: var(--k-sp-1); }
.w-row-b > .k-btn { min-width: 64px; }

/* ---------- The long-press hint: in the top band like a toast, never over the middle */
.k-hint { position: fixed; z-index: calc(var(--k-z-toast) + 1); top: calc(var(--sa-t, 0px) + var(--k-sp-2)); left: 50%; transform: translate(-50%, -6px); max-width: min(420px, 56vw); padding: 8px 12px; box-sizing: border-box;
  border: 1px solid var(--k-brass-dim); border-radius: var(--k-r-1); background: rgba(11, 13, 16, 0.96); color: var(--k-bone); box-shadow: var(--k-shadow-1);
  font: 500 var(--k-fs-2)/1.35 var(--k-font-sans); text-align: center; pointer-events: none; opacity: 0; transition: opacity var(--k-dur-1) var(--k-ease-out), transform var(--k-dur-1) var(--k-ease-out); }
.k-hint.k-open { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .w-tab:active:not(:disabled), .w-chip:active:not(:disabled), .w-tile:active:not(:disabled) { transform: none; } }

/* ---------- The port's places (port.ts, docs/23 items 65–69) */
#modal-panel[data-modal="port"] .w-head { background: linear-gradient(90deg, rgba(8, 8, 9, 0.92) 0%, rgba(8, 8, 9, 0.7) 55%, rgba(8, 8, 9, 0.35) 100%), var(--bg-port, none) center / cover; }
.w-fig.bad { color: var(--k-bad); border-color: rgba(208, 106, 94, 0.6); padding: 0 9px; }
.port-body { padding: var(--k-sp-2) var(--k-sp-3) var(--k-sp-4); }
.mk-head { display: flex; align-items: center; justify-content: space-between; gap: var(--k-sp-2); margin: var(--k-sp-1) 0 0; }
.mk-head .w-sec { margin: 0; }
.mk-by { min-width: 72px; justify-content: center; gap: 4px; }
.mk-by b { font-variant-numeric: tabular-nums; }
.mk-note { margin: var(--k-sp-1) 0; font-size: var(--k-fs-1); }
.mk-list { display: flex; flex-direction: column; }
.mk-row.have .w-row-t > small { color: var(--k-gold); }
.mk-row .w-row-n { min-width: 64px; }
.mk-row .contra { color: #b99ad6; }
.yd-repair, .tv-hire { display: flex; flex-wrap: wrap; align-items: center; gap: var(--k-sp-2) var(--k-sp-3); }
.yd-repair-t, .tv-hire-h { flex: 1 1 220px; display: flex; align-items: center; gap: var(--k-sp-2); min-width: 0; }
.yd-repair-t > span, .tv-hire-h > span { display: flex; flex-direction: column; min-width: 0; }
.yd-repair-t b, .tv-hire-h b { font: 600 16px/1.2 var(--k-font-serif); }
.yd-repair > .w-qbtn, .tv-hire > .w-qbtn { flex: 0 0 auto; min-width: 170px; }
.yd-repair > :not(.yd-repair-t):not(.w-qbtn) { flex: 1 1 100%; }
.tv-hire .w-range { flex: 1 1 260px; }
.tv-why { flex: 1 1 200px; margin: 0; }
.tv-hire .w-range-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.tv-traits { display: flex; flex-wrap: wrap; gap: 2px; }
.tv-traits:empty { display: none; }
.q-best { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--k-sp-2); }
.q-card { display: flex; flex-direction: column; gap: var(--k-sp-2); margin: 0; }
.q-card .q-ico { width: 40px; height: 40px; object-fit: contain; border-radius: 50%; margin: 0; }
.q-card { position: relative; padding-left: 60px; min-height: 120px; }
.q-card > .q-ico { position: absolute; left: 10px; top: 10px; }
.q-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.q-t > b { font: 600 15px/1.2 var(--k-font-serif); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.q-t > small { font-size: var(--k-fs-1); }
.q-card > .w-qbtn { margin-top: auto; min-height: var(--k-h-2); }
.q-blocked { font-size: var(--k-fs-1); }
@media (max-height: 520px), (max-width: 699px) {
  .port-body { padding: var(--k-sp-2); }
  .w-quick > .w-qbtn { min-width: 130px; }
  .q-card { min-height: 0; }
}

/* ---------- The captain's window (hero.ts, gear.ts; docs/23 items 70–71) */
.cap-body { padding: var(--k-sp-2) var(--k-sp-3) var(--k-sp-4); }
/* The paper doll beside its figures: the whole doll in one screen on a phone held sideways. */
.cap-gear .gear-quick { margin-bottom: var(--k-sp-2); }
.cap-gear .gear-quick > .w-qbtn { flex: 0 1 260px; }
.cap-gear .gear-body:has(> .doll) { display: flex; align-items: flex-start; gap: var(--k-sp-3); }
.cap-gear .gear-body > .doll { flex: none; width: 320px; max-width: 100%; margin: 0; }
.cap-gear .gear-body > .gear-side { flex: 1 1 auto; margin-top: 0; min-width: 0; }
@media (max-height: 520px), (max-width: 699px) {
  .cap-body { padding: var(--k-sp-2); }
  .cap-body.cap-gear { padding-top: 4px; padding-bottom: 4px; }
  .cap-gear .gear-body > .doll { --ds: 44px; gap: 4px 6px; width: 250px; max-width: none; grid-template-columns: var(--ds) minmax(0, 1fr) var(--ds); }
  .cap-gear .doll-col { gap: 4px; justify-content: flex-start; }
  .cap-gear .doll-face { min-height: 0; height: calc(var(--ds) * 5 + 16px); }
  .cap-gear .gear-side { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .cap-gear:has(.doll) .gear-quick { position: absolute; left: calc(250px + var(--k-sp-2) + var(--k-sp-3)); right: var(--k-sp-2); top: 4px; z-index: 2; margin: 0; }
  .cap-gear .gear-quick > .w-qbtn { flex: 1 1 auto; min-width: 0; }
  .cap-gear { position: relative; }
  .cap-gear .gear-body > .gear-side { padding-top: 60px; }
}
/* The order book's schools: one row of chips; the school's note is its chip's hint on a phone. */
.cap-body .w-chips.hx-schools { flex-wrap: nowrap; padding: 0 0 var(--k-sp-2); border: 0; margin: 0 calc(-1 * var(--k-sp-1)); }
/* The level's choice in the Hero tab: two rows, a finger-wide «Взять» (the card from below is levelUpSheet). */
@media (max-height: 520px), (max-width: 699px) {
  .cap-body .hx-note { display: none; }
  .cap-body .hx-picks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .cap-body .hx-pick { flex-direction: row; align-items: center; text-align: left; padding: 6px 8px; gap: 8px; }
  .cap-body .hx-pick .ico-lg { width: 40px; height: 40px; flex: none; }
  .cap-body .hx-pick-t { align-items: flex-start; gap: 1px; flex: 1 1 auto; }
  .cap-body .hx-pick-t b { font-size: 15px; }
  .cap-body .hx-pick-t small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11px; }
  .cap-body .hx-pick-t small.muted { display: none; }
  .cap-body .hx-pick > .btn { margin: 0; min-height: 44px; flex: none; }
}
/* The level's choice from below: two big cards, one tap. */
.lu-sheet { width: min(640px, 100%); }
.lu-sub { margin: 0 0 var(--k-sp-2); color: var(--k-haze); font-size: var(--k-fs-2); }
.lu-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--k-sp-2); }
.lu-pick { display: flex; gap: var(--k-sp-2); align-items: flex-start; min-height: 96px; padding: var(--k-sp-3); border: 1px solid var(--k-brass-dim); border-radius: var(--k-r-2); background: linear-gradient(180deg, #221d18, #12100d); color: var(--k-bone); text-align: left; cursor: pointer;
  font: var(--k-fs-2)/32px var(--k-font-sans); touch-action: manipulation; transition: transform var(--k-dur-1) var(--k-ease-out), border-color var(--k-dur-2) var(--k-ease-out); }
.lu-pick:hover { border-color: var(--k-brass); }
.lu-pick:active { transform: scale(0.98); border-color: var(--k-gold); }
.lu-pick:focus-visible { outline: 2px solid var(--k-gold); outline-offset: 2px; }
.lu-pick[aria-busy='true'] { opacity: 0.6; }
.lu-ico { width: 52px; height: 52px; object-fit: contain; flex: none; margin: 0; }
.lu-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.35; }
.lu-t b { font: 600 17px/1.2 var(--k-font-serif); color: var(--k-gold); }
.lu-t small { color: var(--k-bone); font-size: var(--k-fs-1); line-height: 1.35; }
@media (max-width: 480px) { .lu-picks { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Settings (options.ts, docs/23 item 75): six rows in two columns, «Подробнее» under them */
.opt-main { padding: var(--k-sp-2) var(--k-sp-3) var(--k-sp-3); }
.opt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--k-sp-2) var(--k-sp-4); }
.opt-row { display: flex; align-items: center; gap: var(--k-sp-2); min-height: var(--k-h-3); padding: 0 var(--k-sp-2); border: 1px solid rgba(140, 107, 58, 0.28); border-radius: var(--k-r-2); background: rgba(8, 9, 11, 0.5); min-width: 0; }
.opt-ico { width: 26px; height: 26px; object-fit: contain; flex: none; margin: 0; }
.opt-name { flex: 0 1 auto; min-width: 0; font: 600 var(--k-fs-2)/1.2 var(--k-font-sans); color: var(--k-bone); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-row > input[type=range] { flex: 1 1 auto; min-width: 60px; height: var(--k-h-2); margin: 0 0 0 auto; accent-color: var(--k-gold); }
.opt-row > output { flex: none; min-width: 3em; text-align: right; font: 600 var(--k-fs-2) var(--k-font-sans); color: var(--k-haze); font-variant-numeric: tabular-nums; }
.opt-row > .w-seg, .opt-row > .w-switch { margin-left: auto; flex: none; }
.w-seg { display: inline-flex; gap: 2px; }
.w-seg .w-chip { min-width: 52px; justify-content: center; padding: 0 10px; border-radius: var(--k-r-1); }
.w-switch { display: inline-flex; align-items: center; gap: var(--k-sp-2); min-height: var(--k-h-2); min-width: 92px; padding: 0 var(--k-sp-2); border: 1px solid var(--k-brass-dim); border-radius: 22px; background: rgba(8, 9, 11, 0.7); color: var(--k-haze);
  font: 700 var(--k-fs-1)/1 var(--k-font-sans); text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer; touch-action: manipulation; }
.w-switch i { position: relative; width: 36px; height: 20px; border-radius: 10px; background: #2a2d31; box-shadow: inset 0 0 0 1px #050607; transition: background var(--k-dur-2) var(--k-ease-out); }
.w-switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--k-haze); transition: transform var(--k-dur-2) var(--k-ease-out), background var(--k-dur-2) var(--k-ease-out); }
.w-switch[aria-checked='true'] { color: var(--k-gold); border-color: var(--k-brass); }
.w-switch[aria-checked='true'] i { background: rgba(224, 184, 98, 0.35); }
.w-switch[aria-checked='true'] i::after { transform: translateX(16px); background: var(--k-gold); }
.w-switch:focus { outline: none; }
.w-switch:focus-visible { outline: 2px solid var(--k-gold); outline-offset: 2px; }
.opt-more { width: 100%; margin-top: var(--k-sp-3); }
/* the seventh, the minimap with a mark (owner, 2026-10-09), across both columns: its name and two words whole */
.opt-row--wide { grid-column: 1 / -1; }
@media (max-width: 699px) and (min-height: 521px) { .opt-grid { grid-template-columns: minmax(0, 1fr); } }
/* a phone held sideways: the seven rows and «Подробнее» in one screen (812×375, 640×360) */
@media (max-height: 420px) { .opt-grid { gap: 4px var(--k-sp-3); } .opt-row { min-height: 46px; } .opt-more { margin-top: var(--k-sp-2); } }
/* 640×360: the four sizes' chips a finger wide and no wider, so «Размер» keeps its word beside them (it was cut to 3 px) */
@media (max-width: 699px) { .opt-row .w-seg .w-chip { min-width: 44px; padding: 0 5px; } .opt-row { gap: 6px; } .opt-ico { width: 22px; height: 22px; } }

/* ---------- The island (base.ts, docs/23 item 72): «Собрать всё» heads the column, the buildings as big tiles */
.b-quick { margin: 0 0 var(--k-sp-2); }
.b-quick > .w-qbtn { flex: 1 1 auto; }
.b-tiles { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); margin: 0 0 var(--k-sp-3); }
.b-tile { min-height: 96px; }
.b-tile .w-tile-ico { width: 56px; height: 48px; object-fit: contain; }
.b-tile.empty { border-style: dashed; color: var(--k-haze); }
.b-tile .b-plus { font: 400 30px/1 var(--k-font-serif); color: var(--k-brass); }
.b-tile.working { border-color: var(--k-brass); }
.base-head.w-head .w-chips { flex: 1 1 auto; }
/* The town's buildings: a tile each on a phone — the words in its long-press hint. */
@media (max-height: 520px), (max-width: 699px) { .tw-card .tw-text { display: none; } }

/* ---------- The world map (worldmap.ts, docs/23 item 73): the layers in the band; on a phone the chart alone, the
   side logs folded away (the journal has them); a tap's «Плыть туда» big, under the chart's middle. */
#modal-panel[data-modal="map"] .map-wrap { position: relative; }
#modal-panel[data-modal="map"] .map-wp-acts { position: absolute; left: 50%; bottom: var(--k-sp-3); transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: var(--k-sp-2); top: auto; right: auto; }
#modal-panel[data-modal="map"] .map-wp-acts > .hidden { display: none; }
.map-wp-sail .map-wp-name { font: 600 var(--k-fs-1) var(--k-font-sans); color: var(--k-bone); text-shadow: none; }
.map-wp-sail .map-wp-name:empty { display: none; }
@media (max-height: 520px), (max-width: 699px) {
  #modal-panel[data-modal="map"]:has(> .map-logs) { display: flex; flex-direction: column; }
  #modal-panel[data-modal="map"] > .map-logs { display: none; }
  #modal-panel[data-modal="map"] > .map-wrap { flex: 1 1 auto; min-height: 0; }
  #modal-panel[data-modal="map"] .map-legend { position: absolute; left: var(--k-sp-2); bottom: var(--k-sp-2); border-width: 1px; max-width: 46%; }
}

/* ---------- The older windows on a phone (docs/23 item 78): their head in one band, every control a finger wide */
@media (max-height: 520px), (max-width: 699px) {
  #modal-panel > .modal-head:not(.w-head) { min-height: var(--k-h-2); padding: 2px 56px 2px var(--k-sp-2); gap: 2px var(--k-sp-2); align-items: center; }
  .skinned #modal-panel > .modal-head:not(.w-head) h2 { font-size: 17px; border-width: 6px 30px; border-image-width: 6px 30px; }
  #modal-panel > .modal-head:not(.w-head) .sub { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; margin: 0; }
  body.touch #modal-panel .tabs .tab { min-height: var(--k-h-2); display: inline-flex; align-items: center; }
  body.touch #modal-panel .btn { min-height: var(--k-h-2); }
  body.touch #modal-panel :is(input:not([type=checkbox]):not([type=radio]):not([type=range]), select) { min-height: var(--k-h-2); box-sizing: border-box; }
  body.touch #modal-panel .map-legend > summary { display: flex; align-items: center; min-height: var(--k-h-2); min-width: var(--k-h-2); padding: 0 var(--k-sp-2); }
}
/* Words for a desk: on a phone they are the heading's long-press hint. */
@media (max-height: 520px), (max-width: 699px) { .w-desk { display: none !important; } }
/* The journal's forms: one row for a guild's name, its tag and «Основать»; a letter's form first once asked for. */
.g-found { display: flex; gap: var(--k-sp-2); }
.g-found > input:first-child { flex: 1 1 auto; min-width: 0; }
@media (max-height: 520px), (max-width: 699px) { .let-compose { display: flex; flex-direction: column-reverse; } }
/* A narrow phone: a band with chips keeps the window's crest and gives its name's room to the chips (the name is
   still the heading, for a reader). */
@media (max-width: 700px) {
  .w-head--chips .w-title > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
