/* Reset & base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --sidebar-width: 220px;
    --chat-width: 560px;
    --chat-bg: #1a1d23;
    --chat-header-bg: #13151a;
    --input-bg: #2a2d35;
    --user-bubble: #2563eb;
    --assistant-bubble: #2a2d35;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --accent: #f59e0b;
    --border: #3f3f46;
    --radius: 12px;
}

html, body {
    height: 100%;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--chat-bg);
}

.brand-logo {
    font-family: 'Bebas Neue', cursive;
    letter-spacing: 5px;
    font-weight: 400;
    color: var(--accent);
}

/* ===== Login Screen ===== */
#login-screen,
#beta-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--chat-header-bg);
}

#login-screen[hidden],
#beta-screen[hidden] {
    display: none;
}

#login-card {
    background: var(--chat-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 36px;
    width: 380px;
    text-align: center;
}

#login-card h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

#login-form input {
    padding: 10px 14px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

#login-form input:focus {
    border-color: var(--accent);
}

#login-form input::placeholder {
    color: var(--text-secondary);
}

#login-btn {
    padding: 10px;
    background: var(--accent);
    color: #000;
    font-weight: 600;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#login-btn:hover {
    opacity: 0.9;
}

#google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    background: #fff;
    color: #333;
    font-weight: 500;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 16px;
}

#google-btn:hover {
    background: #f5f5f5;
}

.login-toggle {
    font-size: 13px;
    color: var(--text-secondary);
}

.login-toggle button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
}

.login-terms {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 12px;
    opacity: 0.7;
}

.login-terms a {
    color: var(--accent);
    text-decoration: underline;
}

/* ToS checkbox (inside signup form) */
.tos-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    margin-bottom: 12px;
}

.tos-checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.tos-checkbox-label a {
    color: var(--accent);
    text-decoration: underline;
}

/* ToS acceptance modal */
#tos-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

#tos-modal[hidden] {
    display: none;
}

.tos-modal-card {
    max-width: 480px;
    width: 90%;
}

.tos-modal-summary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 18px;
    margin: 16px 0;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: left;
}

.tos-modal-summary p {
    margin-bottom: 8px;
}

.tos-modal-summary ul {
    padding-left: 18px;
    margin-bottom: 10px;
}

.tos-modal-summary ul li {
    margin-bottom: 4px;
}

.tos-modal-summary a {
    color: var(--accent);
    text-decoration: underline;
}

.tos-modal-check {
    justify-content: center;
    margin-bottom: 16px;
}

.tos-accept-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.tos-accept-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.tos-accept-btn:not(:disabled):hover {
    opacity: 0.85;
}

/* ===== App Layout ===== */
#app {
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* ===== Sidebar ===== */
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--chat-header-bg);
    border-right: 1px solid var(--border);
}

#sidebar-header {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

#btn-new-chat {
    width: 100%;
    padding: 8px 12px;
    background: var(--accent);
    color: #000;
    font-weight: 600;
    font-size: 13px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#btn-new-chat:hover {
    opacity: 0.9;
}

#conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.conversation-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 10px;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.conversation-item.active {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.conversation-title {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.conversation-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: auto;
    flex-shrink: 0;
}

.conversation-delete {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px 4px;
    margin-left: 4px;
    flex-shrink: 0;
}

.conversation-item:hover .conversation-delete {
    display: block;
}

.conversation-delete:hover {
    color: #ef4444;
}

#sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#user-email {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#btn-logout {
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
}

#btn-logout:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

#conversation-list::-webkit-scrollbar {
    width: 4px;
}

#conversation-list::-webkit-scrollbar-track {
    background: transparent;
}

#conversation-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* ===== Chat panel ===== */
#chat-panel {
    width: var(--chat-width);
    min-width: 300px;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
    border-right: 1px solid var(--border);
}

#chat-header {
    padding: 16px 20px;
    background: var(--chat-header-bg);
    border-bottom: 1px solid var(--border);
}

#chat-header h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

#chat-header .subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Messages area */
#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 95%;
}

.message.user {
    align-self: flex-end;
}

.message.assistant {
    align-self: flex-start;
}

