

:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-elev: #ffffff;
  --line: #ececec;
  --line-strong: #d8d8d8;
  --text: #0e0e0f;
  --text-mute: #6b6b71;
  --text-faint: #9a9aa1;
  --accent: #0e0e0f;
  --accent-soft: #f3f3f4;
  --ok: #1f8a4a;
  --warn: #b86a00;
  --bad: #c4302b;
  --ring: 0 0 0 3px rgba(0,0,0,.08);
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15,15,17,.04), 0 1px 1px rgba(15,15,17,.03);
  --shadow-md: 0 8px 24px rgba(15,15,17,.06), 0 2px 6px rgba(15,15,17,.04);
  --shadow-lg: 0 24px 48px rgba(15,15,17,.10), 0 4px 14px rgba(15,15,17,.05);
  --t-fast: 160ms cubic-bezier(.4,.0,.2,1);
  --t: 260ms cubic-bezier(.4,.0,.2,1);
  --t-slow: 480ms cubic-bezier(.4,.0,.2,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: 'Josefin Sans', system-ui, sans-serif;
  font-weight: 400;
  font-feature-settings: "ss01", "ss02";
  letter-spacing: .005em;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; height: auto; display: block; }
em { font-style: normal; font-weight: 600; border-bottom: 2px solid var(--text); padding-bottom: 1px; }

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-weight: 600; letter-spacing: .04em; font-size: 18px; }
.brand-tag {
  font-size: 11px; letter-spacing: .35em; text-transform: uppercase;
  color: var(--text-mute);
}
.site-nav { display: flex; gap: 22px; }
.nav-link {
  color: var(--text-mute); font-size: 14px; letter-spacing: .04em;
  transition: color var(--t-fast);
}
.nav-link:hover { color: var(--text); }
@media (max-width: 640px) { .site-nav { display: none; } }

/* ============ Layout ============ */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px 22px 64px; flex: 1; }

.hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  margin: 24px auto 28px;
}
.hero-title {
  font-weight: 300; font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -.005em; line-height: 1.15;
  max-width: 720px; margin: 8px 0 12px;
}
.hero-sub {
  color: var(--text-mute); max-width: 580px; font-size: 16px;
  margin: 0 0 28px;
}

/* ============ Dropzone ============ */
.dropzone {
  position: relative;
  width: 100%; max-width: 640px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  padding: 44px 32px 36px;
  cursor: pointer;
  transition: border-color var(--t), background var(--t), transform var(--t), box-shadow var(--t);
  outline: none;
}
.dropzone:hover { border-color: var(--text); background: var(--bg-soft); }
.dropzone:focus-visible { box-shadow: var(--ring); }
.dropzone.drag-over {
  border-color: var(--text); background: var(--bg-soft);
  transform: scale(1.005);
  box-shadow: var(--shadow-md);
}

.drop-content {
  display: flex; flex-direction: column; align-items: center;
  gap: 18px;
  width: 100%;
}
.drop-illustration {
  width: 64px; height: 64px; display: grid; place-items: center;
  border-radius: 18px; border: 1px solid var(--line); background: var(--bg-soft);
  margin-bottom: 2px;
  transition: transform var(--t), border-color var(--t);
}
.dropzone:hover .drop-illustration,
.dropzone.drag-over .drop-illustration { transform: translateY(-2px); border-color: var(--line-strong); }
.drop-illustration svg { width: 28px; height: 28px; stroke-width: 1.5; color: var(--text); }

.drop-text { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.drop-title { font-size: 18px; margin: 0; font-weight: 500; letter-spacing: .005em; }
.drop-sub { font-size: 13px; color: var(--text-mute); margin: 0; letter-spacing: .03em; }

.drop-divider {
  display: flex; align-items: center; gap: 12px;
  width: 100%; max-width: 280px;
  color: var(--text-faint); font-size: 11px; letter-spacing: .3em; text-transform: uppercase;
  margin: 2px 0;
}
.drop-divider::before, .drop-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.drop-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  justify-content: center;
  width: 100%; max-width: 380px;
}
.drop-actions .btn { flex: 1 1 140px; justify-content: center; }

