:root {
  --bg: #17301f;
  --bg-light: #1e4232;
  --card-bg: rgba(255,255,255,0.06);
  --card-border: rgba(255,255,255,0.09);
  --card-border-hover: rgba(255,255,255,0.16);
  --text: #f0ead8;
  --text-soft: #b5c0a8;
  --text-muted: #7a8e6e;
  --gold: #c8a25a;
  --gold-hover: #dbb86e;
  --green: #6dbf7a;
  --green-hover: #82d490;
  --brown: #a07048;
  --brown-light: #c4956a;
  --tan: #d4c4a0;
  --cream: #f0ead8;
  --error: #e06060;
  --success: #6dbf7a;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(30,66,50,0.8) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(40,50,30,0.6) 0%, transparent 50%);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 18px 40px;
}

/* ── Hero ── */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 60px 0 48px;
  min-height: 340px;
}

.hero-content {
  flex: 1;
  max-width: 480px;
}

.hero-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: rgba(200,162,90,0.12);
  border: 1px solid rgba(200,162,90,0.22);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.btn-logout {
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.12);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-logout:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-soft);
  border-color: rgba(255,255,255,0.2);
}
}

.hero h1 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #f0ead8 20%, #c8a25a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  margin: 16px 0 0;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 380px;
}

.hero-deco {
  flex: 0 0 260px;
  height: 280px;
  position: relative;
}

.deco-piece {
  position: absolute;
  font-size: 3rem;
  opacity: 0.12;
  color: var(--cream);
  filter: blur(0.5px);
  transition: opacity 0.3s;
}
.deco-piece:hover { opacity: 0.25; }
.deco-1 { top: 0; left: 40px; font-size: 4rem; opacity: 0.15; }
.deco-2 { top: 30px; right: 20px; font-size: 3.2rem; }
.deco-3 { top: 100px; left: 10px; font-size: 2.6rem; opacity: 0.1; }
.deco-4 { top: 80px; right: 60px; font-size: 3.6rem; opacity: 0.08; }
.deco-5 { bottom: 50px; left: 50px; font-size: 2.8rem; opacity: 0.12; }
.deco-6 { bottom: 20px; right: 30px; font-size: 4.5rem; opacity: 0.18; }

/* ── Feature Strip ── */
.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  overflow: hidden;
  margin-bottom: 28px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.feature-item {
  padding: 26px 20px;
  text-align: center;
  background: rgba(20,40,28,0.6);
  transition: background 0.2s;
}
.feature-item:hover { background: rgba(30,55,38,0.7); }

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(200,162,90,0.1);
  color: var(--gold);
  margin-bottom: 12px;
}

.feature-item h3 {
  margin: 0 0 6px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cream);
}

.feature-item p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── Card Grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  transition: border-color 0.2s, transform 0.15s;
}
.card:hover {
  border-color: var(--card-border-hover);
  transform: translateY(-2px);
}

.card-wide { grid-column: 1 / -1; }

.card-scan   { background: linear-gradient(145deg, rgba(200,162,90,0.12), rgba(160,112,72,0.08)); }
.card-info   { background: linear-gradient(145deg, rgba(212,196,160,0.08), rgba(180,160,120,0.05)); }
.card-moves  { background: linear-gradient(145deg, rgba(160,112,72,0.1), rgba(130,88,52,0.06)); }
.card-pgn    { background: linear-gradient(145deg, rgba(30,66,50,0.25), rgba(23,48,31,0.3)); }
.card-wide   { background: linear-gradient(145deg, rgba(109,191,122,0.06), rgba(30,66,50,0.15)); }

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.card-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  color: var(--cream);
}
.card-icon-gold   { background: rgba(200,162,90,0.15); color: var(--gold); }
.card-icon-green  { background: rgba(109,191,122,0.12); color: var(--green); }
.card-icon-brown  { background: rgba(160,112,72,0.15); color: var(--brown-light); }
.card-icon-tan    { background: rgba(212,196,160,0.12); color: var(--tan); }
.card-icon-cream  { background: rgba(240,234,216,0.1); color: var(--cream); }

.card-header h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.card-desc {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ── Fields ── */
.field-label {
  display: block;
  margin: 12px 0 5px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input, .output {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 0.92rem;
  color: var(--text);
  background: rgba(255,255,255,0.05);
  transition: border-color 0.2s, background 0.2s;
}
.input:focus, .output:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255,255,255,0.08);
}
.input::placeholder { color: var(--text-muted); }
.output {
  font-family: "SF Mono", "Fira Code", "Courier New", monospace;
  resize: vertical;
  font-size: 0.85rem;
  line-height: 1.5;
}
.output[readonly] { opacity: 0.7; }

