/* Batch Prompting — dark cyber-retro skin for the Artificial Wasteland /tools room.
   The engine (app.js) is byte-identical to the public repo; only this presentation
   layer is themed. Palette mirrors src/styles/global.css. "Glow as a scalpel." */
:root {
  --ground: #0a0c11;
  --surface: #11141c;
  --surface-2: #0d1016;
  --ink: #e7eaf2;
  --ink-soft: #98a1b4;
  --ink-faint: #7c8698;
  --rule: #20252f;
  --rule-bright: #2e3645;
  --phosphor: #ffc94a;
  --phosphor-deep: #e0a52e;
  --cyan: #58d6e0;
  --danger: #ff6b6b;
  --mono: "Martian Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, Cambria, serif;
}
* { box-sizing: border-box; }
/* app.js toggles the `hidden` attribute on modal/keyWrap/baseWrap/etc.; our flex rules
   would otherwise override the UA [hidden]{display:none}, so enforce it explicitly. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  /* faint receding-grid wash, the Wasteland's "generated ground" */
  background-image:
    radial-gradient(1200px 600px at 50% -10%, rgba(88,214,224,.05), transparent 70%),
    linear-gradient(transparent 0, var(--ground) 600px);
  background-attachment: fixed;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--ink-soft); font-weight: 400; }
code { font-family: var(--mono); background: rgba(88,214,224,.08); color: var(--cyan); padding: 1px 5px; border-radius: 4px; font-size: .92em; }

/* header */
header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px clamp(14px, 4vw, 34px);
  background: rgba(10,12,17,.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.back {
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft); white-space: nowrap;
}
.back span { color: var(--cyan); }
.back:hover { color: var(--ink); text-decoration: none; }
.brand { display: flex; align-items: center; gap: 9px; margin-right: auto; }
.brand img { display: block; filter: drop-shadow(0 0 6px rgba(255,201,74,.25)); }
.brand b { font-family: var(--serif); font-weight: 600; font-size: 17px; letter-spacing: .01em; }
.brand .muted { font-size: 12px; }

/* layout */
main { max-width: 1180px; margin: 0 auto; padding: 22px clamp(14px, 4vw, 34px) 90px; }
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.012));
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 16px;
  margin: 0 0 14px;
}
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row { display: flex; gap: 14px; align-items: flex-end; }
.row.tight { gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
label { display: flex; flex-direction: column; gap: 6px; }
label > span {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft);
  display: flex; align-items: center; gap: 8px;
}

/* fields */
input, select, textarea {
  font-family: var(--mono); font-size: 13.5px; color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--rule-bright);
  border-radius: 8px;
  padding: 9px 11px;
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--phosphor);
  box-shadow: 0 0 0 1px var(--phosphor), 0 0 16px -6px var(--phosphor);
}
select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px;
}
.settings label { flex: 0 0 auto; }
.settings input[type="number"] { width: 92px; }
.settings label.grow { flex: 1 1 220px; }
.settings label.grow input { width: 100%; }

