:root {
    --color-navy: #0f2747;
    --color-navy-dark: #07182d;
    --color-blue: #2563eb;
    --color-blue-dark: #1d4ed8;
    --color-sky: #eaf2ff;
    --color-green: #15803d;
    --color-green-soft: #e9f8ef;
    --color-red: #b42318;
    --color-red-soft: #fff1f0;
    --color-amber: #b45309;
    --color-amber-soft: #fff7ed;
    --color-text: #172033;
    --color-muted: #627087;
    --color-border: #dbe4f0;
    --color-card: #ffffff;
    --shadow-soft: 0 20px 55px rgba(15, 39, 71, 0.12);
    --shadow-card: 0 14px 35px rgba(15, 39, 71, 0.08);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--color-text);
    font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 34rem),
        linear-gradient(135deg, #f5f8fc 0%, #eef3f8 45%, #f8fafc 100%);
}

button,
a,
input,
summary,
[role="button"] {
    touch-action: manipulation;
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.45);
    outline-offset: 3px;
}

.is-hidden {
    display: none !important;
}

.initial-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(245, 248, 252, 0.92);
    backdrop-filter: blur(8px);
}

.loader-card {
    width: min(100%, 22rem);
    padding: 2rem;
    text-align: center;
    border: 1px solid rgba(219, 228, 240, 0.9);
    border-radius: var(--radius-lg);
    background: var(--color-card);
    box-shadow: var(--shadow-card);
}

.loader-card p {
    margin: 1rem 0 0;
    color: var(--color-muted);
    font-weight: 600;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.login-card {
    width: min(100%, 68rem);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    overflow: hidden;
    border: 1px solid rgba(219, 228, 240, 0.88);
    border-radius: 34px;
    background: var(--color-card);
    box-shadow: var(--shadow-soft);
}

.login-hero-panel {
    position: relative;
    min-height: 34rem;
    padding: 3.2rem;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(15, 39, 71, 0.96), rgba(16, 76, 152, 0.88)),
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.24), transparent 18rem);
}

.login-hero-panel::after {
    content: "";
    position: absolute;
    right: -7rem;
    bottom: -8rem;
    width: 20rem;
    height: 20rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
}

.brand-mark {
    width: 3rem;
    height: 3rem;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: #ffffff;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.28);
}

.brand-mark-lg {
    width: 4.4rem;
    height: 4.4rem;
    margin-bottom: 2rem;
    font-size: 2rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: none;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.75rem;
    color: #5b75a4;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.login-hero-panel .eyebrow {
    color: #bdd7ff;
}

.login-hero-panel h1 {
    max-width: 28rem;
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 4.6rem);
    line-height: 0.98;
    letter-spacing: -0.06em;
}

.login-description {
    max-width: 30rem;
    margin: 1.4rem 0 2.4rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.12rem;
    line-height: 1.7;
}

.login-feature-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.login-feature-grid div {
    min-height: 7rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(8px);
}

.login-feature-grid i {
    font-size: 1.45rem;
}

.login-feature-grid span {
    color: rgba(255, 255, 255, 0.86);
    font-weight: 700;
    line-height: 1.3;
}

.login-action-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
}

.security-chip {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
    padding: 0.48rem 0.75rem;
    color: var(--color-green);
    border-radius: 999px;
    background: var(--color-green-soft);
    font-size: 0.85rem;
    font-weight: 800;
}

.login-action-panel h2 {
    margin: 0 0 0.7rem;
    color: var(--color-navy);
    font-size: 2rem;
    letter-spacing: -0.03em;
}

.login-action-panel p {
    margin: 0;
    color: var(--color-muted);
    line-height: 1.65;
}

.login-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.6rem;
    padding: 0.9rem 1.2rem;
    border: 0;
    border-radius: 16px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-blue), var(--color-blue-dark));
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.24);
}

.login-button:hover {
    transform: translateY(-1px);
}

.privacy-note {
    margin-top: 1.25rem !important;
    color: #738197 !important;
    font-size: 0.88rem;
}