.url-row {
  display: flex; align-items: center; gap: 8px;
  width: 100%; max-width: 480px;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--bg);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.url-row:focus-within { border-color: var(--text); box-shadow: var(--ring); }
.url-row-icon {
  display: grid; place-items: center;
  width: 18px; height: 18px;
  color: var(--text-mute);
  margin-left: 8px;
  flex-shrink: 0;
}
.url-row-icon svg { width: 16px; height: 16px; stroke-width: 1.8; }
.url-row input {
  flex: 1; min-width: 0;
  font-family: inherit; font-size: 14px;
  padding: 9px 4px;
  border: 0; background: transparent;
  color: var(--text); outline: none;
}
.url-row input::placeholder { color: var(--text-faint); }
.url-row .btn { flex-shrink: 0; padding: 8px 16px; }

@media (max-width: 480px) {
  .dropzone { padding: 32px 18px 28px; }
  .drop-actions { max-width: 100%; }
}

/* preview */
.drop-preview { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.drop-preview img {
  max-height: 320px; border-radius: 14px; box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
}
.preview-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 500;
  letter-spacing: .03em;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; stroke-width: 1.8; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #222; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.legal {
  font-size: 12px; color: var(--text-faint); margin-top: 18px; letter-spacing: .04em;
}

/* ============ Workflow board ============ */
.workflow { margin: 36px auto 24px; max-width: 980px; }
.workflow-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.workflow-head h2 { font-weight: 500; font-size: 18px; letter-spacing: .02em; margin: 0; }

.board {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 28px 36px;
  min-height: 140px;
  overflow: hidden;
}
.wires {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
.wires path {
  fill: none; stroke: var(--line-strong); stroke-width: 1.6;
  stroke-dasharray: 4 5;
  opacity: 0;
  stroke-dashoffset: 200;
  transition: opacity var(--t), stroke var(--t);
}
.wires path.show {
  opacity: 1;
  animation: dash 1.6s linear infinite, fade-in .5s ease both;
}
.wires path.done {
  animation: none;
  stroke: var(--text);
  opacity: 1;
  stroke-dasharray: 0;
  stroke-dashoffset: 0;
}
.wires path.skip { stroke: var(--line); stroke-dasharray: 2 6; opacity: .8; animation: none; }
.wires path.fail { stroke: var(--bad); opacity: .7; animation: none; stroke-dasharray: 3 4; }

@keyframes dash {
  to { stroke-dashoffset: 0; }
}
@keyframes fade-in {
  from { opacity: 0; } to { opacity: 1; }
}

/* nodes */
.node {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 12px;
  min-height: 92px;
  opacity: .55;
  transition: opacity var(--t), border-color var(--t), transform var(--t), box-shadow var(--t);
  z-index: 1;
}
.node.active {
  opacity: 1; border-color: var(--text);
  box-shadow: 0 0 0 1px var(--text) inset, var(--shadow-sm);
  transform: translateY(-1px);
}
.node.ok { opacity: 1; border-color: var(--text); box-shadow: var(--shadow-sm); }
.node.skip { opacity: .45; }
.node.fail { opacity: .9; border-color: var(--bad); }
.node-head {
  display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px;
  letter-spacing: .04em;
}
.node-head svg { width: 16px; height: 16px; stroke-width: 1.8; flex-shrink: 0; }
.node-body { color: var(--text-mute); font-size: 12.5px; margin-top: 6px; min-height: 18px; }

.status {
  margin-left: auto; width: 10px; height: 10px; border-radius: 50%;
  background: #ddd; box-shadow: 0 0 0 0 rgba(0,0,0,0);
  transition: background var(--t), box-shadow var(--t);
}
.status[data-status="working"] {
  background: var(--text);
  animation: pulse 1.1s ease-in-out infinite;
}
.status[data-status="ok"]   { background: var(--ok); }
.status[data-status="skip"] { background: var(--text-faint); }
.status[data-status="fail"] { background: var(--bad); }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(14,14,15,.25); }
  50%     { box-shadow: 0 0 0 6px rgba(14,14,15,0); }
}

