/* ========== Reset ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========== Theme Variables ========== */
:root {
    --bg: #0f0f13;
    --surface: #1a1a24;
    --surface-hover: #22222e;
    --border: #2a2a3a;
    --text: #e8e8ed;
    --text-muted: #8888a0;
    --primary: #f5832b;
    --primary-hover: #e07020;
    --primary-soft: rgba(245, 131, 43, 0.08);
    --success: #34d399;
    --error: #f87171;
    --warning: #fbbf24;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --glass-bg: rgba(26, 26, 36, 0.75);
    --glass-border: rgba(255, 255, 255, 0.06);
    --focus-ring: 0 0 0 3px rgba(245, 131, 43, 0.4);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --surface-hover: #f0f0f4;
    --border: #e0e0e8;
    --text: #1a1a2e;
    --text-muted: #6b6b80;
    --primary: #e67320;
    --primary-hover: #d06518;
    --primary-soft: rgba(230, 115, 32, 0.08);
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.06);
    --focus-ring: 0 0 0 3px rgba(230, 115, 32, 0.3);
}

/* ========== Base ========== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-top: max(2rem, env(safe-area-inset-top));
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
    transition: background var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overscroll-behavior-y: none;
}

.page-layout > .container {
    flex: 1;
    min-width: 0;
    max-width: 640px;
    animation: fadeInUp 0.5s ease-out;
}

.container {
    width: 100%;
    max-width: 640px;
    animation: fadeInUp 0.5s ease-out;
}

/* ========== Skip Link ========== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--primary);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    z-index: 1000;
    text-decoration: none;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 1rem;
}

/* ========== Focus Ring ========== */
*:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* ========== Header ========== */
header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), #fb923c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: opacity var(--transition);
}

.subtitle {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

/* ========== Theme Toggle ========== */
.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all var(--transition);
    color: var(--text);
    padding: 0;
    line-height: 1;
}

.theme-toggle:hover {
    background: var(--surface-hover);
    transform: rotate(30deg);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }

[data-theme="light"] .theme-toggle .icon-sun { display: inline; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ========== Steps ========== */
.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    opacity: 0.35;
    transition: opacity 0.4s ease, transform 0.3s ease;
}

.step.active {
    opacity: 1;
    transform: scale(1.05);
}

.step.done {
    opacity: 0.65;
}

.step__number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.4s ease;
    color: var(--text-muted);
}

.step.active .step__number {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 16px rgba(245, 131, 43, 0.35);
}

.step.done .step__number {
    background: var(--success);
    color: #fff;
}

.step__label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.step__line {
    width: 60px;
    height: 2px;
    background: var(--border);
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.step__line::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--success);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s ease;
}

.step.done + .step__line::after,
.step__line.active::after {
    transform: scaleX(1);
}

/* ========== Drop Zone ========== */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px dashed var(--glass-border);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.drop-zone:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.drop-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(245, 131, 43, 0.15);
    animation: pulse-border 1.5s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: var(--primary); }
    50% { border-color: #fb923c; }
}

.drop-zone--compact {
    padding: 2rem 1.5rem;
    margin-top: 1rem;
}

.drop-zone--compact .drop-zone__icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.drop-zone__icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.drop-zone:hover .drop-zone__icon,
.drop-zone.drag-over .drop-zone__icon {
    transform: scale(1.1) translateY(-4px);
}

.drop-zone__text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text);
}

.drop-zone__or {
    display: block;
    color: var(--text-muted);
    margin: 0.75rem 0;
    font-size: 0.85rem;
}

.drop-zone__button {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.drop-zone__button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 131, 43, 0.3);
}

.drop-zone__button:active {
    transform: translateY(0);
}

.drop-zone__hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 1rem;
}

/* ========== Upload Progress ========== */
.upload-progress {
    margin-top: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    animation: fadeInUp 0.3s ease-out;
}

.upload-progress__info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.upload-progress__name {
    font-weight: 500;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-progress__percent {
    color: var(--primary);
    font-weight: 600;
}

.upload-progress__bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.upload-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #fb923c);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.upload-progress__fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========== Result ========== */
.result {
    margin-top: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    animation: fadeInUp 0.5s ease-out;
}

.result__success {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--success);
    margin-bottom: 0.75rem;
}

.result__file-info {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.result__instruction {
    text-align: left;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 3px solid var(--primary);
}

.result__link-box {
    display: flex;
    gap: 0.5rem;
}

.result__link {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    font-family: 'Consolas', 'SF Mono', monospace;
    transition: border-color var(--transition);
}

.result__link:focus {
    border-color: var(--primary);
}

.result__copy {
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.result__copy:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 131, 43, 0.3);
}

