:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface-hover: #22252f;
    --border: #2a2d37;
    --text: #e2e8f0;
    --text-dim: #94a3b8;
    --text-muted: #64748b;
    --accent: #6c63ff;
    --accent-glow: rgba(108, 99, 255, 0.15);
    --success: #34d399;
    --warning: #fbbf24;
    --error: #f87171;
    --planned: #94a3b8;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --header-h: 57px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow: auto;
}

/* Lock body scroll when map is active (prevents Safari bounce/zoom) */
body.map-active {
    overflow: hidden;
    height: 100%;
    position: fixed;
    width: 100%;
}

/* Login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    flex-direction: column;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    width: 380px;
    max-width: 90vw;
    text-align: center;
    box-shadow: var(--shadow);
}

.login-card h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-dim);
    margin-bottom: 32px;
    font-size: 14px;
}

.login-card input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    margin-bottom: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.login-card input:focus {
    border-color: var(--accent);
}

.login-card button {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.login-card button:hover { opacity: 0.9; }

.error-msg {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
}

/* Header */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
}

.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.logout-btn {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.logout-btn:hover {
    color: var(--text);
    border-color: var(--text-dim);
}

/* Main */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
    transition: margin 0.3s ease;
}

/* Full-width mode for ecosystem map */
main.map-view {
    max-width: none;
    padding: 16px;
}

/* Landing page cards */
.landing-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.landing-subtitle {
    color: var(--text-dim);
    margin-bottom: 32px;
    font-size: 15px;
}

.business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.business-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.business-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-accent);
}

