:root {
  color-scheme: dark;
  --base: #141612;
  --panel: #1d211a;
  --line: #43483a;
  --text: #f3ede1;
  --muted: #c0b9a9;
  --accent: #ead28e;
  --ink: #232014;
  font: 16px/1.55 system-ui,sans-serif;
  color: var(--text);
  background: var(--base);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

h1,h2,h3,p {
  margin: 0 0 .75rem;
}

h1,h2 {
  font-family: Georgia,serif;
  font-weight: 400;
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.7rem,3vw,2.75rem);
}

h3 {
  font-size: 1rem;
}

img {
  display: block;
  max-width: 100%;
  object-fit: cover;
}

button,input,select,textarea {
  font: inherit;
  color: inherit;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #292f24;
  padding: .55rem .75rem;
}

button {
  cursor: pointer;
}

button:hover,button.active,button[aria-current=true] {
  background: #3b4330;
  border-color: #a7996d;
}

button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button.primary {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent);
  font-weight: 700;
}

button.primary:hover {
  background: #f5e2ab;
}

button.quiet {
  background: transparent;
}

.eyebrow {
  font: 700 .72rem/1.4 ui-monospace,monospace;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
}

.muted,small {
  color: var(--muted);
}

.loading {
  padding: 2rem;
}

.cover {
  min-height: 100svh;
  display: grid;
  align-items: end;
  background: linear-gradient(0deg,#10130ef5,#10130ea0 40%,#10130e18 80%),var(--cover) center/cover;
}

.cover-panel {
  max-width: 820px;
  padding: clamp(1.4rem,8vw,8rem);
}

.cover h1 {
  font-size: clamp(3.5rem,12vw,9rem);
  letter-spacing: -.055em;
}

.cover-panel p:not(.eyebrow) {
  font-size: clamp(1rem,2vw,1.35rem);
  max-width: 50ch;
}

.cover button {
  margin: .5rem .4rem .4rem 0;
}

.desk {
  height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  overflow: hidden;
}

.header {
  background: #1c211a;
  display: grid;
  grid-template-columns: minmax(135px,210px) 1fr auto;
  gap: 1rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: .8rem clamp(.65rem,2vw,1.8rem);
  z-index: 2;
}

.brand,.objective {
  display: grid;
  min-width: 0;
}

.brand strong {
  font: 1.55rem Georgia,serif;
}

.objective small {
  color: var(--accent);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.header-controls time {
  color: var(--accent);
  font: 700 1.3rem monospace;
  padding: .2rem .5rem;
}

.columns {
  display: grid;
  grid-template-columns: minmax(0,25fr) minmax(0,45fr) minmax(0,30fr);
  min-height: 0;
  gap: 1px;
  background: var(--line);
}

.columns>aside,.columns>main {
  overflow: auto;
  min-width: 0;
  background: var(--base);
  overscroll-behavior: contain;
}

.mobile-tabs {
  display: none;
}

.section-nav,.board-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .65rem;
  background: #1e231b;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}

.section-nav button,.board-nav button {
  flex: 0 0 auto;
  font-size: .85rem;
}

.work-content,.board-content {
  padding: clamp(.7rem,2vw,1.5rem);
}

.board-title,.place-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .7rem;
}

.board-title {
  padding: .8rem .75rem;
  background: #1e231b;
}

.board-title h2 {
  font-size: 1.5rem;
  margin: 0;
}

.board-title span {
  font: .8rem monospace;
  color: var(--accent);
  white-space: nowrap;
}

.advance {
  margin: .6rem;
}

.mobile-device {
  height: min(755px,calc(100svh - 118px));
  min-height: 460px;
  border: 6px solid #363930;
  outline: 1px solid #686d5d;
  border-radius: 30px;
  overflow: hidden;
  max-width: 345px;
  margin: 1rem auto;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #1e2920;
  box-shadow: 0 12px 35px #0008;
}

.wallpaper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .4;
  pointer-events: none;
}

.phone-status,.locked-content,.home-head,.app-grid,.phone-scroll,.mobile-device footer {
  z-index: 1;
}

.phone-status {
  display: flex;
  justify-content: space-between;
  padding: .45rem .7rem;
  font: .72rem monospace;
  color: #e2ddcb;
}