/* log */
.log {
  list-style: none; padding: 0; margin: 16px 0 0;
  font-size: 12.5px; color: var(--text-mute);
  display: grid; gap: 6px;
  max-height: 160px; overflow-y: auto;
}
.log li {
  display: flex; gap: 10px; align-items: baseline;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  letter-spacing: .015em;
  animation: slide-in .25s ease both;
}
.log li .lk { font-weight: 600; color: var(--text); min-width: 64px; }
.log li .ls { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text-faint); }
@keyframes slide-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* responsive board: stack on small screens */
@media (max-width: 760px) {
  .board {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 20px;
  }
  .wires { display: none; }
  .node { min-height: 0; }
  .node-body { margin-top: 4px; }
}

/* ============ Result ============ */
.result { margin: 28px auto 0; max-width: 980px; }

.result-card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  animation: rise .55s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.result-banner {
  height: 220px;
  background: var(--bg-soft) center/cover no-repeat;
  position: relative;
}
.result-banner::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 30%, rgba(255,255,255,.9) 100%);
}

.result-head {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 22px;
  padding: 0 28px 24px;
  margin-top: -90px;
  position: relative; z-index: 1;
}
.result-cover {
  width: 180px; aspect-ratio: 2/3;
  border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.result-cover img { width: 100%; height: 100%; object-fit: cover; }

/* Cover column wrapper — holds the poster + genre tags below it */
.result-cover-col {
  display: flex; flex-direction: column; gap: 10px;
}
.result-cover-col .tag-row {
  margin: 0; gap: 4px; flex-wrap: wrap;
}
.result-cover-col .tag {
  font-size: 10px; padding: 3px 8px; letter-spacing: .06em;
}

/* Back button bar on detail page */
.detail-back-bar { margin-bottom: 14px; }

.result-meta { padding-top: 96px; }
.result-title-en { font-size: 13px; color: var(--text-mute); letter-spacing: .06em; text-transform: uppercase; }
.result-title { font-size: 28px; font-weight: 500; line-height: 1.15; margin: 4px 0 6px; letter-spacing: -.005em; }
.result-title-native { color: var(--text-mute); font-weight: 300; font-size: 18px; }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--text-mute);
  background: var(--bg);
}
.tag.solid { background: var(--text); color: #fff; border-color: var(--text); }

.stat-row { display: flex; flex-wrap: wrap; gap: 18px; margin: 14px 0 4px; }
.stat { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); }
.stat svg { width: 16px; height: 16px; stroke-width: 1.6; color: var(--text-mute); }
.stat .num { font-weight: 600; }

.result-body {
  padding: 0 28px 28px;
  display: grid; gap: 28px;
}
.section h3 {
  font-size: 12px; letter-spacing: .25em; text-transform: uppercase;
  color: var(--text-mute); margin: 0 0 12px; font-weight: 600;
}

.description { font-size: 15px; line-height: 1.7; color: var(--text); }
.description.collapsed { max-height: 8em; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%); mask-image: linear-gradient(to bottom, #000 70%, transparent 100%); }
.desc-toggle { background: transparent; border: 0; color: var(--text-mute); cursor: pointer; font-family: inherit; padding: 4px 0; letter-spacing: .06em; text-transform: uppercase; font-size: 11px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 24px;
}
.info-grid .kv { font-size: 14px; }
.info-grid .k { color: var(--text-mute); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.info-grid .v { color: var(--text); margin-top: 2px; }

/* characters / cast */
.cast {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.cast-card {
  display: flex; gap: 12px; align-items: center;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px;
  transition: border-color var(--t), transform var(--t);
}
.cast-card:hover { border-color: var(--text); transform: translateY(-1px); }
.cast-img {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 10px; object-fit: cover;
  background: var(--bg-soft); border: 1px solid var(--line);
}
.cast-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cast-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.cast-role { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-mute); }
.cast-va {
  display: flex; gap: 8px; align-items: center;
  margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line);
}
.cast-va img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); }
.cast-va-name { font-size: 12px; color: var(--text); }
.cast-va-lang { font-size: 10px; color: var(--text-faint); letter-spacing: .08em; }

