:root {
  --bg: #0f1115; --panel: #181b22; --panel2: #20242d; --text: #eef1f6; --muted: #8b93a3;
  --accent: #3ddc97; --accent-ink: #062b1b; --danger: #ff5d5d; --warn: #ffb547; --line: #2a2f3a;
  --radius: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; } .error { color: var(--danger); min-height: 1.2em; }

header { position: sticky; top: 0; z-index: 5; padding: calc(env(safe-area-inset-top) + 14px) 16px 10px;
  background: rgba(15,17,21,.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
header h1 { margin: 0; font-size: 30px; letter-spacing: -.5px; }
.tab { padding: 6px 16px calc(env(safe-area-inset-bottom) + 90px); max-width: 720px; margin: 0 auto; }

nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; z-index: 10;
  padding: 6px 4px calc(env(safe-area-inset-bottom) + 6px);
  background: rgba(24,27,34,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); }
nav button { flex: 1; background: none; border: 0; color: var(--muted); font-size: 11px; padding: 4px 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px; }
nav button span { font-size: 22px; line-height: 1; }
nav button.active { color: var(--accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0;
  background: var(--panel2); color: var(--text); padding: 10px 16px; border-radius: 999px;
  font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.danger { background: transparent; color: var(--danger); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }

input, textarea { width: 100%; background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; font-size: 16px; outline: none; font-family: inherit; }
input:focus, textarea:focus { border-color: var(--accent); }
.inline { display: flex; gap: 8px; margin-top: 10px; } .inline input { flex: 1; }
.search { margin: 6px 0 12px; }

.card { background: var(--panel); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card h3 { margin: 0 0 8px; }
.card .btn { margin-top: 10px; }
.toggle { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.toggle input { width: auto; margin-top: 3px; }

.list { display: flex; flex-direction: column; gap: 10px; }
.app { display: flex; gap: 12px; align-items: center; background: var(--panel); padding: 12px;
  border-radius: var(--radius); }
.icon { width: 56px; height: 56px; border-radius: 13px; flex: none; background: var(--panel2) center/cover;
  display: grid; place-items: center; font-weight: 700; font-size: 24px; color: var(--accent); }
.app .meta { flex: 1; min-width: 0; }
.app .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app .sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--panel2); margin-top: 4px; }
.pill.ok { color: var(--accent); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--danger); }
.app .actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

.banner { background: var(--panel); border-left: 4px solid var(--warn); padding: 12px 14px; border-radius: 12px;
  margin-bottom: 12px; font-size: 14px; }
.banner a { color: var(--accent); font-weight: 600; }
.src { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--line); font-size: 14px; word-break: break-all; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px;
  border-bottom: 1px solid var(--line); } .kv span:last-child { color: var(--muted); text-align: right; word-break: break-all; }
.steps { padding-left: 20px; font-size: 14px; color: var(--muted); } .steps li { margin-bottom: 6px; }

.screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.lockbox { width: 100%; max-width: 340px; text-align: center; }
.lockbox input { text-align: center; font-size: 28px; letter-spacing: 10px; margin: 12px 0; }
.lockbox .btn { width: 100%; }
.logo { font-size: 64px; color: var(--accent); }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; display: flex; align-items: flex-end;
  justify-content: center; }
.sheet { background: var(--panel); width: 100%; max-width: 560px; border-radius: 22px 22px 0 0;
  padding: 20px 18px calc(env(safe-area-inset-bottom) + 20px); max-height: 88vh; overflow: auto; }
.sheet h2 { margin: 0 0 10px; }
.sheet .btn { width: 100%; margin-top: 10px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--panel2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 1s linear infinite; margin: 10px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 84px);
  background: var(--panel2); padding: 10px 16px; border-radius: 12px; z-index: 60; max-width: 90vw; font-size: 14px; }
