:root {
  color-scheme: dark;
  --panel: #101719e8;
  --line: #ffffff2e;
  --text: #f5f8f7;
  --muted: #b7c2bf;
  --accent: #67e8c7;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: #b9d1da;
  color: var(--text);
  font: 14px/1.45 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, a { font: inherit; }
#viewport, #viewport canvas { display: block; width: 100%; height: 100%; }

.hud {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  pointer-events: none;
}
.hud > div, .hud nav {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 28px #0003;
  pointer-events: auto;
}
.hud h1 { margin: 1px 0 2px; font-size: 18px; line-height: 1.1; }
.hud p { margin: 0; }
.hud #model-status { color: var(--muted); font-size: 12px; }
.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 10px;
  font-weight: 700;
}
.hud nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; max-width: min(760px, calc(100vw - 280px)); }
.vertical-move-controls { display: inline-flex; gap: 3px; }
.vertical-move-controls button { min-width: 34px; padding-inline: 8px; font-size: 18px; line-height: 1; }
.sun-controls, .sun-controls label { display: inline-flex; align-items: center; gap: 7px; }
.sun-controls[hidden], .sun-controls label[hidden] { display: none; }
.sun-controls label {
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #202a2f;
}
.sun-controls input { width: 112px; margin: 0; accent-color: var(--accent); }
.sun-controls output { min-width: 112px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
button, .hud a {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #202a2f;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
button:hover, .hud a:hover { border-color: var(--accent); }
button:disabled { cursor: wait; opacity: .55; }

.entry-panel {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #07101291;
  backdrop-filter: blur(5px);
}
.entry-panel[hidden] { display: none; }
.entry-card {
  width: min(470px, 100%);
  padding: 24px;
  border: 1px solid #ffffff38;
  border-radius: 12px;
  background: #101719f2;
  box-shadow: 0 24px 80px #0008;
}
.entry-card h2 { margin: 4px 0 10px; font-size: 26px; }
.entry-card > p:not(.eyebrow) { color: var(--muted); }
.entry-card > button {
  width: 100%;
  min-height: 44px;
  margin: 18px 0;
  color: #07110e;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 750;
}
.entry-card dl { display: grid; gap: 5px; margin: 0; }
.entry-card dl div { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.entry-card dt { color: var(--muted); }
.entry-card dd { margin: 0; text-align: right; }
#crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 8px;
  height: 8px;
  margin: -4px;
  border: 1px solid #071012bb;
  border-radius: 50%;
  background: #ffffffcc;
  opacity: 0;
  pointer-events: none;
}
body.is-walking #crosshair { opacity: 1; }
.pause-hint {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 3;
  display: none;
  transform: translateX(-50%);
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  pointer-events: none;
}
body.is-paused .pause-hint { display: block; }
.placement-hint {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 7;
  transform: translateX(-50%);
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: #0b1b1ceb;
  box-shadow: 0 10px 32px #0006;
  color: var(--text);
  pointer-events: none;
}
body.is-placing #viewport canvas { cursor: crosshair; }
.notes-panel {
  position: fixed;
  top: 84px;
  right: 16px;
  z-index: 6;
  width: min(370px, calc(100vw - 32px));
  max-height: calc(100vh - 108px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #101719f5;
  box-shadow: 0 18px 56px #0007;
}
.notes-panel[hidden], .modal[hidden], .placement-hint[hidden] { display: none; }
.notes-panel header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.notes-panel h2 { margin: 2px 0 12px; font-size: 22px; }
.icon-button { min-width: 34px; padding: 3px 9px; font-size: 22px; line-height: 1; }
.check-row { display: flex !important; align-items: center; gap: 8px; color: var(--muted); }
.check-row input { width: auto; margin: 0; accent-color: var(--accent); }
.primary-action { color: #07110e; background: var(--accent); border-color: var(--accent); font-weight: 750; }
.notes-panel > .primary-action { width: 100%; margin: 14px 0 8px; }
.panel-help { margin: 0 0 13px; color: var(--muted); font-size: 12px; }
.notes-list { display: grid; gap: 7px; }
.design-options-list { display: grid; gap: 8px; }
.design-option-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff08;
}
.design-option-row label { color: var(--text); font-weight: 650; }
.design-option-row small { color: var(--muted); line-height: 1.35; }
.note-list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff08;
}
.note-list-item button { min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; }
.note-list-item strong, .note-list-item small { display: block; }
.note-list-item small { margin-top: 2px; color: var(--muted); }
.note-list-item.is-hidden { opacity: .55; }
.note-list-item .status { color: var(--accent); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.notes-panel footer { display: flex; justify-content: flex-end; gap: 7px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.modal {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #07101291;
  backdrop-filter: blur(5px);
}
.note-form {
  width: min(560px, 100%);
  padding: 22px;
  border: 1px solid #ffffff38;
  border-radius: 12px;
  background: #101719fa;
  box-shadow: 0 24px 80px #0008;
}
.note-form h2 { margin: 3px 0 17px; font-size: 25px; }
.note-form > label, .note-form .form-grid > label { display: grid; gap: 6px; margin-top: 12px; color: var(--muted); }
.note-form input, .note-form textarea, .note-form select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: #202a2f;
  color: var(--text);
  font: inherit;
}
.note-form input:focus, .note-form textarea:focus, .note-form select:focus { border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 14px; }
.note-position-controls {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px 16px;
  margin: 17px 0 0;
  padding: 11px 13px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.note-position-controls legend { padding: 0 5px; color: var(--muted); }
.note-position-controls p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.nudge-grid {
  display: grid;
  grid-template-columns: repeat(3, 32px);
  grid-template-rows: repeat(3, 32px);
  gap: 3px;
}
.nudge-grid button { padding: 0; font-size: 18px; line-height: 1; }
.nudge-step { display: grid; place-items: center; color: var(--muted); font-size: 10px; }
.form-actions { display: grid; grid-template-columns: auto auto auto 1fr auto auto; gap: 7px; margin-top: 20px; }
.danger-action { color: #fecaca; border-color: #ef444466; }
.position {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  padding: 6px 9px;
  border-radius: 5px;
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.error {
  position: fixed;
  inset: auto 20px 20px;
  z-index: 10;
  padding: 14px;
  border: 1px solid #ef4444;
  border-radius: 7px;
  background: #450a0ae8;
}

@media (max-width: 720px) {
  .hud { top: 8px; left: 8px; right: 8px; }
  .hud nav { flex-direction: column; }
  .hud nav a, .hud nav button { min-height: 30px; padding: 4px 7px; }
  .vertical-move-controls { align-self: flex-end; }
  .hud > div { max-width: 52%; }
  .notes-panel { top: 8px; right: 8px; max-height: calc(100vh - 16px); }
  .form-grid { grid-template-columns: 1fr; }
  .note-position-controls { grid-template-columns: 1fr; }
  .form-actions { grid-template-columns: 1fr 1fr; }
  .form-actions span { display: none; }
}
