/* ============================================
   Transfer — Premium UI
   ============================================ */

:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e5e9f2;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-faint: #94a3b8;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: #eef2ff;
    --accent: #7c3aed;
    --primary-rgb: 79, 70, 229;
    --primary-deep: #312e81;
    --text-rgb: 15, 23, 42;
    /* Page background behind the upload cards, and the text drawn on it */
    --page-bg: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary) 45%, var(--accent) 100%);
    --on-page: #ffffff;
    --on-page-rgb: 255, 255, 255;
    --blob-1: #a78bfa;
    --blob-2: #38bdf8;
    --blob-opacity: .35;
    --brand-tile-bg: rgba(255, 255, 255, .15);
    --brand-tile-border: rgba(255, 255, 255, .25);
    --success: #10b981;
    --success-soft: #ecfdf5;
    --danger: #ef4444;
    --danger-soft: #fef2f2;
    --warning: #f59e0b;
    --warning-soft: #fffbeb;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, .08), 0 2px 6px -2px rgba(15, 23, 42, .05);
    --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, .15);
    --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, .13), transparent),
                      radial-gradient(ellipse 60% 40% at 100% 0%, rgba(124, 58, 237, .07), transparent);
    background-repeat: no-repeat;
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    line-height: 1.55;
}

/* ---------- App shell ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, .75);
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -.02em;
}

.brand__logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: grid;
    place-items: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), .35);
    flex-shrink: 0;
}

.brand__logo svg {
    width: 18px;
    height: 18px;
}

.brand__logo img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 36px 24px 64px;
    flex: 1;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 20px 24px;
    text-align: center;
    color: var(--text-faint);
    font-size: 13px;
}

/* ---------- Page heading ---------- */

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.03em;
    background: linear-gradient(90deg, var(--text), var(--primary-hover));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-header p {
    margin: 0;
    color: var(--text-muted);
    max-width: 560px;
}

/* ---------- Client card ---------- */

.client-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 24px;
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
}

.client-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), .3);
}

.client-card__details {
    flex: 1;
    min-width: 200px;
}

.client-card__name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.client-card__meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 3px;
}

.client-card__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
}

.client-card__meta-item svg {
    width: 14px;
    height: 14px;
    color: var(--text-faint);
    flex-shrink: 0;
}

/* ---------- Header user chip ---------- */

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-user__name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
}

@media (max-width: 520px) {
    .header-user__name {
        display: none;
    }
}

/* ---------- Cards ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-top: 24px;
    box-shadow: var(--shadow-md);
}

.card h2 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.card h3 {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
}

/* ---------- Forms ---------- */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 4px;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 16px;
}

.form-grid .form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 7px;
    letter-spacing: .01em;
}

.form-control,
input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 11px 14px;
    font-size: 14.5px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
}

select.form-control {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-control:focus,
input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .12);
}

.form-control::placeholder {
    color: var(--text-faint);
}

.field-validation-error {
    display: block;
    color: var(--danger);
    font-size: 13px;
    margin-top: 5px;
}

.validation-summary-errors {
    background: var(--danger-soft);
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 18px;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 18px;
}

.validation-summary-valid {
    display: none;
}

/* ---------- Buttons ---------- */

.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background .15s, box-shadow .15s, transform .1s, border-color .15s, color .15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary,
button[type="submit"],
#uploadBtn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), .35);
}

.btn-primary:hover,
button[type="submit"]:hover,
#uploadBtn:hover {
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), .45);
    transform: translateY(-1px);
}

.btn-primary:active,
button[type="submit"]:active,
#uploadBtn:active {
    transform: translateY(0);
}

.btn-ghost,
button.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
    box-shadow: none;
    padding: 8px 16px;
    font-size: 13.5px;
}

.btn-ghost:hover,
button.btn-ghost:hover {
    color: var(--text);
    border-color: #cbd5e1;
    background: var(--surface-2);
}

