/* /codes/ hub + Mark as Found tracker. Matches the LeonidaTake dark theme. */

.codes-hub { margin: 0 0 2.2rem; }
.codes-hub .lede { max-width: 44rem; }
.codes-hub .updated {
  color: var(--muted);
  margin: -.35rem 0 1.15rem;
  font-size: .95rem;
}
.codes-hub .intro { max-width: 44rem; }
.codes-hub .intro p { margin: 0 0 .85rem; line-height: 1.6; }
.codes-hub .intro a,
.codes-hub .faq a,
.found-hint a,
.codes-callout a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: .12em;
}

/* Progress */
.found-progress {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  margin: 0 0 1.4rem;
  padding: .95rem 1rem .9rem;
}
.found-progress-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem 1rem;
  margin-bottom: .65rem;
}
.found-count {
  margin: 0;
  font-weight: 700;
  letter-spacing: .01em;
}
.found-progress [data-found-reset] {
  cursor: pointer;
}
.found-bar {
  background: #ffffff14;
  border: 1px solid var(--line);
  border-radius: 999px;
  height: .7rem;
  overflow: hidden;
}
.found-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--pink), var(--orange));
  border-radius: inherit;
  transition: width .25s ease;
}

/* Region jump nav */
.codes-jump {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .45rem;
  margin: 0 0 1.4rem;
  padding: 0;
  list-style: none;
}
.codes-jump a {
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  background: #ffffff0a;
  border-radius: 999px;
  padding: .28rem .8rem;
  font-size: .9rem;
  font-weight: 700;
  min-height: 2.2rem;
  display: inline-flex;
  align-items: center;
}
.codes-jump a:hover,
.codes-jump a:focus-visible {
  border-color: #ffffff55;
  outline: none;
}

/* Region blocks + tables */
.codes-region {
  margin: 0 0 1.75rem;
}
.codes-region h2 {
  margin: 0 0 .65rem;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  line-height: .95;
}
.codes-region h2 span {
  color: var(--muted);
  font-family: Inter, Segoe UI, system-ui, sans-serif;
  font-size: 1rem;
  letter-spacing: 0;
  font-weight: 700;
  margin-left: .35rem;
}

.codes-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
}
.codes-table th,
.codes-table td {
  text-align: left;
  vertical-align: middle;
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--line);
}
.codes-table th {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #ffffff08;
}
.codes-table tr:last-child td { border-bottom: 0; }
.codes-table tr.is-found td { background: #2ef2d210; }
.codes-table .col-found { width: 4.2rem; text-align: center; }
.codes-table .col-code { width: 28%; }

.codes-name {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.25;
}
.codes-name:hover span,
.codes-name:focus-visible span {
  text-decoration: underline;
  text-underline-offset: .12em;
}
.codes-name img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: .55rem;
  background: #120816;
  flex: none;
}
.codes-loc { color: var(--muted); font-size: .95rem; line-height: 1.4; }
.codes-code {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.4;
}
.codes-label {
  display: inline-block;
  margin: .25rem .3rem 0 0;
  border: 1px solid #ffe14a73;
  color: var(--yellow);
  background: #120816;
  border-radius: .4rem;
  padding: .05rem .45rem;
  font-size: .78rem;
  font-weight: 700;
}

/* Checkboxes */
.found-toggle {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 2.75rem;
  min-width: 2.75rem;
  cursor: pointer;
  margin: 0;
  justify-content: center;
}
.found-toggle input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--teal);
  cursor: pointer;
}

/* Entry-page box */
.found-box {
  margin: .7rem 0 0;
  padding: .15rem 0 0;
}
.found-box .found-toggle { justify-content: flex-start; }
.found-box .found-label { font-weight: 700; }
.found-hint {
  color: var(--muted);
  margin: .1rem 0 0;
  font-size: .88rem;
}
.found-box.is-found .found-label { color: var(--teal); }

/* Callout on /lock-codes/ */
.codes-callout {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: .9rem;
  margin: 0 0 1.15rem;
  padding: .85rem 1rem;
  max-width: 44rem;
}
.codes-callout p { margin: 0; line-height: 1.5; }

/* FAQ */
.codes-faq { max-width: 44rem; margin: 1.6rem 0 1.2rem; }
.codes-faq h2 {
  margin: 0 0 .4rem;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
}
.codes-faq details { border-bottom: 1px solid var(--line); padding: .7rem 0; }
.codes-faq summary {
  cursor: pointer;
  font-weight: 700;
  list-style: disclosure-closed;
}
.codes-faq details[open] summary { list-style: disclosure-open; }
.codes-faq details p { margin: .45rem 0 0; line-height: 1.6; color: var(--text); }

