[hidden] {
  display: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 150px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0c100e;
  color: #f4f1e8;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:active {
  transform: scale(0.98);
}

:focus-visible {
  outline: 2px solid #c6e27a;
  outline-offset: 2px;
}

.wrap {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 0 16px;
}

.kicker {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #c6e27a;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.display {
  margin: 0 0 12px;
  font-size: 56px;
  line-height: 0.92;
  letter-spacing: -0.05em;
  font-weight: 760;
}

.lead {
  margin: 0;
  max-width: 22em;
  font-size: 18px;
  line-height: 1.4;
  color: #d7ddd4;
}

.fine {
  margin-top: 18px;
  color: #93a399;
  font-size: 13px;
  line-height: 1.45;
}

.gate {
  min-height: 100dvh;
  padding-top: calc(32px + env(safe-area-inset-top));
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.segments {
  display: grid;
  gap: 3px;
  margin-top: 22px;
}

.segments i {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: #24302b;
}

.segments i[data-status="ok"] {
  background: #c6e27a;
}

.segments i[data-status="issue"] {
  background: #e36a4c;
}

.segments i[data-status="half"] {
  background: #e4c36a;
}

.segments i[data-status="skip"] {
  background: #66756e;
}

.fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #a8b7af;
  font-size: 13px;
  font-weight: 650;
}

input,
textarea {
  width: 100%;
  border: 1px solid #31403a;
  background: #121815;
  border-radius: 14px;
  color: #f4f1e8;
}

input {
  height: 52px;
  padding: 0 14px;
  font-size: 16px;
}