.btn-block {
    width: 100%;
}

/* ---------- Button loading state (sign in / guest) ---------- */

.btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: dl-spin .7s linear infinite;
    flex-shrink: 0;
}

.is-loading .btn-spinner {
    display: inline-block;
}

.btn-guest.is-loading svg {
    display: none;
}

.btn.is-loading,
.btn.is-loading:hover,
.btn.is-loading:disabled {
    cursor: progress;
    transform: none;
    opacity: .9;
}

.btn-guest.is-disabled {
    pointer-events: none;
    opacity: .55;
}

/* ---------- Drop zone ---------- */

.drop-zone {
    border: 2px dashed #c7d0e0;
    border-radius: var(--radius);
    padding: 44px 24px;
    text-align: center;
    background: var(--surface-2);
    transition: background .2s, border-color .2s, transform .2s;
    margin: 20px 0;
    cursor: pointer;
}

.drop-zone:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.drop-zone.dragover {
    background: var(--primary-soft);
    border-color: var(--primary);
    transform: scale(1.005);
}

.drop-zone__icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    display: grid;
    place-items: center;
    transition: transform .2s;
}

.drop-zone.dragover .drop-zone__icon,
.drop-zone:hover .drop-zone__icon {
    transform: translateY(-3px);
}

.drop-zone__icon svg {
    width: 26px;
    height: 26px;
}

.drop-zone__title {
    font-weight: 700;
    font-size: 16px;
    margin: 0 0 4px;
    letter-spacing: -.01em;
}

.drop-zone__hint {
    color: var(--text-muted);
    font-size: 13.5px;
    margin: 0;
}

.drop-zone__hint .link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.drop-zone__hint .link:hover {
    text-decoration: underline;
}

.drop-zone input[type="file"] {
    display: none;
}

/* ---------- Status & progress ---------- */

#status {
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    min-height: 20px;
}

#progressList {
    margin-top: 8px;
}

.progress-row {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: 10px;
    background: var(--surface-2);
}

.progress-row__name {
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-row__size {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12.5px;
    margin-left: 8px;
}

.progress-row__track {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
    margin-top: 9px;
}

.progress-row__bar {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width .25s ease;
}

.progress-row__bar.is-done {
    background: var(--success);
}

.progress-row__bar.is-failed {
    background: var(--danger);
}

.progress-row__pct {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ---------- Tabs ---------- */

.tabs {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 22px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 4px;
    border-radius: 12px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 9px;
    cursor: pointer;
    box-shadow: none;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm), 0 0 0 1px var(--border);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn .25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Tables ---------- */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-faint);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

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

tbody tr {
    transition: background .12s;
}

tbody tr:hover {
    background: var(--surface-2);
}

td.cell-muted {
    color: var(--text-muted);
    font-size: 13.5px;
    white-space: nowrap;
}

td.cell-name {
    font-weight: 600;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-download {
    color: var(--primary);
    font-weight: 600;
    font-size: 13.5px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.link-download:hover {
    text-decoration: underline;
}

.link-download svg {
    width: 14px;
    height: 14px;
}

/* ---------- Badges ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-success {
    background: var(--success-soft);
    color: #047857;
}

.badge-danger {
    background: var(--danger-soft);
    color: #b91c1c;
}

.badge-warning {
    background: var(--warning-soft);
    color: #b45309;
}

/* Caption above the dashboard lists ("Showing ... last 10 days") */
.list-range {
    margin: 0 0 10px;
    font-size: 12.5px;
    color: var(--text-muted);
}

/* ---------- Media source tag (Order Status) ---------- */

.media-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.media-tag::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.media-tag--mwa {
    background: var(--primary-soft);
    color: #4338ca;
}

.media-tag--sftp {
    background: #fff7ed;
    color: #c2410c;
}

/* ---------- Empty state ---------- */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-faint);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}

.empty-state svg {
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
    opacity: .5;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* ---------- Auth (login) ---------- */

.auth-wrap {
    min-height: calc(100vh - 180px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.auth-card {
    width: 100%;
    max-width: 410px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
}

.auth-card__logo {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: grid;
    place-items: center;
    color: #fff;
    margin: 0 auto 20px;
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), .35);
}

.auth-card__logo svg {
    width: 25px;
    height: 25px;
}

.auth-card__logo img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.auth-card h2 {
    text-align: center;
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.auth-card__sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin: 0 0 28px;
}

.auth-card__divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 18px;
    color: var(--text-faint);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.auth-card__divider::before,
.auth-card__divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.btn-guest,
a.btn-guest {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.btn-guest:hover,
a.btn-guest:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.btn-guest svg {
    width: 16px;
    height: 16px;
}

.auth-card__guest-hint {
    text-align: center;
    color: var(--text-faint);
    font-size: 12.5px;
    margin: 10px 0 0;
}

/* ============ Guest upload page (pCloud Transfer style) ============ */

.guest-body {
    min-height: 100vh;
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--page-bg);
    position: relative;
    overflow-x: hidden;
}

.guest-body::before,
.guest-body::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: var(--blob-opacity);
    pointer-events: none;
    z-index: 0;
}

.guest-body::before {
    width: 560px;
    height: 560px;
    background: var(--blob-1);
    top: -180px;
    right: -120px;
}

.guest-body::after {
    width: 480px;
    height: 480px;
    background: var(--blob-2);
    bottom: -200px;
    left: -140px;
}

.guest-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 36px;
}

