:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, .08);
  --field: #f5f5f7;
  --accent: #1f8fb8;
  --accent-soft: rgba(31, 143, 184, .12);
  --ok: #1f9d55;
  --ok-soft: rgba(52, 199, 89, .14);
  --bad: #d70015;
  --bad-soft: rgba(255, 59, 48, .12);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 28px rgba(0, 0, 0, .06);
  --radius: 22px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --card: #1c1c1e;
    --fg: #f5f5f7;
    --muted: #a1a1a6;
    --line: rgba(255, 255, 255, .1);
    --field: #2c2c2e;
    --accent: #4cc2e6;
    --accent-soft: rgba(76, 194, 230, .16);
    --ok: #30d158;
    --ok-soft: rgba(48, 209, 88, .16);
    --bad: #ff6961;
    --bad-soft: rgba(255, 105, 97, .16);
    --shadow: 0 0 0 1px rgba(255, 255, 255, .06);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3 { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif; margin: 0; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 14px; }

.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.nav-inner { max-width: 820px; margin: 0 auto; padding: 0 16px; height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.brand img { border-radius: 6px; }
.nav-note { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.nav-note svg { width: 15px; height: 15px; }
.nav-note { margin-left: auto; }
.lang-toggle { appearance: none; flex: none; font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; cursor: pointer; }
.lang-toggle:hover { color: var(--fg); background: var(--field); }
.lang-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

main { max-width: 820px; margin: 0 auto; padding: 0 16px; display: grid; gap: 20px; }

.hero { text-align: center; padding: 56px 0 20px; }
.hero h1 { font-size: clamp(36px, 6.4vw, 56px); line-height: 1.06; letter-spacing: -.028em; font-weight: 700; }
.hero p { max-width: 600px; margin: 18px auto 0; font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); letter-spacing: -.01em; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.step { padding: 24px; display: grid; gap: 20px; min-width: 0; }
.step-head { display: flex; gap: 14px; align-items: flex-start; }
.step-head h2 { font-size: 21px; letter-spacing: -.015em; }
.num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; font-size: 15px; }

.btn { appearance: none; border: 0; border-radius: 99px; padding: 11px 22px; font: inherit; font-size: 16px; font-weight: 500; cursor: pointer; background: var(--field); color: var(--fg); display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn svg { width: 19px; height: 19px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn:disabled { opacity: .4; cursor: default; }
.btn:not(:disabled):hover { filter: brightness(1.06); }

.pick, .actions { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }

.folder-name { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
details { font-size: 14px; color: var(--muted); }
details summary { cursor: pointer; }
details ul { margin: 6px 0 0; padding-left: 18px; max-height: 220px; overflow: auto; }
details li { overflow-wrap: anywhere; }

.field { display: grid; gap: 8px; min-width: 0; }
.field label { font-size: 14px; font-weight: 600; }
select, input[type=number] { font: inherit; font-size: 16px; color: var(--fg); background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; min-width: 0; }
select:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }


input[type=checkbox] { accent-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; cursor: pointer; font-size: 15px; }
.check input { width: 18px; height: 18px; margin: 0; flex: none; }

.tips { padding: 8px 4px 0; color: var(--muted); font-size: 15px; }
.tips h3 { font-size: 17px; color: var(--fg); margin-bottom: 8px; }
.tips ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* Back to the HT Labs home page (wired by i18n.js) */
.home-link { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px 5px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1; letter-spacing: 0; white-space: nowrap; text-decoration: none; }
.home-link:hover { color: var(--fg); border-color: currentColor; text-decoration: none; }
.home-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.home-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 480px) { .home-link span { display: none; } .home-link { padding: 5px 7px; } .nav-note { display: none; } }

/* Duplicate Finder */
.btn.danger { background: var(--bad); color: #fff; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; align-items: end; }
.field-check { padding-bottom: 11px; }
@media (max-width: 700px) { .grid3 { grid-template-columns: minmax(0, 1fr); } .field-check { padding-bottom: 0; } }

.roots { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.roots li { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 14px; background: var(--field); border-radius: 12px; min-width: 0; }
.roots li svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.roots .r-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.roots .r-note { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.x-btn { appearance: none; border: 0; background: none; color: var(--muted); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; flex: none; }
.x-btn:hover { background: var(--card); color: var(--bad); }
.x-btn svg { width: 16px; height: 16px; }
.x-btn:disabled { visibility: hidden; }

.summary { display: grid; gap: 2px; }
.summary .big { overflow-wrap: anywhere; }
.tools { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: end; justify-content: space-between; }
.tools .field { flex: 1 1 260px; max-width: 380px; }
.tool-btns { display: flex; flex-wrap: wrap; gap: 10px; }

.groups { display: grid; gap: 12px; }
.group { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.g-head { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--field); }
.thumb { flex: none; width: 48px; height: 48px; border-radius: 9px; background: var(--card); display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb svg { width: 24px; height: 24px; }
.g-title { min-width: 0; display: grid; }
.g-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.g-title span { font-size: 13px; color: var(--muted); }
.g-files { list-style: none; margin: 0; padding: 0; }
.g-files li { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 14px; }
.g-files label { display: flex; gap: 10px; align-items: center; cursor: pointer; min-width: 0; flex: 1; }
.g-files input { width: 17px; height: 17px; margin: 0; flex: none; }
.path { min-width: 0; overflow-wrap: anywhere; }
.path .d { color: var(--muted); }
.f-date { flex: none; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.badge { flex: none; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); }
li.del .badge { background: var(--bad-soft); color: var(--bad); }
li.del .path { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.g-warn { margin: 0; padding: 8px 14px; font-size: 13px; background: rgba(255, 159, 10, .14); }
@media (max-width: 600px) { .g-files li { flex-wrap: wrap; } .f-date { margin-left: 27px; } }
.more { justify-self: center; }

.big { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.grad { background: linear-gradient(90deg, #3a8fe0, #1fb89a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.foot { text-align: center; padding: 32px 16px 48px; font-size: 13px; color: var(--muted); }
.foot p { margin: 0; }
.foot a { color: var(--accent); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.roots .x-btn { margin-left: auto; }
.roots .r-note + .x-btn { margin-left: 0; }
.bar { height: 8px; border-radius: 99px; background: var(--field); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
#progress { display: grid; gap: 8px; }
#progText { font-variant-numeric: tabular-nums; }
.notice { padding: 14px 16px; border-radius: 14px; font-size: 15px; overflow-wrap: anywhere; }
.notice.ok { background: var(--ok-soft); }
.notice.warn { background: rgba(255, 159, 10, .14); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
