/* ======================================================
   Dwellverse Co-Pilot — Mobile V2 Styles
   Dark theme, safe areas, native feel.
   ====================================================== */

:root {
    --bg: #0a0a0f;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-input: rgba(255, 255, 255, 0.06);
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-muted: #6b6b70;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --success: #34d399;
    --warning: #f59e0b;
    --danger: #f87171;
    --border: rgba(255, 255, 255, 0.06);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --tab-height: 56px;
    --topbar-height: 52px;
    --z-cards: 1;
    --z-tabs: 100;
    --z-orb: 200;
    --z-transcript: 300;
    --z-modal: 400;
    --z-debug: 999999;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html,
body {
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#app {
    height: 100%;
}

/* =================== COPILOT APP =================== */
.copilot-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
}

/* =================== TOP BAR =================== */
.copilot-topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.topbar-greeting {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}
.topbar-right {
    display: flex;
    gap: 4px;
    align-items: center;
}
.topbar-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
}
.topbar-btn:active {
    background: var(--bg-card);
}
.topbar-badge,
.tab-badge {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
.topbar-logout {
    color: var(--text-muted);
}

/* =================== WORKSPACE =================== */
.copilot-workspace {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}
.copilot-cards {
    padding: 12px 12px 20px;
}

/* =================== CARDS (SHARED) =================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
    transition:
        opacity 0.3s,
        transform 0.3s;
}
.card.completed {
    opacity: 0.4;
    transform: scale(0.98);
}
.card.dismissing {
    opacity: 0;
    transform: translateX(100%);
}
.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.card-icon {
    font-size: 1.1rem;
}
.card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}
.empty-card {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 24px 16px;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.section-count {
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
}

/* =================== BRIEFING CARD =================== */
.briefing-stats {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    overflow-x: auto;
}
.stat {
    flex: 1;
    min-width: 56px;
    text-align: center;
    background: var(--bg-input);
    border-radius: 10px;
    padding: 8px 4px;
}
.stat-num {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}
.stat-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.briefing-text {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-secondary);
    white-space: pre-wrap;
}
.briefing-loading {
    color: var(--text-muted);
    font-style: italic;
}

/* =================== ACTION CARDS =================== */
.action-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}
.action-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.action-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.action-btns {
    display: flex;
    gap: 6px;
}
.btn-approve,
.btn-send {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-approve:active,
.btn-send:active {
    opacity: 0.8;
}
.btn-approve:disabled,
.btn-send:disabled {
    opacity: 0.5;
}
.btn-skip,
.btn-dismiss,
.btn-cancel,
.btn-review {
    background: none;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 0.78rem;
    cursor: pointer;
}
.btn-skip:active,
.btn-dismiss:active {
    background: var(--bg-card);
}
.action-status,
.draft-status {
    font-size: 0.72rem;
    margin-top: 6px;
}
.action-status.success,
.draft-status.success {
    color: var(--success);
}
.action-status.error,
.draft-status.error {
    color: var(--danger);
}

/* =================== DRAFT CARDS =================== */
.draft-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.draft-lead {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}
.draft-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}
.draft-subject {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.draft-btns {
    display: flex;
    gap: 6px;
}
.draft-editor {
    margin-top: 8px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}
.draft-editor label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 2px;
    margin-top: 8px;
}
.draft-editor label:first-child {
    margin-top: 0;
}
.draft-editor input,
.draft-editor textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.82rem;
    padding: 8px 10px;
    outline: none;
    font-family: inherit;
}
.draft-editor textarea {
    resize: vertical;
    line-height: 1.5;
}
.draft-editor input:focus,
.draft-editor textarea:focus {
    border-color: var(--accent);
}
.draft-editor-btns {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

/* =================== LEAD SEARCH =================== */
.lead-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.lead-search-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
    padding: 10px 14px;
    outline: none;
    font-family: inherit;
    -webkit-appearance: none;
}
.lead-search-input:focus {
    border-color: var(--accent);
}
.lead-search-input::placeholder {
    color: var(--text-muted);
}
.lead-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* =================== QUICK ADD LEAD =================== */
.lead-add-btn {
    width: 38px;
    height: 38px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: 300;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}
