/* LanePal Conversational — shared styles */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0b0e1a;
    --surface: #141828;
    --surface-hi: #1c2338;
    --border: #262d45;
    --ink: #e8ecf4;
    --ink-dim: #a7b0c5;
    --ink-muted: #6b7490;
    --accent: #7c9aff;
    --accent-2: #59d2c3;
    --success: #2fd87c;
    --danger: #ff5d5d;
    --radius: 10px;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, #0a0d18 0%, #0b0e1a 100%);
    font-size: 15px;
    line-height: 1.5;
}
body { display: flex; flex-direction: column; min-height: 100vh; }

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(11, 14, 26, 0.85);
    backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 5;
}
.header-left h1 { font-size: 18px; font-weight: 700; letter-spacing: 0.2px; }
.header-left h1 .accent { color: var(--accent-2); font-weight: 600; }
.subtitle { color: var(--ink-dim); font-size: 12px; margin-top: 2px; display: block; }
.header-right { display: flex; gap: 8px; align-items: center; }

.model-badge {
    background: var(--surface-hi);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    color: var(--ink-dim);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.status-badge.disconnected { background: #2a2f43; color: var(--ink-muted); }
.status-badge.connected { background: rgba(47, 216, 124, 0.15); color: var(--success); }
.status-badge.processing { background: rgba(124, 154, 255, 0.15); color: var(--accent); }

main { flex: 1; display: flex; flex-direction: column; gap: 20px; padding: 20px 24px 120px; max-width: 900px; width: 100%; margin: 0 auto; }

/* Step rail */
.step-rail ol {
    list-style: none;
    display: flex;
    gap: 6px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
}
.step-rail li {
    flex: 1;
    min-width: max-content;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-muted);
    text-align: center;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.step-rail li.active {
    background: linear-gradient(180deg, rgba(124, 154, 255, 0.18), rgba(124, 154, 255, 0.06));
    color: var(--accent);
    border: 1px solid rgba(124, 154, 255, 0.45);
}
.step-rail li.done { color: var(--success); }

/* Conversation */
.conversation {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 300px;
}
.message { display: flex; gap: 12px; align-items: flex-start; }
.message.user { flex-direction: row-reverse; }
.avatar {
    width: 36px; height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--surface-hi);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.message.user .avatar { background: var(--accent); color: #0b0e1a; }
.bubble {
    max-width: 75%;
    padding: 12px 16px;
    background: var(--surface-hi);
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}
.message.user .bubble {
    background: linear-gradient(180deg, #7c9aff 0%, #5d7af0 100%);
    color: #0b0e1a;
    font-weight: 500;
    border-color: transparent;
}
.bubble strong { color: var(--accent-2); font-weight: 600; }
.message.user .bubble strong { color: #0b0e1a; }

/* Load card list (rendered inline in a bubble) */
.load-cards { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.load-card {
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--ink);
}
.load-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.load-card .lane { font-weight: 600; font-size: 14px; color: var(--ink); }
.load-card .meta { font-size: 12px; color: var(--ink-dim); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.load-card .pay { font-size: 15px; font-weight: 700; color: var(--success); margin-top: 4px; }
.load-card .pay small { font-size: 11px; color: var(--ink-muted); font-weight: 500; margin-left: 4px; }
.load-card.selected { border: 2px solid var(--accent); background: rgba(124, 154, 255, 0.06); }

/* Confirmation receipt */
.receipt {
    padding: 16px;
    background: rgba(47, 216, 124, 0.08);
    border: 1px solid rgba(47, 216, 124, 0.4);
    border-radius: 10px;
}
.receipt h3 { color: var(--success); font-size: 15px; margin-bottom: 8px; }
.receipt dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 13px; }
.receipt dt { color: var(--ink-muted); }
.receipt dd { color: var(--ink); font-weight: 500; }

/* Dock */
.dock {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: sticky;
    bottom: 20px;
}
.mic-btn {
    width: 52px; height: 52px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-hi);
    color: var(--ink-dim);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.18s ease;
}
.mic-btn:hover { border-color: var(--accent); color: var(--accent); }
.mic-btn.listening {
    background: linear-gradient(180deg, #ff5d5d 0%, #e03a3a 100%);
    border-color: #e03a3a;
    color: white;
    animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 93, 93, 0.6); }
    50% { box-shadow: 0 0 0 10px rgba(255, 93, 93, 0); }
}
.audio-level-bar {
    width: 80px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}
#audio-level-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-2);
    transition: width 60ms linear;
}
.dock-input {
    flex: 1;
    display: flex;
    gap: 8px;
    align-items: center;
}
.text-input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    font-family: inherit;
}
.text-input:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
.submit-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #0b0e1a;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}
.submit-btn:hover { background: #93aaff; }

/* Wizard state debug */
.wizard-state {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--ink-dim);
}
.wizard-state summary { cursor: pointer; color: var(--ink-muted); user-select: none; }
.wizard-state pre { margin-top: 8px; font-family: "SF Mono", Menlo, monospace; font-size: 11px; color: var(--ink-dim); overflow-x: auto; }