.message-content {
    padding: 10px 14px;
    border-radius: var(--radius);
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message.user .message-content {
    background: var(--user-bubble);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: var(--assistant-bubble);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-content p {
    margin-bottom: 8px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content strong {
    color: var(--accent);
}

.message-content a {
    color: var(--accent);
    text-decoration: underline;
}

.message-content code {
    background: rgba(0,0,0,0.3);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 13px;
}

.message-content pre {
    background: rgba(0,0,0,0.3);
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
}

.message-content h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 8px 0 4px;
    color: var(--accent);
}

.message-content ul, .message-content ol {
    margin: 4px 0 8px 20px;
}

.message-content li {
    margin-bottom: 2px;
}

/* Tool indicator */
.tool-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 8px;
    font-size: 12px;
    color: var(--accent);
}

.tool-indicator .spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.tool-indicator.done .spinner {
    display: none;
}

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

/* Download button */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    padding: 8px 16px;
    background: var(--accent);
    color: #000;
    font-weight: 600;
    font-size: 13px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    margin-top: 4px;
    white-space: nowrap;
}

.download-btn:hover {
    opacity: 0.9;
}

/* Override .message-content a color rule for download/maps buttons */
.message-content a.download-btn,
.message-content a.maps-btn {
    color: #000;
    text-decoration: none;
    display: inline-flex;
}

/* Row wrapping both buttons */
.download-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

/* Google Maps button */
.maps-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    padding: 8px 16px;
    background: #1a73e8;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.maps-btn:hover { opacity: 0.9; }

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: var(--assistant-bubble);
    border-radius: var(--radius);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Input area */
#chat-form {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--chat-header-bg);
}

#input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
}

#chat-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 120px;
    line-height: 1.4;
}

#chat-input::placeholder {
    color: var(--text-secondary);
}

#send-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

#send-btn:hover {
    opacity: 0.8;
}

#send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Map panel */
#map-panel {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

#map-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    gap: 8px;
}

#map-controls button,
#map-controls select {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    color: #333;
}

#map-controls button:hover,
#map-controls select:hover {
    background: #f0f0f0;
}

/* Route info popup */
.route-popup h4 {
    margin: 0 0 4px;
    font-size: 14px;
}

.route-popup .stats {
    font-size: 12px;
    color: #666;
}

/* ===== Route Summary Card ===== */
.route-summary-card {
    background: var(--chat-header-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 10px;
    font-size: 13px;
    width: 100%;
}

.route-summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.route-summary-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--accent);
}

.route-summary-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.route-summary-stats {
    display: flex;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 10px;
}