.login-alert,
.upload-alert {
    margin-top: 1.2rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    font-weight: 700;
    line-height: 1.45;
}

.login-alert,
.upload-alert.is-danger {
    color: var(--color-red);
    border: 1px solid rgba(180, 35, 24, 0.18);
    background: var(--color-red-soft);
}

.upload-alert.is-warning {
    color: var(--color-amber);
    border: 1px solid rgba(180, 83, 9, 0.20);
    background: var(--color-amber-soft);
}

.upload-alert.is-success {
    color: var(--color-green);
    border: 1px solid rgba(21, 128, 61, 0.18);
    background: var(--color-green-soft);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    color: #ffffff;
    background: rgba(15, 39, 71, 0.96);
    box-shadow: 0 14px 32px rgba(15, 39, 71, 0.18);
    backdrop-filter: blur(14px);
}

.header-inner {
    min-height: 5.3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    color: #ffffff;
    text-decoration: none;
}

.app-brand strong,
.app-brand small {
    display: block;
}

.app-brand strong {
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.app-brand small {
    margin-top: 0.1rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.78rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.user-avatar {
    width: 2.8rem;
    height: 2.8rem;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.26);
    border-radius: 999px;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    font-weight: 900;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-copy {
    display: grid;
    line-height: 1.25;
}

.user-copy span {
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.user-copy small {
    max-width: 16rem;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.67);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-color: rgba(255, 255, 255, 0.32);
    border-radius: 999px;
    font-weight: 800;
}

.dashboard-main {
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.welcome-section {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.3rem;
    padding: 2rem;
    border: 1px solid rgba(219, 228, 240, 0.88);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(234, 242, 255, 0.82)),
        var(--color-card);
    box-shadow: var(--shadow-card);
}

.welcome-section h1 {
    margin: 0;
    color: var(--color-navy);
    font-size: clamp(2rem, 4vw, 3.4rem);
    letter-spacing: -0.05em;
}

.welcome-section p {
    max-width: 45rem;
    margin: 0.65rem 0 0;
    color: var(--color-muted);
    font-size: 1.05rem;
    line-height: 1.65;
}

.welcome-status {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.68rem 0.9rem;
    color: var(--color-green);
    border: 1px solid rgba(21, 128, 61, 0.16);
    border-radius: 999px;
    background: rgba(233, 248, 239, 0.88);
    font-weight: 900;
}

.status-dot {
    width: 0.68rem;
    height: 0.68rem;
    display: inline-block;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.info-card,
.upload-card,
.guidance-card,
.files-card,
.result-card {
    border: 1px solid rgba(219, 228, 240, 0.92);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-card);
}

.info-card {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1.25rem;
}

.info-icon,
.section-icon {
    width: 3rem;
    height: 3rem;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 16px;
    font-size: 1.25rem;
}

.secure-icon,
.section-icon {
    color: #1d4ed8;
    background: #eaf2ff;
}

.smart-icon {
    color: #7c3aed;
    background: #f2eefe;
}

.storage-icon {
    color: var(--color-green);
    background: var(--color-green-soft);
}

.section-icon.muted {
    color: #475569;
    background: #f1f5f9;
}

.info-card h2,
.guidance-card h2,
.upload-card h2,
.files-card h2 {
    margin: 0;
    color: var(--color-navy);
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.info-card p,
.guidance-card p,
.upload-card p,
.files-card p,
.section-heading p {
    margin: 0.25rem 0 0;
    color: var(--color-muted);
    line-height: 1.55;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22rem;
    gap: 1rem;
    align-items: start;
}

.upload-card,
.guidance-card,
.files-card,
.result-card {
    padding: 1.5rem;
}

.section-heading {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.2rem;
}

.upload-dropzone {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 20rem;
    padding: 2rem;
    text-align: center;
    border: 2px dashed #bfd0e6;
    border-radius: 24px;
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
    cursor: pointer;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragging {
    border-color: var(--color-blue);
    background: #f0f6ff;
    box-shadow: inset 0 0 0 5px rgba(37, 99, 235, 0.06);
    transform: translateY(-1px);
}

.upload-dropzone.is-processing {
    cursor: progress;
    opacity: 0.74;
}

.dropzone-icon {
    width: 4.4rem;
    height: 4.4rem;
    display: grid;
    place-items: center;
    margin-bottom: 1rem;
    color: var(--color-blue);
    border-radius: 22px;
    background: #eaf2ff;
    font-size: 2rem;
}

.upload-dropzone h3 {
    margin: 0;
    color: var(--color-navy);
    font-size: 1.35rem;
    font-weight: 900;
}

.upload-dropzone > p {
    margin: 0.35rem 0 0;
}

.support-note {
    display: inline-flex;
    margin-top: 0.75rem;
    padding: 0.4rem 0.72rem;
    color: #37506f;
    border-radius: 999px;
    background: #edf4fd;
    font-size: 0.88rem;
    font-weight: 800;
}

.selected-file {
    width: min(100%, 33rem);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.9rem;
    margin-top: 1.4rem;
    padding: 0.9rem;
    text-align: left;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 39, 71, 0.08);
}

.selected-file-icon {
    width: 2.9rem;
    height: 2.9rem;
    display: grid;
    place-items: center;
    color: var(--color-blue);
    border-radius: 14px;
    background: #eaf2ff;
    font-size: 1.35rem;
}

.selected-file-copy {
    min-width: 0;
    display: grid;
    gap: 0.1rem;
}

.selected-file-copy strong,
.selected-file-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-file-copy strong {
    color: var(--color-navy);
}

.selected-file-copy span {
    color: var(--color-muted);
    font-size: 0.86rem;
}

.submit-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.45rem;
    gap: 0.7rem;
    margin-top: 1rem;
    border: 0;
    border-radius: 16px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--color-blue), var(--color-blue-dark));
    box-shadow: 0 16px 26px rgba(37, 99, 235, 0.22);
}

