:root {
    --bg: #f6f8fb;
    --card: #ffffff;
    --text: #18202f;
    --muted: #667085;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --border: #e4e7ec;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

    a:hover {
        text-decoration: underline;
    }

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    backdrop-filter: blur(12px);
    z-index: 10;
}

.nav {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
}

.nav nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.main {
    padding: 32px 0 56px;
}

.footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    padding: 20px 0;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.hero {
    padding: 44px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #ffffff, #eef5ff);
}

    .hero h1 {
        font-size: 44px;
        margin: 0 0 8px;
    }

    .hero p {
        color: var(--muted);
        font-size: 18px;
        margin-bottom: 24px;
    }

.grid-2, .grid-3 {
    display: grid;
    gap: 18px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

    .page-head h1 {
        margin: 0 0 8px;
    }

.muted {
    color: var(--muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 16px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    min-height: 42px;
}

    .btn:hover {
        text-decoration: none;
        border-color: #cbd5e1;
    }

    .btn.primary {
        background: var(--primary);
        border-color: var(--primary);
        color: #fff;
    }

        .btn.primary:hover {
            background: var(--primary-dark);
        }

    .btn.danger {
        background: var(--danger);
        border-color: var(--danger);
        color: #fff;
    }

    .btn.small {
        padding: 7px 10px;
        min-height: 34px;
        border-radius: 10px;
        font-size: 13px;
    }

    .btn.full {
        width: 100%;
        margin-top: 14px;
    }

.auth-card {
    width: min(460px, 100%);
    margin: 0 auto;
}

label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
input:not([type]) {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

input:focus {
    outline: 2px solid rgba(37, 99, 235, 0.18);
    border-color: var(--primary);
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
}

.validation {
    color: var(--danger);
    font-size: 13px;
}

.alert {
    background: #ecfdf3;
    color: #067647;
    border: 1px solid #abefc6;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.inline-form {
    display: inline;
}

.link-button {
    background: transparent;
    border: 0;
    padding: 0;
    color: var(--primary);
    cursor: pointer;
    font: inherit;
}

.table-card {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 13px;
}

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

.share-box {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 260px;
}

    .share-box input {
        font-size: 12px;
        direction: ltr;
        text-align: left;
    }

.progress-wrap {
    margin-top: 18px;
}

.progress {
    height: 12px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

    .progress > div {
        width: 0;
        height: 100%;
        background: var(--primary);
        transition: width .2s;
    }

.result-box {
    margin-top: 14px;
}

.empty {
    text-align: center;
}

@media (max-width: 800px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero {
        padding: 28px;
    }

        .hero h1 {
            font-size: 34px;
        }

    .nav {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px 0;
    }

        .nav nav {
            flex-wrap: wrap;
        }
}

.upload-guide {
    margin-bottom: 18px;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.guide-item {
    border: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 16px;
    padding: 14px;
}

    .guide-item p {
        margin: 8px 0 0;
        color: var(--muted);
        line-height: 1.9;
    }

.small-note {
    margin-bottom: 0;
    font-size: 13px;
}

.file-info {
    min-height: 22px;
    font-size: 13px;
    line-height: 1.8;
}

.upload-busy {
    margin-bottom: 18px;
}

.btn:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: .65;
}

.btn.is-loading::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.55);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mio-spin .8s linear infinite;
}

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

@media (max-width: 800px) {
    .guide-grid {
        grid-template-columns: 1fr;
    }
}
.upload-progress-box {
    margin-top: 16px;
    padding: 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.upload-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
}

.upload-progress-track {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    width: 0%;
    background: #2563eb;
    border-radius: 999px;
    transition: width 0.2s ease;
}

.upload-status {
    margin-top: 12px;
    font-size: 14px;
    color: #374151;
}

.file-info {
    margin-top: 8px;
    font-size: 13px;
    color: #4b5563;
}
/* Brand / Logo */
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: -0.3px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24);
}

