/* ========================================
   PARKER - Personal AI Operating Agent
   Design System & Styles
   ======================================== */

:root {
    --color-primary: #fedd00;
    --color-primary-dark: #e5c700;
    --color-background: #0d000a;
    --color-surface: #1a0a14;
    --color-surface-elevated: #261420;
    --color-surface-glass: rgba(26, 10, 20, 0.85);
    --color-text-primary: #f3f2f2;
    --color-text-secondary: rgba(243, 242, 242, 0.65);
    --color-text-muted: rgba(243, 242, 242, 0.4);
    --color-text-inverse: #0d000a;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    --color-border: rgba(243, 242, 242, 0.08);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-xxl: 48px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --text-xs: 11px;
    --text-sm: 13px;
    --text-base: 15px;
    --text-lg: 17px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 32px;
    --header-height: 56px;
    --nav-height: 64px;
    --max-width: 430px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-sans); font-size: var(--text-base); line-height: 1.5;
    color: var(--color-text-primary); background: var(--color-background);
    overflow: hidden; height: 100vh; height: 100dvh; width: 100vw;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
#app { position: relative; width: 100%; height: 100%; max-width: var(--max-width); margin: 0 auto; background: var(--color-background); overflow: hidden; }
.view { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; flex-direction: column; background: var(--color-background); z-index: 1; }
.view--active { display: flex; z-index: 10; }

.page-header { position: sticky; top: 0; z-index: 50; background: rgba(13, 0, 10, 0.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--color-border); padding-top: env(safe-area-inset-top); flex-shrink: 0; }
.page-header-content { display: flex; align-items: center; justify-content: space-between; height: var(--header-height); padding: 0 var(--space-md); gap: var(--space-sm); }
.page-header-title { font-size: var(--text-lg); font-weight: 600; color: var(--color-text-primary); flex: 1; text-align: center; }
.header-greeting { display: flex; flex-direction: column; }
.header-greeting span { font-size: var(--text-sm); color: var(--color-text-secondary); }
.header-greeting h2 { font-size: var(--text-xl); font-weight: 700; color: var(--color-text-primary); line-height: 1.2; }
.header-brand { display: flex; align-items: center; gap: var(--space-sm); }
.header-brand-icon { width: 32px; height: 32px; background: var(--color-primary); color: var(--color-text-inverse); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.header-brand-title { font-size: var(--text-base); font-weight: 600; color: var(--color-text-primary); line-height: 1.2; }
.header-brand-status { font-size: var(--text-xs); color: var(--color-success); display: flex; align-items: center; gap: 4px; }
.header-brand-status::before { content: ""; width: 6px; height: 6px; background: var(--color-success); border-radius: 50%; display: inline-block; }
.header-btn { width: 40px; height: 40px; border-radius: var(--radius-full); border: none; background: var(--color-surface); color: var(--color-text-primary); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background var(--transition-fast); flex-shrink: 0; }
.header-btn:active { background: var(--color-surface-elevated); transform: scale(0.95); }
.header-btn--back { background: transparent; }

.page-content { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: var(--space-md); padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom)); }
.page-content--with-nav { padding-bottom: calc(var(--nav-height) + var(--space-md) + env(safe-area-inset-bottom)); }
.page-content::-webkit-scrollbar { display: none; }

.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: var(--max-width); height: calc(var(--nav-height) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(13, 0, 10, 0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--color-border); display: flex; align-items: center; justify-content: space-around; z-index: 100; }
.nav-item { flex: 1; height: var(--nav-height); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: none; border: none; color: var(--color-text-muted); font-size: var(--text-xs); font-weight: 500; cursor: pointer; transition: color var(--transition-fast); padding: 0; }
.nav-item svg { transition: transform var(--transition-fast); }
.nav-item--active { color: var(--color-primary); }
.nav-item--active svg { transform: translateY(-2px); }
.nav-item:active { color: var(--color-primary-dark); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); border-radius: var(--radius-md); border: none; font-size: var(--text-base); font-weight: 600; cursor: pointer; transition: all var(--transition-fast); min-height: 48px; -webkit-touch-callout: none; }
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--color-primary); color: var(--color-text-inverse); }
.btn--primary:active { background: var(--color-primary-dark); }
.btn--secondary { background: var(--color-surface); color: var(--color-text-primary); border: 1px solid var(--color-border); }
.btn--ghost { background: transparent; color: var(--color-text-secondary); border: 1px solid var(--color-border); }
.btn--full { width: 100%; }

