:root {
  --bg: #0a0b10;
  --bg-2: #10121a;
  --panel: rgba(22, 25, 36, .72);
  --panel-solid: #161924;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #e9e8f0;
  --muted: #9a9cb0;
  --faint: #6b6e84;
  --accent: #7cf0d0;
  --accent-2: #9b8cff;
  --danger: #ff6b81;
  --warn: #ffc46b;
  --radius: 16px;
  --radius-sm: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  padding: 0 max(20px, env(safe-area-inset-left)) env(safe-area-inset-bottom);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Background glow ---------- */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg span {
  position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%;
  filter: blur(90px); opacity: .22;
}
.bg span:nth-child(1) { background: radial-gradient(circle, var(--accent-2), transparent 62%); top: -35vmax; left: -15vmax; animation: float1 40s ease-in-out infinite alternate; }
.bg span:nth-child(2) { background: radial-gradient(circle, #1fb5a0, transparent 62%); top: -30vmax; right: -25vmax; animation: float2 50s ease-in-out infinite alternate; }
@keyframes float1 { to { transform: translate(12vmax, 8vmax); } }
@keyframes float2 { to { transform: translate(-10vmax, 10vmax); } }

/* ---------- Header ---------- */
.site-header {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(18px, env(safe-area-inset-top)) 0 18px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; color: var(--text); }
.site-nav { display: flex; gap: 22px; }
.site-nav a { color: var(--muted); font-size: 14px; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
@media (max-width: 640px) { .site-nav { display: none; } }

main { max-width: 1120px; margin: 0 auto; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 48px 0 24px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 18px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255,255,255,.03);
  font-size: 13px; color: var(--muted);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
h1 {
  font-size: clamp(2.3rem, 6vw, 4.2rem); line-height: 1.04; letter-spacing: -.035em;
  margin: 0 0 18px; font-weight: 750;
}
.grad {
  background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { max-width: 640px; margin: 0 auto 40px; color: var(--muted); font-size: clamp(1rem, 2vw, 1.15rem); }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  padding: 11px 16px; border-radius: 10px; color: var(--text);
  transition: transform .15s ease, background .15s ease, border-color .15s ease, opacity .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-lg { font-size: 17px; padding: 16px 28px; border-radius: 12px; }
.btn-primary {
  color: #071512;
  background: linear-gradient(100deg, var(--accent), #a6f7e2);
  box-shadow: 0 8px 30px -8px rgba(124, 240, 208, .55);
}
.btn-primary:hover { text-decoration: none; filter: brightness(1.06); }
.btn-ghost { background: rgba(255,255,255,.04); border-color: var(--line-2); }
.btn-ghost:hover { background: rgba(255,255,255,.08); }
.btn-move { background: rgba(255, 196, 107, .14); border-color: rgba(255, 196, 107, .45); color: #ffd89b; }
.btn-move:hover:not(:disabled) { background: rgba(255, 196, 107, .24); }
.moved-panel {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 10px 0 14px; padding: 16px 18px; border-radius: 14px;
  border: 1px solid rgba(124,240,208,.35); background: rgba(124,240,208,.07);
}
.mp-text { flex: 1 1 320px; min-width: 0; }
.mp-text p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.mp-text code, .dialog code { font-family: var(--mono); font-size: .9em; background: rgba(255,255,255,.07); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.dialog-points { margin: 0 0 16px; padding-left: 1.2em; color: var(--muted); font-size: 15px; }
.dialog-points li { margin: 6px 0; }
.dialog-points strong { color: var(--text); }
.dialog .dialog-small { font-size: 13px; color: var(--faint); margin-bottom: 20px; }
.btn-danger { background: rgba(255, 107, 129, .14); border-color: rgba(255, 107, 129, .45); color: #ffb3bf; }
.btn-danger:hover:not(:disabled) { background: rgba(255, 107, 129, .24); }

/* ---------- App panels ---------- */
.app { text-align: left; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.7);
}
.dropzone {
  max-width: 680px; margin: 0 auto; padding: 44px 28px 28px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  border: 1.5px dashed var(--line-2);
  transition: border-color .2s, background .2s;
}
.dropzone.dragover { border-color: var(--accent); background: rgba(124, 240, 208, .06); }
.dz-icon { width: 56px; height: 56px; color: var(--muted); margin-bottom: 18px; }
.dz-hint { color: var(--faint); font-size: 14px; margin: 12px 0 20px; }
.options { width: 100%; max-width: 440px; font-size: 14px; color: var(--muted); text-align: left; }
.options summary { cursor: pointer; text-align: center; color: var(--faint); list-style: none; }
.options summary::-webkit-details-marker { display: none; }
.options summary::after { content: " ▾"; }
.options[open] summary::after { content: " ▴"; }
.options label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.options small { color: var(--faint); }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
select, input[type="search"] {
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 9px 12px;
}
input[type="search"] { min-width: 0; }
.privacy-note { display: flex; align-items: center; gap: 8px; margin: 20px 0 0; font-size: 13px; color: var(--accent); }
.privacy-note svg { width: 18px; height: 18px; }

/* ---------- Scanning ---------- */
.scanning { max-width: 680px; margin: 0 auto; padding: 40px 28px 28px; text-align: center; }
.scan-ring {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%;
  border: 3px solid var(--line-2); border-top-color: var(--accent); border-right-color: var(--accent-2);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.scan-title { margin: 0 0 4px; font-size: 22px; letter-spacing: -.01em; }
.scan-detail {
  margin: 0 0 22px; color: var(--muted); font-size: 13px; font-family: var(--mono);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.progress { height: 8px; border-radius: 99px; background: rgba(255,255,255,.06); overflow: hidden; }
.progress-bar {
  height: 100%; width: 0%; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .25s ease;
}
.progress.indeterminate .progress-bar { width: 30% !important; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.phases { list-style: none; padding: 0; margin: 22px 0; display: flex; justify-content: center; gap: 8px 22px; flex-wrap: wrap; font-size: 13px; color: var(--faint); }
.phases li::before { content: "○ "; }
.phases li.active { color: var(--text); }
.phases li.active::before { content: "◉ "; color: var(--accent); }
.phases li.done { color: var(--muted); }
.phases li.done::before { content: "✓ "; color: var(--accent); }

/* ---------- Results ---------- */
.results-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 18px 20px; scroll-margin-top: 16px;
  background: linear-gradient(135deg, rgba(124,240,208,.07), rgba(155,140,255,.07));
  border: 1px solid var(--line-2); border-radius: var(--radius);
}
.rh-text { min-width: 0; }
.rh-label { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.rh-title { margin: 2px 0 0; font-size: 22px; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results-head .btn svg { width: 18px; height: 18px; }
.results-foot { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; margin-top: 28px; }
@media (max-width: 520px) { .results-head .btn { width: 100%; } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-v { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-l { color: var(--muted); font-size: 13px; margin-top: 4px; }
.stat.hl .stat-v { background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin-bottom: 10px; }
.tb-left, .tb-right { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-left { flex: 1 1 420px; }
.tb-left input[type="search"] { flex: 1 1 200px; }

.selectbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 12px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02);
  font-size: 14px;
}
.sb-label { color: var(--muted); }
.sb-spacer { flex: 1; }
.sb-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.sb-note { font-size: 13px; color: var(--faint); margin: 4px 2px 12px; }
.chip {
  font: inherit; font-size: 13px; cursor: pointer; color: var(--text);
  background: rgba(124, 240, 208, .08); border: 1px solid rgba(124, 240, 208, .3);
  padding: 5px 11px; border-radius: 999px;
}
.chip:hover { background: rgba(124, 240, 208, .16); }
.chip-quiet { background: transparent; border-color: var(--line-2); color: var(--muted); }

.groups { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.group { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.group-head {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.thumb {
  flex: none; width: 52px; height: 52px; border-radius: 10px; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line);
  display: grid; place-items: center;
  font: 700 10px/1 var(--mono); color: var(--muted); letter-spacing: .04em; text-transform: uppercase;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb[data-kind="image"] { color: #ffc46b; }
.thumb[data-kind="video"] { color: #ff8fab; }
.thumb[data-kind="audio"] { color: #9b8cff; }
.thumb[data-kind="document"] { color: #7cc8ff; }
.thumb[data-kind="archive"] { color: #ffd36b; }
.thumb[data-kind="code"] { color: #7cf0d0; }
.gh-main { min-width: 0; flex: 1; }
.gh-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gh-meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.gh-waste { flex: none; text-align: right; }
.gh-waste b { display: block; font-size: 17px; color: var(--warn); font-variant-numeric: tabular-nums; }
.gh-waste span { font-size: 12px; color: var(--faint); }

.files { list-style: none; margin: 0; padding: 4px 0; }
.file {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  padding: 8px 16px; font-size: 14px;
}
.file + .file { border-top: 1px solid rgba(255,255,255,.04); }
.file.marked { background: rgba(255, 107, 129, .06); }
.file.marked .f-path { color: #ffb3bf; text-decoration: line-through; text-decoration-color: rgba(255, 107, 129, .5); }
.file.deleted { opacity: .45; }
.file.deleted .f-path { text-decoration: line-through; }
.f-path { font-family: var(--mono); font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; }
.f-path bdi { direction: ltr; unicode-bidi: isolate; }
.f-date { color: var(--faint); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.f-actions { display: flex; gap: 6px; align-items: center; }
.f-tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.f-tag.keep { color: var(--accent); background: rgba(124, 240, 208, .1); }
.f-tag.del { color: #ffb3bf; background: rgba(255, 107, 129, .12); }
.f-tag.gone { color: var(--faint); background: rgba(255,255,255,.05); }
.copy {
  appearance: none; border: 0; background: none; color: var(--faint); cursor: pointer; padding: 4px;
  border-radius: 6px; font-size: 12px;
}
.copy:hover { color: var(--text); background: rgba(255,255,255,.06); }
@media (max-width: 640px) {
  .file { grid-template-columns: auto minmax(0, 1fr) auto; }
  .f-date { display: none; }
  .gh-waste span { display: none; }
}

.more { display: flex; margin: 18px auto 0; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h2 { color: var(--text); margin: 12px 0 6px; font-size: 24px; letter-spacing: -.02em; }
.empty .big { font-size: 44px; }

/* ---------- Content sections ---------- */
.section { padding: 88px 0 0; }
.section h2, .cta h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); letter-spacing: -.03em; line-height: 1.15; margin: 0 0 10px; text-align: center; }
.section-lede { text-align: center; color: var(--muted); margin: 0 auto 36px; max-width: 560px; }
.steps { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.steps li, .features article {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px;
}
.step-n {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  font-weight: 700; color: #071512; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  margin-bottom: 14px;
}
.steps h3, .features h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.01em; }
.steps p, .features p { margin: 0; color: var(--muted); font-size: 15px; }
.features { margin-top: 36px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.features h3::before { content: ""; display: block; width: 26px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); margin-bottom: 14px; }

.faq { max-width: 780px; margin: 36px auto 0; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 36px 18px 0; position: relative;
  font-weight: 600; font-size: 17px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-size: 24px; color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0 0 18px; color: var(--muted); }

.cta { text-align: center; margin: 96px 0 0; padding: 56px 24px; border-radius: 24px; border: 1px solid var(--line); background: linear-gradient(135deg, rgba(124,240,208,.08), rgba(155,140,255,.08)); }
.cta p { color: var(--muted); margin: 0 0 24px; }

.site-footer { max-width: 1120px; margin: 64px auto 0; padding: 28px 0 36px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-bottom: 14px; }
.footer-links a { color: var(--muted); }

/* ---------- Dialog ---------- */
.dialog {
  max-width: 440px; width: calc(100% - 32px);
  background: var(--panel-solid); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 18px; padding: 26px;
  box-shadow: 0 40px 120px -20px rgba(0,0,0,.9);
}
.dialog::backdrop { background: rgba(5, 6, 10, .7); backdrop-filter: blur(4px); }
.dialog h2 { margin: 0 0 8px; font-size: 21px; }
.dialog p { color: var(--muted); margin: 0 0 22px; font-size: 15px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 10px 16px; font-size: 14px; z-index: 10; box-shadow: 0 20px 50px -10px rgba(0,0,0,.8);
  animation: toastin .2s ease-out;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } }

.noscript { text-align: center; color: var(--warn); }

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

/* ---------- Guides / articles ---------- */
.site-nav a[aria-current="page"] { color: var(--text); }
.article-wrap { max-width: 760px; margin: 0 auto; padding: 24px 0 0; }
.breadcrumbs { font-size: 13px; color: var(--faint); margin-bottom: 18px; }
.breadcrumbs a { color: var(--muted); }
.article h1 { font-size: clamp(2rem, 5vw, 3rem); text-align: left; margin-bottom: 8px; }
.article-meta { color: var(--faint); font-size: 13px; margin: 0 0 24px; }
.article-lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 28px; }
.article h2 { font-size: 1.55rem; letter-spacing: -.02em; line-height: 1.25; margin: 44px 0 12px; scroll-margin-top: 20px; }
.article h3 { font-size: 1.12rem; margin: 26px 0 6px; }
.article p, .article li { color: #c9c8d4; }
.article li { margin: 6px 0; }
.article ol, .article ul { padding-left: 1.4em; }
.article strong { color: var(--text); }
.article code { font-family: var(--mono); font-size: .88em; background: rgba(255,255,255,.06); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.article pre { background: #07080c; border: 1px solid var(--line-2); border-radius: 12px; padding: 16px 18px; overflow-x: auto; }
.article pre code { background: none; border: 0; padding: 0; font-size: 13.5px; line-height: 1.6; color: #d7f8ee; overflow-wrap: normal; }
.article .note { border-left: 3px solid var(--warn); padding: 8px 14px; background: rgba(255,196,107,.06); border-radius: 0 10px 10px 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.article table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 520px; }
.article th, .article td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.article thead th { color: var(--text); background: rgba(255,255,255,.03); }
.article tbody th { color: var(--muted); font-weight: 600; }
.article tbody tr:last-child > * { border-bottom: 0; }
.tool-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin: 32px 0; padding: 22px 24px; border-radius: 18px; border: 1px solid var(--line-2);
  background: linear-gradient(135deg, rgba(124,240,208,.09), rgba(155,140,255,.09));
}
.tool-cta h2 { margin: 0 0 2px !important; font-size: 1.25rem !important; text-align: left; }
.tool-cta p { margin: 0; color: var(--muted); }
.article-wrap > .tool-cta { margin-top: 36px; }
.more-guides { margin-top: 64px; }
.more-guides h2 { font-size: 1.3rem; margin: 0 0 14px; }
.guide-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.guide-cards a {
  display: block; height: 100%; padding: 18px 20px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  transition: border-color .15s, transform .15s;
}
.guide-cards a:hover { text-decoration: none; border-color: rgba(124,240,208,.45); transform: translateY(-2px); }
.guide-cards strong { display: block; margin-bottom: 4px; }
.guide-cards span { color: var(--muted); font-size: 14px; }
.guide-cards-lg { margin-top: 8px; }
.article kbd { font-family: var(--mono); font-size: .82em; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: rgba(255,255,255,.05); color: var(--text); }

/* ---------- Mode switch ---------- */
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 480px; margin: 0 0 20px; text-align: left; }
.mode-switch label { cursor: pointer; }
.mode-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mode-switch span {
  display: block; height: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: rgba(255,255,255,.02);
  transition: border-color .15s, background .15s;
}
.mode-switch b { display: block; font-size: 15px; }
.mode-switch small { display: block; color: var(--faint); font-size: 12.5px; line-height: 1.35; margin-top: 2px; }
.mode-switch input:checked + span { border-color: var(--accent); background: rgba(124,240,208,.08); box-shadow: inset 0 0 0 1px var(--accent); }
.mode-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 420px) { .mode-switch { grid-template-columns: 1fr; } }
.rh-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 520px) { .rh-actions { width: 100%; } .rh-actions .btn { flex: 1 1 100%; } }

/* ---------- Similar photo cards ---------- */
.sim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; padding: 14px 16px 16px; }
.sim-card { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg-2); transition: border-color .15s; }
.sim-card.marked { border-color: rgba(255,107,129,.55); }
.sim-card.marked .sim-thumb { opacity: .55; }
.sim-card.deleted { opacity: .4; }
.sim-thumb {
  display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; cursor: zoom-in;
  background: #07080c; overflow: hidden;
}
.sim-thumb img { width: 100%; height: 100%; object-fit: contain; }
.sim-check {
  position: absolute; top: 8px; left: 8px; z-index: 1; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px; background: rgba(10,11,16,.75); backdrop-filter: blur(4px); cursor: pointer;
}
.sim-info { padding: 10px 12px 12px; min-width: 0; }
.sim-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 8px; }
.sim-match { font-size: 11.5px; color: var(--accent-2); }
.sim-match.ref { color: var(--faint); }
@media (max-width: 420px) { .sim-grid { grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; } }

/* ---------- Lightbox ---------- */
.lightbox {
  max-width: min(1200px, 96vw); max-height: 94vh; width: auto; padding: 0; border: 0; background: transparent; color: var(--text); overflow: visible;
}
.lightbox::backdrop { background: rgba(4,5,8,.88); backdrop-filter: blur(6px); }
.lightbox img { display: block; max-width: min(1200px, 96vw); max-height: 84vh; width: auto; height: auto; margin: 0 auto; border-radius: 10px; box-shadow: 0 30px 90px -20px #000; }
.lb-cap { margin: 10px 0 0; text-align: center; font: 13px/1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.lb-close {
  position: fixed; top: calc(14px + env(safe-area-inset-top)); right: 16px; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line-2); background: rgba(22,25,36,.9); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer;
}

/* ---------- Unsupported browser notice ---------- */
.browser-warn {
  width: 100%; max-width: 520px; margin: 0 0 18px; padding: 16px 18px; text-align: left;
  border: 1px solid rgba(255,196,107,.45); background: rgba(255,196,107,.08); border-radius: 14px;
}
.browser-warn h3 { margin: 0 0 6px; font-size: 16px; color: #ffd89b; }
.browser-warn p { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.bw-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.bw-tip { margin: 10px 0 0 !important; font-size: 13px !important; }
.bw-tip code { font-family: var(--mono); font-size: 12px; background: rgba(255,255,255,.07); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }

/* ---------- Opt-in permanent delete ---------- */
.link-btn { appearance: none; background: none; border: 0; padding: 4px 2px; font: inherit; font-size: 13px; color: var(--faint); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--muted); }
.expert-row { margin: -4px 2px 10px; }
.expert-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between;
  margin: 4px 0 12px; padding: 12px 16px; border-radius: 12px; font-size: 14px;
  border: 1px solid rgba(255,107,129,.5); background: rgba(255,107,129,.09); color: #ffd0d7;
}
.expert-banner strong { color: #ffb3bf; }
.dialog-danger { border-color: rgba(255,107,129,.45); }
.dialog-danger h2 { color: #ffc2cb; }
.ack { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 14.5px; color: var(--muted); cursor: pointer; }
.ack input { margin-top: 3px; flex: none; accent-color: var(--danger); }
.ack strong { color: var(--text); }
.pd-warn { color: #ffd89b !important; background: rgba(255,196,107,.08); border: 1px solid rgba(255,196,107,.3); padding: 10px 12px; border-radius: 10px; }
.pd-list { list-style: none; margin: 0 0 16px; padding: 10px 12px; max-height: 160px; overflow: auto; background: #07080c; border: 1px solid var(--line); border-radius: 10px; font: 12.5px/1.6 var(--mono); color: var(--muted); }
.pd-list li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-type { display: block; font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.pd-type strong { color: var(--text); font-family: var(--mono); }
.pd-type input { display: block; width: 100%; margin-top: 8px; font: 16px var(--mono); color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; }
.pd-type input:focus { border-color: var(--danger); outline: none; }