/* Global notices */
.notice-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.app-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid #dbe3ef;
    background: #f8fafc;
    color: #334155;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    line-height: 1.9;
}

    .app-notice strong {
        min-width: 64px;
        font-weight: 900;
    }

    .app-notice.info {
        background: #eff6ff;
        border-color: #bfdbfe;
        color: #1e3a8a;
    }

    .app-notice.success {
        background: #ecfdf3;
        border-color: #abefc6;
        color: #067647;
    }

    .app-notice.warning {
        background: #fffbeb;
        border-color: #fedf89;
        color: #92400e;
    }

    .app-notice.danger {
        background: #fef2f2;
        border-color: #fecaca;
        color: #991b1b;
    }

/* Upload page */
.upload-guide {
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff, #f1f7ff);
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.guide-item {
    border: 1px solid #dbeafe;
    background: rgba(255, 255, 255, 0.82);
    border-radius: 18px;
    padding: 16px;
}

    .guide-item strong {
        color: #1e3a8a;
        font-size: 16px;
    }

    .guide-item p {
        margin: 8px 0 0;
        color: #475569;
        line-height: 2;
    }

.upload-card {
    position: relative;
    overflow: hidden;
}

    .upload-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 5px;
        background: linear-gradient(90deg, #2563eb, #60a5fa, #22c55e);
    }

    .upload-card h2 {
        margin-top: 6px;
    }

.file-info {
    min-height: 28px;
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.9;
    color: #475569;
}

.upload-status {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #374151;
    line-height: 1.8;
    min-height: 46px;
}

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

    .upload-status.info {
        background: #eff6ff;
        border-color: #bfdbfe;
        color: #1d4ed8;
    }

    .upload-status.success {
        background: #ecfdf3;
        border-color: #abefc6;
        color: #067647;
    }

    .upload-status.warning {
        background: #fffbeb;
        border-color: #fedf89;
        color: #92400e;
    }

    .upload-status.danger {
        background: #fef2f2;
        border-color: #fecaca;
        color: #991b1b;
    }

.progress-wrap {
    margin-top: 18px;
    padding: 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.upload-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #334155;
}

    .upload-progress-header strong {
        direction: ltr;
        color: #1d4ed8;
    }

.progress {
    height: 14px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

    .progress > div {
        width: 0;
        height: 100%;
        background: linear-gradient(90deg, #2563eb, #60a5fa);
        border-radius: 999px;
        transition: width .18s ease;
    }

.btn.primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: #1d4ed8;
    color: #fff;
    font-weight: 800;
}

    .btn.primary:hover {
        background: linear-gradient(135deg, #1d4ed8, #1e40af);
    }

.btn:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: .62;
}

.btn.is-loading::before {
    content: "";
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,.55);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mio-spin .8s linear infinite;
}

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

/* Mobile */
@media (max-width: 900px) {
    .container {
        width: min(100% - 24px, 1120px);
    }

    .grid-2,
    .guide-grid {
        grid-template-columns: 1fr;
    }

    .page-head {
        flex-direction: column;
        align-items: stretch;
    }

        .page-head .btn {
            width: 100%;
        }

    .card {
        padding: 18px;
        border-radius: 18px;
    }

    .brand-icon {
        width: 38px;
        height: 38px;
    }

    .app-notice {
        flex-direction: column;
        gap: 4px;
    }

        .app-notice strong {
            min-width: auto;
        }
}

@media (max-width: 520px) {
    .main {
        padding-top: 20px;
    }

    .nav {
        gap: 12px;
    }

        .nav nav {
            width: 100%;
            justify-content: space-between;
            gap: 10px;
            font-size: 13px;
        }

    input[type="file"] {
        font-size: 13px;
    }

    .btn {
        width: 100%;
    }

    .upload-progress-header {
        font-size: 13px;
    }
}
/* Files index: filters */
.file-filter-card {
    margin-bottom: 20px;
}

.file-filter-form {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 0.8fr auto auto;
    gap: 12px;
    align-items: end;
}

.filter-field label {
    display: block;
    font-size: 13px;
    color: #475569;
    margin-bottom: 6px;
}

.file-filter-form input,
.file-filter-form select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 11px 13px;
    font: inherit;
    background: #fff;
    color: var(--text);
}

