/* ============================================================
   RautingTech Site Concierge — agent UI
   Three phases: Arrival card → Companion rail → Engaged panel
   ============================================================ */

.rt-concierge {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 998;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink, #0a0e14);
}
.rt-concierge * { box-sizing: border-box; }
.rt-concierge button { font-family: inherit; }

/* ── Orb (used in arrival, rail, panel) ─────────────────── */
.rt-orb {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}
.rt-orb-pulse,
.rt-orb-core {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}
.rt-orb-core {
    background: radial-gradient(circle at 30% 30%, #00ff66 0%, #00d946 45%, #008f2d 100%);
    box-shadow: 0 0 18px rgba(0, 217, 70, 0.55), inset 0 0 8px rgba(255, 255, 255, 0.4);
    animation: rt-orb-breathe 2.6s ease-in-out infinite;
}
.rt-orb-pulse {
    background: rgba(0, 217, 70, 0.3);
    animation: rt-orb-pulse 2.6s ease-out infinite;
}
@keyframes rt-orb-breathe {
    0%, 100% { transform: scale(1);    filter: brightness(1); }
    50%      { transform: scale(1.05); filter: brightness(1.15); }
}
@keyframes rt-orb-pulse {
    0%   { transform: scale(0.8); opacity: 0.55; }
    100% { transform: scale(1.9); opacity: 0; }
}

/* ── Photon launcher (rail orb) — a quantum of light: a radiant core with a
   starburst and concentric wavefront rings. Mirrors the hero photon symbol. ──── */
.rt-photon { position: relative; }
.rt-photon-core {
    position: absolute; top: 50%; left: 50%;
    width: 34%; height: 34%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, #ffffff 0%, #8affc0 38%, #00d946 100%);
    box-shadow: 0 0 8px rgba(0, 217, 70, 0.9), 0 0 16px rgba(0, 217, 70, 0.5), inset 0 0 3px rgba(255, 255, 255, 0.6);
    animation: rt-photon-pulse 2.6s ease-in-out infinite;
}
.rt-photon-rays {
    position: absolute; inset: 0; border-radius: 50%;
    background: repeating-conic-gradient(rgba(138, 255, 192, 0.85) 0deg 2deg, transparent 2deg 30deg);
    -webkit-mask: radial-gradient(circle, #000 10%, rgba(0, 0, 0, 0.55) 34%, transparent 72%);
            mask: radial-gradient(circle, #000 10%, rgba(0, 0, 0, 0.55) 34%, transparent 72%);
    animation: rt-photon-spin 14s linear infinite;
}
.rt-photon-ring {
    position: absolute; inset: 22%; border-radius: 50%;
    border: 1px solid rgba(0, 217, 70, 0.5);
    animation: rt-photon-ripple 2.6s ease-out infinite;
}
.rt-photon-ring::before {
    content: ""; position: absolute; inset: -34%; border-radius: 50%;
    border: 1px solid rgba(0, 217, 70, 0.24);
}
@keyframes rt-photon-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1);    filter: brightness(1); }
    50%      { transform: translate(-50%, -50%) scale(1.14); filter: brightness(1.25); }
}
@keyframes rt-photon-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes rt-photon-ripple {
    0%   { transform: scale(0.82); opacity: 0.85; }
    100% { transform: scale(1.25); opacity: 0; }
}

