html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    color: #2c3e50;
    line-height: 1.5;
}

:root {
    --bar-height: 64px;
}

h1, h5 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.title {
    text-align: center;
    margin-bottom: 32px;
    font-size: 2rem;
    color: #1a202c;
    font-weight: 800;
}

a {
    color: #2b579a;
    text-decoration: none;
}

button, input, select {
    font-family: inherit;
    font-size: 16px;
}

.page-shell {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
    padding-bottom: calc(24px + var(--bar-height));
}

.center-wrap {
    min-height: calc(100dvh - var(--bar-height));
    display: flex;
    align-items: flex-start;
}

.center-inner { width: 100%; }

.nav-bar {
    background: #e6e7e8;
    border-bottom: 1px solid #c7c8c9;
    padding: 8px 16px;
}

.nav-link {
    color: #444;
    margin-right: 12px;
}

.form-field {
    margin-bottom: 12px;
}

.label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    text-align: left;
}

.textbox, .number, .select {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    font-size: 18px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.textbox:focus {
    outline: none;
    border-color: #4c8bf5;
    box-shadow: 0 0 0 4px rgba(76, 139, 245, 0.15);
}

.centered-input {
    text-align: center;
}

.input-hint {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    margin-top: 8px;
    font-style: italic;
}

.error-hint {
    color: #dc2626;
    font-weight: 500;
}

.success-hint {
    color: #059669;
    font-weight: 500;
}

.primary-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    font-family: inherit;
    font-size: 20px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.primary-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.primary-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.preview {
    margin-top: 24px;
    border: 2px solid #e2e8f0;
    padding: 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.qr-img {
    width: 100%;
    height: auto;
    max-width: 512px;
    display: block;
    margin: 0 auto;
}

.actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(248,249,250,0.98);
    border-top: 1px solid #c7c8c9;
    padding: 12px 0;
    display: flex;
    justify-content: center;
    height: var(--bar-height);
}

@media (max-width: 480px) {
    .page-shell {
        padding: 16px;
        padding-bottom: calc(16px + var(--bar-height));
    }

    h1 { font-size: 1.75rem; }
    .title { margin-bottom: 24px; }

    .bottom-bar { padding: 8px 12px; }
    .bottom-bar .primary-btn { width: 100%; max-width: 480px; }

    .qr-img { max-height: calc(100dvh - var(--bar-height) - 220px); object-fit: contain; }
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fffbe6;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* QR Code Loading Animation */
.qr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f8f9fa;
}

.qr-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    width: 120px;
    height: 120px;
    margin-bottom: 24px;
}

.qr-cell {
    width: 100%;
    height: 100%;
    background: #e2e8f0;
    border-radius: 2px;
    opacity: 0;
    animation: qr-appear 2s ease-in-out infinite;
}

.qr-cell:nth-child(1) { animation-delay: 0s; }
.qr-cell:nth-child(2) { animation-delay: 0.1s; }
.qr-cell:nth-child(3) { animation-delay: 0.2s; }
.qr-cell:nth-child(4) { animation-delay: 0.3s; }
.qr-cell:nth-child(5) { animation-delay: 0.4s; }
.qr-cell:nth-child(6) { animation-delay: 0.5s; }
.qr-cell:nth-child(7) { animation-delay: 0.6s; }
.qr-cell:nth-child(8) { animation-delay: 0.7s; }
.qr-cell:nth-child(9) { animation-delay: 0.8s; }
.qr-cell:nth-child(10) { animation-delay: 0.9s; }
.qr-cell:nth-child(11) { animation-delay: 1s; }
.qr-cell:nth-child(12) { animation-delay: 1.1s; }
.qr-cell:nth-child(13) { animation-delay: 1.2s; }
.qr-cell:nth-child(14) { animation-delay: 1.3s; }
.qr-cell:nth-child(15) { animation-delay: 1.4s; }
.qr-cell:nth-child(16) { animation-delay: 1.5s; }

@keyframes qr-appear {
    0%, 100% {
        opacity: 0;
        background: #e2e8f0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        background: #2563eb;
        transform: scale(1);
    }
}

.loading-text {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}