:root {
    --bg: #f3f6fa;
    --shell: #ffffff;
    --panel: #ffffff;
    --panel-strong: #ffffff;
    --ink: #1e293b;
    --secondary: #475569;
    --neutral: #f8fafc;
    --muted: #64748b;
    --line: #e2e8f0;
    --brand: #0d8df2;
    --brand-gradient: linear-gradient(135deg, #0d8df2 0%, #0062cc 100%);
    --brand-soft: rgba(13, 141, 242, 0.08);
    --accent: #10b981;
    --accent-soft: rgba(16, 185, 129, 0.1);
    --warning-soft: #fef3c7;
    --warning-text: #b45309;
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --topbar-height: 60px;
    --bottombar-height: 65px;
    --scan-frame-width: min(calc(100% - 40px), 420px);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top left, rgba(13, 141, 242, 0.08), transparent 40%), #f1f5f9;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

.app-shell {
    width: min(100%, 460px);
    height: 100vh;
    max-height: 850px;
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: var(--shell);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

@media (max-width: 480px) {
    .app-shell {
        height: 100vh;
        max-height: none;
        border-radius: 0;
        border: none;
    }

    .install-banner {
        padding: 12px 14px;
        flex-direction: column;
        align-items: stretch;
    }

    .install-banner-actions {
        justify-content: flex-end;
    }
}

.mobile-topbar {
    position: sticky;
    top: 0;
    width: 100%;
    height: var(--topbar-height);
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(72px, 1fr) auto minmax(72px, 1fr);
    align-items: center;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
}

.mobile-topbar-scanner {
    background: rgba(2, 6, 23, 0.86);
    border-bottom-color: rgba(148, 163, 184, 0.18);
}

.topbar-side,
.topbar-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.topbar-tools {
    justify-content: flex-end;
}

.topbar-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.topbar-back,
.topbar-action {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topbar-back {
    border: none;
    background: transparent;
    color: var(--secondary);
}

.topbar-back:hover {
    background: rgba(148, 163, 184, 0.12);
    color: var(--brand);
}

.topbar-action {
    border: none;
    background: var(--brand-soft);
    color: var(--brand);
}

.topbar-action:hover {
    transform: scale(1.05);
    background: var(--brand);
    color: #ffffff;
}

.topbar-action-icon,
.topbar-action-icon svg {
    width: 20px;
    height: 20px;
}

.topbar-action-icon svg {
    fill: currentColor;
}

.is-hidden {
    display: none !important;
}

.app-content {
    padding: 20px;
    overflow-y: auto;
    background: var(--neutral);
}

.app-content.scanner-mode {
    padding: 0;
    background: #020617;
}

.app-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 100%;
}

.app-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.72rem;
    font-weight: 800;
}

h2 {
    margin: 0 0 12px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
}

h3 {
    margin: 0 0 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
}

.my-card-panel,
.profile-header-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profile-header-container {
    margin-bottom: 16px;
    width: 100%;
}

.profile-pic-frame {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: var(--shadow-md);
    margin-bottom: 12px;
    background: var(--brand-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
    cursor: pointer;
    transition: width 0.24s ease, height 0.24s ease, border-radius 0.24s ease, transform 0.24s ease;
}

.profile-pic-frame.is-qr-mode {
    width: 200px;
    height: 200px;
    border-radius: 1rem;
    transform: translateY(8px);
    border: 1px solid rgba(13, 141, 242, 0.22);
    box-shadow:
        0 26px 56px rgba(15, 23, 42, 0.24),
        0 10px 22px rgba(13, 141, 242, 0.2);
}

.profile-pic-content {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    position: relative;
}

.profile-pic-img,
.profile-qr-img {
    width: 100%;
    height: 100%;
}

.profile-pic-img {
    object-fit: cover;
    transition: transform 0.22s ease, opacity 0.18s ease;
}

.profile-qr-img {
    object-fit: contain;
    background: #ffffff;
    padding: 14px;
    cursor: pointer;
    transition: opacity 0.18s ease;
}

.profile-pic-fallback {
    font-weight: 800;
    font-size: 2.2rem;
    color: var(--brand);
}

.profile-pic-frame.is-qr-mode .profile-pic-fallback {
    display: none !important;
}

.profile-subtitle,
.history-company,
.title-label,
.contact-icon-label,
.records-summary-copy p:last-child,
.upload-status,
.empty-state {
    color: var(--muted);
}

.profile-pic-frame.is-qr-mode .profile-pic-content {
    background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%);
    box-shadow: inset 0 0 0 1px rgba(13, 141, 242, 0.12);
}

.profile-pic-frame.is-qr-mode .profile-pic-img,
.profile-qr-hidden {
    display: none !important;
}

.my-card-panel h2 {
    font-size: 1.4rem;
    margin: 0 0 4px;
}

.profile-subtitle {
    margin: 0 0 4px;
    font-weight: 600;
    font-size: 0.95rem;
}

.profile-company {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: pre-line;
    width: 100%;
}

.profile-qr-hint {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.detail-list {
    display: flex;
    flex-direction: column;
    margin: 15px 0 0;
    background: var(--neutral);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    border: 1px solid var(--line);
    width: 100%;
}

.detail-list div {
    display: grid;
    grid-template-columns: 105px 1fr;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    align-items: baseline;
    text-align: left;
}

.detail-list div:last-child {
    border-bottom: none;
}

.detail-list strong {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-list span {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink);
    word-break: break-word;
}

.full-width-action {
    margin-top: 16px;
    width: 100%;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.full-width-action button {
    flex: 1 1 160px;
}

.full-width-action a {
    flex: 1 1 160px;
}

.vcard-actions {
    flex-direction: column;
    flex-wrap: nowrap;
}

.vcard-actions > * {
    width: 100%;
    flex: 0 0 auto;
}

.vcard-actions button {
    flex: 0 0 auto;
}

.vcard-action-btn {
    width: 100%;
}

.soft-badge {
    align-self: center;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 800;
    background: var(--brand-soft);
    color: var(--brand);
}

.records-summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.records-summary-copy h2 {
    margin-bottom: 4px;
}

.records-search-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.records-search-field {
    margin-bottom: 0;
}

.records-search-field span {
    color: var(--ink);
}

.records-search-field input {
    border-radius: 999px;
    padding-left: 16px;
    padding-right: 16px;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.records-search-hint {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.records-list,
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.history-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.history-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(13, 141, 242, 0.25);
}

.history-company {
    margin: 0 0 6px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-identity h3 {
    margin: 0 0 4px;
    font-size: 1.2rem;
    font-weight: 800;
}

.title-label {
    font-size: 0.95rem;
    margin: 0;
}

.contact-icon-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.my-card-quick-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.my-card-contact-link {
    width: 46px;
    height: 46px;
}

.my-card-contact-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.contact-icon-link {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    color: var(--brand);
    border: 1px solid var(--line);
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.contact-icon-link:hover {
    transform: translateY(-1px);
    background: var(--brand);
    color: #ffffff;
}

.contact-icon-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.contact-icon-link.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.my-card-social-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 16px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--neutral);
    border: 1px solid var(--line);
}

.my-card-social-section h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.my-card-social-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.my-card-social-link {
    flex: 0 0 auto;
}

.my-card-social-icon {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    color: var(--brand);
}

.my-card-social-link.linkedin .my-card-social-icon {
    background: rgba(10, 102, 194, 0.12);
    color: #0a66c2;
}

.my-card-social-link.facebook .my-card-social-icon {
    background: rgba(24, 119, 242, 0.12);
    color: #1877f2;
}

.my-card-social-link.instagram .my-card-social-icon {
    background: rgba(225, 48, 108, 0.12);
    color: #e1306c;
}

.my-card-social-link.x .my-card-social-icon {
    background: rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

.my-card-social-link.youtube .my-card-social-icon {
    background: rgba(255, 0, 0, 0.12);
    color: #ff0000;
}

.my-card-social-link.tiktok .my-card-social-icon {
    background: rgba(37, 244, 238, 0.12);
    color: #111111;
}

.my-card-social-link.is-disabled .my-card-social-icon {
    background: rgba(148, 163, 184, 0.14);
    color: var(--muted);
}

.vguard-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.records-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding-bottom: 8px;
}

.pagination-link {
    min-width: 40px;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--secondary);
    font-weight: 700;
    line-height: 1;
}

.pagination-link:hover:not(:disabled),
.pagination-link.is-active {
    background: var(--brand-gradient);
    color: #ffffff;
    border-color: transparent;
}

.pagination-link:disabled,
.pagination-link.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

button,
.nav-item,
a.ghost-btn,
a.primary-btn,
a.logout-btn {
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.primary-btn {
    background: var(--brand-gradient);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(13, 141, 242, 0.2);
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(13, 141, 242, 0.3);
}

.ghost-btn {
    background: #ffffff;
    color: var(--secondary);
    border: 1px solid var(--line);
}

.ghost-btn:hover {
    background: var(--neutral);
    border-color: var(--muted);
}

.logout-btn {
    width: 100%;
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.22);
}

.logout-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(220, 38, 38, 0.3);
}

.install-banner {
    width: 100%;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(13, 141, 242, 0.16);
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(18px);
    animation: installBannerIn 0.28s ease;
}

.install-banner[hidden] {
    display: none !important;
}

.install-banner-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.install-banner-kicker {
    margin: 0 0 2px;
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.install-banner-title {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--ink);
}

.install-banner-text {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.install-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.install-banner-button {
    min-width: 92px;
}

@keyframes installBannerIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bottom-nav {
    height: var(--bottombar-height);
    background: #ffffff;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    padding: 0 8px;
    z-index: 10;
}

.nav-item {
    flex-direction: column;
    background: transparent;
    color: var(--muted);
    padding: 4px;
    gap: 3px;
    font-size: 0.75rem;
    border-radius: 0;
}

.nav-item.is-active {
    color: var(--brand);
}

.nav-icon {
    font-size: 1.25rem;
    line-height: 1;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    width: 100%;
}

label span {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.required-mark {
    color: #dc2626;
    margin-left: 4px;
}

input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--ink);
    outline: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

input:focus {
    border-color: var(--brand);
}

textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--ink);
    outline: none;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.2s ease;
}

textarea:focus {
    border-color: var(--brand);
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.social-field-group {
    background: var(--neutral);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px;
}

.social-field-title {
    margin: 0;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-transform: none;
}

.phone-input-row {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 10px;
}

.phone-code-select,
.phone-number-input {
    width: 100%;
}

.phone-code-select {
    padding: 12px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--ink);
    outline: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.phone-code-select:focus {
    border-color: var(--brand);
}

@media (max-width: 420px) {
    .phone-input-row {
        grid-template-columns: 1fr;
    }
}

.captured-card-container {
    width: 100%;
    aspect-ratio: 1.58 / 1;
    background: #e2e8f0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--line);
    position: relative;
    margin-bottom: 16px;
}

.captured-card-container.is-interactive {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.captured-card-container.is-interactive:hover,
.captured-card-container.is-interactive:focus-visible {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(13, 141, 242, 0.28);
    outline: none;
}

.captured-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.captured-card-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    padding: 20px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
}

.profile-upload-preview {
    width: 180px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    margin: 0 auto 12px;
}

.upload-link-row {
    display: flex;
    justify-content: center;
    margin: -2px 0 6px;
}

.upload-link-btn {
    border: none;
    background: none;
    padding: 0;
    color: var(--brand);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: underline;
}

.upload-status {
    margin: 4px 0 0;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.upload-status:empty {
    display: none;
}

.image-upload-panel {
    background: var(--neutral);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px;
}

.image-upload-copy {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.image-action-row {
    margin-top: 14px;
}

.image-action-row .ghost-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.edit-form-card {
    box-shadow: var(--shadow-lg);
}

.action-row {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.grow-btn {
    flex: 1;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
}

.scanner-body {
    min-height: 100%;
}

.camera-container {
    position: relative;
    min-height: 100%;
    height: calc(100vh - var(--topbar-height));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #020617;
}

.scan-canvas {
    position: absolute;
    width: 1px;
    height: 1px;
    left: -9999px;
    top: -9999px;
}

.captured-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    display: none;
}

.camera-feed {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #020617;
}

.camera-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: none;
}

.camera-overlay::before {
    content: "";
    position: absolute;
    width: var(--scan-frame-width);
    aspect-ratio: 1.58 / 1;
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 22px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.42);
}

.scanner-status {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #e2e8f0;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    backdrop-filter: blur(10px);
    z-index: 4;
}

.scan-ray {
    position: absolute;
    width: var(--scan-frame-width);
    height: 2px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.9), transparent);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.85);
    animation: scanWave 2s infinite ease-in-out;
    z-index: 2;
}