/* ── Buttons ── */
.buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 4px;
}

.btn {
  border: 0;
  border-radius: var(--radius-pill);
  padding: 10px 22px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.01em;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { cursor: not-allowed; opacity: 0.35; transform: none; }

.btn-hero {
  display: inline-block;
  margin-top: 22px;
  padding: 13px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1206;
  background: linear-gradient(135deg, var(--gold), var(--brown-light));
  box-shadow: 0 4px 20px rgba(200,162,90,0.3);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-hero:hover { box-shadow: 0 6px 28px rgba(200,162,90,0.4); transform: translateY(-2px); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #b8923e);
  color: #1a1206;
  box-shadow: 0 2px 10px rgba(200,162,90,0.2);
}
.btn-gold:hover:not(:disabled) { box-shadow: 0 4px 16px rgba(200,162,90,0.35); }

.btn-green {
  background: linear-gradient(135deg, var(--green), #4a9e56);
  color: #0a1f0e;
  box-shadow: 0 2px 10px rgba(109,191,122,0.2);
}
.btn-green:hover:not(:disabled) { box-shadow: 0 4px 16px rgba(109,191,122,0.35); }

.btn-brown {
  background: linear-gradient(135deg, var(--brown-light), var(--brown));
  color: #1a1206;
}
.btn-brown:hover:not(:disabled) { box-shadow: 0 4px 16px rgba(160,112,72,0.3); }

.btn-outline {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-outline:hover:not(:disabled) { background: rgba(255,255,255,0.06); }

/* ── Status ── */
.status {
  min-height: 20px;
  margin: 8px 0 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-soft);
}
.status.error { color: var(--error); }
.status.success { color: var(--success); }

/* ── Progress ── */
.progress-bar {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin-top: 10px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--green));
  transition: width 0.3s ease;
}
.progress-fill.indeterminate {
  width: 30%;
  animation: pslide 1.4s ease-in-out infinite;
}
.progress-fill.finishing {
  width: 100%;
  transition: width 0.2s ease;
}
@keyframes pslide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* ── Preview ── */
.annotated-container {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--card-border);
}
.preview-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  background: #0a1a10;
}

/* ── Overlay ── */
.overlay-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.overlay-cell {
  position: absolute;
  pointer-events: auto;
  transform: translateX(1%);
}
.overlay-move-no {
  padding: 2px 5px;
  border: 1px solid rgba(255, 211, 122, 0.78);
  border-radius: 6px;
  background: rgba(40, 72, 54, 0.9);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
  color: #ffe09a;
  font-size: clamp(13px, 1.8vw, 23px);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}
.overlay-input {
  min-width: 0;
  border: 1px solid rgba(74, 137, 133, 0.82);
  border-radius: 6px;
  padding: 2px 6px;
  background: rgba(222, 242, 235, 0.76);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  color: #102f2a;
  font-family: "Inter", sans-serif;
  font-size: clamp(14px, 1.9vw, 25px);
  font-weight: 800;
  line-height: 1.15;
}
.overlay-input:placeholder-shown {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}
.overlay-input:focus {
  z-index: 2;
  outline: 3px solid rgba(255, 210, 112, 0.88);
  border-color: #fff0bd;
  background: rgba(255, 252, 235, 0.96);
}
.overlay-input.invalid-move {
  border-color: rgba(212, 77, 65, 0.9);
  background: rgba(255, 218, 210, 0.84);
  color: #721e18;
}
.preview-cell {
  border-radius: 2px;
  background: rgba(255,255,255,0.04);
  overflow: visible;
}
.preview-placeholder {
  background: rgba(218, 239, 233, 0.16);
  border: 1px dashed rgba(98, 180, 158, 0.5);
  min-width: 0;
  height: clamp(21px, 2.4vw, 31px);
}