.business-card:hover {
    border-color: var(--card-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.card-logo {
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-logo img {
    max-width: 72px;
    max-height: 72px;
    object-fit: contain;
}

.card-logo-text {
    border-radius: 14px;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 1px;
}

.card-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.card-desc {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.card-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--card-accent);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ecosystem map view */
.map-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.back-btn {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.back-btn:hover {
    color: var(--text);
    border-color: var(--text-dim);
}

.map-title {
    font-size: 24px;
    font-weight: 700;
}

.map-icon {
    font-size: 28px;
}

.map-logo {
    height: 48px;
    object-fit: contain;
}

.map-logo.map-logo-sm {
    height: 32px;
}

.map-logo.map-logo-lg {
    height: 64px;
}

.map-container {
    display: flex;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    height: calc(100vh - var(--header-h) - 100px);
    min-height: 400px;
}

.map-svg-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
}

.map-svg-wrap:active { cursor: grabbing; }

.map-svg-wrap svg {
    width: 100%;
    height: 100%;
}

/* SVG node styles */
.node-group { cursor: pointer; transition: opacity 0.3s; }
.node-group:hover .node-bg { filter: brightness(1.2); }

.node-group.selected .node-bg {
    stroke-width: 2.5;
    filter: brightness(1.15);
}

.node-group.connected .node-bg {
    stroke-width: 2;
    filter: brightness(1.08);
}

.node-group.dimmed {
    opacity: 0.35;
}

.node-bg {
    rx: 10;
    ry: 10;
    transition: filter 0.3s, stroke-width 0.3s;
}

.node-icon { font-size: 20px; }
.node-name { font-size: 13px; font-weight: 600; fill: var(--text); }
.node-subtitle { font-size: 10px; fill: var(--text-dim); }

.status-dot {
    r: 5;
    stroke-width: 2;
}

.connection-line {
    fill: none;
    stroke-width: 1.5;
    opacity: 0.5;
    transition: opacity 0.3s, stroke-width 0.3s, filter 0.3s;
}

.connection-line.highlighted {
    opacity: 1;
    stroke-width: 3;
    filter: drop-shadow(0 0 4px currentColor) drop-shadow(0 0 10px currentColor);
}

.connection-line.dimmed {
    opacity: 0.06;
}

.connection-label {
    font-size: 9px;
    fill: var(--text-muted);
}

.group-rect {
    fill: none;
    stroke-dasharray: 8 4;
    stroke-width: 1.5;
    rx: 12;
    ry: 12;
    opacity: 0.3;
}

.group-label {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.5;
}

/* Detail panel — desktop: fixed right side panel */
.detail-panel {
    width: 360px;
    position: fixed;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    background: var(--bg);
    border-left: 1px solid var(--border);
    padding: 24px;
    overflow-y: auto;
    display: none;
    z-index: 10;
}

.detail-panel.active { display: block; }

.detail-close {
    float: right;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
}

.detail-close:hover { color: var(--text); }

.detail-icon { font-size: 36px; margin-bottom: 8px; }

.detail-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.detail-subtitle {
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 16px;
}

.detail-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.detail-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.detail-status.live { background: rgba(52,211,153,0.15); color: var(--success); }
.detail-status.dev { background: rgba(251,191,36,0.15); color: var(--warning); }
.detail-status.building { background: rgba(251,191,36,0.15); color: var(--warning); }
.detail-status.planned { background: rgba(148,163,184,0.15); color: var(--planned); }
.detail-status.local { background: rgba(148,163,184,0.15); color: var(--planned); }
.detail-status.idea { background: rgba(100,116,139,0.15); color: var(--text-muted); }
.detail-status.gap { background: rgba(248,113,113,0.15); color: var(--error); }

/* Open App button — prominent link in detail panel */
/* Deploy type badge in detail panel */
.detail-deploy-type {
    display: inline-block;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.detail-open-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: var(--accent);
    color: white;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    transition: opacity 0.2s;
}

.detail-open-btn:hover { opacity: 0.85; }

.detail-world-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(0,0,0,0.3);
}

.detail-desc {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.detail-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
    margin-top: 20px;
}

.detail-url a {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    word-break: break-all;
}

.detail-url a:hover { text-decoration: underline; }

.detail-flow {
    list-style: none;
    padding: 0;
}

.detail-flow li {
    font-size: 13px;
    color: var(--text-dim);
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.detail-flow li:last-child { border-bottom: none; }

.flow-dir {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.flow-dir.in { background: rgba(52,211,153,0.15); color: var(--success); }
.flow-dir.out { background: rgba(108,99,255,0.15); color: var(--accent); }
.flow-dir.both { background: rgba(251,191,36,0.15); color: var(--warning); }

/* Detail panel — owns/openWhen lists */
.detail-list {
    list-style: none;
    padding: 0;
}

.detail-list li {
    font-size: 13px;
    color: var(--text-dim);
    padding: 5px 0 5px 16px;
    position: relative;
    line-height: 1.5;
}

.detail-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

/* Detail panel — terminal command (click-to-copy) */
.detail-cmd {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color 0.2s;
    position: relative;
}

.detail-cmd:hover {
    border-color: var(--accent);
}

.detail-cmd code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: var(--text);
    word-break: break-all;
    display: block;
    line-height: 1.5;
}

.copy-hint {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: right;
    transition: color 0.2s;
}

/* Detail panel — folder path */
.detail-folder {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: var(--text-dim);
    word-break: break-all;
    padding: 6px 0;
}

/* World filter buttons (Control Room) */
.world-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: auto;
}

.world-filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    white-space: nowrap;
}

.world-filter-btn:hover {
    border-color: var(--filter-color);
    color: var(--filter-color);
}

.world-filter-btn.active {
    background: var(--filter-color);
    border-color: var(--filter-color);
    color: var(--bg);
}

/* Dimmed state for world filtering */
.node-group.world-dimmed { opacity: 0.12; }
.connection-line.world-dimmed { opacity: 0.05; }

/* Not-deployed nodes (planned, idea, gap) */
.node-group.not-deployed { opacity: 0.45; }
.node-group.not-deployed .node-bg { stroke-dasharray: 6 4; }

.health-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    margin-top: 8px;
}

.health-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.health-dot.checking { background: var(--text-muted); animation: pulse 1s infinite; }
.health-dot.healthy { background: var(--success); }
.health-dot.unhealthy { background: var(--error); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Empty state (Personal) */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 200px);
    color: var(--text-muted);
    font-size: 18px;
    flex-direction: column;
    gap: 12px;
}

.empty-state .empty-icon { font-size: 48px; opacity: 0.5; }

/* Version footer */
.version-footer {
    position: fixed;
    bottom: 8px;
    right: 12px;
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.6;
}

/* Bottom sheet handle */
.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 2px;
    margin: 0 auto 12px;
    opacity: 0.5;
}

/* ============================================
   VIBE GUIDE
   ============================================ */

.vibe-guide {
    max-width: 900px;
    margin: 0 auto;
}

.vibe-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.vibe-title {
    font-size: 24px;
    font-weight: 700;
    flex: 1;
}

.vibe-map-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.vibe-map-link:hover { text-decoration: underline; }