.submit-ready,
.submit-processing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.guidance-card {
    position: sticky;
    top: 6.4rem;
}

.guidance-card h2 {
    margin-top: 1rem;
}

.guidance-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.2rem;
}

.guidance-list div {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    color: #334155;
    font-weight: 700;
}

.guidance-list i {
    color: var(--color-green);
    font-size: 1.05rem;
}

.files-section {
    margin-top: 1rem;
}

.files-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.files-heading {
    margin-bottom: 0;
}

.files-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
}

.files-count {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.7rem;
    color: #1f3b65;
    border-radius: 999px;
    background: #eaf2ff;
    font-size: 0.82rem;
    font-weight: 900;
    white-space: nowrap;
}

.refresh-files-button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    font-weight: 800;
}

.files-list {
    display: grid;
    gap: 0.75rem;
}

.file-list-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
    padding: 0.95rem 1rem;
    border: 1px solid #e6edf6;
    border-radius: 18px;
    background: #ffffff;
}

.file-list-icon {
    width: 2.45rem;
    height: 2.45rem;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--color-blue);
    border-radius: 12px;
    background: #eaf2ff;
    font-size: 1.15rem;
}

.file-list-copy {
    min-width: 0;
    display: grid;
    gap: 0.1rem;
}

.file-list-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list-name {
    color: var(--color-navy);
    font-weight: 900;
}

.file-row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.file-action-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    font-weight: 800;
}

.files-state,
.files-error {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 4.5rem;
    padding: 1rem;
    border-radius: 18px;
    background: #f8fafc;
    color: var(--color-muted);
    font-weight: 800;
}

.files-state i {
    color: #94a3b8;
    font-size: 1.35rem;
}

.files-error {
    justify-content: space-between;
    color: var(--color-red);
    border: 1px solid rgba(180, 35, 24, 0.18);
    background: var(--color-red-soft);
}

.delete-file-modal {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.delete-file-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 24, 45, 0.62);
    backdrop-filter: blur(8px);
}

