/* Unfollows — one stylesheet, one accent, two themes. */

:root,
[data-theme="light"] {
    color-scheme: light;
    --bg: #f5f6f8;
    --surface: #ffffff;
    --ink: #14171c;
    --muted: #5d6676;
    --line: #e1e4ea;
    --accent: #d62976;
    --on-accent: #ffffff;
    --tint: #fdeef4;
    --danger: #b42318;
    --field: #ffffff;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0e1013;
    --surface: #16191e;
    --ink: #e8eaee;
    --muted: #9aa3b0;
    --line: #272c34;
    --accent: #ff5c9e;
    --on-accent: #ffffff;
    --tint: #33121f;
    --danger: #f28b82;
    --field: #0e1013;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font: 400 16px/1.5 'Hind', system-ui, -apple-system, sans-serif;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px calc(48px + env(safe-area-inset-bottom));
}

.i {
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Top bar ---------- */

.bar {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 60px;
    padding-top: env(safe-area-inset-top);
}

.bar h1 { flex: 1; padding-left: 6px; font-size: 18px; font-weight: 600; }

.icon-btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--ink);
    cursor: pointer;
}

.icon-btn:hover { background: var(--line); }

.ico-sun { display: none; }
[data-theme="dark"] .ico-sun { display: block; }
[data-theme="dark"] .ico-moon { display: none; }

/* ---------- Intro ---------- */

.lede {
    padding: 28px 0 8px;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.3;
    max-width: 14em;
}

.sub { margin-bottom: 28px; color: var(--muted); font-size: 15px; }

/* ---------- Upload ---------- */

.form { display: grid; gap: 12px; }

.drop {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.drop:hover,
.drop.over { border-color: var(--accent); }
.drop.over { background: var(--tint); }

.drop input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.drop:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.drop-ico {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: none;
    border-radius: 10px;
    background: var(--tint);
    color: var(--accent);
}

.drop-text { min-width: 0; flex: 1; }
.drop strong { display: block; font-size: 16px; font-weight: 600; }

.drop small {
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drop.ready { border-style: solid; }
.drop.ready .drop-ico { background: var(--accent); color: var(--on-accent); }
.drop.ready small { color: var(--ink); }

.error { color: var(--danger); font-size: 14px; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 46px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.btn.block { width: 100%; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 14px; }

.form .btn.block { margin-top: 8px; }

.link {
    padding: 6px 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.link:hover { text-decoration: underline; }

/* ---------- How-to ---------- */

.help {
    margin-top: 24px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.help summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.help summary::-webkit-details-marker { display: none; }
.help summary .i { color: var(--muted); transition: transform 0.2s; }
.help[open] summary .i { transform: rotate(180deg); }

.help ol {
    display: grid;
    gap: 6px;
    padding: 0 0 18px 20px;
    color: var(--muted);
    font-size: 15px;
}

.help b { color: var(--ink); font-weight: 600; }

/* ---------- Results ---------- */

.result { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 32px; }

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.stat { padding: 14px 16px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { display: block; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.hi { background: var(--tint); border-radius: 0 13px 13px 0; }
.stat.hi b { color: var(--accent); }

.tools { display: flex; gap: 8px; }

.search {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--field);
    color: var(--ink);
    font: inherit;
    font-size: 16px;
}

.search:focus-visible { border-color: var(--accent); outline-offset: 0; }

.sort {
    height: 46px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--field);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
}

.list {
    padding: 0;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    overflow: hidden;
}

.person {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}

.person:last-child { border-bottom: 0; }

.avatar {
    position: relative;
    width: 40px;
    height: 40px;
    flex: none;
    padding: 2px;
    border-radius: 50%;
    background: var(--accent);
}

.avatar span {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--tint);
    color: var(--accent);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
}


.who { min-width: 0; flex: 1; }

.who a {
    display: block;
    overflow: hidden;
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.who a:hover { color: var(--accent); }
.who small { color: var(--muted); font-size: 13px; }

.person.done { opacity: 0.5; }
.person.done .btn { border-color: var(--line); }

.empty { padding: 20px 16px; color: var(--muted); font-size: 15px; text-align: center; }

.foot { margin-top: 40px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---------- Small screens & motion ---------- */

@media (max-width: 360px) {
    .lede { font-size: 23px; }
    .stat { padding: 12px; }
    .stat b { font-size: 19px; }
}

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