/* Telegram Files - dark-first, soft-glass UI with a violet/cyan accent */
:root {
  color-scheme: dark light;
  --bg: #0a0a12;
  --surface: #131320;
  --surface-2: #1a1a2b;
  --glass: rgba(19, 19, 32, .62);
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #f1f1f8;
  --muted: #a3a3bd;
  --faint: #7e7e9a;
  --accent: #8b6cff;
  --accent-2: #22d3ee;
  --accent-text: #b5a2ff;
  --on-accent: #fff;
  --grad: linear-gradient(135deg, #7c5cff 0%, #5b6cff 50%, #22b8e8 100%);
  --danger: #ff7a8a;
  --danger-bg: rgba(255, 90, 110, .1);
  --ok: #4ade80;
  --ok-bg: rgba(74, 222, 128, .1);
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .75);
  --glow-1: rgba(124, 92, 255, .28);
  --glow-2: rgba(34, 211, 238, .16);
  --ring: #a99bff;
  --k-pdf: #ff6b6b; --k-pdf-bg: rgba(255, 90, 90, .15);
  --k-doc: #5aa0ff; --k-doc-bg: rgba(70, 140, 255, .16);
  --k-xls: #3ddc84; --k-xls-bg: rgba(50, 210, 120, .14);
  --k-ppt: #ff9f43; --k-ppt-bg: rgba(255, 150, 50, .15);
  --k-img: #c084fc; --k-img-bg: rgba(180, 110, 255, .16);
  --k-txt: #aab0c4; --k-txt-bg: rgba(160, 170, 195, .13);
  --r-sm: 10px; --r: 14px; --r-lg: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f5fc;
    --surface: #ffffff;
    --surface-2: #f0eefa;
    --glass: rgba(255, 255, 255, .72);
    --border: rgba(30, 20, 80, .09);
    --border-strong: rgba(30, 20, 80, .2);
    --text: #15132b;
    --muted: #55536e;
    --faint: #6b6987;
    --accent: #6c47ff;
    --accent-2: #0891b2;
    --accent-text: #5b36e8;
    --grad: linear-gradient(135deg, #6c47ff 0%, #4f5bf0 55%, #0e9fd0 100%);
    --danger: #c4243c;
    --danger-bg: rgba(220, 40, 70, .08);
    --ok: #12804a;
    --ok-bg: rgba(20, 150, 80, .1);
    --shadow: 0 10px 30px -12px rgba(50, 30, 140, .22);
    --shadow-lg: 0 30px 80px -20px rgba(50, 30, 140, .35);
    --glow-1: rgba(108, 71, 255, .16);
    --glow-2: rgba(14, 159, 208, .13);
    --ring: #5b36e8;
    --k-pdf: #d12f2f; --k-pdf-bg: rgba(220, 50, 50, .1);
    --k-doc: #1f63d6; --k-doc-bg: rgba(40, 110, 230, .1);
    --k-xls: #14803f; --k-xls-bg: rgba(20, 150, 70, .11);
    --k-ppt: #c2570c; --k-ppt-bg: rgba(240, 120, 20, .12);
    --k-img: #8a38d6; --k-img-bg: rgba(140, 60, 220, .1);
    --k-txt: #565c72; --k-txt-bg: rgba(90, 100, 130, .11);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent-text); }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--surface); padding: 10px 16px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); }
.skip:focus { top: 12px; }
.ic { width: 20px; height: 20px; flex: none; }
.ic-lg { width: 30px; height: 30px; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* background glow */
.glow { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 20% -5%, var(--glow-1), transparent 70%),
    radial-gradient(45% 40% at 90% 5%, var(--glow-2), transparent 70%); }

/* header */
.top { position: sticky; top: 0; z-index: 30; background: var(--glass); border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 1.05rem; letter-spacing: -.01em; border-radius: var(--r-sm); }
.brand img { border-radius: 9px; box-shadow: 0 4px 14px -4px var(--glow-1); }
.brand b { font-weight: 800; margin-left: 3px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.actions { display: flex; gap: 10px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 0 20px;
  border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: .94rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .18s var(--ease), box-shadow .2s var(--ease), background-color .2s, border-color .2s, opacity .2s, filter .2s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--grad); color: var(--on-accent); box-shadow: 0 8px 22px -8px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 12px 28px -8px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(.97); }
.btn-danger { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 16%, transparent); border-color: var(--danger); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); background: var(--surface-2); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: background-color .2s, color .2s, transform .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.92); }