.lead-add-btn:active {
    opacity: 0.8;
}
.quick-add-form {
    padding: 14px 16px !important;
    margin-bottom: 10px;
}
.quick-add-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}
.quick-add-input,
.quick-add-select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 16px;
    padding: 10px 12px;
    outline: none;
    font-family: inherit;
    margin-bottom: 8px;
    -webkit-appearance: none;
}
.quick-add-input:focus,
.quick-add-select:focus {
    border-color: var(--accent);
}
.quick-add-input::placeholder {
    color: var(--text-muted);
}
.quick-add-row {
    display: flex;
    gap: 8px;
}
.quick-add-row select {
    flex: 1;
}
.quick-add-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.quick-add-save {
    flex: 1;
    padding: 11px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}
.quick-add-save:active {
    opacity: 0.85;
}
.quick-add-save:disabled {
    opacity: 0.5;
}
.quick-add-cancel {
    padding: 11px 18px;
    background: none;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.88rem;
    cursor: pointer;
}
.quick-add-status {
    font-size: 0.75rem;
    text-align: center;
    margin-top: 6px;
    min-height: 18px;
}
.quick-add-status.success {
    color: var(--success);
}
.quick-add-status.error {
    color: var(--danger);
}

/* =================== CALL CARDS =================== */
.call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}
.call-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
}
.call-urgency {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid;
}
.call-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.call-actions {
    display: flex;
    gap: 6px;
}
.call-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px; /* 44px touch target (WCAG 2.5.5) */
    font-size: 0.72rem;
    padding: 5px 12px;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--bg-input);
    box-sizing: border-box;
}
.call-btn:active {
    background: var(--bg-card-hover);
}
.call-phone {
    color: var(--success);
    border-color: rgba(52, 211, 153, 0.2);
}
.call-text {
    color: #a78bfa;
    border-color: rgba(167, 139, 250, 0.2);
}
.call-email {
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.2);
}

/* =================== DEAL CARDS =================== */
.deal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}
.deal-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}
.deal-closing {
    font-size: 0.72rem;
    font-weight: 600;
}
.deal-addr {
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.deal-stage {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.deal-alerts {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
}
.deal-alert {
    font-size: 0.72rem;
    font-weight: 500;
}

/* Deal card extras */
.deal-progress {
    margin-top: 6px;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}
.deal-progress-fill {
    height: 100%;
    background: #34d399;
    border-radius: 2px;
    transition: width 0.3s;
}
.deal-progress-label {
    position: absolute;
    right: 0;
    top: -14px;
    font-size: 0.6rem;
    color: var(--text-muted);
}
.deal-tap-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 6px;
    opacity: 0.5;
}

/* =================== DEAL DETAIL (Deal Room) =================== */
.deal-detail {
    padding-bottom: 20px;
}
.dd-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 12px;
}
.dd-back {
    background: none;
    border: none;
    color: var(--accent, #818cf8);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    flex-shrink: 0;
}
.dd-header-info {
    flex: 1;
    min-width: 0;
}
.dd-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}
.dd-subtitle {
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.dd-closing {
    text-align: right;
    flex-shrink: 0;
}
.dd-closing-date {
    font-size: 0.75rem;
    font-weight: 500;
}
.dd-closing-days {
    font-size: 0.68rem;
    font-weight: 600;
}

/* Stage bar */
.dd-stage-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.dd-stage-select {
    flex: 1;
    font-size: 0.8rem;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    -webkit-appearance: none;
}
.dd-type-badge {
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
    font-weight: 600;
    text-transform: capitalize;
}

/* Quick stats */
.dd-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}
.dd-stat {
    text-align: center;
    padding: 8px 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.dd-stat-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
}
.dd-stat-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Quick actions */
.dd-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.dd-action-btn {
    flex: 1;
    padding: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
    text-align: center;
}
.dd-action-btn:active {
    background: rgba(255, 255, 255, 0.08);
}

/* Accordion sections */
.dd-sections {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dd-section {
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}
.dd-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.dd-section-header::after {
    content: '▸';
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.dd-section.open .dd-section-header::after {
    transform: rotate(90deg);
}
.dd-section-count {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-right: 8px;
}
.dd-section-body {
    display: none;
    padding: 0 14px 12px;
}
.dd-section.open .dd-section-body {
    display: block;
}
.dd-empty {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    padding: 12px;
}

/* Progress bar */
.dd-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}
.dd-progress-fill {
    height: 100%;
    background: #34d399;
    border-radius: 3px;
    transition: width 0.3s;
}

/* Checklist */
.dd-check-group {
    margin-bottom: 10px;
}
.dd-check-group-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}
.dd-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}
.dd-check-item.done .dd-check-label {
    text-decoration: line-through;
    opacity: 0.5;
}
.dd-check-toggle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dd-check-toggle.done {
    background: rgba(52, 211, 153, 0.15);
    border-color: #34d399;
    color: #34d399;
}
.dd-check-label {
    font-size: 0.78rem;
    color: var(--text);
}

