:root {
  --ink: #1a1414;
  --muted: #6b4545;
  --ivory: #fff8f2;
  --paper: #fffdf8;
  --panel: #ffffff;
  --red: #e21b2c;
  --red-dark: #b51220;
  --red-deep: #8e101b;
  --yellow: #ffd34a;
  --yellow-dark: #8a6500;
  --blue: #1e90ff;
  --blue-dark: #0b62c4;
  --green: #16a34a;
  --green-dark: #0d7a36;
  --charcoal: #1a1414;
  --line: #ffd0cc;
  --line-soft: #ffe2c8;
  --gain: #0d7a36;
  --loss: #b51220;
  --focus: #0b62c4;
  --shadow: 0 16px 40px rgba(226, 27, 44, 0.12);
  --font: "Outfit", "Segoe UI", sans-serif;
  --display: "Newsreader", Georgia, serif;
  --wrap: 1160px;
  --radius: 22px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 211, 74, 0.28), transparent 28%),
    radial-gradient(circle at 96% 40%, rgba(30, 144, 255, 0.14), transparent 26%),
    radial-gradient(circle at 70% 95%, rgba(22, 163, 74, 0.1), transparent 24%),
    var(--ivory);
  line-height: 1.55;
  font-size: 1.05rem;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--blue-dark); }