.guest-topbar__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--on-page);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -.02em;
    text-decoration: none;
}

.guest-topbar__brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--brand-tile-bg);
    border: 1px solid var(--brand-tile-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.guest-topbar__brand-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--on-page);
}

.guest-topbar__brand-icon img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.guest-topbar__signin {
    color: var(--on-page);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid rgba(var(--on-page-rgb), .35);
    transition: background .15s ease;
}

.guest-topbar__signin:hover {
    background: rgba(var(--on-page-rgb), .12);
}

.guest-topbar__right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.guest-topbar__user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(var(--on-page-rgb), .92);
    font-size: 14px;
    font-weight: 600;
}

.guest-topbar__user svg {
    width: 16px;
    height: 16px;
}

.guest-signout,
button.guest-signout[type="submit"] {
    background: transparent;
    color: var(--on-page);
    font-size: 14px;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid rgba(var(--on-page-rgb), .35);
    box-shadow: none;
    transition: background .15s ease;
}

.guest-signout:hover {
    background: rgba(var(--on-page-rgb), .12);
    box-shadow: none;
    transform: none;
}

.guest-history {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 980px;
    margin: 34px auto 0;
    background: var(--surface);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    padding: 26px 28px;
}

.guest-main {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 64px;
    flex-wrap: wrap;
    padding: 32px 24px 64px;
    min-height: calc(100vh - 160px);
}

.guest-hero {
    max-width: 440px;
    color: var(--on-page);
}

.guest-hero h1 {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.12;
    margin: 0 0 16px;
}

.guest-hero p {
    font-size: 17px;
    line-height: 1.6;
    color: rgba(var(--on-page-rgb), .85);
    margin: 0 0 24px;
}

.guest-hero__points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.guest-hero__points li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14.5px;
    color: rgba(var(--on-page-rgb), .9);
}

.guest-hero__points svg {
    width: 17px;
    height: 17px;
    stroke: #6ee7b7;
    flex-shrink: 0;
}

.guest-card {
    position: relative;
    width: 100%;
    max-width: 430px;
    background: var(--surface);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    padding: 30px 28px 28px;
    transition: box-shadow .15s ease, outline .15s ease;
    outline: 2px dashed transparent;
    outline-offset: -10px;
}

.guest-card.dragover {
    outline-color: var(--primary);
    box-shadow: 0 24px 48px -12px rgba(var(--primary-rgb), .45);
}

