/* Maintenance Window Manager — desktop interface, light and dark.
   One stylesheet, no framework, no reset beyond box-sizing. Colours are custom
   properties on :root; the dark set is applied by the system preference unless
   the manual toggle has pinned a theme with data-theme on <html>. */

:root {
  color-scheme: light dark;

  --bg: #eceff4;
  --panel: #ffffff;
  --panel-2: #f5f7fa;
  --panel-3: #eef1f6;
  --line: #d4dae3;
  --line-soft: #e4e9f0;
  --fg: #151a21;
  --fg-2: #3a4450;
  --muted: #69747f;
  --muted-2: #8b95a1;

  --accent: #1c63d4;
  --accent-fg: #ffffff;
  --accent-soft: #e4edfd;
  --accent-line: #b7cef6;

  --good: #17704a;
  --good-soft: #e0f3e9;
  --good-line: #a9d9c1;
  --warn: #8a5800;
  --warn-soft: #fbeed6;
  --warn-line: #e6c88a;
  --bad: #ab2a20;
  --bad-soft: #fbe5e3;
  --bad-line: #eeb3ad;

  --hatch: rgba(21, 26, 33, 0.16);
  --shadow: 0 1px 1px rgba(15, 23, 36, .04), 0 6px 18px rgba(15, 23, 36, .07);
  --shadow-lift: 0 2px 4px rgba(15, 23, 36, .06), 0 14px 34px rgba(15, 23, 36, .12);

  --r: 10px;
  --r-sm: 6px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116;
    --panel: #161a21;
    --panel-2: #1c212a;
    --panel-3: #222833;
    --line: #2c333e;
    --line-soft: #242a34;
    --fg: #e8edf4;
    --fg-2: #bfc8d4;
    --muted: #8e99a7;
    --muted-2: #6e7885;

    --accent: #5e9bf6;
    --accent-fg: #0b1017;
    --accent-soft: #16263d;
    --accent-line: #2c4a75;

    --good: #57c795;
    --good-soft: #12291f;
    --good-line: #235640;
    --warn: #e0ab4b;
    --warn-soft: #2c2312;
    --warn-line: #5d4720;
    --bad: #f0827a;
    --bad-soft: #2f1a19;
    --bad-line: #663230;

    --hatch: rgba(232, 237, 244, 0.18);
    --shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .35);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 14px 34px rgba(0, 0, 0, .5);
  }
}

:root[data-theme="dark"] {
  --bg: #0e1116;
  --panel: #161a21;
  --panel-2: #1c212a;
  --panel-3: #222833;
  --line: #2c333e;
  --line-soft: #242a34;
  --fg: #e8edf4;
  --fg-2: #bfc8d4;
  --muted: #8e99a7;
  --muted-2: #6e7885;

  --accent: #5e9bf6;
  --accent-fg: #0b1017;
  --accent-soft: #16263d;
  --accent-line: #2c4a75;

  --good: #57c795;
  --good-soft: #12291f;
  --good-line: #235640;
  --warn: #e0ab4b;
  --warn-soft: #2c2312;
  --warn-line: #5d4720;
  --bad: #f0827a;
  --bad-soft: #2f1a19;
  --bad-line: #663230;

  --hatch: rgba(232, 237, 244, 0.18);
  --shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .35);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 14px 34px rgba(0, 0, 0, .5);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 1200px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.sprite { position: absolute; }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 12px; height: 12px; }

.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- shell -- */

.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }

.rail {
  position: sticky; top: 0; align-self: start;
  height: 100vh;
  display: flex; flex-direction: column;
  padding: 18px 14px 14px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.rail-head { display: flex; gap: 10px; align-items: flex-start; padding: 0 6px 18px; }
.mark {
  width: 22px; height: 22px; flex: none; border-radius: 6px; margin-top: 1px;
  background:
    linear-gradient(var(--accent), var(--accent)) padding-box,
    var(--panel);
  box-shadow: inset 0 0 0 1px var(--accent-line);
  position: relative; overflow: hidden;
}
.mark::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, transparent 0 3px, rgba(255,255,255,.45) 3px 4px);
}
.rail-title { font-size: 12.5px; font-weight: 600; letter-spacing: .01em; line-height: 1.25; color: var(--fg); }

