@font-face { font-family: 'IM Fell English'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/im-fell-english.woff2) format('woff2'); }
@font-face { font-family: 'IM Fell English'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/im-fell-english-italic.woff2) format('woff2'); }

:root {
  --paper: #e9dfc8;
  --panel: #f6efdf;
  --ink: #2b2a28;
  --quiet: #66604f;
  --rule: #cdbf9f;
  --sea: #4d7482;
  --sea-deep: #2f4a55;
  --accent: #8c2f39;
  --good: #3f6a4a;
  --bad: #a4342a;
  --display: 'IM Fell English', Georgia, serif;
  font: 15px/1.4 Georgia, 'Iowan Old Style', serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html body { font: inherit; margin: 0; background: var(--paper); min-height: 100vh; display: flex; flex-direction: column; }
button { font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; padding: 5px 10px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--ink); }
button:disabled { color: #a79f8f; cursor: not-allowed; }
button.primary { background: var(--ink); color: var(--panel); border-color: var(--ink); }
button.primary:disabled { background: var(--rule); border-color: var(--rule); color: var(--quiet); }
button.on { background: var(--sea-deep); border-color: var(--sea-deep); color: #fff; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

#bar { display: flex; align-items: center; gap: 13px; padding: 8px 16px; background: var(--sea-deep); color: var(--paper); flex-wrap: wrap; border-bottom: 3px double #c9b98f; }
#bar .year { font: 30px/1 var(--display); font-variant-numeric: tabular-nums; }
#bar .part { font-size: 12px; opacity: .75; width: 122px; white-space: nowrap; }  /* Wide enough for 30 September, so the bar never shifts. */
#crash { padding: 8px 16px; background: var(--bad); color: #fff; font-size: 14px; }
#bar .stat { font-size: 12px; opacity: .75; white-space: nowrap; }
#bar .stat:nth-child(2) { width: 84px; }
#bar .stat:nth-child(3) { width: 62px; }  /* Room for the change due on 31 December. */
#bar .stat:nth-child(4) { width: 76px; }
#bar .stat:nth-child(5) { width: 58px; }  /* Room for homes under way. */
#bar .stat:nth-child(6) { width: 58px; }
#bar .stat:nth-child(7) { width: 72px; }
#bar .stat:nth-child(8) { width: 74px; }
#bar .stat:nth-child(9) { width: 56px; }
#bar .stat b { display: block; font-size: 16px; font-weight: 400; opacity: 1; color: #fff; font-variant-numeric: tabular-nums; }
#bar .stat b.bad { color: #ffb4a8; }
#bar .stat b small { font-size: 11px; color: #e5d6a8; }
#bar .stat b small.bad { color: #ffb4a8; }
#bar .speed { margin-left: auto; display: flex; gap: 4px; }
#bar .speed button { background: transparent; color: var(--paper); border-color: #6c8791; min-width: 40px; }
#bar .speed button.on { background: var(--accent); border-color: var(--accent); }
#bar .speed button.go { background: var(--paper); border-color: var(--paper); color: var(--sea-deep); }

main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; padding: 14px 16px; align-items: start; }
.stage { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.canvas-wrap { position: relative; }
canvas { width: 100%; height: auto; display: block; cursor: crosshair; background: var(--sea); box-shadow: 0 2px 10px rgba(60,44,20,.35); }
#zoom { position: absolute; left: 12px; top: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
#zoom button { width: 30px; height: 30px; padding: 0; font-size: 18px; line-height: 1; background: rgba(246, 239, 223, .92); }
#zoom #island, #zoom #names { width: auto; padding: 0 7px; font-size: 13px; }
canvas { touch-action: none; }
#place { position: absolute; right: 8px; top: 46px; width: min(250px, 70%); max-height: 70%; overflow: auto; padding: 8px 26px 8px 10px; background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: 4px; box-shadow: 0 2px 8px rgba(60,44,20,.35); font-size: 12.5px; line-height: 1.35; cursor: pointer; }
#place[hidden] { display: none; }
#place h4 { margin: 0 0 3px; font-size: 14px; color: var(--sea-deep); }
#place p { margin: 0 0 3px; }
#place button { position: absolute; top: 3px; right: 4px; padding: 0 5px; border: 0; background: none; font-size: 15px; color: var(--quiet); }
#tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--paper); font-size: 12px; padding: 4px 7px; border-radius: 3px; white-space: nowrap; }

#status { margin: 0; font-size: 12px; color: var(--quiet); }
#sea { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.voyage { font-size: 12px; background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; padding: 5px 8px; }
.voyage .track { height: 5px; background: var(--rule); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.voyage .track i { display: block; height: 100%; background: var(--sea-deep); }
.voyage.home .track i { background: var(--accent); }
.voyage.site .track i { background: #b5651d; }
.card .track { height: 5px; background: var(--rule); border-radius: 3px; margin: 6px 0; overflow: hidden; }
.card .track i { display: block; height: 100%; background: #b5651d; }
.feed-title { margin: 4px 0 0; font: 400 17px/1.2 var(--display); color: var(--sea-deep); border-bottom: 1px solid var(--rule); padding-bottom: 2px; }
#feed { list-style: none; margin: 0; padding: 0 4px 0 0; font-size: 13px; line-height: 1.35; color: var(--quiet); height: 240px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
#feed li { display: flex; gap: 8px; padding: 2px 0; }
#feed li p { margin: 0; }
#feed .good { color: var(--good); }
#feed .bad { color: var(--bad); }
#feed span { flex: 0 0 78px; font-variant-numeric: tabular-nums; }

#panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; display: flex; flex-direction: column; max-height: calc(100vh - 92px); overflow: hidden; }
#tabs { display: flex; border-bottom: 1px solid var(--rule); }
#tabs button { flex: 1; border: 0; border-radius: 0; background: transparent; padding: 7px 2px; font: 16px var(--display); }
#tabs button.on { background: transparent; color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
#tabs b { color: var(--accent); }
.alert { margin: 0; padding: 8px 12px; background: var(--bad); color: #fff; font-size: 14px; }
#content { padding: 12px; overflow-y: auto; }
#content h3 { margin: 14px 0 6px; font: 400 17px/1.2 var(--display); color: var(--sea-deep); border-bottom: 1px solid var(--rule); padding-bottom: 2px; }
#content h3:first-child { margin-top: 0; }
#content h3.fold button { display: flex; justify-content: space-between; align-items: baseline; width: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; }
#content h3.fold small { font: 12.5px Georgia, serif; color: var(--quiet); }
#content h3.fold button:hover small { color: var(--ink); }
.log-toggle { display: flex; justify-content: space-between; align-items: baseline; width: 100%; margin: 6px 0 2px; padding: 3px 0; border: 0; border-top: 1px solid var(--rule); border-radius: 0; background: none; font-size: 13.5px; text-align: left; }
.log-toggle small { color: var(--quiet); font-size: 12px; }
.log-pages { margin-bottom: 4px; }
#content h3.review-head button:disabled { color: #a79f8f; }
#content h3.review-head { display: flex; justify-content: space-between; align-items: baseline; }
#content h3.review-head button { width: auto; display: inline-block; padding: 1px 7px; margin-left: 3px; border: 1px solid var(--rule); border-radius: 4px; font: 12px Georgia, serif; }
.log-head { margin: 8px 0 3px; font-size: 12.5px; font-weight: 700; color: var(--sea-deep); }
.logbook { list-style: none; margin: 0; padding: 0; }
.logbook li { display: grid; grid-template-columns: 76px 1fr; gap: 6px; padding: 2px 0; font-size: 12.5px; line-height: 1.35; }
.logbook span { color: var(--quiet); }
.logbook p { margin: 0; }
.row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; font-size: 14px; }
.row b { font-weight: 400; font-variant-numeric: tabular-nums; }
.note { font-size: 12.5px; color: var(--quiet); margin: 4px 0 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.card { border: 1px solid var(--rule); border-radius: 4px; padding: 8px 10px; margin-bottom: 8px; }
.card.home { border-color: var(--accent); }
.card h4 { margin: 0 0 2px; font: 400 18px/1.2 var(--display); display: flex; justify-content: space-between; }
.card h4 small { color: var(--quiet); font: 12px Georgia, serif; }
.choice { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.choice button { flex: 1; font-size: 12.5px; padding: 4px 4px; min-width: 0; }
.policy { margin-top: 8px; font-size: 14px; }
.policy .note { margin: 3px 0 0; line-height: 1.3; }
.tool { display: grid; grid-template-columns: 38px 1fr auto; gap: 8px; align-items: center; width: 100%; text-align: left; margin-bottom: 4px; padding: 5px 8px; }
.tool img { width: 38px; height: 38px; display: block; }
.tool small { display: block; color: var(--quiet); font-size: 12px; }
.tool.on small { color: #fbe9d7; }
.tool small.no-lot { color: var(--accent); margin-top: 2px; }
.tool.on small.no-lot { color: #fbe9d7; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; font-variant-numeric: tabular-nums; }
th { text-align: right; color: var(--quiet); font-weight: 400; border-bottom: 1px solid var(--rule); padding: 2px 4px; }
td { text-align: right; padding: 2px 4px; }
th:first-child, td:first-child { text-align: left; }
svg.spark { width: 100%; height: 56px; display: block; }

#overlay { position: fixed; inset: 0; background: rgba(38, 48, 52, .42); display: grid; place-items: center; padding: 16px; z-index: 5; }
#overlay[hidden] { display: none; }
.dialog { background: var(--panel); border-radius: 2px; border: 1px solid var(--ink); outline: 1px solid var(--ink); outline-offset: -6px; box-shadow: 0 8px 28px rgba(30,26,18,.45); padding: 26px 28px; max-width: 520px; width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; }
.dialog h2 { margin: 0 0 8px; font: 400 28px/1.15 var(--display); color: var(--sea-deep); }
.dialog p { margin: 0 0 12px; }
.dialog .steps { margin: 0 0 14px; padding-left: 20px; }
.dialog .steps li { margin-bottom: 8px; }
.dialog .steps b { font-weight: 600; }
#paused { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); padding: 5px 12px; background: var(--sea-deep); color: var(--paper); border-radius: 2px; font-size: 13px; white-space: nowrap; pointer-events: none; }
.dialog .subtitle { margin: -4px 0 14px; font: italic 18px/1.2 var(--display); color: var(--quiet); }
.dialog .notice { padding: 8px 10px; border-left: 3px solid var(--accent); background: var(--paper); font-size: 13.5px; }
.dialog .actions { flex-direction: column; }
.dialog .actions.inline { flex-direction: row; }
.dialog .actions button small { display: block; font-size: 12.5px; color: var(--quiet); margin-top: 1px; }
.dialog textarea { width: 100%; min-height: 70px; font: inherit; padding: 6px; border: 1px solid var(--rule); border-radius: 4px; background: #fff; color: var(--ink); }  /* The color is set so a dark-mode browser cannot turn the text white on white. */
.scale button { flex: 1; }

@media (max-width: 960px) {
  main { grid-template-columns: minmax(0, 1fr); }
  #panel { max-height: none; }
  #sea { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
html { scrollbar-gutter: stable; }  /* A scrollbar coming and going would nudge the speed buttons. */

.warn { margin: 8px 0; padding: 6px 8px; font-size: 12.5px; border-left: 3px solid var(--accent); background: rgba(150, 130, 90, .14); }
.ask { font-size: 12.5px; color: var(--quiet); margin: 10px 0 4px; }
.ask b { display: block; font: 400 15px/1.2 var(--display); color: var(--sea-deep); }
.outlook { margin: 10px 0 6px; padding: 6px 8px; font-size: 12.5px; background: rgba(150, 130, 90, .14); }
#coach { margin: 8px 12px 0; padding: 8px 10px; border-left: 3px solid var(--sea-deep); background: rgba(150, 130, 90, .14); font-size: 13px; }
#coach b { font: 400 15px/1.2 var(--display); color: var(--sea-deep); }
#coach p { margin: 2px 0 0; }
#coach .actions button { font-size: 12px; padding: 2px 8px; }
#hover { position: fixed; z-index: 9; max-width: 260px; padding: 5px 8px; background: var(--ink); color: var(--paper); font-size: 12.5px; line-height: 1.35; border-radius: 3px; pointer-events: none; }
#hover[hidden] { display: none; }

.landing { width: 100%; margin: 6px 0; font-size: 12.5px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.landing th, .landing td { padding: 1px 4px; text-align: right; border: 0; }
.landing th:first-child, .landing td:first-child { text-align: left; }
.landing .total td { border-top: 1px solid var(--ink); font-weight: 700; }
.accounts { max-height: 280px; overflow: auto; border: 1px solid var(--rule); border-radius: 4px; background: var(--panel); }
.accounts table { width: 100%; font-size: 11.5px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.accounts th { position: sticky; top: 0; background: var(--panel); text-align: left; padding: 3px 5px; }
.accounts td { padding: 2px 5px; border-top: 1px solid var(--rule); vertical-align: top; }
.accounts td:nth-child(1) { white-space: nowrap; color: var(--quiet); }
.accounts td:nth-child(2) { text-align: left; }
.accounts td:nth-child(3), .accounts td:nth-child(4), .accounts th:nth-child(3), .accounts th:nth-child(4) { text-align: right; white-space: nowrap; }
.accounts .in { color: var(--good); }
.accounts .out { color: var(--bad); }

/* A pick is a tick and an outline. Only the sail button looks like something still to press. */
.choice button.on { background: #e3e9e6; color: var(--sea-deep); border-color: var(--sea-deep); box-shadow: inset 0 0 0 1px var(--sea-deep); }
.choice button.on::before { content: '\2713\00a0'; font-weight: 700; }
button.sail { display: block; width: 100%; margin-top: 4px; padding: 10px; font: 17px var(--display); background: var(--good); border-color: #2c4c35; color: #fff; box-shadow: 0 2px 0 #2c4c35; }
button.sail:hover:not(:disabled) { background: #4b7c58; border-color: #2c4c35; }
button.sail:active:not(:disabled) { box-shadow: none; transform: translateY(2px); }
button.sail:disabled { background: transparent; border: 1px dashed #a79f8f; color: #a79f8f; box-shadow: none; }