/* Row review keeps editable OCR beside the handwriting instead of over it. */
.row-review {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 1320px;
  margin-inline: auto;
}
.column-review-panel {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}
.column-review-panel h3 {
  margin: 0 0 9px;
  color: #ffe09a;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1rem;
}
.column-review-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
  gap: 14px;
}
.review-column-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: #e7edf0;
}
.review-column-inputs {
  display: grid;
  grid-template-rows: 4.4fr repeat(25, 3.6fr) 5.6fr;
  row-gap: 0;
  min-height: 0;
}
.column-input-spacer { grid-row: 1; }
.column-input-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 0;
  padding: 0 3px;
  border-radius: 4px;
}
.column-input-row:nth-child(even) { background: rgba(200, 162, 90, 0.12); }
.column-input-row span {
  display: grid;
  place-items: center;
  color: #ffe09a;
  font-size: clamp(0.85rem, 1.1vw, 1rem);
  font-weight: 800;
}
.column-move-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}
.review-input {
  width: 100%;
  min-width: 0;
  height: clamp(23px, 1.8vw, 27px);
  padding: 2px 6px;
  border: 1px solid rgba(101, 180, 158, 0.72);
  border-radius: 4px;
  background: #e5f3ed;
  color: #102f2a;
  font: 800 clamp(0.82rem, 1.05vw, 0.95rem)/1 "Inter", sans-serif;
}
.review-input::placeholder {
  color: #6f857d;
  font-weight: 600;
}
.review-input:focus {
  outline: 3px solid rgba(255, 210, 112, 0.7);
  border-color: #ffe09a;
}
.review-input.invalid-move {
  border-color: #dd5d50;
  background: #ffe0da;
  color: #721e18;
}

@media (max-width: 1080px) {
  .row-review { grid-template-columns: minmax(0, 1fr); }
  .column-review-pair { grid-template-columns: minmax(0, 1fr) 340px; }
}

@media (max-width: 800px) {
  .column-review-pair { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 560px) {
  .column-review-pair { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .column-input-row { grid-template-columns: 34px minmax(0, 1fr); gap: 4px; }
  .column-move-fields { gap: 4px; }
}

/* ── Crop ── */
.crop-stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 24px;
  margin-bottom: 16px;
}
.crop-controls { min-width: 0; }
.crop-controls .manual-straighten { margin-top: 0; }
.crop-stage .crop-box {
  width: fit-content;
  max-width: 100%;
  justify-self: center;
}
.crop-stage .crop-img {
  width: auto;
  max-width: 100%;
  max-height: min(65vh, 640px);
}
.crop-box {
  position: relative;
  width: 100%;
  cursor: crosshair;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: #0a1a10;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.crop-img {
  display: block;
  width: 100%;
  pointer-events: none;
}
.crop-selection {
  position: absolute;
  display: none;
  border: 2px solid var(--gold);
  background: rgba(200,162,90,0.15);
  cursor: move;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.45);
  pointer-events: none;
}
.crop-selection-adjusting { background: rgba(200,162,90,0.08); }
.crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--gold);
  border-radius: 4px;
  background: var(--cream);
  z-index: 5;
  pointer-events: auto;
}
.crop-handle-nw { top: -7px; left: -7px; cursor: nwse-resize; }
.crop-handle-n  { top: -7px; left: 50%; margin-left: -7px; cursor: ns-resize; }
.crop-handle-ne { top: -7px; right: -7px; cursor: nesw-resize; }
.crop-handle-e  { top: 50%; right: -7px; margin-top: -7px; cursor: ew-resize; }
.crop-handle-se { bottom: -7px; right: -7px; cursor: nwse-resize; }
.crop-handle-s  { bottom: -7px; left: 50%; margin-left: -7px; cursor: ns-resize; }
.crop-handle-sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.crop-handle-w  { top: 50%; left: -7px; margin-top: -7px; cursor: ew-resize; }
.crop-size-badge {
  position: absolute;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(10,26,16,0.85);
  border: 1px solid var(--gold);
  color: var(--cream);
  font-size: 0.78rem;
  line-height: 1.5;
  z-index: 6;
  pointer-events: none;
  white-space: nowrap;
}
.crop-hint {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--text-soft);
}
.manual-straighten {
  margin: 14px 0 18px;
  padding: 14px 16px 10px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.035);
}
.manual-straighten-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.manual-straighten-heading label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}
.manual-straighten-heading output {
  min-width: 106px;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  background: rgba(200,162,90,0.14);
  color: var(--gold-hover);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.manual-straighten-heading .btn { padding: 8px 14px; font-size: 0.85rem; }
.straighten-angle {
  display: block;
  width: 100%;
  height: 28px;
  margin: 12px 0 0;
  accent-color: var(--green);
  cursor: pointer;
}
.straighten-angle:disabled { cursor: wait; opacity: 0.55; }
.straighten-range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) {
  .manual-straighten { padding: 12px; }
  .manual-straighten-heading .btn { width: 100%; }
}