/* hero */
.hero { padding-top: clamp(40px, 8vw, 84px); padding-bottom: 20px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero h1 { margin-top: 22px; font-size: clamp(2.2rem, 6.4vw, 4rem); line-height: 1.06; font-weight: 800; letter-spacing: -.035em; text-wrap: balance; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .08em; }
.sub { margin-top: 18px; max-width: 540px; font-size: clamp(1rem, 2.4vw, 1.15rem); color: var(--muted); text-wrap: balance; }

.hero-drop { position: relative; margin-top: 34px; width: 100%; max-width: 680px; display: flex; align-items: center; gap: 20px; text-align: left; padding: 28px 30px;
  border-radius: var(--r-lg); cursor: pointer; background: var(--glass); border: 1.5px dashed var(--border-strong); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform .25s var(--ease), border-color .2s, background-color .2s, box-shadow .25s; }
.hero-drop:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow), 0 0 0 6px color-mix(in srgb, var(--accent) 10%, transparent); }
.hero-drop:active { transform: scale(.992); }
.hero-drop.over { border-style: solid; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); transform: scale(1.02); box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 16%, transparent), var(--shadow-lg); }
.hd-icon { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; color: #fff; background: var(--grad); box-shadow: 0 10px 24px -8px var(--accent); transition: transform .3s var(--ease); }
.hero-drop:hover .hd-icon, .hero-drop.over .hd-icon { transform: translateY(-3px) scale(1.05); }
.hd-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hd-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; }
.hd-sub { color: var(--muted); font-size: .95rem; }
.hd-sub u { text-decoration-color: var(--accent); text-underline-offset: 3px; color: var(--text); }
.when-over { display: none; }
.hero-drop.over .when-over { display: inline; }
.hero-drop.over .when-idle { display: none; }

.trust { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; color: var(--muted); font-size: .88rem; }
.trust li { display: inline-flex; align-items: center; gap: 8px; }
.trust .ic { width: 17px; height: 17px; color: var(--accent-text); }
.trust .trust-priv { padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); }
.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.stats[hidden] { display: none; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: .85rem; }
.chip b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

/* files */
.files { padding-top: 38px; padding-bottom: 20px; }
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.tb-title h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.025em; }
.count { min-height: 1.4em; font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.search { position: relative; flex: 1 1 280px; max-width: 400px; }
.search .ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; transition: color .2s; }
.search input { width: 100%; min-height: 48px; padding: 0 16px 0 44px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); outline: 0; transition: border-color .2s, box-shadow .2s; }
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.search:focus-within .ic { color: var(--accent-text); }

#rows { display: flex; flex-direction: column; gap: 10px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) 84px 100px 44px; align-items: center; gap: 8px 16px; padding: 10px 12px 10px 10px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border); position: relative;
  transition: transform .2s var(--ease), border-color .2s, background-color .2s, box-shadow .25s; animation: rise .4s var(--ease) both; }