/* buttons */
button {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; border-radius: 999px; padding: 9px 16px; border: 1px solid var(--rule-bright);
  background: rgba(255,255,255,.03); color: var(--ink);
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
button:hover { border-color: var(--ink-soft); }
button.primary {
  background: var(--phosphor); color: #10141c; border-color: var(--phosphor); font-weight: 700;
}
button.primary:hover { box-shadow: 0 0 22px -5px var(--phosphor); border-color: var(--phosphor); }
button.ghost { background: rgba(255,255,255,.03); }
button.danger:hover { border-color: var(--danger); color: var(--danger); }
button.link {
  background: none; border: none; padding: 0; text-transform: none; letter-spacing: 0;
  color: var(--cyan); font-size: 11px; text-decoration: underline; text-underline-offset: 2px;
}
button.link:hover { color: var(--ink); }
#install { white-space: nowrap; }

/* run bar + progress */
.runbar { margin-top: 14px; flex-wrap: wrap; }
#status { font-size: 11.5px; letter-spacing: .04em; }
.bar { flex: 1 1 120px; height: 4px; background: var(--rule); border-radius: 999px; overflow: hidden; min-width: 90px; }
#barFill { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--phosphor)); transition: width .2s ease; }

/* results grid */
.grid { overflow-x: auto; border: 1px solid var(--rule); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { border: 1px solid var(--rule); padding: 10px 12px; text-align: left; vertical-align: top; }
thead th { background: var(--surface); position: sticky; top: 0; font-weight: 600; }
thead th > div:first-child { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--ink); word-break: break-all; }
.cornercell { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
.agg { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); margin-top: 4px; letter-spacing: .02em; }
tbody th { background: var(--surface-2); font-family: var(--serif); font-weight: 400; font-size: 13.5px; color: var(--ink); max-width: 320px; }
td .out { white-space: pre-wrap; line-height: 1.5; color: var(--ink); max-width: 460px; }
td.pending .out { color: var(--ink-faint); }
td.error { background: rgba(255,107,107,.06); }
td.error .out { color: #ffb0b0; }
td.empty .out { color: var(--ink-faint); font-style: italic; }
td hr { border: none; border-top: 1px dashed var(--rule-bright); margin: 8px 0; }
.badges { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
.badge { font-family: var(--mono); font-size: 9.5px; letter-spacing: .03em; color: var(--ink-soft);
  background: rgba(255,255,255,.04); border: 1px solid var(--rule); border-radius: 5px; padding: 1px 6px; }
.badge.err { color: var(--danger); border-color: rgba(255,107,107,.3); background: rgba(255,107,107,.08); }

/* footer notes */
.foot { font-size: 11.5px; line-height: 1.6; margin: 18px 2px 0; max-width: 80ch; }

/* trust panel */
.trust {
  margin-top: 22px; padding: 18px 20px;
  border: 1px solid var(--rule); border-left: 2px solid var(--cyan);
  border-radius: 10px; background: linear-gradient(180deg, rgba(88,214,224,.04), rgba(88,214,224,.012));
}
.trust__line { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); display: flex; align-items: center; gap: 9px; }
.trust__line .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 9px 1px var(--cyan); }
.trust p { font-size: 12.5px; line-height: 1.65; color: var(--ink-soft); max-width: 82ch; margin: 10px 0 14px; }
.trust b { color: var(--ink); }
.trust__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  padding: 9px 15px; border-radius: 999px; border: 1px solid var(--cyan); color: var(--cyan);
  background: rgba(88,214,224,.06);
}
.btn:hover { text-decoration: none; background: rgba(88,214,224,.13); box-shadow: 0 0 16px -7px var(--cyan); }
.btn.ghost { border-color: var(--rule-bright); color: var(--ink-soft); background: rgba(255,255,255,.03); }
.btn.ghost:hover { color: var(--ink); border-color: var(--ink-soft); box-shadow: none; }

/* model browser modal */
.modal { position: fixed; inset: 0; background: rgba(4,5,8,.7); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 20; }
.modal-box { background: var(--surface); border: 1px solid var(--rule-bright); border-radius: 14px; width: min(560px, 100%); max-height: 80vh; display: flex; flex-direction: column; padding: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.6); }
.modellist { overflow-y: auto; margin-top: 10px; }
.modellist .m { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 12px; border: 1px solid transparent; }
.modellist .m:hover { background: rgba(88,214,224,.07); border-color: var(--rule); }
.modellist .m .price { color: var(--ink-faint); font-size: 10.5px; white-space: nowrap; }

@media (max-width: 720px) {
  .cols { grid-template-columns: 1fr; }
  .row { flex-direction: column; align-items: stretch; }
  .row.tight { flex-direction: row; }
  .settings input[type="number"] { width: 100%; }
  td .out, tbody th { max-width: 70vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
