/* ── STEP LABEL ── */
.step {
  display: flex; align-items: baseline; gap: 0.75rem;
  margin: 2rem 0 0.75rem; flex-wrap: wrap;
}
.step .n {
  font-family: var(--mono); color: var(--acc);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.05em;
}
.step h2 {
  margin: 0; font-size: 14px; font-weight: 600;
  color: var(--fg); letter-spacing: -0.005em;
}
.step .hint { color: var(--fg-4); font-size: var(--fs-xs); flex: 1; }

/* ── REPORT SLOT ── */
.report-slot {
  border: 1px dashed var(--line-2); background: var(--bg-1);
  border-radius: 4px; padding: 1.1rem 1.25rem;
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 1.25rem; align-items: center;
  transition: border-color .15s;
}
.report-slot.loaded { border-style: solid; }
.report-slot:hover { border-color: var(--acc); }
.report-slot.drag-over { border-color: var(--acc); background: color-mix(in oklab, var(--acc) 5%, var(--bg-1)); }
.report-slot .icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  color: var(--fg-4); border: 1px solid var(--line);
  border-radius: 3px; background: var(--bg); letter-spacing: 0.05em;
}
.report-slot.loaded .icon {
  color: var(--acc);
  border-color: color-mix(in oklab, var(--acc) 40%, var(--line-2));
  background: color-mix(in oklab, var(--acc) 5%, var(--bg));
}
.report-slot .rs-body .title { font-weight: 600; font-size: var(--fs); color: var(--fg); }
.report-slot .rs-body .meta { font-size: var(--fs-s); color: var(--fg-2); margin-top: 0.25rem; }
.report-slot .rs-body .meta .k { color: var(--fg); font-family: var(--mono); }
.report-slot .rs-body .meta .sep { color: var(--fg-4); margin: 0 0.4rem; }
.report-slot .rs-actions { display: flex; gap: 0.4rem; align-items: center; }
.slot-aux {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.35rem 0.25rem 0; font-size: var(--fs-xs); color: var(--fg-4);
  gap: 1rem; flex-wrap: wrap;
}
.slot-aux a { color: var(--fg-3); border-bottom: 1px dotted var(--fg-4); }
.slot-aux a:hover { color: var(--acc); border-bottom-color: var(--acc); text-decoration: none; }

/* ── CARD GRID ── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

/* ── CARD STATUS VARIANTS (index query states) ── */
.card.r-ok::before   { background: var(--ok); }
.card.r-err::before  { background: var(--err); }
.card.r-load::before { background: var(--load); }
.card.r-pend::before { background: var(--line-2); }

.c-hd { display: flex; flex-direction: column; gap: 0.2rem; }
.c-hd .title { font-weight: 600; font-size: var(--fs); color: var(--fg); line-height: 1.2; }
.c-hd .ident { font-family: var(--mono); font-size: var(--fs-xs); color: var(--fg-3); line-height: 1.2; word-break: break-all; }
.c-hd .ident .at { color: var(--fg-4); }
.c-hd .ident .crawler { color: var(--fg-4); }

.c-body-row {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 0.85rem;
  padding-top: 0.35rem; border-top: 1px dashed var(--line); margin-top: auto;
}
.solved-wrap { display: flex; flex-direction: column; gap: 0.05rem; }
.subs-wrap   { display: flex; flex-direction: column; gap: 0.05rem; align-items: flex-end; }
.c-body-row .lbl {
  font-size: 10px; color: var(--fg-4);
  text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600;
}
.solved-link {
  font-family: var(--mono); font-size: 1.6rem; font-weight: 600; line-height: 1.1;
  color: var(--acc); font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
  cursor: pointer;
  border-bottom: 1px dashed color-mix(in oklab, var(--acc) 50%, transparent);
  text-decoration: none; padding-bottom: 1px;
}
.solved-link:hover { color: var(--fg); border-bottom-color: var(--fg); text-decoration: none; }
.subs-val {
  font-family: var(--mono); font-size: var(--fs-s); color: var(--fg-3);
  font-variant-numeric: tabular-nums; line-height: 1; padding-bottom: 4px;
}
.dash { font-family: var(--mono); color: var(--fg-4); font-size: 1.6rem; font-weight: 600; line-height: 1.1; }

.c-err-msg {
  font-family: var(--mono); font-size: var(--fs-xs); color: var(--err);
  padding-top: 0.35rem; border-top: 1px dashed var(--line);
  line-height: 1.45; min-width: 0;
}

.c-ft {
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--fs-xs);
}
.c-ft .status {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: var(--fs-xs); font-family: var(--mono);
}
.c-ft .status::before {
  content: ""; width: 7px; height: 7px;
  background: currentColor; display: inline-block; border-radius: 50%;
}
.c-ft .status.s-ok   { color: var(--ok); }
.c-ft .status.s-err  { color: var(--err); }
.c-ft .status.s-load { color: var(--load); }
.c-ft .status.s-pend { color: var(--fg-4); }
.c-ft .status .t { color: var(--fg-4); font-size: 11px; margin-left: 0.2rem; }
.c-ft .actions { display: flex; gap: 0.3rem; }

