:root {
  --ink: #152f39;
  --deep: #102a34;
  --edge: #47616a;
  --brass: #e8bc72;
  --paper: #f4ead1;
  --cream: #fff2d6;
  --teal: #17696a;
  --muted: #a9b9b6;
  --header: 70px;
  --dock-h: 126px;
  --dock-b: 18px;
  --pad: 22px;
  --sans: 'DM Sans', Arial, sans-serif;
  --serif: 'DM Serif Text', Georgia, serif;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body,
#game {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
body {
  background: #176b73;
  color: var(--cream);
  font: 14px/1.35 var(--sans);
  user-select: none;
  -webkit-user-select: none;
}
button {
  color: inherit;
  font: inherit;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
canvas:focus-visible {
  outline: 2px solid #f1bd61;
  outline-offset: 3px;
}
button:disabled {
  cursor: default;
}
button .icon,
.ico-btn .icon {
  pointer-events: none;
  flex: none;
  vertical-align: middle;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
#game {
  position: relative;
  isolation: isolate;
}
#chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: 0 !important;
  cursor: grab;
}
#chart.moving {
  cursor: grabbing !important;
}
#vignette {
  position: absolute;
  inset: var(--header) 0 0;
  pointer-events: none;
  box-shadow: inset 0 0 64px #062d3e2e;
}
.topbar,
#dock,
#tide-panel,
#map-tools,
#inspector {
  background-color: var(--ink);
  background-image: linear-gradient(112deg, #24444d75, #0e2833bb);
  border: 1px solid #6f837980;
  box-shadow:
    0 4px 12px #052d394d,
    0 1px 3px #072b3659;
}
.topbar {
  position: absolute;
  inset: 0 0 auto;
  height: var(--header);
  display: flex;
  align-items: center;
  padding: 0 var(--pad);
  border: 0;
  border-bottom: 2px solid #c8a265;
  gap: 14px;
  z-index: 4;
  background: linear-gradient(110deg, #142f3a, #193946 48%, #112c36);
}
#brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 212px;
}
#brand .crest {
  flex: none;
}
.wordmark {
  font: normal 35px/0.96 var(--serif);
  letter-spacing: -1.35px;
  color: #faecd0;
}
.brand-sub {
  color: var(--brass);
  font-size: 8.7px;
  font-weight: 650;
  letter-spacing: 2.55px;
  margin-top: 5px;
  text-transform: uppercase;
}
#stores {
  display: flex;
  align-self: stretch;
  align-items: center;
  margin: auto;
  gap: 0;
}
.meter {
  height: 39px;
  padding: 0 clamp(12px, 1.9vw, 33px);
  border-left: 1px solid #657b7d65;
  display: grid;
  grid-template-columns: 31px auto;
  grid-template-rows: 15px 25px;
  align-items: center;
  column-gap: 9px;
  text-align: left;
}
.meter:last-child {
  border-right: 1px solid #657b7d65;
}
.meter > .icon {
  grid-row: span 2;
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 2px 0 #071f2580);
}
.meter-label,
.eyebrow,
.smallcap {
  font: 700 9px/1.3 var(--sans);
  letter-spacing: 1.55px;
  text-transform: uppercase;
}
.meter-label {
  align-self: end;
  color: #c0ccca;
  font-size: 9px;
  letter-spacing: 1.2px;
}
.value {
  font-size: 22px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: -0.7px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.rate {
  display: inline-block;
  font: 600 10px var(--sans);
  color: #aed2a2;
  vertical-align: middle;
  margin-left: 5px;
  letter-spacing: 0;
}
.rate.neg {
  color: #f2a28a;
}
.cap {
  color: #b4c2bd;
  font-size: 12px;
  letter-spacing: 0;
  font-weight: 500;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.ico-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  height: 34px;
  width: 34px;
  border-radius: 6px;
  color: #d4dece;
  border: 1px solid #738b866b;
  background: #132f3780;
}
.ico-btn:hover,
.ico-btn.on {
  color: var(--brass);
  background: #375057;
  border-color: #a89772;
}
.paper {
  color: #223c40;
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 2% 5%, #fff5df, transparent 58%),
    repeating-linear-gradient(3deg, transparent 0 3px, #a9854c05 3px 4px);
  border: 1px solid #d7bc87;
  box-shadow:
    0 5px 16px #0e3c4166,
    0 1px 2px #002b3659;
}
#charter {
  position: absolute;
  left: var(--pad);
  top: calc(var(--header) + 18px);
  width: 246px;
  border-radius: 7px;
  overflow: hidden;
  z-index: 3;
}
.charter-inner {
  padding: 15px 16px 12px;
}
.charter-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #87613a;
}
.charter-meta .eyebrow,
.section-mark {
  display: flex;
  gap: 6px;
  align-items: center;
}
.charter-index {
  font: 600 10px var(--sans);
  color: #82785c;
  letter-spacing: 1px;
  white-space: nowrap;
}
.charter-fold {
  display: flex;
  align-items: center;
  gap: 6px;
}
.charter-fold:hover {
  color: #095657;
}
#charter h2 {
  font: normal 27px/1.13 var(--serif);
  letter-spacing: -0.7px;
  margin: 9px 0 5px;
}
.charter-story {
  font-size: 12px;
  line-height: 1.46;
  color: #4f5c55;
}
.mission-row {
  margin-top: 11px;
}
.mission-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 650;
}
.mission-title .mark {
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  border: 1px solid #9a8b61;
  background: #f9f1dc;
  flex: none;
}
.mission-title.done .mark {
  background: #39847b;
  border-color: #39847b;
}
.mission-title .fraction {
  margin-left: auto;
  font-size: 11px;
  letter-spacing: 0.3px;
  color: #5a6255;
  white-space: nowrap;
}
.progress {
  height: 4px;
  background: #d9ceb2;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.progress span {
  display: block;
  height: 100%;
  background: #36857b;
  transition: width 0.25s ease;
}
.charter-foot {
  padding: 9px 16px;
  border-top: 1px solid #c9b991a3;
  background: #e6d8b94d;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #687064;
}
.charter-foot strong {
  font-weight: 550;
}
.charter-foot .res-chips {
  margin-left: auto;
}
.res-chips {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.res-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 650;
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.res-chip svg {
  flex: none;
}
.charter-claim {
  border-top: 1px solid #469a85;
  background: #216d65;
  color: #fff4d8;
  width: 100%;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.charter-claim:hover {
  background: #195f59;
}
#charter.folded .charter-inner {
  padding: 10px 14px;
}
#charter.folded h2 {
  font-size: 21px;
  margin: 6px 0 0;
}
#tide-panel {
  position: absolute;
  right: var(--pad);
  top: calc(var(--header) + 18px);
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 7px;
  padding: 8px 8px 8px 12px;
  z-index: 3;
}
.tide-read {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
}
.tide-read > .icon {
  color: var(--brass);
  width: 25px;
  height: 25px;
}
.tide-read .eyebrow {
  color: #cfbf95;
  font-size: 8px;
  letter-spacing: 1.2px;
  display: block;
}
.tide-number {
  font: normal 21px/1.1 var(--serif);
  display: block;
}
.gold-btn,
.primary,
.secondary,
.danger-btn {
  font: 650 12px var(--sans);
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
}
.gold-btn {
  background: linear-gradient(#eed09a, #dfb36e);
  color: #22363a;
  border: 1px solid #edcd98;
  box-shadow: 0 2px 0 #10232c66;
}
.gold-btn:hover {
  background: #f4d8a2;
}
.gold-btn:active,
.primary:active {
  transform: translateY(1px);
}
#map-tools {
  display: flex;
  flex-direction: column;
  position: absolute;
  right: var(--pad);
  bottom: calc(var(--dock-h) + var(--dock-b) + 17px);
  border-radius: 6px;
  padding: 2px;
  z-index: 2;
}
#map-tools button {
  display: grid;
  place-items: center;
  color: #e5e6cf;
  width: 33px;
  height: 33px;
}
#map-tools button + button {
  border-top: 1px solid #6d807255;
}
#map-tools button:hover,
#map-tools button.on {
  color: #f8ce7e;
  background: #537b7855;
}
#maphint {
  position: absolute;
  left: var(--pad);
  bottom: calc(var(--dock-h) + var(--dock-b) + 16px);
  color: #f1f0da;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  text-shadow: 0 1px 3px #0e3a42;
  background: #14474e91;
  padding: 5px 9px;
  border-radius: 20px;
  pointer-events: none;
}
#maphint .icon {
  vertical-align: middle;
}
#maphint i {
  width: 2px;
  height: 2px;
  border-radius: 100%;
  background: currentColor;
}
#dock {
  position: absolute;
  bottom: var(--dock-b);
  left: 50%;
  transform: translateX(-50%);
  width: min(1140px, calc(100% - var(--pad) * 2));
  height: var(--dock-h);
  border-radius: 9px;
  z-index: 4;
  padding: 0 10px 9px;
  background: linear-gradient(110deg, #173844, #132f39 68%, #193741);
  box-shadow:
    0 5px 16px #062e3666,
    0 0 0 1px #163c4255;
}
.dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
}
.nav-tabs {
  height: 100%;
  display: flex;
  gap: 9px;
  align-items: stretch;
}
.nav-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1px;
  color: #b8c6c1;
  padding: 0 12px;
}
.nav-tab.active,
.nav-tab:hover {
  color: #f2cc8b;
}
.nav-tab.active:after {
  content: '';
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 2px;
  height: 2px;
  background: #d3ac6f;
  border-radius: 2px;
}
.new-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e8b464;
  box-shadow: 0 0 0 2px #d6aa6318;
  margin-left: -3px;
}
.plan-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.page-btn {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
  color: #b9c9c4;
  border-radius: 4px;
}
.page-btn.active {
  background: #315256;
  border-color: #667b71;
  color: #f6e8ca;
}
.small-tool {
  display: grid;
  place-items: center;
  width: 27px;
  height: 25px;
  color: #d9d8bd;
  border-radius: 3px;
}
.small-tool:hover {
  background: #39565b;
}
.small-tool:disabled {
  opacity: 0.34;
}
.sep {
  height: 16px;
  width: 1px;
  background: #546a68;
  margin: 0 5px;
}
#plans {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  height: calc(100% - 42px);
}
.plan {
  position: relative;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 6px;
  min-width: 0;
  padding: 4px 7px;
  border-radius: 5px;
  border: 1px solid #506767;
  background:
    radial-gradient(ellipse at 17% 90%, #44615e96, transparent 77%),
    linear-gradient(120deg, #30474b, #233d46);
  transition:
    background 0.12s,
    border-color 0.12s,
    transform 0.12s;
}
.plan:hover {
  border-color: #bca16b;
  background-color: #3a5557;
  transform: translateY(-1px);
}
.plan.selected {
  border-color: #f0c47e;
  box-shadow: inset 0 0 0 1px #deb36a96;
  background: linear-gradient(120deg, #526258, #394f4c);
}
.plan img,
.plan .pier-art {
  width: clamp(39px, 4.4vw, 65px);
  height: calc(var(--dock-h) - 70px);
  object-fit: contain;
  filter: drop-shadow(1px 3px 1px #0c202253);
  pointer-events: none;
}
.plan-word {
  min-width: 0;
  align-self: center;
  padding-top: 7px;
}
.plan-name {
  display: block;
  font: 600 13px/1.1 var(--sans);
  color: #faefd4;
  letter-spacing: -0.05px;
  margin-bottom: 6px;
}
.plan .res-chips {
  gap: 6px;
}
.plan .res-chip {
  font-size: 11px;
  font-weight: 550;
  color: #d9e3ce;
  gap: 2px;
}
.plan .res-chip svg {
  width: 14px;
  height: 14px;
}
.keycap {
  position: absolute;
  top: 5px;
  right: 6px;
  color: #b4c0af;
  font: 500 9px/1 var(--sans);
  opacity: 0.8;
}
.plan.locked {
  opacity: 0.66;
}
.plan.unaffordable .res-chips {
  opacity: 0.6;
}
#build-note {
  position: absolute;
  left: 50%;
  bottom: calc(var(--dock-b) + var(--dock-h) + 9px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  background: #173943f2;
  border: 1px solid #99a58d9c;
  box-shadow: 0 3px 8px #183f4755;
  border-radius: 5px;
  padding: 7px 9px 7px 12px;
  max-width: 65%;
  font-size: 11px;
  color: #e2e7d5;
  z-index: 3;
  white-space: nowrap;
}
#build-note b {
  color: #f3cc8f;
}
#build-note button {
  display: grid;
  place-items: center;
  padding: 2px 3px;
  color: #d7ba88;
}
#toast {
  position: absolute;
  left: 50%;
  top: calc(var(--header) + 14px);
  transform: translate(-50%, -6px);
  transition:
    opacity 0.2s,
    transform 0.2s;
  opacity: 0;
  pointer-events: none;
  background: #163942f5;
  box-shadow: 0 3px 9px #0c323f55;
  border: 1px solid #bba373a0;
  color: #f4e8cf;
  padding: 9px 15px;
  border-radius: 25px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  font-weight: 550;
  z-index: 9;
  max-width: 48vw;
  text-align: center;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#toast > .icon {
  color: #e4bd7c;
}
#tip {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  background: #102d38f5;
  border: 1px solid #76968a9c;
  color: #f9edd4;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 5px;
  max-width: 245px;
  box-shadow: 0 2px 9px #12323755;
}
#tip strong {
  display: block;
  color: #f4d397;
  font-weight: 650;
}
#tip small {
  display: block;
  font-size: 11px;
  color: #c4d2c8;
  margin-top: 2px;
}
#inspector {
  position: absolute;
  right: var(--pad);
  top: calc(var(--header) + 88px);
  z-index: 4;
  width: 249px;
  border-radius: 7px;
  padding: 14px;
  color: #dce4d8;
  max-height: calc(100% - var(--header) - var(--dock-h) - 114px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.inspect-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 10px;
}
.inspect-art {
  width: 58px;
  height: 65px;
  object-fit: contain;
}
.inspect-head .eyebrow {
  color: #c6b388;
  font-size: 8px;
}
.inspect-head h3 {
  font: normal 23px/1.02 var(--serif);
  color: var(--cream);
  margin: 3px 0;
}
.inspect-head small {
  color: #bccdc7;
  font-size: 10px;
}
.mini-x {
  position: absolute;
  right: 7px;
  top: 7px;
  color: inherit;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  opacity: 0.8;
}
.inspect-desc {
  font-size: 12px;
  line-height: 1.45;
  color: #d0dace;
  margin: 9px 0;
}
.inspect-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  border-top: 1px solid #6d817955;
  padding: 7px 0;
  font-size: 11px;
}
.inspect-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.inspect-actions .tiny {
  flex: 1;
}
.tiny {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  color: #d6e0d1;
  background: #2d4b52;
  border: 1px solid #627b74;
  border-radius: 4px;
  font-size: 10px;
}
.tiny:hover,
.tiny.on {
  color: #ffdc95;
  border-color: #c49c64;
}
.inspect-btn {
  width: 100%;
  padding: 8px;
  justify-content: space-between;
  font-size: 11px;
}
.inspect-btn:disabled,
.gold-btn:disabled {
  opacity: 0.55;
}
#modal-wrap {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: #09263078;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#modal {
  position: relative;
  width: min(714px, 94vw);
  max-height: calc(100vh - 38px);
  overflow: auto;
  border: 1px solid #bea06b;
  border-radius: 10px;
  background-color: var(--paper);
  background-image: radial-gradient(ellipse at 7% 0%, #fff5db, transparent 60%);
  color: #263d40;
  box-shadow: 0 16px 70px #05232cbc;
  scrollbar-width: thin;
  scrollbar-color: #b9ad86 #eee3c5;
}
.modal-hero {
  position: relative;
  background: var(--ink);
  color: var(--cream);
  min-height: 110px;
  padding: 20px 26px 19px;
  overflow: hidden;
  background-image:
    linear-gradient(90deg, #183944 0%, #193c44 26%, #163941c9 52%, #14384217 86%), url('art/harbor.webp');
  background-size: cover;
  background-position:
    center,
    center 45%;
}
.modal-hero .eyebrow {
  color: #e9c78e;
  display: flex;
  align-items: center;
  gap: 7px;
}
.modal-hero h2 {
  font: normal 36px/1.13 var(--serif);
  margin: 5px 0;
  letter-spacing: -0.8px;
}
.modal-hero p {
  font-size: 12px;
  color: #ebe9d6;
  max-width: 80%;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  background: #13333ed9;
  border: 1px solid #aeb8a29e;
  color: #f0e2c8;
  border-radius: 50%;
  z-index: 1;
}
.modal-close:hover {
  background: #284e54;
}
.folio-tabs {
  display: flex;
  padding: 0 23px;
  background: #e2d4b6;
  border-bottom: 1px solid #c4b695;
  gap: 16px;
  flex-wrap: wrap;
}
.folio-tabs button {
  font-weight: 650;
  font-size: 12px;
  height: 38px;
  position: relative;
  color: #687264;
  display: flex;
  align-items: center;
  gap: 6px;
}
.folio-tabs .active {
  color: #1a615b;
}
.folio-tabs .active:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #287468;
}
.folio-body {
  padding: 20px 25px 22px;
}
.folio-body h3 {
  font: normal 24px/1.15 var(--serif);
  letter-spacing: -0.45px;
}
.folio-body p {
  color: #586257;
  font-size: 12px;
  line-height: 1.5;
}
.folio-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.folio-title .smallcap {
  color: #71775f;
  letter-spacing: 1.1px;
  font-size: 9px;
}
.fleet-quote {
  font: italic 15px/1.45 var(--serif);
  color: #646958;
  margin: 6px 0 15px;
}
.orders {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.order {
  border: 1px solid #c9b899;
  background: linear-gradient(135deg, #fff8e6, #ecdfc3);
  border-radius: 5px;
  padding: 13px 12px;
  position: relative;
}
.order .eyebrow {
  color: #847552;
  font-size: 8px;
}
.order h4 {
  font: normal 19px/1.15 var(--serif);
  margin: 5px 0 12px;
}
.order-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: #737662;
  padding: 6px 0;
  border-top: 1px solid #c4b69966;
}
.order-line .res-chip {
  color: #31484a;
}
.primary {
  color: #fff3d4;
  background: #216b64;
  border: 1px solid #205f5a;
}
.primary:hover {
  background: #185b56;
}
.primary:disabled,
.secondary:disabled {
  color: #778076;
  background: #d5d4bf;
  border-color: #b9bca6;
}
.order button {
  width: 100%;
  margin-top: 9px;
}
.secondary,
.danger-btn {
  background: #f0e5c7;
  border: 1px solid #b6a887;
  color: #334e4d;
}
.secondary:hover {
  background: #e6dab8;
}
.danger-btn {
  color: #934c3d;
}
.folio-foot {
  border-top: 1px solid #cdbfa3;
  margin-top: 16px;
  padding-top: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: #666f5e;
}
.folio-foot .primary {
  padding: 6px 10px;
}
.mail-pane,
.finish-pane {
  display: flex;
  align-items: center;
  gap: 22px;
}
.mail-art,
.finish-art {
  height: 125px;
  width: 125px;
  object-fit: contain;
}
.mail-text {
  flex: 1;
}
.mail-text .order-line {
  max-width: 290px;
}
.mail-text p {
  margin: 6px 0 10px;
}
.mail-text .primary {
  margin-top: 10px;
}
.charter-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 11px;
}
.charter-entry {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #c9bca0;
  border-radius: 5px;
  background: #f4ebd0;
  padding: 8px 10px;
}
.charter-entry.current {
  border-color: #518a79;
  background: #dce6cc;
}
.charter-entry .num {
  font: normal 18px var(--serif);
  color: #8e805e;
  min-width: 24px;
  text-align: center;
}
.charter-entry b {
  font: normal 16px var(--serif);
  display: block;
}
.charter-entry small {
  font-size: 10px;
  color: #70765f;
}
.chart-summary {
  margin: 0 0 11px;
  color: #5a665c;
  font-size: 12px;
}
.log-entry {
  display: grid;
  grid-template-columns: 54px auto;
  gap: 10px;
  border-bottom: 1px solid #cbbd9e;
  padding: 9px 0;
}
.log-entry .smallcap {
  color: #8a7b5c;
  margin-top: 2px;
  font-size: 8px;
}
.log-entry b {
  font-size: 13px;
}
.log-entry p {
  margin-top: 2px;
}
.scroll-page {
  max-height: min(350px, 48vh);
  overflow-y: auto;
  padding-right: 5px;
  scrollbar-width: thin;
}
.flag-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-top: 12px;
}
.flag-tile {
  background: #f9efd6;
  border-radius: 4px;
  border: 1px solid #cabb98;
  text-align: center;
  padding: 8px;
  font-size: 12px;
}
.flag-tile .icon {
  vertical-align: middle;
}
.flag-tile.flying {
  border-color: #688c72;
  background: #e1e9d0;
}
.flag-tile.locked .swatch {
  filter: grayscale(0.85);
  opacity: 0.4;
}
.flag-tile small {
  display: block;
  color: #757763;
  font-size: 10px;
}
.swatch {
  width: 48px;
  height: 27px;
  margin: 0 auto 5px;
  border-radius: 1px;
  clip-path: polygon(0 0, 100% 10%, 87% 51%, 100% 92%, 0 100%);
}
.account-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 12px 0;
}
.account {
  border: 1px solid #c7b99b;
  background: #faf0d7;
  border-radius: 5px;
  padding: 10px;
  text-align: center;
}
.account .total {
  font-weight: 650;
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: center;
}
.account .smallcap {
  font-size: 8px;
  color: #72755e;
}
.positive {
  color: #267359;
}
.negative {
  color: #a65543;
}
.ledger-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #c8b99a85;
  font-size: 12px;
}
.ledger-line b {
  font-weight: 600;
}
.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 22px;
}
.guide-grid article h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 20px;
  margin-bottom: 3px;
}
kbd {
  font: 600 10px var(--sans);
  background: #e5dabc;
  border: 1px solid #c6ba98;
  border-bottom-width: 2px;
  color: #556257;
  border-radius: 3px;
  padding: 1px 4px;
  white-space: nowrap;
}
.key-lines {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 20px;
  margin-top: 15px;
  font-size: 11px;
  color: #5d685d;
}
.key-lines div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
#controller-cursor {
  position: fixed;
  width: 15px;
  height: 15px;
  border: 2px solid #fff4c9;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px #254951;
  z-index: 22;
  pointer-events: none;
  margin: -7px;
}
.empty-note {
  padding: 15px 0;
  color: #6b735f;
  font-style: italic;
}
@media (min-height: 850px) and (min-width: 1200px) {
  :root {
    --header: 76px;
    --dock-h: 140px;
    --pad: 27px;
    --dock-b: 24px;
  }
  #charter {
    width: 264px;
  }
  .charter-inner {
    padding: 17px 19px 15px;
  }
  .charter-story {
    font-size: 13px;
  }
  .dock-head {
    height: 45px;
  }
  #plans {
    height: calc(100% - 45px);
  }
  .plan-name {
    font-size: 14px;
  }
}
@media (max-width: 1110px) {
  :root {
    --pad: 14px;
    --header: 62px;
    --dock-h: 114px;
    --dock-b: 12px;
  }
  #brand {
    min-width: 177px;
    gap: 6px;
  }
  .wordmark {
    font-size: 31px;
  }
  .brand-sub {
    font-size: 8px;
    letter-spacing: 2.1px;
  }
  .crest {
    width: 39px;
  }
  .meter {
    padding: 0 15px;
    grid-template-columns: 26px auto;
    column-gap: 6px;
  }
  .meter > .icon {
    width: 26px;
    height: 26px;
  }
  .topbar {
    gap: 8px;
  }
  .top-actions {
    gap: 6px;
  }
  #charter {
    width: 218px;
  }
  .charter-inner {
    padding: 12px 13px 10px;
  }
  #charter h2 {
    font-size: 24px;
  }
  .charter-story {
    font-size: 11.5px;
  }
  .plan {
    gap: 4px;
    padding: 4px;
  }
  .plan-name {
    font-size: 12px;
  }
  .plan img,
  .plan .pier-art {
    width: 42px;
  }
  .plan-word {
    padding-top: 6px;
  }
  .dock-head {
    height: 36px;
  }
  #plans {
    height: calc(100% - 36px);
  }
  #tide-panel {
    gap: 8px;
  }
  .nav-tab {
    font-size: 12px;
  }
}
@media (max-height: 600px) {
  :root {
    --header: 55px;
    --dock-h: 98px;
    --dock-b: 9px;
    --pad: 12px;
  }
  .wordmark {
    font-size: 28px;
  }
  .brand-sub {
    margin-top: 3px;
    font-size: 7px;
  }
  .crest {
    height: 43px;
  }
  .meter {
    height: 34px;
    grid-template-rows: 12px 22px;
  }
  .value {
    font-size: 20px;
  }
  .meter-label {
    font-size: 8px;
  }
  .topbar {
    border-bottom-width: 1px;
  }
  #charter,
  #tide-panel {
    top: calc(var(--header) + 10px);
  }
  #charter {
    width: 207px;
  }
  .charter-inner {
    padding: 9px 11px;
  }
  #charter h2 {
    font-size: 23px;
    margin: 6px 0 3px;
  }
  .charter-story {
    font-size: 11px;
    line-height: 1.36;
  }
  .mission-row {
    margin-top: 8px;
  }
  .mission-title {
    font-size: 11px;
  }
  .charter-foot {
    padding: 6px 11px;
  }
  .dock-head {
    height: 32px;
  }
  #plans {
    height: calc(100% - 32px);
  }
  .nav-tab .icon {
    width: 15px;
  }
  .plan img,
  .plan .pier-art {
    height: 42px;
    width: 40px;
  }
  .plan-name {
    margin-bottom: 4px;
  }
  .plan .keycap {
    font-size: 8px;
  }
  .plan .res-chip {
    font-size: 10px;
  }
  #tide-panel {
    padding: 6px 6px 6px 9px;
  }
  .tide-number {
    font-size: 18px;
  }
  #tide-panel .gold-btn {
    padding: 7px 9px;
  }
  .modal-hero {
    min-height: 78px;
    padding: 12px 22px;
  }
  .modal-hero h2 {
    font-size: 29px;
  }
  .folio-body {
    padding: 13px 20px 15px;
  }
  .folio-tabs button {
    height: 31px;
  }
  .folio-foot {
    margin-top: 10px;
  }
  .order {
    padding: 9px;
  }
  .order h4 {
    margin: 4px 0 7px;
  }
  .fleet-quote {
    margin: 4px 0 9px;
  }
  .guide-grid {
    gap: 10px 16px;
  }
  #inspector {
    top: calc(var(--header) + 64px);
    max-height: calc(100% - var(--header) - var(--dock-h) - 82px);
    padding: 10px;
    width: 218px;
  }
  .inspect-art {
    width: 44px;
    height: 43px;
  }
  .inspect-head h3 {
    font-size: 20px;
  }
  .inspect-desc {
    font-size: 11px;
    margin: 7px 0;
  }
  #build-note {
    padding: 5px 8px;
    font-size: 10px;
  }
  .folio-title h3 {
    font-size: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* The tide bell shares the instrument rail, leaving the lighthouse in view. */
.topbar #tide-panel {
  position: static;
  inset: auto;
  z-index: auto;
  box-shadow: none;
  background: none;
  border: 0;
  border-left: 1px solid #61797a70;
  border-radius: 0;
  padding: 0 6px 0 19px;
  gap: 14px;
  flex: none;
}
.topbar #tide-panel .gold-btn {
  white-space: nowrap;
}
.topbar #brand {
  min-width: max-content;
}
.charter-meta .eyebrow {
  white-space: nowrap;
}
#inspector {
  top: calc(var(--header) + 18px);
  max-height: calc(100% - var(--header) - var(--dock-h) - 53px);
}
@media (max-width: 1210px) {
  .topbar #tide-panel {
    padding-left: 12px;
    gap: 8px;
  }
  #stores .meter {
    padding: 0 13px;
  }
  .top-actions {
    gap: 5px;
  }
}
@media (max-width: 1040px) {
  #stores .meter {
    padding: 0 9px;
    grid-template-columns: 23px auto;
    column-gap: 5px;
  }
  .meter > .icon {
    width: 24px;
    height: 24px;
  }
  .topbar #tide-panel {
    border: 0;
    padding: 0 2px;
  }
  .topbar #tide-panel .gold-btn {
    padding: 7px 8px;
  }
  .tide-read > .icon {
    width: 21px;
    height: 21px;
  }
  .tide-read {
    gap: 5px;
  }
  #brand {
    gap: 4px;
  }
  .top-actions .ico-btn {
    width: 29px;
    height: 29px;
  }
  .charter-meta .eyebrow {
    font-size: 8px;
    letter-spacing: 1.15px;
  }
}
@media (max-height: 600px) {
  #inspector {
    top: calc(var(--header) + 10px);
    max-height: calc(100% - var(--header) - var(--dock-h) - 33px);
  }
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 12px;
}
.project-card {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 6px;
  border: 1px solid #c5b899;
  border-radius: 5px;
  padding: 5px 7px;
  background: #f8efd5;
  min-width: 0;
}
.project-card.active {
  background: #dce7ce;
  border-color: #528578;
}
.project-card img {
  width: 37px;
  height: 41px;
  object-fit: contain;
}
.project-card b {
  font: normal 14px/1.1 var(--serif);
  display: block;
}
.project-card small {
  font-size: 9px;
  color: #717762;
  line-height: 1.15;
  display: block;
  margin-top: 3px;
}
.project-details {
  border: 1px solid #c8b99a;
  border-radius: 5px;
  padding: 12px 14px;
  background: #f9efd6;
}
.project-details .project-req {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 12px;
}
.project-req.good {
  color: #246759;
}
.project-req .icon {
  flex: none;
}
.project-details .folio-foot {
  margin-top: 8px;
  padding-top: 8px;
}
.project-details .folio-title h3 {
  font-size: 21px;
}
@media (max-height: 600px) {
  .project-card img {
    height: 31px;
    width: 28px;
  }
  .project-details {
    padding: 8px 11px;
  }
  .project-grid {
    margin-bottom: 7px;
  }
}
#first-cue {
  font-size: 11px;
  color: #c8d3c3;
  padding-left: 9px;
}
.mail-pane .project-req {
  font-size: 11px;
  margin: 7px 0;
  color: #7e6746;
}
.mail-pane .project-req.good {
  color: #307565;
}
.register {
  margin-top: 7px;
}
.register-row {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 10px;
  border-bottom: 1px solid #c8b99a95;
  padding: 5px 4px;
  font-size: 12px;
}
.register-row:hover {
  background: #e2ddbd;
}
.register-row img {
  width: 35px;
  height: 36px;
  object-fit: contain;
}
.register-row small {
  display: block;
  color: #697260;
  font-size: 10px;
}
.register-crew {
  margin-left: auto;
  color: #626e60;
  font-size: 11px;
}
.register-row .res-chips {
  min-width: 40px;
  justify-content: flex-end;
}
#build-note .turn-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-left: 1px solid #72857a80;
  padding: 2px 6px 2px 9px;
  margin-left: 2px;
  font-size: 10px;
}