/* ── PHASE 1 — Arrival card ─────────────────────────────── */
.rt-arrival {
    position: fixed;
    top: 50%;
    right: 24px;
    width: 340px;
    max-width: calc(100vw - 32px);
    transform: translateY(-50%) translateX(40px) scale(0.96);
    background: linear-gradient(180deg, #0a0e14 0%, #11161e 100%);
    color: #fff;
    border-radius: 18px;
    padding: 22px 22px 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(0, 217, 70, 0.22);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
                transform 0.55s cubic-bezier(0.2, 1.4, 0.4, 1);
    visibility: hidden;
}
.rt-arrival.rt-arrival-show {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
    pointer-events: auto;
    visibility: visible;
}
.rt-arrival::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 18px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0, 217, 70, 0.4), rgba(0, 217, 70, 0) 50%, rgba(0, 217, 70, 0.4));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.rt-arrival-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, color 0.18s;
}
.rt-arrival-close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.rt-arrival-orb {
    position: relative;
    width: 40px;
    height: 40px;
    margin-bottom: 14px;
}
.rt-arrival-orb .rt-orb-core,
.rt-arrival-orb .rt-orb-pulse {
    position: absolute; inset: 0; border-radius: 50%;
}
.rt-arrival-orb .rt-orb-core {
    background: radial-gradient(circle at 30% 30%, #00ff66 0%, #00d946 45%, #008f2d 100%);
    box-shadow: 0 0 22px rgba(0, 217, 70, 0.7), inset 0 0 10px rgba(255, 255, 255, 0.4);
    animation: rt-orb-breathe 2.6s ease-in-out infinite;
}
.rt-arrival-orb .rt-orb-pulse {
    background: rgba(0, 217, 70, 0.35);
    animation: rt-orb-pulse 2.6s ease-out infinite;
}
.rt-arrival-eyebrow {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #00d946;
    margin-bottom: 6px;
}
.rt-arrival-title {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: -0.4px;
    margin: 0 0 8px;
    color: #fff;
    line-height: 1.2;
}
.rt-arrival-body {
    font-size: 0.88rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.78);
    margin: 0 0 16px;
}
.rt-arrival-starters {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.rt-starter {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-align: left;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, transform 0.12s;
}
.rt-starter:hover {
    background: rgba(0, 217, 70, 0.1);
    border-color: rgba(0, 217, 70, 0.45);
}
.rt-starter:active { transform: scale(0.985); }
.rt-arrival-cta {
    width: 100%;
    background: #00d946;
    color: #0a0e14;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.18s;
}
.rt-arrival-cta:hover { background: #00ff66; }

/* ── PHASE 2 — Companion rail ───────────────────────────── */
.rt-rail {
    position: fixed;
    top: 50%;
    right: 16px;
    transform: translateY(-50%) translateX(120%);
    width: 50px;
    min-height: 0;
    background: linear-gradient(180deg, rgba(10, 14, 20, 0.95) 0%, rgba(17, 22, 30, 0.95) 100%);
    color: #fff;
    border-radius: 16px;
    border: 1px solid rgba(0, 217, 70, 0.2);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.32), 0 0 14px rgba(0, 217, 70, 0.1);
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 13px 0;
    gap: 11px;
    transition: transform 0.55s cubic-bezier(0.2, 1.2, 0.4, 1),
                opacity 0.4s ease;
    opacity: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.rt-rail.rt-rail-show {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
    animation: rt-rail-bob 5.5s ease-in-out 1s infinite;
}
.rt-rail.rt-rail-dim {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(110%);
    animation: none;
}
@keyframes rt-rail-bob {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50%      { transform: translateY(calc(-50% - 6px)) translateX(-2px); }
}
.rt-rail:hover {
    border-color: rgba(0, 217, 70, 0.42);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 0 22px rgba(0, 217, 70, 0.2);
}
.rt-rail .rt-orb {
    width: 32px;
    height: 32px;
}
.rt-rail-label {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 2.4px;
    color: rgba(255, 255, 255, 0.72);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}
.rt-mic-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 217, 70, 0.12);
    color: #00d946;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 217, 70, 0.32);
}