.guest-card h2 {
    margin: 0 0 4px;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.02em;
    text-align: center;
}

.guest-card__sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 13.5px;
    margin: 0 0 22px;
}

.guest-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.guest-add__circle {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    border: 2px dashed var(--border);
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.guest-add__circle:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    background: #e0e7ff;
}

.guest-add__circle svg {
    width: 34px;
    height: 34px;
}

.guest-add__label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.guest-add__hint {
    font-size: 12.5px;
    color: var(--text-faint);
}

.guest-add__hint .link {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

.guest-add__hint .link:hover {
    text-decoration: underline;
}

.guest-files {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0 0 14px;
    display: grid;
    gap: 6px;
}

.guest-file {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 13.5px;
}

.guest-file__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.guest-file__size {
    color: var(--text-muted);
    font-size: 12.5px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.guest-file__size.is-failed {
    color: #b91c1c;
    font-weight: 600;
}

.guest-file__remove {
    border: none;
    background: none;
    color: var(--text-faint);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 6px;
    flex-shrink: 0;
}

.guest-file__remove:hover {
    color: var(--danger);
    background: var(--danger-soft);
}

/* In-row upload progress: thin bar under the file name */

.guest-file__track {
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: #e8ecf5;
    overflow: hidden;
    margin-top: 5px;
}

.guest-file__bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width .2s ease;
}

.guest-file__bar.is-done {
    background: var(--success);
}

.guest-file__bar.is-failed {
    background: var(--danger);
}

.guest-file__pct {
    flex-shrink: 0;
    min-width: 34px;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.guest-file__pct.is-done {
    color: var(--success);
    font-size: 14px;
}

.guest-file__pct.is-failed {
    color: var(--danger);
    font-size: 13px;
}

.guest-card .status-box {
    min-height: 18px;
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 12px;
    text-align: center;
}

.guest-card .progress-list {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.guest-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    color: rgba(var(--on-page-rgb), .6);
    font-size: 12.5px;
    padding: 0 24px 26px;
}

/* --- Guest page: headline + two-panel selected state --- */

.guest-body [hidden] {
    display: none !important;
}

.guest-main {
    flex-direction: column;
    gap: 0;
    justify-content: flex-start;
    padding-top: 12px;
}

.guest-head {
    text-align: center;
    color: var(--on-page);
    margin-bottom: 30px;
}

.guest-head h1 {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -.03em;
    margin: 0 0 10px;
}

.guest-head p {
    font-size: 16.5px;
    color: rgba(var(--on-page-rgb), .85);
    margin: 0;
}

.guest-stage {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 22px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
}

.guest-stage.dragover .guest-card,
.guest-stage.dragover .guest-panel {
    outline: 2px dashed var(--primary);
    outline-offset: -10px;
    box-shadow: 0 24px 48px -12px rgba(var(--primary-rgb), .45);
}

.guest-panel {
    background: var(--surface);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.guest-panel--files,
.guest-panel--send {
    flex: 1 1 340px;
    min-width: 0;
}

/* Empty-state card sized like a panel, so the right box can sit beside it */
.guest-card--half {
    flex: 1 1 340px;
    min-width: 0;
    max-width: none;
}

.guest-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.guest-panel__count {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.guest-panel__total {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
    margin-left: 6px;
}

/* Guest "Maximum N GB per order" note under the file count. */
.size-limit-note {
    margin: -6px 0 12px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.size-limit-note.is-over {
    color: #dc2626;
    font-weight: 600;
}

/* "Uploading X of Y file(s)" line in the files box while an upload runs. */
.files-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -4px 0 12px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.files-progress[hidden] {
    display: none;
}

.files-progress__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    animation: files-progress-pulse 1.4s ease-in-out infinite;
}

@keyframes files-progress-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .35; transform: scale(.7); }
}

/* Required-field marker and error outline (guest email + message). */
.req {
    color: #dc2626;
    font-weight: 700;
}

.form-control.is-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}

.guest-clear {
    width: 26px;
    height: 26px;
    padding: 0;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--text-faint);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, color .15s ease;
}

