/* EARTHS AI Mode — toolbar button + overlay panel. Additive; scoped to .ai-mode-* / .aim-* */

.ai-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    margin: 0 6px;
    background: linear-gradient(135deg, #7b2ff7 0%, #00c2ff 100%);
    color: #fff;
    border: none;
    border-radius: 7px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(123, 47, 247, .35);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.ai-mode-btn:hover { transform: translateY(-1px); filter: brightness(1.07); box-shadow: 0 4px 16px rgba(0, 194, 255, .4); }
.ai-mode-btn.active { filter: brightness(1.12); box-shadow: 0 0 0 2px rgba(0, 194, 255, .55), 0 4px 16px rgba(0, 194, 255, .4); }
.ai-mode-btn .aim-spark { font-size: 13px; line-height: 1; }

.ai-mode-panel {
    display: none;
    position: fixed;
    top: 64px;
    right: 18px;
    width: 360px;
    max-width: calc(100vw - 36px);
    max-height: calc(100vh - 96px);
    background: #11151c;
    color: #e6edf3;
    border: 1px solid #2b3340;
    border-radius: 12px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .6);
    z-index: 9000;
    overflow: hidden;
    font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
}

.aim-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #161b22;
    border-bottom: 1px solid #2b3340;
}
.aim-title { font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; }
.aim-title .aim-spark { background: linear-gradient(135deg, #b07bff, #00c2ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.aim-close {
    background: transparent; color: #8b949e; border: none; font-size: 20px;
    line-height: 1; cursor: pointer; padding: 0 4px; border-radius: 6px;
}
.aim-close:hover { color: #fff; background: #21262d; }

.aim-body { padding: 14px; overflow-y: auto; max-height: calc(100vh - 150px); }
.aim-label { display: block; margin-bottom: 6px; color: #8b949e; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.aim-label.aim-inline { margin: 0 10px 0 0; }

.aim-script, .aim-palette {
    width: 100%; padding: 9px 10px; background: #0d1117; color: #e6edf3;
    border: 1px solid #2b3340; border-radius: 7px; font: inherit; font-size: 13px;
}
.aim-script { min-height: 120px; resize: vertical; }
.aim-script:focus, .aim-palette:focus { outline: none; border-color: #00c2ff; box-shadow: 0 0 0 2px rgba(0, 194, 255, .2); }

.aim-row { display: flex; align-items: center; margin: 12px 0; }
.aim-row .aim-palette { flex: 1; }

.aim-generate {
    width: 100%; margin-top: 4px; padding: 10px 14px;
    background: linear-gradient(135deg, #7b2ff7 0%, #00c2ff 100%);
    color: #fff; border: none; border-radius: 8px; font: inherit; font-weight: 700;
    font-size: 13px; cursor: pointer; transition: filter .12s ease, transform .12s ease;
}
.aim-generate:hover { filter: brightness(1.08); transform: translateY(-1px); }
.aim-generate:disabled { filter: grayscale(.5) brightness(.7); cursor: progress; transform: none; }

.aim-log {
    margin-top: 12px; padding: 10px; min-height: 24px; max-height: 220px; overflow-y: auto;
    background: #0d1117; border: 1px solid #2b3340; border-radius: 7px;
    font-family: "JetBrains Mono", "Menlo", monospace; font-size: 11.5px; color: #8b949e;
}
.aim-log:empty { display: none; }
.aim-line { white-space: pre-wrap; word-break: break-word; }
.aim-line.ok { color: #56d364; }
.aim-line.warn { color: #e3b341; }
.aim-line.err { color: #f85149; }

.aim-actions { display: none; gap: 8px; margin-top: 12px; }
.aim-actions button {
    flex: 1; padding: 8px 6px; background: #21262d; color: #c9d1d9;
    border: 1px solid #2b3340; border-radius: 7px; font: inherit; font-size: 12px;
    font-weight: 600; cursor: pointer; transition: background .12s ease, border-color .12s ease;
}
.aim-actions button:hover { background: #2b3340; border-color: #00c2ff; }
.aim-actions .aim-play { background: #1f6feb; color: #fff; border-color: #1f6feb; }
.aim-actions .aim-play:hover { background: #2f81f7; }

.aim-hint { margin-top: 12px; font-size: 11.5px; color: #8b949e; }
.aim-hint.ok { color: #56d364; }
.aim-hint.warn { color: #e3b341; }
.aim-hint code { background: #0d1117; border: 1px solid #2b3340; border-radius: 4px; padding: 1px 5px; font-size: 11px; }