.route-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.route-summary-table th {
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 4px 6px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.route-summary-table td {
    padding: 4px 6px;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(63, 63, 70, 0.4);
    white-space: nowrap;
}

.route-summary-table tr:last-child td {
    border-bottom: none;
}

.svc-yes {
    color: #22c55e;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.svc-no {
    color: #71717a;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* Scrollbar */
#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ===== Plan / Billing UI ===== */
.plan-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-free       { background: rgba(113,113,122,0.2); color: #a1a1aa; }
.plan-voyager    { background: rgba(59,130,246,0.2);  color: #60a5fa; }
.plan-pathfinder { background: rgba(168,85,247,0.2);  color: #c084fc; }
.plan-dev        { background: rgba(34,197,94,0.2);   color: #4ade80; }
.plan-beta       { background: rgba(251,191,36,0.2);  color: #fbbf24; }

#usage-count {
    font-size: 11px;
    color: var(--text-secondary);
}

#usage-count.usage-warning {
    color: #f97316;
}

#btn-upgrade {
    padding: 6px 12px;
    background: var(--accent);
    color: #000;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

#btn-upgrade:hover { opacity: 0.9; }

/* ===== Upgrade Modal ===== */
#upgrade-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#upgrade-modal[hidden] { display: none; }

.modal-card {
    background: var(--chat-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 540px;
    position: relative;
}

.modal-card h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 6px;
}

.modal-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

#modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

#modal-close:hover { color: var(--text-primary); }

.plan-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.plan-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.plan-card:hover {
    border-color: var(--accent);
}

.plan-card.featured {
    border-color: #a855f7;
    background: rgba(168,85,247,0.05);
}

.plan-card-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.plan-card.voyager .plan-card-name    { color: #60a5fa; }
.plan-card.pathfinder .plan-card-name { color: #c084fc; }

.plan-card-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.plan-card-price span {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
}

.plan-card-features {
    list-style: none;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plan-card-features li::before {
    content: "✓ ";
    color: #22c55e;
    font-weight: 700;
}

.plan-card-btn {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.plan-card.voyager    .plan-card-btn { background: #3b82f6; color: #fff; }
.plan-card.pathfinder .plan-card-btn { background: #a855f7; color: #fff; }
.plan-card-btn:hover { opacity: 0.9; }

.modal-manage-link {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.modal-manage-link button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
    font-size: 12px;
}

/* ===== Upgrade prompt in chat ===== */
.upgrade-prompt {
    background: rgba(168,85,247,0.08);
    border: 1px solid rgba(168,85,247,0.3);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.upgrade-icon { font-size: 24px; }

.upgrade-message {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

.upgrade-plan-btn {
    padding: 8px 16px;
    background: #a855f7;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.upgrade-plan-btn:hover { opacity: 0.9; }

/* ===== Route summary enhancements ===== */
.route-color-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
    vertical-align: middle;
}

.route-optional-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    background: rgba(168,85,247,0.15);
    color: #c084fc;
    border: 1px solid rgba(168,85,247,0.3);
}

/* ===== Toast ===== */
#toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #22c55e;
    color: #000;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    z-index: 20000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#toast[hidden] { display: none; }

/* ── Account settings button ─────────────────────────────────────── */
.btn-settings {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-settings:hover { color: var(--text-primary); border-color: var(--text-secondary); }

/* ── Account modals ──────────────────────────────────────────────── */
.acct-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.acct-overlay[hidden] { display: none; }

.acct-box {
    background: var(--chat-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 32px;
    width: 100%;
    max-width: 480px;
    position: relative;
}
.acct-box-sm { max-width: 400px; }

.acct-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.acct-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.acct-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}
.acct-close:hover { color: var(--text-primary); }

.acct-section { margin-bottom: 4px; }
.acct-section h3 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.acct-plan-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.acct-usage {
    font-size: 12px;
    color: var(--text-secondary);
}

.acct-cancel-notice {
    font-size: 12px;
    color: #f59e0b;
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

.acct-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.acct-btn {
    width: 100%;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--sidebar-bg);
    color: var(--text-primary);
    text-align: left;
    transition: background 0.15s;
}
.acct-btn:hover { background: var(--border); }
.acct-btn:disabled { opacity: 0.5; cursor: default; }

.acct-btn-warn {
    border-color: #f59e0b44;
    color: #f59e0b;
    background: rgba(245,158,11,0.08);
}
.acct-btn-warn:hover { background: rgba(245,158,11,0.18); }

.acct-btn-danger {
    border-color: #ef444444;
    color: #ef4444;
    background: rgba(239,68,68,0.08);
}
.acct-btn-danger:hover { background: rgba(239,68,68,0.18); }
.acct-btn-danger:disabled { opacity: 0.4; cursor: default; background: rgba(239,68,68,0.08); }

.acct-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

.acct-danger-zone h3 { color: #ef4444; }
.acct-danger-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.acct-confirm-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}
.acct-confirm-actions .acct-btn { flex: 1; text-align: center; }

.acct-type-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 14px 0 6px;
}

.acct-text-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--input-bg, var(--sidebar-bg));
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
}
.acct-text-input:focus {
    outline: none;
    border-color: #ef4444;
}

/* Responsive */
@media (max-width: 768px) {
    #app {
        flex-direction: column;
    }

    #sidebar {
        width: 100%;
        min-width: unset;
        height: auto;
        max-height: 120px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    #sidebar-header {
        display: none;
    }

    #conversation-list {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 4px;
        padding: 8px;
    }

    .conversation-item {
        flex-shrink: 0;
        flex-wrap: nowrap;
        padding: 6px 10px;
    }

    #sidebar-footer {
        display: none;
    }

    #chat-panel {
        width: 100%;
        min-width: unset;
        flex: 1;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    #map-panel {
        height: 40%;
        flex: none;
    }
}
