:root {
    --bg: #eef3ff;
    --bg-secondary: #f7f9ff;
    --bg-tertiary: #e9eefb;
    --ink: #14203f;
    --muted: #5f6c8f;
    --line: rgba(43, 61, 129, 0.14);
    --panel: rgba(255, 255, 255, 0.78);
    --panel-strong: rgba(255, 255, 255, 0.9);
    --surface: #ffffff;
    --surface-soft: #f4f7ff;
    --primary: #3346b9;
    --primary-deep: #202f88;
    --primary-soft: #dce4ff;
    --primary-glow: rgba(73, 97, 210, 0.26);
    --danger: #b34444;
    --success: #1f7b67;
    --shadow-soft: 0 22px 56px rgba(23, 36, 94, 0.12);
    --shadow-strong: 0 34px 90px rgba(23, 36, 94, 0.16);
    --radius-xl: 30px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --grid-color: rgba(55, 79, 168, 0.06);
}

body[data-theme="light"] {
    --bg: #eef3ff;
    --bg-secondary: #f7f9ff;
    --bg-tertiary: #e9eefb;
    --ink: #14203f;
    --muted: #5f6c8f;
    --line: rgba(43, 61, 129, 0.14);
    --panel: rgba(255, 255, 255, 0.78);
    --panel-strong: rgba(255, 255, 255, 0.9);
    --surface: #ffffff;
    --surface-soft: #f4f7ff;
    --grid-color: rgba(55, 79, 168, 0.06);
}

body[data-theme="dark"] {
    --bg: #0c1225;
    --bg-secondary: #101935;
    --bg-tertiary: #162043;
    --ink: #edf2ff;
    --muted: #9eaacd;
    --line: rgba(162, 177, 241, 0.16);
    --panel: rgba(16, 25, 53, 0.8);
    --panel-strong: rgba(18, 28, 60, 0.92);
    --surface: #121d3d;
    --surface-soft: #162347;
    --grid-color: rgba(162, 177, 241, 0.05);
    --shadow-soft: 0 24px 58px rgba(2, 4, 13, 0.45);
    --shadow-strong: 0 38px 100px rgba(2, 4, 13, 0.55);
    --topbar-bg: rgba(16, 25, 53, 0.86);
    --card-bg-soft: rgba(19, 30, 63, 0.84);
    --card-bg-deep: rgba(15, 23, 50, 0.92);
    --chip-bg: rgba(33, 50, 100, 0.82);
    --field-highlight: rgba(122, 143, 224, 0.18);
}

body[data-theme="sand"] {
    --bg: #f6f1eb;
    --bg-secondary: #fffaf3;
    --bg-tertiary: #efe4d8;
    --ink: #30271f;
    --muted: #7d6d60;
    --line: rgba(116, 82, 45, 0.15);
    --panel: rgba(255, 250, 245, 0.82);
    --panel-strong: rgba(255, 253, 249, 0.92);
    --surface: #fffdf9;
    --surface-soft: #fbf0e2;
    --grid-color: rgba(160, 119, 73, 0.05);
    --shadow-soft: 0 22px 52px rgba(73, 44, 18, 0.12);
    --shadow-strong: 0 34px 90px rgba(73, 44, 18, 0.16);
}

body[data-accent="teal"] {
    --primary: #0e7d88;
    --primary-deep: #0d5861;
    --primary-soft: #d5f2f4;
    --primary-glow: rgba(17, 131, 143, 0.24);
}

body[data-accent="blue"] {
    --primary: #3346b9;
    --primary-deep: #202f88;
    --primary-soft: #dce4ff;
    --primary-glow: rgba(73, 97, 210, 0.26);
}

body[data-accent="amber"] {
    --primary: #c07823;
    --primary-deep: #8d5310;
    --primary-soft: #ffe7c8;
    --primary-glow: rgba(192, 120, 35, 0.24);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Manrope", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(118, 143, 255, 0.22), transparent 32%),
        radial-gradient(circle at top right, rgba(144, 159, 223, 0.2), transparent 28%),
        linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg) 56%, var(--bg-tertiary) 100%);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.08) 52%, transparent 100%);
    pointer-events: none;
    z-index: -2;
}

body::after {
    content: "";
    position: fixed;
    inset: auto -10vw -30vh auto;
    width: 52vw;
    height: 52vw;
    min-width: 380px;
    min-height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 68%);
    pointer-events: none;
    z-index: -1;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select {
    font: inherit;
}

.shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px clamp(16px, 3vw, 28px) 36px;
}

.brand-topbar,
.topbar,
.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 26px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-soft);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 14px;
    padding: 7px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.brand-caption {
    margin: 0 0 4px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--primary-deep);
}

.brand-title {
    margin: 0;
    font-family: "Syne", "Segoe UI", sans-serif;
    font-size: 1.25rem;
    line-height: 1;
    letter-spacing: -0.04em;
}

.brand-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.brand-actions,
.top-actions,
.actions,
.row-actions,
.tile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.14fr) minmax(300px, 0.86fr);
    gap: 18px;
    margin-bottom: 18px;
}

.hero-card,
.insight-card,
.stat,
.panel,
.card,
.tile,
.preview,
.item,
.folder-item,
.modal-card,
.theme-panel,
.result {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--panel);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-soft);
}

.hero-card {
    position: relative;
    overflow: hidden;
    padding: clamp(24px, 4vw, 40px);
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.55), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(244, 247, 255, 0.82));
}

.hero-card::after {
    content: "";
    position: absolute;
    top: -64px;
    right: -18px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 68%);
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--line);
    color: var(--primary-deep);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.kicker::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    box-shadow: 0 0 0 6px rgba(54, 77, 187, 0.08);
}

.hero-title {
    margin: 18px 0 16px;
    max-width: 11ch;
    font-family: "Syne", "Segoe UI", sans-serif;
    font-size: clamp(2.4rem, 5.6vw, 4.6rem);
    line-height: 0.95;
    letter-spacing: -0.06em;
}

.hero-text {
    max-width: 60ch;
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.hero-note {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 22px;
    color: var(--muted);
    font-size: 0.9rem;
}

.hero-note strong {
    color: var(--ink);
}

.hero-side {
    display: grid;
    gap: 14px;
}

.insight-card {
    position: relative;
    overflow: hidden;
    padding: 22px;
    min-height: 100%;
    color: #ffffff;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 28%),
        linear-gradient(160deg, #3f56d0 0%, #273790 56%, #182258 100%);
}

.insight-card::after {
    content: "";
    position: absolute;
    inset: auto -30px -40px auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, transparent 70%);
}

.insight-overline {
    margin: 0 0 8px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.8;
}

.insight-title {
    margin: 0;
    font-family: "Syne", "Segoe UI", sans-serif;
    font-size: 2rem;
    line-height: 1;
    letter-spacing: -0.05em;
}

.insight-copy {
    margin: 12px 0 18px;
    max-width: 32ch;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.6;
}

.insight-list,
.story-list {
    display: grid;
    gap: 12px;
}

.insight-item,
.story-item {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.insight-item strong,
.story-item strong {
    font-size: 0.94rem;
}

.insight-item span,
.story-item span {
    font-size: 0.82rem;
    color: inherit;
    opacity: 0.82;
}

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

.stat {
    position: relative;
    overflow: hidden;
    padding: 18px 20px;
}

.stat::after {
    content: "";
    position: absolute;
    right: -34px;
    bottom: -56px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 72%);
}

.stat .label {
    position: relative;
    z-index: 1;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.stat .value {
    position: relative;
    z-index: 1;
    margin-top: 10px;
    font-family: "Syne", "Segoe UI", sans-serif;
    font-size: clamp(1.55rem, 3.8vw, 2.5rem);
    line-height: 1;
    letter-spacing: -0.05em;
}

.layout {
    display: grid;
    grid-template-columns: minmax(290px, 360px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.panel,
.card {
    overflow: hidden;
}

.panel-head,
.card-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0));
}

.panel-head h2,
.panel-head h3,
.panel-head strong,
.card-head strong,
.title h1,
.top h1 {
    margin: 0;
    font-family: "Syne", "Segoe UI", sans-serif;
    font-size: clamp(1.2rem, 2.6vw, 1.7rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.panel-body,
.card-body {
    padding: 18px 20px 20px;
    display: grid;
    gap: 14px;
}

.title p,
.top p,
.helper,
.folder-path,
.size,
.small {
    color: var(--muted);
}

.helper {
    font-size: 0.86rem;
}

.search,
input[type="text"],
input[type="file"],
.theme-field select,
.modal-body input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    color: var(--ink);
    background: var(--panel-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.folder-list {
    display: grid;
    gap: 12px;
    max-height: 72vh;
    overflow: auto;
    padding-right: 4px;
}

.folder-item {
    padding: 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.64);
}

.folder-main {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.folder-name {
    font-size: 1rem;
    font-weight: 800;
}

.folder-count {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(51, 70, 185, 0.08);
    color: var(--primary-deep);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.folder-path {
    font-size: 0.78rem;
    word-break: break-word;
}

.grid,
.preview-grid,
#preview.preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}

.tile,
.preview-grid .preview,
.item {
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    overflow: hidden;
}

.thumb,
.preview-media,
.item-media {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(209, 219, 255, 0.75), rgba(245, 248, 255, 0.94));
    display: block;
}

.tile-meta,
.preview-body,
.item-body {
    padding: 14px;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 8px;
}

.name,
.filename {
    font-size: 0.88rem;
    font-weight: 800;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

button,
.btn {
    appearance: none;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.72);
    border-color: var(--line);
    color: var(--ink);
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
}

button:disabled,
.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    box-shadow: 0 16px 30px rgba(51, 70, 185, 0.18);
}

.ghost {
    color: var(--ink);
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.72);
}

.danger {
    color: var(--danger);
    border-color: rgba(179, 68, 68, 0.18);
    background: rgba(255, 255, 255, 0.72);
}

.dropzone,
.drop {
    border: 1.5px dashed rgba(51, 70, 185, 0.28);
    border-radius: 24px;
    padding: 28px 16px;
    text-align: center;
    color: var(--muted);
    background: linear-gradient(135deg, rgba(240, 244, 255, 0.92), rgba(255, 255, 255, 0.78));
    cursor: pointer;
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.dropzone:hover,
.drop:hover {
    transform: translateY(-1px);
}

.dropzone.dragover,
.drop.drag {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.95);
}

.progress-wrap {
    height: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.68);
}

.progress {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #7a92ff);
    transition: width 0.2s ease;
}

.result,
.empty {
    padding: 16px 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px dashed var(--line);
}

.result {
    display: none;
    max-height: 240px;
    overflow: auto;
}

.result.show {
    display: block;
}

.result ul {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
}

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

.result a:hover {
    text-decoration: underline;
}

.theme-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: min(320px, calc(100vw - 32px));
    padding: 18px;
    display: none;
    z-index: 40;
    background: var(--panel-strong);
}

