:root {
    --ink: #17212b;
    --muted: #687382;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-strong: #ffffff;
    --line: rgba(23, 33, 43, 0.12);
    --accent: #d55f2a;
    --accent-dark: #9e3f1d;
    --leaf: #21745b;
    --leaf-dark: #184c3e;
    --sky: #d9ecf5;
    --sand: #f7ead4;
    --paper: #fffaf1;
    --shadow: 0 22px 60px rgba(26, 39, 54, 0.16);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
    background:
            radial-gradient(circle at 11% 14%, rgba(213, 95, 42, 0.22), transparent 28rem),
            radial-gradient(circle at 86% 6%, rgba(33, 116, 91, 0.18), transparent 24rem),
            linear-gradient(135deg, var(--sand), var(--sky));
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
            linear-gradient(rgba(23, 33, 43, 0.045) 1px, transparent 1px),
            linear-gradient(90deg, rgba(23, 33, 43, 0.045) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 75%);
}

body.modal-open {
    overflow: hidden;
}

.shell {
    position: relative;
    width: min(1500px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 54px;
}

.top-bar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 14px;
}

.logout-button {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 13px;
    color: var(--accent-dark);
    background: rgba(255, 255, 255, 0.76);
    cursor: pointer;
    font-family: inherit;
    font-weight: 800;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 22px;
    align-items: stretch;
    margin-bottom: 22px;
}

.hero-copy,
.upload-card,
.stat,
.table-card {
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.hero-copy {
    padding: 32px;
    overflow: hidden;
    position: relative;
}

.hero-copy::after {
    content: "";
    position: absolute;
    right: -80px;
    bottom: -95px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    border: 42px solid rgba(213, 95, 42, 0.16);
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.eyebrow {
    margin-bottom: 16px;
}

.eyebrow::before,
.section-kicker::before {
    content: "";
    width: 34px;
    height: 2px;
    background: var(--accent);
}

h1,
h2 {
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: -0.05em;
}

h1 {
    max-width: 780px;
    margin: 0;
    font-size: clamp(36px, 5vw, 76px);
    line-height: 0.95;
}

h2 {
    margin: 0;
    font-size: 26px;
    line-height: 1.05;
}

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

.hero-copy p {
    max-width: 760px;
    margin: 18px 0 0;
    font-size: 17px;
    line-height: 1.6;
}

.endpoint-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.endpoint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.endpoint code,
.stat code,
.path-cell,
.file-table small,
.json-output {
    font-family: Consolas, "Courier New", monospace;
}

.endpoint code {
    color: var(--ink);
}

.upload-card {
    padding: 24px;
    background: rgba(255, 255, 255, 0.94);
}

.upload-card p {
    margin: 10px 0 18px;
    line-height: 1.5;
}

.upload-form,
.transmit-form {
    display: grid;
    gap: 14px;
}

.transmit-form {
    margin-top: 14px;
}

.file-picker {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px dashed rgba(23, 33, 43, 0.32);
    border-radius: 18px;
    background: var(--paper);
    color: var(--muted);
    cursor: pointer;
}

.file-picker span {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.file-picker strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-picker input {
    width: 100%;
    color: var(--muted);
}

.button,
.link-button,
.icon-button,
.folder-pill {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: 800;
}

.button,
.icon-button {
    border-radius: 999px;
    padding: 13px 18px;
    color: #fff;
    background: var(--ink);
    letter-spacing: 0.02em;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover,
.icon-button:hover,
.folder-pill:hover,
.link-button:hover {
    transform: translateY(-1px);
}

.button:hover,
.icon-button:hover {
    box-shadow: 0 12px 26px rgba(23, 33, 43, 0.2);
}

.primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.secondary {
    background: linear-gradient(135deg, var(--leaf), var(--leaf-dark));
}

.alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid;
    font-weight: 800;
}

.alert-success {
    color: #154c3b;
    background: rgba(33, 116, 91, 0.14);
    border-color: rgba(33, 116, 91, 0.3);
}

.alert-error {
    color: #7a2616;
    background: rgba(213, 95, 42, 0.14);
    border-color: rgba(213, 95, 42, 0.34);
}

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

.stat {
    padding: 22px;
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.stat strong {
    display: block;
    margin-top: 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 44px;
    line-height: 1;
}

.stat code {
    display: block;
    margin-top: 12px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 12px;
}

.table-grid {
    display: grid;
    gap: 22px;
}

.file-tabs {
    display: grid;
    gap: 16px;
}

.tab-list {
    display: inline-flex;
    width: fit-content;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.tab-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 12px 16px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
}

.tab-button span {
    padding: 3px 8px;
    border-radius: 999px;
    color: var(--ink);
    background: rgba(23, 33, 43, 0.08);
    font-size: 12px;
}

.tab-button.active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.tab-button.active span {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
}

.tab-panels {
    display: grid;
}

.tab-panel[hidden] {
    display: none;
}

.table-card {
    overflow: hidden;
    background: var(--panel-strong);
}

.table-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
}

.table-head p {
    margin: 8px 0 0;
}

.badge,
.chip {
    display: inline-flex;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.badge {
    color: #7a341b;
    background: rgba(213, 95, 42, 0.14);
}

.badge.sent {
    color: #145641;
    background: rgba(33, 116, 91, 0.14);
}

.chip {
    color: #1d4252;
    background: rgba(42, 123, 154, 0.12);
}

.folder-strip {
    display: flex;
    gap: 10px;
    padding: 18px 24px 8px;
    overflow-x: auto;
}

.folder-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 360px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: #fff8ec;
    box-shadow: none;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
    white-space: nowrap;
}

.folder-pill span {
    padding: 3px 8px;
    border-radius: 999px;
    color: var(--ink);
    background: rgba(23, 33, 43, 0.08);
    font-size: 11px;
}

.folder-pill.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.folder-pill.sent.active {
    background: linear-gradient(135deg, var(--leaf), var(--leaf-dark));
}

.folder-pill.active span {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
}

.table-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 8px 24px 18px;
}

.search-box {
    display: grid;
    gap: 7px;
    width: min(420px, 100%);
}

.search-box span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.search-box input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--ink);
    background: #fff;
    outline: none;
}

