:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #eff6ff;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --input-focus: rgba(59, 130, 246, 0.4);
    
    --header-bg: #0f172a;
    --header-text: #f1f5f9;
    --nav-item-bg: rgba(255, 255, 255, 0.1);
    --nav-item-hover: rgba(255, 255, 255, 0.2);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;
    --container-width: 100%;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --page-padding-x: clamp(1rem, 3vw, 2rem);
}

* {
    box-sizing: border-box;
}

.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;
}

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

.copy-helper {
    position: fixed;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.manual-emphasis {
    color: #b91c1c;
    font-weight: 700;
}

option.manual-option {
    color: #b91c1c;
    font-weight: 700;
}

.confirmed-emphasis {
    color: #b91c1c;
    font-weight: 700;
}

option.confirmed-option {
    color: #b91c1c;
    font-weight: 700;
}

.skip-link {
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    background: #fff;
    color: #0f172a;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-200%);
    transition: transform 0.15s ease;
    z-index: 1000;
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    font-weight: 600;
    line-height: 1.25;
    color: #0f172a;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--page-padding-x);
}

.admin-header {
    background: var(--header-bg);
    color: var(--header-text);
    padding: 0.75rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-header .container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.admin-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    padding: 4px;
}

@media (min-width: 768px) {
    .admin-header .container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
    }
}

.admin-header h1 {
    color: #fff;
    font-size: 1.25rem;
    margin: 0;
    letter-spacing: -0.025em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 14rem;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    flex-direction: column;
}

.admin-nav-left,
.admin-nav-right {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.admin-nav-right {
    justify-content: flex-start;
    width: 100%;
}

.admin-nav-right .admin-user {
    margin-left: 0;
}

@media (max-width: 767px) {
    .admin-nav-left,
    .admin-nav-right {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        -webkit-overflow-scrolling: touch;
    }

    .admin-nav a {
        white-space: nowrap;
    }
}

@media (min-width: 768px) {
    .admin-nav {
        flex-direction: row;
        align-items: center;
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
    }

    .admin-header h1 {
        max-width: 18rem;
    }

    .admin-nav-right {
        margin-left: auto;
        width: auto;
        justify-content: flex-end;
    }
}

.admin-nav a {
    color: #e2e8f0;
    text-decoration: none;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-md);
    background: transparent;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: var(--nav-item-hover);
    color: #fff;
}

.admin-nav a.is-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.admin-user {
    font-size: 0.85rem;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    line-height: 1;
}

.admin-main {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.admin-main .card {
    padding: 1.15rem;
    margin-bottom: 1rem;
}

.admin-main .card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.6rem;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
}

input[type="text"],
input[type="password"],
input[type="file"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: #fff;
    color: var(--text-main);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--input-focus);
}

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

button:hover,
.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

button:active,
.btn:active {
    transform: translateY(0);
}

button:disabled,
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

button:disabled:hover,
.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn.btn-secondary {
    background: #fff;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn.btn-danger {
    background: #ef4444;
}

.btn.btn-danger:hover {
    background: #dc2626;
}

.btn.btn-success {
    background: #16a34a;
}

.btn.btn-success:hover {
    background: #15803d;
}

.btn.btn-warning {
    background: #f59e0b;
    color: #111827;
}