.guest-clear:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.guest-clear svg {
    width: 13px;
    height: 13px;
}

.guest-panel--files .guest-files {
    flex: 1;
    max-height: 320px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 8px;
}

.guest-panel--files .guest-file {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    border: none;
}

.guest-file__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.guest-file__icon svg {
    width: 16px;
    height: 16px;
}

.guest-file__glyph {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.guest-file__glyph--sm {
    font-size: 8.5px;
    letter-spacing: .02em;
}

.guest-file__icon--pdf {
    background: #fee2e2;
    color: #dc2626;
}

.guest-file__icon--word {
    background: #dbeafe;
    color: #2563eb;
}

.guest-file__icon--excel {
    background: #dcfce7;
    color: #16a34a;
}

.guest-file__icon--ppt {
    background: #ffedd5;
    color: #ea580c;
}

.guest-file__icon--psd {
    background: #e0f2fe;
    color: #0284c7;
}

.guest-file__icon--ai {
    background: #fff7ed;
    color: #c2410c;
}

.guest-file__icon--img {
    background: #ede9fe;
    color: #7c3aed;
}

.guest-file__icon--jpg {
    background: #fef9c3;
    color: #ca8a04;
}

.guest-file__icon--png {
    background: #cffafe;
    color: #0891b2;
}

.guest-file__icon--tiff {
    background: #e0e7ff;
    color: #4f46e5;
}

.guest-file__icon--txt {
    background: #e2e8f0;
    color: #475569;
}

.guest-file__icon--html {
    background: #ffe4e6;
    color: #e11d48;
}

.guest-file__icon--video {
    background: #fae8ff;
    color: #a21caf;
}

.guest-file__icon--audio {
    background: #ccfbf1;
    color: #0d9488;
}

.guest-file__icon--zip {
    background: #fef3c7;
    color: #b45309;
}

.guest-file__meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.guest-file__meta .guest-file__name {
    flex: none;
}

/* Folder part of a selected file's path shown in deep yellow; file name stays dark. */
.guest-file__folder {
    color: #ca8a04;
    font-weight: 700;
}

.guest-file__basename {
    color: var(--text);
}

.guest-addmore {
    margin-top: 14px;
    width: 100%;
    padding: 11px 18px;
    border-radius: 999px;
    border: 1.5px solid var(--primary);
    background: var(--surface);
    color: var(--primary);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease;
}

.guest-addmore:hover {
    background: var(--primary-soft);
}

.guest-addmore__hint {
    text-align: center;
    font-size: 12.5px;
    color: var(--text-faint);
    margin: 8px 0 0;
}

.guest-addmore__hint .link {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

.guest-addmore__hint .link:hover {
    text-decoration: underline;
}

.guest-panel__title {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.guest-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 520px) {
    .guest-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

.guest-message {
    resize: vertical;
    min-height: 92px;
}

.guest-panel__note {
    text-align: center;
    color: var(--text-faint);
    font-size: 12.5px;
    margin: 12px 0 0;
}

.guest-panel--send .status-box {
    margin-top: auto;
}

.guest-success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--success-soft);
    color: #047857;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 18px;
}

.guest-success svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

@media (max-width: 960px) {
    .guest-head h1 {
        font-size: 30px;
    }

    .guest-stage {
        gap: 18px;
    }

    .guest-panel--files,
    .guest-panel--send {
        max-width: 520px;
    }
}

/* File-type icons inside the transfer information tables */

.cell-file {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.cell-file__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-wrap .guest-file__icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
}

.table-wrap .guest-file__glyph {
    font-size: 11.5px;
}

.table-wrap .guest-file__glyph--sm {
    font-size: 7.5px;
}

/* ============ FTP View tab ============ */

.guest-file__icon--folder {
    background: #fef3c7;
    color: #d97706;
}

.ftp-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-bottom: 12px;
}