.theme-panel.open {
    display: block;
    animation: slide-panel 0.2s ease;
}

@keyframes slide-panel {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.theme-head {
    margin-bottom: 12px;
    font-family: "Syne", "Segoe UI", sans-serif;
    font-size: 1.1rem;
    letter-spacing: -0.03em;
}

.theme-field {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(20, 32, 63, 0.28);
    backdrop-filter: blur(5px);
    z-index: 35;
}

.modal.open {
    display: flex;
}

.modal-card {
    width: min(520px, 100%);
    overflow: hidden;
    background: var(--panel-strong);
}

.modal-head {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--line);
    font-family: "Syne", "Segoe UI", sans-serif;
    font-size: 1.2rem;
    letter-spacing: -0.04em;
}

.modal-body {
    padding: 18px 20px;
    display: grid;
    gap: 10px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px 20px 20px;
    border-top: 1px solid var(--line);
}

.toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    max-width: 340px;
    padding: 14px 16px;
    border-radius: 18px;
    color: #ffffff;
    background: linear-gradient(135deg, #3548bb, #202f88);
    box-shadow: 0 18px 36px rgba(24, 35, 86, 0.28);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 45;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

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

.story-card {
    padding: 22px;
}

.story-card h2 {
    margin: 0;
    font-family: "Syne", "Segoe UI", sans-serif;
    font-size: 1.7rem;
    letter-spacing: -0.05em;
}

.story-card p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.65;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.74);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
}

.upload-page .hero-card,
.batch-page .hero-card {
    min-height: 100%;
}

.upload-page .panel,
.batch-page .card {
    background: var(--panel-strong);
}

.dashboard-page .hero-card {
    min-height: 100%;
}

body[data-theme="dark"] .brand-topbar,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .top {
    background: var(--topbar-bg);
    border-color: rgba(162, 177, 241, 0.24);
}

body[data-theme="dark"] .brand-logo {
    background: rgba(27, 40, 81, 0.92);
    box-shadow: inset 0 1px 0 rgba(174, 191, 255, 0.2);
}

body[data-theme="dark"] .brand-caption {
    color: #b6c7ff;
}