.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--fg-2); text-decoration: none; font-weight: 500;
  border: 1px solid transparent;
}
.nav a:hover { background: var(--panel-2); color: var(--fg); }
.nav a.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.nav a.on .ic { stroke-width: 1.9; }
.nav a:focus-visible, .theme:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.rail-foot { margin-top: auto; display: grid; gap: 12px; }
.facts { margin: 0; padding: 12px 10px; border-radius: var(--r-sm); background: var(--panel-2); display: grid; gap: 6px; }
.facts div { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.facts dt { color: var(--muted); font-size: 11.5px; }
.facts dd { margin: 0; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.facts dd.flag-warn { color: var(--warn); }

.rail-user { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--panel-2); }
.rail-user:empty { display: none; }
.rail-user .who { min-width: 0; font-size: 12px; font-weight: 600; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-user .who span { display: block; font-size: 10.5px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-2); }

.theme {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  padding: 7px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--panel-2); color: var(--fg-2);
  font: inherit; font-size: 12px; cursor: pointer;
}
.theme:hover { background: var(--panel-3); color: var(--fg); }

.main { padding: 22px 26px 64px; max-width: 1560px; }
.main:focus { outline: none; }

/* --------------------------------------------------------------- pieces -- */

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.view-head h1 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.view-head p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; max-width: 70ch; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { margin: 0; font-size: 13px; font-weight: 650; letter-spacing: .02em; text-transform: uppercase; color: var(--fg-2); }
.panel-head .sub { color: var(--muted); font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.panel-body { padding: 16px; }
.panel-body.tight { padding: 0; }

.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }

/* --------------------------------------------------------------- inputs -- */

label.field { display: grid; gap: 5px; font-size: 11.5px; color: var(--muted); font-weight: 500; letter-spacing: .02em; text-transform: uppercase; }

