
:root {
    --blue: #1a73e8;
    --blue-hover: #1765cc;
    --surface: #ffffff;
    --page: #f8fafd;
    --text: #202124;
    --muted: #5f6368;
    --border: #dadce0;
    --danger: #d93025;
    --success: #188038;
    --shadow: 0 10px 30px rgba(60, 64, 67, 0.14);
    --radius: 16px;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #e8f0fe 0, var(--page) 36%, #fff 100%);
    color: var(--text);
}

.auth-card {
    width: min(430px, 100%);
    padding: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
}

.auth-card.wide { width: min(720px, 100%); }

.login-card { position: relative; }

.brand-mark {
    display: inline-flex;
    align-items: center;
    height: 34px;
    margin-bottom: 18px;
    padding: 0 12px;
    border-radius: 999px;
    background: #e8f0fe;
    color: var(--blue);
    font-weight: 700;
    letter-spacing: 0.2px;
}

h1, h2 {
    margin: 0 0 10px;
    color: var(--text);
    font-weight: 500;
    letter-spacing: -0.02em;
}

h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; margin: 0 0 10px; font-weight: 500; }

label {
    display: block;
    margin: 18px 0 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
}

input, select {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

select[multiple] { min-height: 90px; }

input:focus, select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.14);
}

button {
    width: 100%;
    min-height: 46px;
    margin-top: 20px;
    padding: 11px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.08s ease, opacity 0.18s ease;
}

button:hover:not(:disabled) {
    background: var(--blue-hover);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.28);
}

button:active:not(:disabled) { transform: translateY(1px); }

button.secondary { background: #f1f3f4; color: var(--blue); }
button.secondary:hover:not(:disabled) { background: #e8f0fe; box-shadow: none; }

button:disabled, input:disabled { opacity: 0.58; cursor: not-allowed; }

.icon-button {
    width: 44px; min-height: 44px; height: 44px;
    margin: 0 0 18px; padding: 0;
    border-radius: 50%;
    background: #f1f3f4;
    color: var(--blue);
    font-size: 24px;
    line-height: 44px;
}

#back-to-password {
    background: transparent;
    color: var(--muted);
}
#back-to-password:hover,
#back-to-password:hover:not(:disabled) {
    background: transparent;
    color: var(--blue);
    box-shadow: none;
}

.hidden { display: none !important; }

.hint { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }

.message { min-height: 24px; margin: 18px 0 0; font-size: 14px; }
.message.error { color: var(--danger); }
.message.success { color: var(--success); }

.otp-input-row {
    display: flex; align-items: center;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.otp-input-row:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.14);
}
.otp-input-row input { min-width: 0; border: 0; box-shadow: none; }
.otp-input-row input:focus { box-shadow: none; }

.inline-send-button {
    position: relative; width: 116px; min-width: 116px; min-height: 32px;
    margin: 0; padding: 0 12px; border-radius: 0;
    background: transparent; color: var(--blue); font-size: 14px; box-shadow: none;
}
.inline-send-button::before {
    content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
    width: 1px; background: var(--border);
}
.inline-send-button:hover:not(:disabled) { background: transparent; box-shadow: none; color: var(--blue-hover); }

.authorize-panel {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.authorize-panel div {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafd;
}

.authorize-panel span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
}

.authorize-panel strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

.qr-box {
    display: flex; justify-content: center;
    margin: 18px 0; padding: 18px;
    border: 1px solid var(--border); border-radius: 14px; background: #f8fafd;
}
.qr-box img { width: 220px; max-width: 100%; }
.break-word { overflow-wrap: anywhere; word-break: break-word; }

/* ====================== ACCOUNT page ====================== */
.account-body {
    align-items: stretch; justify-content: stretch;
    padding: 0; background: var(--page);
}

.account-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    width: 100%; min-height: 100vh;
}

.account-sidebar {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column;
    padding: 28px 18px;
    background: var(--surface);
    overflow-y: auto;
}

.sidebar-brand {
    margin: 0 10px 32px;
    padding: 0 14px;
    font-size: 22px; font-weight: 700; color: var(--blue);
    letter-spacing: 0.04em;
}

