/* CSS Variables - Phony.cam Design System */
:root {
    /* Surfaces */
    --bg: #000000;
    --bg-soft: #050505;
    --bg-elevated: #0a0a0a;
    
    /* Glass tints */
    --glass-1: rgba(255, 255, 255, 0.045);
    --glass-2: rgba(255, 255, 255, 0.07);
    --glass-3: rgba(255, 255, 255, 0.10);
    
    /* Glass rims */
    --rim: rgba(255, 255, 255, 0.10);
    --rim-strong: rgba(255, 255, 255, 0.18);
    --rim-bright: rgba(255, 255, 255, 0.32);
    
    /* Text */
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-muted: #6e6e73;
    --text-faint: rgba(245, 245, 247, 0.32);
    
    /* Status colors */
    --success: #00ff88;
    --warning: #ffaa00;
    --error: #ff4444;
    
    /* Geometry */
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-pill: 999px;
    
    /* Shadows */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 24px 48px -16px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 32px 64px -24px rgba(0, 0, 0, 0.8);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Safe area for mobile */
    --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);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
    will-change: transform;
}

.orb-1 {
    width: 600px;
    height: 600px;
    top: -180px;
    left: -120px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent);
}

.orb-2 {
    width: 520px;
    height: 520px;
    top: 30%;
    right: -160px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06), transparent);
    animation-delay: -10s;
}

.orb-3 {
    width: 720px;
    height: 720px;
    bottom: -260px;
    left: 28%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05), transparent);
    animation-delay: -20s;
    opacity: 0.5;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Grid pattern overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 1;
    pointer-events: none;
}

/* Screen Management */
.screen {
    display: none;
    position: relative;
    z-index: 2;
    min-height: 100vh;
    min-height: 100dvh;
}

.screen.active {
    display: block;
}

/* Auth Container */
#login-screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    padding-top: calc(24px + var(--safe-top));
    padding-bottom: calc(24px + var(--safe-bottom));
}

.auth-container {
    background: var(--glass-2);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid var(--rim);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.logo-icon {
    width: 64px;
    height: 64px;
    background: var(--glass-3);
    border: 1px solid var(--rim-strong);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-sm);
}

.logo-icon svg {
    width: 32px;
    height: 32px;
}

.logo-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    background: linear-gradient(100deg, #ffffff 0%, #ffffff 40%, rgba(255,255,255,0.55) 50%, #ffffff 60%, #ffffff 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.logo-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.form-group input {
    background: var(--glass-1);
    border: 1px solid var(--rim);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    color: var(--text);
    font-family: inherit;
    font-size: 16px;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
}

.form-group input:focus {
    outline: none;
    border-color: var(--rim-bright);
    background: var(--glass-2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 24px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1;
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--glass-2);
    color: var(--text);
    border: 1px solid var(--rim);
}

.btn-secondary:hover {
    background: var(--glass-3);
    border-color: var(--rim-strong);
}

