/* Shelf Reset — interface styles
   Zero external resources: system font stack, no imports, no web fonts. */

:root {
  --bg: #070707;
  --surface: #101010;
  --field: #0C0C0C;
  --text: #F2F2F0;
  --muted: #A7A7A3;
  --line: #262626;
  --accent: #C9CDD2;

  --danger: #E06C5A;
  --warn: #D8A94A;
  --ok: #79B98A;

  --radius: 8px;
  --control-h: 48px;
  --form-w: 760px;
  --result-w: 1040px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
          "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--result-w);
  margin: 0 auto;
  padding: 0 24px;
}
.wrap-form { max-width: var(--form-w); padding-top: 8px; padding-bottom: 64px; }
.wrap-result { padding-top: 8px; padding-bottom: 72px; }

/* ---------------- header / footer ---------------- */

.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  max-width: var(--result-w);
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { display: block; }
.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.brand-tag {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-foot {
  border-top: 1px solid var(--line);
  padding: 22px 0;
  margin-top: 8px;
}
.site-foot p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* ---------------- typography ---------------- */

h1 {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
h2 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }

.intro { padding: 40px 0 28px; }

.lede {
  margin: 0 0 6px;
  font-size: 19px;
  color: var(--text);
}
.trust {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.card-sub {
  margin: 6px 0 18px;
  color: var(--muted);
  font-size: 14px;
}
.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

/* ---------------- cards ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
}
.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--field);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
}
.opt { color: var(--muted); font-weight: 400; font-size: 13px; }

/* ---------------- form controls ---------------- */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}
.field { display: flex; flex-direction: column; }
.field-wide { grid-column: 1 / -1; }

label {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
}

input[type="number"],
input[type="text"] {
  height: var(--control-h);
  width: 100%;
  padding: 0 14px;
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder { color: #6B6B68; }
input[type="number"]:hover,
input[type="text"]:hover { border-color: #333; }
input[type="number"]:focus-visible,
input[type="text"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 205, 210, 0.14);
}
/* keep spin buttons from looking like default chrome */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--control-h);
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 205, 210, 0.18);
}
.btn-primary {
  background: #FFFFFF;
  color: #0A0A0A;
  border-color: #FFFFFF;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost { color: var(--text); }
.btn-ghost:hover { border-color: #3A3A3A; background: #141414; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: default; }

.submit-row { margin: 4px 0 0; }

/* ---------------- dropzone ---------------- */

.dropzone {
  border: 1px dashed #3A3A3A;
  border-radius: var(--radius);
  background: var(--field);
  padding: 26px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover { border-color: #4A4A4A; }
.dropzone:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 205, 210, 0.14);
}
.dropzone.is-dragover {
  border-color: var(--accent);
  background: #131313;
}
.drop-line { margin: 0; font-size: 15px; }
.drop-or { margin: 6px 0 12px; color: var(--muted); font-size: 13px; }
.drop-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.file-status {
  margin: 16px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}
.file-status.is-set { color: var(--text); }

/* ---------------- error ---------------- */

.error {
  display: none;
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid #3A2A28;
  border-radius: var(--radius);
  background: #16100F;
  color: var(--danger);
  font-size: 14px;
  line-height: 1.45;
}
.error.is-shown { display: block; }
.error.is-warn { border-color: #3A3323; background: #151207; color: var(--warn); }

/* ---------------- upsell ---------------- */

.upsell {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.upsell-title { margin: 0 0 6px; font-size: 15px; }
.upsell-copy {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13.5px;
}
.unlock-note {
  margin: 12px 0 0;
  color: var(--ok);
  font-size: 13.5px;
}

/* ---------------- result ---------------- */

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 40px 0 24px;
}
.result-head-text { min-width: 0; }
.result-head .lede { color: var(--muted); font-size: 15px; }

/* shelf map */
.shelf-map {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.shelf-level {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 560px;
}
.shelf-tag {
  flex: 0 0 92px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px;
  color: var(--muted);
}
.shelf-tag strong { color: var(--text); font-size: 13px; }
.shelf-tag .band {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.shelf-row {
  flex: 1 1 auto;
  display: flex;
  gap: 3px;
  min-height: 44px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
}
.shelf-slot {
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 6px;
  border-radius: 4px;
  background: #1B1B1B;
  border: 1px solid #2E2E2E;
  color: var(--text);
  font-size: 11.5px;
  line-height: 1.25;
  overflow: hidden;
}
.shelf-slot .slot-sku {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shelf-slot .slot-fac { color: var(--muted); white-space: nowrap; }
.shelf-slot.is-eye { background: #202124; border-color: #3A3D42; }
.shelf-empty {
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: 0;
  min-width: 0;
  border: 1px dashed #333;
  border-radius: 4px;
}
.shelf-legend {
  display: flex;
  gap: 18px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-swatch {
  width: 18px;
  height: 12px;
  border-radius: 3px;
  background: #1B1B1B;
  border: 1px solid #2E2E2E;
}
.legend-swatch-empty { background: transparent; border: 1px dashed #333; }

/* reset sheet table */
.table-wrap { overflow-x: auto; }
.reset-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.reset-table th,
.reset-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.reset-table th {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.reset-table td.name-cell { white-space: normal; min-width: 160px; }
.reset-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.reset-table tbody tr:last-child td { border-bottom: none; }
.reset-table tbody tr.level-start td { border-top: 2px solid #303030; }
.reset-table tbody tr.level-start:first-child td { border-top: none; }

/* notes */
.notes-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
}
.notes-list li { margin-bottom: 6px; }
.notes-list li:last-child { margin-bottom: 0; }

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ---------------- utilities ---------------- */

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

/* ---------------- responsive ---------------- */

@media (max-width: 640px) {
  h1 { font-size: 28px; }
  .lede { font-size: 17px; }
  .grid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .result-head { flex-direction: column; }
  .wrap { padding: 0 16px; }
}

/* ---------------- print ---------------- */

@media print {
  :root {
    --bg: #FFFFFF;
    --surface: #FFFFFF;
    --field: #FFFFFF;
    --text: #000000;
    --muted: #444444;
    --line: #BBBBBB;
    --accent: #555555;
  }
  body {
    background: #FFFFFF;
    color: #000000;
    font-size: 12px;
  }
  .site-head,
  .site-foot,
  #view-input,
  .result-actions,
  #new-file-btn,
  .shelf-legend { display: none !important; }
  .wrap-result { max-width: none; padding: 0; }
  .result-head { padding: 0 0 12px; }
  .card {
    border: 1px solid #BBBBBB;
    background: #FFFFFF;
    page-break-inside: avoid;
    break-inside: avoid;
    padding: 12px;
    margin-bottom: 12px;
  }
  .card-sub { display: none; }
  .shelf-level { min-width: 0; }
  .shelf-row { border-color: #999999; background: #FFFFFF; }
  .shelf-slot {
    background: #FFFFFF;
    border: 1px solid #999999;
    color: #000000;
  }
  .shelf-slot.is-eye { background: #F0F0F0; border-color: #666666; }
  .shelf-slot .slot-fac { color: #333333; }
  .shelf-empty { border-color: #AAAAAA; }
  .shelf-tag .band { color: #333333; }
  .reset-table th,
  .reset-table td { border-color: #BBBBBB; color: #000000; }
  .reset-table th { color: #333333; }
  .notes-list { color: #222222; }
  .card { box-shadow: none; }
}