.nav-item, .sidebar-logout {
    display: block; width: 100%;
    margin: 3px 0; padding: 13px 18px;
    border-radius: 999px;
    background: var(--surface); color: #5f6368;
    text-align: left; font-weight: 500; font-size: 16px;
    cursor: pointer; border: 0;
    transition: background 0.18s ease, color 0.18s ease;
}
.nav-item:hover { background: #1a73e8; color: #fff; }
.nav-item.active { background: rgb(232, 240, 254); color: #1a73e8; font-weight: 600; }
.nav-item.active:hover { background: #1a73e8; color: #fff; }
.sidebar-logout {
    margin-top: auto;
    text-align: center; color: #d93025; background: rgb(241, 243, 244);
    font-size: 15px; font-weight: 500;
}
.sidebar-logout:hover { background: #d93025; color: #fff; }

.account-content { padding: 42px; overflow: auto; display: flex; flex-direction: column; align-items: center; }

.account-hero {
    width: 100%; max-width: 760px;
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 28px; padding: 28px 30px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); box-shadow: 0 4px 18px rgba(60, 64, 67, 0.08);
}
.hero-left { display: flex; align-items: center; gap: 16px; }
.hero-avatar {
    width: 56px; height: 56px; border-radius: 50%; overflow: hidden;
    background: #e8f0fe; display: flex; align-items: center; justify-content: center;
}
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-hero h1 { margin: 0 0 4px; font-size: 26px; }
.hero-badge {
    padding: 8px 16px; border-radius: 999px;
    background: #e8f0fe; color: var(--blue); font-size: 13px; font-weight: 700;
}

.profile-avatar-row { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.profile-avatar {
    width: 80px; height: 80px; min-width: 80px; border-radius: 50%; overflow: hidden;
    background: #e8f0fe; display: flex; align-items: center; justify-content: center;
}
.profile-avatar-small {
    width: 56px; height: 56px; min-width: 56px; border-radius: 50%; overflow: hidden;
    background: #e8f0fe; display: flex; align-items: center; justify-content: center;
}
.profile-avatar-small img { width: 100%; height: 100%; object-fit: cover; }
.email-text { color: var(--muted) !important; }
.profile-avatar-row div:last-child { flex: 1; min-width: 0; }
.profile-avatar-row label { margin-top: 0; }
.avatar-picker {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 14px; width: 100%; max-width: 520px; max-height: 260px;
    overflow-y: auto; padding: 8px 10px 8px 0; margin-bottom: 18px;
    scrollbar-gutter: stable;
}
.avatar-option {
    width: 72px; height: 72px; padding: 3px; border-radius: 50%;
    border: 2px solid transparent; background: transparent; cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.avatar-option:hover { transform: translateY(-1px); border-color: #c7d2fe; }
.avatar-option.selected { border-color: var(--blue); }
.avatar-option img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar-upload-option {
    border-style: dashed; border-color: #c9d3e2; background: #f8fafd;
    display: flex; align-items: center; justify-content: center;
}
.avatar-upload-icon {
    width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; line-height: 1; font-weight: 500;
}

.crop-modal {
    position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, 0.48);
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.crop-dialog {
    width: min(680px, 100%); background: #fff; border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28); padding: 22px;
}
.crop-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.crop-header h3 { margin: 0; font-size: 22px; }
.crop-stage {
    height: 420px; background: #f1f5f9; border-radius: 14px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.crop-stage img { display: block; max-width: 100%; max-height: 100%; }
.crop-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px; }

.dialog-open { overflow: hidden; }
.app-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.45);
}
.app-dialog {
    width: min(420px, 100%);
    padding: 24px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    outline: none;
}
.app-dialog h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
}
.app-dialog p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}
.app-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}
.app-dialog-actions button {
    width: auto;
    min-width: 88px;
    margin-top: 0;
}

.readonly-field {
    min-height: 48px; padding: 12px 14px; border-radius: 10px;
    background: #f8fafd; color: var(--muted); font-size: 16px;
    display: flex; align-items: center;
}
.link-field {
    min-height: 48px; padding: 12px 14px; border-radius: 10px;
    background: #f8fafd; color: var(--blue); font-size: 16px; font-weight: 500;
    display: flex; align-items: center; cursor: pointer;
    transition: background 0.15s ease;
}
.link-field:hover { background: #e8f0fe; }

.security-list { display: flex; flex-direction: column; gap: 10px; }
.security-item {
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px;
    padding: 20px 24px; border-radius: 8px;
    border: 1px solid #edf1f7;
    background: #fff; cursor: pointer;
    transition: background 0.15s ease;
}
.security-item:hover { background: #f8fafd; }
.security-item > div { min-width: 0; }
.security-item div strong { display: block; margin-bottom: 7px; font-size: 17px; font-weight: 600; }
.security-item div span { display: block; color: var(--muted); font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.profile-avatar-item div strong { margin-bottom: 0; }
.security-arrow { color: var(--muted); font-size: 18px; }
.section-title { margin-top: 38px; }
.login-record-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.login-record-group + .login-record-group { margin-top: 14px; }
.login-record-group h3 {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
}
.login-record-item { background: #fff; border: 1px solid var(--border); }
.login-record-item:hover { background: #fff; }
.login-record-item.current-login { background: #f8fafd; border-color: #c7d7fb; }
.login-record-item.current-login:hover { background: #f8fafd; }
.login-record-item div span b,
.device-item div span b {
    display: inline-block;
    min-width: 42px;
    margin-right: 8px;
    color: var(--text);
    font-weight: 600;
}
.device-item { align-items: flex-start; }
.device-list { margin-top: 14px; }
.device-item .delete-device {
    width: auto;
    min-width: 72px;
    min-height: 38px;
    margin: 0;
    padding: 8px 14px;
    border-radius: 8px;
    background: #fce8e6;
    color: var(--danger);
    box-shadow: none;
}
.device-item .delete-device:hover:not(:disabled) {
    background: #fad2cf;
    box-shadow: none;
}
.current-session-badge {
    display: inline-flex !important;
    margin-left: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e8f0fe;
    color: var(--blue) !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    vertical-align: middle;
}
.danger-button {
    background: #d93025;
}
.danger-button:hover:not(:disabled) {
    background: #b3261e;
}
.text-button {
    width: auto;
    min-height: 40px;
    margin: 16px auto 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: transparent;
    color: var(--blue);
    box-shadow: none;
}
.text-button:hover:not(:disabled) {
    background: #e8f0fe;
    box-shadow: none;
}

.back-btn {
    width: 48px; min-height: 48px; height: 48px; margin: 0 0 10px; padding: 0;
    border-radius: 50%; background: transparent; color: var(--muted);
    font-size: 28px; line-height: 48px;
}
.back-btn:hover,
.back-btn:hover:not(:disabled) {
    background: transparent;
    color: var(--blue);
    box-shadow: none;
}

#avatar-subpanel,
#nickname-subpanel,
#email-subpanel,
#username-subpanel,
#password-subpanel,
#twofa-subpanel,
#settings-grace-subpanel,
#settings-login-2fa-subpanel,
#settings-session-valid-subpanel {
    position: relative;
}

#avatar-subpanel h2,
#nickname-subpanel h2,
#email-subpanel h2,
#username-subpanel h2,
#password-subpanel h2,
#twofa-subpanel h2,
#settings-grace-subpanel h2,
#settings-login-2fa-subpanel h2,
#settings-session-valid-subpanel h2 {
    text-align: center;
}

.status-grid.three-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.account-panel {
    width: 100%; max-width: 760px;
    padding: 30px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); box-shadow: 0 4px 18px rgba(60, 64, 67, 0.08);
    margin-bottom: 24px;
}
.account-panel h2 { font-size: 26px; margin-bottom: 18px; }
.account-panel label { font-size: 16px; }
.account-panel input { font-size: 17px; }

.narrow-form {
    width: min(520px, 100%);
    max-width: 520px;
    margin-right: auto;
    margin-left: auto;
}

.narrow-form label,
.narrow-form .hint {
    text-align: left;
}

.status-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px; margin-bottom: 24px;
}
.status-grid div {
    min-width: 0; padding: 16px;
    border: 1px solid var(--border); border-radius: 14px; background: #f8fafd;
}
.status-grid strong, .status-grid span { display: block; overflow-wrap: anywhere; }
.status-grid strong { color: var(--muted); font-size: 13px; font-weight: 500; }
.status-grid span { margin-top: 8px; color: var(--text); font-size: 16px; }

.status-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}
.status-list div {
    display: grid;
    grid-template-columns: minmax(96px, 150px) minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    min-width: 0;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fafd;
}
.status-list strong {
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
}
.status-list span {
    color: var(--text);
    font-size: 17px;
    overflow-wrap: anywhere;
}

.google-info-list {
    overflow: hidden;
    margin-top: 24px;
    border-radius: 18px;
    border: 1px solid #edf1f7;
    background: #fff;
}
.google-info-row {
    display: block;
    align-items: center;
    min-height: 72px;
    padding: 18px 24px;
    background: #fff;
}
.google-info-row + .google-info-row { border-top: 1px solid #edf1f7; }
.google-info-row:hover { background: #f8fafd; }
.google-info-row strong,
.google-info-row span {
    display: block;
    overflow-wrap: anywhere;
}
.google-info-row strong {
    margin-bottom: 4px;
    color: var(--text);
    font-size: 17px;
    font-weight: 600;
}
.google-info-row div span {
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
}

.settings-card {
    width: min(520px, 100%);
    margin: 24px auto 0;
    padding: 24px;
    border: 1px solid #edf1f7;
    border-radius: 16px;
    background: #fff;
}
.settings-card strong,
.settings-card span {
    display: block;
}
.settings-card strong {
    color: var(--text);
    font-size: 17px;
    font-weight: 600;
}
.settings-card span {
    margin-top: 6px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}
.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 20px;
}
.switch-row span { margin: 0; }
.switch-row small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
}
.switch-row input[type="checkbox"] {
    width: 24px;
    min-width: 24px;
    min-height: 24px;
    height: 24px;
    margin: 0;
    accent-color: var(--blue);
}
.minute-stepper {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}
.minute-stepper button {
    width: 48px;
    min-height: 48px;
    margin: 0;
    padding: 0;
    border-radius: 8px;
    background: #f1f3f4;
    color: var(--blue);
    font-size: 24px;
}
.minute-stepper button:hover:not(:disabled) {
    background: #e8f0fe;
    box-shadow: none;
}
.minute-stepper input {
    height: 48px;
    min-height: 48px;
    text-align: center;
}

/* Mobile FAB & drawer */
.mobile-fab {
    display: none;
    position: fixed; right: 20px; bottom: 24px; z-index: 20;
    width: 56px; height: 56px; margin: 0; border-radius: 50%;
    background: var(--blue); color: #fff; font-size: 24px;
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.35);
    cursor: pointer; border: 0;
}
.drawer-backdrop {
    position: fixed; inset: 0; z-index: 9;
    background: rgba(0, 0, 0, 0.38);
}

/* ====================== SETUP page ====================== */
.setup-body {
    align-items: stretch; justify-content: stretch;
    padding: 0; background: var(--page);
}

.setup-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    width: 100%; min-height: 100vh;
}

.setup-rail {
    position: sticky; top: 0; height: 100vh;
    padding: 32px 24px;
    border-right: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 4px 0 18px rgba(60, 64, 67, 0.08);
    overflow-y: auto;
}
.setup-rail h1 { margin: 12px 0 28px; font-size: 22px; }

.setup-progress { margin-top: 8px; }
.progress-item {
    padding: 14px 16px; margin: 4px 0;
    border-radius: 10px; color: var(--muted);
    font-size: 14px; font-weight: 500;
    background: #f8fafd;
}
.progress-item.active { background: #e8f0fe; color: var(--blue); font-weight: 700; }

.setup-content { padding: 42px; overflow: auto; }

.setup-card {
    max-width: 840px; padding: 32px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); box-shadow: 0 4px 18px rgba(60, 64, 67, 0.08);
}

.setup-subcard {
    margin-top: 28px; padding: 24px;
    border: 1px solid var(--border); border-radius: 14px;
    background: #f8fafd;
}

.form-grid { display: grid; gap: 14px; }
.form-grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check-row { display: flex; gap: 24px; align-items: center; padding-top: 18px; }
.check-row label { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.check-row input[type="checkbox"] { width: auto; min-height: auto; }

.inline-field { display: flex; gap: 8px; align-items: center; }
.inline-field input { min-width: 0; }
.inline-field button { width: auto; margin-top: 0; white-space: nowrap; }

/* permission groups editor */
.groups-editor { margin-top: 18px; }
.group-card {
    margin-bottom: 16px; padding: 18px;
    border: 1px solid var(--border); border-radius: 14px;
    background: var(--surface);
}
.group-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.group-header button { width: auto; margin-top: 0; min-height: 34px; padding: 6px 14px; font-size: 13px; }

.permission-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.permission-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 999px;
    background: #e8f0fe; color: var(--blue); font-size: 13px; font-weight: 500;
}
.permission-chip button {
    width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0;
    border-radius: 50%; background: transparent; color: var(--blue);
    font-size: 14px; line-height: 1; opacity: 0.7;
}
.permission-chip button:hover { opacity: 1; }

.finish-button {
    margin-top: 32px; padding: 14px 24px;
    font-size: 16px; background: #188038;
}
.finish-button:hover:not(:disabled) { background: #137333; }

/* ====================== RESPONSIVE ====================== */
@media (max-width: 820px) {
    body {
        align-items: flex-start; min-height: 100vh; padding: 18px;
    }

    .auth-card { margin: 0 auto; padding: 24px; }

    /* Account mobile */
    .account-body { padding: 0; }
    .account-shell { grid-template-columns: 1fr; }

    .account-sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; z-index: 10;
        width: min(78vw, 300px); height: 100vh;
        background: var(--surface);
        transform: translateX(-105%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 8px 0 30px rgba(60, 64, 67, 0.18);
    }

    .drawer-open .account-sidebar { transform: translateX(0); }

    .mobile-fab { display: flex; align-items: center; justify-content: center; }

    .account-content { padding: 18px; }
    .account-hero { padding: 22px; flex-direction: column; gap: 14px; }
    .account-panel { max-width: none; padding: 22px; }
    .status-grid { grid-template-columns: 1fr; }
    .status-list div { grid-template-columns: 1fr; gap: 6px; }
    .google-info-row { padding: 16px 18px; }
    .status-grid.three-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-avatar { width: 44px; height: 44px; }

    .nav-item, .sidebar-logout { margin: 4px 0; }

    /* Setup mobile */
    .setup-shell { grid-template-columns: 1fr; }
    .setup-rail {
        position: sticky; top: 0; z-index: 2; height: auto;
        padding: 18px; border-right: 0; border-bottom: 1px solid var(--border);
    }
    .setup-rail h1 { margin: 4px 0 12px; font-size: 20px; }
    .setup-progress { display: flex; gap: 10px; }
    .progress-item { flex: 1; text-align: center; padding: 10px; }

    .setup-content { padding: 18px; }
    .setup-card { max-width: none; padding: 24px; }

    .form-grid.two-cols { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
    body { padding: 12px; background: var(--surface); }
    .auth-card { padding: 20px; border: 0; box-shadow: none; }
    h1 { font-size: 24px; }

    .inline-send-button { width: 98px; min-width: 98px; padding: 0 8px; font-size: 13px; }
    .qr-box img { width: 190px; }

    .account-content { padding: 12px; }
    .account-hero { padding: 18px; }
    .account-hero h1 { font-size: 22px; }
    .account-panel { padding: 18px; border-radius: 14px; }
    .google-info-row { padding: 15px 14px; }
    .toast-message { right: 16px; bottom: 16px; }
    .minute-stepper { grid-template-columns: 44px minmax(0, 1fr) 44px; }
    .minute-stepper button { width: 44px; min-height: 44px; }

    .setup-content { padding: 12px; }
    .setup-card { padding: 20px; }
    .setup-subcard { padding: 18px; margin-top: 20px; }
    .status-grid.three-cols { grid-template-columns: 1fr; }
    .profile-avatar-row { flex-direction: column; align-items: center; }
    .crop-modal { padding: 12px; }
    .crop-dialog { padding: 16px; border-radius: 14px; }
    .crop-stage { height: 320px; }
    .crop-actions { flex-direction: column-reverse; }
}