.btn.btn-warning:hover {
    background: #d97706;
    color: #111827;
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.btn.btn-info {
    background: #4f46e5;
}

.btn.btn-info:hover {
    background: #4338ca;
}

.btn.btn-teal {
    background: #0d9488;
}

.btn.btn-teal:hover {
    background: #0f766e;
}

.btn.btn-slate {
    background: #334155;
}

.btn.btn-slate:hover {
    background: #1f2937;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.table-compact {
    font-size: 0.875rem;
}

.table-compact th,
.table-compact td {
    padding: 0.55rem 0.75rem;
}

@media (max-width: 640px) {
    th.col-muted,
    td.col-muted {
        display: none;
    }
}

.cell-ellipsis {
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640px) {
    .cell-ellipsis {
        max-width: 160px;
    }
}

.details-btn > summary {
    list-style: none;
}

.details-btn > summary::-webkit-details-marker {
    display: none;
}

.details-panel {
    margin-top: 0.5rem;
    display: grid;
    gap: 0.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

th, td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f8fafc;
}

tr.row-confirmed td {
    background: rgba(34, 197, 94, 0.06);
}

tr.row-confirmed:hover td {
    background: rgba(34, 197, 94, 0.12);
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.grid-2-tight {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 520px) {
    .grid-2-tight {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.inline-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
}

.attendee-select,
.attendee-input {
    font-size: 0.9rem;
}

.attendee-picker {
    display: none;
}

.attendee-picker-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-main);
    font-size: inherit;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.attendee-picker-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.attendee-picker-text {
    min-width: 0;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attendee-picker-caret {
    flex: 0 0 auto;
    color: var(--text-muted);
}

.attendee-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: end center;
}

.attendee-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.attendee-modal-panel {
    position: relative;
    width: min(680px, 100%);
    max-height: 85vh;
    background: #fff;
    border-radius: 1rem 1rem 0 0;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    display: grid;
    gap: 0.75rem;
}

.attendee-modal-top {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.attendee-modal-search {
    margin-bottom: 0;
}

.attendee-modal-list {
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    background: #fff;
    display: grid;
    gap: 0.25rem;
}

.attendee-item-btn {
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.65rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.9rem;
}

.attendee-item-btn[aria-selected="true"] {
    background: var(--primary-light);
    border-color: rgba(59, 130, 246, 0.25);
}

.attendee-item-btn:hover {
    background: #f8fafc;
}

html.attendee-modal-open,
html.attendee-modal-open body {
    overflow: hidden;
}

@media (max-width: 520px) {
    .attendee-select,
    .attendee-input {
        font-size: 0.85rem;
    }

    .attendee-search-row {
        display: none;
    }

    .attendee-picker {
        display: block;
    }

    .attendee-select {
        display: none;
    }

    .attendee-item-btn {
        font-size: 0.85rem;
    }
}

.mt-xs {
    margin-top: 0.25rem;
}

.mt-sm {
    margin-top: 0.5rem;
}

.mt-md {
    margin-top: 0.75rem;
}

.mt-lg {
    margin-top: 1rem;
}

.mt-neg-sm {
    margin-top: -0.5rem;
}

@media (min-width: 640px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.file-list-checkbox {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    background: #f9fafb;
}

.file-list-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    margin: 0;
    padding: 0.25rem 0;
    cursor: pointer;
}

.qr-thumb {
    width: 180px;
    height: 180px;
    object-fit: contain;
    border-radius: 0;
    border: 1px solid var(--border-color);
    image-rendering: pixelated;
}

.qr-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto;
}

.qr-wrapper-lg {
    width: 220px;
    height: 220px;
}

.qr-wrapper .qr-thumb {
    width: 100%;
    height: 100%;
    display: block;
}

.qr-logo-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14%;
    height: 14%;
    min-width: 20px;
    min-height: 20px;
    max-width: 32px;
    max-height: 32px;
    transform: translate(-50%, -50%);
    border-radius: var(--radius-md);
    background: #fff;
    padding: 2px;
    object-fit: contain;
    box-shadow: 0 0 0 1px #fff, var(--shadow-md);
}

.qr-logo-preview {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-top: 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    padding: 2px;
}

.logo-upload-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.logo-upload-row .qr-logo-preview {
    margin-top: 0;
}

.link-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: monospace;
}

.link-actions {
    margin-top: 0.5rem;
}

.link-actions .btn {
    width: 100%;
    justify-content: center;
}

.scan-wrap {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #0b1220;
    box-shadow: var(--shadow-md);
}

.scan-video {
    width: 100%;
    height: auto;
    display: block;
    background: #0b1220;
}

.scan-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at center, rgba(0,0,0,0) 0 45%, rgba(0,0,0,0.55) 60% 100%),
        linear-gradient(transparent, rgba(0,0,0,0.2));
}