/* ── ICON BUTTON ── */
.iconbtn {
  background: transparent; border: 1px solid var(--line);
  color: var(--fg-3); width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-family: var(--mono);
  cursor: pointer; border-radius: 2px;
}
.iconbtn:hover { color: var(--acc); border-color: var(--acc); }
.iconbtn.danger:hover { color: var(--err); border-color: var(--err); }

.err-link {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  word-break: break-all;
  color: var(--fg-3); font-size: var(--fs-xs); text-decoration: none;
}
.err-link:hover { color: var(--err); text-decoration: none; }

.loading-dots::after {
  content: ""; animation: dots 1.4s steps(4,end) infinite;
}
@keyframes dots {
  0%  { content: ""; } 25% { content: "."; }
  50% { content: ".."; } 75% { content: "..."; }
}

/* empty card grid state */
.card-empty {
  grid-column: 1 / -1; padding: 2.5rem 1rem; text-align: center;
  color: var(--fg-4); font-size: var(--fs-s);
}
.card-empty pre { margin: 0 0 0.75rem; color: var(--fg-3); font-size: var(--fs-xs); line-height: 1.4; }

/* ── DOWNLOAD CARD / SUMMARY ── */
.download-card, .summary {
  display: grid; grid-template-columns: 1fr auto;
  border: 1px solid var(--line); background: var(--bg-1); border-radius: 4px;
}
.dc-left, .summary-left {
  padding: 1.2rem 1.4rem;
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 2rem 2.5rem;
}
.stat { display: flex; flex-direction: column; gap: 0.15rem; }
.stat .n {
  font-family: var(--mono); font-size: 1.75rem; font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em; color: var(--fg);
}
.stat.accent .n { color: var(--acc); }
.stat .l {
  font-size: 10px; color: var(--fg-4);
  text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700;
}
.dc-right, .summary-right {
  border-left: 1px solid var(--line); padding: 1.2rem 1.3rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  align-items: stretch; justify-content: center; min-width: 240px;
}
.dc-right .note, .summary-right .note {
  font-size: var(--fs-xs); color: var(--fg-4); line-height: 1.5;
}

/* ── COMPOSER (home-page only) ── */
.composer {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.55rem;
  padding: 0.85rem 0.95rem;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.composer .crawler-hint {
  grid-column: 1 / -1;
  font-size: var(--fs-xs); color: var(--fg-4); padding: 0 0.1rem;
}
.composer .crawler-hint::before { content: "ℹ "; color: var(--fg-4); }

.field {
  display: flex; align-items: center;
  border: 1px solid var(--line-2);
  background: var(--bg); padding: 0 0.75rem; height: 38px; border-radius: 3px;
}
.field:focus-within { border-color: var(--acc); box-shadow: 0 0 0 2px color-mix(in oklab, var(--acc) 10%, var(--bg)); }
.field .prefix { color: var(--fg-4); user-select: none; margin-right: 0.45rem; font-size: var(--fs-xs); }
.field select, .field input { background: transparent; border: 0; outline: none; color: var(--fg); font: inherit; width: 100%; padding: 0; }
.field select option { background: var(--bg-1); color: var(--fg); }
.field input::placeholder { color: var(--fg-4); }
.field .at { color: var(--acc); margin: 0 0.3rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--bg-2); color: var(--fg);
  border: 1px solid var(--line-2);
  padding: 0 0.9rem; height: 38px;
  font: inherit; white-space: nowrap; border-radius: 3px;
}
.btn:hover { border-color: var(--acc); color: var(--acc); }
.btn.primary { background: var(--acc); color: #0a0b0d; border-color: var(--acc); font-weight: 600; }
.btn.primary:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.btn.ghost { background: transparent; }
.btn.danger:hover { border-color: var(--err); color: var(--err); }
.btn .kbd { margin-left: 0.3rem; color: var(--fg-4); font-size: 10px; border: 1px solid var(--line); padding: 1px 4px; border-radius: 2px; }
.btn.primary .kbd { color: rgba(10,11,13,0.7); border-color: rgba(10,11,13,0.3); }
.btn.sm { height: 32px; padding: 0 0.75rem; font-size: var(--fs-s); }
.btn.xs { height: 26px; padding: 0 0.55rem; font-size: var(--fs-xs); }

.step-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ── RESPONSIVE ── */
@media (max-width: 820px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-slot { grid-template-columns: auto 1fr; }
  .report-slot .rs-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .download-card, .summary { grid-template-columns: 1fr; }
  .dc-right, .summary-right { border-left: 0; border-top: 1px solid var(--line); min-width: 0; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .composer { grid-template-columns: 1fr; }
  .btn .kbd { display: none; }
  .step { flex-wrap: wrap; }
  .step .hint { order: 10; flex: 0 0 100%; margin-top: 0.1rem; }
  .step-actions { flex: 0 0 100%; }
}