input[type="text"], input[type="password"], input[type="number"], input[type="time"], input[type="date"], input[type="search"], select, textarea {
  font: inherit; font-size: 13px;
  color: var(--fg); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 6px 8px; min-width: 0; width: 100%;
  font-variant-numeric: tabular-nums;
}
input[type="color"] { width: 34px; height: 26px; padding: 1px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel-2); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input::placeholder { color: var(--muted-2); }
input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; }
::-webkit-calendar-picker-indicator { filter: none; opacity: .6; }
:root[data-theme="dark"] ::-webkit-calendar-picker-indicator { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) ::-webkit-calendar-picker-indicator { filter: invert(1); } }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  font: inherit; font-size: 12.5px; font-weight: 550;
  padding: 6px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--panel-2); color: var(--fg-2);
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--panel-3); color: var(--fg); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent); color: var(--accent-fg); filter: brightness(1.08); }
.btn-danger { color: var(--bad); border-color: var(--bad-line); background: var(--bad-soft); }
.btn-danger:hover { background: var(--bad-soft); color: var(--bad); filter: brightness(1.04); }
.btn-icon { padding: 5px; }
.btn-sm { padding: 4px 8px; font-size: 12px; }
.btn.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--panel-2); }
.seg button { font: inherit; font-size: 12px; padding: 5px 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------- chips -- */

.picker { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel-2); overflow: hidden; }
.picker-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 7px 8px; border-bottom: 1px solid var(--line-soft); }
.picker-bar input { flex: 1 1 150px; }
.picker-bar .small { white-space: nowrap; margin-left: auto; }
.picker-list { max-height: 188px; overflow: auto; padding: 8px; display: grid; gap: 8px; }
.picker-group-name { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--muted-2); text-transform: uppercase; margin-bottom: 5px; }
.picker-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.picker-empty { color: var(--muted); font-size: 12px; padding: 4px 2px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 6px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--fg-2); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--muted-2); color: var(--fg); }
.chip .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--c, var(--muted)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); flex: none; }
.chip .code { font-weight: 650; font-size: 11px; letter-spacing: .03em; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--panel-3); border-color: var(--c, var(--accent)); color: var(--fg); font-weight: 550; box-shadow: inset 2px 0 0 var(--c, var(--accent)); }
.chip[aria-pressed="true"] .code { color: var(--fg-2); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.chip-static { cursor: default; }
.chip-static:hover { border-color: var(--line); color: var(--fg-2); }

/* --------------------------------------------------------------- badges -- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 550; letter-spacing: .01em;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--fg-2);
  cursor: default;
}
.badge-info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.badge-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.badge-bad  { background: var(--bad-soft);  border-color: var(--bad-line);  color: var(--bad); }
.badge-good { background: var(--good-soft); border-color: var(--good-line); color: var(--good); }

.note { display: flex; gap: 9px; padding: 10px 13px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel-2); color: var(--fg-2); font-size: 12.5px; align-items: flex-start; }
.note .ic { margin-top: 1px; }
.note-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.note-bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.note-info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--fg-2); }
.empty p { margin: 0 auto; max-width: 56ch; font-size: 12.5px; }
.empty ul { margin: 10px auto 0; max-width: 56ch; text-align: left; display: inline-block; font-size: 12.5px; padding-left: 18px; }

/* --------------------------------------------------------------- tables -- */

table.grid-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.grid-table th {
  text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line);
  background: var(--panel-2); position: sticky; top: 0; z-index: 1;
}
.grid-table td { padding: 7px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.grid-table tbody tr:hover { background: var(--panel-2); }
.grid-table tbody tr:last-child td { border-bottom: 0; }
.grid-table td.num, .grid-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid-table td.actions { text-align: right; white-space: nowrap; }
.grid-table input, .grid-table select { padding: 4px 6px; font-size: 12.5px; }
.scroll-y { max-height: 460px; overflow: auto; }

/* --------------------------------------------------------------- finder -- */

.finder-form { display: grid; grid-template-columns: minmax(430px, 1.35fr) minmax(430px, 1fr); gap: 20px; }
.finder-params { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; align-content: start; }
.finder-params .wide { grid-column: span 3; }
.finder-params .half { grid-column: span 2; }
.dur { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.dur select { width: auto; }

.finder-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }

.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 20px 0 10px; }
.results-head h2 { margin: 0; font-size: 15px; font-weight: 650; }
.results-head .meta { color: var(--muted); font-size: 12px; }