.files-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 14px 0 18px;
    color: #475569;
    font-size: 14px;
}

    .files-summary strong {
        color: #0f172a;
    }

/* Files index: responsive cards */
.files-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.file-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
    position: relative;
    overflow: hidden;
}

    .file-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 5px;
        background: linear-gradient(90deg, #2563eb, #60a5fa);
    }

.file-card-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.file-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #eff6ff;
    font-size: 24px;
    flex: 0 0 auto;
}

.file-title-box {
    min-width: 0;
}

    .file-title-box h2 {
        margin: 0 0 6px;
        font-size: 17px;
        line-height: 1.7;
        word-break: break-word;
    }

    .file-title-box span {
        color: #64748b;
        font-size: 13px;
    }

.file-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

    .file-meta-grid > div {
        padding: 12px;
        border-radius: 16px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
    }

    .file-meta-grid small {
        display: block;
        color: #64748b;
        margin-bottom: 5px;
    }

    .file-meta-grid strong {
        color: #0f172a;
        font-size: 13px;
    }

.responsive-share {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-bottom: 12px;
}

    .responsive-share input {
        direction: ltr;
        text-align: left;
        font-size: 12px;
    }

.file-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

    .file-actions form {
        margin: 0;
    }

.pagination-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.active-page {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
}

.files-empty {
    text-align: center;
}

/* Drag & Drop upload */
.drop-zone {
    border: 2px dashed #bfdbfe;
    background: #eff6ff;
    border-radius: 20px;
    padding: 22px;
    text-align: center;
    cursor: pointer;
    transition: all .2s ease;
    color: #1e3a8a;
}

    .drop-zone strong {
        display: block;
        margin-bottom: 6px;
        font-weight: 900;
    }

    .drop-zone span {
        color: #64748b;
        font-size: 13px;
    }

    .drop-zone input[type="file"] {
        margin-top: 14px;
        background: #fff;
    }

    .drop-zone.dragover {
        background: #dbeafe;
        border-color: #2563eb;
        transform: translateY(-1px);
        box-shadow: 0 12px 26px rgba(37, 99, 235, 0.16);
    }

/* Responsive */
@media (max-width: 1180px) {
    .file-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

        .file-filter-form button,
        .file-filter-form .btn {
            width: 100%;
        }
}

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

    .file-filter-form {
        grid-template-columns: 1fr;
    }

    .files-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .responsive-share {
        grid-template-columns: 1fr;
    }

        .responsive-share .btn {
            width: 100%;
        }

    .file-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

        .file-actions .btn,
        .file-actions button {
            width: 100%;
        }
}

@media (max-width: 520px) {
    .file-card {
        padding: 15px;
        border-radius: 18px;
    }

    .file-card-head {
        flex-direction: column;
    }

    .file-icon {
        width: 44px;
        height: 44px;
    }

    .file-meta-grid {
        grid-template-columns: 1fr;
    }

    .file-actions {
        grid-template-columns: 1fr;
    }

    .drop-zone {
        padding: 16px;
    }
}
.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Category management */
.category-create-card {
    margin-bottom: 20px;
}

.category-create-form {
    display: grid;
    grid-template-columns: 1fr 1.4fr auto;
    gap: 12px;
    align-items: end;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.category-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

.category-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.category-card h2 {
    margin: 0 0 6px;
}

.category-card p {
    color: #64748b;
    line-height: 1.8;
}

.category-status {
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
}

    .category-status.shared {
        background: #ecfdf3;
        color: #067647;
    }

    .category-status.private {
        background: #f1f5f9;
        color: #475569;
    }

.category-meta {
    margin: 14px 0;
    color: #475569;
}

/* Files index */
.file-filter-card {
    margin-bottom: 20px;
}

.file-filter-form {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr .8fr auto auto;
    gap: 12px;
    align-items: end;
}

.filter-field label {
    display: block;
    font-size: 13px;
    color: #475569;
    margin-bottom: 6px;
}

.file-filter-form input,
.file-filter-form select,
.category-create-form input,
.upload-area select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 11px 13px;
    font: inherit;
    background: #fff;
    color: var(--text);
}