/* Deadlines */
.dd-dl-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.dd-dl-item:last-child {
    border-bottom: none;
}
.dd-dl-name {
    font-size: 0.78rem;
    color: var(--text);
}
.dd-dl-date {
    font-size: 0.68rem;
    color: var(--text-muted);
}
.dd-dl-btns {
    display: flex;
    gap: 4px;
}
.dd-dl-action {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}
.dd-dl-action:active {
    background: rgba(255, 255, 255, 0.08);
}

/* Documents */
.dd-doc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.dd-doc-item:last-child {
    border-bottom: none;
}
.dd-doc-status {
    font-size: 1rem;
    flex-shrink: 0;
}
.dd-doc-name {
    flex: 1;
    font-size: 0.78rem;
    color: var(--text);
}
.dd-doc-status-label {
    font-size: 0.65rem;
    text-transform: capitalize;
}

/* Parties */
.dd-party-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.dd-party-item:last-child {
    border-bottom: none;
}
.dd-party-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
}
.dd-party-role {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: capitalize;
}
.dd-party-actions {
    display: flex;
    gap: 4px;
}
.dd-party-btn {
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: var(--accent, #818cf8);
    cursor: pointer;
    text-decoration: none;
}
.dd-party-btn:active {
    background: rgba(255, 255, 255, 0.08);
}

/* Financials */
.dd-fin-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dd-fin-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    padding: 3px 0;
}
.dd-fin-row span:first-child {
    color: var(--text-muted);
}
.dd-fin-row span:last-child {
    color: var(--text);
    font-weight: 500;
}

/* =================== TASK CARDS =================== */
.task-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.task-check {
    background: none;
    border: 2px solid var(--border);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}
.task-check.done {
    border-color: var(--success);
    color: var(--success);
}
.task-card.completing {
    opacity: 0.4;
}
.task-content {
    flex: 1;
    min-width: 0;
}
.task-title {
    font-size: 0.82rem;
    color: var(--text);
    font-weight: 500;
}
.task-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.task-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}
.task-priority {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}
.task-due {
    font-size: 0.65rem;
    font-weight: 500;
}
.task-card.compact {
    padding: 10px 14px;
}

