:root {
  --background: #f1f0f8;
  --surface: #ffffff;
  --ink: #27233f;
  --muted: #5c5772;
  --accent: #514099;
  --accent-hover: #3d2e7a;
  --edge: #d5d0e6;
  --error: #a1234b;
  --type-body: "Inter", system-ui, sans-serif;
  --type-display: "Geist", "Inter", system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
  font-family: var(--type-body);
  line-height: 1.5;
  scrollbar-color: #81799c #eeecf5;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
h1, h2, p, ul { margin: 0; }
h1, h2 { font-family: var(--type-display); line-height: 1.12; }
h1 { font-size: clamp(2.4rem, 5.5vw, 4.9rem); letter-spacing: -.06em; font-weight: 740; }
h2 { font-size: 1.3rem; letter-spacing: -.035em; }
a, button, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1[tabindex="-1"]:focus { outline: none; }

button, .download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 44px;
  padding: .55rem .88rem;
  border: 1px solid var(--edge);
  border-radius: 9px;
  color: var(--accent);
  background: var(--surface);
  font-weight: 680;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .download:hover { background: #eeebf9; }
button:active, .download:active { background: #e8e3f7; }
button:disabled { opacity: .58; cursor: default; }
.primary { background: var(--accent); color: white; border-color: transparent; }
.primary:hover, .primary:active { background: var(--accent-hover); }
.plain { border-color: transparent; background: transparent; }
.light { color: white; }
.light:hover, .light:active { background: #413956; }
.light:focus-visible { outline-color: #d2c4ff; }

.topbar { background: var(--ink); color: white; }
.topline {
  max-width: 1152px;
  margin: 0 auto;
  padding: 8px 28px;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand { margin-right: auto; display: flex; align-items: center; gap: 11px; font-weight: 760; }
.mark {
  display: block;
  width: 20px;
  height: 20px;
  border: 2px solid #d2c4ff;
  border-radius: 4px;
  background: repeating-linear-gradient(to bottom, transparent 0 4px, #d2c4ff 4px 6px);
}
.route { color: #e5def8; font-size: .875rem; line-height: 1.25; }
.route::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #b7a4ff; vertical-align: .07em; }

main { max-width: 1152px; margin: 0 auto; padding: clamp(30px, 6vw, 72px) 28px; }
.workspace { display: grid; grid-template-columns: minmax(190px, 254px) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); }
.summary h1 { margin: 0 0 28px; }
.capacity { border-bottom: 1px solid var(--edge); padding-bottom: 1rem; }
.amount { font-size: 1rem; color: var(--muted); }
.amount strong { color: var(--ink); font-weight: 760; font-variant-numeric: tabular-nums; }
.limit, .lifetime { font-size: .9rem; color: var(--muted); }
.lifetime { margin-top: .85rem; max-width: 25ch; }
meter {
  display: block;
  width: 100%;
  height: 14px;
  margin: .45rem 0 .3rem;
  background: var(--edge);
  border-radius: 3px;
  accent-color: var(--accent);
}
meter::-webkit-meter-bar { background: var(--edge); border: 0; border-radius: 3px; }
meter::-webkit-meter-optimum-value { background: var(--accent); }
meter::-moz-meter-bar { background: var(--accent); }
.drop-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px dashed #9790b4;
  border-radius: 13px;
  background: #eae7f5;
}
.drop-zone.drag { outline: 2px solid var(--accent); background: #dfd7f8; }
.drop-zone p { margin-top: .45rem; color: var(--muted); }
.content > section { min-width: 0; }
.notice {
  min-height: 1.7rem;
  padding: .3rem 0 0;
  color: var(--muted);
  font-size: .9rem;
}
.files, .transfers { background: var(--surface); border: 1px solid var(--edge); border-radius: 13px; }
.transfers { margin-bottom: 16px; }
.transfers h2 { padding: 18px 18px 12px; }
.files-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 10px 10px 10px 18px; }
.list-status { padding: 0 18px; color: var(--muted); }
.list-status:not(:empty) { padding-bottom: 18px; }
.items { list-style: none; padding: 0; }
.item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px 11px 18px; border-top: 1px solid var(--edge); }
.info { min-width: 0; flex: 1 1 0; }
.filename { color: var(--ink); font-weight: 670; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.detail { color: var(--muted); font-size: .85rem; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.file-actions { justify-content: flex-end; }
.protected { color: var(--accent); font-weight: 650; }
.pagination { display: flex; align-items: center; justify-content: center; padding: 12px; gap: 14px; border-top: 1px solid var(--edge); }
progress { width: min(100%, 22rem); accent-color: var(--accent); height: 10px; margin-top: .3rem; }
.problem { color: var(--error); }

.sign-in {
  max-width: 490px;
  min-height: 15rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--edge);
  padding: clamp(22px, 5vw, 48px);
  margin: 4vh auto;
}
.sign-in h1 { font-size: clamp(2rem, 6vw, 3.2rem); }
.sign-in > p { margin-top: 1rem; color: var(--muted); }
.sign-in form { display: grid; margin-top: 1.7rem; }
.sign-in label { font-weight: 680; }
.sign-in .primary { justify-self: start; width: 8rem; }
.sign-in > button { margin-top: 1rem; }
.password-control { display: flex; gap: 5px; margin-top: 6px; }
.password-control input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .6rem .7rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #9790b4;
  border-radius: 9px;
}
.status-slot { min-height: 3rem; padding: .35rem 0; }

dialog {
  width: min(480px, calc(100% - 32px));
  padding: clamp(18px, 5vw, 27px);
  border: 1px solid var(--edge);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
}
dialog::backdrop { background: rgb(39 35 63 / 55%); }
dialog p { margin-top: .6rem; }
#share-description, #delete-description { color: var(--muted); }
#share-result { margin-top: .9rem; }
#share-result label { display: block; font-weight: 650; }
#share-result input {
  display: block;
  width: 100%;
  margin-top: .3rem;
  min-height: 44px;
  padding: .55rem .65rem;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: var(--background);
  color: var(--ink);
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
.danger { color: var(--error); }
.danger-confirm { color: white; background: var(--error); border-color: var(--error); }
.danger-confirm:hover, .danger-confirm:active { background: #7c1638; border-color: #7c1638; }

@media (max-width: 690px) {
  main, .topline { padding-inline: 16px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .summary h1 { margin-bottom: 12px; }
  .lifetime { max-width: none; }
  .capacity { padding-bottom: .6rem; }
  .file-item { align-items: flex-start; flex-direction: column; }
  .file-actions { justify-content: flex-start; }
}
@media (max-width: 440px) {
  .drop-zone { align-items: stretch; flex-direction: column; }
  .item { align-items: flex-start; flex-direction: column; gap: 8px; }
  .info { width: 100%; }
  .pagination { gap: 8px; }
}
