:root {
  color-scheme: light dark;
  --page: light-dark(#f3f1eb, #17191b);
  --surface: light-dark(#ffffff, #222528);
  --ink: light-dark(#202529, #f4f3ef);
  --muted: light-dark(#667078, #aeb6bc);
  --line: light-dark(#d9d5ca, #3d4247);
  --brand: light-dark(#165b48, #71c7ad);
  --open: light-dark(#176b45, #70d39e);
  --open-soft: light-dark(#e3f3ea, #17392a);
  --closed: light-dark(#a53030, #ff8a8a);
  --closed-soft: light-dark(#f9e7e5, #442426);
  --warning: light-dark(#a53030, #ff9292);
  --shadow: light-dark(rgba(25, 31, 34, .14), rgba(0, 0, 0, .38));
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background: var(--page);
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", Arial, sans-serif;
}

button,
a,
canvas {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  width: min(100%, 520px);
  min-height: 100svh;
  margin: 0 auto;
  background: var(--page);
}

.crossing-nav {
  position: sticky;
  z-index: 10;
  top: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.crossing-nav a {
  display: grid;
  min-height: 46px;
  place-items: center;
  color: var(--muted);
  font-size: .84rem;
  text-decoration: none;
}

.crossing-nav a[aria-current="page"] {
  color: var(--brand);
  box-shadow: inset 0 -3px 0 var(--brand);
  font-weight: 700;
}

.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 17px 13px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.25rem;
}

.page-clock {
  display: grid;
  gap: 1px;
  text-align: right;
}

#page-time {
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

#page-date {
  color: var(--muted);
  font-size: .8rem;
  white-space: nowrap;
}

.status-panel {
  margin: 12px;
  padding: 13px 14px 11px;
  border-radius: 14px;
}

.status-panel.open {
  background: var(--open-soft);
}

.status-panel.closed {
  background: var(--closed-soft);
}

.barrier-line {
  font-size: 1rem;
  line-height: 1.42;
}

.barrier-word {
  font-weight: 700;
}

.status-panel.open .barrier-word {
  color: var(--open);
}

.status-panel.closed .barrier-word {
  color: var(--closed);
}

.freshness {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: var(--muted);
  font-size: .73rem;
}

.freshness-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--open);
  border-radius: 50%;
}

.artwork-section {
  padding-top: 8px;
}

.passenger-warning {
  padding: 0 16px;
  color: var(--warning);
  font-size: .77rem;
  font-style: italic;
  line-height: 1.38;
}

.shared-note {
  padding: 9px 16px 3px;
  color: var(--muted);
  font-size: .78rem;
}

.project-line {
  margin: 2px 16px 3px;
  color: var(--ink);
  font-size: .82rem;
}

.canvas-frame {
  margin: 10px 12px 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid light-dark(#bbb8af, #73777a);
  box-shadow: 0 2px 9px var(--shadow);
}

#pixel-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  image-rendering: pixelated;
  touch-action: manipulation;
}

#pixel-canvas:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

.palette {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin: 0 16px;
}

.palette-top {
  margin-top: 10px;
  margin-bottom: 14px;
}

.colour-swatch {
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  padding: 0;
  background: var(--swatch);
  border: 1px solid rgba(0, 0, 0, .28);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
  cursor: pointer;
}

.colour-swatch:focus-visible,
.colour-swatch:hover:not(:disabled) {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.colour-swatch:disabled {
  cursor: default;
  opacity: .42;
}

.paint-guidance {
  min-height: 42px;
  margin: 12px 16px 4px;
  color: var(--brand);
  font-size: .92rem;
  font-weight: 700;
  text-align: center;
}

.paint-guidance.waiting {
  color: var(--closed);
}

.recent-art {
  min-height: 18px;
  margin: -1px 16px 9px;
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.45;
  text-align: center;
}

.recent-art a,
.moderation-note a {
  color: var(--brand);
}

.moderation-note {
  margin: 13px 16px 5px;
  padding: 10px 11px;
  color: var(--muted);
  background: var(--surface);
  border-left: 3px solid var(--warning);
  border-radius: 4px 9px 9px 4px;
  font-size: .74rem;
  line-height: 1.42;
}

.moderation-note strong {
  color: var(--ink);
}

.return-link {
  padding: 9px 16px 20px;
  text-align: center;
}

.archive-view #pixel-canvas {
  cursor: default;
}

.return-link a {
  color: var(--brand);
  font-size: .86rem;
  font-weight: 700;
}


@media (max-width: 350px) {
  .palette {
    gap: 4px;
    margin-inline: 12px;
  }
}