.cards { display: grid; gap: 14px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.card-best { border-color: var(--good-line); box-shadow: var(--shadow-lift); }
.card-best .card-head { background: var(--good-soft); border-bottom-color: var(--good-line); }

.card-head { display: flex; align-items: center; gap: 12px; padding: 11px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line-soft); }
.card-date { font-size: 15px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.card-date .iso { color: var(--muted); font-weight: 450; font-size: 12.5px; margin-left: 8px; }
.card-head .badges { display: flex; gap: 6px; flex-wrap: wrap; }
.card-head .btn { margin-left: 4px; }

.seg-block { display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 0; border-bottom: 1px solid var(--line-soft); }
.card > .seg-block:last-of-type { border-bottom: 0; }
.seg-ship { padding: 12px 14px; border-right: 1px solid var(--line-soft); border-left: 3px solid var(--c, var(--line)); background: var(--panel-2); }
.seg-ship .name { font-weight: 620; font-size: 13px; }
.seg-ship .code { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; }
.seg-ship .brand { color: var(--muted-2); font-size: 11px; margin-top: 2px; }
.seg-body { padding: 10px 14px 12px; min-width: 0; }

.clocks { display: grid; gap: 3px; margin-bottom: 10px; }
.clock { display: flex; gap: 14px; align-items: baseline; padding: 3px 6px; border-radius: 5px; }
.clock .lbl { width: 52px; flex: none; }
.clock:nth-child(odd) { background: var(--panel-2); }
.clock .lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.clock .span { font-variant-numeric: tabular-nums; font-size: 13px; }
.clock .span .arrow { color: var(--muted-2); margin: 0 6px; }
.clock .span .dim { color: var(--muted); }
.clock .off { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.clock-home { font-weight: 600; }

.strip { border: 1px solid var(--line-soft); border-radius: var(--r-sm); overflow: hidden; }
.strip-row { display: grid; grid-template-columns: 94px minmax(0, 330px) 104px 186px minmax(60px, 1fr); gap: 12px; align-items: center; padding: 5px 10px; font-size: 12px; }
.strip-row + .strip-row { border-top: 1px solid var(--line-soft); }
.strip-row.head { background: var(--panel-2); color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.strip-row .d { font-variant-numeric: tabular-nums; font-weight: 600; }
.strip-row .where { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-row .where.sea { color: var(--muted); font-style: italic; }
.strip-row .hours { font-variant-numeric: tabular-nums; color: var(--fg-2); }
.strip-row .tz { font-family: var(--mono); font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-row .marks { display: flex; gap: 4px; justify-content: flex-end; }
.strip-row.gap { background: var(--bad-soft); }

.mark-pill { display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; border-radius: 5px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); cursor: default; }
.mark-turn { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.mark-dry { color: var(--bad); border-color: var(--bad-line); background: var(--bad-soft); }
.mark-skag { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }

.seg-warnings { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }

/* ------------------------------------------------------------- calendar -- */

.cal-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-month { font-size: 15px; font-weight: 650; min-width: 142px; text-align: center; font-variant-numeric: tabular-nums; }

.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 9px 16px; border-top: 1px solid var(--line-soft); background: var(--panel-2); font-size: 11.5px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 22px; height: 11px; border-radius: 3px; background: var(--muted-2); flex: none; }
.legend-swatch.hatch { background: var(--panel-3); background-image: repeating-linear-gradient(45deg, var(--hatch) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--line); }
.legend-swatch.banner { background: var(--bad-soft); box-shadow: inset 0 0 0 1px var(--bad-line); }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }

.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.cal-dow { padding: 7px 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--line); text-align: center; }
.cal-dow + .cal-dow { border-left: 1px solid var(--line-soft); }

.cell {
  min-height: 116px; padding: 6px 7px 8px; background: var(--panel);
  border-bottom: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 4px; position: relative;
}
.cell:nth-child(7n + 1) { border-left: 0; }
.cell.out { background: var(--panel-2); }
.cell.out .daynum { color: var(--muted-2); }
.cell.weekend:not(.out) { background: var(--panel-2); }
.cell.today .daynum { background: var(--accent); color: var(--accent-fg); border-radius: 5px; padding: 0 5px; }
.cell.chosen { box-shadow: inset 0 0 0 2px var(--good); z-index: 2; }
.cell.chosen::after {
  content: "chosen"; position: absolute; right: 4px; bottom: 3px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--good);
}
.cell.drydock { background-image: repeating-linear-gradient(45deg, var(--hatch) 0 2px, transparent 2px 6px); }

.cell-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 18px; }
.daynum { font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--fg-2); }
.turns { display: flex; gap: 3px; }
.turn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--accent)); box-shadow: 0 0 0 1px var(--panel), inset 0 0 0 1px rgba(0,0,0,.2); cursor: default; }

.cell-banner {
  display: flex; align-items: center; gap: 5px;
  padding: 2px 6px; border-radius: 4px;
  background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad-line);
  font-size: 10.5px; font-weight: 650; letter-spacing: .02em;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

.bars { display: grid; gap: 3px; }
.bar {
  display: flex; align-items: center; gap: 5px;
  padding: 1px 6px; border-radius: 4px; min-height: 17px;
  background: color-mix(in srgb, var(--c) 26%, var(--panel));
  box-shadow: inset 3px 0 0 var(--c);
  color: var(--fg); font-size: 10.5px; font-weight: 650; letter-spacing: .02em;
  overflow: hidden; white-space: nowrap; cursor: default;
}
:root[data-theme="dark"] .bar { background: color-mix(in srgb, var(--c) 30%, var(--panel)); }
.bar .ic { width: 11px; height: 11px; opacity: .85; }
.bar .lbl { overflow: hidden; text-overflow: ellipsis; }
.bar-manual { border: 1px dashed color-mix(in srgb, var(--c) 70%, var(--panel)); }
.bar-dry { background-image: repeating-linear-gradient(45deg, var(--hatch) 0 2px, transparent 2px 6px); }

