:root {
  color-scheme: light;
  --ink: #1c1c1e;
  --muted: #656872;
  --accent: #0a68d0;
  --line: rgb(60 60 67 / .15);
  --content-width: 832px;
  --gutter: 32px;
  --glass: linear-gradient(156deg, rgb(255 255 255 / .72), rgb(255 255 255 / .09) 46%, rgb(228 238 252 / .42)),
    rgb(235 241 248 / .22);
  --glass-shadow: inset 0 1px 1px rgb(255 255 255 / .94),
    inset 0 -1px 1px rgb(255 255 255 / .58), 0 0 0 .5px rgb(40 55 84 / .18),
    0 6px 18px -10px rgb(30 47 76 / .35);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang TC", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
[hidden], .symbol-library { display: none !important; }
body { margin: 0; min-height: 100dvh; background: #fff; color: var(--ink); }
button, input, select { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, p { margin: 0; }
.icon {
  display: block;
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.masthead, .workspace {
  width: min(100% - 2 * var(--gutter), var(--content-width));
  margin-inline: auto;
}
.masthead {
  padding-top: calc(30px + env(safe-area-inset-top));
  padding-bottom: 26px;
}
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand h1 { font-size: 42px; line-height: 1.1; letter-spacing: -.081em; font-weight: 750; }
.brand span { align-self: end; margin-bottom: 4px; color: var(--muted); font-size: 10px; letter-spacing: .012em; white-space: nowrap; }

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(118 118 128 / .09);
  color: #363c48;
  -webkit-tap-highlight-color: transparent;
}
.icon-button:hover { background-color: rgb(118 118 128 / .16); }
.icon-button:active { background-color: rgb(118 118 128 / .23); }
.glass {
  background: var(--glass);
  border: .5px solid rgb(255 255 255 / .5);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(175%) brightness(1.05) contrast(1.03);
  backdrop-filter: blur(18px) saturate(175%) brightness(1.05) contrast(1.03);
}
.glass:hover { background-color: rgb(206 224 252 / .38); }
.glass:active { background-color: rgb(189 215 252 / .58); }
.workspace {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: min(560px, 72dvh);
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.search {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 8px;
  min-width: 0;
  padding: 0 12px;
  border-radius: 13px;
  background: #f3f3f5;
  color: var(--muted);
}
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search input { width: 100%; min-height: 44px; padding: 0; outline: 0; border: 0; background: none; color: var(--ink); font-size: 16px; }
.search input::placeholder { color: var(--muted); opacity: 1; }
.search .icon { width: 18px; height: 18px; }
.sort { position: relative; overflow: hidden; }
.sort:has(select:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.sort select { position: absolute; inset: 0; width: 100%; height: 100%; appearance: none; opacity: 0; }

.file-list { margin: 0; padding: 0; list-style: none; }
.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px 144px 44px;
  align-items: center;
  gap: 16px;
  min-height: 65px;
}
.file-row + .file-row { border-top: .5px solid var(--line); }
.file-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.file-icon { display: grid; place-items: center; flex: none; width: 28px; height: 32px; color: #5c6472; }
.file-icon .icon { width: 22px; height: 22px; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 580; }
.file-size, .file-expiry { color: var(--muted); font-size: 13px; font-weight: 450; }
.file-expiry[data-soon] { color: #955708; }
.download { justify-self: end; background-color: transparent; }
.download .icon { width: 19px; height: 19px; }

.list-state { display: flex; min-height: 270px; flex-direction: column; align-items: center; justify-content: center; gap: 11px; text-align: center; color: var(--muted); }
.state-icon { width: 33px; height: 33px; color: #7b808a; stroke-width: 1.25; }
.list-state h2 { font-size: 14px; font-weight: 560; }
.list-state p, .feedback { font-size: 13px; }
.feedback { color: var(--muted); padding-top: 12px; overflow-wrap: anywhere; }
.feedback[data-error] { color: #a52c2c; }
.drop-target {
  position: absolute;
  inset: 0 0 90px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed var(--accent);
  border-radius: 17px;
  background: #f3f8ff;
  color: var(--accent);
  font-weight: 610;
  pointer-events: none;
}
.upload {
  position: fixed;
  z-index: 3;
  right: max(26px, calc(env(safe-area-inset-right) + 14px));
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 8px));
  width: 66px;
  height: 66px;
  color: #1461b5;
  background-image: radial-gradient(ellipse at 26% 16%, rgb(255 255 255 / .94), transparent 52%),
    linear-gradient(155deg, rgb(242 248 255 / .35) 24%, rgb(189 219 255 / .33) 76%, rgb(226 236 255 / .72));
  box-shadow: var(--glass-shadow), inset 0 -5px 10px rgb(173 203 244 / .28), 0 12px 26px -12px rgb(53 103 169 / .46);
}
.upload .icon { width: 29px; height: 29px; stroke-width: 1.8; }


@media (max-width: 600px) {
  :root { --gutter: max(18px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  .masthead { padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: 18px; }
  .brand h1 { font-size: 37px; }
  .brand span { margin-bottom: 3px; }
  .toolbar { gap: 8px; margin-bottom: 9px; }
  .file-row {
    position: relative;
    grid-template-columns: auto minmax(0, 1fr) 44px;
    grid-template-rows: auto auto;
    align-content: center;
    gap: 2px 8px;
    min-height: 66px;
    padding: 8px 0 8px 38px;
  }
  .file-identity { grid-row: 1; grid-column: 1 / 3; }
  .file-icon { position: absolute; left: 0; top: 50%; transform: translateY(-50%); }
  .file-size { grid-row: 2; grid-column: 1; font-size: 12px; }
  .file-expiry { grid-row: 2; grid-column: 2; font-size: 12px; }
  .file-expiry::before { content: "·"; margin-right: 8px; color: var(--muted); }
  .download { grid-row: 1 / 3; grid-column: 3; }
  .list-state { min-height: 232px; }
  .upload { right: max(16px, calc(env(safe-area-inset-right) + 8px)); bottom: max(14px, calc(env(safe-area-inset-bottom) + 6px)); width: 62px; height: 62px; }
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass { background-color: #f1f5fb; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: #edf2fa; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