/* =================== CHAT (VOICE-FIRST) =================== */
.chat-overlay {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--topbar-height) - var(--tab-height) - var(--safe-top) - var(--safe-bottom));
}
.chat-orb-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0 12px;
    flex-shrink: 0;
    cursor: pointer;
}
.chat-transcript {
    text-align: center;
    min-height: 28px;
    padding: 0 16px;
    flex-shrink: 0;
}
.transcript-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.transcript-text.listening {
    color: var(--success);
}
.transcript-text.thinking {
    color: var(--accent);
}
.chat-welcome-voice {
    color: var(--text-muted);
    font-size: 0.78rem;
    padding: 4px 0;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 12px 8px;
}
.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    margin-bottom: 8px;
    font-size: 0.82rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.chat-msg.user {
    background: var(--accent);
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}
.chat-msg.ai {
    background: var(--bg-card);
    color: var(--text-secondary);
    border-bottom-left-radius: 4px;
}
.chat-msg.error {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger);
    text-align: center;
    max-width: 100%;
    font-size: 0.78rem;
}
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}
.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingBounce 1.2s infinite;
}
.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}
.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes typingBounce {
    0%,
    80%,
    100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-6px);
    }
}
.chat-input-row {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    align-items: flex-end;
}
.chat-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: 0.85rem;
    padding: 10px 16px;
    outline: none;
    resize: none;
    font-family: inherit;
    min-height: 40px;
    max-height: 120px;
}
.chat-input:focus {
    border-color: var(--accent);
}
.chat-send-btn {
    background: var(--accent);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chat-send-btn:active {
    opacity: 0.8;
}
.chat-send-btn:disabled {
    opacity: 0.4;
}

/* =================== WEEK AHEAD =================== */
.week-card {
    padding: 0;
    overflow: hidden;
}
.week-day {
    border-bottom: 1px solid var(--border);
}
.week-day:last-child {
    border-bottom: none;
}
.week-day-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
}
.week-day.today .week-day-header {
    background: rgba(99, 102, 241, 0.06);
}
.week-day-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 36px;
    flex-shrink: 0;
}
.week-day-name {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.week-day.today .week-day-name {
    color: var(--accent);
}
.week-day-num {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.week-day.today .week-day-num {
    color: var(--accent);
}
.week-day-label {
    flex: 1;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.week-day.today .week-day-label {
    color: var(--text-secondary);
    font-weight: 500;
}
.week-day-count {
    font-size: 0.65rem;
    background: var(--accent);
    color: #fff;
    padding: 2px 7px;
    border-radius: 8px;
    font-weight: 700;
}
.week-day-items {
    padding: 0 14px 10px 60px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.week-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.week-item.overdue .week-item-title {
    color: var(--danger);
}
.week-item-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.week-item-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.week-item-overdue {
    font-size: 0.6rem;
    color: var(--danger);
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* =================== DRIP CAMPAIGNS =================== */
.drip-list-card {
    padding: 0;
    overflow: hidden;
}
.drip-row {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.drip-row:last-child {
    border-bottom: none;
}
.drip-row-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}
.drip-lead-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
}
.drip-status {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.drip-campaign-name {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.drip-progress-bar {
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
}
.drip-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}
.drip-progress-text {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* =================== CENTER TAB ORB =================== */
.tab-orb-slot {
    flex: 0 0 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.tab-orb-container {
    position: absolute;
    bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-orb);
}
.orb-canvas-wrap {
    width: 72px;
    height: 72px;
    cursor: pointer;
    filter: drop-shadow(0 0 14px var(--accent-glow));
    transition: transform 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}
.orb-canvas-wrap:active {
    transform: scale(0.88);
}
.orb-canvas-wrap canvas {
    pointer-events: none;
}
.orb-transcript {
    position: fixed;
    bottom: calc(var(--tab-height) + var(--safe-bottom) + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    z-index: var(--z-transcript);
    max-width: 300px;
    width: calc(100% - 48px);
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
    padding: 12px 16px;
    border-radius: 16px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.2s,
        transform 0.2s;
}
.orb-transcript.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.orb-transcript.listening {
    color: var(--success);
}
.orb-transcript.thinking {
    color: var(--accent);
}
.orb-transcript.response {
    color: var(--text);
}
.orb-transcript.error {
    color: var(--danger);
}
.orb-text-input {
    display: flex;
    gap: 6px;
    position: fixed;
    bottom: calc(var(--tab-height) + var(--safe-bottom) + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: calc(100% - 48px);
    max-width: 320px;
    z-index: var(--z-transcript);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.2s,
        transform 0.2s;
}
.orb-text-input.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.orb-text-input input {
    flex: 1;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid var(--accent);
    border-radius: 22px;
    color: var(--text);
    font-size: 16px; /* 16px prevents iOS zoom on focus */
    padding: 10px 16px;
    outline: none;
    font-family: inherit;
    -webkit-appearance: none;
}
.orb-text-input button {
    background: var(--accent);
    border: none;
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

/* =================== BOTTOM TABS =================== */
.copilot-tabs {
    height: var(--tab-height);
    display: flex;
    border-top: 1px solid var(--border);
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-shrink: 0;
    padding: 0 4px;
}
.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    padding: 4px 0;
    transition: color 0.2s;
}
.tab-btn.active {
    color: var(--accent);
}
.tab-btn:active {
    color: var(--text);
}
.tab-label {
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.2px;
}
.tab-badge {
    top: 4px;
    right: calc(50% - 18px);
}

/* =================== LOGIN =================== */
.login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 24px;
}
.login-logo {
    text-align: center;
    margin-bottom: 40px;
}
.login-logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 16px;
}
.login-logo p {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}
/* Firework orb mounts */
.login-orb-mount {
    width: 120px;
    height: 120px;
    margin: 0 auto;
}
.loading-orb-mount {
    width: 50px;
    height: 50px;
    margin-bottom: 16px;
}
.chat-thinking-orb {
    width: 32px;
    height: 32px;
}
.firework-orb-canvas {
    display: block;
}
.login-google-btn {
    width: 100%;
    max-width: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition:
        background 0.2s,
        border-color 0.2s;
}
.login-google-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}
.login-google-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}
.login-divider {
    width: 100%;
    max-width: 320px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0;
    color: #4b5563;
    font-size: 0.75rem;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}
.login-form {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.login-form input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
}
.login-form input:focus {
    border-color: var(--accent);
}
.login-form input::placeholder {
    color: var(--text-muted);
}
#loginBtn {
    padding: 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
}
#loginBtn:active {
    opacity: 0.85;
}
#loginBtn:disabled {
    opacity: 0.5;
}
.login-powered {
    font-size: 0.65rem !important;
    color: #818cf8 !important;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 500;
    margin-top: 6px;
}
.login-error {
    color: var(--danger);
    font-size: 0.82rem;
    text-align: center;
    min-height: 20px;
}

/* =================== NOTIFICATION PANEL =================== */
.notif-panel {
    position: fixed;
    top: calc(var(--topbar-height) + var(--safe-top));
    right: 0;
    width: 100%;
    max-width: 360px;
    max-height: 60vh;
    background: #1a1a2e;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.notif-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}
.notif-header-btns {
    display: flex;
    gap: 6px;
    align-items: center;
}
.notif-speak-btn,
.notif-markall-btn {
    font-size: 0.68rem;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.notif-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 6px;
}
.notif-list {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}
.notif-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    gap: 8px;
}
.notif-item.unread {
    background: rgba(99, 102, 241, 0.06);
}
.notif-content {
    flex: 1;
    min-width: 0;
}
.notif-msg {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.notif-item.unread .notif-msg {
    color: var(--text);
    font-weight: 500;
}
.notif-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.notif-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    padding: 2px;
}
.notif-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 30px 16px;
}