/* Thought bubble peeking out from the rail */
.rt-thought {
    position: fixed;
    top: 50%;
    right: 92px;
    transform: translateY(-50%) translateX(20px);
    background: #0a0e14;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 8px 13px;
    border-radius: 999px;
    border: 1px solid rgba(0, 217, 70, 0.4);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
    opacity: 0;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.2, 1.2, 0.4, 1);
    white-space: nowrap;
    visibility: hidden;
}
.rt-thought.rt-thought-show {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    visibility: visible;
}
.rt-thought::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: #0a0e14;
    border-right: 1px solid rgba(0, 217, 70, 0.4);
    border-top: 1px solid rgba(0, 217, 70, 0.4);
}
.rt-thought:hover { background: #11161e; }

/* ── PHASE 3 — Engaged panel ────────────────────────────── */
.rt-panel {
    position: fixed;
    top: 16px;
    right: 16px;
    bottom: 16px;
    width: 420px;
    max-width: calc(100vw - 32px);
    background: linear-gradient(180deg, #0a0e14 0%, #11161e 100%);
    color: #fff;
    border-radius: 18px;
    border: 1px solid rgba(0, 217, 70, 0.22);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 40px rgba(0, 217, 70, 0.12);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: translateX(60px) scale(0.985);
    transition: opacity 0.32s ease,
                transform 0.45s cubic-bezier(0.2, 1.0, 0.3, 1);
    visibility: hidden;
    overflow: hidden;
}
.rt-panel.rt-panel-show {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
    visibility: visible;
}

.rt-panel-head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.18);
}
.rt-panel-orb {
    position: relative; width: 30px; height: 30px; flex-shrink: 0;
}
.rt-panel-orb .rt-orb-core,
.rt-panel-orb .rt-orb-pulse {
    position: absolute; inset: 0; border-radius: 50%;
}
.rt-panel-orb .rt-orb-core {
    background: radial-gradient(circle at 30% 30%, #00ff66 0%, #00d946 45%, #008f2d 100%);
    box-shadow: 0 0 16px rgba(0, 217, 70, 0.6), inset 0 0 8px rgba(255, 255, 255, 0.4);
    animation: rt-orb-breathe 2.6s ease-in-out infinite;
}
.rt-panel-orb .rt-orb-pulse {
    background: rgba(0, 217, 70, 0.3);
    animation: rt-orb-pulse 2.6s ease-out infinite;
}
.rt-panel-title { flex: 1; line-height: 1.25; }
.rt-panel-title strong { display: block; font-size: 0.95rem; font-weight: 800; color: #fff; letter-spacing: -0.2px; }
.rt-panel-title small  { display: block; font-size: 0.72rem; color: rgba(255, 255, 255, 0.55); margin-top: 2px; }
.rt-panel-head-actions { display: flex; gap: 6px; }
.rt-voicechat-btn,
.rt-voiceout-btn,
.rt-panel-min {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.rt-voicechat-btn:hover,
.rt-voiceout-btn:hover,
.rt-panel-min:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.16);
}
.rt-voicechat-btn.rt-on,
.rt-voiceout-btn.rt-on {
    background: rgba(0, 217, 70, 0.15);
    color: #00d946;
    border-color: rgba(0, 217, 70, 0.4);
}
.rt-voicechat-btn.rt-on { box-shadow: 0 0 14px rgba(0, 217, 70, 0.35); }
.rt-voicechat-btn:disabled,
.rt-voiceout-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Subtle subtitle warning when we're in the wind-down stretch */
.rt-panel-subtitle.rt-warn {
    color: #ffbf3d;
    font-weight: 600;
    letter-spacing: 0.15px;
}

/* Voice-chat status line under the header — only visible in voice chat mode */
.rt-vc-status {
    display: none;
    padding: 8px 16px 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(0, 217, 70, 0.8);
    text-align: center;
}
.rt-panel.rt-voicechat .rt-vc-status { display: block; }

/* Voice-chat orb states — orb in panel header gets dialed up when in voice chat */
.rt-panel.rt-voicechat .rt-panel-orb {
    width: 38px;
    height: 38px;
    cursor: pointer;
    transition: width 0.3s ease, height 0.3s ease;
}
.rt-panel.rt-voicechat .rt-panel-orb .rt-orb-core {
    box-shadow: 0 0 22px rgba(0, 217, 70, 0.7), inset 0 0 10px rgba(255, 255, 255, 0.45);
}
.rt-panel.rt-voicechat.rt-vc-listening .rt-panel-orb .rt-orb-core {
    background: radial-gradient(circle at 30% 30%, #00ff66 0%, #00d946 45%, #008f2d 100%);
    animation: rt-orb-breathe 1.6s ease-in-out infinite;
}
.rt-panel.rt-voicechat.rt-vc-listening .rt-panel-orb .rt-orb-pulse {
    animation: rt-orb-pulse 1.6s ease-out infinite;
}
.rt-panel.rt-voicechat.rt-vc-thinking .rt-panel-orb .rt-orb-core {
    background: radial-gradient(circle at 30% 30%, #ffd166 0%, #f0a500 45%, #b87900 100%);
    box-shadow: 0 0 18px rgba(240, 165, 0, 0.55), inset 0 0 8px rgba(255, 255, 255, 0.4);
    animation: rt-orb-breathe 1.0s ease-in-out infinite;
}
.rt-panel.rt-voicechat.rt-vc-thinking .rt-panel-orb .rt-orb-pulse {
    background: rgba(240, 165, 0, 0.32);
    animation: rt-orb-pulse 1.0s ease-out infinite;
}
.rt-panel.rt-voicechat.rt-vc-speaking .rt-panel-orb .rt-orb-core {
    background: radial-gradient(circle at 30% 30%, #7dffb1 0%, #00d946 50%, #006b22 100%);
    animation: rt-orb-breathe 0.7s ease-in-out infinite;
}
.rt-panel.rt-voicechat.rt-vc-speaking .rt-panel-orb .rt-orb-pulse {
    animation: rt-orb-pulse 0.7s ease-out infinite;
}

/* Ended state — gray everything out, kill the input */
.rt-panel.rt-ended .rt-input-wrap {
    opacity: 0.55;
    background: rgba(255, 255, 255, 0.03);
}
.rt-panel.rt-ended .rt-input,
.rt-panel.rt-ended .rt-mic,
.rt-panel.rt-ended .rt-send {
    cursor: not-allowed;
}
.rt-panel.rt-ended .rt-send {
    background: rgba(0, 217, 70, 0.3);
}
.rt-panel.rt-ended .rt-send:hover { transform: none; }
.rt-panel.rt-ended .rt-panel-orb .rt-orb-core {
    background: radial-gradient(circle at 30% 30%, #707d8c 0%, #4a5563 50%, #2a3038 100%);
    box-shadow: none;
    animation: none;
}
.rt-panel.rt-ended .rt-panel-orb .rt-orb-pulse { animation: none; opacity: 0; }

.rt-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.rt-panel-body::-webkit-scrollbar { width: 6px; }
.rt-panel-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.rt-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.rt-msg {
    display: flex;
    flex-direction: column;
    max-width: 88%;
    animation: rt-msg-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes rt-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rt-msg-user { align-self: flex-end; }
.rt-msg-assistant { align-self: flex-start; }
.rt-bubble {
    padding: 10px 13px;
    border-radius: 13px;
    font-size: 0.92rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.rt-msg-user .rt-bubble {
    background: #00d946;
    color: #0a0e14;
    border-bottom-right-radius: 4px;
}
.rt-msg-assistant .rt-bubble {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
}
.rt-typing .rt-bubble { display: inline-flex; gap: 4px; align-items: center; padding: 12px 14px; }
.rt-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(0, 217, 70, 0.7);
    animation: rt-typing-dot 1.2s ease-in-out infinite;
}
.rt-dot:nth-child(2) { animation-delay: 0.15s; }
.rt-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes rt-typing-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.55; }
    30%           { transform: translateY(-3px); opacity: 1; }
}

.rt-nav-wrap {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 7px;
}
.rt-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: rgba(0, 217, 70, 0.08);
    color: #00d946;
    border: 1px solid rgba(0, 217, 70, 0.32);
    padding: 8px 12px;
    border-radius: 9px;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.12s;
}
.rt-nav-btn::after { content: "→"; opacity: 0.7; }
.rt-nav-btn:hover {
    background: rgba(0, 217, 70, 0.16);
    border-color: rgba(0, 217, 70, 0.55);
    color: #00ff66;
}
.rt-nav-btn:active { transform: scale(0.99); }

/* Capture form */
.rt-capture {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.42s ease, padding 0.3s ease;
    background: rgba(0, 217, 70, 0.06);
    border-top: 1px solid rgba(0, 217, 70, 0.18);
}
.rt-capture.rt-capture-show {
    max-height: 260px;
    padding: 14px 16px;
}
.rt-capture-prompt {
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 10px;
    line-height: 1.5;
}
.rt-capture-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}
.rt-capture-form input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 9px 11px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-family: inherit;
}
.rt-capture-form input::placeholder { color: rgba(255, 255, 255, 0.4); }
.rt-capture-form input:focus { outline: none; border-color: rgba(0, 217, 70, 0.6); background: rgba(255, 255, 255, 0.08); }
.rt-capture-submit {
    grid-column: 1 / -1;
    background: #00d946;
    color: #0a0e14;
    border: none;
    padding: 9px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    transition: background 0.18s;
}
.rt-capture-submit:hover { background: #00ff66; }
.rt-capture-submit:disabled { background: rgba(0, 217, 70, 0.4); cursor: not-allowed; }
.rt-capture-done {
    font-size: 0.86rem;
    color: #00d946;
    text-align: center;
    padding: 8px 0;
    font-weight: 600;
}

/* Footer (input area) */
.rt-panel-foot {
    display: flex;
    gap: 7px;
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.2);
}
.rt-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 0 8px 0 12px;
    transition: border-color 0.15s, background 0.15s;
}
.rt-input-wrap:focus-within {
    border-color: rgba(0, 217, 70, 0.55);
    background: rgba(255, 255, 255, 0.08);
}
.rt-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.92rem;
    padding: 10px 0;
    outline: none;
    font-family: inherit;
}
.rt-input::placeholder { color: rgba(255, 255, 255, 0.36); }
.rt-mic,
.rt-send {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, transform 0.12s;
    flex-shrink: 0;
}
.rt-mic {
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
}
.rt-mic:hover { color: #00d946; background: rgba(0, 217, 70, 0.1); }
.rt-listening .rt-mic {
    color: #0a0e14;
    background: #00d946;
    animation: rt-mic-pulse 1.1s ease-in-out infinite;
}
@keyframes rt-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 217, 70, 0.6); }
    50%      { box-shadow: 0 0 0 8px rgba(0, 217, 70, 0); }
}
.rt-send {
    background: #00d946;
    color: #0a0e14;
}
.rt-send:hover { background: #00ff66; transform: scale(1.04); }

/* ── Mobile (≤ 600px) ───────────────────────────────────── */
@media (max-width: 600px) {
    .rt-arrival {
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        top: auto;
        bottom: 18px;
        transform: translateY(40px) scale(0.96);
        padding: 18px 18px 16px;
    }
    .rt-arrival.rt-arrival-show {
        transform: translateY(0) scale(1);
    }
    .rt-arrival-title { font-size: 1.08rem; }
    .rt-arrival-body { font-size: 0.84rem; }
    .rt-starter { font-size: 0.8rem; padding: 10px 12px; }

    .rt-rail {
        top: auto;
        bottom: 14px;
        right: 14px;
        width: auto;
        min-height: 0;
        flex-direction: row;
        padding: 8px 12px;
        gap: 9px;
        min-width: 56px;
    }
    .rt-rail.rt-rail-show {
        transform: translateY(0) translateX(0);
        animation: rt-rail-bob-m 5s ease-in-out 1s infinite;
    }
    @keyframes rt-rail-bob-m {
        0%, 100% { transform: translateY(0); }
        50%      { transform: translateY(-5px); }
    }
    .rt-rail.rt-rail-dim {
        transform: translateY(0) translateX(120%);
    }
    .rt-rail-label { display: none; }
    .rt-rail .rt-orb { width: 26px; height: 26px; }
    .rt-mic-icon { width: 24px; height: 24px; }

    .rt-thought {
        top: auto;
        bottom: 78px;
        right: 14px;
        transform: translateY(20px);
        font-size: 0.74rem;
        padding: 7px 11px;
        max-width: calc(100vw - 28px);
    }
    .rt-thought.rt-thought-show { transform: translateY(0); }
    .rt-thought::after { display: none; }

    .rt-panel {
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        border: none;
        transform: translateY(40px) scale(0.99);
    }
    .rt-panel.rt-panel-show { transform: translateY(0) scale(1); }
    .rt-panel-head { padding: 14px 12px; gap: 9px; }
    .rt-panel-head-actions { gap: 8px; }
    .rt-voiceout-btn, .rt-panel-min { width: 34px; height: 34px; }
    .rt-panel-title strong { font-size: 0.92rem; }
    .rt-panel-title small { font-size: 0.7rem; }
    .rt-panel-body { padding: 14px 12px; }
    .rt-panel-foot { padding: 10px 12px 12px; }
    .rt-input { font-size: 16px; }  /* prevent iOS zoom on focus */
}

/* Very narrow — iPhone SE (320px) needs the panel header to breathe more */
@media (max-width: 360px) {
    .rt-arrival { padding: 16px 14px; }
    .rt-arrival-title { font-size: 1.02rem; }
    .rt-arrival-body { font-size: 0.8rem; }
    .rt-panel-head { padding: 12px 10px; }
    .rt-panel-title strong { font-size: 0.88rem; }
    .rt-panel-title small { font-size: 0.68rem; line-height: 1.3; }
    .rt-bubble { font-size: 0.88rem; }
    .rt-nav-btn { font-size: 0.8rem; padding: 7px 10px; }
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .rt-orb-core,
    .rt-orb-pulse,
    .rt-rail.rt-rail-show,
    .rt-rail.rt-rail-show * { animation: none !important; }
    .rt-arrival,
    .rt-rail,
    .rt-panel,
    .rt-thought,
    .rt-msg { transition: opacity 0.2s ease !important; transform: none !important; }
    .rt-arrival.rt-arrival-show,
    .rt-rail.rt-rail-show,
    .rt-panel.rt-panel-show,
    .rt-thought.rt-thought-show { transform: none !important; }
}

/* When panel is open, dim site background a touch on mobile so the
   conversation feels focused (desktop stays unaffected since panel is a side panel). */
@media (max-width: 600px) {
    body.rt-panel-open { overflow: hidden; }
}