.files-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 14px 0 18px;
    color: #475569;
    font-size: 14px;
}

    .files-summary strong {
        color: #0f172a;
    }

.files-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.file-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
    position: relative;
    overflow: hidden;
}

    .file-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 5px;
        background: linear-gradient(90deg, #2563eb, #60a5fa);
    }

.file-card-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.file-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #eff6ff;
    font-size: 24px;
    flex: 0 0 auto;
}

.file-title-box {
    min-width: 0;
}

    .file-title-box h2 {
        margin: 0 0 6px;
        font-size: 17px;
        line-height: 1.7;
        word-break: break-word;
    }

    .file-title-box span {
        color: #64748b;
        font-size: 13px;
    }

.file-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

    .file-meta-grid > div {
        padding: 12px;
        border-radius: 16px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
    }

    .file-meta-grid small {
        display: block;
        color: #64748b;
        margin-bottom: 5px;
    }

    .file-meta-grid strong {
        color: #0f172a;
        font-size: 13px;
    }

.file-category-label {
    padding: 9px 11px;
    border-radius: 14px;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    margin-bottom: 12px;
    font-size: 13px;
}

.responsive-share {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-bottom: 12px;
}

    .responsive-share input {
        direction: ltr;
        text-align: left;
        font-size: 12px;
    }

.file-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

    .file-actions form {
        margin: 0;
    }

.pagination-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.active-page {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
}

/* Drop zone */
.drop-zone {
    border: 2px dashed #bfdbfe;
    background: #eff6ff;
    border-radius: 20px;
    padding: 22px;
    text-align: center;
    cursor: pointer;
    transition: all .2s ease;
    color: #1e3a8a;
}

    .drop-zone strong {
        display: block;
        margin-bottom: 6px;
        font-weight: 900;
    }

    .drop-zone span {
        color: #64748b;
        font-size: 13px;
    }

    .drop-zone input[type="file"] {
        margin-top: 14px;
        background: #fff;
    }

    .drop-zone.dragover {
        background: #dbeafe;
        border-color: #2563eb;
        transform: translateY(-1px);
        box-shadow: 0 12px 26px rgba(37, 99, 235, 0.16);
    }

/* Invite */
.invite-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.level-badge {
    display: inline-flex;
    padding: 8px 14px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 900;
    margin-bottom: 14px;
}

.quota-box {
    margin-top: 16px;
}

.quota-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #475569;
}

.quota-track {
    height: 14px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.quota-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #22c55e);
}

.quota-meta {
    display: grid;
    gap: 5px;
    margin-top: 10px;
    color: #64748b;
    font-size: 13px;
}

/* Public share */
.public-share-body {
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
    min-height: 100vh;
}

.public-share-shell {
    width: min(1050px, calc(100% - 28px));
    margin: 0 auto;
    padding: 26px 0 50px;
}

.public-share-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

    .public-share-header img {
        width: 54px;
        height: 54px;
        border-radius: 18px;
    }

    .public-share-header strong {
        display: block;
        font-size: 22px;
    }

    .public-share-header span {
        color: #64748b;
    }

.public-ad-banner {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 18px;
    margin-bottom: 18px;
    border-radius: 22px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    box-shadow: 0 14px 35px rgba(37, 99, 235, .25);
}

    .public-ad-banner span {
        opacity: .9;
    }

.public-category-card {
    margin-bottom: 18px;
}

.public-search-form {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    margin-top: 14px;
}

.public-files-grid {
    margin-top: 18px;
}

/* Responsive */
@media (max-width: 1180px) {
    .file-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

        .file-filter-form button,
        .file-filter-form .btn,
        .category-create-form button {
            width: 100%;
        }
}

