:root {
  --bg: #111318;
  --panel: #1c2027;
  --line: #303640;
  --text: #f1f3f5;
  --muted: #9ca3ad;
  --green: #23864f;
  --red: #c54138;
  --skip: #5d6570;
  --accent: #7eb0ff;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.bar {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  font-size: 13px;
}
.bar__title { font-weight: 650; }
.bar__progress, .bar__sync, .bar__who { color: var(--muted); }
.bar__spacer { flex: 1; }
.bar__sync[data-state="pending"] { color: #e1b25e; }
.bar__sync[data-state="error"] { color: #f06b61; }

main {
  width: min(1800px, 100%);
  min-height: calc(100dvh - 42px);
  margin: 0 auto;
  padding: 12px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav button {
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.nav button:hover:not(:disabled) { border-color: var(--muted); }
.nav button:disabled { opacity: .4; cursor: default; }
.counter {
  min-width: 58px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.counter b { color: var(--text); font-size: 15px; }

.claim {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.claim__place { flex: 0 1 auto; min-width: 260px; display: flex; align-items: center; gap: 10px; }
.claim__label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.claim__address { display: block; margin-top: 2px; font-size: 16px; line-height: 1.3; }
.claim__address.is-empty { color: var(--muted); font-weight: 400; }
.pill {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pill--none { border-color: #705a31; color: #e1b25e; }
.fields {
  width: 100%;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 18px;
}
.fields div { display: flex; gap: 6px; min-width: 0; }
.fields dt { color: var(--muted); font-size: 12px; white-space: nowrap; }
.fields dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.fields .field--wide { flex: 1 1 100%; }
.fields .field--wide dd {
  flex: 1 1 auto;
  min-width: 0;
  color: #c8cdd5;
}
.fields .field--wide dd.is-long {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reasoning-preview {
  width: 100%;
  min-width: 0;
  padding: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.reasoning-preview span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reasoning-preview strong {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.fields .filename { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.fields .is-empty { color: #656c76; font-style: italic; }

.reasoning-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 18px 60px rgb(0 0 0 / 55%);
}
.reasoning-dialog::backdrop { background: rgb(0 0 0 / 70%); }
.reasoning-dialog__header {
  position: sticky;
  top: 0;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.reasoning-dialog h2 { margin: 0; font-size: 17px; }
.reasoning-dialog__header button {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #252a32;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.reasoning-dialog p {
  margin: 0;
  padding: 18px;
  color: #d7dbe1;
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.media-dialog {
  width: calc(100vw - 24px);
  height: calc(100dvh - 24px);
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #000;
  color: var(--text);
}
.media-dialog::backdrop { background: rgb(0 0 0 / 82%); }
.media-dialog > button {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  padding: 8px 12px;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 7px;
  background: rgb(17 19 24 / 88%);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
#media-full { width: 100%; height: 100%; }
#media-full img, #media-full video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.visuals {
  flex: 1 1 auto;
  min-height: 320px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 10px;
}
.visual {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}
.visual h2 {
  flex: 0 0 36px;
  margin: 0;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 650;
}
.visual h2 small { margin-left: 5px; color: var(--muted); font-size: 11px; font-weight: 400; }
.visual__body { flex: 1 1 auto; min-height: 0; min-width: 0; }
.media { position: relative; display: flex; align-items: center; justify-content: center; background: #000; }
.media video, .media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.media img[role="button"] { cursor: zoom-in; }
.media img[role="button"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}
.media__open {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 7px 10px;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 7px;
  background: rgb(17 19 24 / 86%);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.media__fail, .map__none { margin: auto; padding: 24px; color: var(--muted); text-align: center; }
.map { display: flex; flex-direction: column; background: #171a20; }
.map iframe { flex: 1 1 auto; display: block; width: 100%; min-height: 0; border: 0; }
.map__link { flex: 0 0 auto; padding: 7px 10px; border-top: 1px solid var(--line); font-size: 12px; }
.map__link a { color: var(--accent); text-decoration: none; }

.verdict {
  flex: 0 0 auto;
  width: min(720px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.verdict__buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.verdict__nav { justify-content: center; }
.v {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .12s ease, transform .12s ease;
}
.v:hover { filter: brightness(1.12); }
.v:active { transform: translateY(1px); }
.v--yes { background: var(--green); }
.v--no { background: var(--red); }
.v--skip { background: var(--skip); }
.v[aria-pressed="true"] { outline: 3px solid #fff; outline-offset: -4px; }
#note {
  width: 100%;
  padding: 9px 11px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

:where(button, textarea, a):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (min-width: 901px) {
  body { overflow: hidden; }
  main { height: calc(100dvh - 42px); }
}

@media (max-width: 900px) {
  main { padding: 10px; }
  .bar__title, .bar__who { display: none; }
  .visuals {
    flex: none;
    min-height: 0;
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: min(86vw, 520px);
    grid-auto-rows: 56vh;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .visual { scroll-snap-align: center; }
  .claim { align-items: flex-start; flex-direction: column; gap: 8px; }
  .claim__place { width: 100%; min-width: 0; }
  .claim__place > div { min-width: 0; }
  .claim__address { overflow-wrap: anywhere; }
  .fields { max-height: 92px; overflow: auto; }
}

@media (max-width: 520px) {
  .bar { padding: 7px 10px; }
  .bar__sync { display: none; }
  .nav button { padding: 7px 10px; }
  .visuals { grid-auto-columns: calc(100vw - 20px); grid-auto-rows: 48vh; }
  .verdict__buttons { gap: 6px; }
  .v { min-height: 48px; font-size: 14px; }
}