.delete-file-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 34rem);
    overflow: hidden;
    border: 1px solid rgba(219, 228, 240, 0.92);
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 28px 70px rgba(7, 24, 45, 0.30);
    animation: resultReveal 220ms ease both;
}

.delete-file-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.25rem 1.35rem;
    border-bottom: 1px solid var(--color-border);
    background: #f8fbff;
}

.delete-file-icon {
    width: 3rem;
    height: 3rem;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--color-red);
    border-radius: 16px;
    background: var(--color-red-soft);
    font-size: 1.35rem;
}

.delete-file-header h2 {
    margin: 0;
    color: var(--color-navy);
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.delete-file-body {
    padding: 1.25rem 1.35rem;
}

.delete-file-body p {
    margin: 0;
    color: #334155;
    line-height: 1.65;
}

.delete-file-error {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    color: var(--color-red);
    border: 1px solid rgba(180, 35, 24, 0.18);
    border-radius: 14px;
    background: var(--color-red-soft);
    font-weight: 800;
}

.delete-file-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 1rem 1.35rem 1.25rem;
    border-top: 1px solid var(--color-border);
    background: #f8fbff;
}

.delete-file-footer .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-width: 7rem;
    border-radius: 999px;
    font-weight: 800;
}

.result-section {
    margin-top: 1rem;
}

.result-card {
    animation: resultReveal 380ms ease both;
}

@keyframes resultReveal {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--color-border);
}

.success-check {
    width: 3.4rem;
    height: 3.4rem;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #ffffff;
    border-radius: 999px;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.13);
    animation: successPulse 700ms ease both;
}

@keyframes successPulse {
    0% {
        transform: scale(0.82);
        opacity: 0;
    }
    70% {
        transform: scale(1.06);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.result-kicker {
    color: var(--color-green);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.result-header h2 {
    margin: 0.12rem 0 0;
    color: var(--color-navy);
    font-size: clamp(1.35rem, 3vw, 2rem);
    letter-spacing: -0.03em;
}

.category-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1.1rem;
    border-radius: 20px;
    background: #f7fbff;
}

.detail-label {
    display: block;
    margin-bottom: 0.35rem;
    color: #66758d;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.68rem 0.9rem;
    border-radius: 999px;
    color: #1f3b65;
    background: #eaf2ff;
    font-weight: 900;
}

.category-sick {
    color: #be123c;
    background: #fff1f2;
}

.category-annual {
    color: #1d4ed8;
    background: #eaf2ff;
}

.category-emergency {
    color: #b45309;
    background: #fff7ed;
}

.category-maternity {
    color: #9d174d;
    background: #fdf2f8;
}

.category-unpaid {
    color: #475569;
    background: #f1f5f9;
}

.category-other {
    color: #4f46e5;
    background: #eef2ff;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.detail-item {
    min-width: 0;
    padding: 1rem;
    border: 1px solid #e6edf6;
    border-radius: 18px;
    background: #ffffff;
}

.detail-item strong {
    display: block;
    overflow-wrap: anywhere;
    color: #1f2937;
    line-height: 1.45;
}

.detail-wide {
    grid-column: 1 / -1;
}

.keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.keyword-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.65rem;
    color: #1d4ed8;
    border-radius: 999px;
    background: #eaf2ff;
    font-size: 0.86rem;
    font-weight: 900;
}

.empty-keywords {
    color: var(--color-muted);
    font-weight: 700;
}

.object-id {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.95rem;
}

.content-preview {
    margin-top: 1rem;
    border: 1px solid #e6edf6;
    border-radius: 20px;
    background: #f8fafc;
}

.content-preview summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    color: var(--color-navy);
    cursor: pointer;
    font-weight: 900;
    list-style: none;
}

.content-preview summary::-webkit-details-marker {
    display: none;
}