@media (max-width: 860px) {
    .files-grid,
    .category-grid,
    .invite-grid,
    .category-create-form,
    .public-search-form {
        grid-template-columns: 1fr;
    }

    .file-filter-form {
        grid-template-columns: 1fr;
    }

    .files-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .responsive-share {
        grid-template-columns: 1fr;
    }

        .responsive-share .btn {
            width: 100%;
        }

    .file-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

        .file-actions .btn,
        .file-actions button {
            width: 100%;
        }

    .public-ad-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .page-actions {
        width: 100%;
    }

        .page-actions .btn {
            width: 100%;
        }

    .file-card,
    .category-card {
        padding: 15px;
        border-radius: 18px;
    }

    .file-card-head {
        flex-direction: column;
    }

    .file-icon {
        width: 44px;
        height: 44px;
    }

    .file-meta-grid {
        grid-template-columns: 1fr;
    }

    .file-actions {
        grid-template-columns: 1fr;
    }

    .drop-zone {
        padding: 16px;
    }
}
.drop-zone input[type="file"] {
    display: none;
}
/* =========================
   Mio Mio Home Page
   ========================= */

.home-hero {
    display: grid;
    grid-template-columns: 1.6fr .9fr;
    gap: 28px;
    align-items: center;
    padding: 46px;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 34%), linear-gradient(135deg, #ffffff, #eef5ff);
    overflow: hidden;
}

.home-hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 900;
    border: 1px solid #bfdbfe;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
}

    .hero-badge::before {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: #22c55e;
        box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.14);
    }

.home-hero-content h1 {
    font-size: 42px;
    line-height: 1.45;
    margin: 14px 0 14px;
    color: #0f172a;
    letter-spacing: -0.8px;
}

.home-hero-content p {
    max-width: 760px;
    font-size: 17px;
    line-height: 2.05;
    color: #475569;
    margin: 0 0 24px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.home-hero-card {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
    border: 1px solid #dbeafe;
    border-radius: 30px;
    padding: 26px;
    box-shadow: 0 24px 60px rgba(37, 99, 235, .14), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    text-align: center;
}

    .home-hero-card::before {
        content: "";
        position: absolute;
        inset: -1px;
        border-radius: 30px;
        padding: 1px;
        background: linear-gradient(135deg, rgba(37, 99, 235, .34), rgba(34, 197, 94, .24), transparent);
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        pointer-events: none;
    }

    .home-hero-card img {
        width: 96px;
        height: 96px;
        border-radius: 26px;
        margin-bottom: 18px;
        box-shadow: 0 18px 34px rgba(37, 99, 235, .20);
    }

    .home-hero-card strong {
        display: block;
        font-size: 20px;
        line-height: 1.85;
        color: #0f172a;
        margin-bottom: 8px;
    }

    .home-hero-card span {
        display: block;
        color: #64748b;
        line-height: 1.95;
        font-size: 14px;
    }

/* Stats */

.home-stats {
    margin: 20px 0 30px;
}

.stat-card {
    position: relative;
    text-align: center;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    overflow: hidden;
}

    .stat-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 5px;
        background: linear-gradient(90deg, #2563eb, #60a5fa, #22c55e);
    }

    .stat-card strong {
        display: block;
        font-size: 34px;
        color: #2563eb;
        margin: 8px 0 8px;
        letter-spacing: -0.6px;
    }

    .stat-card span {
        color: #475569;
        line-height: 1.8;
    }

/* Sections */

.home-section {
    margin-top: 30px;
}

.section-head {
    margin-bottom: 18px;
}

    .section-head h2 {
        margin: 0 0 8px;
        font-size: 29px;
        color: #0f172a;
        letter-spacing: -0.4px;
    }

    .section-head p {
        max-width: 820px;
        line-height: 1.9;
    }

.feature-card,
.audience-card {
    min-height: 230px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

    .feature-card:hover,
    .audience-card:hover {
        transform: translateY(-3px);
        border-color: #bfdbfe;
        box-shadow: 0 16px 38px rgba(15, 23, 42, 0.10);
    }

.feature-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    font-size: 27px;
    margin-bottom: 15px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

.feature-card h3,
.audience-card h3 {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 19px;
}

.feature-card p,
.audience-card p {
    color: #475569;
    line-height: 2;
    margin: 0;
}

/* Public share preview */

.home-share-section {
    display: grid;
    grid-template-columns: 1.15fr .9fr;
    gap: 24px;
    align-items: center;
    margin-top: 30px;
    background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.10), transparent 34%), linear-gradient(135deg, #ffffff, #f8fafc);
}

    .home-share-section h2 {
        margin: 0 0 10px;
        color: #0f172a;
        font-size: 28px;
    }

    .home-share-section p {
        color: #475569;
        line-height: 2.05;
        margin: 0;
    }

.public-preview-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 17px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-weight: 900;
    color: #1e3a8a;
}

    .preview-header img {
        width: 44px;
        height: 44px;
        border-radius: 15px;
        box-shadow: 0 10px 22px rgba(37, 99, 235, .17);
    }

