:root {
  color-scheme: dark;
  font-family: var(--ui);
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--text);
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
select {
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.42;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea,
select {
  color: var(--text);
}
button {
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: 9px;
  padding: 10px 14px;
  transition: background 0.15s;
}
button:hover:not(:disabled) {
  background: #2d3035;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
input,
select,
textarea {
  background: var(--panel2);
  border: 1px solid var(--border);
  width: 100%;
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #8a9173;
}
textarea {
  resize: vertical;
}
label {
  display: grid;
  gap: 8px;
  color: #b8bbc3;
}
form {
  display: grid;
  gap: 16px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.error {
  color: var(--danger);
  margin: 0;
}
.eyebrow {
  font-size: 11px; /* was 10px; review L8 */
  color: var(--muted);
  letter-spacing: 1.8px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 25px;
  letter-spacing: -0.7px;
  font-weight: 550;
}
h2 {
  font-size: 20px;
  font-weight: 550;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 15px;
  font-weight: 550;
}
.topbar {
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mark);
  font-stretch: 125%;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.01em;
}
.brand-icon {
  font-size: 35px;
  font-weight: 400;
}
.brand-note {
  font-family: var(--ui);
  font-stretch: normal;
  color: var(--muted);
  margin-left: 7px;
  align-self: center;
}
nav {
  display: flex;
  align-self: stretch;
  gap: 30px;
}
.nav-item {
  border: 0;
  background: transparent;
  padding: 0 2px;
  border-radius: 0;
  color: #92959e;
  position: relative;
}
.nav-item.active:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}
#identity {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
}
.allowance {
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 12px;
  color: #e0e2e6;
}
.allowance span {
  color: var(--accent);
  margin-right: 6px;
}
.user-name {
  font-size: 12px;
  color: var(--muted);
}
.icon-button {
  font-size: 23px;
  padding: 4px 10px;
  background: transparent;
  border: 0;
}
.quiet {
  background: transparent;
  color: var(--muted);
  border: 0;
  font-size: 12px;
}
.primary,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--accent);
  border: 0;
  color: #151a0b;
  font-weight: 600;
  border-radius: 8px;
  padding: 13px 18px;
}
.primary:hover:not(:disabled),
.button:hover {
  background: #f0ffbd;
}
.login {
  width: min(400px, calc(100% - 40px));
}
.login-symbol {
  font-size: 58px;
  color: var(--accent);
  margin-bottom: 25px;
}
.login h1 {
  margin: 15px 0 20px;
}
.login > p.muted {
  line-height: 1.6;
  margin-bottom: 30px;
}
.login form {
  margin-bottom: 20px;
}
.login .primary {
  justify-content: space-between;
}
.notice {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  color: #e8e9ea;
  border-radius: 10px;
  padding: 14px 22px;
  max-width: min(620px, 90vw);
  box-shadow: 0 10px 40px #0008;
}
.gallery-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gallery-tools {
  display: flex;
  align-items: center;
  font-size: 12px;
}
.gallery {
  padding: 0 34px 285px;
  display: grid;
}
.empty {
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
  padding: 20px;
}
.empty-symbol {
  font-size: 46px;
  margin-bottom: 15px;
}
.empty h2 {
  margin-bottom: 10px;
}
.empty p {
  line-height: 1.7;
}
.batch-head {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
}
.batch-head p {
  margin: 0;
  color: #c6c8cd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.batch-head time {
  margin-left: auto;
  font-size: 11px;
}
.version-chip {
  font-size: 11px; /* was 10px; review L8 */
  color: var(--accent);
  background: #21271a;
  padding: 3px 7px;
  border-radius: 4px;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.image-tile {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  background: #15171a;
  border: 1px solid #25282c;
  cursor: pointer;
  padding: 0;
}
.image-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.tile-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 12px 12px;
  background: linear-gradient(transparent, #000b);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.2s;
}
.image-tile:hover .tile-overlay,
.image-tile:focus-visible .tile-overlay {
  opacity: 1;
}
.tile-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 8px;
  padding: 20px;
  color: var(--muted);
  font-size: 12px;
}
.tile-state b {
  font-weight: 500;
  color: #d1d4d8;
}
.tile-state small {
  font-size: 11px;
  line-height: 1.5;
}
.spinner {
  border: 2px solid #313638;
  border-top-color: var(--accent);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  margin: 0 auto 8px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.composer-wrap {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
}
.composer-top {
  align-items: center;
}
.composer-label {
  color: #c9cdd3;
  font-size: 11px; /* was 10px; review L8 */
  letter-spacing: 1px;
}
.composer-top #draft-status {
  font-size: 11px; /* was 10px; review L8 */
  color: #707783;
}
.revision-label {
  margin-left: auto;
  color: var(--accent);
  font-size: 11px;
}
.composer textarea {
  border: 0;
}
.composer-bottom {
  display: flex;
  justify-content: space-between;
}
.controls {
  display: flex;
  align-items: center;
}
.pill {
  white-space: nowrap;
  width: auto;
}
.composer-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.references {
  display: flex;
  flex-wrap: wrap;
}
.references:empty {
  display: none;
}
.reference {
  position: relative;
  border: 1px solid #41464f;
}
.reference img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.reference button {
  position: absolute;
  top: -5px;
  right: -5px;
  border-radius: 100%;
  font-size: 14px;
  padding: 0;
  line-height: 18px;
}
.reference select {
  position: absolute;
  bottom: 0;
  left: 0;
  max-width: 100%;
  padding: 2px;
}
.modal {
  border: 1px solid #383d45;
  border-radius: 16px;
  background: #16181c;
  color: var(--text);
  padding: 24px;
  width: min(480px, calc(100vw - 32px));
  max-height: 85vh;
  box-shadow: 0 20px 80px #000b;
}
.modal::backdrop {
  background: #000a;
  backdrop-filter: blur(5px);
}
.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.modal-heading h2 {
  margin: 0;
}
.model-list {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  max-height: 55vh;
  overflow: auto;
}
.model-option {
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  background: #202328;
  border-color: #30343c;
}
.model-option small {
  font-size: 11px; /* was 10px; review L8 */
  color: var(--muted);
}
.model-option.selected {
  border-color: #b2c279;
  color: var(--accent);
}
.settings-fields {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}
.detail-modal {
  width: min(1120px, calc(100vw - 40px));
  padding: 18px;
}
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
}
.detail-image {
  width: 100%;
  height: 65vh;
  object-fit: contain;
  background: #0e1012;
  border-radius: 10px;
}
.detail-info {
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.detail-info .modal-heading {
  margin-bottom: 0;
}
.detail-info h2 {
  font-size: 16px;
}
.detail-info p {
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.detail-actions > * {
  flex: 1;
  text-align: center;
  white-space: nowrap;
}
.detail-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  font-size: 11px;
  color: var(--muted);
}
.detail-meta dt,
.detail-meta dd {
  margin: 0;
}
.detail-meta dd {
  text-align: right;
  color: #d2d6db;
  overflow-wrap: anywhere;
}
.detail-references {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.detail-references img {
  height: 48px;
  width: 48px;
  object-fit: cover;
  border-radius: 6px;
}
.draft-option {
  text-align: left;
  width: 100%;
  margin-bottom: 8px;
  display: grid;
  gap: 5px;
}
.draft-option small {
  color: var(--muted);
}
.admin-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.admin-heading h1 {
  margin: 6px 0 0;
}
.admin-section {
  margin: 30px 0;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.section-heading h2 {
  margin: 0;
  font-size: 18px;
}
.section-heading small {
  color: var(--muted);
}
.account-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.account-card {
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 20px;
  border-radius: 12px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.account-card h3 {
  margin: 0;
}
.account-card .balance {
  font-size: 27px;
  letter-spacing: -0.8px;
}
.account-card .balance small {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0;
}
.account-id {
  font-family: ui-monospace, monospace;
  font-size: 11px; /* was 9px; review L8 */
  overflow-wrap: anywhere;
  color: #858b95;
}
.account-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
}
.account-actions button {
  font-size: 11px;
  padding: 7px;
}
.account-empty {
  border-style: dashed;
  justify-content: center;
  align-items: center;
  color: var(--muted);
  text-align: center;
}
.status {
  font-size: 11px; /* was 10px; review L8 */
  color: var(--accent);
}
.status.bad {
  color: var(--danger);
}
.account-card p {
  font-size: 11px; /* was 10px; review L8 */
  color: var(--danger);
  line-height: 1.5;
  margin: 0;
}
.budget-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  padding: 16px 20px;
  gap: 20px;
  font-size: 12px;
}
.budget-bar p {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted);
}
.budget-bar button {
  font-size: 12px;
}
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 12px;
  white-space: nowrap;
}
th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}
tr:last-child td {
  border-bottom: 0;
}
th {
  color: var(--muted);
  font-weight: 400;
  background: var(--panel);
}
td small {
  display: block;
  color: var(--muted);
  font-size: 11px; /* was 10px; review L8 */
  margin-top: 4px;
}
td input {
  width: 80px;
  padding: 8px;
}
td button {
  font-size: 11px;
  padding: 8px 10px;
}
td .inline-form {
  display: flex;
  gap: 7px;
  align-items: center;
}
.request-row {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}
.request-row .request-copy {
  flex: 1;
}
.request-copy p {
  margin: 6px 0 0;
  color: var(--muted);
}
.request-row button {
  font-size: 11px;
}
.admin-output {
  padding-bottom: 40px;
}
.admin-output .gallery {
  padding: 0;
}
.admin-view select {
  width: auto;
}
.connect-result {
  padding-top: 20px;
  line-height: 1.6;
}
.connection-result {
  max-width: 600px;
  margin: 15vh auto;
  padding: 30px;
}
@media (min-width: 1700px) {
  .tiles {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
@media (max-width: 1100px) {
  .tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .user-name {
    display: none;
  }
  .composer-bottom {
    align-items: flex-end;
  }
  .composer-footer > span:last-child {
    display: none;
  }
}
@media (max-width: 700px) {
  .topbar {
    padding: 0 16px;
    height: 65px;
    gap: 20px;
  }
  .brand {
    font-size: 15px;
  }
  .brand-icon {
    font-size: 27px;
  }
  nav {
    gap: 14px;
  }
  .nav-item {
    font-size: 12px;
  }
  #identity {
    gap: 2px;
  }
  .allowance {
    font-size: 11px; /* was 10px; review L8 */
    padding: 7px;
  }
  .gallery-heading {
    padding: 24px 18px 20px;
  }
  .gallery-tools {
    gap: 3px;
  }
  .gallery-tools .muted {
    display: none;
  }
  .gallery {
    padding: 0 18px 320px;
    gap: 24px;
  }
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .batch-head {
    flex-wrap: wrap;
    gap: 5px;
  }
  .batch-head p {
    max-width: 100%;
    width: 100%;
  }
  .batch-head time {
    margin-left: 0;
  }
  .composer-wrap {
    bottom: 12px;
    width: calc(100% - 24px);
  }
  .composer {
    padding: 12px;
  }
  .composer-bottom {
    align-items: stretch;
    flex-direction: column;
  }
  .composer textarea {
    font-size: 14px;
  }
  .controls {
    gap: 5px;
  }
  .pill {
    font-size: 11px; /* was 10px; review L8 */
    padding: 7px;
  }
  .admin-view {
    padding: 24px 18px;
  }
  .account-grid {
    grid-template-columns: 1fr;
  }
  .admin-heading,
  .budget-bar {
    align-items: flex-start;
    flex-direction: column;
  }
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .detail-image {
    height: 45vh;
  }
  .detail-info {
    gap: 14px;
  }
  .modal {
    padding: 18px;
  }
  .image-tile .tile-overlay {
    opacity: 1;
  }
  .request-row {
    flex-wrap: wrap;
    gap: 10px;
  }
}
.gallery {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 22px 14px;
}
.batch-1 {
  grid-column: span 1;
}
.batch-2 {
  grid-column: span 2;
}
.batch-3 {
  grid-column: span 3;
}
.batch-4 {
  grid-column: span 4;
}
.batch-1 .tiles {
  grid-template-columns: 1fr;
}
.batch-2 .tiles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.batch-3 .tiles {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.batch-4 .tiles {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.batch-head {
  flex-wrap: wrap;
  gap: 5px 8px;
  min-height: 48px;
}
.batch-head p {
  width: 100%;
  max-width: 100%;
  font-size: 11px;
}
.batch-head > span:not(.version-chip),
.batch-head time {
  font-size: 11px; /* was 10px; review L8 */
}
.image-tile {
  border-radius: 7px;
}
.gallery-tools {
  flex-shrink: 0;
}
@media (max-width: 1100px) {
  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .batch-4 {
    grid-column: span 3;
  }
  .batch-4 .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .batch-3,
  .batch-4 {
    grid-column: span 2;
  }
  .batch-3 .tiles,
  .batch-4 .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gallery-heading h1 {
    font-size: 20px;
  }
  .brand-note {
    display: none;
  }
  .batch-head {
    min-height: 54px;
  }
}
/* Google sign-in and identity assignment */
.google-login {
  display: flex;
  width: 100%;
  margin-top: 24px;
  background: #e7e9ed;
  color: #17191e;
}
.google-login:hover {
  background: #fff;
}
.google-mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.google-mapping-grid form {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  background: var(--panel);
  gap: 10px;
}
.google-mapping-grid button {
  justify-self: start;
}
.image-tile video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #0e1012;
}

#uncertain-evidence {
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#resolve-form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}