.content-preview summary span {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.content-preview summary > i {
    transition: transform 180ms ease;
}

.content-preview[open] summary > i {
    transform: rotate(180deg);
}

.content-preview pre {
    max-height: 24rem;
    margin: 0;
    padding: 1rem 1.1rem 1.2rem;
    overflow: auto;
    color: #263244;
    border-top: 1px solid #e6edf6;
    border-radius: 0 0 20px 20px;
    background: #ffffff;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.92rem;
    line-height: 1.65;
    white-space: pre-wrap;
}

.toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2500;
    display: grid;
    gap: 0.75rem;
    width: min(calc(100vw - 2rem), 26rem);
    pointer-events: none;
}

.app-toast {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(219, 228, 240, 0.92);
    border-left: 5px solid var(--color-blue);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 16px 36px rgba(15, 39, 71, 0.16);
    opacity: 0;
    pointer-events: auto;
    transform: translateY(-8px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.app-toast.is-leaving {
    opacity: 0;
    transform: translateY(-8px);
}

.app-toast i {
    font-size: 1.2rem;
}

.app-toast strong {
    display: block;
    margin-bottom: 0.1rem;
    color: var(--color-navy);
}

.app-toast p {
    margin: 0;
    color: #475569;
    line-height: 1.45;
}

.app-toast-success {
    border-left-color: var(--color-green);
}

.app-toast-success > i {
    color: var(--color-green);
}

.app-toast-danger {
    border-left-color: var(--color-red);
}

.app-toast-danger > i {
    color: var(--color-red);
}

.app-toast-warning {
    border-left-color: var(--color-amber);
}

.app-toast-warning > i {
    color: var(--color-amber);
}

.app-toast-info > i {
    color: var(--color-blue);
}

.toast-close {
    width: 2rem;
    height: 2rem;
    display: inline-grid;
    place-items: center;
    color: #64748b;
    border: 0;
    border-radius: 999px;
    background: transparent;
}

.toast-close:hover {
    color: #0f172a;
    background: #f1f5f9;
}

@media (max-width: 991.98px) {
    .login-card,
    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .login-hero-panel {
        min-height: auto;
    }

    .guidance-card {
        position: static;
    }
}

@media (max-width: 767.98px) {
    .login-page {
        padding: 1rem;
    }

    .login-card {
        border-radius: 26px;
    }

    .login-hero-panel,
    .login-action-panel {
        padding: 1.5rem;
    }

    .login-feature-grid,
    .info-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .header-inner,
    .welcome-section,
    .category-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .header-inner {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .user-menu {
        width: 100%;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .user-copy span,
    .user-copy small {
        max-width: 100%;
    }

    .dashboard-main {
        padding-top: 1rem;
    }

    .welcome-section,
    .upload-card,
    .guidance-card,
    .files-card,
    .result-card {
        padding: 1rem;
        border-radius: 22px;
    }

    .files-header,
    .files-actions,
    .files-error {
        align-items: stretch;
        flex-direction: column;
    }

    .files-actions,
    .refresh-files-button,
    .files-error button {
        width: 100%;
    }

    .refresh-files-button,
    .files-error button {
        justify-content: center;
    }

    .file-list-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .file-row-actions {
        grid-column: 1 / -1;
        width: 100%;
    }

    .file-action-button {
        flex: 1 1 8rem;
        justify-content: center;
    }

    .delete-file-modal {
        padding: 0.75rem;
    }

    .delete-file-panel {
        border-radius: 22px;
    }

    .delete-file-header,
    .delete-file-body,
    .delete-file-footer {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .delete-file-footer {
        flex-direction: column-reverse;
    }

    .delete-file-footer .btn {
        width: 100%;
    }

    .upload-dropzone {
        min-height: 18rem;
        padding: 1rem;
    }

    .selected-file {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .selected-file button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .toast-stack {
        top: auto;
        right: 1rem;
        bottom: 1rem;
        left: 1rem;
        width: auto;
    }
}

@media (max-width: 480px) {
    .app-brand small,
    .logout-button span {
        display: none;
    }

    .user-menu {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.65rem;
    }

    .logout-button {
        width: 2.5rem;
        height: 2.5rem;
        justify-content: center;
        padding: 0;
    }
}