.ftp-path {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text);
}

.ftp-nav {
    width: 30px;
    height: 30px;
    padding: 0;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ftp-nav:hover:not(:disabled) {
    color: var(--primary);
    border-color: var(--primary);
}

.ftp-nav:disabled {
    opacity: .45;
    cursor: default;
}

.ftp-nav svg {
    width: 14px;
    height: 14px;
}

.ftp-zipbtn {
    flex-shrink: 0;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    border: 1.5px solid var(--primary);
    background: var(--surface);
    color: var(--primary);
}

.ftp-zipbtn:hover {
    background: var(--primary-soft);
}

.ftp-status {
    min-height: 18px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.ftp-list-wrap {
    position: relative;
    transition: min-height .2s ease;
}

.ftp-list {
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    display: grid;
    gap: 4px;
    transition: opacity .15s ease;
}

/* Dim the current list while the next folder loads. */
.ftp-list.is-loading {
    opacity: .35;
    pointer-events: none;
}

/* Fade-and-rise the freshly loaded rows. */
.ftp-list.is-enter {
    animation: ftp-fade-in .22s ease;
}

@keyframes ftp-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Spinner overlay, centered over the list area. */
.ftp-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    pointer-events: none;
}

.ftp-loader__text {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.ftp-spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid var(--primary-soft);
    border-top-color: var(--primary);
    animation: dl-spin .8s linear infinite;
}

.ftp-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 13.5px;
}

.ftp-row--folder {
    cursor: pointer;
}

.ftp-row--folder:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.ftp-row__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.ftp-row__meta {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 12.5px;
    text-align: right;
}

.ftp-row__date {
    width: 140px;
}

.ftp-list .guest-file__icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    flex-shrink: 0;
}

.ftp-list .guest-file__glyph {
    font-size: 11.5px;
}

.ftp-list .guest-file__glyph--sm {
    font-size: 7.5px;
}

@media (max-width: 700px) {
    .ftp-row__date {
        display: none;
    }
}

/* Extra status badges for the Order Status tab */

.badge-info {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-neutral {
    background: #e2e8f0;
    color: #475569;
}

.cell-status {
    white-space: nowrap;
}

.cell-status .link-download {
    margin-left: 10px;
}

/* ============ Delivery download page ============ */

.delivery-card {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    padding: 40px 32px 32px;
    text-align: center;
    margin: 40px auto 0;
}

.delivery-card h1 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.delivery-card__order {
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 600;
    margin: 0 0 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delivery-card__status {
    color: var(--text-muted);
    font-size: 14px;
    min-height: 20px;
    margin: 0 0 14px;
}

.delivery-card__track {
    height: 8px;
    border-radius: 999px;
    background: #e8ecf5;
    overflow: hidden;
    margin-bottom: 16px;
}

.delivery-card__bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width .25s ease;
}

.delivery-card__bar.is-indeterminate {
    width: 40% !important;
    animation: dl-slide 1.2s ease-in-out infinite;
}

@keyframes dl-slide {
    0% { margin-left: -40%; }
    100% { margin-left: 100%; }
}

.delivery-card__hint {
    color: var(--text-faint);
    font-size: 12.5px;
    margin: 0;
}

.delivery-card__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.delivery-card__actions .btn-primary {
    width: 100%;
}

.dl-anim {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 22px;
}

.dl-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid var(--primary-soft);
    border-top-color: var(--primary);
    animation: dl-spin 1s linear infinite;
}

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

.dl-arrow {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    color: var(--primary);
    animation: dl-bounce 1.1s ease-in-out infinite;
}

@keyframes dl-bounce {
    0%, 100% { transform: translateY(-5px); }
    50% { transform: translateY(6px); }
}

.dl-check {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--success-soft);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px;
    animation: dl-pop .35s ease;
}