.input-group { margin-bottom: var(--space-md); }
.input-group--half { flex: 1; }
.input-label { display: block; font-size: var(--text-sm); font-weight: 500; color: var(--color-text-secondary); margin-bottom: var(--space-xs); }
.input-field { width: 100%; padding: var(--space-md); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); color: var(--color-text-primary); font-size: var(--text-base); font-family: inherit; outline: none; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); -webkit-appearance: none; }
.input-field:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(254, 221, 0, 0.15); }
.input-field::placeholder { color: var(--color-text-muted); }
.input-prefix { position: relative; display: flex; align-items: center; }
.input-prefix-text { position: absolute; left: var(--space-md); font-size: var(--text-base); font-weight: 600; color: var(--color-text-secondary); pointer-events: none; }
.input-field--prefixed { padding-left: 52px; }
.input-row { display: flex; gap: var(--space-md); }
select.input-field { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23f3f2f2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 40px; }

.auth-container { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; padding: var(--space-xl); background: linear-gradient(180deg, var(--color-background) 0%, var(--color-surface) 100%); }
.auth-brand { text-align: center; margin-bottom: var(--space-xxl); }
.auth-logo { width: 64px; height: 64px; background: var(--color-primary); color: var(--color-text-inverse); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; margin: 0 auto var(--space-lg); box-shadow: 0 8px 32px rgba(254, 221, 0, 0.2); }
.auth-logo svg { width: 32px; height: 32px; }
.auth-title { font-size: var(--text-3xl); font-weight: 800; color: var(--color-text-primary); margin-bottom: var(--space-xs); letter-spacing: -0.5px; }
.auth-subtitle { font-size: var(--text-base); color: var(--color-text-secondary); font-weight: 400; }
.auth-form { width: 100%; max-width: 320px; }
.auth-hint { text-align: center; font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-lg); line-height: 1.4; }

.briefing-card { background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-elevated) 100%); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-lg); margin-bottom: var(--space-lg); }
.briefing-header { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.briefing-icon { width: 28px; height: 28px; background: var(--color-primary); color: var(--color-text-inverse); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.briefing-label { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--color-primary); }
.briefing-text { font-size: var(--text-base); line-height: 1.6; color: var(--color-text-primary); }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md); margin-bottom: var(--space-lg); }
.stat-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-lg); cursor: pointer; transition: all var(--transition-fast); }
.stat-card:active { transform: scale(0.98); border-color: var(--color-primary); }
.stat-icon { width: 36px; height: 36px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-sm); }
.stat-icon--task { background: rgba(34, 197, 94, 0.15); color: var(--color-success); }
.stat-icon--expense { background: rgba(254, 221, 0, 0.15); color: var(--color-primary); }
.stat-icon--calendar { background: rgba(59, 130, 246, 0.15); color: var(--color-info); }
.stat-icon--message { background: rgba(239, 68, 68, 0.15); color: var(--color-danger); }
.stat-value { font-size: var(--text-2xl); font-weight: 800; color: var(--color-text-primary); line-height: 1.2; margin-bottom: 2px; }
.stat-label { font-size: var(--text-sm); color: var(--color-text-secondary); }

.section-block { margin-bottom: var(--space-lg); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-md); }
.section-title { font-size: var(--text-lg); font-weight: 700; color: var(--color-text-primary); }
.section-action { background: none; border: none; color: var(--color-primary); font-size: var(--text-sm); font-weight: 600; cursor: pointer; padding: var(--space-xs) var(--space-sm); }

