:root {
  font-family: "Aptos", "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: #202a22;
  background: #f7f8f5;
  font-synthesis: none;
  --text: #202a22;
  --muted: #5d685f;
  --line: #e2e7df;
  --surface: #fff;
  --accent: #d9f477;
  --dark: #253b2b;
  --green: #3f5b41;
  --sidebar: 250px;
  --radius: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }
button:not(:disabled), select:not(:disabled) { cursor: pointer; }
button:disabled { opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #567c40; outline-offset: 3px; }
svg { flex-shrink: 0; vertical-align: middle; }
p, h1, h2, h3 { margin: 0; }
[hidden] { display: none !important; }

.layout { display: grid; min-height: 100vh; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 29px; padding: 27px 17px 16px; background: #213328; color: #eef3ec; overflow-y: auto; z-index: 5; }
.brand { display: flex; align-items: center; gap: 11px; text-align: left; font-size: 1.42rem; font-weight: 750; letter-spacing: -.045em; line-height: 1.05; }
.sidebar .brand { margin: 0 8px 14px; }
.brand small { display: block; margin-top: 6px; font-size: .79rem; letter-spacing: .005em; color: #b4c4b6; font-weight: 500; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-label { padding: 0 10px; margin: 0 0 6px; color: #a8bcab; font-size: .72rem; font-weight: 750; letter-spacing: .08em; }
.nav-heading { display: flex; align-items: center; justify-content: space-between; min-height: 26px; }
.nav-heading .nav-label { margin: 0; }
.nav-heading .btn { min-height: 29px; width: 29px; }
.nav-item { display: flex; align-items: center; gap: 11px; text-align: left; min-height: 42px; width: 100%; padding: 9px 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #d5e0d4; font-size: .9rem; font-weight: 540; }
.nav-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover, .sidebar .btn:hover { background: #304738; }
.nav-item.selected { color: #e4fa9d; background: #38513c; border-color: #476149; }
.nav-item.selected svg { color: #d9f477; }
.sidebar-empty { color: #b4c4b6; font-size: .82rem; padding: 4px 10px; }
.folders-nav { min-height: 0; max-height: 30vh; overflow: auto; }
.profile { margin-top: auto; border-top: 1px solid #385144; display: flex; align-items: center; gap: 10px; padding: 17px 2px 0; }
.avatar { display: inline-grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; background: #ecf2e3; font-size: .76rem; font-weight: 750; color: #3e5a43; }
.profile .avatar { background: #d9f477; color: #273b25; }
.profile div { flex: 1 1 auto; min-width: 0; }
.profile strong, .profile small, .table-name small, .block { display: block; }
.profile strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .83rem; }
.profile small { margin-top: 3px; color: #b4c4b6; font-size: .74rem; }
.profile .btn { color: #c0d0c1; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; padding: 12px 34px; border-bottom: 1px solid var(--line); background: #fff; }
.breadcrumbs, .top-actions { display: flex; align-items: center; gap: 9px; min-width: 0; }
.breadcrumbs { flex: 1; color: var(--muted); font-size: .88rem; flex-wrap: wrap; }
.breadcrumbs span { color: var(--text); font-weight: 680; overflow-wrap: anywhere; }
.breadcrumbs button:not(.btn) { border: 0; background: transparent; padding: 3px 0; color: var(--muted); }
.breadcrumbs button:hover { text-decoration: underline; }
.search { min-width: 0; width: clamp(160px, 24vw, 340px); display: flex; gap: 9px; align-items: center; padding: 0 10px; height: 39px; border: 1px solid var(--line); border-radius: 9px; background: #f8f9f7; color: var(--muted); }
.search:focus-within { border-color: #729269; }
.search input { min-width: 0; width: 100%; outline: none; border: 0; background: transparent; color: var(--text); font-size: .88rem; }
.search input::placeholder { color: #68736b; }
kbd { border: 1px solid #dfe5db; border-radius: 4px; padding: 0 5px; color: #67726a; background: white; font-size: .8rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 39px; padding: 8px 12px; border-radius: 8px; border: 1px solid transparent; white-space: nowrap; font-size: .88rem; line-height: 1.3; font-weight: 680; background: transparent; text-decoration: none; }
.btn.icon-only { width: 39px; padding: 0; }
.btn.primary { background: var(--accent); color: #243522; border-color: #cce666; }
.btn.primary:hover { background: #cfed64; border-color: #bddb54; }
.btn.secondary { border-color: #dce3da; background: #fff; color: #3c4f3e; }
.btn.secondary:hover, .btn.quiet:hover { background: #eef3ea; }
.btn.danger { background: #963c35; color: #fff; }
.btn.danger:hover { background: #79302a; }
.btn.menu-button { display: none; }

.main { max-width: 1560px; margin: 0 auto; padding: 33px 34px 55px; }
.heading { display: flex; gap: 18px; justify-content: space-between; align-items: center; margin: 0 0 23px; }
.heading h1 { font-size: clamp(1.8rem, 3vw, 2.47rem); font-weight: 750; line-height: 1.08; letter-spacing: -.052em; overflow-wrap: anywhere; }
.heading p { color: var(--muted); margin-top: 9px; line-height: 1.55; font-size: .97rem; }
.heading-actions { display: flex; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 19px; }
.stat { min-height: 77px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px; }
.stat-icon, .drop-icon, .dialog-icon { display: inline-grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; background: #eef4e9; color: #46654a; }
.stat div { min-width: 0; }
.stat div span { display: block; color: var(--muted); font-size: .78rem; line-height: 1.25; }
.stat strong { display: block; margin-top: 4px; font-size: clamp(.91rem, 1.6vw, 1.2rem); letter-spacing: -.035em; overflow-wrap: anywhere; }
.drop { display: flex; align-items: center; gap: 14px; border: 1px dashed #a8bba3; border-radius: 12px; padding: 16px 17px; margin-bottom: 26px; background: #eef4e9; }
.drop-icon { background: #e0ebd9; flex-basis: 44px; width: 44px; height: 44px; }
.drop h2 { font-size: .97rem; font-weight: 720; }
.drop p { font-size: .85rem; line-height: 1.45; color: var(--muted); margin-top: 4px; }
.drop .btn { margin-left: auto; }
.dragging .drop { background: #e4f2be; border-color: #68834d; }
.dragging .workspace { outline: 3px solid #9fc468; outline-offset: -3px; }
.collection-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.tabs, .controls { display: flex; align-items: center; gap: 6px; }
.tabs button { color: var(--muted); padding: 0 12px; min-height: 48px; border: 0; border-bottom: 2px solid transparent; background: transparent; font-size: .91rem; font-weight: 650; white-space: nowrap; }
.tabs button svg { margin-right: 5px; }
.tabs button[aria-pressed="true"] { color: #2c5231; border-bottom-color: #4f774f; }
.tabs button:hover { color: #2c5231; }
.sort { display: flex; align-items: center; position: relative; }
.sort select { appearance: none; padding: 7px 28px 7px 10px; font-size: .83rem; border: 1px solid var(--line); border-radius: 8px; color: #4d5d50; background: #fff; }
.sort svg { position: absolute; right: 8px; pointer-events: none; }
.segments { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.segments .btn { width: 32px; min-height: 29px; border-radius: 6px; color: var(--muted); }
.segments button[aria-pressed="true"] { background: #eaf2e5; color: #375b38; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 15px 0 0; }
.filters button { display: flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 11px; border: 1px solid #e1e6dd; border-radius: 7px; background: #fff; color: #506052; font-size: .81rem; font-weight: 570; }
.filters button:hover, .filters button[aria-pressed="true"] { background: #eaf2e5; border-color: #ccdcca; color: #345737; }
.results-label { display: flex; justify-content: space-between; gap: 10px; color: #5a665c; font-size: .81rem; margin: 18px 0 10px; }
.results-label strong { font-weight: 680; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.file-card { min-width: 0; text-align: left; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; transition: border-color .15s, box-shadow .15s; }
.file-card:hover { border-color: #9db59a; box-shadow: 0 3px 12px #253b2b12; }
.thumb { isolation: isolate; position: relative; overflow: hidden; display: grid; place-items: center; width: 100%; aspect-ratio: 1.62; background: #edf2e8; color: #527047; }
.thumb img, .thumb video { position: absolute; width: 100%; height: 100%; object-fit: cover; inset: 0; z-index: -1; }
.thumb video { opacity: 0; }
.thumb.has-preview video { opacity: 1; }
.thumb.has-preview .thumb-icon { visibility: hidden; }
.thumb.folder { background: #e5efd8; color: #5a7c45; }
.thumb.video { background: #eee8f3; color: #6c5385; }
.thumb.audio { background: #f1e8e1; color: #8d674b; }
.thumb.pdf { background: #f5e7e4; color: #9a5952; }
.thumb.model, .thumb.ext-json { background: #e4edef; color: #44717a; }
.thumb.ext-csv { background: #e3eedf; color: #4c7751; }
.thumb.ext-md { background: #eee9f4; color: #725b85; }
.thumb-icon { border: 1px solid #ffffffa0; background: #ffffff77; border-radius: 13px; display: grid; place-items: center; width: 57px; height: 57px; }
.file-badge { position: absolute; left: 9px; top: 9px; background: #fffffff0; border: 1px solid #ffffffa0; border-radius: 5px; color: #465748; font-weight: 740; font-size: .68rem; padding: 3px 6px; letter-spacing: .04em; max-width: 85%; overflow: hidden; text-overflow: ellipsis; }
.snippet { position: absolute; top: 32%; left: 14%; width: 73%; height: 82%; margin: 0; padding: 12px 10px; overflow: hidden; background: #ffffffd9; border: 1px solid #ffffff; border-radius: 7px; box-shadow: 1px 1px 14px #23332916; transform: rotate(-4deg); color: #48594c; white-space: pre-wrap; overflow-wrap: anywhere; font: .63rem/1.53 ui-monospace, monospace; visibility: hidden; }
.has-snippet .snippet { visibility: visible; }
.has-snippet .thumb-icon { visibility: hidden; }
.card-content { padding: 11px 12px 13px; }
.file-name { font-weight: 680; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: .76rem; color: var(--muted); margin-top: 5px; }
.card-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta span:last-child { flex-shrink: 0; }
.empty, .loading { padding: 30px 17px; text-align: center; color: var(--muted); }
.empty { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.empty > span { display: inline-grid; place-items: center; color: var(--green); width: 49px; height: 49px; border-radius: 14px; background: #eff3eb; }
.empty h3 { margin: 10px 0 5px; color: var(--text); font-size: 1.02rem; }
.empty p { font-size: .88rem; line-height: 1.5; }
.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; text-align: left; }
thead th { padding: 12px 16px; background: #f1f4ef; color: #536356; font-size: .81rem; font-weight: 730; white-space: nowrap; }
tbody td { border-top: 1px solid var(--line); padding: 10px 16px; font-size: .86rem; color: #4c5c4f; }
tbody td:first-child { color: var(--text); }
tbody tr:hover { background: #fbfcfa; }
.table-name { display: flex; align-items: center; gap: 10px; color: var(--text); background: transparent; border: 0; padding: 1px; text-align: left; font-size: .9rem; font-weight: 670; overflow-wrap: anywhere; }
button.table-name:hover { text-decoration: underline; }
.table-name small, .block { margin-top: 3px; color: var(--muted); font-weight: 490; font-size: .76rem; }
.table-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 7px; background: #edf2e8; color: #4c6b4d; }
.table-icon.video, .table-icon.model { background: #eee9f4; color: #725b85; }
.table-icon.audio { background: #f1e8e1; color: #8d674b; }
.row-actions { display: flex; gap: 2px; }
.pill { display: inline-block; padding: 4px 8px; border-radius: 6px; background: #eef1ed; color: #516056; font-size: .76rem; font-weight: 680; }
.pill.active { background: #e8f2e5; color: #3d673d; }

dialog { width: min(505px, calc(100% - 24px)); max-height: calc(100dvh - 24px); color: var(--text); margin: auto; border: 1px solid #dee6dd; border-radius: 16px; box-shadow: 0 22px 68px #10261943; padding: 0; background: #fff; }
dialog.wide { width: min(860px, calc(100% - 24px)); }
dialog::backdrop { background: #1b2e2399; backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { flex: 1; font-size: 1.14rem; font-weight: 750; letter-spacing: -.025em; overflow-wrap: anywhere; }
.dialog-head .btn { flex-shrink: 0; }
.dialog-form { display: grid; gap: 14px; padding: 16px 18px 18px; }
.dialog-form p { color: var(--muted); font-size: .94rem; line-height: 1.55; }
.dialog-form label, .login-form label { display: grid; gap: 6px; font-size: .89rem; font-weight: 650; }
.dialog-form input:not([type="checkbox"]), .dialog-form select, .login-form input { width: 100%; padding: 9px 10px; border: 1px solid #d9e2d7; border-radius: 7px; color: #263626; background: #fff; min-height: 40px; }
.dialog-form small { color: var(--muted); font-size: .75rem; font-weight: 500; }
.dialog-form label.checkbox { display: flex; align-items: center; }
.checkbox input { width: 16px; height: 16px; accent-color: #4d714b; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; }
.form-error { color: #903c33 !important; min-height: 0; font-size: .85rem; }
.form-error:empty { display: none; }
.preview-body { padding: 15px; }
.preview-content { min-height: min(395px, 48vh); display: grid; place-items: center; background: #f1f4ef; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.preview-content img, .preview-content video { display: block; max-width: 100%; max-height: 62vh; object-fit: contain; }
.preview-content audio { display: block; width: 85%; max-width: 530px; }
.preview-content iframe { display: block; width: 100%; height: min(58vh, 520px); border: 0; }
.preview-content pre { max-width: 100%; width: 100%; max-height: min(60vh, 545px); margin: 0; overflow: auto; align-self: start; padding: 20px; white-space: pre-wrap; overflow-wrap: anywhere; font: .9rem/1.6 ui-monospace, monospace; }
.preview-content.model-content { height: min(58vh, 520px); }
.preview-content canvas { display: block; width: 100%; height: 100%; }
.preview-content .empty { align-self: center; background: transparent; border: 0; }
.preview-meta { display: flex; align-items: center; gap: 9px 16px; flex-wrap: wrap; margin-top: 12px; font-size: .84rem; color: var(--muted); }
.preview-meta span { display: inline-flex; align-items: center; gap: 5px; }
.preview-meta a { margin-left: auto; }
#notice { position: fixed; z-index: 20; bottom: 18px; right: 18px; max-width: calc(100vw - 36px); }
.toast { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: 9px; color: #fff; background: #284333; box-shadow: 0 3px 13px #1d2d2445; font-size: .9rem; }
.toast.error { background: #873c36; }

.login { display: grid; min-height: 100dvh; padding: 16px; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: #fff; }
.login-form { padding: 26px clamp(15px, 4vw, 65px); display: flex; flex-direction: column; }
.login-form .brand small { color: var(--muted); }
.login-center { width: min(100%, 390px); margin: auto; padding: 30px 0; }
.login-center h1 { font-size: clamp(1.93rem, 3.25vw, 3rem); font-weight: 750; letter-spacing: -.062em; line-height: 1.07; }
.login-center > p { color: var(--muted); line-height: 1.5; margin: 12px 0 25px; }
.login-form form { display: grid; gap: 15px; }
.login-form form .btn { min-height: 44px; margin-top: 4px; }
.login-art { display: grid; place-items: center; position: relative; overflow: hidden; isolation: isolate; background: #233a2b; border-radius: 20px; }
.art-grid { position: absolute; inset: 0; pointer-events: none; z-index: -1; background: radial-gradient(ellipse at center, #54764d 0%, #263f2f 63%); }
.art-grid::after { position: absolute; inset: 0; content: ""; opacity: .33; background: repeating-linear-gradient(0deg, transparent 0 35px, #b3d19a41 35px 36px), repeating-linear-gradient(90deg, transparent 0 35px, #b3d19a41 35px 36px); mask-image: radial-gradient(ellipse at center, #000, transparent 78%); }
.art-file { display: grid; place-items: center; position: absolute; width: clamp(115px, 15vw, 220px); height: clamp(105px, 13vw, 190px); border-radius: 25px; border: 1px solid #b4c5a47a; box-shadow: 0 22px 30px #14292043; }
.art-one { transform: translate(-47%, -42%) rotate(-16deg); background: #edf3dt; color: #496642; }
.art-two { transform: rotate(-7deg); background: var(--accent); color: #345238; z-index: 2; }
.art-three { transform: translate(53%, 47%) rotate(13deg); background: #537359; color: #e5f0df; }

@media (min-width: 1550px) { .cards { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1120px) {
  :root { --sidebar: 218px; }
  .main, .topbar { padding-left: 24px; padding-right: 24px; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { gap: 8px; }
  .stat { padding: 9px; gap: 7px; }
  .stat-icon { width: 32px; height: 32px; flex-basis: 32px; }
}
@media (max-width: 820px) {
  .layout { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(270px, 80vw); transform: translateX(-100%); visibility: hidden; transition: transform .18s, visibility .18s; box-shadow: 12px 0 40px #22352730; }
  .sidebar.is-open { visibility: visible; transform: translateX(0); }
  .btn.menu-button { display: inline-flex; z-index: 6; position: relative; }
  .layout:has(.sidebar.is-open) .menu-button { position: fixed; left: min(270px, 80vw); top: 12px; background: white; border-radius: 0 8px 8px 0; }
  .main, .topbar { padding-left: 17px; padding-right: 17px; }
}
@media (max-width: 570px) {
  .topbar { min-height: 59px; gap: 5px; padding: 8px 11px; flex-wrap: wrap; }
  .breadcrumbs { flex-basis: 100%; }
  .top-actions { width: 100%; }
  .search { flex: 1; }
  .main { padding-top: 22px; }
  .heading { align-items: flex-start; gap: 8px; }
  .heading p { font-size: .89rem; }
  .heading-actions { flex-wrap: wrap; justify-content: flex-end; }
  .stats, .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drop { flex-wrap: wrap; gap: 9px; padding: 12px; }
  .drop > div { flex: 1 1 180px; }
  .collection-bar { flex-wrap: wrap; }
  .tabs button { padding: 0 7px; font-size: .84rem; }
  .controls { margin-bottom: 5px; margin-left: auto; }
  .cards { gap: 8px; }
  .card-content { padding: 9px; }
  .file-name { font-size: .82rem; }
  .login { display: block; padding: 0; }
  .login-form { min-height: 100dvh; padding: 20px; }
  .login-art { display: none; }
  tbody td, thead th { padding-left: 9px; padding-right: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