/* ── Raw box ── */
.raw-box {
  margin-top: 12px;
  border-top: 1px solid var(--card-border);
  padding-top: 10px;
}
.raw-box summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-soft);
}
.raw-box summary:hover { color: var(--text); }
.raw-output {
  white-space: pre-wrap;
  margin: 8px 0 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.04);
  font-size: 0.82rem;
  color: var(--text-soft);
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 36px 0 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ── Hidden ── */
.hidden { display: none; }

/* ── Responsive ── */
@media (max-width: 780px) {
  .hero { flex-direction: column; text-align: center; padding: 40px 0 32px; min-height: auto; }
  .hero-content { max-width: 100%; }
  .hero-desc { max-width: 100%; }
  .hero-deco { display: none; }
  .feature-strip { grid-template-columns: repeat(2, 1fr); }
  .crop-stage { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .card-wide { grid-column: 1; }
}

@media (max-width: 480px) {
  .feature-strip { grid-template-columns: 1fr; }
  .buttons .btn { width: 100%; text-align: center; }
}

/* ── Editorial monochrome skin ─────────────────────────────────── */
:root {
  color-scheme: light;
  --bg: #090909;
  --bg-light: #f5f5f3;
  --card-bg: #fff;
  --card-border: #d4d4d1;
  --card-border-hover: #111;
  --text: #111;
  --text-soft: #424242;
  --text-muted: #686868;
  --gold: #111;
  --gold-hover: #333;
  --green: #111;
  --green-hover: #333;
  --brown: #111;
  --brown-light: #333;
  --tan: #111;
  --cream: #111;
  --error: #a32222;
  --success: #176333;
  --radius: 3px;
  --radius-sm: 2px;
  --radius-pill: 2px;
}

body {
  padding: 14px;
  color: var(--text);
  background: #090909;
  background-image: none;
  font-family: Inter, Arial, sans-serif;
}

.page {
  max-width: 1420px;
  padding: 0 clamp(18px, 5vw, 76px) 28px;
  background: #fff;
  border: 1px solid #cfcfcd;
}

.hero {
  min-height: 0;
  padding: clamp(54px, 8vw, 112px) 0 64px;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  text-align: center;
}

.hero-content { max-width: 760px; }
.hero-top-row { justify-content: center; margin-bottom: 22px; }
.hero-badge {
  padding: 0;
  color: #333;
  border: 0;
  background: transparent;
  border-radius: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.015em;
}

.hero h1 {
  color: #080808;
  background: none;
  -webkit-text-fill-color: currentColor;
  font-family: Inter, Arial, sans-serif;
  font-size: clamp(3.2rem, 8vw, 6.5rem);
  font-weight: 750;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hero-desc {
  max-width: 46ch;
  margin: 20px auto 0;
  color: #4d4d4d;
  font-size: 1rem;
  line-height: 1.65;
}

.btn-hero {
  margin-top: 26px;
  padding: 13px 24px;
  color: #fff;
  background: #080808;
  border: 1px solid #080808;
  box-shadow: none;
}
.btn-hero:hover { background: #333; box-shadow: none; transform: translateY(-1px); }

.hero-deco {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 3vw, 34px);
  width: 100%;
  height: auto;
  color: #080808;
}
.deco-piece {
  position: static;
  color: inherit;
  font-size: clamp(2.25rem, 7vw, 5rem);
  line-height: 1;
  opacity: 1;
  filter: none;
  transition: none;
}
.deco-1, .deco-2, .deco-3, .deco-4, .deco-5, .deco-6 { font-size: clamp(2.25rem, 7vw, 5rem); opacity: 1; }
.deco-piece:hover { opacity: 1; }

.feature-strip {
  margin: 0 calc(0px - clamp(18px, 5vw, 76px)) 34px;
  padding: 28px clamp(18px, 5vw, 76px);
  color: #fff;
  background: #080808;
  border: 0;
  border-radius: 0;
  gap: 0;
  backdrop-filter: none;
}
.feature-item,
.feature-item:hover {
  padding: 16px 20px;
  color: #fff;
  background: transparent;
}
.feature-item + .feature-item { border-left: 1px solid #444; }
.feature-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  color: #fff;
  background: #252525;
  border-radius: 50%;
}
.feature-item h3 {
  color: #fff;
  font-family: Inter, Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 650;
}
.feature-item p { color: #c2c2c2; }

.card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
/* Keep the scan action distinct, then group all three result panels together. */
.card-scan { grid-column: 1 / -1; }
.card-info,
.card-moves,
.card-pgn { grid-column: auto; min-width: 0; }
.card {
  padding: 22px;
  color: #111;
  background: #fff;
  border: 1px solid #d4d4d1;
  border-radius: 3px;
  box-shadow: none;
  transition: border-color 0.15s ease;
}
.card:hover { border-color: #111; transform: none; }
.card-scan,
.card-info,
.card-moves,
.card-pgn,
.card-wide {
  background: #fff;
}
.card-header { gap: 12px; }
.card-icon,
.card-icon-gold,
.card-icon-green,
.card-icon-brown,
.card-icon-tan,
.card-icon-cream {
  width: 36px;
  height: 36px;
  color: #111;
  background: #f0f0ee;
  border-radius: 2px;
}
.card-header h2 {
  color: #111;
  font-family: Inter, Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.card-desc { color: #626262; line-height: 1.5; }

.field-label { color: #333; }
.input, .output {
  color: #151515;
  background: #fafaf9;
  border: 1px solid #c9c9c6;
  border-radius: 2px;
}
.input:focus, .output:focus {
  border-color: #111;
  background: #fff;
  outline: 2px solid #111;
  outline-offset: 2px;
}
.input::placeholder { color: #696969; }
.output[readonly] { opacity: 1; color: #424242; background: #f5f5f3; }

.btn {
  border-radius: 2px;
  letter-spacing: 0;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: none; }
.btn:focus-visible,
.btn-hero:focus-visible,
.raw-box summary:focus-visible {
  outline: 2px solid #111;
  outline-offset: 3px;
}
.btn-gold, .btn-green, .btn-brown {
  color: #fff;
  background: #090909;
  border: 1px solid #090909;
  box-shadow: none;
}
.btn-gold:hover:not(:disabled),
.btn-green:hover:not(:disabled),
.btn-brown:hover:not(:disabled) {
  color: #fff;
  background: #333;
  box-shadow: none;
}
.btn-outline {
  color: #171717;
  background: #fff;
  border: 1px solid #777;
}
.btn-outline:hover:not(:disabled) { background: #f0f0ee; }
.btn:disabled { opacity: 0.48; }

.status { color: #4d4d4d; }
.status.error { color: var(--error); }
.status.success { color: var(--success); }
.progress-bar { background: #e2e2df; border-radius: 0; }
.progress-fill { background: #111; border-radius: 0; }

.annotated-container,
.crop-box { border-color: #bcbcb8; border-radius: 2px; }
.preview-img { background: #ededeb; }
.overlay-move-no {
  border-color: #111;
  border-radius: 2px;
  color: #fff;
  background: rgba(17, 17, 17, 0.92);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.overlay-input {
  border-color: #444;
  border-radius: 2px;
  color: #111;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.overlay-input:placeholder-shown { border-color: #aaa; background: rgba(255, 255, 255, 0.82); }
.overlay-input:focus { outline-color: #111; border-color: #111; background: #fff; }
.overlay-input.invalid-move { border-color: #a32222; background: #fff0ee; color: #721e18; }
.preview-cell { background: rgba(0, 0, 0, 0.035); }
.preview-placeholder { background: rgba(0, 0, 0, 0.07); border-color: #777; }

.column-review-panel {
  border-color: #d4d4d1;
  border-radius: 2px;
  background: #f7f7f5;
}
.column-review-panel h3 { color: #111; font-family: Inter, Arial, sans-serif; }
.review-column-image { border-color: #ccc; border-radius: 2px; }
.column-input-row:nth-child(even) { background: #efefed; }
.column-input-row span { color: #111; }
.review-input { border-color: #999; border-radius: 2px; color: #111; background: #fff; }
.review-input::placeholder { color: #777; }
.review-input:focus { outline-color: #111; border-color: #111; }
.review-input.invalid-move { border-color: #a32222; background: #fff0ee; color: #721e18; }

.crop-box { background: #eee; }
.crop-selection { border-color: #111; background: rgba(255, 255, 255, 0.12); }
.crop-selection-adjusting { background: rgba(255, 255, 255, 0.08); }
.crop-handle { border-color: #111; border-radius: 1px; background: #fff; }
.crop-size-badge {
  color: #fff;
  background: rgba(17, 17, 17, 0.92);
  border-color: #fff;
  border-radius: 1px;
}
.crop-hint { color: #555; line-height: 1.55; }
.manual-straighten {
  border-color: #d4d4d1;
  border-radius: 2px;
  background: #f7f7f5;
}
.manual-straighten-heading label { color: #111; }
.manual-straighten-heading output {
  color: #111;
  background: #e9e9e7;
  border-radius: 2px;
}
.straighten-angle { accent-color: #111; }
.straighten-range-labels { color: #686868; }

.raw-box { border-color: #d4d4d1; }
.raw-box summary { color: #333; }
.raw-box summary:hover { color: #000; }
.raw-output {
  color: #333;
  background: #f6f6f4;
  border-color: #d4d4d1;
  border-radius: 2px;
}
.footer {
  margin: 24px calc(0px - clamp(18px, 5vw, 76px)) 0;
  padding: 22px clamp(18px, 5vw, 76px) 8px;
  color: #d0d0ce;
  background: #090909;
  text-align: left;
}

::selection { color: #fff; background: #111; }
input, textarea, button { accent-color: #111; }

@media (max-width: 780px) {
  body { padding: 8px; }
  .page { padding: 0 18px 20px; }
  .hero { padding: 54px 0 42px; }
  .feature-strip { margin: 0 -18px 26px; padding: 22px 18px; }
  .feature-item + .feature-item { border-left: 0; }
  .feature-item:nth-child(even) { border-left: 1px solid #444; }
  .feature-item:nth-child(n + 3) { border-top: 1px solid #444; }
  .crop-stage { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .card-scan,
  .card-info,
  .card-moves,
  .card-pgn,
  .card-wide { grid-column: 1; }
  .footer { margin: 22px -18px 0; padding: 20px 18px 8px; }
}

@media (max-width: 560px) {
  .hero { padding: 42px 0 34px; gap: 20px; }
  .hero-desc { font-size: 0.94rem; }
  .hero-deco { gap: 7px; }
  .deco-piece, .deco-1, .deco-2, .deco-3, .deco-4, .deco-5, .deco-6 { font-size: clamp(1.8rem, 10vw, 3rem); }
  .feature-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-item { padding: 14px 8px; }
  .card { padding: 18px; }
}

.scan-method {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .85rem;
  font-weight: 600;
}
.scan-method select {
  color: inherit;
  background: #fff;
  font: inherit;
  padding: .45rem .6rem;
  border: 1px solid #777;
  border-radius: 4px;
}
.board-review {
  display: grid;
  grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1rem, 3vw, 2rem);
  margin: 1rem 0 1.5rem;
}
.review-board {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  border: 1px solid #454545;
  container-type: inline-size;
}
.board-square {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #171717;
  font-family: "DejaVu Sans", "Apple Symbols", "Segoe UI Symbol", sans-serif;
  font-size: 10cqi;
  line-height: 1;
  cursor: pointer;
}
.board-dark { background: #898984; }
.board-light { background: #ecece8; }
.board-square[data-color="w"] {
  color: #fff;
  -webkit-text-stroke: 1px #141414;
}
.board-square[aria-pressed="true"] { box-shadow: inset 0 0 0 3px #146344; }
.board-square:focus-visible { outline: 3px solid #173e8a; outline-offset: -3px; z-index: 1; }
.board-target::after {
  content: "";
  position: absolute;
  inset: 35%;
  border-radius: 50%;
  background: #146344;
  pointer-events: none;
}
.board-target[data-color]:not([data-color=""])::after {
  inset: 5%;
  border: 3px solid #146344;
  background: transparent;
}
.board-status { font-weight: 700; }
.board-controls p { margin: .65rem 0; }
.board-suggestions, .board-promotion:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .75rem;
}
.review-input.unchecked-move { border-style: dashed; }
.review-input.invalid-move { outline: 2px solid #ab3128; outline-offset: -2px; }

@media (max-width: 640px) {
  .board-review { grid-template-columns: minmax(0, 1fr); }
  .review-board { width: min(100%, 24rem); }
}

.board-review.hidden,
.board-review [hidden] {
  display: none;
}