.scan-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.scan-status {
    margin-top: 0.75rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.scan-help {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}

.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f1f5f9;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 24px 24px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 1.5rem var(--page-padding-x);
}

.auth-container .card {
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: none;
}

.auth-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-main);
}

.stat-box {
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid #dbeafe;
    transition: transform 0.2s;
}

.stat-box:hover {
    transform: translateY(-2px);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-value-sm {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

.public-body {
    background: radial-gradient(1200px 600px at 20% 10%, rgba(59, 130, 246, 0.15), transparent 60%),
    radial-gradient(900px 500px at 90% 20%, rgba(14, 165, 233, 0.14), transparent 55%),
    radial-gradient(1000px 700px at 50% 100%, rgba(99, 102, 241, 0.10), transparent 65%),
    #f8fafc;
}

.public-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.25rem var(--page-padding-x);
    min-height: 100vh;
}

.public-container.public-container-with-corner-brand {
    padding-top: 4.75rem;
}

.public-hero {
    position: relative;
    border-radius: calc(var(--radius-lg) + 0.25rem);
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(14, 165, 233, 0.08));
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.public-hero.public-hero-with-corner-brand {
    padding-top: 4.25rem;
}

@media (min-width: 768px) {
    .public-hero.public-hero-with-corner-brand {
        padding-top: 4.5rem;
    }
}

.public-corner-brand {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.45rem 0.55rem;
    border-radius: calc(var(--radius-md) + 0.1rem);
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
    max-width: calc(100% - 1.5rem);
}

.public-corner-brand-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.public-corner-brand-logo {
    width: 24px;
    height: 24px;
    border-radius: 9px;
    background: #fff;
    padding: 2px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: var(--shadow-sm);
    object-fit: contain;
}

.public-corner-brand-logo.public-corner-brand-logo-secondary {
    width: 22px;
    height: 22px;
    border-radius: 8px;
}

.public-corner-brand-text {
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.public-corner-brand-text.public-corner-brand-text-secondary {
    font-weight: 600;
    font-size: 0.86rem;
    color: rgba(15, 23, 42, 0.86);
}

.public-app-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.public-app-brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #fff;
    padding: 3px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: var(--shadow-sm);
    object-fit: contain;
}

.public-app-brand-name {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    line-height: 1.1;
    font-size: 1.25rem;
}

@media (min-width: 768px) {
    .public-hero {
        padding: 1.5rem;
    }
}

.public-hero::before {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    right: -180px;
    top: -220px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(59, 130, 246, 0.35), transparent 65%);
    pointer-events: none;
}

.public-hero::after {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    left: -200px;
    bottom: -240px;
    border-radius: 50%;
    background: radial-gradient(circle at 60% 40%, rgba(14, 165, 233, 0.28), transparent 65%);
    pointer-events: none;
}

.public-hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: center;
}

@media (min-width: 900px) {
    .public-hero-inner {
        grid-template-columns: 1.1fr 0.9fr;
        gap: 1.25rem;
    }
}

.public-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.public-brand-dual {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.public-brand-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.public-logo.public-logo-sm {
    width: 32px;
    height: 32px;
}

.public-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: #fff;
    padding: 2px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: var(--shadow-sm);
    object-fit: contain;
}

.public-brand-name {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    line-height: 1.1;
}

.public-brand-name.public-brand-name-secondary {
    font-weight: 600;
    font-size: 0.95rem;
}

.public-brand-tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.public-header {
    margin-bottom: 0.5rem;
}

.public-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.public-title-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: #fff;
    padding: 2px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: var(--shadow-sm);
    object-fit: contain;
    flex: 0 0 auto;
}

.public-header h1 {
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    margin: 0;
    color: #0f172a;
    letter-spacing: -0.02em;
}

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

.public-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(255, 255, 255, 0.75);
    color: #0f172a;
    font-size: 0.85rem;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.meta-pill.muted {
    color: var(--text-muted);
}

.meta-pill.warning {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.08);
    color: #92400e;
}

.meta-pill.success {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.08);
    color: #166534;
}

.icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.public-hero-art {
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (min-width: 900px) {
    .public-hero-art {
        justify-content: flex-end;
    }
}

.hero-card {
    width: min(360px, 100%);
    border-radius: calc(var(--radius-lg) + 0.25rem);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: var(--shadow-md);
    padding: 1.1rem;
    display: grid;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    isolation: isolate;
}

.hero-card .qr-wrapper {
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.hero-card .qr-thumb {
    width: 100%;
    height: 100%;
}

.hero-card .link-actions {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.hero-card .link-actions .btn {
    width: 100%;
    justify-content: center;
}

.hero-card .link-input {
    margin-top: 0.25rem;
}

.hero-card > * {
    position: relative;
    z-index: 1;
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: -90px;
    background-image:
        radial-gradient(circle, rgba(59, 130, 246, 0.22), transparent 55%),
        radial-gradient(circle, rgba(14, 165, 233, 0.18), transparent 60%),
        radial-gradient(circle, rgba(168, 85, 247, 0.16), transparent 62%);
    background-size: 200% 200%, 180% 180%, 220% 220%;
    background-position: 0% 0%, 100% 70%, 20% 100%;
    pointer-events: none;
    opacity: 0.9;
}

.hero-card::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background-image:
        linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.55) 18%, transparent 42%),
        linear-gradient(to right, rgba(148, 163, 184, 0.12) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
    background-size: 220% 220%, 36px 36px, 36px 36px;
    background-position: 120% 0%, 0 0, 0 0;
    background-blend-mode: overlay, normal, normal;
    mix-blend-mode: overlay;
    mask-image: radial-gradient(circle at 50% 40%, rgba(0, 0, 0, 0.9), transparent 65%);
    pointer-events: none;
    opacity: 0.7;
}

@media (prefers-reduced-motion: no-preference) {
    .hero-card {
        animation: heroCardFloat 7s ease-in-out infinite;
    }

    .hero-card::before {
        animation: heroAuroraShift 12s ease-in-out infinite;
    }

    .hero-card::after {
        animation: heroSheenSweep 5.5s ease-in-out infinite;
    }

    .hero-line {
        animation: heroLineShimmer 2.8s ease-in-out infinite;
    }

    .hero-line.short {
        animation-delay: 0.18s;
    }

    .hero-line.tiny {
        animation-delay: 0.34s;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-card,
    .hero-card::before,
    .hero-card::after {
        animation: none;
    }

    .hero-line {
        animation: none;
    }
}

@keyframes heroCardFloat {
    0% { transform: translateY(0) rotate(-0.2deg); }
    50% { transform: translateY(-6px) rotate(0.2deg); }
    100% { transform: translateY(0) rotate(-0.2deg); }
}

@keyframes heroAuroraShift {
    0% { background-position: 0% 0%, 100% 70%, 20% 100%; }
    50% { background-position: 25% 15%, 70% 35%, 45% 75%; }
    100% { background-position: 0% 0%, 100% 70%, 20% 100%; }
}

@keyframes heroSheenSweep {
    0% { background-position: 120% 0%, 0 0, 0 0; opacity: 0.55; }
    55% { background-position: -20% 100%, 0 0, 0 0; opacity: 0.75; }
    100% { background-position: -20% 100%, 0 0, 0 0; opacity: 0.55; }
}

@keyframes heroLineShimmer {
    0% { background-position: 0% 50%; opacity: 0.75; }
    50% { background-position: 100% 50%; opacity: 1; }
    100% { background-position: 0% 50%; opacity: 0.75; }
}

@media (max-width: 600px) {
    .hero-card .link-actions {
        grid-template-columns: 1fr;
    }
}

.hero-card-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: var(--radius-full);
    padding: 0.25rem 0.55rem;
    border: 1px solid rgba(59, 130, 246, 0.25);
    background: rgba(59, 130, 246, 0.10);
    color: #1d4ed8;
    font-weight: 600;
    font-size: 0.8rem;
    position: relative;
}

.hero-badge-text {
    background-image: linear-gradient(90deg, #2563eb, #06b6d4, #a855f7, #f97316);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.01em;
    text-shadow: 0 0 16px rgba(59, 130, 246, 0.18);
    animation: heroBadgeHue 6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .hero-badge-text {
        animation: none;
    }
}

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

.hero-lines {
    display: grid;
    gap: 0.45rem;
    position: relative;
}

.meta-pill.group-name {
    border-color: rgba(59, 130, 246, 0.22);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(14, 165, 233, 0.10));
    color: #0f172a;
    font-weight: 600;
}

.hero-line {
    height: 10px;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.35), rgba(148, 163, 184, 0.12));
    background-size: 180% 100%;
}