a:hover { color: var(--red); }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: #fff3a8;
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--red); color: #fff;
  padding: 0.5rem 0.8rem; z-index: 80; border-radius: 999px;
}
.skip-link:focus { top: 0.5rem; color: #fff; }

.wrap { width: min(calc(100% - 2rem), var(--wrap)); margin-inline: auto; }

.legal-banner {
  background: var(--yellow);
  color: var(--charcoal);
  text-align: center;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  line-height: 1.4;
}

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 248, 242, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.2rem;
}
.logo {
  display: flex; align-items: center; gap: 0.7rem;
  text-decoration: none; color: inherit;
}
.logo-mark {
  width: 2.7rem; height: 2.7rem; border-radius: 12px;
  background: var(--yellow);
  overflow: hidden;
  display: block; flex-shrink: 0;
  box-shadow: 4px 4px 0 #1e90ff;
}
.logo-mark img, .logo-mark svg {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { font-family: var(--display); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.03em; color: var(--red); }
.logo-tag { font-size: 0.7rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

.site-nav { display: flex; align-items: center; gap: 1.05rem; }
.site-nav a {
  text-decoration: none; color: var(--ink);
  font-weight: 600; font-size: 0.95rem;
}
.site-nav a:hover { color: var(--red); }
.count-pill {
  display: inline-grid; place-items: center;
  min-width: 1.2rem; height: 1.2rem; padding: 0 0.3rem;
  border-radius: 999px; background: var(--yellow); color: var(--charcoal);
  font-size: 0.7rem; font-weight: 700; vertical-align: 1px;
}
.nav-cta {
  background: var(--red); color: #fff !important;
  padding: 0.5rem 1rem; border-radius: 999px;
  box-shadow: 3px 3px 0 var(--yellow);
}
.nav-cta:hover { background: var(--red-dark); color: #fff !important; }

.nav-toggle {
  display: none; width: 2.6rem; height: 2.6rem;
  border: 2px solid var(--red); background: #fff;
  border-radius: 12px; cursor: pointer;
}
.nav-toggle span {
  display: block; width: 1.1rem; height: 2px;
  background: var(--red); margin: 5px auto;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% -10%, rgba(255, 211, 74, 0.5), transparent 42%),
    radial-gradient(circle at 6% 110%, rgba(30, 144, 255, 0.35), transparent 36%),
    var(--red);
  color: #fff;
  padding: 3.4rem 0 3.8rem;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero::before {
  width: 220px; height: 220px;
  background: var(--yellow);
  right: -60px; top: -70px;
  opacity: 0.45;
}
.hero::after {
  width: 140px; height: 140px;
  background: #7ad0ff;
  left: 12%; bottom: -50px;
  opacity: 0.4;
}
.hero .wrap { position: relative; z-index: 1; }
.hero-grid {
  display: grid; grid-template-columns: 1.25fr 0.75fr;
  gap: 2.5rem; align-items: end;
}
.eyebrow {
  font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 700; color: var(--red); margin: 0 0 0.7rem;
}
.hero .eyebrow { color: var(--yellow); }
h1, h2, h3, .logo-name { letter-spacing: -0.03em; }
h1 {
  font-family: var(--display);
  font-size: clamp(2.3rem, 5.2vw, 3.7rem);
  line-height: 1.06; font-weight: 600; margin: 0 0 1rem;
}
h2 {
  font-family: var(--display);
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  line-height: 1.15; font-weight: 600; margin: 0 0 0.7rem;
}
h3 { font-family: var(--display); font-size: 1.25rem; margin: 0 0 0.35rem; font-weight: 600; }
.lede { color: #fff0c8; font-size: 1.1rem; max-width: 38rem; margin: 0 0 1.4rem; }

.search-box {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  background: #fff; border: 3px solid var(--yellow);
  border-radius: 24px; padding: 0.55rem;
  box-shadow: 6px 6px 0 rgba(26, 20, 20, 0.12);
}
.search-fields { display: flex; flex: 1; gap: 0.5rem; min-width: 16rem; }
.search-box input, .toolbar input, .toolbar select, .form-grid input, .form-grid select {
  font: inherit; color: inherit; border-radius: 14px;
  border: 1px solid transparent; padding: 0.7rem 0.85rem; width: 100%;
}
.search-box input {
  background: #fff8f2; color: var(--ink); border-color: #ffd0cc;
}
.search-box input::placeholder { color: #8a6a6a; }
.source-line { margin: 0.8rem 0 0; color: #fff0c8; font-size: 0.9rem; }
.source-line.live { color: #fff; font-weight: 600; }
.source-line.sample { color: var(--yellow); font-weight: 600; }

.hero-stats {
  background: #fff; color: var(--ink);
  border: 3px solid var(--yellow);
  border-radius: 28px; padding: 1.15rem 1.2rem 1.2rem;
  box-shadow: 8px 8px 0 rgba(26, 20, 20, 0.14);
}
.hero-stats-label {
  margin: 0 0 0.8rem; text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 0.72rem; color: var(--red); font-weight: 700;
}
.hero-stats dl { margin: 0; display: grid; gap: 0.75rem; }
.hero-stats dt { color: var(--muted); font-size: 0.82rem; }
.hero-stats dd {
  margin: 0; font-family: var(--display); font-size: 1.55rem; font-weight: 600;
}
.hero-stats-note { color: var(--muted); font-size: 0.8rem; margin: 1rem 0 0; }
.gain { color: var(--gain) !important; }
.loss { color: var(--loss) !important; }
.ink-gain { color: var(--gain) !important; }
.ink-loss { color: var(--loss) !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer; font: inherit; font-weight: 700;
  text-decoration: none; border-radius: 999px;
  padding: 0.7rem 1.15rem; transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--red); color: #fff; box-shadow: 3px 3px 0 var(--yellow); }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border: 2px solid var(--ink); }
.btn-ghost:hover { background: #fff3a8; color: var(--ink); }
.btn-quiet { background: transparent; color: var(--muted); }
.btn-tiny { padding: 0.35rem 0.75rem; font-size: 0.82rem; box-shadow: none; }

.section { padding: 3.8rem 0; }
.section-alt {
  background:
    radial-gradient(circle at 90% 20%, rgba(30, 144, 255, 0.1), transparent 30%),
    #eef8ff;
}
.section-intro { color: var(--muted); max-width: 40rem; margin: 0; }
.fuzzy-note {
  margin: 0.35rem 0 0;
  max-width: 40rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}
.fuzzy-note[hidden] { display: none; }
.section-head {
  display: flex; justify-content: space-between; gap: 1rem;
  align-items: end; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.section-head .section-intro { margin-top: 0.3rem; }
.section-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.result-meta { color: var(--muted); font-size: 0.9rem; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.ptc-card {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 0.8rem 0.95rem;
  box-shadow: 6px 6px 0 rgba(226, 27, 44, 0.1);
  display: flex; flex-direction: column; gap: 0.55rem;
}
.ptc-card:nth-child(3n) { border-color: #ffd34a; box-shadow: 6px 6px 0 rgba(255, 211, 74, 0.45); }
.ptc-card:nth-child(3n+2) { border-color: #9ad4ff; box-shadow: 6px 6px 0 rgba(30, 144, 255, 0.16); }
.ptc-card button.card-open {
  border: 0; background: none; padding: 0; font: inherit;
  color: inherit; text-align: left; cursor: pointer;
}
.ptc-art {
  aspect-ratio: 63 / 88; border-radius: 16px; overflow: hidden;
  background:
    linear-gradient(180deg, #fff3a8, #ffd0cc);
  display: grid; place-items: center;
}
.ptc-art img { width: 100%; height: 100%; object-fit: cover; }
.ptc-art-missing {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 0.35rem; width: 100%; height: 100%; min-height: 5.5rem;
  padding: 0.6rem; text-align: center; box-sizing: border-box;
  background:
    repeating-linear-gradient(-45deg, rgba(226,27,44,0.06), rgba(226,27,44,0.06) 8px, transparent 8px, transparent 16px);
}
.ptc-art-placeholder {
  font-weight: 700; font-size: 0.86rem; color: var(--ink);
}
.ptc-art-note {
  font-size: 0.72rem; color: var(--muted); line-height: 1.3; max-width: 14rem;
}
.ptc-art-missing-compact {
  min-height: 4.4rem; padding: 0.3rem;
  border-radius: 8px;
  background: #fff3a8;
}
.ptc-art-missing-compact .ptc-art-placeholder { font-size: 0.68rem; }
.col-art .ptc-art-missing, .watch-item .ptc-art-missing { width: 64px; height: 88px; }

.ptc-name { font-weight: 700; margin: 0; line-height: 1.25; }
.ptc-meta, .muted { color: var(--muted); font-size: 0.82rem; margin: 0; }
.ptc-price {
  font-family: var(--display); font-size: 1.45rem; margin: 0.1rem 0 0;
  font-weight: 600; color: var(--red);
}
.ptc-price span { font-family: var(--font); font-size: 0.75rem; font-weight: 500; color: var(--muted); margin-left: 0.25rem; }
.ptc-actions { display: flex; gap: 0.35rem; margin-top: auto; }
.range {
  height: 8px; background: #ffe3e3; border-radius: 99px; position: relative;
  margin: 0.35rem 0 0.15rem;
}
.range i {
  position: absolute; top: 0; bottom: 0; background: #ff9aa2; border-radius: 99px;
}
.range b {
  position: absolute; top: -3px; width: 12px; height: 12px;
  background: var(--red); border-radius: 50%; transform: translateX(-50%);
  box-shadow: 0 0 0 2px #fff;
}
.range-labels { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--muted); }

.badge {
  display: inline-block; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.22rem 0.5rem; border-radius: 999px;
  background: #ffe3e3; color: var(--red-deep);
}
.badge-live { background: #d8f8e5; color: var(--green-dark); }
.badge-sample { background: var(--yellow); color: var(--charcoal); }

.empty, .status-msg {
  background: var(--panel); border: 2px dashed #ffb3b0;
  border-radius: 20px; padding: 1.4rem; color: var(--muted);
}
.status-msg { margin-bottom: 1rem; }

.watch-item, .col-row {
  display: grid; gap: 0.8rem; align-items: center;
  background: var(--panel); border: 2px solid var(--line);
  border-radius: 20px; padding: 0.8rem;
  margin-bottom: 0.65rem;
}
.watch-item {
  grid-template-columns: 64px 1fr auto auto;
}
.watch-item img, .col-art img {
  width: 64px; height: auto; border-radius: 10px;
}
.spark { width: 120px; height: 40px; }
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem; margin-bottom: 1.2rem;
}
.metric {
  background: var(--panel); border: 2px solid var(--line);
  border-radius: 20px; padding: 0.95rem 1rem;
  border-top-width: 6px;
}
.metric:nth-child(1) { border-top-color: var(--red); }
.metric:nth-child(2) { border-top-color: var(--yellow); }
.metric:nth-child(3) { border-top-color: var(--blue); }
.metric:nth-child(4), .metric:nth-child(5) { border-top-color: var(--green); }
.metric dt { color: var(--muted); font-size: 0.8rem; margin: 0 0 0.25rem; }
.metric dd { margin: 0; font-family: var(--display); font-size: 1.45rem; font-weight: 600; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 1rem;
}
.toolbar input, .toolbar select {
  background: var(--panel); border: 2px solid var(--line);
  max-width: 100%; flex: 1; min-width: 10rem;
}

.col-row {
  grid-template-columns: 52px 1.4fr 0.6fr 0.7fr 0.7fr 0.7fr auto;
}
.col-row p { margin: 0; }
.col-head, .col-row { font-size: 0.92rem; }
.col-head {
  display: grid; grid-template-columns: 52px 1.4fr 0.6fr 0.7fr 0.7fr 0.7fr auto;
  gap: 0.8rem; padding: 0 0.75rem 0.4rem;
  color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
}

.set-progress { margin-top: 2rem; }
.set-block { margin-bottom: 0.8rem; }
.set-block header { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.92rem; }
.bar { height: 10px; background: #ffe3e3; border-radius: 99px; overflow: hidden; margin-top: 0.35rem; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--yellow)); border-radius: 99px; }


.site-footer {
  background: var(--red);
  color: #fff0c8;
  padding: 2.5rem 0 1.3rem;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute; width: 180px; height: 180px; border-radius: 50%;
  background: var(--yellow); opacity: 0.25; right: -40px; top: -50px;
}
.footer-grid {
  position: relative;
  display: grid; grid-template-columns: 1.3fr 1fr 1fr;
  gap: 1.5rem; margin-bottom: 1.5rem;
}
.site-footer .logo-name { color: #fff; }
.footer-label {
  text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.72rem; font-weight: 700; color: var(--yellow); margin: 0 0 0.4rem;
}
.site-footer a { color: #fff; }
.footer-base {
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, 0.28); padding-top: 1rem; font-size: 0.86rem;
}

.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(26, 20, 20, 0.45);
  z-index: 60;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 100%);
  background: var(--ivory); z-index: 70;
  overflow: auto; padding: 1.2rem 1.2rem 2rem;
  box-shadow: -12px 0 40px rgba(226, 27, 44, 0.16);
  border-left: 6px solid var(--yellow);
}
.drawer-art { width: 180px; margin: 0 auto 1rem; border-radius: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.25rem; }
.form-grid input, .form-grid select, .form-grid textarea {
  background: var(--panel); border: 2px solid var(--line);
}
.form-grid textarea {
  font: inherit; color: inherit; border-radius: 14px;
  padding: 0.7rem 0.85rem; width: 100%; resize: vertical; min-height: 5.5rem;
}
.optional { font-weight: 500; color: var(--muted); font-size: 0.82em; }
.form-hint { margin: 0.7rem 0 0.55rem; color: var(--muted); font-size: 0.88rem; }
.form-status {
  margin: 0.8rem 0 0; padding: 0.7rem 0.85rem;
  border-radius: 14px; font-weight: 600; font-size: 0.92rem;
}
.form-status[hidden] { display: none; }
.form-status.is-ok { background: #d8f8e5; color: var(--green-dark); }
.form-status.is-err { background: #ffe3e3; color: var(--red-deep); }
.hp-field {
  position: absolute; left: -10000px; width: 1px; height: 1px;
  overflow: hidden;
}
.chart-wrap {
  background: #fff; border: 2px solid var(--line);
  border-radius: 18px; padding: 0.8rem; margin: 0.8rem 0;
}
.chart-caption { color: var(--muted); font-size: 0.78rem; margin: 0.4rem 0 0; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1rem; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none; position: absolute;
    top: calc(2.4rem + 4.2rem); left: 0; right: 0;
    background: #fff; border-bottom: 2px solid var(--line);
    flex-direction: column; align-items: stretch;
    padding: 0.8rem 1rem 1rem; gap: 0.4rem;
  }
  .site-nav.open { display: flex; }
  .hero-grid, .footer-grid, .metrics, .form-grid,
  .watch-item, .col-row, .col-head { grid-template-columns: 1fr; }
  .col-head { display: none; }
  .spark { width: 100%; }
  .watch-item img { width: 72px; }
}
@media (max-width: 560px) {
  .search-fields { flex-direction: column; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.search-fields-wide {
  display: grid;
  grid-template-columns: minmax(10rem, 1.5fr) minmax(7rem, 0.8fr) minmax(11rem, 1.3fr);
  gap: 0.5rem;
  flex: 1;
  min-width: 16rem;
  width: 100%;
}
.search-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(7.5rem, 1fr));
  gap: 0.5rem;
  width: 100%;
}
.filter-field { display: grid; gap: 0.18rem; min-width: 0; }
.filter-field label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.filter-hint {
  margin: 0.15rem 0 0;
  width: 100%;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.filter-hint[hidden] { display: none; }
.filter-clear {
  appearance: none;
  border: 0;
  background: none;
  color: var(--red-deep);
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.35rem 0.15rem;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.filter-clear:hover { color: var(--red); }
.search-box select {
  font: inherit;
  color: var(--ink);
  background: #fff8f2;
  border: 1px solid #ffd0cc;
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  width: 100%;
}
.pager {
  display: flex;
  justify-content: center;
  margin-top: 1.4rem;
}
.btn-lore {
  background: #e8f4ff;
  color: var(--blue-dark);
  border: 2px solid var(--blue);
  font-weight: 700;
}
.btn-lore:hover { background: #d6ecff; color: var(--blue-dark); }

.lore-modal {
  position: fixed;
  top: 4vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(920px, calc(100% - 1.5rem));
  max-height: 92vh;
  overflow: auto;
  background: var(--ivory);
  z-index: 80;
  border-radius: 24px;
  border: 4px solid var(--yellow);
  box-shadow: 10px 10px 0 rgba(226, 27, 44, 0.16);
  padding: 1.2rem 1.2rem 1.6rem;
}
.lore-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 0.8rem;
}
.evo-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: stretch;
  justify-content: center;
  margin: 0.4rem 0 1rem;
}
.evo-line > .evo-stage { flex: 1 1 220px; max-width: 260px; }
.evo-arrow {
  align-self: center;
  font-size: 1.6rem;
  color: var(--red);
  font-weight: 700;
}
.evo-branches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
}
.evo-stage {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 0.8rem;
  width: min(240px, 100%);
  box-shadow: 4px 4px 0 rgba(30, 144, 255, 0.12);
}
.evo-stage img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  margin: 0 auto 0.4rem;
}
.evo-stage h3 { text-align: center; }
.evo-genus {
  text-align: center;
  color: var(--red);
  font-weight: 700;
  font-size: 0.88rem;
  margin: 0 0 0.5rem;
}
.evo-entry {
  font-size: 0.86rem;
  color: var(--ink);
  margin: 0 0 0.45rem;
  background: #fff8f2;
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
}
.evo-entry small { display: block; color: var(--muted); font-size: 0.72rem; }
.lore-status { text-align: center; padding: 1.5rem; color: var(--muted); }

@media (max-width: 900px) {
  .search-fields-wide { grid-template-columns: 1fr; }
  .search-filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .search-filters { grid-template-columns: 1fr; }
}

/* Translate */
.search-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.btn-scan {
  background: var(--green);
  color: #fff;
  box-shadow: 3px 3px 0 var(--yellow);
}
.btn-scan:hover { background: var(--green-dark); color: #fff; }

.translate-toggle {
  flex-shrink: 0;
  border: 2px solid var(--blue);
  background: #fff;
  color: var(--blue-dark);
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  margin-left: auto;
}
.translate-toggle:hover { background: #e8f4ff; }
.translate-toggle[aria-pressed="true"] {
  background: var(--blue);
  color: #fff;
  box-shadow: 3px 3px 0 var(--yellow);
}

.i18n-block { display: block; }
.i18n-en {
  display: block;
  font-size: 0.82em;
  color: var(--blue-dark);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 0.15rem;
}
.ptc-name .i18n-en { font-size: 0.78em; font-weight: 700; }

.i18n-inline { display: inline; }
.i18n-inline .i18n-en {
  display: inline;
  margin: 0 0 0 0.25em;
  font-size: 0.92em;
}
.i18n-inline .i18n-en::before { content: "("; }
.i18n-inline .i18n-en::after { content: ")"; }
.i18n-mt {
  display: block;
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.68em;
  font-weight: 500;
}
.i18n-inline .i18n-mt { display: none; }
.card-text { margin: 0.8rem 0 1rem; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 0.8rem; }
.card-text h3 { margin-top: 0; }
.card-text p, .card-text dt, .card-text dd { font-size: 0.9rem; }
.card-text dt { font-weight: 700; margin-top: 0.45rem; }
.card-text dd { margin: 0.15rem 0 0; }

@media (max-width: 800px) {
  .translate-toggle { font-size: 0.72rem; padding: 0.35rem 0.55rem; max-width: 9.5rem; line-height: 1.2; }
}


.bottom-nav { display: none; }
@media (max-width: 900px) {
  body { padding-bottom: 4.8rem; }
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    background: #fff8f2;
    border-top: 3px solid var(--red);
    box-shadow: 0 -6px 20px rgba(226, 27, 44, 0.12);
    padding: 0.25rem 0.3rem calc(0.3rem + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button {
    appearance: none; background: transparent; border: 0;
    font: inherit; font-weight: 700; font-size: 0.78rem;
    color: var(--ink); text-decoration: none; text-align: center;
    padding: 0.7rem 0.2rem; border-radius: 12px; cursor: pointer;
  }
  .bottom-nav a:hover, .bottom-nav button:hover,
  .bottom-nav a.is-active, .bottom-nav button.is-active {
    color: var(--red); background: #ffe4e1;
  }
}

.footer-credits { position: relative; padding: 1.1rem 0 0.4rem; }
.footer-credits ul { margin: 0.35rem 0 0; padding-left: 1.15rem; }
.footer-credits li { margin: 0 0 0.45rem; font-size: 0.86rem; color: #fff8f2; }
.footer-credits a { color: var(--yellow); }
.footer-base p { max-width: 62rem; }

.footer-submit, .footer-contact {
  position: relative;
  background: var(--ivory);
  color: var(--ink);
  border: 3px solid var(--yellow);
  border-radius: 24px;
  padding: 1.15rem 1.25rem 1.25rem;
  box-shadow: 6px 6px 0 rgba(26, 20, 20, 0.18);
}
.footer-submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 1.2rem auto 0;
}
.footer-submit p {
  margin: 0;
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--ink);
}
.footer-contact { margin: 1rem auto 1.4rem; }
.footer-contact .footer-label { color: var(--red); }
.footer-contact h2 {
  margin: 0 0 0.4rem;
  color: var(--red);
  font-family: var(--display);
}
.footer-contact p { margin: 0 0 0.7rem; }
.contact-email-placeholder {
  display: inline-block;
  font-weight: 700;
  background: #fff3a8;
  color: var(--charcoal);
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  margin: 0 0 0.9rem;
}
.footer-contact .form-grid input,
.footer-contact .form-grid textarea {
  background: #fff;
}

.submit-modal {
  position: fixed;
  top: 3vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 1.5rem));
  max-height: 94vh;
  overflow: auto;
  background: var(--ivory);
  z-index: 85;
  border-radius: 24px;
  border: 4px solid var(--yellow);
  box-shadow: 10px 10px 0 rgba(226, 27, 44, 0.16);
  padding: 1.2rem 1.2rem 1.6rem;
}
.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 11rem;
  margin: 0.4rem 0 0.2rem;
  background: #fff;
  border: 3px dashed var(--red);
  border-radius: 20px;
  cursor: pointer;
  text-align: center;
  padding: 1rem;
  color: var(--ink);
}
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.is-over {
  background: #fff3a8;
  border-style: solid;
}
.drop-zone-copy { display: grid; gap: 0.2rem; pointer-events: none; }
.drop-zone-copy strong { font-size: 1.05rem; }
.drop-zone-copy span { color: var(--muted); font-size: 0.9rem; }
.drop-zone-hint { font-size: 0.8rem !important; }
.drop-zone.has-file .drop-zone-copy { display: none; }
.drop-zone img {
  max-height: 14rem;
  width: auto;
  max-width: 100%;
  border-radius: 12px;
  margin: 0 auto;
}
@media (max-width: 560px) {
  .footer-submit { justify-content: center; text-align: center; }
  .submit-modal { top: 1vh; max-height: 98vh; width: calc(100% - 0.8rem); }
}

.footer-privacy {
  position: relative;
  margin: 0 auto 1.2rem;
  padding-top: 0.4rem;
}
.footer-privacy .footer-label { margin-bottom: 0.35rem; }
.footer-privacy p { margin: 0; font-size: 0.86rem; color: #fff8f2; max-width: 62rem; }

.account-chip {
  position: relative;
  flex-shrink: 0;
  margin-left: 0.25rem;
}
.account-menu-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 2px solid var(--red);
  background: #fff;
  color: var(--red-deep);
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  border-radius: 999px;
  padding: 0.2rem 0.45rem 0.2rem 0.2rem;
  min-height: 2.45rem;
  cursor: pointer;
}
.account-menu-btn:hover,
.account-menu-btn[aria-expanded="true"] { background: #ffe4e1; }
.account-avatar {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 2px 2px 0 var(--yellow);
  flex-shrink: 0;
}
.account-label {
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 0.95rem;
  margin-right: 0.1rem;
  flex-shrink: 0;
}
.account-burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--red);
  border-radius: 1px;
}
.account-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  background: #fff;
  border: 2px solid var(--red);
  border-radius: 16px;
  box-shadow: 4px 4px 0 var(--yellow);
  min-width: 12.5rem;
  padding: 0.3rem;
  z-index: 55;
  display: grid;
}
.account-menu[hidden] { display: none; }
.account-menu-heading {
  display: none;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.4rem 0.7rem 0.25rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-menu [role="menuitem"] {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
  width: 100%;
}
.account-menu [role="menuitem"]:hover,
.account-menu [role="menuitem"]:focus-visible {
  background: #fff3a8;
  outline: none;
}

.welcome-modal, .auth-modal {
  position: fixed;
  top: 6vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 1.5rem));
  max-height: 90vh;
  overflow: auto;
  background: var(--ivory);
  z-index: 90;
  border-radius: 24px;
  border: 4px solid var(--yellow);
  box-shadow: 10px 10px 0 rgba(226, 27, 44, 0.16);
  padding: 1.2rem 1.2rem 1.4rem;
}
.welcome-modal h2, .auth-modal h2 { margin: 0 0 0.4rem; }
.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0.6rem;
}
.auth-notes, .auth-switch { color: var(--muted); font-size: 0.86rem; margin: 0.8rem 0 0; }
.auth-switch button {
  appearance: none; border: 0; background: none; color: var(--blue-dark);
  font: inherit; font-weight: 700; cursor: pointer; padding: 0;
}
.auth-panel[hidden] { display: none; }
.settings-block {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 2px solid var(--line);
}
.settings-block h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.settings-danger { border-top-color: #ffb3b0; }
.check-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.check-label input { width: auto; }

@media (max-width: 900px) {
  .account-label { display: none; }
  .account-menu-heading { display: block; }
}
@media (max-width: 560px) {
  .welcome-modal, .auth-modal { top: 2vh; max-height: 96vh; width: calc(100% - 0.8rem); }
  .welcome-actions { flex-direction: column; }
  .welcome-actions .btn { width: 100%; }
}

.support-band {
  background: #fff4d6;
  border-bottom: 2px solid var(--line);
  padding: 0.5rem 0;
}
.support-band[hidden] { display: none; }
.support-band-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 1rem;
}
.support-band-inner > p {
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}
.support-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem 0.7rem; }
.support-band .btn-primary { padding: 0.38rem 0.9rem; font-size: 0.88rem; }
.support-note { margin: 0; font-weight: 500; font-size: 0.8rem; color: var(--muted); }
@media (max-width: 560px) {
  .support-band { padding: 0.65rem 0; }
  .support-band-inner { text-align: center; }
  .support-actions { justify-content: center; }
}


@keyframes setbound-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html.js-anim .reveal {
  opacity: 0;
  transform: translateY(14px);
}

html.js-anim .reveal.is-in {
  animation: setbound-fade-up 550ms ease-out both;
  animation-delay: var(--reveal-delay, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  html.js-anim .reveal,
  html.js-anim .reveal.is-in {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
