@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,700&display=swap');

:root {
    --bg: #1a1a1a;
    --surface: #242424;
    --surface-raised: #2e2e2e;
    --border: #333;
    --text: #e8e8e8;
    --text-dim: #888;
    --accent: #e8a838;
    --accent-dim: #b8832a;
    --red: #e85454;
    --green: #4ec46e;
    --radius: 8px;
    --mono: 'Space Mono', monospace;
    --sans: 'DM Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.topbar .mark {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 2px;
}

.topbar h1 {
    font-family: var(--mono);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: lowercase;
    color: var(--accent);
}

.topbar .tag {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* grid */
.grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 860px) {
    .grid { grid-template-columns: 1fr; }
}

/* panel */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

/* urls */
.field-label {
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
    display: block;
}

textarea {
    width: 100%;
    height: 100px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.82rem;
    padding: 12px;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s;
}

textarea:focus { border-color: var(--accent); }
textarea::placeholder { color: #555; }

/* section label */
.section-title {
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin: 22px 0 4px;
}

.hint {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-bottom: 12px;
}

/* chips — made obviously clickable */
.module-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid var(--border);
    background: transparent;
    cursor: pointer;
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-dim);
    transition: all 0.15s;
    user-select: none;
    outline: none;
}

.chip:hover {
    border-color: var(--accent-dim);
    color: var(--text);
}

.chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a1a1a;
    font-weight: 700;
}

/* select all / none — clearly styled as buttons */
.select-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.select-btn {
    flex: 1;
    padding: 8px 0;
    border-radius: var(--radius);
    border: 1px dashed var(--border);
    background: transparent;
    color: var(--text-dim);
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.select-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    border-style: solid;
}

/* run button */
.btn-go {
    width: 100%;
    margin-top: 24px;
    padding: 14px;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
    color: #1a1a1a;
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    position: relative;
}

.btn-go:hover { background: var(--accent-dim); }
.btn-go:active { transform: scale(0.98); }
.btn-go:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-go .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* download zone — prominent, animated, clearly clickable */
.dl-zone {
    margin-top: 20px;
    display: none;
    animation: slideUp 0.4s ease;
}

.dl-zone.show { display: block; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.dl-zone .dl-title {
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--green);
    margin-bottom: 10px;
}

.dl-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg);
    border: 2px solid var(--green);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    margin-bottom: 8px;
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.dl-link:hover {
    background: var(--green);
    color: #1a1a1a;
    font-weight: 700;
}

.dl-link .dl-icon {
    font-size: 1.2rem;
}

/* terminal */
.term {
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    height: 520px;
    max-height: 80vh;
}

.term-bar {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    gap: 6px;
    border-bottom: 1px solid #222;
}

.term-bar .circ {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.circ.r { background: #e85454; }
.circ.y { background: #e8c44e; }
.circ.g { background: #4ec46e; }

.term-bar .term-label {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 0.65rem;
    color: #444;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.term-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    font-family: var(--mono);
    font-size: 0.8rem;
    line-height: 1.6;
    color: #777;
}

.term-body::-webkit-scrollbar { width: 6px; }
.term-body::-webkit-scrollbar-track { background: transparent; }
.term-body::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

.term-body .line { margin-bottom: 2px; white-space: pre-wrap; word-break: break-all; }
.term-body .line.ok { color: var(--green); }
.term-body .line.err { color: var(--red); }
.term-body .line.hi { color: var(--accent); }
.term-body .line.sys { color: #555; }