@keyframes scanWave {
    0% { top: calc(50% - (var(--scan-frame-width) / 1.75 / 2)); }
    50% { top: calc(50% + (var(--scan-frame-width) / 1.75 / 2)); }
    100% { top: calc(50% - (var(--scan-frame-width) / 1.75 / 2)); }
}

.scanner-tip {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    width: min(80%, 320px);
    text-align: center;
    color: #e2e8f0;
    font-size: 0.84rem;
    font-weight: 600;
    z-index: 3;
}

.scanner-bottom-bar {
    position: absolute;
    left: 50%;
    bottom: 72px;
    transform: translateX(-50%);
    width: min(92%, 420px);
    display: flex;
    gap: 12px;
    z-index: 4;
}

.scanner-bottom-btn {
    min-height: 52px;
}

.scanner-bottom-bar .primary-btn,
.scanner-bottom-bar .ghost-btn {
    flex: 1;
}

.scan-result-panel {
    margin: 18px 16px 20px;
    padding: 18px;
}

.scan-review-card {
    display: grid;
    gap: 16px;
}

.scan-review-preview {
    margin-bottom: 0;
}

.scan-review-actions {
    flex-wrap: wrap;
}

.scan-review-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 12px;
    text-decoration: none;
}

.scan-result-header h2,
.scan-result-header p {
    margin: 0;
}