.task-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.task-item { display: flex; align-items: flex-start; gap: var(--space-md); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-md); transition: all var(--transition-fast); }
.task-item--completed { opacity: 0.6; }
.task-item--completed .task-title { text-decoration: line-through; color: var(--color-text-muted); }
.task-checkbox { width: 22px; height: 22px; border-radius: var(--radius-full); border: 2px solid var(--color-border); background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; margin-top: 2px; transition: all var(--transition-fast); }
.task-checkbox--checked { background: var(--color-success); border-color: var(--color-success); color: white; }
.task-content { flex: 1; min-width: 0; }
.task-title { font-size: var(--text-base); font-weight: 500; color: var(--color-text-primary); margin-bottom: 2px; word-break: break-word; }
.task-meta { display: flex; align-items: center; gap: var(--space-sm); font-size: var(--text-xs); color: var(--color-text-muted); }
.task-priority { padding: 2px 6px; border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; }
.task-priority--high { background: rgba(239, 68, 68, 0.15); color: var(--color-danger); }
.task-priority--medium { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.task-priority--low { background: rgba(34, 197, 94, 0.15); color: var(--color-success); }
.task-actions { display: flex; gap: var(--space-xs); }
.task-btn { width: 32px; height: 32px; border-radius: var(--radius-full); border: none; background: transparent; color: var(--color-text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.task-btn:active { background: var(--color-surface-elevated); color: var(--color-text-primary); }

.expense-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.expense-item { display: flex; align-items: center; gap: var(--space-md); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-md); }
.expense-icon { width: 40px; height: 40px; background: rgba(254, 221, 0, 0.1); color: var(--color-primary); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.expense-details { flex: 1; min-width: 0; }
.expense-title { font-size: var(--text-base); font-weight: 500; color: var(--color-text-primary); margin-bottom: 2px; }
.expense-meta { font-size: var(--text-xs); color: var(--color-text-muted); }
.expense-amount { font-size: var(--text-base); font-weight: 700; color: var(--color-text-primary); flex-shrink: 0; }

.expense-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-sm); margin-bottom: var(--space-lg); }
.expense-summary-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-md); text-align: center; }
.expense-summary-label { display: block; font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-xs); }
.expense-summary-value { display: block; font-size: var(--text-sm); font-weight: 700; color: var(--color-text-primary); }

.plan-timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.plan-timeline::before { content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px; background: var(--color-border); }
.timeline-item { display: flex; align-items: flex-start; gap: var(--space-md); padding: var(--space-md) 0; position: relative; }
.timeline-dot { width: 10px; height: 10px; background: var(--color-primary); border-radius: 50%; margin-top: 6px; margin-left: 15px; flex-shrink: 0; position: relative; z-index: 2; }
.timeline-dot--past { background: var(--color-text-muted); }
.timeline-content { flex: 1; }
.timeline-time { font-size: var(--text-xs); font-weight: 600; color: var(--color-primary); margin-bottom: 2px; }
.timeline-title { font-size: var(--text-base); font-weight: 500; color: var(--color-text-primary); }
.timeline-desc { font-size: var(--text-sm); color: var(--color-text-secondary); margin-top: 2px; }

.chat-container { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: var(--space-md); padding-bottom: var(--space-md); display: flex; flex-direction: column; gap: var(--space-md); }
.chat-container::-webkit-scrollbar { display: none; }
.chat-message { display: flex; gap: var(--space-sm); max-width: 85%; animation: messageIn 0.3s ease; }
@keyframes messageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.chat-message--user { align-self: flex-end; flex-direction: row-reverse; }
.chat-message--agent { align-self: flex-start; }
.chat-avatar { width: 28px; height: 28px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: var(--text-xs); font-weight: 700; }
.chat-avatar--user { background: var(--color-surface-elevated); color: var(--color-text-secondary); }
.chat-avatar--agent { background: var(--color-primary); color: var(--color-text-inverse); }
.chat-bubble { padding: var(--space-md); border-radius: var(--radius-lg); font-size: var(--text-base); line-height: 1.5; word-break: break-word; }
.chat-bubble--user { background: var(--color-primary); color: var(--color-text-inverse); border-bottom-right-radius: var(--space-xs); }
.chat-bubble--agent { background: var(--color-surface); color: var(--color-text-primary); border: 1px solid var(--color-border); border-bottom-left-radius: var(--space-xs); }
.chat-bubble--action { background: var(--color-surface-elevated); border: 1px solid var(--color-primary); }
.chat-meta { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 4px; padding: 0 4px; }
.chat-message--user .chat-meta { text-align: right; }

