:root {
  color-scheme: dark;
  --bg: #0e0e10; --surface: #16161a; --surface-2: #1d1d22; --surface-3: #26262c;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14);
  --text: #f2f2f3; --text-2: #a6a6ad; --muted: #75757d;
  --accent: #f2f2f3; --accent-ink: #0e0e10; --accent-soft: rgba(242,242,243,.10);
  --ok: #3fb67f; --warn: #d4a72c; --bad: #e5484d;
  --r: 12px; --r-sm: 10px; --pad: 20px; --gap: 12px; --fs: 15px;
  --ease: cubic-bezier(.22,1,.36,1); --dur: 300ms;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bot: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 var(--fs)/1.45 var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
h1, h2 { margin: 0; }
h1 { font-size: 24px; font-weight: 600; line-height: 1.2; }
h2 { font-size: 17px; font-weight: 600; }
.muted { color: var(--muted); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.wrap { max-width: var(--wrap, 560px); margin: 0 auto; padding: calc(12px + var(--safe-top)) 16px calc(24px + var(--safe-bot)); }
body.web .wrap { --wrap: 640px; }
.top { display: flex; align-items: center; gap: 12px; min-height: 48px; margin-bottom: 16px; }
.top .logo { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 17px; flex: 1; min-width: 0; }
.iconbtn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.iconbtn:active { transform: scale(.96); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--pad); margin-bottom: var(--gap); }
.search { position: relative; margin-bottom: var(--gap); }
.search svg.i { position: absolute; left: 14px; top: 15px; color: var(--muted); }
input { width: 100%; height: 48px; font: 400 16px var(--font); color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 14px 0 42px; transition: border-color 150ms var(--ease); }
input:focus { outline: none; border-color: var(--line-2); }
input::placeholder { color: var(--muted); }

.list { display: flex; flex-direction: column; gap: 8px; }
.row-btn { display: flex; align-items: center; gap: 14px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; width: 100%; text-align: left; color: inherit; font: inherit; transition: background-color 150ms var(--ease), transform 120ms var(--ease); }
.row-btn:active { transform: scale(.985); background: var(--surface-2); }
.row-btn .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-btn .meta b { font-weight: 500; }
.row-btn .meta small { color: var(--muted); font-size: 13px; }
.row-btn .price { font-weight: 500; white-space: nowrap; }
.row-btn > svg.i { color: var(--muted); }

.appicon { width: 56px; height: 56px; border-radius: 13px; background: var(--surface-3); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); overflow: hidden; flex: none; }
.appicon img { width: 100%; height: 100%; object-fit: cover; }
.appicon.lg { width: 96px; height: 96px; border-radius: 22px; }
.appicon.lg svg.i { width: 32px; height: 32px; }

.hero { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.hero .meta { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hero .price { font-size: 32px; font-weight: 600; line-height: 1.1; margin-top: 4px; }
.desc { white-space: pre-wrap; color: var(--text-2); margin: 0; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.kv:first-child { border-top: 0; padding-top: 0; }
.kv:last-child { padding-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; padding: 0 16px; border: 1px solid var(--accent); border-radius: var(--r-sm); background: var(--accent); color: var(--accent-ink); font: 600 15px var(--font); cursor: pointer; transition: transform 120ms var(--ease), opacity 150ms var(--ease); }
.btn:active { transform: scale(.985); }
.btn.sec { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn[disabled], .btn.off { opacity: .45; pointer-events: none; }
.note { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); font-size: 13px; margin-bottom: var(--gap); }
.note svg.i { color: var(--muted); margin-top: 1px; }
.note.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.note.warn svg.i { color: var(--warn); }
.steps { margin: 0; padding-left: 20px; color: var(--text-2); display: flex; flex-direction: column; gap: 8px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 48px 16px; color: var(--muted); }
.empty svg.i { width: 24px; height: 24px; }
.sticky { position: sticky; bottom: 0; padding: 12px 0 calc(4px + var(--safe-bot)); background: var(--bg); }

.sk { position: relative; overflow: hidden; background: var(--surface); border-radius: var(--r); height: 82px; }
.sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent); transform: translateX(-100%); animation: shine 1.2s infinite; }
@keyframes shine { to { transform: translateX(100%); } }

.screen { animation: inFade var(--dur) var(--ease) both; }
.screen.fwd { animation-name: inFwd; }
.screen.back { animation-name: inBack; }
@keyframes inFwd { from { opacity: 0; transform: translateX(28px); } }
@keyframes inBack { from { opacity: 0; transform: translateX(-28px); } }
@keyframes inFade { from { opacity: 0; } }

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