:root {
  color-scheme: light;
  --bg: #f2f0eb;
  --surface: #fff;
  --surface-2: #f7f5f1;
  --ink: #171717;
  --muted: #73716c;
  --border: #dedbd3;
  --border-strong: #b9b5ad;
  --accent: #ff5a2a;
  --accent-soft: #fff0e9;
  --on-ink: #fff;
  --danger: #d63d3d;
  --shadow: 0 20px 60px rgba(34, 31, 25, .09), 0 2px 8px rgba(34, 31, 25, .04);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-ui: cubic-bezier(.4, 0, .2, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f0e;
  --surface: #191918;
  --surface-2: #222220;
  --ink: #f6f3ed;
  --muted: #9c9992;
  --border: #30302d;
  --border-strong: #4a4944;
  --accent: #ff7147;
  --accent-soft: #352017;
  --on-ink: #111;
  --danger: #ff6565;
  --shadow: 0 24px 70px rgba(0, 0, 0, .32), 0 1px 0 rgba(255, 255, 255, .03);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -20%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 32rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  width: min(1120px, calc(100% - 32px));
  height: 64px;
  margin: 18px auto 0;
  padding: 0 12px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(34, 31, 25, .05);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 10;
  animation: page-in .85s var(--ease) both;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 760; letter-spacing: -.035em; }
.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 9px;
  font-size: 18px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 4px 12px color-mix(in srgb, var(--accent) 24%, transparent);
}
.site-header nav { display: flex; align-items: center; gap: 5px; }
.nav-link { padding: 10px 13px; border-radius: 11px; color: var(--muted); font-size: 13px; font-weight: 650; transition: color .32s var(--ease-ui), background .32s var(--ease-ui), transform .32s var(--ease); }
.nav-link:hover { color: var(--ink); background: var(--surface-2); }
.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface-2);
  cursor: pointer;
  transition: transform .34s var(--ease), border-color .32s var(--ease-ui), background .32s var(--ease-ui), color .32s var(--ease-ui);
}
.icon-button:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.icon-button:active, .button:active { transform: scale(.97); }
.sun { width: 15px; height: 15px; border: 2px solid currentColor; border-radius: 50%; position: relative; }
.sun::after { content: ""; position: absolute; inset: -6px; border: 1px dotted currentColor; border-radius: 50%; }

.home-shell { width: min(760px, calc(100% - 32px)); margin: clamp(42px, 8vh, 84px) auto 56px; text-align: center; }
.intro { margin-bottom: 32px; }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-size: 11px; font-weight: 780; letter-spacing: .16em; text-transform: uppercase; }
.intro .eyebrow { animation: page-in .82s .1s var(--ease) both; }
.intro h1, .page-title h1 {
  margin: 0;
  font-size: clamp(46px, 8vw, 76px);
  line-height: .94;
  letter-spacing: -.068em;
  font-weight: 800;
}
.intro h1 { animation: page-in .9s .18s var(--ease) both; }
.lead { margin: 20px 0 0; color: var(--muted); font-size: clamp(16px, 2.2vw, 19px); letter-spacing: -.018em; animation: page-in .86s .28s var(--ease) both; }

.glass { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.upload-panel {
  padding: 10px;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  animation: page-in .96s .38s var(--ease) both;
  transition: height .62s var(--ease), box-shadow .36s var(--ease-ui), transform .36s var(--ease);
}
.upload-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #ff9b52);
  opacity: .9;
}
.dropzone {
  min-height: 350px;
  padding: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: 20px;
  background: var(--surface-2);
  outline: none;
  transition: transform .4s var(--ease), border-color .34s var(--ease-ui), background .34s var(--ease-ui), box-shadow .34s var(--ease-ui);
}
.dropzone.dragging { transform: scale(.985); border-color: var(--accent); background: var(--accent-soft); }
.dropzone h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.035em; }
.dropzone p { margin: 0 0 24px; color: var(--muted); }
.upload-symbol {
  width: 72px;
  height: 72px;
  margin-bottom: 24px;
  border-radius: 20px;
  background: var(--ink);
  position: relative;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--ink) 18%, transparent);
  transition: transform .42s var(--ease);
}
.dropzone:hover .upload-symbol { transform: translateY(-4px) rotate(-2deg); }
.upload-symbol::before { content: ""; position: absolute; width: 2px; height: 23px; left: 35px; top: 20px; border-radius: 2px; background: var(--surface); }
.upload-symbol::after { content: ""; position: absolute; width: 12px; height: 12px; left: 29px; top: 20px; border-top: 2px solid var(--surface); border-left: 2px solid var(--surface); transform: rotate(45deg); }
.upload-symbol span { position: absolute; width: 24px; height: 2px; left: 24px; top: 48px; border-radius: 2px; background: var(--accent); }
.upload-symbol.small { transform: scale(.75); margin-bottom: 10px; }