.btn-danger {
    background: rgba(255, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(255, 68, 68, 0.2);
    border-color: rgba(255, 68, 68, 0.5);
}

.btn-block {
    width: 100%;
}

.error-message {
    color: var(--error);
    font-size: 13px;
    text-align: center;
    min-height: 18px;
}

.auth-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.auth-footer a:hover {
    border-bottom-color: var(--text);
}

/* Header */
.header {
    background: var(--glass-1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--rim);
    position: sticky;
    top: 0;
    z-index: 100;
    padding-top: var(--safe-top);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
    text-decoration: none;
}

.logo-icon-small {
    width: 36px;
    height: 36px;
    background: var(--glass-2);
    border: 1px solid var(--rim);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon-small svg {
    width: 20px;
    height: 20px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    background: var(--glass-1);
    border: 1px solid var(--rim);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text);
    flex-shrink: 0;
}

.btn-icon:hover {
    background: var(--glass-2);
    border-color: var(--rim-strong);
}

.btn-icon:active {
    transform: scale(0.95);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* Main */
.main {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px;
    padding-bottom: calc(32px + var(--safe-bottom));
}

/* Profile Hero */
.profile-hero {
    background: var(--glass-2);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid var(--rim);
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.profile-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.profile-avatar {
    width: 96px;
    height: 96px;
    background: var(--glass-3);
    border: 2px solid var(--rim-strong);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    color: var(--text);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    text-transform: uppercase;
    overflow: hidden;
    position: relative;
}

.profile-avatar svg {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
}

.profile-avatar > * {
    border-radius: 50%;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-info h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    word-break: break-word;
}

.phony-id-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--glass-1);
    border: 1px solid var(--rim);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    max-width: 100%;
    flex-wrap: wrap;
}

.badge-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.badge-value {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.btn-copy {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border-radius: 4px;
}

.btn-copy:hover {
    color: var(--text);
    background: var(--glass-1);
}

.btn-copy:active {
    transform: scale(0.9);
}

.btn-copy svg {
    width: 14px;
    height: 14px;
}

/* Tabs */
.tabs-wrapper {
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.tabs {
    display: inline-flex;
    gap: 4px;
    background: var(--glass-1);
    border: 1px solid var(--rim);
    border-radius: var(--radius-md);
    padding: 4px;
    min-width: 100%;
}

.tab {
    background: transparent;
    border: none;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: nowrap;
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    background: var(--glass-3);
    color: var(--text);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Card */
.card {
    background: var(--glass-2);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid var(--rim);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.card:last-child {
    margin-bottom: 0;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--rim);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.card-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.card-body {
    padding: 24px;
}

/* Info Rows */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--rim);
    gap: 16px;
    min-height: 32px;
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-row:first-child {
    padding-top: 0;
}

.info-label {
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.info-value {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

.info-value.mono {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
}

.info-value-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-copy-small {
    background: var(--glass-1);
    border: 1px solid var(--rim);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-family: inherit;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
    white-space: nowrap;
}

.btn-copy-small:hover {
    background: var(--glass-2);
    color: var(--text);
    border-color: var(--rim-strong);
}

.btn-copy-small:active {
    transform: scale(0.95);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--glass-1);
    border: 1px solid var(--rim);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
}

.quick-action:hover {
    background: var(--glass-2);
    border-color: var(--rim-strong);
    transform: translateY(-2px);
}

.quick-action:active {
    transform: translateY(0);
}

.action-icon {
    width: 40px;
    height: 40px;
    background: var(--glass-2);
    border: 1px solid var(--rim);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--text);
}

.action-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.action-title {
    font-size: 14px;
    font-weight: 600;
}

.action-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Inline Form */
.inline-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-status {
    font-size: 13px;
    text-align: center;
    min-height: 18px;
}

.form-status.success {
    color: var(--success);
}

.form-status.error {
    color: var(--error);
}

/* Connection Status */
.connection-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.connection-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.connection-icon {
    width: 48px;
    height: 48px;
    background: var(--glass-1);
    border: 1px solid var(--rim);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.connection-icon.connected {
    background: rgba(0, 255, 136, 0.1);
    border-color: rgba(0, 255, 136, 0.3);
    color: var(--success);
}

.connection-icon svg {
    width: 24px;
    height: 24px;
}

.connection-text {
    flex: 1;
    min-width: 0;
}

.connection-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    word-break: break-word;
}

.connection-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Code Box */
.code-instruction {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.code-instruction a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--rim);
}

.code-instruction code {
    background: var(--glass-2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 12px;
}

.code-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--glass-1);
    border: 1px solid var(--rim);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-bottom: 12px;
    gap: 12px;
}

.code-box span {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--text);
}

.code-hint {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 12px;
    line-height: 1.5;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 12px;
    color: var(--text-faint);
}

/* Sessions */
.session-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--glass-1);
    border: 1px solid var(--rim);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    gap: 16px;
    transition: var(--transition);
}

.session-item:hover {
    background: var(--glass-2);
    border-color: var(--rim-strong);
}

.session-device-icon {
    width: 44px;
    height: 44px;
    background: var(--glass-2);
    border: 1px solid var(--rim);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    flex-shrink: 0;
}

.session-device-icon svg {
    width: 22px;
    height: 22px;
}

.session-info {
    flex: 1;
    min-width: 0;
}

.session-device {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    word-break: break-word;
}

.session-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.session-ip {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    background: var(--glass-1);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--rim);
}

.session-time {
    color: var(--text-muted);
}

.session-current {
    background: rgba(0, 255, 136, 0.1);
    color: var(--success);
    border: 1px solid rgba(0, 255, 136, 0.3);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* Toast */
.toast-container {
    position: fixed;
    top: calc(20px + var(--safe-top));
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--glass-2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--rim);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text);
    box-shadow: var(--shadow-md);
    animation: toastIn 0.3s ease;
    min-width: 240px;
    max-width: 360px;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

.toast.success {
    border-color: rgba(0, 255, 136, 0.3);
}