.result__copy:active {
    transform: translateY(0);
}

.result__feedback {
    color: var(--success);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

.result__countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.countdown-timer {
    font-family: 'Consolas', 'SF Mono', monospace;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--warning);
    letter-spacing: 0.05em;
}

.countdown-timer.expired {
    color: var(--error);
}

.result__locked {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--primary-soft);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ========== QR Code ========== */
.qr-section {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.qr-section__label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.qr-canvas {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    display: inline-block;
}

/* ========== File List ========== */
.file-list {
    margin-top: 0.75rem;
}

.file-list--uploaded {
    padding: 0.75rem;
}

.file-list__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    transition: background var(--transition);
}

.file-list__item:last-child {
    margin-bottom: 0;
}

.file-list__item:hover {
    background: var(--surface-hover);
}

.file-list__icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.file-list__info {
    flex: 1;
    min-width: 0;
}

.file-list__name {
    font-weight: 600;
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list__meta {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 2px;
}

.file-list__remove {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.75rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
    padding: 0;
}

.file-list__remove:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: var(--error);
    color: var(--error);
}

.btn-upload {
    width: 100%;
    margin-top: 0.75rem;
    text-align: center;
    justify-content: center;
}

/* ========== Password Section ========== */
.password-section {
    margin-top: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    animation: fadeInUp 0.3s ease-out;
}

.password-section__label {
    display: block;
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.password-section__row {
    display: flex;
    gap: 0.5rem;
}

.password-section__input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text);
    font-size: 1rem;
    font-family: 'Consolas', 'SF Mono', monospace;
    outline: none;
    transition: border-color var(--transition);
}

.password-section__input:focus {
    border-color: var(--primary);
}

.password-section__input::placeholder {
    color: var(--text-muted);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
}

.password-section__gen {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-section__gen:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
}

.password-section__hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.6rem;
    margin-bottom: 0;
}

.password-section .btn-upload {
    margin-top: 1rem;
}

/* ========== Status Badge ========== */
.status-badge {
    text-align: center;
    margin-bottom: 1.5rem;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    animation: fadeInUp 0.3s ease-out;
}

.badge--waiting {
    background: rgba(251, 191, 36, 0.12);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge--done {
    background: rgba(52, 211, 153, 0.12);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

/* ========== File Card ========== */
.file-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
    transition: transform var(--transition), box-shadow var(--transition);
    animation: fadeInUp 0.4s ease-out;
}

.file-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.file-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.file-card__role {
    font-weight: 600;
    font-size: 0.9rem;
}

.file-card__status {
    font-size: 0.8rem;
    color: var(--warning);
}

.file-card__status--done {
    color: var(--success);
}

.file-card__body {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
}

.file-card__icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.file-card__info {
    min-width: 0;
}

.file-card__name {
    font-weight: 600;
    font-size: 1rem;
    word-break: break-all;
}

.file-card__meta {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 4px;
}

.file-card__download {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--primary);
    color: #fff;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    margin-left: auto;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.file-card__download:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 131, 43, 0.3);
}

/* ========== State Box ========== */
.state-box {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    animation: fadeInUp 0.4s ease-out;
}

.state-box__icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.state-box h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.state-box p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

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

/* ========== Button ========== */
.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 131, 43, 0.3);
}

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

/* ========== Completed Banner ========== */
.completed-banner {
    text-align: center;
    padding: 1rem;
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: var(--radius);
    margin-top: 1rem;
    color: var(--success);
    font-size: 0.95rem;
    animation: fadeInUp 0.5s ease-out;
}

/* ========== Toast Notifications ========== */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    min-width: 280px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: all 0.3s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.toast--exit {
    animation: toastOut 0.3s ease-in forwards;
}

.toast__icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast__message {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
}

.toast--success { border-left: 4px solid var(--success); }
.toast--error   { border-left: 4px solid var(--error); }
.toast--warning { border-left: 4px solid var(--warning); }
.toast--info    { border-left: 4px solid var(--primary); }

.toast--success .toast__icon { color: var(--success); }
.toast--error   .toast__icon { color: var(--error); }
.toast--warning .toast__icon { color: var(--warning); }
.toast--info    .toast__icon { color: var(--primary); }

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
}

/* ========== Page Layout (Sidebar + Main) ========== */
.page-layout {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    width: 100%;
    max-width: 960px;
}

.rules-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 2rem;
    animation: fadeInUp 0.5s ease-out;
}

.rules-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.rules-card__title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}

.rules-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.rules-list__item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.82rem;
    line-height: 1.45;
}

