/* ═══════════════════════════════════════════════════════════════════════
   27-avatar-runtime.css — Autonomous Avatar runtime panel + activity feed
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Runtime panel container ── */
.rt-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

/* ── Toggle row ── */
.rt-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.rt-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.rt-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.rt-toggle-slider {
    display: inline-block;
    width: 36px;
    height: 20px;
    background: var(--line);
    border-radius: 10px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.rt-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    background: var(--text);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}

.rt-toggle input:checked ~ .rt-toggle-slider {
    background: var(--green);
}

.rt-toggle input:checked ~ .rt-toggle-slider::after {
    transform: translateX(16px);
    background: var(--bg);
}

.rt-toggle-label {
    font-size: 13px;
    color: var(--muted);
}

.rt-toggle input:checked ~ .rt-toggle-label {
    color: var(--green);
}

/* ── Config grid ── */
.rt-config {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: opacity 0.2s;
}

.rt-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rt-field-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.rt-field-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rt-field-hint {
    font-size: 13px;
    color: var(--muted);
}

.rt-select,
.rt-input {
    background: var(--panel-2, var(--panel));
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    padding: 6px 10px;
    outline: none;
    transition: border-color 0.15s;
    max-width: 200px;
    width: 100%;
}

.rt-select:focus,
.rt-input:focus {
    border-color: var(--green);
}

.rt-input[type="number"] {
    max-width: 100px;
}

/* ── Meta row (last/next run) ── */
.rt-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.rt-meta-item {
    font-size: 11px;
    color: var(--muted);
}

/* ── Quick links ── */
.rt-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.rt-link {
    font-size: 13px;
    color: var(--green);
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.15s;
}

.rt-link:hover {
    opacity: 1;
}

/* ── Buttons ── */
.rt-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s, background 0.15s;
    white-space: nowrap;
}

.rt-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.rt-btn-primary {
    background: var(--green);
    color: var(--bg);
}

.rt-btn-primary:hover:not(:disabled) {
    opacity: 0.88;
}

.rt-btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
}

.rt-btn-ghost:hover:not(:disabled) {
    background: rgba(var(--green-rgb), 0.07);
    border-color: rgba(var(--green-rgb), 0.35);
}

.rt-btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* ── Error state ── */
.rt-error {
    font-size: 13px;
    color: var(--red);
    padding: 8px 0;
}

/* ── Empty state ── */
.rt-empty {
    text-align: center;
    padding: 40px 24px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

/* ══════════════════════════════════════════════════════
   Activity Feed Page
   ══════════════════════════════════════════════════════ */

.rt-activity {
    padding: 0 16px 80px;
    max-width: 680px;
    margin: 0 auto;
}

.rt-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 20px 0 10px;
}

/* ── Run cards ── */
.rt-run-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
}

.rt-run-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.rt-run-status {
    font-size: 16px;
    flex-shrink: 0;
}

.rt-run-trigger {
    font-size: 12px;
    color: var(--muted);
    background: rgba(var(--green-rgb), 0.08);
    border-radius: 4px;
    padding: 2px 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rt-run-date {
    font-size: 12px;
    color: var(--muted);
    margin-left: auto;
}

.rt-run-summary {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
    margin-top: 6px;
}

.rt-run-decision {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
    font-style: italic;
}

.rt-run-cost {
    font-size: 12px;
    color: var(--amber);
    margin-top: 4px;
}

/* ── Observation cards ── */
.rt-obs-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
}

.rt-obs-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.rt-obs-kind {
    font-size: 12px;
    color: var(--muted);
    background: var(--panel-2, var(--panel));
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 2px 6px;
}

.rt-obs-date {
    font-size: 12px;
    color: var(--muted);
    margin-left: auto;
}

.rt-obs-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.rt-obs-content {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════
   Goals Page
   ══════════════════════════════════════════════════════ */

.rt-goals {
    padding: 0 16px 80px;
    max-width: 680px;
    margin: 0 auto;
}

.rt-goal-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.rt-goal-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.rt-goal-prio {
    font-size: 12px;
    color: var(--muted);
    flex-shrink: 0;
}

.rt-goal-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.rt-goal-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 6px;
}

.rt-goal-criteria {
    font-size: 12px;
    color: var(--muted);
    border-left: 2px solid rgba(var(--green-rgb), 0.4);
    padding-left: 8px;
    margin-bottom: 8px;
    font-style: italic;
}

.rt-goal-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