.search-box input:focus {
    border-color: rgba(213, 95, 42, 0.6);
    box-shadow: 0 0 0 4px rgba(213, 95, 42, 0.12);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.file-table {
    width: 100%;
    min-width: 1120px;
    border-collapse: collapse;
}

.file-table th,
.file-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.file-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: var(--muted);
    background: #fff8ec;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.file-table tbody tr {
    transition: background 120ms ease;
}

.file-table tbody tr:hover {
    background: rgba(247, 234, 212, 0.42);
}

.file-table td {
    font-size: 14px;
}

.file-table small {
    display: block;
    max-width: 360px;
    margin-top: 5px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 12px;
}

.folder-name {
    display: inline-block;
    max-width: 270px;
    overflow-wrap: anywhere;
    font-weight: 800;
}

.path-cell {
    max-width: 260px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 12px;
}

.link-button {
    padding: 8px 11px;
    border-radius: 999px;
    color: var(--accent-dark);
    background: rgba(213, 95, 42, 0.12);
    transition: transform 160ms ease, background 160ms ease;
}

.link-button:hover {
    background: rgba(213, 95, 42, 0.2);
}

.empty-row {
    padding: 26px;
    color: var(--muted);
    text-align: center;
}

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

.modal[hidden] {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 22px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 16, 24, 0.58);
    backdrop-filter: blur(8px);
}

.modal-panel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    width: min(1180px, 100%);
    max-height: min(86vh, 920px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 28px;
    background: #fffdf8;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.32);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding: 22px 24px 14px;
    border-bottom: 1px solid var(--line);
}

.modal-head p {
    max-width: 840px;
    margin: 8px 0 0;
    overflow-wrap: anywhere;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 14px 24px;
    border-bottom: 1px solid var(--line);
    background: #fff8ec;
}

.modal-status {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.json-output {
    min-height: 360px;
    margin: 0;
    padding: 22px 24px 28px;
    overflow: auto;
    color: #22303d;
    background: #f4f0e8;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.login-body {
    display: grid;
    place-items: center;
}

.login-shell {
    position: relative;
    width: min(1040px, calc(100% - 32px));
    padding: 40px 0;
}

.login-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 22px;
    align-items: stretch;
}

.login-copy,
.login-form {
    border: 1px solid var(--line);
    border-radius: 30px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.login-copy {
    position: relative;
    overflow: hidden;
    padding: 34px;
}

.login-copy::after {
    content: "";
    position: absolute;
    right: -70px;
    bottom: -80px;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    border: 38px solid rgba(33, 116, 91, 0.14);
}

.login-copy p {
    max-width: 560px;
    font-size: 17px;
    line-height: 1.6;
}

.login-form {
    display: grid;
    gap: 16px;
    padding: 28px;
    background: rgba(255, 255, 255, 0.94);
}

.login-form label {
    display: grid;
    gap: 8px;
}

.login-form label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.login-form input {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--ink);
    background: #fff;
    outline: none;
}

.login-form input:focus {
    border-color: rgba(213, 95, 42, 0.6);
    box-shadow: 0 0 0 4px rgba(213, 95, 42, 0.12);
}

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

    .stats,
    .login-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .shell {
        width: min(100% - 20px, 1500px);
        padding-top: 18px;
    }

    .hero-copy,
    .upload-card,
    .stat,
    .table-head {
        border-radius: 22px;
        padding: 20px;
    }

    .table-card {
        border-radius: 22px;
    }

    h1 {
        font-size: 38px;
    }

    .endpoint-row,
    .modal-actions,
    .top-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .button,
    .icon-button {
        width: 100%;
    }

    .folder-strip,
    .table-toolbar {
        padding-left: 16px;
        padding-right: 16px;
    }

    .tab-list {
        width: 100%;
    }

    .tab-button {
        flex: 1;
        justify-content: center;
    }

    .modal {
        padding: 10px;
    }

    .modal-panel {
        max-height: 92vh;
        border-radius: 20px;
    }

    .modal-head {
        display: grid;
    }
}
