:root {
  --bg: #e9edf4;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --ink: #16203a;
  --muted: #5b6579;
  --line: #d3d9e4;
  --accent: #2b50d6;
  --accent-soft: #e3e9fd;
  --accent-ink: #ffffff;
  --ok: #17784c;
  --danger: #b8342a;
  --radius-lg: 18px;
  --radius: 10px;
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1322;
    --surface: #151d31;
    --surface-2: #1b2540;
    --ink: #e6ebf6;
    --muted: #98a3ba;
    --line: #29344f;
    --accent: #7d9bff;
    --accent-soft: #1f2c55;
    --accent-ink: #0d1322;
    --ok: #4cc58c;
    --danger: #ff7d70;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font);
  font-optical-sizing: auto;
}
a { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* header */
.site-header { max-width: 760px; margin: 0 auto; padding: 22px 20px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M10 14a4.5 4.5 0 0 0 6.4 0l3-3a4.5 4.5 0 0 0-6.4-6.4l-1 1'/%3E%3Cpath d='M14 10a4.5 4.5 0 0 0-6.4 0l-3 3a4.5 4.5 0 0 0 6.4 6.4l1-1'/%3E%3C/svg%3E") center/80% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M10 14a4.5 4.5 0 0 0 6.4 0l3-3a4.5 4.5 0 0 0-6.4-6.4l-1 1'/%3E%3Cpath d='M14 10a4.5 4.5 0 0 0-6.4 0l-3 3a4.5 4.5 0 0 0 6.4 6.4l1-1'/%3E%3C/svg%3E") center/80% no-repeat;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px 64px; }

/* intro */
.intro { padding: 44px 0 26px; }
.intro h1 {
  margin: 0; font-size: clamp(2.1rem, 6vw, 3.4rem); line-height: 1.02;
  font-weight: 750; letter-spacing: -0.035em; max-width: 13ch;
}
.lede { margin: 14px 0 0; color: var(--muted); font-size: 1.08rem; max-width: 48ch; }

/* panel */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
@media (min-width: 640px) { .panel { padding: 28px; } }

/* tabs */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 999px; margin-bottom: 18px; }
.tab {
  font: inherit; font-weight: 600; border: 0; background: transparent; color: var(--muted);
  padding: 7px 18px; border-radius: 999px; cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }

/* drop zone: the one bold element */
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 230px; padding: 28px 18px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line); border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 18px 18px,
    var(--surface-2);
  transition: border-color .15s, background-color .15s, transform .15s;
}
.drop:hover { border-color: var(--accent); }
.drop.is-over { border-color: var(--accent); border-style: solid; background-color: var(--accent-soft); transform: scale(1.01); }
.drop-art {
  width: 64px; height: 64px; margin-bottom: 8px; border-radius: 20px; background: var(--accent);
  box-shadow: 0 10px 24px -10px var(--accent);
  position: relative;
}
.drop-art::after {
  content: ""; position: absolute; inset: 16px; background: var(--accent-ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M6 10l6-6 6 6M4 20h16'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M6 10l6-6 6 6M4 20h16'/%3E%3C/svg%3E") center/contain no-repeat;
}
.drop.is-over .drop-art { transform: translateY(-4px); transition: transform .15s; }
.drop-title { font-weight: 600; font-size: 1.12rem; }
.drop-title u { color: var(--accent); text-underline-offset: 3px; }
.drop-hint { color: var(--muted); font-size: .92rem; }

/* picked files */
.picked { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.picked li {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px;
  background: var(--surface-2); border-radius: var(--radius);
}
.picked .p-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked .p-size { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.picked .p-remove {
  border: 0; background: transparent; color: var(--muted); cursor: pointer; width: 30px; height: 30px; border-radius: 8px; font-size: 1.2rem; line-height: 1;
}
.picked .p-remove:hover { background: var(--line); color: var(--ink); }
.picked .p-total { background: none; padding: 2px 4px; color: var(--muted); font-size: .9rem; }

/* text */
textarea {
  width: 100%; min-height: 230px; resize: vertical; padding: 14px 16px;
  font: .95rem/1.55 var(--mono); color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.text-count { text-align: right; color: var(--muted); font-size: .85rem; margin-top: 6px; }

/* options */
.options { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.field { display: grid; gap: 6px; flex: 1 1 240px; }
.field--narrow { flex: 0 1 170px; }
.field > span { font-weight: 600; font-size: .92rem; }
.field small { color: var(--muted); font-weight: 400; }
input[type="text"], select {
  font: inherit; color: var(--ink); width: 100%; height: 44px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
input[type="text"]:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; padding: 0 16px; font: inherit; font-weight: 600; font-size: .95rem;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn-quiet:hover { color: var(--ink); border-color: var(--line); }
.btn-small { height: 34px; padding: 0 12px; font-size: .88rem; }
.btn-wide { width: 100%; height: 52px; margin-top: 20px; font-size: 1.05rem; }
.btn:disabled { opacity: .6; cursor: progress; }

.error { margin: 16px 0 0; padding: 10px 14px; border-radius: var(--radius); color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); font-weight: 600; }

/* progress */
.progress { margin-top: 18px; display: grid; gap: 6px; }
.progress-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.progress-label { font-size: .88rem; color: var(--muted); }

/* result */
.result { text-align: center; padding: 10px 0; }
.result-check {
  display: inline-block; width: 56px; height: 56px; border-radius: 50%; background: var(--ok); position: relative;
  animation: pop .35s ease-out;
}
.result-check::after {
  content: ""; position: absolute; inset: 15px; background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat;
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.result-title { margin: 12px 0 2px; font-size: 1.6rem; letter-spacing: -0.02em; }
.result-name { margin: 0 0 18px; color: var(--muted); overflow-wrap: anywhere; }
.link-box { display: flex; gap: 8px; max-width: 560px; margin: 0 auto; }
.link-box input { height: 48px; font-family: var(--mono); font-size: .92rem; background: var(--surface-2); }
.link-box .btn { height: 48px; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
@media (max-width: 480px) { .link-box { flex-direction: column; } }

/* recent */
.recent { margin-top: 40px; }
.recent h2 { margin: 0; font-size: 1.35rem; letter-spacing: -0.02em; }
.recent-note { margin: 2px 0 14px; color: var(--muted); font-size: .92rem; }
.recent-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.recent-item { display: flex; align-items: center; gap: 14px; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.recent-item.is-new { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
.recent-icon { flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); position: relative; }
.recent-icon::after { content: ""; position: absolute; inset: 10px; background: var(--accent); -webkit-mask: var(--icon) center/contain no-repeat; mask: var(--icon) center/contain no-repeat; }
.recent-icon--file { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M6 2h8l5 5v15H6z'/%3E%3Cpath d='M14 2v5h5'/%3E%3C/svg%3E"); }
.recent-icon--text { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h10'/%3E%3C/svg%3E"); }
.recent-main { flex: 1; min-width: 0; display: grid; }
.recent-title { font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-title:hover { color: var(--accent); text-decoration: underline; }
.recent-meta { color: var(--muted); font-size: .86rem; }
.recent-actions { display: flex; gap: 4px; flex: none; }
@media (max-width: 560px) {
  .recent-item { flex-wrap: wrap; }
  .recent-actions { width: 100%; padding-left: 52px; }
}
.empty { color: var(--muted); padding: 22px 0; margin: 0; }

/* share page */
.share { margin-top: 36px; }
.share-head { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: start; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.share-head h1 { margin: 0; font-size: clamp(1.5rem, 4.5vw, 2.1rem); line-height: 1.15; letter-spacing: -0.025em; overflow-wrap: anywhere; }
.share-head .btn { grid-row: 1 / span 2; grid-column: 2; }
.share-meta { margin: 0; color: var(--muted); font-size: .92rem; }
.share-block { margin-top: 22px; }
.block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.block-head h2 { margin: 0; font-size: 1.1rem; }
.block-head h2 small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.block-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.shared-text {
  margin: 0; padding: 16px; max-height: 60vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  font: .93rem/1.6 var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--surface-2); border-radius: var(--radius); }
.file-ext { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: .72rem; font-weight: 750; }
.file-name { flex: 1; min-width: 0; display: grid; overflow-wrap: anywhere; font-weight: 600; }
.file-name small { color: var(--muted); font-weight: 400; font-size: .85rem; }
.file-actions { display: flex; gap: 4px; flex: none; }
@media (max-width: 480px) { .file-row { flex-wrap: wrap; } .file-actions { width: 100%; justify-content: flex-end; } }
.footer-cta { text-align: center; margin-top: 22px; }
.missing { margin-top: 48px; text-align: center; }
.missing h1 { margin: 0 0 8px; font-size: 1.8rem; letter-spacing: -0.02em; }
.missing p { color: var(--muted); margin: 0 auto 20px; max-width: 42ch; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