.preview-file-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: 17px;
    background: #fff;
    border: 1px solid #e2e8f0;
    margin-top: 10px;
}

    .preview-file-row span {
        color: #334155;
        line-height: 1.7;
        font-size: 14px;
    }

/* Audience */

.audience-card {
    background: linear-gradient(180deg, #ffffff, #fbfdff);
}

    .audience-card h3 {
        position: relative;
        padding-bottom: 10px;
    }

        .audience-card h3::after {
            content: "";
            position: absolute;
            right: 0;
            bottom: 0;
            width: 48px;
            height: 3px;
            border-radius: 999px;
            background: linear-gradient(90deg, #2563eb, #60a5fa);
        }

/* CTA */

.home-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, .22), transparent 28%), linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border-color: rgba(255, 255, 255, .18);
}

    .home-cta h2 {
        margin: 0 0 8px;
        color: #fff;
    }

    .home-cta p {
        margin: 0;
        line-height: 2;
        color: rgba(255, 255, 255, .90);
        max-width: 820px;
    }

    .home-cta .btn {
        background: #fff;
        color: #1d4ed8;
        border-color: #fff;
        font-weight: 900;
    }

        .home-cta .btn.primary {
            background: #0f172a;
            color: #fff;
            border-color: #0f172a;
        }

        .home-cta .btn:hover {
            filter: brightness(.97);
        }

/* Responsive Home */

@media (max-width: 1000px) {
    .home-hero,
    .home-share-section {
        grid-template-columns: 1fr;
    }

    .home-hero {
        padding: 32px;
    }

    .home-hero-content h1 {
        font-size: 34px;
    }

    .home-hero-card {
        max-width: 520px;
        margin: 0 auto;
    }
}

@media (max-width: 900px) {
    .home-cta {
        flex-direction: column;
        align-items: flex-start;
    }

        .home-cta .hero-actions {
            width: 100%;
        }

        .home-cta .btn {
            width: 100%;
        }

    .preview-file-row {
        flex-direction: column;
        align-items: stretch;
    }

        .preview-file-row .btn {
            width: 100%;
        }
}

@media (max-width: 620px) {
    .home-hero {
        padding: 22px;
        border-radius: 20px;
    }

    .home-hero-content h1 {
        font-size: 28px;
        line-height: 1.55;
    }

    .home-hero-content p {
        font-size: 15px;
        line-height: 2;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .home-hero-card {
        padding: 20px;
        border-radius: 22px;
    }

        .home-hero-card img {
            width: 82px;
            height: 82px;
        }

        .home-hero-card strong {
            font-size: 17px;
        }

    .stat-card strong {
        font-size: 28px;
    }

    .section-head h2,
    .home-share-section h2 {
        font-size: 23px;
        line-height: 1.6;
    }

    .feature-card,
    .audience-card {
        min-height: auto;
    }

    .public-preview-box {
        padding: 13px;
    }
}
