:root {
    color-scheme: light;
    --bg: #f6f7f9;
    --panel: #ffffff;
    --text: #18202a;
    --muted: #667085;
    --line: #d9dee7;
    --primary: #0b6bcb;
    --primary-dark: #07569f;
    --danger: #c22828;
    --success-bg: #e8f7ee;
    --success-text: #166534;
    --error-bg: #fdecec;
    --error-text: #991b1b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

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

a:hover {
    text-decoration: underline;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0;
}

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

.eyebrow {
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    line-height: 1.15;
}

h1 {
    font-size: 30px;
}

h2 {
    margin-bottom: 16px;
    font-size: 18px;
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.manager-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 16px;
}

.sidebar {
    align-self: start;
}

.folder-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-radius: 6px;
    padding: 9px 10px;
    color: var(--text);
    font-weight: 700;
}

.folder-link:hover,
.folder-link.active {
    background: #eef5fc;
    text-decoration: none;
}

.folder-link b {
    color: var(--muted);
    font-size: 12px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.login-panel {
    max-width: 430px;
}

.form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 9px 11px;
    color: var(--text);
    font: inherit;
    background: #ffffff;
}

input:focus {
    outline: 3px solid rgba(11, 107, 203, 0.15);
    border-color: var(--primary);
}

.dropzone {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 138px;
    border: 2px dashed #9db4cc;
    border-radius: 8px;
    padding: 18px;
    background: #f8fbff;
    color: var(--muted);
    cursor: pointer;
    text-align: center;
}

.dropzone strong {
    display: block;
    color: var(--text);
    font-size: 17px;
}

.dropzone span {
    font-size: 13px;
}

.dropzone.is-dragover {
    border-color: var(--primary);
    background: #edf6ff;
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.selected-files {
    display: grid;
    gap: 10px;
}

.selected-file {
    display: grid;
    grid-template-columns: minmax(0, 0.75fr) minmax(160px, 1fr);
    gap: 12px;
    align-items: end;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #ffffff;
}

.selected-file strong,
.selected-file small {
    display: block;
    overflow-wrap: anywhere;
}

.selected-file small {
    color: var(--muted);
    font-size: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 40px;
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 9px 14px;
    background: var(--primary);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.button:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.button.secondary {
    border-color: var(--line);
    background: #ffffff;
    color: var(--text);
}

.button.secondary:hover {
    background: #f1f4f8;
}

.button.tiny {
    min-height: 32px;
    padding: 5px 9px;
    font-size: 13px;
}

.alert {
    margin-bottom: 16px;
    border-radius: 8px;
    padding: 12px 14px;
    font-weight: 700;
}

.alert.success {
    background: var(--success-bg);
    color: var(--success-text);
}

.alert.error {
    background: var(--error-bg);
    color: var(--error-text);
}

.api-list {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px 12px;
    margin: 0;
}

.api-list dt {
    color: var(--muted);
    font-weight: 700;
}

.api-list dd {
    min-width: 0;
    margin: 0;
}

code {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 2px 5px;
    background: #f8fafc;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
}

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

.search {
    display: flex;
    gap: 8px;
    width: min(460px, 100%);
}

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

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

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 11px 9px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

td small {
    display: block;
    max-width: 260px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 12px;
}

.thumb,
.file-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    background: #f8fafc;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-badge {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.empty {
    color: var(--muted);
    text-align: center;
}

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

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

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

.inline-meta {
    margin: 0;
}

@media (max-width: 760px) {
    .shell {
        width: min(100% - 20px, 1180px);
        padding: 18px 0;
    }

    .topbar,
    .section-head {
        align-items: stretch;
        flex-direction: column;
    }

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

    .manager-layout,
    .selected-file {
        grid-template-columns: 1fr;
    }

    .search {
        flex-direction: column;
    }

    .button {
        width: 100%;
    }
}
