:root {
  color-scheme: dark;
  --bg: #10191d;
  --panel: #182429;
  --line: #35474e;
  --muted: #b3c2c6;
  --accent: #b9e2d1;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: #f1f4f3;
  font:
    14px/1.5 system-ui,
    -apple-system,
    sans-serif;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 26px 32px 14px;
  border-bottom: 1px solid var(--line);
}
h1 {
  font:
    500 29px/1.2 Georgia,
    serif;
  margin: 7px 0;
}
h2 {
  font-size: 14px;
  font-weight: 650;
  margin: 0 0 15px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent);
}
button,
select,
input {
  font: inherit;
}
button {
  border: 1px solid #53676e;
  background: #26373e;
  color: #f5f7f6;
  border-radius: 5px;
  padding: 9px 12px;
  cursor: pointer;
}
button:hover {
  border-color: var(--accent);
  background: #354a51;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.primary {
  background: var(--accent);
  color: #132126;
  border-color: var(--accent);
}
input,
select {
  width: 100%;
  border: 1px solid #4a5e67;
  border-radius: 5px;
  background: #101b21;
  color: inherit;
  padding: 8px;
  min-width: 0;
}
input[type='range'] {
  padding: 0;
  accent-color: var(--accent);
}
input[type='color'] {
  padding: 3px;
  height: 36px;
}
input:disabled,
select:disabled {
  opacity: 0.6;
}
label {
  display: block;
  color: #c8d3d7;
  font-size: 12px;
  margin: 12px 0;
}
label input,
label select {
  display: block;
  margin-top: 5px;
}
a {
  color: var(--accent);
}
.tools,
.preview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.projectbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 32px 0;
}
.projectbar input {
  max-width: 440px;
}
#saved {
  color: var(--muted);
  font-size: 12px;
}
#status {
  padding: 0 32px;
  min-height: 21px;
  color: var(--accent);
}
#status.error {
  color: #ffb7a9;
}
main {
  display: grid;
  grid-template-columns: 270px minmax(360px, 1fr) 255px;
  gap: 18px;
  padding: 0 24px 35px;
  align-items: start;
}
.controls,
.inspector {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 18px;
}
.controls section + section {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 24px;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  align-items: end;
}
.pair > * {
  min-width: 0;
}
.note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.preview {
  position: sticky;
  top: 16px;
  min-width: 0;
}
.preview-heading {
  display: flex;
  justify-content: space-between;
  padding: 8px 4px;
}
#latency {
  font-size: 11px;
  color: var(--muted);
}
#canvas {
  position: relative;
  aspect-ratio: 1.6;
  background: #f5f4f0;
  border-radius: 8px;
  overflow: hidden;
}
#render {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
#hits {
  position: absolute;
  inset: 0;
}
.hit {
  position: absolute;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 0;
  touch-action: none;
}
.hit:hover {
  background: #72b7ee15;
  border-color: #4698dd;
}
.hit.selected {
  outline: 2px solid #2789d2;
  outline-offset: 3px;
  background: #428acb10;
}
.hit:focus-visible {
  outline: 3px solid #1575c9;
}
body.catalog .hit {
  cursor: pointer;
}
body:not(.catalog) .hit {
  cursor: move;
}
.preview-actions {
  margin: 16px 0;
}
.preview-actions button {
  font-size: 12px;
}
details {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 14px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
}
summary {
  cursor: pointer;
  color: #dde5e6;
}
#inspector .delete {
  color: #ffb7a9;
  margin-top: 20px;
}
.check {
  display: flex;
  gap: 10px;
  align-items: center;
}
.check input {
  width: auto;
}
dialog {
  max-width: 600px;
  width: 90%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: inherit;
  border-radius: 10px;
  padding: 24px;
}
dialog::backdrop {
  background: #000a;
}
#projectList {
  max-height: 60vh;
  overflow: auto;
}
#projectList button {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 9px;
}
[hidden] {
  display: none !important;
}
body.catalog .custom {
  display: none;
}
#name {
  font-weight: 600;
}
.login {
  max-width: 430px;
  margin: 12vh auto;
  padding: 30px;
  background: var(--panel);
  border-radius: 12px;
}
.login button {
  width: 100%;
  margin-top: 15px;
}
.login p {
  color: var(--muted);
}
@media (min-width: 1800px) {
  main {
    grid-template-columns: 300px minmax(600px, 1fr) 300px;
  }
}
@media (max-width: 1150px) {
  main {
    grid-template-columns: 260px minmax(350px, 1fr);
  }
  .inspector {
    grid-column: 2;
    grid-row: 2;
  }
  .preview {
    position: static;
  }
  .controls {
    grid-row: 1/3;
  }
}
@media (max-width: 760px) {
  header {
    padding: 20px;
    align-items: start;
    flex-direction: column;
  }
  .projectbar {
    padding: 14px 20px 0;
    flex-wrap: wrap;
  }
  #status {
    padding: 0 20px;
  }
  main {
    display: flex;
    flex-direction: column;
    padding: 0 14px 25px;
  }
  .preview {
    order: 0;
    width: 100%;
  }
  .controls {
    order: 1;
    width: 100%;
  }
  .inspector {
    order: 2;
    width: 100%;
  }
  h1 {
    font-size: 26px;
  }
  .preview-actions button {
    flex: 1;
  }
  .login {
    margin: 30px 15px;
  }
  input,
  select {
    font-size: 16px;
  }
}

#adminAccess {
  color: var(--muted);
  font-size: 13px;
  align-self: center;
}
#adminAccess:hover {
  color: var(--accent);
}

.wall-settings {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.wall-settings summary {
  cursor: pointer;
  font-weight: 600;
  padding: 8px 0;
}

.project-details {
  margin: 0 28px 20px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.project-details textarea {
  box-sizing: border-box;
  width: 100%;
  font: inherit;
  background: #15242b;
  color: inherit;
  border: 1px solid #536169;
  padding: 10px;
}
.project-details summary {
  cursor: pointer;
}
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.comparison-grid figure {
  margin: 0;
}
.comparison-grid img {
  width: 100%;
  height: auto;
}
#comparison {
  max-width: 1400px;
  width: 90vw;
}
dialog input {
  max-width: 100%;
  box-sizing: border-box;
}
dialog form {
  margin: 12px 0 22px;
}
.consent {
  font-size: 13px;
}
.consent input {
  width: auto;
  display: inline;
}
#accountStatus {
  max-width: 440px;
}
.projectbar input {
  min-width: 250px;
}
#projectIdentity {
  overflow-wrap: anywhere;
}
@media (max-width: 720px) {
  .comparison-grid {
    grid-template-columns: 1fr;
  }
  .project-details {
    margin: 0 14px 16px;
  }
  dialog {
    max-width: calc(100vw - 40px);
  }
}

.inline-link-arrow { display:inline-block; vertical-align:-0.15em; flex-shrink:0; }