.locked-content,.home-head {
  padding: 1.5rem 1rem;
}

.clock {
  font: 500 clamp(2.4rem,4vw,3.9rem)/1 system-ui;
  letter-spacing: -.07em;
}

.locked-content form {
  max-width: 175px;
}

.mobile-device footer {
  margin-top: auto;
  background: #151c16;
  padding: .3rem;
  text-align: center;
}

.mobile-device footer button {
  width: 100%;
  border: 0;
}

.app-grid {
  padding: .5rem .8rem;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: .5rem;
}

.app-grid button {
  display: grid;
  position: relative;
  justify-items: center;
  font-size: .8rem;
}

.app-grid b {
  font-size: 1.5rem;
  color: var(--accent);
}

.app-grid i {
  position: absolute;
  right: .6rem;
  top: .5rem;
  width: 8px;
  height: 8px;
  background: #ebc674;
  border-radius: 50%;
}

.phone-scroll {
  padding: .7rem;
  overflow: auto;
}

.message-text {
  white-space: pre-line;
  background: #2b3b2d;
  padding: .7rem;
  border-radius: 8px;
  margin-bottom: .65rem;
}

.inspection {
  position: relative;
  isolation: isolate;
  margin: .65rem 0;
  background: #25291f;
}

.inspection img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.hotspot {
  position: absolute;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  width: 44px;
  padding: 0;
  background: #22291bd6;
  border-color: #e3ca83;
  font-size: 1.25rem;
}

.hotspot.found {
  color: var(--accent);
}

.material-grid,.people,.map,.comparison {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: .55rem;
}

.material-link,.evidence-row {
  width: 100%;
  text-align: left;
  display: grid;
}

.material h3 {
  font: 1.6rem Georgia,serif;
}

.material {
  padding: 1rem;
  background: #252a20;
  border: 1px solid var(--line);
  margin-bottom: .65rem;
}

.material p {
  white-space: pre-line;
}

.material .primary {
  display: block;
  margin-top: .75rem;
}

.map {
  padding: .7rem;
  background: #20271c;
  margin-bottom: 1rem;
}

.map span {
  border: 1px dashed var(--line);
  padding: .5rem;
  color: var(--muted);
}

.people button {
  display: grid;
  align-content: start;
  text-align: left;
  gap: .2rem;
  padding: .45rem;
}

.people img {
  width: 100%;
  aspect-ratio: 4/3;
  object-position: 50% 25%;
}

.witness-head {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: .75rem;
}

.witness-head img {
  width: 92px;
  aspect-ratio: 1;
  object-position: 50% 23%;
  border-radius: 9px;
}

.dialogue,.board-card,.verdict {
  border: 1px solid var(--line);
  background: #242b21;
  padding: .75rem;
  margin-bottom: .65rem;
}

.turn {
  margin: .4rem 0;
}

.question {
  width: 100%;
  text-align: left;
}

.turn blockquote {
  background: #303b2d;
  border-left: 2px solid var(--accent);
  margin: .4rem 0;
  padding: .55rem .7rem;
}

.picture {
  position: relative;
  width: 100%;
  padding: 0;
  overflow: hidden;
  margin-bottom: .4rem;
}

.picture img {
  width: 100%;
  max-height: 350px;
  object-fit: contain;
}

.picture span {
  display: block;
  padding: .3rem;
}

.portrait-button img {
  aspect-ratio: 1;
  object-fit: cover;
  object-position: 50% 18%;
  max-height: 115px;
}

.comparison>div {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: .3rem;
  align-items: start;
}

.times {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.camera {
  margin: .75rem 0 0;
  background: #111510;
  border: 1px solid var(--line);
  padding: .6rem;
}

.camera figcaption {
  display: flex;
  justify-content: space-between;
  color: var(--accent);
  font-family: monospace;
  padding: .3rem;
}

.camera img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.camera-record {
  min-height: 140px;
  display: grid;
  align-content: center;
  text-align: center;
  background: #222b20;
}

.camera p {
  padding: .45rem;
  margin: 0;
}

form {
  display: grid;
  gap: .55rem;
  margin: .5rem 0;
}

label {
  display: grid;
  gap: .25rem;
}

input,select,textarea,fieldset {
  min-width: 0;
  max-width: 100%;
}

textarea {
  width: 100%;
}

fieldset {
  border: 1px solid var(--line);
  padding: .5rem;
}

.tick {
  display: flex;
  gap: .5rem;
  align-items: center;
  min-height: 44px;
}

.tick input {
  min-height: 0;
  flex: none;
}

.evidence-row {
  margin: .4rem 0;
}

.board-card p {
  margin: .25rem 0;
}

.time-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: .55rem;
  border-bottom: 1px solid var(--line);
  padding: .42rem 0;
}