.dl-check svg {
    width: 44px;
    height: 44px;
}

.dl-check--error {
    background: var(--danger-soft);
    color: var(--danger);
}

@keyframes dl-pop {
    0% { transform: scale(.5); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* ============ Upload completed popup ============ */

.upload-done {
    position: relative;
    max-width: 360px;
    text-align: center;
    padding: 34px 28px 30px;
}

.upload-done__close {
    position: absolute;
    top: 14px;
    right: 14px;
}

.upload-done h3 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.upload-done p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.upload-done .dl-check {
    width: 76px;
    height: 76px;
    margin-bottom: 16px;
}

.upload-done .dl-check svg {
    width: 36px;
    height: 36px;
}

/* ============ Preparing-for-upload popup ============ */

.preparing {
    max-width: 240px;
    text-align: center;
    padding: 22px 20px 20px;
    animation: dl-pop .3s ease;
}

.prep-art {
    position: relative;
    width: 66px;
    height: 66px;
    margin: 0 auto 12px;
    color: var(--primary);
}

.prep-art svg {
    width: 100%;
    height: 100%;
}

.prep-cloud {
    opacity: .9;
    animation: prep-pulse 1.8s ease-in-out infinite;
}

@keyframes prep-pulse {
    0%, 100% { opacity: .45; }
    50% { opacity: 1; }
}

.prep-arrow {
    transform-origin: 61px 64px;
    animation: prep-rise 1.3s ease-in-out infinite;
}

@keyframes prep-rise {
    0% { transform: translateY(8px); opacity: 0; }
    30% { opacity: 1; }
    70% { transform: translateY(-6px); opacity: 1; }
    100% { transform: translateY(-10px); opacity: 0; }
}

.prep-dots {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
}

.prep-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    opacity: .3;
    animation: prep-dot 1.2s ease-in-out infinite;
}

.prep-dots i:nth-child(2) { animation-delay: .2s; }
.prep-dots i:nth-child(3) { animation-delay: .4s; }

@keyframes prep-dot {
    0%, 100% { opacity: .3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-4px); }
}

.preparing h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.preparing p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12.5px;
}

/* ============ Order files popup ============ */

.qty-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.qty-link:hover {
    text-decoration: underline;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal {
    background: var(--surface);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 20px 22px;
}

.modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.modal__title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal__status {
    min-height: 16px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.modal .ftp-list {
    max-height: 55vh;
}

/* ============ Announcement banner (master Settings) ============ */

.site-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 auto 20px;
    max-width: 880px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
}

.site-notice svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-card .site-notice {
    margin-bottom: 18px;
    text-align: left;
}

/* ============ Top-bar Settings link (client 1 only) ============ */

.guest-settings-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.guest-settings-link svg {
    width: 15px;
    height: 15px;
}

/* ============ Master settings page ============ */

.admin-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-head h1 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.admin-head__sub {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.admin-alert {
    margin-top: 18px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
}

.admin-alert--ok {
    background: var(--success-soft);
    color: #047857;
    border: 1px solid #a7f3d0;
}

.admin-alert--error {
    background: var(--danger-soft);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.admin-card .form-grid + .form-grid {
    margin-top: 18px;
}

.admin-gap {
    margin-top: 20px;
    margin-bottom: 0;
}

.admin-hint {
    margin: 6px 0 0;
    font-size: 12.5px;
    color: var(--text-faint);
    line-height: 1.45;
}

input[type="number"].form-control,
textarea.form-control {
    width: 100%;
}

.theme-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.theme-preset {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px 7px 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 99px;
    box-shadow: none;
}

.theme-preset:hover {
    border-color: #cbd5e1;
    transform: none;
}

.theme-preset.is-active {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text);
}

.theme-preset__swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

.color-field {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-field__picker {
    width: 52px;
    height: 40px;
    padding: 3px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
}

.color-field__value {
    font-size: 13.5px;
    color: var(--text-muted);
}


.admin-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    margin: 8px 0 0 !important;
    font-size: 14px !important;
    color: var(--text) !important;
    cursor: pointer;
}

.admin-toggle input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.admin-toggle__track {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: 99px;
    background: #cbd5e1;
    transition: background .15s;
    flex-shrink: 0;
}

.admin-toggle__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform .15s;
}

.admin-toggle input:checked + .admin-toggle__track {
    background: var(--primary);
}

.admin-toggle input:checked + .admin-toggle__track::after {
    transform: translateX(18px);
}

.admin-toggle input:focus-visible + .admin-toggle__track {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.admin-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    position: sticky;
    bottom: 0;
    padding: 14px 0;
    background: linear-gradient(to top, var(--bg) 70%, transparent);
}

/* ---- Settings: theme groups, background choice, live preview ---- */

.admin-narrow {
    max-width: 420px;
}

.admin-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

@media (max-width: 760px) {
    .admin-grid-3 {
        grid-template-columns: 1fr;
    }
}

.admin-grid-3 .form-group {
    margin-bottom: 0;
}

.admin-hint--warn {
    margin-top: 10px;
    color: #b45309;
}

.theme-group__title {
    margin: 4px 0 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.theme-group__title ~ .theme-group__title {
    margin-top: 14px;
}

.theme-preset__swatch--light {
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .15);
}

.bg-choices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (max-width: 760px) {
    .bg-choices {
        grid-template-columns: 1fr;
    }
}

.bg-choice {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 12px;
    margin: 0 !important;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text) !important;
    font-size: 14px !important;
    transition: border-color .15s, box-shadow .15s;
}