.action-preview { background: rgba(254, 221, 0, 0.05); border: 1px solid rgba(254, 221, 0, 0.2); border-radius: var(--radius-md); padding: var(--space-md); margin-top: var(--space-sm); }
.action-preview-header { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--color-primary); margin-bottom: var(--space-sm); }
.action-preview-row { display: flex; justify-content: space-between; padding: var(--space-xs) 0; border-bottom: 1px solid var(--color-border); font-size: var(--text-sm); }
.action-preview-row:last-child { border-bottom: none; }
.action-preview-label { color: var(--color-text-muted); }
.action-preview-value { color: var(--color-text-primary); font-weight: 500; text-align: right; max-width: 60%; word-break: break-word; }
.action-preview-buttons { display: flex; gap: var(--space-sm); margin-top: var(--space-md); }
.action-preview-buttons .btn { flex: 1; min-height: 40px; font-size: var(--text-sm); }

#view-chat { padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom)); }
.chat-composer { background: rgba(13, 0, 10, 0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--color-border); padding: var(--space-sm) var(--space-md); padding-bottom: calc(var(--space-sm) + env(safe-area-inset-bottom)); flex-shrink: 0; position: relative; z-index: 150; }
.composer-toolbar { display: flex; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.composer-input-wrap { display: flex; align-items: center; gap: var(--space-sm); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); padding: 4px 4px 4px var(--space-md); }
.composer-input { flex: 1; background: none; border: none; color: var(--color-text-primary); font-size: var(--text-base); font-family: inherit; outline: none; padding: var(--space-sm) 0; min-height: 40px; }
.composer-input::placeholder { color: var(--color-text-muted); }
.composer-btn { width: 40px; height: 40px; border-radius: var(--radius-full); border: none; background: transparent; color: var(--color-text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: all var(--transition-fast); }
.composer-btn:active { background: var(--color-surface-elevated); color: var(--color-text-primary); }
.composer-btn--send { background: var(--color-primary); color: var(--color-text-inverse); }
.composer-btn--send:active { background: var(--color-primary-dark); }
.composer-btn--mic { color: var(--color-text-secondary); }
.composer-btn--mic.recording { background: var(--color-danger); color: white; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

.quick-actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); padding: var(--space-md) 0; }
.quick-action-btn { display: flex; flex-direction: column; align-items: center; gap: var(--space-sm); background: none; border: none; color: var(--color-text-primary); font-size: var(--text-sm); font-weight: 500; cursor: pointer; padding: var(--space-md); border-radius: var(--radius-md); transition: background var(--transition-fast); }
.quick-action-btn:active { background: var(--color-surface); }
.quick-action-icon { width: 48px; height: 48px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; }

.sheet { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 200; display: none; flex-direction: column; justify-content: flex-end; }
.sheet--open { display: flex; }
.sheet-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); animation: fadeIn 0.2s ease; }
.sheet-content { position: relative; background: var(--color-surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: var(--space-lg); padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom)); max-height: 85vh; overflow-y: auto; animation: slideUp 0.3s ease; z-index: 1; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-lg); }
.sheet-title { font-size: var(--text-lg); font-weight: 700; color: var(--color-text-primary); }
.sheet-close { width: 32px; height: 32px; border-radius: var(--radius-full); border: none; background: var(--color-surface-elevated); color: var(--color-text-primary); display: flex; align-items: center; justify-content: center; cursor: pointer; }

.filter-bar { display: flex; gap: var(--space-sm); margin-bottom: var(--space-md); overflow-x: auto; padding-bottom: var(--space-xs); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip { padding: var(--space-sm) var(--space-md); border-radius: var(--radius-full); border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-secondary); font-size: var(--text-sm); font-weight: 500; cursor: pointer; white-space: nowrap; transition: all var(--transition-fast); -webkit-appearance: none; }
.filter-chip--active { background: var(--color-primary); color: var(--color-text-inverse); border-color: var(--color-primary); }
.filter-chip:active { transform: scale(0.95); }