/* =================== COMPOSE MODAL =================== */
.compose-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-modal);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: var(--safe-top) 0 var(--safe-bottom) 0;
}
.compose-modal {
    width: 100%;
    max-width: 500px;
    height: 85vh;
    background: #1a1a2e;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}
.compose-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: #1a1a2e;
}
.compose-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}
.compose-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
}
/* compose-generating styles moved to sending overlay section below */
.compose-form {
    padding: 12px 16px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.compose-form label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
}
.compose-form label:first-child {
    margin-top: 0;
}
.compose-to,
.compose-subject,
.compose-body {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.85rem;
    padding: 10px 12px;
    outline: none;
    font-family: inherit;
}
.compose-to[readonly] {
    color: var(--text-muted);
}
.compose-subject:focus,
.compose-body:focus {
    border-color: var(--accent);
}
.compose-body {
    resize: none;
    line-height: 1.5;
    min-height: 120px;
    flex: 1;
}
.compose-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}
.compose-send-btn {
    flex: 1;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}
.compose-send-btn:active {
    opacity: 0.85;
}
.compose-send-btn:disabled {
    opacity: 0.5;
}
.compose-cancel-btn {
    padding: 12px 20px;
    background: none;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.88rem;
    cursor: pointer;
}
.compose-status {
    text-align: center;
    font-size: 0.78rem;
    margin-top: 10px;
    min-height: 20px;
}
.compose-status.success {
    color: var(--success);
}
.compose-status.error {
    color: var(--danger);
}

/* Firework sending overlay */
.compose-sending-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 46, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 20px;
}
.compose-sending-overlay .sending-canvas {
    width: 200px;
    height: 200px;
}
.compose-sending-overlay .sending-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 8px;
    transition: color 0.3s;
}
.compose-generating {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
    color: var(--accent);
    font-size: 0.85rem;
    flex: 1;
}
.compose-generating .sending-canvas {
    width: 150px;
    height: 150px;
}

/* =================== ONBOARDING =================== */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-modal);
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--safe-top) 20px var(--safe-bottom);
}
.onboarding-card {
    width: 100%;
    max-width: 380px;
    text-align: center;
    padding: 20px 0;
}
.onboarding-icon-area {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
.onboarding-emoji {
    font-size: 3.5rem;
}
.onboarding-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    letter-spacing: -0.3px;
}
.onboarding-body {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
    padding: 0 8px;
    margin-bottom: 28px;
    min-height: 100px;
}
.onboarding-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 24px;
}
.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition:
        background 0.3s,
        transform 0.3s;
}
.onboarding-dot.active {
    transform: scale(1.3);
}
.onboarding-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 0 20px;
}
.onboarding-next {
    flex: 1;
    max-width: 200px;
    padding: 14px 24px;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.onboarding-next:active {
    opacity: 0.85;
}
.onboarding-back,
.onboarding-skip {
    padding: 14px 20px;
    background: none;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.88rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.onboarding-progress {
    margin-top: 16px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* =================== LOADING =================== */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.88rem;
}
/* loading-orb replaced by FireworkOrb component */
.cards-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
    font-size: 0.82rem;
}
.ptr-indicator {
    text-align: center;
    color: var(--accent);
    font-size: 0.75rem;
    padding: 8px;
}