.scan-result-header .eyebrow {
    margin-bottom: 8px;
}

.scan-result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 18px;
}

.scan-result-grid > div {
    padding: 12px 14px;
    border-radius: 16px;
    background: #f8fbff;
    border: 1px solid rgba(13, 141, 242, 0.12);
}

.scan-result-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.scan-result-grid strong {
    color: #0f172a;
    font-size: 0.98rem;
}

.scan-result-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.scan-result-details {
    margin-top: 18px;
}

.scan-result-details pre {
    white-space: pre-wrap;
    word-break: break-word;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    overflow: auto;
}

.scanner-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(10px);
    padding: 20px;
}

.scanner-modal[hidden] {
    display: none !important;
}

.scanner-modal.is-loading .scanner-modal-actions {
    display: none;
}

.scanner-modal.is-loading .scanner-modal-preview {
    display: none;
}

.scanner-modal.is-preview .scanner-modal-loading {
    display: none;
}

.scanner-modal-card {
    width: min(92vw, 360px);
    background: rgba(255, 255, 255, 0.96);
    border-radius: 24px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 24px 80px rgba(2, 6, 23, 0.42);
}

.scanner-modal-card-preview {
    display: grid;
    gap: 16px;
    text-align: left;
}

.scanner-modal-preview {
    width: 100%;
    aspect-ratio: 1.58 / 1;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: #e2e8f0;
}

