:root {
  color-scheme: light;
  --ink: #37271d;
  --muted: #765a47;
  --paper: #fffdf9;
  --border: #e7d3bd;
  --border-soft: #eee0cf;
  --brand: #aa471e;
  --orange: #ffb372;
  --soft-orange: #fff0df;
}

* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font: 16px/1.5 system-ui, sans-serif;
  background: radial-gradient(ellipse 900px 550px at 70% 0%, #ffe7ca, transparent 80%), #fbf6ec;
}
main, .site-inner {
  width: min(1120px, 100%);
  margin: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}
main { padding-block: 10px 24px; }
.site-header { border-bottom: 1px solid #e5ceb64f; background: #fffaf3bc; }
.site-inner { display: flex; align-items: center; min-height: 70px; gap: 10px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: clamp(1rem, 3.5vw, 1.32rem);
  font-weight: 780;
  letter-spacing: -.045em;
  text-decoration: none;
  white-space: nowrap;
}
.brand img { object-fit: contain; }
.brand-dot { color: #d6652d; }
.plus-badge {
  padding: 2px 8px;
  border: 1px solid #ebc698;
  border-radius: 999px;
  color: #904218;
  background: linear-gradient(#fff5e5, #ffe3bc);
  font-size: .72rem;
  font-weight: 750;
}
.intro {
  display: grid;
  position: relative;
  isolation: isolate;
  grid-template-columns: minmax(0, 1fr) minmax(95px, .43fr);
  align-items: center;
  min-height: 84px;
  margin-bottom: 14px;
  padding: 9px clamp(12px, 2.5vw, 25px);
  overflow: hidden;
  border: 1px solid #ebcfaf;
  border-radius: clamp(19px, 3vw, 32px);
  background: radial-gradient(ellipse at 82% 22%, #fff7dc, transparent 62%), linear-gradient(115deg, #fffaf0 15%, #ffe8ca 100%);
  box-shadow: inset 0 1px #fff, 0 13px 45px #ab602711;
}
.intro-copy { z-index: 1; }
.eyebrow, .fixture-label { color: var(--brand); font-size: .72rem; font-weight: 780; letter-spacing: .13em; }
.eyebrow span { margin-right: 4px; }
h1 { margin: 4px 0 6px; font-size: clamp(1.55rem, 4vw, 2.15rem); line-height: .99; letter-spacing: -.065em; }
h2 { margin: 0; font-size: clamp(1.25rem, 3.2vw, 1.55rem); line-height: 1.15; letter-spacing: -.035em; }
p { margin: 0 0 12px; overflow-wrap: anywhere; }
.intro p, .auth p { color: var(--muted); }
.intro p { margin-bottom: 0; font-size: clamp(.88rem, 2vw, 1.05rem); }
.cloud-art {
  position: relative;
  justify-self: end;
  display: grid;
  place-items: center;
  width: min(100%, 128px);
}
.cloud-art::before {
  position: absolute;
  inset: 0 -12%;
  z-index: -1;
  background: radial-gradient(ellipse, #ffb25a6b, transparent 69%);
  content: "";
}
.cloud-art img {
  display: block;
  width: 100%;
  max-height: 65px;
  object-fit: contain;
  filter: drop-shadow(0 14px 14px #d877333e);
  animation: cloud-float 6s ease-in-out infinite;
}
.cloud-spark { position: absolute; color: #d96e24; font-size: clamp(.8rem, 2.5vw, 1.25rem); }
.cloud-spark-one { left: 2%; top: 5%; }
.cloud-spark-two { right: 2%; bottom: 1%; opacity: .66; }
@keyframes cloud-float { 50% { transform: translateY(-4px) rotate(-1deg); } }
.card {
  padding: clamp(14px, 3vw, 28px);
  border: 1px solid var(--border);
  border-radius: clamp(19px, 3vw, 27px);
  background: var(--paper);
  box-shadow: 0 12px 46px #79432213, inset 0 1px #fff;
}
.card:has(.auth:not([hidden])) {
  width: min(100%, 460px);
  margin: clamp(16px, 4vw, 38px) auto 0;
  padding: clamp(20px, 6vw, 38px);
  background: linear-gradient(145deg, #fffdf9 44%, #fff6e9);
  box-shadow: 0 18px 50px #79432217, inset 0 1px #fff;
}
.auth h2 { margin-bottom: 8px; font-size: clamp(1.45rem, 5vw, 1.8rem); }
.auth-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border: 1px solid #edc393;
  border-radius: 16px;
  color: #904218;
  background: linear-gradient(#fff5e5, #ffd39e);
  box-shadow: inset 0 1px #fff, 0 5px 12px #a75d2026;
}
.auth .auth-description { margin-bottom: 22px; }
.fixture-label { margin-bottom: 8px; }
label { font-weight: 600; }
.auth label { display: block; margin-bottom: 6px; }
input, button, .action { min-height: 44px; font: inherit; }
input:not([type=file],[type=checkbox]) {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 8px 11px;
  border: 1px solid #d9bda2;
  border-radius: 10px;
  color: var(--ink);
  background: #fffdf8;
}
.auth input:not([type=file],[type=checkbox]) {
  min-height: 50px;
  margin-bottom: 16px;
  padding-inline: 14px;
  border-radius: 14px;
}
.auth #token { font-variant-numeric: tabular-nums; letter-spacing: .16em; }
.auth .auth-primary {
  min-height: 48px;
  width: 100%;
  border-radius: 14px;
  background: linear-gradient(#ffdaaf, #ffaf70 54%, #ffa15e);
  box-shadow: inset 0 1px #fff7e5, 0 4px 10px #a75d2026;
}
.auth .auth-primary:hover { background: linear-gradient(#ffe2bd, #ffad6b); }
#fixture-auth .auth-primary { width: auto; }
.auth-alternatives { margin-top: 10px; }
.auth-alternatives button {
  flex: 1 1 auto;
  border-radius: 12px;
  font-size: .88rem;
}
input[type=file] { max-width: 100%; min-width: 0; align-content: center; color: var(--muted); }
input::file-selector-button { margin-right: 9px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; font: inherit; color: var(--ink); background: #fff9ee; cursor: pointer; }
button, .action {
  padding: 8px 14px;
  border: 1px solid #c3622b;
  border-radius: 10px;
  color: #40200b;
  background: var(--orange);
  cursor: pointer;
  font-weight: 600;
}
.action { display: inline-flex; align-items: center; text-decoration: none; }
.secondary { border-color: var(--border); background: #fff9ef; }
button:hover, .action:hover { background: #ff9f59; }
.secondary:hover { background: var(--soft-orange); }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid #973f1d; outline-offset: 3px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.spread { justify-content: space-between; }
#account-control { position: relative; margin-left: auto; }
.vault-popover {
  position: absolute;
  top: calc(100% + 8px);
  z-index: 4;
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid #e6c8aa;
  border-radius: 16px;
  background: #fffaf3;
  box-shadow: 0 12px 34px #58321c26, inset 0 1px #fff;
}
#account-menu, #add-menu { width: min(255px, calc(100vw - 100px)); }
#account-menu { right: 0; }
#add-menu { left: -55px; }
#account-menu { z-index: 6; }
.account-info { padding: 5px 7px 9px; margin-bottom: 3px; border-bottom: 1px solid var(--border-soft); }
#account { margin: 0 0 2px; font-weight: 650; }
.plan { margin: 0; color: var(--muted); font-size: .89rem; }
.files-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}
.folder-heading { min-height: 54px; }
#folder-nav { min-width: 0; flex: 1; }
.folder-heading { display: flex; align-items: center; gap: 8px; }
#folder-up {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--brand);
}
#folder-up:hover, #folder-up:focus-visible { background: var(--soft-orange); }
.up-folder-icon { position: absolute; left: 3px; bottom: 3px; width: 29px; height: 29px; }
#folder-up .up-arrow {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 25px;
  height: 25px;
  min-width: 0;
  min-height: 0;
}
.up-arrow svg { width: 15px; height: 15px; }
#files-heading { overflow-wrap: anywhere; }
#breadcrumbs {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-block: 0 4px;
  overflow-x: auto;
  scrollbar-width: thin;
  color: var(--muted);
  font-size: .82rem;
}
#breadcrumbs button {
  flex-shrink: 0;
  padding: 2px 7px;
  border-color: transparent;
  background: transparent;
  color: var(--brand);
}
#breadcrumbs button:hover, #breadcrumbs button:focus-visible { background: var(--soft-orange); }
#breadcrumbs [aria-current] { font-weight: 650; }
.sort-control { flex: 0 0 auto; }
#sort {
  min-height: 44px;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
  background: #fffaf2;
  font: inherit;
  font-size: .9rem;
}
#sort:hover { background: var(--soft-orange); }
.file-tools { flex-wrap: nowrap; }
.view-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
#search-control { position: relative; min-width: 0; }
.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 3px 4px 3px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fffaf2;
  box-shadow: inset 0 2px 4px #a4683410;
}
.search-box #search { flex: 1; border: 0; padding: 4px; background: transparent; }
.search-box:focus-within { border-color: #c67c46; }
.search-box #search:focus-visible { outline: none; }
.glossy-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid #c15d23;
  border-radius: 50%;
  color: #632b0b;
  background: linear-gradient(177deg, #ffe0af, #ffab61 49%, #f18035 52%, #f78f44);
  box-shadow: inset 0 2px #fff8e6b8, 0 3px 8px #b75c2d31;
  transition: transform .18s ease, box-shadow .18s ease;
}
.glossy-button:hover { background: linear-gradient(177deg, #ffe9ca, #ffb878 49%, #fa8f46 52%, #ffa260); }
.glossy-button:active { transform: scale(.94); }
#search-results {
  inset-inline: 0;
  max-height: min(300px, 45vh);
  overflow: auto;
  overscroll-behavior: contain;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 5px 8px;
  border-color: transparent;
  text-align: left;
  background: transparent;
}
.search-result:hover, .search-result:focus-visible { border-color: var(--border); background: var(--soft-orange); }
.search-result .file-preview { flex: 0 0 auto; width: 33px; height: 36px; }
.search-result strong, .search-result small { display: block; overflow-wrap: anywhere; }
.search-result small, .search-empty { color: var(--muted); }
.search-empty { margin: 0; padding: 8px; }
.view-toggle { display: inline-flex; gap: 3px; background: #f7ead9; border-radius: 12px; padding: 3px; }
.view-toggle button { display: inline-flex; gap: 7px; align-items: center; background: transparent; border-color: transparent; }
.view-toggle button[aria-pressed=true] { background: #fffaf2; border-color: var(--border); color: var(--brand); }
.upload { position: relative; margin: 0; }
#add-toggle svg { transition: transform .2s ease; }
#add-toggle[aria-expanded=true] svg { transform: rotate(45deg); }
#add-toggle:not([aria-expanded=true]):hover svg { transform: rotate(12deg); }
.popover-title { margin: 0; padding: 4px 5px; font-weight: 750; }
#upload-name { margin: 4px 5px; color: var(--muted); font-size: .86rem; }
.selection-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.selection-bar button { font-size: .88rem; }
#selection-count { color: var(--muted); font-size: .88rem; }
.danger { color: #9a3023; }
#files { margin: 12px 0 0; padding: 0; list-style: none; }
#files[data-view=icons] {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
  gap: 12px;
}
#files .file-item {
  display: grid;
  position: relative;
  min-width: 0;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: linear-gradient(165deg, #fffefa, #fff7ec);
}
#files .file-item:hover, #files .file-item:focus-within { border-color: #d8b492; }
#files .file-item:has(.file-select:checked), #files .file-item[aria-selected=true], #files .file-item.is-selected {
  border-color: #db955d;
  background: var(--soft-orange);
}
#files[data-view=icons] .file-item {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr auto auto;
  gap: 5px;
  min-height: 152px;
}
#files[data-view=icons] .file-select { grid-area: 1 / 1; }
#files[data-view=icons] .file-actions { grid-area: 1 / 3; }
#files[data-view=icons] .file-preview { grid-area: 2 / 1 / 3 / 4; justify-self: center; }
#files[data-view=icons] .file-name { grid-area: 3 / 1 / 4 / 4; text-align: center; }
#files[data-view=icons] .file-meta { grid-area: 4 / 1 / 5 / 4; text-align: center; }
#files[data-view=list] { display: grid; gap: 5px; }
#files[data-view=list] .file-item { grid-template-columns: auto auto minmax(0, 1fr) minmax(4rem, auto) auto; gap: 8px; }
#files[data-view=list] .file-select { grid-column: 1; grid-row: 1; }
#files[data-view=list] .file-preview { grid-column: 2; grid-row: 1; width: 36px; height: 38px; }
#files[data-view=list] .file-name { grid-column: 3; grid-row: 1; }
#files[data-view=list] .file-meta { grid-column: 4; grid-row: 1; }
#files[data-view=list] .file-actions { grid-column: 5; grid-row: 1; }
.file-select { width: 16px; height: 16px; min-height: 0; margin: 5px; accent-color: #b85224; }
.file-preview {
  display: grid;
  place-items: center;
  width: 54px;
  height: 59px;
  overflow: hidden;
  border: 1px solid #efcba7;
  border-radius: 10px 17px 10px 10px;
  color: #943c19;
  background: linear-gradient(150deg, #fff7e8, #ffd6af);
  box-shadow: inset 0 1px #fff8ee, 0 4px 9px #ad682224;
  font-weight: 750;
  font-size: .72rem;
}
#files .folder-item {
  border-color: #ebd2b5;
  background: linear-gradient(160deg, #fffdf7, #fff1dd);
}
.folder-item .file-preview, .folder-preview {
  color: #9a451c;
  border-color: #efbf8e;
  border-radius: 9px;
  background: linear-gradient(160deg, #fff1d5, #ffc489);
}
.folder-preview svg, .folder-item .file-preview svg { width: 60%; height: 60%; }
.folder-open {
  grid-area: 1 / 1 / -1 / -1;
  align-self: stretch;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 4px 6px;
  border-color: transparent;
  color: var(--brand);
  background: transparent;
  text-align: inherit;
  overflow-wrap: anywhere;
}
#files[data-view=list] .folder-open { display: flex; align-items: center; }
#files[data-view=icons] .folder-open :is(.file-preview, .file-name) { grid-area: auto; }
#files .folder-controls { position: absolute; z-index: 1; top: 5px; right: 5px; display: flex; }
#files[data-view=list] .folder-controls { top: 50%; transform: translateY(-50%); }
#files[data-view=list] .folder-open { padding-right: 96px; }
.folder-toggle { display: grid; place-items: center; color: var(--brand); }
.folder-toggle[aria-expanded=true] svg { transform: rotate(180deg); }
#files[data-view=list] > .nested-row {
  margin-inline-start: min(calc(var(--folder-depth) * clamp(12px, 3vw, 23px)), 24%);
  border-inline-start: 2px solid #e4ba90;
}
.folder-open:hover, .folder-open:focus-visible { background: #ffe9ce; }
#files .folder-item.is-drop-target, #breadcrumbs .is-drop-target {
  border-color: #c1652c;
  background: #ffe3bc;
  outline: 2px dashed #b45823;
  outline-offset: -3px;
}
.file-drag-preview { touch-action: none; user-select: none; cursor: grab; }
.file-preview img, .file-preview video { width: 100%; height: 100%; object-fit: cover; }
.file-name { min-width: 0; overflow-wrap: anywhere; font-size: .91rem; font-weight: 650; }
.file-meta { min-width: 0; color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.file-actions { min-width: 34px; min-height: 34px; padding: 3px 6px; border-color: transparent; background: transparent; }
.file-actions:hover, .file-actions:focus-visible { border-color: var(--border); background: var(--soft-orange); }
.file-empty, #files > li:only-child:not(.file-item) {
  grid-column: 1 / -1;
  padding: 24px 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}
.file-menu {
  position: fixed;
  z-index: 5;
  display: grid;
  min-width: 165px;
  max-width: calc(100vw - 16px);
  padding: 5px;
  border: 1px solid #e5ae78;
  border-radius: 12px;
  color: var(--ink);
  background: #ffd4a9;
  box-shadow: 0 12px 30px #5c321d28;
}
.file-menu button { border: 0; text-align: left; background: transparent; }
.file-menu button:hover, .file-menu button:focus-visible { background: #fff2e1; }
.file-dialog {
  width: min(28rem, calc(100% - 24px));
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 15px 45px #5c321d3b;
}
.file-dialog::backdrop { background: #34241856; }
.file-dialog h2 { margin-bottom: 8px; }
.file-dialog input:not([type=checkbox]), .file-dialog select { margin-bottom: 12px; }
.file-dialog select {
  width: 100%;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fffdf8;
  color: var(--ink);
}
#status { margin: 14px 0 0; }
#status:empty { display: none; }
#status[data-error] { color: #942515; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 530px) {
  .files-heading { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
  .toolbar { gap: 6px; }
  .intro { grid-template-columns: minmax(0, 1fr) minmax(76px, .4fr); }
  #sort { width: 112px; font-size: .9rem; }
  .site-inner { min-height: 62px; }
  .brand img { width: 27px; height: 25px; }
  .selection-bar, #selection-actions { gap: 5px; }
  .view-toggle button {
    justify-content: center;
    width: 44px;
    padding: 0;
    gap: 0;
    font-size: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cloud-art img { animation: none; }
  .glossy-button, #add-toggle svg { transition: none; }
}
@media (max-width: 480px) {
  #files[data-view=icons] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #files[data-view=list] .file-item { grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 1px 7px; }
  #files[data-view=list] :is(.file-select, .file-preview, .file-actions) { grid-row: 1 / 3; }
  #files[data-view=list] .file-meta { grid-area: 2 / 3; }
  #files[data-view=list] .file-actions { grid-column: 4; }
}
@media (pointer: coarse) {
  .file-actions { min-width: 44px; min-height: 44px; }
  .file-select { width: 20px; height: 20px; }
}
