/* Toolkit · minimal monochrome utility.
   One signal colour (orange) for state only: detected platform, focus, progress.
   Shape rule: fields + buttons 12px, small toggles full pill. */
@font-face { font-family: 'Geist'; src: url('/assets/geist/geist-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/assets/geist-mono/geist-mono-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f6f6f5;
  --field: #ffffff;
  --line: #e6e6e4;
  --line-2: #d4d4d1;
  --text: #111112;
  --text-2: #45464a;
  --muted: #8a8b90;
  --signal: #e8501c;
  --signal-soft: rgba(232, 80, 28, .1);
  --primary: #111112;
  --primary-ink: #f6f6f5;
  --bad: #c2261d;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0b0b0c; --field: #141416; --line: #222225; --line-2: #313135;
  --text: #ededee; --text-2: #b7b8bd; --muted: #75767c;
  --signal: #ff6633; --signal-soft: rgba(255, 102, 51, .13);
  --primary: #ededee; --primary-ink: #0b0b0c; --bad: #f87171;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0b0b0c; --field: #141416; --line: #222225; --line-2: #313135;
    --text: #ededee; --text-2: #b7b8bd; --muted: #75767c;
    --signal: #ff6633; --signal-soft: rgba(255, 102, 51, .13);
    --primary: #ededee; --primary-ink: #0b0b0c; --bad: #f87171;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100dvh; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
i.ph, i.ph-fill { line-height: 1; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 6px; }

/* header */
.top { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(16px, 4vw, 40px); }
.brand { font-weight: 650; font-size: 17px; letter-spacing: -.03em; }
.brand span { color: var(--signal); }
.views-nav { display: flex; align-items: center; gap: 4px; }
.views-nav a { padding: 6px 12px; font-size: 14.5px; color: var(--muted); border-radius: 8px; transition: color .2s; }
.views-nav a:hover { color: var(--text); }
.views-nav a.on { color: var(--text); font-weight: 550; }
.ghost-icon { width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 10px; font-size: 18px; transition: color .2s, background .2s; }
.ghost-icon:hover { color: var(--text); background: var(--line); }

/* column */
.col { width: min(640px, 100% - 32px); margin: 0 auto; padding: clamp(32px, 11vh, 120px) 0 80px; }

/* link field */
.field { display: flex; align-items: center; gap: 4px; height: 60px; padding: 0 8px 0 18px; background: var(--field); border: 1px solid var(--line-2); border-radius: 12px; transition: border-color .2s, box-shadow .2s; }
.field:focus-within { border-color: var(--text); box-shadow: 0 0 0 4px color-mix(in srgb, var(--text) 6%, transparent); }
.field-icon { font-size: 20px; color: var(--muted); display: grid; place-items: center; margin-right: 8px; transition: color .2s; }
.field-icon.known { color: var(--signal); }
.field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 16.5px; letter-spacing: -.01em; }
.field input::placeholder { color: var(--muted); }
.go { width: 44px; height: 44px; border-radius: 10px; border: 0; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font-size: 19px; transition: transform .15s var(--ease), opacity .2s; }
.go:active { transform: scale(.95); }
.go:disabled { opacity: .4; cursor: progress; }

.under { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.plat-tabs { display: flex; gap: 2px; flex-wrap: wrap; margin-left: -8px; }
.plat-tabs button { border: 0; background: transparent; padding: 4px 8px; border-radius: 999px; font-size: 13.5px; color: var(--muted); transition: color .2s, background .2s; }
.plat-tabs button:hover { color: var(--text); }
.plat-tabs button.on { color: var(--signal); background: var(--signal-soft); }
.mode { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--line); }
.mode button { border: 0; background: transparent; padding: 4px 12px; border-radius: 999px; font-size: 13.5px; color: var(--muted); transition: color .2s, background .2s; }
.mode button.on { background: var(--primary); color: var(--primary-ink); }
.hint { min-height: 22px; margin: 12px 0 0; font-size: 13.5px; color: var(--muted); }
.hint.bad { color: var(--bad); }

/* result */
.result { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); animation: rise .45s var(--ease); }
.media { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 18px; align-items: start; }
.thumb { width: 76px; aspect-ratio: 1; border-radius: 12px; background: var(--line) center / cover no-repeat; }
.thumb.skeleton, .sk { background: linear-gradient(100deg, var(--line) 30%, var(--line-2) 50%, var(--line) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.sk { height: 12px; border-radius: 6px; margin: 8px 0; }
.meta { min-width: 0; }
.m-plat { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.m-plat i { font-size: 14px; color: var(--signal); }
.meta h2 { margin: 3px 0 2px; font-size: 16px; font-weight: 600; letter-spacing: -.015em; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta p { margin: 0; font-size: 13.5px; color: var(--muted); }
.chips { display: flex; gap: 14px; margin-top: 8px; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.chip { display: inline-flex; align-items: center; gap: 5px; }
.chip i { font-size: 15px; color: var(--muted); }
.chip.hot, .chip.hot i { color: var(--signal); font-weight: 550; }

.progress { margin-top: 24px; }
.bar { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--signal); transition: width .4s var(--ease); }
.bar i.indet { width: 30% !important; animation: indet 1.2s var(--ease) infinite; }
.p-row { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.done { display: flex; gap: 8px; margin-top: 24px; animation: rise .35s var(--ease); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2); background: transparent; font-size: 14.5px; font-weight: 550; white-space: nowrap; transition: transform .15s var(--ease), background .2s, border-color .2s; }
.btn:hover { border-color: var(--text); }
.btn:active { transform: scale(.985); }
.btn i { font-size: 17px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.done .btn.primary { flex: 1; }
.error { display: flex; gap: 10px; align-items: flex-start; margin-top: 22px; color: var(--bad); font-size: 14px; }
.error i { font-size: 19px; margin-top: 1px; }
.error p { margin: 0; color: var(--text-2); }

/* history / lists */
.history { margin-top: 64px; }
.h-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.h-head h3 { margin: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.text-btn { border: 0; background: none; font-size: 13px; color: var(--muted); padding: 2px 0; }
.text-btn:hover { color: var(--text); }
#history { list-style: none; margin: 0; padding: 0; }
#history li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); animation: rise .3s var(--ease); }
#history li:last-child { border-bottom: 0; }
.h-thumb { width: 40px; height: 40px; border-radius: 9px; background: var(--line) center / cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 18px; }
.h-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-sub { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; }
.h-act { display: flex; gap: 2px; }
.h-act a, .h-act button { width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; display: grid; place-items: center; color: var(--muted); font-size: 17px; }
.h-act a:hover, .h-act button:hover { color: var(--text); background: var(--line); }
.h-act .expired { opacity: .35; pointer-events: none; }

/* password */
.pw-out { min-height: 112px; display: flex; align-items: center; padding: 8px 0 20px; border-bottom: 1px solid var(--line); }
.pw-out output { font: 500 clamp(22px, 4.2vw, 32px)/1.3 var(--mono); letter-spacing: -.01em; word-break: break-all; }
.pw-out .d { color: var(--signal); }
.pw-out .s { color: var(--muted); }
.pw-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0 40px; flex-wrap: wrap; }
.strength { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.s-track { width: 120px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.s-track i { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .4s var(--ease), background .3s; }
.pw-actions { display: flex; gap: 8px; }
.pw-opts { display: grid; gap: 22px; }
.len-row { display: grid; grid-template-columns: 70px 1fr 90px; align-items: center; gap: 16px; font-size: 14px; color: var(--text-2); }
.len-row b { text-align: right; font-weight: 550; font-variant-numeric: tabular-nums; color: var(--text); }
input[type=range] { width: 100%; accent-color: var(--text); }
.toggles { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tog { position: relative; cursor: pointer; }
.tog input { position: absolute; opacity: 0; pointer-events: none; }
.tog span { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); font: 13px var(--mono); color: var(--muted); transition: all .2s; }
.tog input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.tog input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 2px; }
select { height: 34px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; padding: 0 12px; font-size: 13px; }
.pw-alt { display: grid; }
.pw-alt button { display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 13px 0; font: 13.5px/1.4 var(--mono); color: var(--text-2); word-break: break-all; }
.pw-alt button:last-child { border-bottom: 0; }
.pw-alt button:hover { color: var(--text); }
.pw-alt button i { flex: none; color: var(--muted); font-size: 16px; }
.note { margin: 40px 0 0; font-size: 13px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--primary); color: var(--primary-ink); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; animation: rise .3s var(--ease); z-index: 30; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes shimmer { to { background-position: -300% 0; } }
@keyframes indet { 0% { transform: translateX(-110%); } 100% { transform: translateX(350%); } }
.toast { transform: translateX(-50%); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 560px) {
  .col { padding-top: 24px; }
  .field { height: 56px; padding-left: 14px; }
  .under { flex-direction: column; align-items: flex-start; }
  .len-row { grid-template-columns: 56px 1fr 72px; }
  .done { flex-direction: column; }
}