.calendar-day-header { display: flex; align-items: center; justify-content: space-between; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-md); margin-bottom: var(--space-lg); }
.calendar-nav { width: 36px; height: 36px; border-radius: var(--radius-full); border: none; background: var(--color-surface-elevated); color: var(--color-text-primary); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.calendar-nav:active { background: var(--color-border); }
.calendar-current { text-align: center; }
.calendar-day-name { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--color-primary); text-transform: uppercase; letter-spacing: 0.5px; }
.calendar-date { display: block; font-size: var(--text-base); color: var(--color-text-primary); font-weight: 500; }

.settings-group { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); margin-bottom: var(--space-lg); overflow: hidden; }
.settings-header { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--color-border); font-size: var(--text-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--color-text-secondary); }
.settings-item { display: flex; align-items: center; justify-content: space-between; padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--color-border); cursor: pointer; transition: background var(--transition-fast); }
.settings-item:last-child { border-bottom: none; }
.settings-item:active { background: var(--color-surface-elevated); }
.settings-item--toggle { cursor: default; }
.settings-item-label { font-size: var(--text-base); color: var(--color-text-primary); font-weight: 500; }
.settings-item-value { font-size: var(--text-sm); color: var(--color-text-secondary); }
.settings-item-desc { display: block; font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }

.toggle { width: 48px; height: 28px; border-radius: var(--radius-full); position: relative; cursor: pointer; transition: background var(--transition-fast); flex-shrink: 0; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; background: white; border-radius: 50%; transition: transform var(--transition-fast); box-shadow: var(--shadow-sm); }
.toggle--on { background: var(--color-primary); }
.toggle--on::after { transform: translateX(20px); }
.toggle--off { background: var(--color-surface-elevated); border: 1px solid var(--color-border); }
.toggle--off::after { transform: translateX(0); background: var(--color-text-muted); }

.toast { position: fixed; bottom: calc(var(--nav-height) + var(--space-lg) + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%) translateY(100px); background: var(--color-surface-elevated); color: var(--color-text-primary); padding: var(--space-md) var(--space-xl); border-radius: var(--radius-full); font-size: var(--text-sm); font-weight: 500; box-shadow: var(--shadow-lg); border: 1px solid var(--color-border); z-index: 300; opacity: 0; transition: all 0.3s ease; pointer-events: none; white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; }
.toast--show { transform: translateX(-50%) translateY(0); opacity: 1; }

.voice-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(13, 0, 10, 0.95); z-index: 400; display: none; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-xl); }
.voice-overlay--active { display: flex; }
.voice-pulse { width: 80px; height: 80px; background: var(--color-primary); border-radius: 50%; opacity: 0.3; animation: voicePulse 2s infinite; }
.voice-pulse--2 { position: absolute; animation-delay: 0.5s; }
.voice-overlay--speaking .voice-pulse { background: var(--color-success, #2ecc71); animation-duration: 1s; }
@keyframes voicePulse { 0% { transform: scale(1); opacity: 0.3; } 50% { transform: scale(1.5); opacity: 0.1; } 100% { transform: scale(1); opacity: 0.3; } }
.voice-text { font-size: var(--text-xl); font-weight: 600; color: var(--color-text-primary); }
.voice-hint { font-size: var(--text-sm); color: var(--color-text-muted); }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--space-xxl) var(--space-lg); text-align: center; color: var(--color-text-muted); }
.empty-state svg { margin-bottom: var(--space-md); opacity: 0.4; }
.empty-state-title { font-size: var(--text-lg); font-weight: 600; color: var(--color-text-secondary); margin-bottom: var(--space-xs); }
.empty-state-desc { font-size: var(--text-sm); color: var(--color-text-muted); }

.typing-indicator { display: flex; gap: 4px; padding: var(--space-md); }
.typing-indicator span { width: 8px; height: 8px; background: var(--color-text-muted); border-radius: 50%; animation: typingBounce 1.4s infinite ease-in-out both; }
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingBounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

@media (min-width: 431px) { #app { border-left: 1px solid var(--color-border); border-right: 1px solid var(--color-border); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } }
*:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
::selection { background: rgba(254, 221, 0, 0.3); color: var(--color-text-primary); }