.toast.error {
    border-color: rgba(255, 68, 68, 0.3);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Utility */
.hidden {
    display: none !important;
}

/* ====== Tablet (768px and below) ====== */
@media (max-width: 768px) {
    .profile-hero {
        flex-direction: column;
        text-align: center;
        padding: 24px;
        gap: 16px;
    }
    
    .phony-id-badge {
        justify-content: center;
    }
    
    .header-content {
        padding: 12px 16px;
    }
    
    .header-logo span {
        font-size: 16px;
    }
    
    .main {
        padding: 20px 16px;
    }
    
    .auth-container {
        padding: 36px 24px;
    }
    
    .logo-title {
        font-size: 28px;
    }
    
    .card-header {
        padding: 16px 20px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 14px 0;
    }
    
    .info-value {
        text-align: left;
    }
    
    .info-value-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .connection-status {
        flex-direction: column;
        align-items: stretch;
    }
    
    .connection-info {
        width: 100%;
    }
    
    .connection-status .btn {
        width: 100%;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .toast-container {
        left: 12px;
        right: 12px;
        top: calc(12px + var(--safe-top));
    }
    
    .toast {
        min-width: 0;
        max-width: 100%;
    }
    
    .tabs {
        min-width: max-content;
    }
    
    .tab {
        flex: 0 0 auto;
        padding: 10px 16px;
    }
}

/* ====== Mobile (480px and below) ====== */
@media (max-width: 480px) {
    #login-screen.active {
        padding: 16px;
    }
    
    .auth-container {
        padding: 32px 20px;
        border-radius: var(--radius-lg);
    }
    
    .logo-icon {
        width: 56px;
        height: 56px;
    }
    
    .logo-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .logo-title {
        font-size: 26px;
    }
    
    .logo-subtitle {
        font-size: 13px;
    }
    
    .form-group input {
        font-size: 16px; /* Prevent iOS zoom */
        padding: 12px 14px;
    }
    
    .header-content {
        padding: 10px 12px;
    }
    
    .header-logo {
        gap: 8px;
    }
    
    .header-logo span {
        font-size: 15px;
    }
    
    .logo-icon-small {
        width: 32px;
        height: 32px;
    }
    
    .btn-icon {
        width: 36px;
        height: 36px;
    }
    
    .main {
        padding: 16px 12px;
    }
    
    .profile-hero {
        padding: 20px;
        margin-bottom: 16px;
        border-radius: var(--radius-md);
    }
    
    .profile-avatar {
        width: 72px;
        height: 72px;
        font-size: 28px;
    }
    
    .profile-info h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .phony-id-badge {
        padding: 5px 12px;
        gap: 8px;
    }
    
    .badge-value {
        font-size: 13px;
    }
    
    .tabs-wrapper {
        margin-bottom: 16px;
        margin-left: -12px;
        margin-right: -12px;
        padding: 0 12px;
    }
    
    .card {
        border-radius: var(--radius-md);
    }
    
    .card-header {
        padding: 14px 16px;
    }
    
    .card-header h3 {
        font-size: 15px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .info-label {
        font-size: 12px;
    }
    
    .info-value,
    .info-value.mono {
        font-size: 13px;
    }
    
    .quick-action {
        padding: 14px;
    }
    
    .action-title {
        font-size: 13px;
    }
    
    .action-desc {
        font-size: 11px;
    }
    
    .code-box {
        padding: 14px 16px;
    }
    
    .code-box span {
        font-size: 22px;
        letter-spacing: 3px;
    }
    
    .session-item {
        padding: 12px;
        gap: 12px;
    }
    
    .session-device-icon {
        width: 36px;
        height: 36px;
    }
    
    .session-device-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .session-current {
        align-self: flex-start;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* ====== Small Mobile (380px and below) ====== */
@media (max-width: 380px) {
    .auth-container {
        padding: 28px 16px;
    }
    
    .logo-title {
        font-size: 24px;
    }
    
    .profile-hero {
        padding: 16px;
    }
    
    .profile-avatar {
        width: 64px;
        height: 64px;
        font-size: 24px;
    }
    
    .profile-info h2 {
        font-size: 18px;
    }
    
    .code-box span {
        font-size: 20px;
        letter-spacing: 2px;
    }
    
    .tab {
        font-size: 13px;
        padding: 9px 14px;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .auth-container {
        padding: 24px 32px;
    }
    
    .logo-section {
        margin-bottom: 24px;
    }
    
    .logo-icon {
        margin-bottom: 12px;
        width: 48px;
        height: 48px;
    }
    
    .logo-title {
        font-size: 22px;
    }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .gradient-orb {
        animation: none;
    }
}

/* Passkey rows */
.passkey-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 14px;
}
.passkey-row:last-child { border-bottom: none; }
