:root {
    --accent: #0f766e;
    --accent-hover: #0d9488;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    color-scheme: light;

    --tblr-font-sans-serif: var(--font);
    --tblr-font-monospace: var(--mono);
    --tblr-body-font-family: var(--font);
    --tblr-primary: var(--accent);
    --tblr-primary-rgb: 15, 118, 110;
    --tblr-primary-darken: var(--accent-hover);
    --tblr-link-color: var(--accent);
    --tblr-link-hover-color: var(--accent-hover);
}

[data-bs-theme="dark"] {
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --tblr-primary: var(--accent);
    --tblr-primary-rgb: 45, 212, 191;
    --tblr-primary-darken: var(--accent-hover);
    --tblr-link-color: var(--accent);
    --tblr-link-hover-color: var(--accent-hover);
    color-scheme: dark;
}

.mono,
.filename,
code.mono {
    font-family: var(--mono);
}

/* Keep dark vertical sidebar even when page is light */
.navbar-vertical[data-bs-theme="dark"] {
    --tblr-navbar-bg: #0b1220;
}

[data-bs-theme="dark"] .navbar-vertical[data-bs-theme="dark"] {
    --tblr-navbar-bg: #080c14;
}

/* Page header: Tabler zeros .breadcrumb margin despite --tblr-breadcrumb-margin-bottom */
.page-header .breadcrumb {
    margin-bottom: 0.5rem;
}

/* Theme switcher */
.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0.15rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    background: var(--tblr-bg-surface);
}

.theme-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    border: 0;
    border-radius: calc(var(--tblr-border-radius) - 2px);
    background: transparent;
    color: var(--tblr-secondary);
    cursor: pointer;
}

.theme-switch-btn:hover {
    color: var(--tblr-body-color);
    background: var(--tblr-bg-surface-secondary, rgba(0, 0, 0, 0.04));
}

.theme-switch-btn.is-active {
    color: var(--accent);
    background: color-mix(in oklab, var(--accent) 14%, transparent);
}

.theme-switch-btn .icon {
    width: 1rem;
    height: 1rem;
}

/* Files table helpers */
.files-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.files-panel-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.files-search {
    width: 11rem;
}

.files-selection-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.5rem;
    padding: 0.5rem 1.25rem;
    border-bottom: 1px solid var(--tblr-border-color);
    background: var(--tblr-bg-surface-secondary, var(--tblr-bg-surface));
}

.files-selection-bar.is-active {
    background: color-mix(in oklab, var(--accent) 12%, transparent);
}

.files-selection-label {
    flex: 1 1 auto;
    color: var(--tblr-secondary);
    font-size: 0.8125rem;
}

.files-table-scroll {
    overflow-x: auto;
}

.files-table .files-col-check {
    width: 2.5rem;
}

.files-table .files-col-size,
.files-table .files-col-date {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.files-table .files-col-name .filename {
    display: inline-block;
    max-width: 28rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.files-sort-link {
    color: inherit;
    text-decoration: none;
}

.files-sort-link:hover {
    color: var(--accent);
}

/* Destination choice tiles on download form */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 0.65rem;
}

.choice-tile {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    background: var(--tblr-bg-surface);
    cursor: pointer;
}

.choice-tile:hover {
    border-color: var(--accent);
}

.choice-tile:has(.form-check-input:checked) {
    border-color: var(--accent);
    background: color-mix(in oklab, var(--accent) 12%, transparent);
    box-shadow: 0 0 0 1px var(--accent);
}

.choice-tile:has(.form-check-input:disabled) {
    opacity: 0.55;
    cursor: not-allowed;
}

.choice-tile-title {
    font-weight: 600;
    line-height: 1.25;
}

.choice-tile-desc {
    font-size: 0.78rem;
    color: var(--tblr-secondary);
}

.form-control-narrow {
    max-width: 16rem;
}

.source-options-block {
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    background: var(--tblr-bg-surface-secondary, var(--tblr-bg-surface));
    padding: 0.9rem 1rem;
}

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

    .form-control-narrow,
    .files-search {
        max-width: none;
        width: 100%;
    }
}

.choice-fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    min-inline-size: 0;
}

.choice-tile-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.source-options-nested {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--tblr-border-color);
}

.cloud-options {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    background: var(--tblr-bg-surface-secondary, var(--tblr-bg-surface));
}