.button {
  min-height: 46px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .34s var(--ease), background .32s var(--ease-ui), color .32s var(--ease-ui), border-color .32s var(--ease-ui), box-shadow .34s var(--ease-ui);
}
.button.primary { color: var(--on-ink); background: var(--ink); box-shadow: 0 8px 20px color-mix(in srgb, var(--ink) 16%, transparent); }
.button.primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px color-mix(in srgb, var(--ink) 22%, transparent); }
.button.secondary { color: var(--ink); background: var(--surface); border-color: var(--border); }
.button.secondary:hover { border-color: var(--border-strong); background: var(--surface-2); }
.button.tertiary { color: var(--muted); background: transparent; }
.button.danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 20%, var(--border)); }
.wide { width: 100%; }

.file-stage { padding: 6px; animation: state-in .62s var(--ease) both; }
.selected-file { padding: 17px; display: flex; align-items: center; gap: 14px; text-align: left; background: var(--surface-2); border: 1px solid var(--border); border-radius: 18px; }
.file-glyph {
  width: 48px;
  height: 54px;
  flex: none;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 11px 11px 14px 14px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .04em;
  box-shadow: 0 8px 16px color-mix(in srgb, var(--accent) 20%, transparent);
}
.file-glyph.large { width: 78px; height: 90px; margin: auto; font-size: 12px; }
.file-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.file-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.file-copy span { color: var(--muted); font-size: 12px; }
.remove-file { border-radius: 11px; border-color: transparent; background: transparent; font-size: 21px; box-shadow: none; }
.settings { padding: 12px 8px 2px; }
.setting-block { margin: 0; padding: 17px 4px; border: 0; border-bottom: 1px solid var(--border); text-align: left; animation: state-in .64s var(--ease) both; }
.setting-block:nth-child(2) { animation-delay: .04s; }
.setting-block:nth-child(3) { animation-delay: .08s; }
.setting-block legend { margin-bottom: 12px; padding: 0; color: var(--muted); font-size: 12px; }
.segmented { padding: 4px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px; }
.segmented button { height: 36px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 680; cursor: pointer; transition: color .3s var(--ease-ui), background .3s var(--ease-ui), box-shadow .3s var(--ease-ui), transform .34s var(--ease); }
.segmented button.active { color: var(--on-ink); background: var(--ink); box-shadow: 0 4px 12px color-mix(in srgb, var(--ink) 14%, transparent); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.toggle-row div { display: flex; flex-direction: column; gap: 4px; }
.toggle-row strong { font-size: 14px; }
.toggle-row div span { color: var(--muted); font-size: 12px; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 46px; height: 28px; display: block; border-radius: 20px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .38s var(--ease-ui), box-shadow .38s var(--ease-ui); }
.switch span::after { content: ""; width: 22px; height: 22px; border-radius: 50%; background: #fff; position: absolute; left: 3px; top: 3px; box-shadow: 0 2px 7px rgba(0,0,0,.2); transition: transform .42s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.reveal { padding: 4px 4px 15px; text-align: left; animation: state-in .56s var(--ease) both; }
.reveal label, .manage-card label, .success-stage > label { display: block; margin: 10px 0 7px; color: var(--muted); font-size: 12px; }
.reveal input, .manage-card input, .unlock-form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface-2);
  outline: none;
  transition: border-color .32s var(--ease-ui), box-shadow .32s var(--ease-ui), background .32s var(--ease-ui);
}
.reveal input:focus, .manage-card input:focus, .unlock-form input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 8%, transparent); }
.input-with-action { position: relative; }
.input-with-action input { padding-right: 78px; }
.text-action { position: absolute; right: 7px; top: 7px; height: 34px; padding: 0 8px; border: 0; border-radius: 8px; color: var(--accent); background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.file-stage > .button { margin-top: 14px; }

.progress-stage, .success-stage { padding: 52px clamp(10px, 6vw, 56px); animation: state-in .7s var(--ease) both; }
.progress-orb { width: 106px; height: 106px; margin: 0 auto 24px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--accent) var(--progress, 0%), var(--surface-2) 0); position: relative; }
.progress-orb::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface); }
.progress-orb span { z-index: 1; font-weight: 760; }
.progress-stage h2, .success-stage h2 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.progress-stage p, .success-subtitle { margin: 8px 0 24px; color: var(--muted); }
.progress-track { height: 5px; overflow: hidden; border-radius: 9px; background: var(--surface-2); }
.progress-track span { width: 0; height: 100%; display: block; border-radius: inherit; background: var(--accent); transition: width .28s var(--ease-ui); }
.progress-stage .button { margin-top: 18px; }
.success-mark { width: 64px; height: 64px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 19px; color: #fff; background: var(--accent); font-size: 28px; font-weight: 800; box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 24%, transparent); transform: rotate(-3deg); }
.copy-field { padding: 4px; display: flex; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.copy-field input { min-width: 0; height: 38px !important; padding: 0 10px !important; flex: 1; border: 0 !important; color: var(--ink); background: transparent !important; outline: none; font-size: 13px; }
.copy-field button { padding: 0 12px; border: 0; border-radius: 9px; color: var(--accent); background: var(--surface); font-size: 12px; font-weight: 750; cursor: pointer; }
.success-actions { margin: 15px 0 9px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quota-line, .microcopy { margin: 20px 0 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; animation: page-in .82s .52s var(--ease) both; }
.quota-ring { width: 16px; height: 16px; margin-right: 7px; border-radius: 50%; background: conic-gradient(var(--accent) var(--quota), var(--border) 0); position: relative; }
.quota-ring::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--bg); }
.microcopy { margin-top: 12px; gap: 9px; animation-delay: .49s; }
.microcopy i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }

.qr-dialog { max-width: 360px; padding: 34px; border-radius: 24px; color: var(--ink); text-align: center; animation: state-in .56s var(--ease); }
.qr-dialog::backdrop { background: rgba(16, 15, 13, .48); backdrop-filter: blur(5px); }
.qr-dialog img { width: 220px; height: 220px; padding: 10px; border: 1px solid var(--border); border-radius: 16px; background: #fff; }
.qr-dialog p { color: var(--muted); }
.dialog-close { position: absolute; right: 12px; top: 12px; width: 35px; height: 35px; border: 1px solid var(--border); border-radius: 10px; color: var(--ink); background: var(--surface-2); font-size: 20px; cursor: pointer; }

.file-shell, .center-shell { width: min(900px, calc(100% - 32px)); margin: clamp(42px, 9vh, 96px) auto; }
.file-viewer { padding: 18px; border-radius: var(--radius-xl); animation: page-in .9s .16s var(--ease) both; }
.file-heading { padding: 10px 10px 22px; display: flex; align-items: center; gap: 16px; text-align: left; }
.file-heading h1 { margin: 0; overflow-wrap: anywhere; font-size: clamp(21px, 4vw, 30px); letter-spacing: -.035em; }
.file-heading p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.preview { min-height: 280px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 19px; background: var(--surface-2); }
.preview img, .preview video { max-width: 100%; max-height: 60vh; display: block; object-fit: contain; }
.preview video { width: 100%; background: #080808; }
.preview audio { width: min(580px, 90%); }
.preview iframe { width: 100%; height: 65vh; border: 0; }
.text-preview { width: 100%; max-height: 60vh; margin: 0; padding: 25px; overflow: auto; white-space: pre-wrap; word-break: break-word; text-align: left; font: 13px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; }
.no-preview { color: var(--muted); }
.file-actions { padding: 20px 5px 5px; display: flex; justify-content: center; gap: 8px; }
.file-stats { padding: 12px; display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.locked-panel { max-width: 440px; margin: 30px auto 45px; text-align: center; }
.lock-symbol { width: 72px; height: 72px; margin: auto; display: grid; place-items: center; border-radius: 20px; color: var(--on-ink); background: var(--ink); font-size: 34px; }
.locked-panel h2 { margin: 18px 0 8px; }
.locked-panel > p { color: var(--muted); line-height: 1.5; }
.unlock-form .button { margin-top: 8px; }
.form-error { min-height: 18px; color: var(--danger) !important; font-size: 12px; text-align: left; }

.manage-shell, .list-shell { width: min(1040px, calc(100% - 32px)); margin: 52px auto 80px; }
.page-title { margin: 42px auto; text-align: center; }
.page-title > * { animation: page-in .84s var(--ease) both; }
.page-title > :nth-child(2) { animation-delay: .08s; }
.page-title > :nth-child(3) { animation-delay: .16s; }
.page-title p { color: var(--muted); }
.page-title h1 { font-size: clamp(42px, 7vw, 66px); }
.manage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.manage-card { padding: 24px; border-radius: var(--radius-lg); text-align: left; animation: page-in .82s var(--ease) both; }
.manage-card:nth-child(2) { animation-delay: .07s; }
.manage-card:nth-child(3) { animation-delay: .14s; }
.manage-card:nth-child(4) { animation-delay: .21s; }
.manage-card h2 { margin: 0 0 20px; font-size: 18px; }
.stats-card { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stats-card div { display: flex; flex-direction: column; gap: 7px; }
.stats-card span { color: var(--muted); font-size: 12px; }
.stats-card strong { font-size: 20px; letter-spacing: -.03em; }
.manage-form { display: grid; gap: 8px; }
.manage-form .button { margin-top: 10px; }
.inline-check { display: flex !important; align-items: center; gap: 8px; color: var(--ink) !important; }
.inline-check input { width: 16px !important; height: 16px !important; }
.manage-card small { float: right; color: var(--muted); }
.danger-card { display: flex; flex-direction: column; align-items: flex-start; }
.danger-card p { flex: 1; color: var(--muted); font-size: 13px; line-height: 1.5; }
.file-list { display: grid; gap: 10px; }
.file-list-item { padding: 15px 18px; display: flex; align-items: center; gap: 14px; border-radius: 18px; animation: page-in .78s var(--ease) both; }
.file-list-item:nth-child(2) { animation-delay: .06s; }
.file-list-item:nth-child(3) { animation-delay: .12s; }
.file-list-item .file-copy { flex: 1; }
.file-list-item .item-actions { display: flex; gap: 7px; }
.empty-state { padding: 60px 30px; border-radius: var(--radius-xl); text-align: center; animation: page-in .9s .16s var(--ease) both; }
.empty-state h1, .empty-state h2 { letter-spacing: -.04em; }
.empty-state p { margin: 8px auto 24px; color: var(--muted); }
.lost-symbol { color: var(--accent); font-size: 13px; font-weight: 850; letter-spacing: .2em; }
.management-claim { max-width: 520px; margin: 0 auto; }
.claim-loader { width: 28px; height: 28px; margin: 20px auto 0; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: claim-spin .9s linear infinite; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 30; padding: 11px 17px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; color: #fff; background: #171717; box-shadow: 0 14px 40px rgba(0,0,0,.22); font-size: 13px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px) scale(.98); transition: opacity .4s var(--ease-ui), transform .48s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.svg-icon { width: 18px; height: 18px; display: block; flex: none; }
.icon-button .svg-icon, .dialog-close .svg-icon { width: 17px; height: 17px; }
.button .svg-icon { width: 17px; height: 17px; margin-right: 8px; }
.upload-symbol::before, .upload-symbol::after, .upload-symbol span { display: none; }
.upload-symbol { display: grid; place-items: center; color: var(--on-ink); }
.upload-symbol .svg-icon { width: 32px; height: 32px; }
.success-mark .svg-icon { width: 31px; height: 31px; }
.protected-glyph { color: var(--on-ink); background: var(--ink); }
.protected-glyph .svg-icon { width: 20px; height: 20px; }
.lock-symbol .svg-icon { width: 31px; height: 31px; }

.audio-preview { min-height: auto; padding: clamp(18px, 4vw, 34px); }
.custom-audio { width: 100%; display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 26px; align-items: center; text-align: left; }
.custom-audio audio { display: none; }
.audio-art {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  color: var(--on-ink);
  background: var(--ink);
  box-shadow: 0 18px 34px color-mix(in srgb, var(--ink) 20%, transparent);
  position: relative;
  overflow: hidden;
}
.audio-art::after { content: ""; position: absolute; width: 70px; height: 70px; right: -24px; bottom: -26px; border-radius: 50%; background: var(--accent); opacity: .95; }
.audio-art .svg-icon { width: 46px; height: 46px; position: relative; z-index: 1; }
.audio-body { min-width: 0; }
.audio-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; letter-spacing: -.035em; }
.audio-type { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .06em; }
.audio-controls { margin-top: 24px; display: grid; grid-template-columns: 48px minmax(120px, 1fr) 36px 76px; gap: 12px; align-items: center; }
.player-toggle, .player-volume { display: grid; place-items: center; border: 0; color: var(--on-ink); background: var(--ink); cursor: pointer; transition: transform .34s var(--ease), background .32s var(--ease-ui), color .32s var(--ease-ui); }
.player-toggle { width: 48px; height: 48px; border-radius: 15px; }
.player-volume { width: 36px; height: 36px; border-radius: 10px; background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
[data-theme="dark"] .player-volume { color: var(--ink); }
.player-toggle:hover, .player-volume:hover { transform: translateY(-2px); }
.player-toggle .svg-icon { width: 19px; height: 19px; }
.pause-icon, .volume-off { display: none; }
.custom-audio.is-playing .play-icon { display: none; }
.custom-audio.is-playing .pause-icon { display: block; }
.custom-audio.is-playing .audio-art .svg-icon { animation: audio-pulse 2.4s var(--ease-ui) infinite; }
.custom-audio.is-muted .volume-on { display: none; }
.custom-audio.is-muted .volume-off { display: block; }
.audio-timeline { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.player-time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.player-seek, .volume-range { height: 4px; margin: 0; appearance: none; border-radius: 99px; outline: none; background: linear-gradient(90deg, var(--accent) var(--played, 0%), var(--border) 0); cursor: pointer; }
.volume-range { background: linear-gradient(90deg, var(--ink) var(--volume, 100%), var(--border) 0); }
.player-seek::-webkit-slider-thumb, .volume-range::-webkit-slider-thumb { width: 14px; height: 14px; appearance: none; border: 3px solid var(--surface); border-radius: 50%; background: var(--accent); box-shadow: 0 1px 6px rgba(0,0,0,.22); }
.volume-range::-webkit-slider-thumb { width: 12px; height: 12px; background: var(--ink); }
.player-seek::-moz-range-thumb, .volume-range::-moz-range-thumb { width: 9px; height: 9px; border: 3px solid var(--surface); border-radius: 50%; background: var(--accent); box-shadow: 0 1px 6px rgba(0,0,0,.22); }

.video-preview { min-height: auto; display: block; padding: 0; border-color: #242424; background: #050505; }
.custom-video { width: 100%; min-height: 320px; display: grid; place-items: center; overflow: hidden; background: #050505; position: relative; outline: none; }
.custom-video video { width: 100%; max-width: 100%; min-height: 320px; max-height: 72vh; display: block; object-fit: contain; background: #050505; }
.video-overlay-play {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 24px;
  color: #111;
  background: rgba(255,255,255,.92);
  box-shadow: 0 18px 44px rgba(0,0,0,.35);
  backdrop-filter: blur(16px);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: opacity .4s var(--ease-ui), transform .48s var(--ease), background .32s var(--ease-ui);
}
.video-overlay-play:hover { background: #fff; transform: translate(-50%, -50%) scale(1.06); }
.video-overlay-play .svg-icon { width: 27px; height: 27px; margin-left: 3px; }
.custom-video.is-playing .video-overlay-play { opacity: 0; pointer-events: none; transform: translate(-50%, -44%) scale(.9); }
.video-controls {
  width: calc(100% - 28px);
  min-height: 58px;
  padding: 9px 11px;
  display: grid;
  grid-template-columns: 40px minmax(120px, 1fr) auto 36px 74px 36px;
  gap: 11px;
  align-items: center;
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 3;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  color: #fff;
  background: rgba(15,15,15,.72);
  box-shadow: 0 12px 36px rgba(0,0,0,.28);
  backdrop-filter: blur(18px) saturate(130%);
  transition: opacity .42s var(--ease-ui), transform .5s var(--ease);
}
.custom-video.controls-hidden:not(:focus-within) .video-controls { opacity: 0; pointer-events: none; transform: translateY(10px); }
.video-toggle, .video-volume, .video-fullscreen { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; color: #fff; background: rgba(255,255,255,.1); cursor: pointer; transition: background .32s var(--ease-ui), transform .34s var(--ease); }
.video-toggle:hover, .video-volume:hover, .video-fullscreen:hover { background: rgba(255,255,255,.2); transform: translateY(-1px); }
.video-toggle .svg-icon, .video-volume .svg-icon, .video-fullscreen .svg-icon { width: 18px; height: 18px; }
.video-time { color: rgba(255,255,255,.76); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.video-seek, .video-volume-range { height: 4px; margin: 0; appearance: none; border-radius: 99px; outline: none; background: linear-gradient(90deg, var(--accent) var(--played, 0%), rgba(255,255,255,.26) 0); cursor: pointer; }
.video-volume-range { background: linear-gradient(90deg, #fff var(--volume, 100%), rgba(255,255,255,.26) 0); }
.video-seek::-webkit-slider-thumb, .video-volume-range::-webkit-slider-thumb { width: 13px; height: 13px; appearance: none; border: 2px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.video-volume-range::-webkit-slider-thumb { width: 11px; height: 11px; background: #fff; }
.video-seek::-moz-range-thumb, .video-volume-range::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: var(--accent); }
.video-volume-range::-moz-range-thumb { width: 7px; height: 7px; background: #fff; }
.custom-video.is-playing .video-toggle .play-icon, .custom-video.is-muted .video-volume .volume-on, .custom-video.is-fullscreen .fullscreen-icon { display: none; }
.custom-video.is-playing .video-toggle .pause-icon, .custom-video.is-muted .video-volume .volume-off, .custom-video.is-fullscreen .minimize-icon { display: block; }
.minimize-icon { display: none; }
.custom-video:fullscreen { width: 100vw; height: 100vh; }
.custom-video:fullscreen video { width: 100%; height: 100%; max-height: 100vh; }

.dropzone > *, .selected-file > *, .success-stage > *, .progress-stage > *, .file-heading > *, .locked-panel > *, .empty-state > *, .manage-card > * { animation: detail-in .74s var(--ease) backwards; }
.dropzone > :nth-child(2), .selected-file > :nth-child(2), .success-stage > :nth-child(2), .progress-stage > :nth-child(2), .file-heading > :nth-child(2), .locked-panel > :nth-child(2), .empty-state > :nth-child(2), .manage-card > :nth-child(2) { animation-delay: .06s; }
.dropzone > :nth-child(3), .success-stage > :nth-child(3), .progress-stage > :nth-child(3), .locked-panel > :nth-child(3), .empty-state > :nth-child(3), .manage-card > :nth-child(3) { animation-delay: .12s; }
.dropzone > :nth-child(4), .success-stage > :nth-child(4), .progress-stage > :nth-child(4), .locked-panel > :nth-child(4), .empty-state > :nth-child(4), .manage-card > :nth-child(4) { animation-delay: .18s; }
.success-stage > :nth-child(n+5), .manage-card > :nth-child(n+5) { animation-delay: .24s; }
.preview, .file-actions, .file-stats { animation: detail-in .8s var(--ease) both; }
.file-actions { animation-delay: .08s; }
.file-stats { animation-delay: .16s; }

body > main { animation: route-in .9s var(--ease) both; }
body > main > * { animation: page-in .86s .1s var(--ease) both; }
body > main > :nth-child(2) { animation-delay: .16s; }
body > main > :nth-child(3) { animation-delay: .24s; }
.file-viewer > *, .manage-grid > *, .file-list > *, .empty-state > * { animation-name: detail-in; animation-duration: .76s; animation-timing-function: var(--ease); animation-fill-mode: backwards; }
.file-viewer > :nth-child(2), .manage-grid > :nth-child(2), .file-list > :nth-child(2), .empty-state > :nth-child(2) { animation-delay: .08s; }
.file-viewer > :nth-child(3), .manage-grid > :nth-child(3), .file-list > :nth-child(3), .empty-state > :nth-child(3) { animation-delay: .16s; }
.file-viewer > :nth-child(n+4), .manage-grid > :nth-child(n+4), .file-list > :nth-child(n+4), .empty-state > :nth-child(n+4) { animation-delay: .24s; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent); outline-offset: 3px; }
@keyframes route-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes page-in { from { opacity: 0; transform: translateY(14px) scale(.992); filter: blur(4px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes state-in { from { opacity: 0; transform: translateY(9px) scale(.992); } to { opacity: 1; transform: none; } }
@keyframes detail-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes audio-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
@keyframes claim-spin { to { transform: rotate(360deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.shake { animation: shake .42s var(--ease-ui); }

@media (max-width: 680px) {
  .site-header { width: calc(100% - 24px); height: 58px; margin-top: 12px; padding-left: 12px; border-radius: 15px; }
  .brand { font-size: 17px; }
  .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
  .nav-link { padding: 9px 8px; font-size: 12px; }
  .icon-button { width: 36px; height: 36px; border-radius: 10px; }
  .home-shell { margin-top: 42px; }
  .intro { margin-bottom: 26px; }
  .intro h1 { font-size: clamp(48px, 15vw, 62px); }
  .lead { max-width: 330px; margin: 18px auto 0; line-height: 1.45; }
  .upload-panel { padding: 8px; border-radius: 22px; }
  .dropzone { min-height: 310px; padding: 28px 14px; border-radius: 16px; }
  .dropzone h2 { font-size: 20px; }
  .segmented button { font-size: 10px; }
  .microcopy { gap: 6px; font-size: 10px; }
  .progress-stage, .success-stage { padding: 42px 8px; }
  .manage-grid { grid-template-columns: 1fr; }
  .stats-card { grid-template-columns: 1fr 1fr; }
  .stats-card div:last-child { grid-column: 1 / -1; }
  .manage-card { padding: 20px; }
  .file-viewer { padding: 10px; }
  .preview { min-height: 230px; }
  .file-actions { flex-direction: column; }
  .file-actions .button { width: 100%; }
  .file-list-item { align-items: flex-start; flex-wrap: wrap; }
  .file-list-item .item-actions { width: 100%; }
  .file-list-item .item-actions .button { flex: 1; }
  .success-actions { grid-template-columns: 1fr; }
  .custom-audio { grid-template-columns: 1fr; gap: 20px; text-align: center; }
  .audio-art { width: 116px; height: 116px; margin: 0 auto; border-radius: 22px; }
  .audio-controls { grid-template-columns: 46px minmax(100px, 1fr) 36px; }
  .volume-range { display: none; }
  .player-toggle { width: 46px; height: 46px; }
  .custom-video, .custom-video video { min-height: 220px; }
  .video-controls { width: calc(100% - 16px); min-height: 52px; left: 8px; bottom: 8px; padding: 7px; grid-template-columns: 36px minmax(70px, 1fr) auto 34px 34px; gap: 7px; border-radius: 13px; }
  .video-volume-range { display: none; }
  .video-toggle, .video-volume, .video-fullscreen { width: 34px; height: 34px; }
  .video-time { font-size: 9px; }
  .video-overlay-play { width: 64px; height: 64px; border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