.time-row time {
  font: 700 .83rem monospace;
  color: var(--accent);
}

.notes {
  padding: .55rem 0;
}

.notes summary {
  cursor: pointer;
  min-height: 44px;
}

#status {
  position: fixed;
  bottom: .75rem;
  right: .75rem;
  z-index: 3;
  max-width: min(460px,calc(100% - 1.5rem));
  background: var(--accent);
  color: var(--ink);
  padding: .5rem .75rem;
  border-radius: 5px;
  pointer-events: none;
}

#status:empty {
  display: none;
}

dialog {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  width: min(1020px,96vw);
  max-height: 90svh;
  padding: .75rem;
}

dialog::backdrop {
  background: #000b;
}

dialog img {
  margin: .5rem auto 0;
  max-height: 76svh;
  object-fit: contain;
}

@media(max-width:850px) {
  .desk {
    grid-template-rows: auto auto minmax(0,1fr);
  }
  .header {
    grid-template-columns: 1fr auto;
    gap: .4rem;
    padding: .55rem;
  }
  .objective {
    grid-column: 1/-1;
    grid-row: 2;
  }
  .header-controls time {
    padding: .15rem;
    font-size: 1rem;
  }
  .header-controls button {
    font-size: .75rem;
    padding: .3rem;
  }
  .brand strong {
    font-size: 1.2rem;
  }
  .brand .eyebrow {
    font-size: .55rem;
  }
  .mobile-tabs {
    display: flex;
    gap: .3rem;
    padding: .35rem;
    border-bottom: 1px solid var(--line);
  }
  .mobile-tabs button {
    flex: 1;
  }
  .columns {
    display: block;
    overflow: auto;
    background: var(--base);
  }
  .columns>* {
    display: none;
    height: 100%;
    overflow: auto;
  }
  .desk[data-mobile=phone] #pane-phone,.desk[data-mobile=case] #pane-case,.desk[data-mobile=board] #pane-board {
    display: block;
  }
  .mobile-device {
    height: max(460px,calc(100svh - 210px));
    margin: .65rem auto;
    width: min(94%,345px);
  }
  .material-grid,.people {
    gap: .4rem;
  }
  .work-content {
    padding: .65rem;
  }
}

@media(max-width:850px) {
  .camera-times {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .camera-times button {
    font-size: .83rem;
    padding: .4rem .25rem;
  }
  .mobile-tabs button {
    min-width: 0;
    padding: .5rem .25rem;
  }
  .mobile-device {
    height: max(460px,calc(100svh - 237px));
  }
}

@media(max-width:420px) {
  .mobile-tabs button {
    font-size: .9rem;
  }
  .mobile-tabs button[data-id=case] {
    flex: 1.4;
  }
  .comparison {
    grid-template-columns: 1fr;
  }
  .comparison>div {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
  .portrait-button span {
    font-size: .8rem;
  }
}

.guide {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--panel);
  padding: .75rem;
  margin-bottom: 1rem;
}
.guide strong {
  display: block;
  margin-bottom: .3rem;
}
.journal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
}
.journal-evidence {
  display: grid;
  gap: .35rem;
  list-style: none;
  padding: 0;
}
.journal-evidence button {
  text-align: left;
  width: 100%;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,180px),1fr));
  gap: .8rem;
}
.gallery figure {
  border: 1px solid var(--line);
  margin: 0;
}
.gallery button {
  text-align: left;
  width: 100%;
}
.gallery img {
  width: 100%;
  aspect-ratio: 4/3;
}
.locked-content {
  overflow: auto;
}
@media (max-width:420px) {
  .header-controls {
    flex-wrap: wrap;
    justify-content: end;
  }
  .header-controls time {
    display: none;
  }
}