.row:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); box-shadow: var(--shadow); transform: translateY(-1px); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.row .main { display: flex; align-items: center; gap: 14px; min-width: 0; text-align: left; min-height: 52px; padding: 0; background: none; border: 0; cursor: pointer; border-radius: 10px; }
.row .main::after { content: ''; position: absolute; inset: 0; border-radius: var(--r); } /* whole-row hit area */
.row .main:focus-visible { outline: none; }
.row .main:focus-visible::after { outline: 2px solid var(--ring); outline-offset: 2px; }
.nm { min-width: 0; display: flex; flex-direction: column; }
.fname { display: flex; min-width: 0; font-weight: 600; font-size: .98rem; }
.fname .base { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fname .ext { flex: none; color: var(--faint); font-weight: 500; }
.sub { }
.row .sub { display: none; font-size: .82rem; color: var(--muted); font-weight: 400; margin-top: 1px; max-width: none; text-align: left; }
.c-size, .c-time { font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-size { text-align: right; }
.dl { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid transparent; transition: background-color .2s, color .2s, transform .15s, box-shadow .2s; }
.dl:hover { background: var(--grad); color: #fff; box-shadow: 0 8px 18px -6px var(--accent); transform: translateY(-1px); }
.dl:active { transform: scale(.92); }

.badge { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; font-size: .68rem; font-weight: 800; letter-spacing: .04em; color: var(--k-txt); background: var(--k-txt-bg); border: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.badge.lg { width: 56px; height: 56px; border-radius: 15px; font-size: .78rem; }
.k-pdf { color: var(--k-pdf); background: var(--k-pdf-bg); }
.k-doc { color: var(--k-doc); background: var(--k-doc-bg); }
.k-xls { color: var(--k-xls); background: var(--k-xls-bg); }
.k-ppt { color: var(--k-ppt); background: var(--k-ppt-bg); }
.k-img { color: var(--k-img); background: var(--k-img-bg); }
.k-txt { color: var(--k-txt); background: var(--k-txt-bg); }

/* skeleton */
.sk { background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 55%, var(--text) 9%) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-row { animation: none; }
.sk-row:hover { transform: none; box-shadow: none; border-color: var(--border); background: var(--surface); }
.sk-row .badge { border-color: transparent; }
.sk-line { height: 14px; } .sk-line.sm { height: 11px; margin-top: 8px; }
.sk-row .nm { gap: 0; width: 100%; }
.sk-row .c-size { height: 14px; width: 54px; justify-self: end; }
.sk-row .c-time { height: 14px; width: 70px; }
.sk-dl { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); }

/* states */
.state { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 44px 20px; color: var(--muted); border-radius: var(--r-lg); border: 1px dashed var(--border-strong); background: var(--glass); }
.state[hidden] { display: none; }
.state strong { color: var(--text); font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.state span { max-width: 380px; }
.state .btn { margin-top: 12px; }
.state .ill { margin-bottom: 6px; }
.state.error { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: var(--danger-bg); }
.state.error strong { color: var(--danger); }
.more { display: flex; justify-content: center; margin-top: 18px; }
.more[hidden] { display: none; }
.foot { padding-top: 24px; padding-bottom: 48px; text-align: center; color: var(--faint); font-size: .82rem; }
.foot p { max-width: 560px; margin: 0 auto; border-top: 1px solid var(--border); padding-top: 22px; }

/* dialogs */
dialog { color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); padding: 0; box-shadow: var(--shadow-lg); overflow: auto; }
dialog::backdrop { background: rgba(5, 5, 14, .6); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: fade .25s ease both; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(500px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border-radius: 22px; margin: auto; animation: pop .3s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(460px, 100vw); height: 100dvh; max-height: none; border-radius: 22px 0 0 22px; border-width: 0 0 0 1px; animation: slide .35s var(--ease) both; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.dlg-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.dlg-head h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; }
.dlg-body { padding: 22px 24px 26px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.lead { color: var(--muted); font-size: .94rem; margin-bottom: 20px; }

.field { margin-top: 16px; }
.field label { display: block; margin-bottom: 7px; font-size: .88rem; font-weight: 600; }
.field input, .field select, .copyrow input { width: 100%; min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--bg); outline: 0; transition: border-color .2s, box-shadow .2s; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8aa8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.field input:focus, .field select:focus, .copyrow input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.field input::placeholder { color: var(--faint); }
.hint { margin-top: 7px; font-size: .8rem; color: var(--faint); line-height: 1.45; }
.err, .ok { display: flex; align-items: flex-start; gap: 9px; margin-top: 16px; padding: 12px 14px; border-radius: 12px; font-size: .9rem; font-weight: 500; }
.err[hidden], .ok[hidden], .done[hidden], .progress[hidden], .chosen[hidden] { display: none; }
.err { color: var(--danger); background: var(--danger-bg); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.ok { color: var(--ok); background: var(--ok-bg); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.done .ok { margin-top: 0; background: none; border: 0; padding: 0 0 10px; }

.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 26px 18px; border-radius: var(--r); border: 1.5px dashed var(--border-strong); background: var(--bg); transition: border-color .2s, background-color .2s, transform .2s var(--ease); }
.drop .ic-lg { color: var(--accent-text); }
.drop p { margin: 0; }
.drop .btn { margin-top: 6px; }
.drop.over { border-style: solid; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg)); transform: scale(1.02); }
.chosen { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); font-size: .9rem; font-weight: 500; overflow-wrap: anywhere; }
.progress { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.bar { flex: 1; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width .2s linear; }
#u-pct { min-width: 3.2ch; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .9rem; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; min-width: 0; font-size: .85rem; }
.copyrow .btn { padding: 0 14px; }

/* visibility segmented control */
.vis { margin-top: 18px; }
.vis legend { padding: 0; margin-bottom: 8px; font-size: .88rem; font-weight: 600; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg-opt { position: relative; display: block; cursor: pointer; }
.seg-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.seg-in { display: flex; flex-direction: column; gap: 6px; height: 100%; min-height: 44px; padding: 12px 14px; border-radius: var(--r); border: 1.5px solid var(--border-strong); background: var(--bg);
  transition: border-color .2s, background-color .2s, box-shadow .2s, transform .15s var(--ease); }
.seg-top { display: flex; align-items: center; gap: 8px; font-size: .96rem; }
.seg-top .ic { color: var(--faint); transition: color .2s; }
.seg-in small { font-size: .78rem; line-height: 1.4; color: var(--muted); }
.seg-opt:hover .seg-in { border-color: color-mix(in srgb, var(--accent) 55%, var(--border-strong)); }
.seg-opt input:checked + .seg-in { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.seg-opt input:checked + .seg-in .seg-top .ic { color: var(--accent-text); }
.seg-opt input:checked + .seg-in .seg-top::after { content: ''; margin-left: auto; width: 18px; height: 18px; border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat, var(--grad); }
.seg-opt input:focus-visible + .seg-in { outline: 2px solid var(--ring); outline-offset: 2px; }

/* upload success */
.done-card { padding: 18px; border-radius: var(--r-lg); border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--border)); background: var(--ok-bg); }
.done-card.priv { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent); }
.done-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.done-ic { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: #fff; background: var(--grad); box-shadow: 0 8px 20px -8px var(--accent); }
.done-card:not(.priv) .done-ic { background: linear-gradient(135deg, #16a34a, #22b8a0); box-shadow: 0 8px 20px -8px #16a34a; }
.done-ic .ic { width: 24px; height: 24px; }
.done-t { min-width: 0; }
.done-t h3 { font-size: 1.12rem; font-weight: 800; letter-spacing: -.02em; outline: 0; }
.done-name { font-size: .86rem; color: var(--muted); overflow-wrap: anywhere; }
.done-card .copyrow input { background: var(--bg); font-size: .8rem; }
.done-card .copyrow .btn { min-width: 104px; }
.warn, .timer, .note { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; font-size: .88rem; line-height: 1.45; }
.warn { padding: 11px 13px; border-radius: 12px; font-weight: 600; color: var(--text); background: color-mix(in srgb, #f59e0b 16%, transparent); border: 1px solid color-mix(in srgb, #f59e0b 45%, transparent); }
.warn .ic { width: 18px; height: 18px; margin-top: 2px; color: #d97706; }
.warn.copied { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.warn.copied .ic { color: var(--ok); }
.timer { align-items: center; color: var(--muted); font-weight: 600; }
.timer .ic { width: 17px; height: 17px; color: var(--accent-text); }
.timer span { font-variant-numeric: tabular-nums; color: var(--text); }
.timer.low span { color: var(--danger); }
.note { color: var(--muted); }
.d-more { margin-top: 14px; font-size: .92rem; }
.confirm { margin-top: 16px; padding: 14px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); background: var(--danger-bg); font-size: .92rem; }
.confirm-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.confirm-btns .btn { flex: 1 1 130px; }
.done[hidden], #u-fields[hidden], .confirm[hidden], .note[hidden] { display: none; }

/* drawer content */
.d-hero { display: flex; align-items: center; gap: 16px; }
.d-name { font-weight: 700; font-size: 1.08rem; line-height: 1.3; letter-spacing: -.015em; overflow-wrap: anywhere; }
.d-sub { margin-top: 2px; color: var(--muted); font-size: .88rem; }
.d-actions { margin: 20px 0 8px; }
.d-actions .btn { width: 100%; }
.meta { margin: 14px 0 0; }
.meta > div { padding: 13px 0; border-bottom: 1px solid var(--border); }
.meta > div:last-child { border-bottom: 0; }
.meta dt { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.meta dd { margin: 3px 0 0; font-size: .93rem; overflow-wrap: anywhere; }
.meta .copyrow { margin-top: 6px; }
.meta .hint { margin-top: 6px; }
.d-actions .btn[aria-busy="true"], .dl[aria-busy="true"] { opacity: .6; pointer-events: none; }

/* toast */
.toast { position: fixed; inset: auto auto max(24px, env(safe-area-inset-bottom)) 50%; margin: 0; overflow: visible; z-index: 200; display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: .92rem; box-shadow: var(--shadow-lg);
  transform: translate(-50%, 24px); opacity: 0; visibility: hidden; pointer-events: none; transition: transform .35s var(--ease), opacity .25s, visibility .25s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.toast .ic { color: #16a34a; }
.toast.error .ic { color: #dc2626; }

/* responsive */
@media (max-width: 760px) {
  .row { grid-template-columns: minmax(0, 1fr) 44px; padding: 10px; }
  .row .c-size, .row .c-time { display: none; }
  .row .sub { display: block; }
  .sk-row .c-size, .sk-row .c-time { display: none; }
  .row .dl { grid-column: 2; grid-row: 1; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .top-in { min-height: 62px; }
  .brand span { font-size: 1rem; }
  .actions { gap: 8px; }
  .actions .btn { padding: 0 14px; }
  #donate-open span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #donate-open { padding: 0; width: 44px; }
  .hero-drop { flex-direction: column; text-align: center; padding: 26px 18px; gap: 14px; }
  .hd-text { align-items: center; }
  .search { max-width: none; flex-basis: 100%; }
  .modal { width: 100vw; max-width: none; margin: auto 0 0; max-height: 92dvh; border-radius: 22px 22px 0 0; border-width: 1px 0 0; animation: sheet .35s var(--ease) both; }
  @keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
  .drawer { width: 100vw; border-radius: 0; border-width: 0; }
  .dlg-body { padding: 18px 18px 24px; }
  .dlg-head { padding-left: 18px; }
  .dlg-foot .btn { flex: 1; }
  .seg { grid-template-columns: 1fr; }
  .seg-in { padding: 12px 14px; }
}
@media (max-width: 380px) {
  .brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .row:hover, .hero-drop:hover, .btn-primary:hover:not(:disabled), .dl:hover { transform: none; }
}
[hidden] { display: none !important; }