.cell-port { margin-top: auto; font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.cell-port .pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-port .hours { font-variant-numeric: tabular-nums; color: var(--muted-2); }

.cal-grid.editing .cell:not(.out) { cursor: pointer; }
.cal-grid.editing .cell:not(.out):hover { box-shadow: inset 0 0 0 2px var(--accent); }
.cell.busy { opacity: .5; }

/* ---------------------------------------------------------- itineraries -- */

.drop {
  border: 1.5px dashed var(--line); border-radius: var(--r);
  background: var(--panel-2); padding: 26px 20px; text-align: center;
  display: grid; gap: 8px; justify-items: center;
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
.drop p { margin: 0; color: var(--muted); font-size: 12.5px; }
.drop .ic { width: 22px; height: 22px; color: var(--muted-2); }

.file-name { font-family: var(--mono); font-size: 11.5px; word-break: break-all; }
.rowbadges { display: flex; flex-wrap: wrap; gap: 4px; }

/* --------------------------------------------------------------- dialog -- */

dialog {
  border: 1px solid var(--line); border-radius: var(--r); padding: 0;
  background: var(--panel); color: var(--fg); box-shadow: var(--shadow-lift);
  max-width: 460px; width: 92vw;
}
dialog::backdrop { background: rgba(10, 14, 20, .5); }
.dlg-head { padding: 14px 18px 0; font-size: 14.5px; font-weight: 650; }
.dlg-body { padding: 8px 18px 4px; color: var(--fg-2); font-size: 13px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px 16px; }

/* --------------------------------------------------------------- toasts -- */

.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 50; max-width: 420px; }
.toast {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 10px 13px; border-radius: var(--r-sm);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lift);
  font-size: 12.5px; color: var(--fg-2);
}
.toast .ic { margin-top: 1px; }
.toast-ok { border-color: var(--good-line); color: var(--good); background: var(--good-soft); }
.toast-warn { border-color: var(--warn-line); color: var(--warn); background: var(--warn-soft); }
.toast-bad { border-color: var(--bad-line); color: var(--bad); background: var(--bad-soft); }

.loading { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }

/* ------------------------------------------------------------- layouts -- */

.cal-layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 16px; align-items: start; }
.cal-side { display: grid; gap: 16px; position: sticky; top: 22px; }
.cal-side .panel + .panel { margin-top: 0; }
.cal-mainpane { min-width: 0; }
.cal-coverage:not(:empty) { margin-bottom: 12px; }
.cal-loading { grid-column: 1 / -1; padding: 30px; display: grid; justify-items: center; }
.cal-side .picker-list { max-height: 330px; }

.data-layout { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.data-layout > div { min-width: 0; }

.field-label { font-size: 11.5px; color: var(--muted); font-weight: 500; letter-spacing: .02em; text-transform: uppercase; margin-bottom: 5px; }
.finder-ships { min-width: 0; }
.picker-notes { display: grid; gap: 10px; margin-top: 10px; }
.picker-notes p { margin: 0; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-actions { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.checkfield > .row { padding-top: 5px; }
.checkfield > .row, .checkfield > .row span { text-transform: none; letter-spacing: normal; color: var(--fg-2); }

.ships-table th:nth-child(1), .ships-table td:nth-child(1) { width: 58px; }
.ships-table th:nth-child(2) { width: 40%; }
.ships-table th:nth-child(3) { width: 24%; }
.ships-table th:nth-child(4), .ships-table th:nth-child(5), .ships-table th:nth-child(6) { width: 64px; }
.ships-table td:nth-child(4), .ships-table td:nth-child(5), .ships-table td:nth-child(6) { text-align: center; }

.finder-ships .picker-list { max-height: 252px; }

.idle { padding: 26px 20px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: var(--r); background: transparent; }
.idle strong { color: var(--fg-2); font-weight: 600; }

.preview { margin-top: 16px; }
.preview-actions { margin-top: 12px; }
.outcome { margin-top: 16px; display: grid; gap: 12px; }
.add-row { background: var(--panel-2); }
.add-row td { border-top: 1px solid var(--line); }