.vibe-stats {
    display: flex;
    gap: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.vibe-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.vibe-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.vibe-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vibe-search-wrap {
    margin-bottom: 24px;
}

.vibe-search {
    width: 100%;
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.vibe-search:focus {
    border-color: var(--accent);
}

.vibe-section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

/* Quick Reference Cards */
.ref-cards {
    margin-bottom: 32px;
}

.ref-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
}

.ref-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.ref-card-header:hover {
    background: var(--surface-hover);
}

.ref-card-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.ref-card-title {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
}

.ref-card-chevron {
    font-size: 18px;
    color: var(--text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.ref-card.expanded .ref-card-chevron {
    transform: rotate(90deg);
}

.ref-card-body {
    display: none;
    padding: 0 16px 14px;
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.6;
}

.ref-card.expanded .ref-card-body {
    display: block;
}

.ref-card-body ul {
    list-style: none;
    padding: 0;
}

.ref-card-body li {
    padding: 4px 0 4px 16px;
    position: relative;
}

.ref-card-body li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

.ref-card-body code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
}

/* Session Directory */
.world-section {
    margin-bottom: 20px;
}

.world-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.world-section-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.world-section-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--world-color);
    flex: 1;
}

.world-section-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--surface);
    padding: 2px 8px;
    border-radius: 10px;
}

.session-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.session-row:hover {
    background: var(--surface);
}

.session-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.session-info {
    flex: 1;
    min-width: 0;
}

.session-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-subtitle {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-status {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.session-status.live { background: rgba(52,211,153,0.15); color: var(--success); }
.session-status.dev { background: rgba(251,191,36,0.15); color: var(--warning); }
.session-status.building { background: rgba(251,191,36,0.15); color: var(--warning); }
.session-status.planned { background: rgba(148,163,184,0.15); color: var(--planned); }
.session-status.local { background: rgba(148,163,184,0.15); color: var(--planned); }
.session-status.idea { background: rgba(100,116,139,0.15); color: var(--text-muted); }

.session-cmd-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-dim);
    font-size: 13px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.session-cmd-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.session-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color 0.2s;
    flex-shrink: 0;
}

.session-link:hover {
    color: var(--accent);
}

/* ============================================
   APPROVALS
   ============================================ */

.approvals-page {
    max-width: 900px;
    margin: 0 auto;
}

.approvals-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.approvals-title {
    font-size: 24px;
    font-weight: 700;
}

.approvals-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-muted);
    margin: 32px 0 12px;
}

.approvals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.approval-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: opacity 0.3s, transform 0.3s;
}

.approval-card.completed {
    opacity: 0.6;
}

.approval-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.approval-source,
.approval-target {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.approval-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.approval-risk {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

.approval-risk.risk-low {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
}

.approval-risk.risk-infra {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
}

.approval-risk.risk-breaking {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
}

.approval-time {
    font-size: 11px;
    color: var(--text-muted);
}

.approval-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}

.approval-preview {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 16px;
}

.approval-actions {
    display: flex;
    gap: 10px;
}

.approve-btn,
.reject-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.approve-btn {
    background: var(--success);
    color: var(--bg);
}

.reject-btn {
    background: var(--error);
    color: white;
}

.approve-btn:hover,
.reject-btn:hover {
    opacity: 0.85;
}

.approve-btn:disabled,
.reject-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.approval-decision {
    font-size: 13px;
    font-weight: 600;
    padding: 8px 0 0;
}

.approval-decision.approved {
    color: var(--success);
}

.approval-decision.rejected {
    color: var(--error);
}

.approvals-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.approvals-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
    color: var(--success);
}

/* Nav link in header */
.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    margin-right: 8px;
}

.nav-link:hover {
    color: var(--text);
    border-color: var(--text-dim);
}

.nav-link.has-badge {
    border-color: var(--warning);
    color: var(--warning);
}

/* Toast notification */
.approval-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 200;
    box-shadow: var(--shadow);
}

.approval-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   MOBILE: Bottom sheet + compact layout
   ============================================ */