/* media tiles */
.tile-row {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.tile {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--bg); display: flex; flex-direction: column;
  transition: border-color var(--t), transform var(--t);
}
.tile:hover { border-color: var(--text); transform: translateY(-2px); }
.tile-img { aspect-ratio: 2/3; background: var(--bg-soft) center/cover no-repeat; }
.tile-meta { padding: 8px 10px 10px; }
.tile-name { font-size: 13px; line-height: 1.3; font-weight: 500; }
.tile-sub { font-size: 11px; color: var(--text-mute); letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }

/* external links */
.links {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.linkchip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--text);
  font-size: 13px; letter-spacing: .02em;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.linkchip:hover { border-color: var(--text); background: var(--bg-soft); }
.linkchip img { width: 16px; height: 16px; object-fit: contain; border-radius: 3px; }
.linkchip .type { color: var(--text-faint); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }

/* trailer */
.trailer {
  position: relative;
  width: 100%; aspect-ratio: 16/9;
  border-radius: 12px; overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
}
.trailer iframe { width: 100%; height: 100%; border: 0; display: block; }
.trailer-cover {
  position: absolute; inset: 0; cursor: pointer;
  background-size: cover; background-position: center;
}
.trailer-cover::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(0,0,0,.3), rgba(0,0,0,.55));
}
.trailer-cover svg {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 56px; height: 56px; color: #fff;
}

/* trace.moe preview block */
.trace-preview {
  display: flex; gap: 14px; align-items: center;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 10px; background: var(--bg);
}
.trace-preview video, .trace-preview img {
  width: 220px; aspect-ratio: 16/9; object-fit: cover;
  border-radius: 8px; background: #000;
}
.trace-preview .meta { font-size: 13px; color: var(--text-mute); }
.trace-preview .meta strong { color: var(--text); }

@media (max-width: 760px) {
  .result-head { grid-template-columns: 110px 1fr; gap: 14px; padding: 0 16px 16px; margin-top: -60px; }
  .result-cover { width: 110px; }
  .result-meta { padding-top: 56px; }
  .result-title { font-size: 22px; }
  .result-banner { height: 160px; }
  .result-body { padding: 0 16px 22px; }
  .trace-preview { flex-direction: column; align-items: stretch; }
  .trace-preview video, .trace-preview img { width: 100%; }
  .result-cover-col .tag { font-size: 9px; padding: 2px 6px; }
  .stat-val { font-size: 15px; }
}

/* ============ How it works ============ */
.how { margin: 60px auto 24px; max-width: 720px; }
.how h2 { font-weight: 500; font-size: 18px; letter-spacing: .02em; margin: 0 0 12px; }
.steps { color: var(--text-mute); padding-left: 20px; line-height: 1.8; font-size: 15px; }
.steps strong { color: var(--text); font-weight: 600; }

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
  margin-top: auto;
  padding: 36px 22px 28px;
}
.footer-inner {
  width: 100%; max-width: 1080px; margin: 0 auto;
  display: flex; flex-direction: column;
}
.footer-main {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 14px;
  text-align: left;
}
.footer-brand {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--text);
}
.footer-brand img {
  width: 36px; height: 36px;
  border-radius: 9px; object-fit: contain;
}
.footer-brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.footer-brand-name {
  font-weight: 600; letter-spacing: .04em; font-size: 16px;
}
.footer-brand-tag {
  font-size: 10px; letter-spacing: .35em; text-transform: uppercase;
  color: var(--text-mute);
}
.footer-blurb {
  margin: 0;
  color: var(--text-mute);
  font-size: 13.5px; line-height: 1.7;
  max-width: 560px;
  letter-spacing: .01em;
}
.footer-link {
  color: var(--text);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
  transition: border-color var(--t-fast), color var(--t-fast);
}
.footer-link:hover { border-color: var(--text); }
.footer-social {
  list-style: none; padding: 0; margin: 4px 0 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.footer-social-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-mute);
  font-size: 12.5px; letter-spacing: .04em;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.footer-social-link:hover {
  color: var(--text);
  border-color: var(--text);
  background: var(--bg-soft);
}
.footer-social-link svg { display: block; }
.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 11.5px; letter-spacing: .06em;
}
.dot { opacity: .5; }