.rules-list__icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.rules-list__item strong {
    display: block;
    color: var(--text);
    font-weight: 600;
    font-size: 0.84rem;
    margin-bottom: 2px;
}

.rules-list__item p {
    color: var(--text-muted);
    margin: 0;
}

.rules-list__item code {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: 'Consolas', 'SF Mono', monospace;
    font-size: 0.8rem;
    color: var(--primary);
}

/* ========== Info Banner ========== */
.info-banner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-top: 2rem;
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    cursor: pointer;
}

.info-banner:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.info-banner__icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.info-banner__text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.info-banner__text strong {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
}

.info-banner__text span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========== Footer ========== */
footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

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

/* ========== Animations ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== Touch Targets (44px minimum) ========== */
.drop-zone__button,
.result__copy,
.btn-primary,
.file-card__download,
.theme-toggle {
    min-height: 44px;
    min-width: 44px;
}

/* Prevent zoom on input focus (iOS requires >= 16px) */
input[type="text"],
input[type="file"],
select,
textarea {
    font-size: 16px;
}

/* Better touch behavior */
.drop-zone,
.drop-zone__button,
.result__copy,
.btn-primary,
.file-card__download {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* ========== Responsive: Small Phone (≤360px) ========== */
@media (max-width: 360px) {
    body {
        padding: 1rem 0.75rem;
    }

    .page-layout {
        flex-direction: column;
        gap: 1rem;
    }

    .rules-sidebar {
        width: 100%;
        position: static;
    }

    .rules-card {
        padding: 1rem;
    }

    .rules-card__title {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    .rules-list {
        gap: 0.6rem;
    }

    .rules-list__item {
        font-size: 0.78rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .theme-toggle {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

    .steps {
        margin-bottom: 1.25rem;
    }

    .step__number {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .step__label {
        font-size: 0.65rem;
    }

    .step__line {
        width: 20px;
        margin: 0 0.25rem;
        margin-bottom: 1.25rem;
    }

    .drop-zone {
        padding: 1.5rem 1rem;
    }

    .drop-zone--compact {
        padding: 1.25rem 0.75rem;
    }

    .drop-zone__icon {
        font-size: 2.25rem;
        margin-bottom: 0.75rem;
    }

    .drop-zone__text {
        font-size: 0.95rem;
    }

    .drop-zone__button {
        padding: 0.75rem 1.25rem;
        width: 100%;
    }

    .drop-zone__hint {
        font-size: 0.75rem;
    }

    .result {
        padding: 1rem;
    }

    .result__link-box {
        flex-direction: column;
    }

    .result__copy {
        width: 100%;
        padding: 0.85rem;
    }

    .result__instruction {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    .file-card__body {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
        gap: 0.75rem;
    }

    .file-card__download {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        padding: 0.75rem;
    }

    .file-card__icon {
        font-size: 2rem;
    }

    .file-card__name {
        font-size: 0.9rem;
    }

    .badge {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }

    .countdown-timer {
        font-size: 0.95rem;
    }

    .qr-canvas {
        width: 120px !important;
        height: 120px !important;
    }

    .state-box {
        padding: 2rem 1rem;
    }

    .state-box__icon {
        font-size: 2.5rem;
    }

    .toast-container {
        top: auto;
        bottom: max(1rem, env(safe-area-inset-bottom));
        left: 0.75rem;
        right: 0.75rem;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
        animation: toastInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .toast--exit {
        animation: toastOutDown 0.3s ease-in forwards;
    }
}

/* ========== Responsive: Phone (≤480px) ========== */
@media (max-width: 480px) {
    .page-layout {
        flex-direction: column;
        gap: 1rem;
    }

    .rules-sidebar {
        width: 100%;
        position: static;
    }

    .drop-zone {
        padding: 2rem 1.25rem;
    }

    .drop-zone--compact {
        padding: 1.5rem 1rem;
    }

    .drop-zone__button {
        padding: 0.75rem 1.5rem;
        min-height: 48px;
    }

    .result__link-box {
        flex-direction: column;
    }

    .result__copy {
        width: 100%;
        padding: 0.85rem 1rem;
    }

    .result__link {
        padding: 0.85rem 1rem;
        font-size: 0.85rem;
    }

    .steps {
        gap: 0;
    }

    .step__line {
        width: 28px;
    }

    .file-card__body {
        flex-wrap: wrap;
    }

    .file-card__download {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        padding: 0.7rem 1rem;
        margin-top: 0.5rem;
    }

    .toast-container {
        top: auto;
        bottom: max(1rem, env(safe-area-inset-bottom));
        left: 1rem;
        right: 1rem;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
        animation: toastInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .toast--exit {
        animation: toastOutDown 0.3s ease-in forwards;
    }

    .theme-toggle {
        width: 38px;
        height: 38px;
        font-size: 1.05rem;
    }

    .btn-primary {
        width: 100%;
        text-align: center;
        padding: 0.85rem 1.5rem;
    }
}

/* ========== Responsive: Tablet Portrait (≤768px) ========== */
@media (min-width: 481px) and (max-width: 768px) {
    body {
        padding: 2.5rem 2rem;
    }

    .page-layout {
        flex-direction: column;
        gap: 1.25rem;
        max-width: 560px;
    }

    .rules-sidebar {
        width: 100%;
        position: static;
    }

    .container {
        max-width: 100%;
    }

    header h1 {
        font-size: 2.25rem;
    }

    .drop-zone {
        padding: 3rem 2.5rem;
    }

    .drop-zone__icon {
        font-size: 3.5rem;
    }

    .drop-zone__text {
        font-size: 1.2rem;
    }

    .drop-zone__button {
        padding: 0.75rem 2rem;
        font-size: 1rem;
    }

    .result {
        padding: 2rem;
    }

    .result__link-box {
        gap: 0.75rem;
    }

    .result__copy {
        padding: 0.85rem 1.5rem;
    }

    .file-card__body {
        padding: 1.5rem;
    }

    .file-card__download {
        padding: 0.55rem 1.25rem;
    }

    .state-box {
        padding: 3.5rem 2rem;
    }

    .qr-canvas {
        width: 180px !important;
        height: 180px !important;
    }
}

/* ========== Responsive: Tablet Landscape (≤1024px) ========== */
@media (min-width: 769px) and (max-width: 1024px) {
    body {
        padding: 3rem 2.5rem;
    }

    .container {
        max-width: 600px;
    }
}

/* ========== Landscape Phone Optimization ========== */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 0.75rem 1rem;
    }

    .page-layout {
        flex-direction: column;
        gap: 0.5rem;
    }

    .rules-sidebar {
        display: none;
    }

    header {
        margin-bottom: 1rem;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .subtitle {
        display: none;
    }

    .steps {
        margin-bottom: 1rem;
    }

    .step__number {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .step__label {
        display: none;
    }

    .step__line {
        width: 24px;
        margin-bottom: 0;
    }

    .drop-zone {
        padding: 1.25rem 1.5rem;
    }

    .drop-zone__icon {
        font-size: 1.75rem;
        margin-bottom: 0.25rem;
    }

    .drop-zone__or {
        display: none;
    }

    .drop-zone__hint {
        margin-top: 0.5rem;
    }

    .state-box {
        padding: 1.5rem;
    }

    .state-box__icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    footer {
        margin-top: 1rem;
    }
}

/* ========== High DPI / Retina ========== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .upload-progress__bar {
        height: 8px;
    }

    .upload-progress__fill {
        height: 100%;
    }
}

/* ========== Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .container {
        animation: none;
    }

    .file-card:hover,
    .drop-zone:hover,
    .btn-primary:hover,
    .result__copy:hover,
    .file-card__download:hover {
        transform: none;
    }
}

/* ========== Hover-capable devices only ========== */
@media (hover: hover) and (pointer: fine) {
    .drop-zone:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }

    .file-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }

    .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(245, 131, 43, 0.3);
    }

    .result__copy:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(245, 131, 43, 0.3);
    }

    .file-card__download:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(245, 131, 43, 0.3);
    }

    .theme-toggle:hover {
        transform: rotate(30deg);
    }
}

/* Touch devices: remove hover transforms (prevents sticky hover) */
@media (hover: none) {
    .drop-zone:hover {
        transform: none;
        box-shadow: none;
    }

    .file-card:hover {
        transform: none;
        box-shadow: none;
    }

    .btn-primary:hover,
    .result__copy:hover,
    .file-card__download:hover {
        transform: none;
        box-shadow: none;
    }

    .theme-toggle:hover {
        transform: none;
    }

    /* Active state instead for touch feedback */
    .drop-zone:active {
        border-color: var(--primary);
        background: var(--primary-soft);
    }

    .btn-primary:active,
    .result__copy:active,
    .file-card__download:active {
        transform: scale(0.97);
        opacity: 0.9;
    }
}

/* ========== Toast Animations (Mobile: slide from bottom) ========== */
@keyframes toastInUp {
    from {
        opacity: 0;
        transform: translateY(100%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastOutDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(100%) scale(0.8);
    }
}