/* All mobile devices */
@media (max-width: 932px) {
    header {
        padding: 8px 12px;
        height: 44px;
        --header-h: 44px;
    }

    .logo { font-size: 15px; }
    .logout-btn { font-size: 12px; padding: 4px 10px; }
    .version-footer { display: none; }

    main {
        padding: 8px;
        max-width: none;
    }

    main.map-view {
        padding: 4px;
    }

    .map-header {
        gap: 10px;
        margin-bottom: 8px;
    }

    .map-header .back-btn {
        font-size: 13px;
        padding: 4px 8px;
    }

    .map-logo { height: 32px; }
    .map-logo.map-logo-lg { height: 40px; }
    .map-logo.map-logo-sm { height: 24px; }

    .map-container {
        height: calc(100vh - 44px - 60px);
        min-height: 200px;
        border-radius: var(--radius-sm);
    }

    /* Detail panel becomes bottom sheet on mobile */
    .detail-panel {
        width: 100%;
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        max-height: 50vh;
        border-left: none;
        border-top: 1px solid var(--border);
        border-radius: 16px 16px 0 0;
        padding: 8px 16px 16px;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        display: block;
        z-index: 20;
    }

    .detail-panel.active {
        transform: translateY(0);
    }

    .detail-close {
        position: absolute;
        top: 8px;
        right: 12px;
        font-size: 22px;
        padding: 8px;
        z-index: 1;
    }

    .detail-icon { font-size: 28px; margin-bottom: 4px; }
    .detail-name { font-size: 17px; }
    .detail-subtitle { font-size: 12px; margin-bottom: 10px; }
    .detail-desc { font-size: 13px; margin-bottom: 14px; }

    .landing-title { font-size: 22px; }
    .landing-subtitle { font-size: 13px; margin-bottom: 20px; }

    /* Vibe Guide mobile */
    .vibe-header { flex-wrap: wrap; gap: 10px; }
    .vibe-title { font-size: 20px; }
    .vibe-stats { gap: 16px; padding: 12px 16px; }
    .vibe-stat-value { font-size: 18px; }
    .session-row { padding: 8px 8px; }

    /* Approvals mobile */
    .approvals-grid { grid-template-columns: 1fr; }
    .approvals-title { font-size: 20px; }
    .nav-link { font-size: 11px; padding: 4px 10px; margin-right: 4px; }
}

/* Short viewport (landscape phone or short window) — maximize map */
@media (max-width: 932px) and (max-height: 500px) {
    header {
        padding: 2px 12px;
        height: 32px;
        --header-h: 32px;
    }

    .logo { font-size: 13px; }
    .logout-btn { font-size: 11px; padding: 2px 8px; }

    main.map-view { padding: 0; }

    .map-header {
        margin-bottom: 2px;
        gap: 6px;
        padding: 0 4px;
    }

    .map-header .back-btn { padding: 2px 6px; font-size: 11px; }
    .map-logo { height: 20px; }
    .map-logo.map-logo-lg { height: 24px; }
    .map-logo.map-logo-sm { height: 18px; }

    .map-container {
        height: calc(100vh - 32px - 28px);
        min-height: 100px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .detail-panel {
        max-height: 45vh;
        padding: 6px 12px 12px;
    }

    .detail-icon { font-size: 22px; margin-bottom: 2px; }
    .detail-name { font-size: 15px; }
}

/* Narrow viewport (portrait phone) — single column cards */
@media (max-width: 500px) {
    .business-grid { grid-template-columns: 1fr; }
    .business-card { padding: 20px 16px; }
    .card-logo { width: 56px; height: 56px; }
    .card-logo img { max-width: 56px; max-height: 56px; }

    .detail-panel {
        max-height: 55vh;
    }

    .map-container {
        height: calc(100vh - 44px - 56px);
    }
}

/* === CLAUDE SPEND === */
.spend-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px;
}
.spend-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}
.spend-loading, .spend-not-configured {
    color: var(--text-dim);
    padding: 40px 0;
    text-align: center;
}
.spend-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
}
.spend-card {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}
.spend-card-primary {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}
.spend-card-label {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 6px;
}
.spend-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}
.spend-card-primary .spend-card-value {
    color: var(--accent);
}
.spend-section {
    margin-bottom: 28px;
}
.spend-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 12px;
}
/* Daily bar chart */
.spend-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 160px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 12px 8px;
    overflow-x: auto;
}
.spend-bar-col {
    flex: 1;
    min-width: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}
.spend-bar-value {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    white-space: nowrap;
}
.spend-bar {
    width: 100%;
    max-width: 32px;
    background: var(--accent);
    border-radius: 4px 4px 0 0;
    min-height: 2px;
}
.spend-bar-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 4px;
    white-space: nowrap;
}
/* Model / key rows */
.spend-table {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px 0;
}
.spend-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
}
.spend-row + .spend-row {
    border-top: 1px solid var(--border);
}
.spend-row-label {
    flex: 0 0 auto;
    min-width: 200px;
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.spend-row-bar {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.spend-row-bar span {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
}
.spend-row-value {
    flex: 0 0 auto;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    text-align: right;
    min-width: 80px;
}
.spend-footer {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    padding: 16px 0;
}
@media (max-width: 932px) {
    .spend-summary { flex-direction: column; }
    .spend-row-label { min-width: 120px; font-size: 0.75rem; }
    .spend-card-value { font-size: 1.5rem; }
}