.scanner-modal-loading {
    text-align: center;
}

.scanner-modal-loading h3 {
    margin: 0 0 10px;
}

.scanner-modal-loading p {
    margin: 0;
    color: var(--muted);
}

.scanner-modal-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.scanner-modal-btn {
    min-height: 52px;
}

.scanner-spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto 14px;
    border-radius: 50%;
    border: 4px solid rgba(13, 141, 242, 0.16);
    border-top-color: #0d8df2;
    animation: scannerSpin 0.9s linear infinite;
}

@keyframes scannerSpin {
    to { transform: rotate(360deg); }
}

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 65;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(8px);
    padding: 20px;
}

.confirm-modal.is-hidden {
    display: none;
}

.confirm-modal-card {
    width: min(92vw, 360px);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 24px 80px rgba(2, 6, 23, 0.42);
}

.confirm-modal-card h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
    color: var(--ink);
}

.confirm-modal-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.93rem;
}

.confirm-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.confirm-modal-actions .primary-btn,
.confirm-modal-actions .ghost-btn {
    flex: 1;
}

.auth-mode .app-content {
    padding: 18px;
}

.auth-page {
    min-height: 100%;
    display: grid;
    gap: 16px;
    align-content: start;
}

.auth-hero {
    padding: 8px 4px 4px;
}

.auth-hero-copy {
    margin: 10px 0 0;
    color: var(--secondary);
    font-weight: 500;
}

.auth-card {
    padding: 18px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.auth-tab {
    background: #f8fafc;
    border: 1px solid var(--line);
    color: var(--secondary);
}

.auth-tab.is-active {
    background: var(--brand-gradient);
    color: #ffffff;
    border-color: transparent;
}

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

.auth-form.is-hidden {
    display: none;
}

.history-panel {
    margin-top: 2px;
}

.history-timeline {
    display: grid;
    gap: 12px;
}

.history-timeline-item {
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid var(--line);
}

.history-timeline-item strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand);
}

.history-timeline-item span,
.history-timeline-item p,
.empty-inline {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.empty-inline {
    padding: 10px 0;
}

.topbar-logout {
    text-decoration: none;
}
