.t-dir {
  color-scheme: light;
  --paper: #faf8f4;
  --surface: #ffffff;
  --tint: #f3f0e9;
  --ink: #16191d;
  --muted: #4d535b;
  --fine: #5f656c;
  --line: #e2ddd3;
  --line-strong: #cfc8bb;
  --red: #b8322a;
  --red-deep: #962820;
  --slate: #1c2b2d;
  --slate-2: #273a3d;
  --on-dark: #f4f1ea;
  --on-dark-muted: #c3cbc9;
  --green: #1d6a3f;
  --amber: #8a4b00;
  --closed: #a02d24;
  --sp-bg: #f6eed8;
  --sp-line: #e3d3a6;
  --sp-text: #6a4a00;
  --focus: #1f5fbf;
  /* derived: text on fills, lines on dark bands, shadows */
  --on-accent: #ffffff;
  --on-status: #ffffff;
  --on-dark-hi: #ffffff;
  --accent-on-dark: #e8867e;
  --mast-rule: #4a5d60;
  --mast-line: #5b6e71;
  --mast-sep: #34494c;
  --dark-line: #3c5154;
  --foot-bg: #142022;
  --foot-line: #2f4245;
  --placeholder: #767b81;
  --shadow: 22 25 29;
  /* drawn photo slots */
  --scene-sky: #b9c4c2;
  --scene-mid: #8d8576;
  --scene-deep: #3c3d38;
  --scene-glow: #f2dfbd;
  --scene-warm: #cd8246;
  --scene-cap: #ffffff;
  /* map illustration */
  --map-land: #ece8df;
  --map-water: #cbd9d8;
  --map-water-line: #b9cbca;
  --map-park: #dbe3cf;
  --map-road: #ffffff;
  --map-arterial: #f3d9a8;
  --map-arterial-edge: #e9c27e;
  --map-label: #6a6f74;
  --font: "Libre Franklin Variable", "Franklin Gothic", "Helvetica Neue", Arial, sans-serif;
  --r: 6px;
  --wrap: 78rem;
  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4.5rem; --s9: 6.5rem;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}