.hero-line.short {
    width: 70%;
}

.hero-line.tiny {
    width: 45%;
}

.public-footer {
    text-align: center;
    margin-top: 3rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.action-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
    min-width: 140px;
}

.action-stack .action-form {
    margin: 0;
}

.action-stack .action-btn {
    width: 100%;
    justify-content: center;
}

.qr-preview {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.qr-preview .public-container {
    min-height: auto;
    padding: 1.25rem var(--page-padding-x);
}

.qr-preview .public-header {
    margin-bottom: 1.25rem;
}

.qr-preview .public-footer {
    margin-top: 1.5rem;
}

.preview-note {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

.file-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.image-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .image-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.image-item {
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: #fff;
    padding: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.image-carousel {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: #fff;
    padding: 0.75rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.image-carousel::before {
    content: "";
    position: absolute;
    inset: -80px;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.16), transparent 55%),
        radial-gradient(circle at 80% 30%, rgba(14, 165, 233, 0.14), transparent 60%),
        radial-gradient(circle at 45% 85%, rgba(168, 85, 247, 0.12), transparent 62%);
    pointer-events: none;
    opacity: 0.9;
    z-index: 0;
}

.image-slide {
    display: none;
}

.image-slide.active {
    display: block;
}

.image-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
    margin-bottom: 0.65rem;
    padding: 0.35rem 0.55rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
}

.image-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: calc(var(--radius-lg) - 0.2rem);
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(248, 250, 252, 0.7);
    object-fit: contain;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 1;
}

.image-carousel .image-img {
    height: 320px;
    height: clamp(200px, 55vw, 360px);
    aspect-ratio: 16 / 9;
}

.image-grid .image-img {
    height: 220px;
    height: clamp(180px, 35vw, 260px);
    aspect-ratio: 16 / 9;
}

.image-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.75rem;
    position: relative;
    z-index: 1;
}

.carousel-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex: 1;
}

.carousel-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.6);
    border: 1px solid rgba(226, 232, 240, 0.9);
    padding: 0;
    transition: transform 0.15s ease, background 0.15s ease;
}

.carousel-dot.active {
    background: var(--primary);
    transform: scale(1.15);
}

@media (min-width: 640px) {
    .file-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .file-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.file-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.file-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(59, 130, 246, 0.35);
}

.file-card-head {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.file-type {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(59, 130, 246, 0.08);
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.file-type.image {
    background: rgba(16, 185, 129, 0.10);
    color: #047857;
}

.file-type.pdf {
    background: rgba(239, 68, 68, 0.10);
    color: #b91c1c;
}

.file-card-title {
    font-weight: 600;
    color: var(--text-main);
    word-break: break-word;
    line-height: 1.35;
}

.file-card-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.file-card-btn {
    width: 100%;
    justify-content: center;
}

.file-card-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-card-note {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}

.file-empty {
    grid-column: 1 / -1;
    padding: 1rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    text-align: center;
    background: #f8fafc;
}

.file-view-card {
    padding: 1.25rem;
}

.file-view-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.file-viewer {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: #f8fafc;
    overflow: hidden;
}

.file-view-fallback {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.pdfjs-pages {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #fff;
}

.pdfjs-page {
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #fff;
}

.pdfjs-canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    background: #fff;
}

.file-view-frame {
    width: 100%;
    height: min(72vh, 900px);
    border: 0;
    display: block;
    background: #fff;
}

.file-view-img {
    width: 100%;
    height: auto;
    display: block;
    background: #fff;
}