/* Mobile stacked table */
@media (max-width: 720px) {
  .codes-table thead { display: none; }
  .codes-table,
  .codes-table tbody,
  .codes-table tr,
  .codes-table td {
    display: block;
    width: 100%;
  }
  .codes-table { border: 0; background: transparent; overflow: visible; }
  .codes-table tr {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 1rem;
    margin: 0 0 .65rem;
    padding: .7rem .8rem .75rem;
    overflow: hidden;
  }
  .codes-table tr.is-found { background: #2ef2d214; }
  .codes-table td {
    border: 0;
    padding: .15rem 0;
  }
  .codes-table .col-found {
    width: auto;
    text-align: left;
    float: right;
    padding: 0;
  }
  .codes-table .col-found .found-toggle { min-width: auto; }
  .codes-name { padding-right: 4.5rem; }
  .codes-table .col-code { margin-top: .25rem; }
}

/* Phase 2: collections, regions, submit, patch tracker, region filter links */

.filters a[data-region]{
  border:1px solid var(--line);
  min-height:2.4rem;
  color:var(--text);
  font:inherit;
  cursor:pointer;
  white-space:nowrap;
  background:#ffffff0a;
  border-radius:999px;
  flex:none;
  padding:.3rem .85rem;
  font-weight:700;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
}
.filters a[data-region][aria-current="page"],
.filters a[data-region].is-selected,
.filters a[data-region][aria-pressed="true"]{
  background:linear-gradient(90deg, var(--pink), var(--orange));
  color:#fff;
  border-color:#0000;
}

.vault-index{margin:0 0 2rem}
.vault-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(16.5rem, 1fr));
  gap:1rem;
  margin:1rem 0 1.5rem;
}
.vault-card{
  display:flex;
  flex-direction:column;
  color:inherit;
  text-decoration:none;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:1rem;
  overflow:hidden;
  min-height:100%;
}
.vault-card:hover,.vault-card:focus-visible{
  border-color:#ffffff55;
  outline:none;
}
.vault-card img{
  width:100%;
  aspect-ratio:16/9;
  object-fit:cover;
  background:#120816;
  display:block;
}
.vault-card-body{padding:.85rem 1rem 1rem}
.vault-card strong{
  display:block;
  font-size:1.15rem;
  line-height:1.25;
  margin:0 0 .35rem;
}
.vault-card p{margin:0;color:var(--muted);font-size:.95rem;line-height:1.45}

.entry-list-plain{list-style:none;margin:0 0 1.5rem;padding:0}
.entry-list-plain li{margin:0 0 .65rem}
.vault-row{
  display:flex;
  gap:.85rem;
  align-items:center;
  color:inherit;
  text-decoration:none;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:1rem;
  padding:.65rem .8rem;
}
.vault-row:hover,.vault-row:focus-visible{border-color:#ffffff55;outline:none}
.vault-row img{
  width:72px;height:72px;object-fit:cover;border-radius:.55rem;flex:none;background:#120816;
}
.vault-row .row-copy{flex:1;min-width:0}
.vault-row strong{display:block;line-height:1.25}
.vault-row .meta{color:var(--muted);font-size:.92rem;line-height:1.4}

.patch-table{width:100%;border-collapse:collapse;background:var(--panel);border:1px solid var(--line);border-radius:1rem;overflow:hidden;margin:0 0 1.5rem}
.patch-table th,.patch-table td{text-align:left;vertical-align:top;padding:.75rem .9rem;border-bottom:1px solid var(--line)}
.patch-table th{color:var(--muted);font-size:.82rem;letter-spacing:.04em;text-transform:uppercase;background:#ffffff08}
.patch-table tr:last-child td{border-bottom:0}
.patch-empty{background:var(--panel);border:1px dashed var(--line);border-radius:1rem;padding:1rem}

.submit-form{max-width:40rem;margin:0 0 2rem}
.submit-form label{display:block;font-weight:700;margin:0 0 .3rem}
.submit-form .field{margin:0 0 1rem}
.submit-form input,.submit-form select,.submit-form textarea{
  width:100%;
  box-sizing:border-box;
  font:inherit;
  color:var(--text);
  background:#120816;
  border:1px solid var(--line);
  border-radius:.6rem;
  padding:.65rem .75rem;
}
.submit-form textarea{min-height:8rem;resize:vertical}
.submit-form .hint{color:var(--muted);margin:.3rem 0 0;font-size:.88rem;font-weight:400}
.submit-form .actions{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;margin:1rem 0}
.submit-status{color:var(--muted);min-height:1.4em}

.known-so-far{color:var(--muted);margin:.2rem 0 1rem;font-weight:700}
.collection-guide{margin:0 0 1.2rem}

@media (max-width:720px){
  .vault-row img{width:64px;height:64px}
  .patch-table thead{display:none}
  .patch-table,.patch-table tbody,.patch-table tr,.patch-table td{display:block;width:100%}
  .patch-table tr{border-bottom:1px solid var(--line);padding:.4rem 0}
  .patch-table td{border:0;padding:.2rem .9rem}
  .patch-table td::before{content:attr(data-label);display:block;color:var(--muted);font-size:.75rem;letter-spacing:.04em;text-transform:uppercase;margin-bottom:.15rem}
}