@media (max-width: 480px) {
  .site-footer { padding: 28px 18px 22px; }
  .footer-social-link span { display: none; }
  .footer-social-link { padding: 8px; }
}

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(10px);
  background: var(--text); color: #fff;
  padding: 10px 16px; border-radius: 999px;
  font-size: 13px; letter-spacing: .02em;
  box-shadow: var(--shadow-lg);
  opacity: 0; transition: opacity var(--t), transform var(--t);
  z-index: 50;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ Small utilities ============ */
.muted { color: var(--text-mute); }
.center { text-align: center; }
hr.sep { border: 0; height: 1px; background: var(--line); margin: 16px 0; }

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


.result-list-wrap { display: flex; flex-direction: column; gap: 12px; }
.result-list-header { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; }
.result-list-count { font-weight: 600; font-size: 0.95rem; }
.result-list { display: flex; flex-direction: column; gap: 8px; }

.result-list-item {
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--card-bg, #fff);
}
.result-list-item:hover,
.result-list-item:focus-visible { border-color: var(--accent, #6366f1); box-shadow: 0 0 0 2px var(--accent-alpha, #6366f120); outline: none; }
.result-list-item.expanded { border-color: var(--accent, #6366f1); }

.result-list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
}
.result-thumb {
  width: 52px; height: 72px; object-fit: cover; border-radius: 6px;
  flex-shrink: 0; background: var(--muted-bg, #f3f3f3);
}
.result-thumb-placeholder {
  width: 52px; height: 72px; border-radius: 6px; flex-shrink: 0;
  background: var(--muted-bg, #f3f3f3); display: flex; align-items: center; justify-content: center;
  color: var(--muted, #888);
}
.result-list-info { flex: 1; min-width: 0; }
.result-list-title { font-weight: 600; font-size: 0.95rem; line-height: 1.3; margin-bottom: 2px; }
.result-list-native { font-size: 0.78rem; color: var(--muted, #888); margin-bottom: 6px; }
.result-list-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.result-list-chevron {
  width: 18px; height: 18px; flex-shrink: 0; color: var(--muted, #888);
  transition: transform 0.2s;
}
.result-list-item.expanded .result-list-chevron { transform: rotate(180deg); }
.result-list-detail { padding: 0 16px 16px; }

/* Confidence badges */
.conf-badge {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: 0.75rem; font-weight: 700;
}
.conf-high { background: #dcfce7; color: #166534; }
.conf-mid  { background: #fef9c3; color: #854d0e; }
.conf-low  { background: #fee2e2; color: #991b1b; }

/* Type badges */
.type-badge {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: 0.73rem; font-weight: 600; background: var(--muted-bg, #f3f3f3);
  color: var(--muted-fg, #555); text-transform: uppercase; letter-spacing: 0.02em;
}
.type-anime    { background: #ede9fe; color: #5b21b6; }
.type-manga    { background: #fce7f3; color: #9d174d; }
.type-manhwa   { background: #e0f2fe; color: #075985; }
.type-manhua   { background: #fef3c7; color: #92400e; }
.type-light_novel,
.type-light-novel { background: #f0fdf4; color: #14532d; }

/* Not-found template */
.result-not-found {
  text-align: center; padding: 48px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  border: 1px dashed var(--border, #e5e5e5); border-radius: 16px;
}
.not-found-icon { font-size: 2.5rem; }
.fallback-banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  background: #fffbeb; border: 1px solid #f59e0b; color: #92400e;
  font-size: 0.83rem; line-height: 1.5;
}
.fallback-note { font-size: 0.82rem; }

/* Detail loading state */
.detail-loading {
  display: flex; align-items: center; gap: 10px;
  padding: 24px 8px; color: var(--muted, #888); font-size: 0.9rem;
}
.detail-not-found {
  padding: 20px 8px; color: var(--muted, #888); font-size: 0.88rem;
  display: flex; align-items: center; gap: 8px;
}
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* AniList credit */
.anilist-credit {
  text-align: center; font-size: 0.78rem; color: var(--muted, #888);
  padding: 8px 0 4px; margin-top: 8px;
}
.anilist-credit a { color: var(--accent, #6366f1); text-decoration: none; }
.anilist-credit a:hover { text-decoration: underline; }

/* Initial loader on direct route */
#initialLoader {
  justify-content: center; padding: 80px 24px;
}


/* Stat card row (replaces old inline flex .stat icons) */
.result-title-block { margin-bottom: 8px; }
.result-title-sub {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-mute, var(--muted, #888)); margin-bottom: 4px;
}
.stat-row {
  display: flex; flex-wrap: nowrap; gap: 6px; margin: 12px 0 4px;
}
.stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex: 1; min-width: 0; padding: 10px 6px;
  background: var(--surface, var(--muted-bg, #f5f5f7));
  border-radius: 10px;
  text-align: center;
}
.stat-icon { color: var(--accent, #6366f1); display: inline-flex; }
.stat-icon svg, .stat-icon i { width: 16px; height: 16px; }
.stat-val { font-size: 18px; font-weight: 600; line-height: 1; }
.stat-unit { font-size: 11px; font-weight: 400; color: var(--text-mute, var(--muted, #888)); margin-left: 2px; }
.stat-label { font-size: 11px; color: var(--text-mute, var(--muted, #888)); letter-spacing: .04em; }

/* Cast card is now interactive */
.cast-card[role="button"] { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.cast-card[role="button"]:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.cast-card[role="button"]:focus-visible {
  outline: 2px solid var(--accent, #6366f1); outline-offset: 2px;
}

/* Character / Seiyuu modal */
.sk-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; backdrop-filter: blur(4px);
}
.sk-modal-overlay[hidden] { display: none; }
.sk-modal-box {
  background: var(--surface-raised, #fff); color: var(--text-body, inherit);
  border-radius: 16px; max-width: 540px; width: 100%; max-height: 85vh;
  overflow-y: auto; padding: 24px; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.sk-modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--text-mute, var(--muted, #888));
}
.sk-modal-close:hover { color: var(--text-body, #111); }
.sk-modal-content {}
.modal-char-head {
  display: flex; gap: 16px; margin-bottom: 14px; align-items: flex-start;
}
.modal-char-img {
  width: 90px; height: 120px; object-fit: cover;
  border-radius: 10px; flex-shrink: 0;
}
.modal-char-img--sm { width: 60px; height: 80px; }
.modal-char-info { flex: 1; min-width: 0; }
.modal-char-info h3 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.modal-kv-grid {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 10px;
  margin-top: 8px; font-size: 13px;
}
.modal-desc {
  font-size: 13px; line-height: 1.6; color: var(--text-body, #333);
  white-space: pre-line; max-height: 180px; overflow-y: auto;
}
.modal-desc--sm { max-height: 120px; margin-top: 8px; }
.modal-va {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border, #eee);
}
.modal-va h4 {
  margin: 0 0 12px; font-size: 13px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-mute, var(--muted, #888));
}
.modal-va-name { font-weight: 600; font-size: 15px; }