body[data-theme="dark"] .brand-subtitle,
body[data-theme="dark"] .title p,
body[data-theme="dark"] .top p,
body[data-theme="dark"] .helper,
body[data-theme="dark"] .folder-path,
body[data-theme="dark"] .size,
body[data-theme="dark"] .small,
body[data-theme="dark"] .hero-text,
body[data-theme="dark"] .hero-note {
    color: #b5c2e8;
}

body[data-theme="dark"] .hero-note strong {
    color: #f0f4ff;
}

body[data-theme="dark"] .hero-card {
    background:
        radial-gradient(circle at top right, rgba(95, 119, 223, 0.28), transparent 38%),
        linear-gradient(145deg, rgba(22, 34, 72, 0.95), rgba(14, 22, 49, 0.93));
    border-color: rgba(162, 177, 241, 0.22);
}

body[data-theme="dark"] .kicker {
    background: var(--chip-bg);
    color: #dce6ff;
    border-color: rgba(162, 177, 241, 0.28);
}

body[data-theme="dark"] .kicker::before {
    box-shadow: 0 0 0 6px rgba(109, 133, 231, 0.2);
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .card,
body[data-theme="dark"] .stat,
body[data-theme="dark"] .theme-panel,
body[data-theme="dark"] .modal-card {
    background: var(--card-bg-soft);
    border-color: rgba(162, 177, 241, 0.2);
}

body[data-theme="dark"] .panel-head,
body[data-theme="dark"] .card-head {
    background: linear-gradient(180deg, rgba(46, 66, 130, 0.42), rgba(20, 31, 64, 0));
}

body[data-theme="dark"] .folder-item,
body[data-theme="dark"] .tile,
body[data-theme="dark"] .preview-grid .preview,
body[data-theme="dark"] .item,
body[data-theme="dark"] .result,
body[data-theme="dark"] .empty,
body[data-theme="dark"] .badge {
    background: var(--card-bg-deep);
    border-color: rgba(162, 177, 241, 0.18);
}

body[data-theme="dark"] .folder-count {
    background: rgba(95, 119, 223, 0.24);
    color: #dbe5ff;
}

body[data-theme="dark"] .dropzone,
body[data-theme="dark"] .drop {
    background: linear-gradient(135deg, rgba(25, 39, 80, 0.9), rgba(19, 30, 63, 0.84));
    border-color: rgba(122, 143, 224, 0.44);
    color: #b8c6ec;
}

body[data-theme="dark"] .dropzone.dragover,
body[data-theme="dark"] .drop.drag {
    background: rgba(29, 45, 91, 0.96);
    border-color: rgba(143, 161, 236, 0.7);
}

body[data-theme="dark"] .progress-wrap {
    background: rgba(17, 27, 57, 0.8);
    border-color: rgba(122, 143, 224, 0.32);
}

body[data-theme="dark"] .btn:not(.primary),
body[data-theme="dark"] button:not(.primary) {
    background: rgba(32, 48, 96, 0.82);
    color: #e5ecff;
    border-color: rgba(162, 177, 241, 0.3);
}

body[data-theme="dark"] .btn:not(.primary):hover,
body[data-theme="dark"] button:not(.primary):hover {
    background: rgba(44, 63, 122, 0.92);
}

body[data-theme="dark"] .danger {
    color: #ffb8b8;
    border-color: rgba(233, 126, 126, 0.38);
}

body[data-theme="dark"] .search,
body[data-theme="dark"] input[type="text"],
body[data-theme="dark"] input[type="file"],
body[data-theme="dark"] .theme-field select,
body[data-theme="dark"] .modal-body input {
    box-shadow: inset 0 1px 0 var(--field-highlight);
}

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

    .folder-list {
        max-height: none;
    }
}

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

    .hero-title {
        max-width: none;
        font-size: clamp(2.2rem, 10vw, 3.4rem);
    }
}

@media (max-width: 640px) {
    .shell {
        padding: 18px 14px 28px;
    }

    .brand-topbar,
    .topbar,
    .top {
        padding: 14px;
        border-radius: 22px;
    }

    .hero-card,
    .insight-card,
    .panel,
    .card,
    .stat,
    .theme-panel,
    .modal-card,
    .result {
        border-radius: 24px;
    }

    .panel-head,
    .card-head,
    .panel-body,
    .card-body,
    .hero-card,
    .insight-card {
        padding-left: 16px;
        padding-right: 16px;
    }

    .brand-actions .btn,
    .top-actions .btn,
    .actions .btn,
    .row-actions .btn,
    .tile-actions .btn,
    .modal-actions .btn {
        flex: 1;
    }

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