html.t-dir, body.t-dir { margin: 0; background: var(--paper); color: var(--ink); }
html.t-dir { font-size: 100%; }
.t-dir *, .t-dir *::before, .t-dir *::after { box-sizing: border-box; }
.t-dir h1, .t-dir h2, .t-dir h3, .t-dir p, .t-dir ul, .t-dir ol, .t-dir dl, .t-dir dd, .t-dir figure, .t-dir blockquote, .t-dir fieldset { margin: 0; }
.t-dir ul, .t-dir ol { padding: 0; list-style: none; }
.t-dir fieldset { border: 0; padding: 0; min-width: 0; }
.t-dir h1, .t-dir h2, .t-dir h3 { text-wrap: balance; }
.t-dir p, .t-dir li, .t-dir dd { text-wrap: pretty; }
.t-dir a { color: var(--ink); text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; transition: color .15s, text-decoration-color .15s, text-underline-offset .15s; }
@media (hover: hover) { .t-dir a:hover { color: var(--red-deep); text-decoration-color: currentColor; text-underline-offset: 0.24em; } }
.t-dir button, .t-dir input, .t-dir select, .t-dir textarea { font: inherit; color: inherit; }
.t-dir :focus { outline: none; }
.t-dir :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.t-dir .skip { position: absolute; left: 1rem; top: 0; transform: translateY(-150%); background: var(--ink); color: var(--paper); padding: 0.6rem 0.9rem; z-index: 20; }
.t-dir .skip:focus { transform: none; color: var(--paper); }
@media (prefers-reduced-motion: reduce) {
  .t-dir *, .t-dir *::before, .t-dir *::after { animation-duration: 0.01ms !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .t-dir :focus-visible { outline: 2px solid Highlight; }
  .t-dir .btn, .t-dir .chip { border: 1px solid ButtonText; }
}

/* ==========================================================================
   Palettes (60 / 30 / 10). The default above is "Harbor".
   60 = --paper / --surface, 30 = --slate (header, owners band, footer),
   10 = --red (buttons, pins, brand mark, active nav).
   Lines on dark bands are mixed from --on-dark and --slate.
   ========================================================================== */
[data-palette].t-dir, [data-palette] .t-dir {
  --mast-rule: color-mix(in srgb, var(--on-dark) 24%, var(--slate));
  --mast-line: color-mix(in srgb, var(--on-dark) 34%, var(--slate));
  --mast-sep: color-mix(in srgb, var(--on-dark) 14%, var(--slate));
  --dark-line: color-mix(in srgb, var(--on-dark) 20%, var(--slate));
  --foot-line: color-mix(in srgb, var(--on-dark) 16%, var(--foot-bg));
}

/* Greenmarket: fresh light green, persimmon accent */
[data-palette="greenmarket"].t-dir, [data-palette="greenmarket"] .t-dir {
  --paper: #f5f8f2; --surface: #ffffff; --tint: #eaf0e5;
  --ink: #142019; --muted: #45534a; --fine: #56645b;
  --line: #dbe4d5; --line-strong: #c2cfbb;
  --red: #c2410c; --red-deep: #9a3412;
  --slate: #1d3b2c; --slate-2: #285039; --foot-bg: #132a1e;
  --on-dark: #f1f6ee; --on-dark-muted: #bed0c3; --accent-on-dark: #f6a372;
  --green: #17683f; --amber: #8a4b00; --closed: #a3301f;
  --sp-bg: #f4efd9; --sp-line: #e0d4a3; --sp-text: #664700;
  --focus: #1f5fbf; --placeholder: #707a72; --shadow: 20 32 25;
  --scene-sky: #c3d2bd; --scene-mid: #85977c; --scene-deep: #2f3d2d; --scene-glow: #f1e8c6; --scene-warm: #d27a3e;
  --map-land: #edf2e7; --map-water: #c2dad4; --map-water-line: #accbc3; --map-park: #cde1bd;
  --map-arterial: #f6d5b3; --map-arterial-edge: #e7b07f; --map-label: #5b675f;
}

/* Terracotta: warm clay header, deep teal accent */
[data-palette="terracotta"].t-dir, [data-palette="terracotta"] .t-dir {
  --paper: #fbf6f0; --surface: #fffdfa; --tint: #f5ebe0;
  --ink: #231a15; --muted: #5a4b42; --fine: #67574d;
  --line: #eadccd; --line-strong: #d8c4af;
  --red: #0f6470; --red-deep: #0a4952;
  --slate: #8a3a22; --slate-2: #9b4630; --foot-bg: #5c2615;
  --on-dark: #fdf3ea; --on-dark-muted: #f2d6c6; --accent-on-dark: #ffe0b8;
  --green: #1d6a3f; --amber: #8a4b00; --closed: #a02d24;
  --sp-bg: #f7ecd6; --sp-line: #e6d0a2; --sp-text: #664700;
  --focus: #1f5fbf; --placeholder: #7b6d64; --shadow: 35 26 21;
  --scene-sky: #dccab8; --scene-mid: #a7826a; --scene-deep: #4a2c1f; --scene-glow: #f7dfbd; --scene-warm: #c4693f;
  --map-land: #f3e8dc; --map-water: #c6dbd7; --map-water-line: #afccc6; --map-park: #e1dcbd;
  --map-arterial: #f1c9a5; --map-arterial-edge: #dc9f71; --map-label: #6b5a50;
}

/* Night Map: dark directory, coral accent */
[data-palette="night"].t-dir, [data-palette="night"] .t-dir {
  color-scheme: dark;
  --paper: #111517; --surface: #192023; --tint: #151b1d;
  --ink: #ebe7e0; --muted: #aab2b1; --fine: #9aa3a1;
  --line: #2a3336; --line-strong: #3b4649;
  --red: #ff7a66; --red-deep: #ff9a8b; --on-accent: #1d0d09;
  --slate: #1f2b2e; --slate-2: #29393c; --foot-bg: #0b0f10;
  --on-dark: #ebe7e0; --on-dark-muted: #afb9b7; --on-dark-hi: #ffffff; --accent-on-dark: #ff9a8b;
  --green: #63cf92; --on-status: #08190f; --amber: #f0b45a; --closed: #ff8a7a;
  --sp-bg: #272215; --sp-line: #4a3f22; --sp-text: #f0c869;
  --focus: #8ab6ff; --placeholder: #87908f; --shadow: 0 0 0;
  --scene-sky: #46514f; --scene-mid: #2c3436; --scene-deep: #0b0e0f; --scene-glow: #7a6b4f; --scene-warm: #b6683d; --scene-cap: #f3efe8;
  --map-land: #1b2225; --map-water: #1c3337; --map-water-line: #244340; --map-park: #1f2e24; --map-road: #2f3a3d;
  --map-arterial: #5c4b2a; --map-arterial-edge: #7d6435; --map-label: #9ba4a3;
}