.bg-choice:hover {
    border-color: #cbd5e1;
}

.bg-choice input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.bg-choice:has(input:checked) {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .15);
}

.bg-choice:has(input:focus-visible) {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.bg-choice strong {
    display: block;
    font-size: 14px;
}

.bg-choice small {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-faint);
}

.bg-choice__sample {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 9px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .12);
}

.bg-choice__sample--gradient {
    background: linear-gradient(135deg, var(--primary-deep), var(--primary) 45%, var(--accent));
}

.bg-choice__sample--soft {
    background: linear-gradient(135deg, var(--primary-soft), #ffffff 55%, var(--primary-soft));
}

.bg-choice__sample--white {
    background: #ffffff;
}

.theme-preview {
    margin-top: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.theme-preview__page {
    padding: 14px 18px 20px;
    background: var(--page-bg);
    transition: background .2s;
}

.theme-preview__topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--on-page);
}

.theme-preview__logo {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--brand-tile-bg);
}

.theme-preview__hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: 12px 0 14px;
    color: var(--on-page);
    text-align: center;
}

.theme-preview__hero strong {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.theme-preview__hero span {
    font-size: 12.5px;
    color: rgba(var(--on-page-rgb), .8);
}

.theme-preview__card {
    max-width: 460px;
    margin: 0 auto;
    padding: 14px 16px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 0 0 1px var(--card-ring, transparent), 0 14px 30px -14px rgba(15, 23, 42, .35);
}

.theme-preview__card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.theme-preview__card-text {
    margin-top: 6px;
    font-size: 13px;
    color: #ca8a04;
    font-weight: 700;
}

.theme-preview__card-text b {
    color: var(--text);
}

.theme-preview__card-muted {
    font-size: 12px;
    color: var(--text-muted);
}

.theme-preview__body {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.theme-preview__btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), .35);
}

.theme-preview__chip {
    padding: 5px 11px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-soft);
}

.theme-preview__bar {
    flex: 1;
    min-width: 100px;
    height: 6px;
    border-radius: 99px;
    background: #e5e9f2;
    overflow: hidden;
}

.theme-preview__bar i {
    display: block;
    width: 62%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.theme-preset__default {
    padding: 1px 7px;
    border-radius: 99px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--primary);
    background: var(--primary-soft);
}
