.terminal-wide {
  max-width: 760px;
}

.prompt-link {
  color: inherit;
  text-decoration: none;
}
.prompt-link:hover .caret { color: var(--accent); }
.prompt .muted { color: var(--muted); margin-left: 6px; font-size: 0.95rem; }

.lede {
  color: var(--muted);
  margin: 0 0 18px 0;
}

/* ---- network badge ---- */
.net-badge {
  display: inline-block;
  border: 1px solid var(--border);
  padding: 6px 10px;
  font-size: 0.8125rem;
  margin: 0 0 18px 0;
}
.net-ok {
  color: var(--accent);
  border-color: rgba(0, 255, 136, 0.3);
  background: rgba(0, 255, 136, 0.05);
}
.net-bad {
  color: #ff5c5c;
  border-color: rgba(255, 92, 92, 0.4);
  background: rgba(255, 92, 92, 0.05);
}

/* ---- form ---- */
.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.field {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 10px;
  align-items: center;
}
.field-toggle { grid-template-columns: 1fr; }
.field label { color: var(--muted); font-size: 0.875rem; }
.field input[type="number"],
.field input[type="text"],
.field input[type="password"] {
  background: #050505;
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.9375rem;
  outline: none;
}
.field input:focus {
  border-color: var(--accent);
}
.field input:disabled { opacity: 0.5; cursor: not-allowed; }
.field .hint {
  color: var(--muted);
  font-size: 0.8125rem;
}
.estimate { margin: 0; padding-left: 150px; }

.warn {
  color: #ffb84d;
  font-size: 0.8125rem;
  margin: 0;
  padding-left: 150px;
  min-height: 1em;
}
.warn-strong { color: #ff8a4d; font-weight: bold; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--fg);
}
.toggle input { accent-color: var(--accent); }

.enc-fields {
  border-left: 1px solid var(--border);
  padding-left: 12px;
  margin-left: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.actions button {
  font-family: inherit;
  font-size: 0.95rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 10px 18px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.actions button:not(:disabled):hover {
  border-color: var(--accent);
  background: rgba(0, 255, 136, 0.06);
}
.actions button.primary {
  border-color: rgba(0, 255, 136, 0.4);
}
.actions button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.6;
}

/* ---- status ---- */
.status {
  font-size: 0.875rem;
  margin: 4px 0 0 0;
  color: var(--muted);
  min-height: 1.2em;
  word-break: break-word;
}
.status.ok { color: var(--accent); }
.status.err { color: #ff5c5c; }
.status.warn { color: #ffb84d; }
.status.running { color: var(--fg); }

/* ---- results ---- */
.results-section {
  margin-bottom: 18px;
}
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 10px;
  font-size: 0.875rem;
  color: var(--muted);
}
.results-header button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.8125rem;
  padding: 4px 10px;
  cursor: pointer;
}
.results {
  max-height: 460px;
  overflow-y: auto;
  border: 1px solid var(--border);
  background: #050505;
}
.row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid #1a1a1a;
  font-size: 0.8125rem;
  align-items: center;
}
.row:last-child { border-bottom: 0; }
.row .idx { color: var(--muted); text-align: right; }
.row .addr {
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--fg);
}
.row button {
  font-family: inherit;
  font-size: 0.75rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 2px 8px;
  cursor: pointer;
}
.row button[aria-pressed="true"] {
  background: rgba(0, 255, 136, 0.08);
}
.row .key {
  grid-column: 1 / -1;
  margin: 6px 0 0 0;
  padding: 8px 10px;
  background: #0a0a0a;
  border: 1px solid var(--border);
  color: #ffb84d;
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: all;
}

/* ---- downloads ---- */
.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.downloads button {
  font-family: inherit;
  font-size: 0.9rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 8px 14px;
  cursor: pointer;
}
.downloads button:hover { border-color: var(--accent); background: rgba(0, 255, 136, 0.06); }

/* ---- decrypt ---- */
.rule { border: 0; border-top: 1px dashed #1a1a1a; margin: 24px 0; }
.decrypt-toggle {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}
.decrypt-toggle:hover { text-decoration: underline; }
.decrypt-panel {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.decrypt-panel .muted { color: var(--muted); font-size: 0.875rem; margin: 0; }
.decrypt-zone {
  display: block;
  border: 1px dashed var(--border);
  padding: 18px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}
.decrypt-zone:hover, .decrypt-zone.dragging {
  border-color: var(--accent);
  color: var(--accent);
}
.decrypt-zone input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
#decrypt-go {
  align-self: flex-start;
  font-family: inherit;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 8px 16px;
  cursor: pointer;
}
#decrypt-go:disabled { color: var(--muted); cursor: not-allowed; }
#decrypt-go:not(:disabled):hover { border-color: var(--accent); background: rgba(0, 255, 136, 0.06); }

/* ---- mobile ---- */
@media (max-width: 560px) {
  .field { grid-template-columns: 100px 1fr; }
  .field .hint { grid-column: 2; }
  .estimate, .warn { padding-left: 110px; }
  .actions button { flex: 1; }
  .row { grid-template-columns: 28px 1fr auto auto; font-size: 0.75rem; }
  .row .addr { max-width: 100%; }
}