input[data-field="vin"] {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

textarea {
  min-height: 84px;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.4;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #7f9088;
}

.primary,
.ghost,
.pair button,
.filters button {
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid #31403a;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
}

.primary {
  width: 100%;
  margin-top: 16px;
  background: #c6e27a;
  border-color: #c6e27a;
  color: #142014;
}

.ghost {
  background: #171d1a;
  color: #f4f1e8;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pair button[aria-pressed="true"][data-act="checked"][data-val="yes"],
.pair button[aria-pressed="true"][data-act="issue"][data-val="no"] {
  background: #c6e27a;
  border-color: #c6e27a;
  color: #142014;
}

.pair button[aria-pressed="true"][data-act="checked"][data-val="no"] {
  background: #2a3330;
  border-color: #66756e;
  color: #f4f1e8;
}

.pair button[aria-pressed="true"][data-act="issue"][data-val="yes"] {
  background: #e36a4c;
  border-color: #e36a4c;
  color: #2a100c;
}

.text-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: #c6e27a;
  font-size: 15px;
  font-weight: 700;
}

.danger-text {
  color: #e7a090;
}

.resume {
  margin-top: 28px;
  padding: 18px;
  border: 1px solid #31403a;
  border-radius: 20px;
  background: #151b18;
}

.resume .primary {
  margin-top: 14px;
}

.resume-line {
  margin-top: 8px;
  font-size: 22px;
  letter-spacing: -0.04em;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.resume-line em {
  display: block;
  margin-top: 4px;
  color: #e36a4c;
  font-size: 15px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0;
}

.screen.has-dock {
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

.top {
  position: sticky;
  top: 0;
  z-index: 8;
  padding: calc(12px + env(safe-area-inset-top)) 0 12px;
  background: rgba(12, 16, 14, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.top-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.top h1 {
  font-size: 32px;
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-weight: 750;
}

.count {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #a8b7af;
  font-size: 14px;
}

.count strong {
  color: #f4f1e8;
  font-size: 28px;
  letter-spacing: -0.05em;
  font-weight: 750;
}

.count em {
  display: block;
  margin-top: 2px;
  color: #e36a4c;
  font-style: normal;
  font-size: 13px;
  font-weight: 750;
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 14px;
}

.filters button {
  min-height: 40px;
  border-radius: 999px;
  font-size: 14px;
}

.filters button[aria-pressed="true"] {
  background: #f4f1e8;
  border-color: #f4f1e8;
  color: #142014;
}

.meta {
  margin-top: 8px;
  border-top: 1px solid #24302b;
}

.meta summary,
.fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  color: #d7ddd4;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
}

.meta summary::-webkit-details-marker,
.fold summary::-webkit-details-marker {
  display: none;
}

.meta summary::after,
.fold summary::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-right: 2px solid #93a399;
  border-bottom: 2px solid #93a399;
  transform: rotate(45deg) translateY(-2px);
}

.meta[open] summary::after,
.fold[open] summary::after {
  transform: rotate(-135deg) translateY(-2px);
}

.meta summary.needs-info {
  color: #c6e27a;
}

.group {
  margin-top: 8px;
}

.group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 22px 2px 10px;
}

.group-head h2,
.sheet h2 {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #93a399;
  font-weight: 750;
}

.group-count {
  color: #93a399;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.card {
  margin-bottom: 10px;
  padding: 16px;
  border: 1px solid #29332e;
  border-radius: 18px;
  background: #151b18;
  scroll-margin-top: 150px;
}

.card[data-status="ok"] {
  border-color: #35502f;
  box-shadow: inset 3px 0 0 #c6e27a;
}

.card[data-status="issue"] {
  border-color: #5c332c;
  box-shadow: inset 3px 0 0 #e36a4c;
}

.card[data-status="half"] {
  box-shadow: inset 3px 0 0 #e4c36a;
}

.card[data-status="skip"] {
  box-shadow: inset 3px 0 0 #66756e;
}

.card-top {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.num {
  flex: none;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #93a399;
}

.card h2 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.03em;
  font-weight: 720;
  text-transform: none;
  color: #f4f1e8;
}

.ask {
  margin-top: 8px;
  color: #d5ddd4;
  font-size: 16px;
  line-height: 1.45;
}

fieldset {
  margin: 14px 0 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

legend {
  margin-bottom: 8px;
  padding: 0;
  color: #a8b7af;
  font-size: 13px;
  font-weight: 650;
}

.note {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  color: #a8b7af;
  font-size: 13px;
  font-weight: 650;
}

.hint {
  margin-top: 10px;
  color: #e4c36a;
  font-size: 13px;
  font-weight: 650;
}

.empty {
  padding: 28px 4px;
  color: #a8b7af;
  font-size: 16px;
}

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 22px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, #0c100e 62%, rgba(12, 16, 14, 0));
  pointer-events: none;
}

.dock .wrap {
  pointer-events: auto;
}

.dock .primary {
  margin-top: 0;
}

.dock-row {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 8px;
}

.sheet {
  padding-top: 8px;
}

.sub {
  margin-top: 8px;
  color: #c5d0c8;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0 8px;
}

.stat {
  padding: 14px 10px 12px;
  border-radius: 16px;
  background: #151b18;
  border: 1px solid #29332e;
}

.stat b {
  display: block;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.stat span {
  display: block;
  margin-top: 6px;
  color: #a8b7af;
  font-size: 12px;
  font-weight: 700;
}

.stat.ok b {
  color: #c6e27a;
}

.stat.bad b {
  color: #e36a4c;
}

.block {
  margin-top: 22px;
}

.block h2 {
  margin-bottom: 4px;
}

.issue,
.plain li {
  padding: 14px 0;
  border-top: 1px solid #29332e;
}

.issue h3,
.plain li {
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.issue .quiet,
.tag {
  margin-top: 4px;
  color: #93a399;
  font-size: 13px;
  line-height: 1.4;
}

.issue .seen {
  margin-top: 8px;
  color: #f4f1e8;
  font-size: 16px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.plain {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plain li {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.plain .num {
  width: 1.6em;
}

.tag {
  margin-left: auto;
  color: #e4c36a;
  font-weight: 700;
  white-space: nowrap;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 18px;
}

.banner {
  margin: 0;
  padding: 10px 16px;
  background: #3a3218;
  color: #f4e3b0;
  font-size: 14px;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 30;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border-radius: 999px;
  background: #f4f1e8;
  color: #142014;
  font-size: 14px;
  font-weight: 750;
}

dialog {
  width: min(380px, calc(100% - 32px));
  padding: 20px;
  border: 1px solid #31403a;
  border-radius: 20px;
  background: #151b18;
  color: #f4f1e8;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.64);
}

dialog h2 {
  font-size: 22px;
  letter-spacing: -0.03em;
  text-transform: none;
  color: #f4f1e8;
}

dialog p {
  margin-top: 8px;
  color: #c5d0c8;
  font-size: 15px;
  line-height: 1.4;
}

dialog .pair {
  margin-top: 16px;
}

dialog .danger {
  background: #e36a4c;
  border-color: #e36a4c;
  color: #2a100c;
}

.noscript {
  padding: 24px 16px;
}

@media (prefers-reduced-motion: reduce) {
  button:active {
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}

@media print {
  body {
    background: #fff;
    color: #161616;
  }

  .dock,
  .filters,
  .text-btn,
  .report-actions,
  .banner,
  .toast,
  dialog,
  .no-print {
    display: none !important;
  }

  .top {
    position: static;
    background: #fff;
  }

  .card,
  .issue,
  .stat,
  .plain li {
    break-inside: avoid;
  }

  .card,
  .stat {
    border-color: #ccc;
    background: #fff;
    box-shadow: none;
  }

  .ask,
  .sub,
  .fine,
  .quiet,
  .group-head h2,
  .sheet h2 {
    color: #333;
  }
}
