@font-face {
  font-family: Inter;
  src: url("/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  font: 16px/1.5 Inter, system-ui, sans-serif;
  font-optical-sizing: auto;
  --page: #f0f3ef;
  --paper: #fff;
  --soft: #f1f4ef;
  --hover: #e8eee8;
  --selected: #dcece3;
  --ink: #1a302c;
  --muted: #52665f;
  --accent: #205e50;
  --primary: #205f51;
  --on-primary: #fff;
  --focus: #1b6e5c;
  --danger: #943a32;
  --shadow: 0 12px 35px rgb(35 70 55 / 7%);
  --cover: #205e56;
  --doc-bg: #f2eaf2;
  --doc-fg: #725073;
  --pdf-bg: #faeae3;
  --pdf-fg: #964b34;
  --media-bg: #e6edf9;
  --media-fg: #3f6391;
  --easing: cubic-bezier(.2,.8,.2,1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #16231f;
  --paper: #21322d;
  --soft: #293d35;
  --hover: #334940;
  --selected: #354e41;
  --ink: #edf4ed;
  --muted: #b0c1b6;
  --accent: #a4d6bb;
  --primary: #a6d9bb;
  --on-primary: #18382c;
  --focus: #b6e9ce;
  --danger: #ffa9a0;
  --shadow: 0 12px 35px rgb(3 14 10 / 17%);
  --cover: #194f49;
  --doc-bg: #48384b;
  --doc-fg: #e7c7e4;
  --pdf-bg: #4a352e;
  --pdf-fg: #ffcab4;
  --media-bg: #2e4052;
  --media-fg: #bfd7f2;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--page); color: var(--ink); }
body, button, input, dialog { transition: color 160ms, background-color 160ms; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 42px; padding: .55rem .9rem; border: 0; border-radius: 12px;
  background: var(--soft); cursor: pointer; font-size: .88rem; line-height: 1.3; font-weight: 620;
  transition: background-color 160ms, color 160ms, transform 160ms var(--easing);
}
button:disabled { cursor: default; opacity: .53; }
button:active:not(:disabled) { transform: translateY(1px); }
:where(button, a, input, select, [tabindex]):focus-visible {
  outline: 3px solid var(--focus); outline-offset: 3px;
}
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
button.primary { background: var(--primary); color: var(--on-primary); }
.quiet { background: transparent; color: var(--muted); }
.icon-button { min-width: 42px; padding: 8px; }
.masthead, main, footer { width: min(100% - clamp(32px, 7vw, 112px), 1392px); margin-inline: auto; }
.masthead { display: flex; justify-content: space-between; align-items: center; min-height: 82px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; border-radius: 10px; text-decoration: none; }
.brand span { font-size: 1.35rem; font-weight: 750; letter-spacing: -.065em; }
.brand small { padding-left: .1rem; font-weight: 540; color: var(--muted); font-size: .81rem; }
.theme-button { background: var(--paper); color: var(--muted); min-width: 42px; padding: .65rem; }
.theme-button .moon, :root[data-theme="dark"] .theme-button .sun { display: none; }
:root[data-theme="dark"] .theme-button .moon { display: block; }
main { flex: 1 0 auto; display: flex; flex-direction: column; }
footer { display: flex; justify-content: flex-end; padding: 1rem 0 1.35rem; color: var(--muted); }
footer a { display: inline-flex; align-items: center; min-height: 40px; gap: .5rem; border-radius: 5px; font-size: .82rem; font-weight: 560; text-decoration: none; }
footer .icon { width: 15px; height: 15px; }

.login {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .84fr);
  width: min(100%, 1110px); margin: auto; border-radius: 32px;
  background: var(--paper); box-shadow: var(--shadow); overflow: hidden;
}
.cover { display: grid; place-items: center; min-height: clamp(440px, 57vh, 590px); background: var(--cover); overflow: hidden; }
.cover-art { width: min(112%, 675px); max-width: none; height: auto; display: block; }
.login-content { align-self: center; width: min(100%, 460px); padding: 3rem clamp(32px, 4vw, 64px); margin-inline: auto; }
.access-label { color: var(--accent); display: flex; align-items: center; gap: .42rem; font-size: .84rem; font-weight: 650; }
.access-label .icon { width: 17px; height: 17px; }
.login h1 { margin-top: .8rem; font-size: clamp(2.4rem, 3.6vw, 3.65rem); letter-spacing: -.077em; line-height: 1.05; font-weight: 720; }
.intro { margin-top: .9rem; color: var(--muted); line-height: 1.55; }
#login-form { margin-top: 2rem; }
#login-form label, #dialog-body label { display: block; font-size: .9rem; font-weight: 610; margin-bottom: .45rem; }
input:not([type="file"], [type="checkbox"], [type="radio"]), select {
  min-width: 0; width: 100%; background: var(--soft); color: var(--ink); border: 0; border-radius: 12px; padding: .78rem .9rem;
}
input::placeholder { opacity: 1; color: var(--muted); }
#login-form .primary { width: 100%; margin-top: .9rem; min-height: 47px; font-size: .96rem; }
.error { color: var(--danger); font-size: .88rem; font-weight: 540; }
.error:not(:empty) { margin-top: .7rem; }

.workspace { display: grid; grid-template-columns: 215px minmax(0, 1fr); gap: clamp(16px, 2.4vw, 42px); flex: 1; }
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; padding-top: .3rem; }
.navigation { display: grid; gap: 4px; }
.navigation button, #logout { justify-content: flex-start; }
.navigation button {
  width: 100%; min-height: 46px; gap: .78rem; padding-inline: 1rem;
  background: transparent; color: var(--muted); font-weight: 550; text-align: left;
}
.navigation button[data-active="true"], .navigation button[aria-current="page"] { color: var(--accent); background: var(--selected); font-weight: 740; }
.sidebar-end { display: grid; gap: 1rem; margin-top: auto; padding: .75rem .45rem .25rem; }
.storage { padding: .85rem .65rem; }
.storage h2 { display: flex; align-items: center; gap: .55rem; font-size: .86rem; font-weight: 620; }
.storage h2 .icon { width: 17px; height: 17px; }
progress { display: block; overflow: hidden; appearance: none; width: 100%; height: 6px; border: 0; border-radius: 9px; color: var(--accent); background: var(--hover); }
.storage progress { margin: .72rem 0 .45rem; }
progress::-webkit-progress-bar { background: var(--hover); border-radius: 9px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 9px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 9px; }
.storage small { font-size: .77rem; color: var(--muted); }
#logout { padding-inline: .65rem; }
.library { min-width: 0; }
.library-tools { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.search { display: flex; align-items: center; min-width: 0; flex: 1; padding-inline: 1rem; border-radius: 14px; background: var(--paper); color: var(--muted); }
.search input#search { min-height: 47px; padding-left: .65rem; background: transparent; outline-offset: -3px; }
#upload { min-height: 46px; padding-inline: 1rem; }
.library-body { display: flex; flex-direction: column; min-height: clamp(440px, 66vh, 900px); margin-top: 1rem; padding: clamp(22px, 3.3vw, 50px); border-radius: 26px; background: var(--paper); box-shadow: var(--shadow); }
.workspace.drop-active .library-body { background: var(--selected); }
#crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; color: var(--muted); min-width: 0; font-size: .86rem; }
#crumbs:not(:empty) { margin-bottom: .6rem; }
.crumb + .crumb::before { content: "›"; margin-inline-end: .1rem; color: var(--muted); }
.crumb { max-width: 100%; min-height: 32px; border-radius: 7px; padding: .3rem .44rem; background: var(--soft); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-head h1 { line-height: 1.09; overflow-wrap: anywhere; font-weight: 690; letter-spacing: -.066em; font-size: clamp(2rem, 3.2vw, 3.35rem); }
.creation { display: flex; flex-wrap: wrap; gap: .48rem; margin: 1.25rem 0 1.6rem; }
.creation button { min-height: 39px; border-radius: 10px; }
.creation .icon { width: 18px; height: 18px; }
#new-folder .icon { color: var(--accent); }
#new-doc .icon { color: var(--doc-fg); }
#new-pdf .icon { color: var(--pdf-fg); }
.contents-tools, .dialog-head, .dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.contents-tools { margin-bottom: .65rem; color: var(--muted); }
.contents-tools > span { font-size: .84rem; font-weight: 610; }
.list-tools { display: flex; gap: 4px; }
.list-tools button { min-height: 37px; padding: .4rem .65rem; background: transparent; color: var(--muted); font-size: .82rem; }
.list-tools .icon { width: 17px; height: 17px; }
.entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(65px, .27fr) minmax(48px, .16fr) 40px; gap: .6rem; min-width: 0; align-items: center; padding: .36rem .4rem; border-radius: 12px; }
.item-open { display: flex; justify-content: flex-start; min-width: 0; gap: .8rem; padding: .3rem .15rem; background: transparent; text-align: left; }
.item-copy { display: grid; min-width: 0; gap: .15rem; }
.item-copy strong, .item-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-copy strong { font-size: .94rem; font-weight: 610; }
.item-copy small, .entry-date, .entry-size { color: var(--muted); font-size: .8rem; font-weight: 470; }
.file-icon { display: inline-grid; flex: none; place-items: center; width: 42px; height: 43px; border-radius: 12px; background: var(--soft); color: var(--muted); font-size: .65rem; font-weight: 740; letter-spacing: -.01em; }
.file-icon svg { width: 23px; height: 23px; }
.file-icon[data-type="folder"] { color: var(--accent); background: var(--selected); }
.file-icon[data-type="doc"] { color: var(--doc-fg); background: var(--doc-bg); }
.file-icon[data-type="pdf"] { color: var(--pdf-fg); background: var(--pdf-bg); }
.file-icon:is([data-type="image"], [data-type="video"], [data-type="audio"]) { color: var(--media-fg); background: var(--media-bg); }
.more { justify-self: end; min-width: 38px; min-height: 38px; padding: .36rem; background: transparent; color: var(--muted); }
#entries.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 176px), 1fr)); gap: .7rem; }
#entries.grid .entry { position: relative; display: flex; align-items: stretch; background: var(--soft); min-height: 125px; padding: .7rem .8rem; }
#entries.grid .item-open { flex-direction: column; align-items: flex-start; justify-content: space-between; gap: .7rem; width: 100%; padding: 0; }
#entries.grid .item-copy { width: 100%; }
#entries.grid .entry-date, #entries.grid .entry-size { display: none; }
#entries.grid .more { position: absolute; top: .35rem; right: .3rem; }
.empty { flex: 1; min-height: 180px; padding: 2rem 1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; text-align: center; color: var(--muted); }
.empty h2, .empty h3, .empty strong { color: var(--ink); font-size: 1.1rem; font-weight: 630; }
.empty svg { width: 34px; height: 34px; margin-bottom: .3rem; color: var(--accent); }
.empty-action { background: var(--selected); color: var(--accent); margin: .3rem; }

dialog { max-width: min(460px, calc(100vw - 24px)); width: 100%; padding: 1.4rem; overflow: auto; max-height: 85dvh; border: none; border-radius: 22px; background: var(--paper); color: var(--ink); box-shadow: 0 20px 70px #11251e38; }
dialog[open] { animation: arrive 170ms var(--easing); }
dialog::backdrop { background: rgb(12 27 23 / 48%); }
dialog h2 { min-width: 0; font-size: 1.35rem; font-weight: 660; line-height: 1.24; letter-spacing: -.045em; overflow-wrap: anywhere; }
.dialog-head { margin-bottom: 1rem; }
.dialog-footer { justify-content: flex-end; margin-top: 1.1rem; }
#dialog-body { display: grid; gap: .5rem; margin-top: 1rem; }
#dialog-body label input { margin-top: .42rem; }
#action-list { display: grid; gap: 4px; }
.action-option, .folder-option { justify-content: flex-start; width: 100%; text-align: left; overflow-wrap: anywhere; }
[data-active="true"].folder-option, .folder-option[aria-pressed="true"] { background: var(--selected); color: var(--accent); font-weight: 700; }
#preview { max-width: min(850px, calc(100vw - 24px)); }
#preview-body { display: grid; justify-items: start; gap: 1rem; min-width: 0; }
#preview-body :is(img, video, audio) { display: block; max-width: 100%; max-height: 64dvh; margin-inline: auto; }
#preview-body pre { width: 100%; max-height: 60dvh; margin: 0; padding: 1rem; border-radius: 12px; background: var(--soft); overflow: auto; overflow-wrap: anywhere; white-space: pre-wrap; font-size: .9rem; }
#status:not(:empty), #transfer:not(:empty) { position: fixed; z-index: 4; left: 50%; width: max-content; max-width: calc(100% - 24px); transform: translateX(-50%); border-radius: 14px; padding: .68rem 1rem; font-size: .88rem; box-shadow: var(--shadow); }
#status:not(:empty) { bottom: max(16px, env(safe-area-inset-bottom)); background: var(--ink); color: var(--paper); }
#transfer:not(:empty) { bottom: 76px; width: min(390px, calc(100% - 24px)); max-height: 45dvh; overflow: auto; background: var(--paper); }
.transfer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .5rem; align-items: center; }
.transfer-row + .transfer-row { margin-top: .7rem; }
.transfer-row strong { grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-row small { grid-column: 1; font-size: .8rem; color: var(--muted); }
.transfer-row progress { grid-column: 1 / -1; margin-block: .4rem .1rem; }
.transfer-row button { grid-column: 2; grid-row: 1 / 3; }
* { scrollbar-width: thin; scrollbar-color: var(--muted) var(--soft); }
@keyframes arrive { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (hover: hover) {
  button:hover:not(:disabled), .entry:hover { background-color: var(--hover); }
  button.primary:hover:not(:disabled) { background-color: color-mix(in srgb, var(--primary) 88%, var(--ink)); }
  .entry .item-open:hover { background-color: transparent; }
  footer a:hover { color: var(--accent); text-decoration: underline; }
}
@media (max-width: 850px) {
  .workspace { grid-template-columns: 171px minmax(0, 1fr); gap: 14px; }
  .masthead, main, footer { width: calc(100% - 36px); }
  .entry { grid-template-columns: minmax(0, 1fr) max-content 38px; }
  .entry-date { display: none; }
  .login-content { padding-inline: 28px; }
}
@media (max-width: 680px) {
  .masthead { min-height: 66px; }
  .login { grid-template-columns: minmax(0, 1fr); max-width: 480px; border-radius: 23px; }
  .cover { min-height: 0; height: clamp(132px, 26vh, 220px); }
  .cover-art { width: auto; max-width: 100%; height: 125%; }
  .login-content { width: 100%; padding: 1.7rem 1.35rem; }
  .login h1 { margin-top: .5rem; }
  #login-form { margin-top: 1.3rem; }
  .workspace { display: flex; flex-direction: column; gap: .7rem; }
  .sidebar { display: contents; }
  .navigation { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
  .navigation button { flex-direction: column; text-align: center; gap: .26rem; padding: .48rem .08rem; font-size: .76rem; }
  .navigation .icon { width: 18px; height: 18px; }
  .sidebar-end { order: 2; display: flex; align-items: center; justify-content: space-between; gap: .55rem; padding: .2rem .25rem; }
  .storage { flex: 1; max-width: 16rem; padding: .5rem 0; }
  .storage progress { margin: .37rem 0 0; }
  .storage h2 { font-size: .77rem; }
  .storage h2 .icon { width: 15px; height: 15px; }
  #logout { font-size: .78rem; }
  .library-body { margin-top: .7rem; min-height: 430px; border-radius: 20px; padding: 1.15rem; }
  .library-tools { gap: .45rem; }
  .search { padding-left: .65rem; padding-right: .25rem; }
  .search .icon { width: 17px; }
  .search input#search { padding-left: .4rem; font-size: 1rem; }
  #upload { min-height: 45px; font-size: .8rem; padding-inline: .65rem; gap: .32rem; }
  #upload .icon { width: 16px; }
  .creation { margin: .85rem 0 1rem; gap: .28rem; }
  .creation button { font-size: .76rem; gap: .28rem; padding: .42rem .52rem; }
  .creation .icon { width: 16px; height: 16px; }
  .entry { padding-inline: 0; gap: .2rem; }
  .entry-size { font-size: .74rem; }
  .file-icon { width: 34px; height: 37px; border-radius: 9px; }
  .item-open { gap: .45rem; }
  .item-copy strong { font-size: .86rem; }
  .item-copy small { font-size: .75rem; }
  #entries.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  #entries.grid .entry { min-height: 110px; padding: .55rem; }
  footer { padding-block: .45rem .7rem; }
}
@media (max-width: 390px) {
  .masthead, main, footer { width: calc(100% - 20px); }
  .library-body { padding: 1rem .7rem; }
  .entry { grid-template-columns: minmax(0, 1fr) 36px; }
  .entry-size { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  button { border: 1px solid ButtonText; }
  button[data-active="true"] { outline: 2px solid Highlight; }
}
