/* ============================================================
   Workbench — chained cipher tools (Workshop, puzzles, maze)
   Location: assets/css/workbench.css
   ============================================================ */
.wb {
    --wb-green: #0f0;
    --wb-dim: rgba(0, 255, 0, 0.25);
    --wb-cyan: #0ff;
    --wb-gold: #ffd700;
    --wb-red: #ff5a5a;
    display: grid;
    gap: 18px;
    font-family: 'Courier New', monospace;
}
.wb-section { display: grid; gap: 8px; }
.wb-label {
    display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
    color: var(--wb-green); font-weight: bold; letter-spacing: 1px; text-transform: uppercase; font-size: 0.85em;
}
.wb-stats { font-weight: normal; text-transform: none; letter-spacing: 0; opacity: 0.65; font-size: 0.9em; }
.wb-limit { font-weight: normal; letter-spacing: 0; color: var(--wb-cyan); font-size: 0.9em; text-transform: none; }

.wb .wb-textarea { min-height: 90px; font-size: 0.95em; }
.wb .wb-output { background: rgba(0, 40, 0, 0.6); }

.wb-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---- chain ---- */
.wb-chain { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: none; }
.wb-step {
    border: 1px solid var(--wb-dim);
    border-left: 3px solid var(--wb-green);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.55);
    padding: 10px 12px;
    display: grid; gap: 8px;
}
.wb-step-head { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; }
.wb-step-num {
    width: 26px; height: 26px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--wb-green); color: #000; font-weight: bold; font-size: 0.85em; margin-top: 4px;
}
.wb-step-controls { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; min-width: 0; }
.wb-step-tools { display: flex; gap: 4px; }

.wb .wb-select,
.wb .wb-input {
    width: auto; padding: 6px 8px; font-size: 0.9em; border-width: 1px; border-radius: 4px;
}
.wb .wb-select { max-width: 100%; }
.wb .wb-input { min-width: 8em; }
.wb .wb-num { width: 5em; min-width: 0; }
.wb-param { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85em; color: #0c0; }
.wb-stepper { display: inline-flex; align-items: center; gap: 4px; }
.wb .wb-bump { min-width: 40px; min-height: 40px; font-size: 1.2em; font-weight: bold; touch-action: manipulation; }
.wb .wb-stepper .wb-num { text-align: center; }

.wb-toggle { display: inline-flex; border: 1px solid var(--wb-green); border-radius: 4px; overflow: hidden; }
.wb-toggle-btn {
    background: transparent; color: var(--wb-green); border: 0; padding: 6px 10px; cursor: pointer;
    font: inherit; font-size: 0.85em;
}
.wb-toggle-btn + .wb-toggle-btn { border-left: 1px solid var(--wb-green); }
.wb-toggle-btn.is-on { background: var(--wb-green); color: #000; font-weight: bold; }

.wb-icon {
    background: transparent; color: var(--wb-green); border: 1px solid var(--wb-dim); border-radius: 4px;
    width: 30px; height: 30px; padding: 0; cursor: pointer; font: inherit; line-height: 28px; text-align: center;
    text-decoration: none; display: inline-block;
}
.wb-icon:hover:not(:disabled) { border-color: var(--wb-green); background: rgba(0, 255, 0, 0.12); }
.wb-icon:disabled { opacity: 0.25; cursor: default; }
.wb-remove:hover:not(:disabled) { color: var(--wb-red); border-color: var(--wb-red); background: rgba(255, 0, 0, 0.1); }

.wb-step-out {
    font-size: 0.85em; color: var(--wb-cyan); word-break: break-all; white-space: pre-wrap;
    border-top: 1px dashed rgba(0, 255, 0, 0.15); padding-top: 6px; min-height: 1.2em;
}
.wb-step-out code { font-family: inherit; font-size: inherit; color: inherit; background: none; border: 0; padding: 0; box-shadow: none; }
.wb-step-out.is-error { color: var(--wb-red); }

.wb-add,
.wb-btn {
    background: transparent; color: var(--wb-green); border: 1px dashed var(--wb-green); border-radius: 6px;
    padding: 8px 14px; cursor: pointer; font: inherit; font-size: 0.9em;
}
.wb-btn { border-style: solid; }
.wb-add:hover, .wb-btn:hover { background: rgba(0, 255, 0, 0.12); }
.wb-add.is-locked { color: var(--wb-gold); border-color: var(--wb-gold); }

/* ---- lens (analyzer) ---- */
.wb-lens { border: 1px solid var(--wb-dim); border-radius: 6px; padding: 12px; background: rgba(0, 20, 20, 0.5); }
.wb-lens-out { display: grid; gap: 8px; font-size: 0.9em; }
.wb-lens-summary { color: var(--wb-cyan); font-weight: bold; }
.wb-lens-table { border-collapse: collapse; width: 100%; max-width: 520px; }
.wb-lens-table th, .wb-lens-table td { text-align: left; padding: 3px 8px; border-bottom: 1px dashed rgba(0, 255, 0, 0.15); }
.wb-lens-table th { color: var(--wb-green); font-weight: normal; width: 40%; }
.wb-lens-table td { color: #cfc; word-break: break-all; }
.wb-lens-link { color: var(--wb-green); font-size: 0.85em; }

@media (max-width: 600px) {
    .wb-step-head { grid-template-columns: auto 1fr; }
    .wb-step-tools { grid-column: 1 / -1; justify-content: flex-end; }
    .wb .wb-input { min-width: 0; width: 100%; }
    .wb-param { width: 100%; }
    .wb-param .wb-input { flex: 1; }
    .wb-param-num .wb-stepper { flex: 1; }
    .wb .wb-stepper .wb-num { flex: 1; width: auto; }
}

/* ---- plain-language guidance: what each step takes and where its result goes ---- */
.wb-hint { margin: 0; font-size: 0.85em; opacity: 0.8; }
.wb-empty { border: 1px dashed var(--wb-dim); border-radius: 6px; padding: 10px 12px; font-size: 0.9em; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.wb-empty[hidden] { display: none; }
.wb-step-from { font-size: 0.82em; opacity: 0.8; }
.wb-step-out-label { color: var(--wb-green); opacity: 0.85; }
.wb-step + .wb-step { position: relative; margin-top: 12px; }
.wb-step + .wb-step::before { content: '↓'; position: absolute; top: -24px; left: 14px; color: var(--wb-green); font-weight: bold; }
