/* ============ KERNEX style.css — tokens, base, login, buttons, cards ============ */

:root {
  --bg: #0b0f17; --sur: #111827; --card: #151f30; --card2: #1a2537; --line: #223049;
  --tx: #e7edf7; --tx2: #93a4c0; --mut: #5b6b88;
  --acc: #4f8cff; --acc2: #3b6fd4; --grn: #22c55e; --red: #ef4444; --yel: #f59e0b; --pur: #a78bfa;
  --rad: 14px; --nav: 62px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--tx);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select {
  font: inherit; color: var(--tx); background: var(--card2);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; width: 100%; outline: 0;
}
input:focus { border-color: var(--acc); }
a { color: var(--acc); text-decoration: none; }
h2 { font-size: 19px; margin: 2px 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .92em; }
.mut { color: var(--tx2); } .small { font-size: 12.5px; } .tiny { font-size: 11px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hidden { display: none !important; }

/* ---------- login ---------- */
.login-body {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px 18px; max-width: 430px; margin: 0 auto;
}
.logo { font-size: 44px; }
.brand { font-size: 27px; font-weight: 800; letter-spacing: .5px; margin: 6px 0 2px; }
.brand b { color: var(--acc); }
.tag { color: var(--tx2); text-align: center; margin-bottom: 22px; }
.feat { width: 100%; margin: 0 0 22px; }
.feat div { display: flex; gap: 9px; align-items: flex-start; padding: 7px 0; color: var(--tx2); font-size: 13.5px; }
.feat span { color: var(--grn); }

/* ---------- cards & buttons ---------- */
.card { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--rad); padding: 18px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 13px; border-radius: 12px; font-weight: 700;
  background: var(--card2); border: 1px solid var(--line); transition: .15s;
}
.btn:active { transform: scale(.985); }
.btn.acc { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn.grn { background: var(--grn); border-color: var(--grn); color: #06220f; }
.btn.red { background: transparent; border-color: var(--red); color: var(--red); }
.btn.gh { background: transparent; }
.btn:disabled { opacity: .55; }
.or { display: flex; align-items: center; gap: 12px; color: var(--mut); font-size: 12px; margin: 14px 0; }
.or::before, .or::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.err { color: var(--red); font-size: 13px; margin-top: 9px; min-height: 17px; }
.err.ok-text { color: var(--grn); }
.ok { color: var(--grn); }

/* ---------- pills / toggles / items ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  border-radius: 99px; padding: 3px 9px; background: var(--card2); border: 1px solid var(--line); color: var(--tx2);
}
.pill.g { color: var(--grn); border-color: rgba(34, 197, 94, .4); }
.pill.r { color: var(--red); border-color: rgba(239, 68, 68, .4); }
.pill.y { color: var(--yel); border-color: rgba(245, 158, 11, .4); }
.pill.a { color: var(--acc); border-color: rgba(79, 140, 255, .4); }

.tgl { position: relative; width: 42px; height: 24px; flex: none; }
.tgl input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.tgl i { position: absolute; inset: 0; background: var(--card2); border: 1px solid var(--line); border-radius: 99px; transition: .2s; }
.tgl i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; background: var(--tx2); border-radius: 50%; transition: .2s; }
.tgl input:checked + i { background: rgba(34, 197, 94, .25); border-color: var(--grn); }
.tgl input:checked + i::after { left: 21px; background: var(--grn); }

.act {
  background: var(--card2); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; font-size: 12.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  flex: 1; min-width: calc(25% - 6px);
}
.act:active { background: var(--line); }

.frow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.frow .fl { color: var(--tx2); }

/* ---------- spinner / toast / modal ---------- */
.spin {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--tx2); border-top-color: var(--acc);
  border-radius: 50%; animation: sp .7s linear infinite; vertical-align: -2px;
}
@keyframes sp { to { transform: rotate(360deg); } }

#toast-wrap {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav) + 20px); z-index: 99;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none; max-width: 88vw;
}
.toast {
  background: #1e293b; border: 1px solid var(--line); color: var(--tx);
  padding: 10px 16px; border-radius: 12px; font-size: 13px;
  text-align: center; animation: tin .25s ease;
}
.toast.success { border-color: rgba(34, 197, 94, .5); }
.toast.error { border-color: rgba(239, 68, 68, .5); }
@keyframes tin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

#modal-root {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
}
#modal-root .sheet {
  background: var(--sur); border: 1px solid var(--line); border-radius: 18px 18px 0 0;
  width: 100%; max-width: 520px; padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 85vh; overflow-y: auto;
}

.empty { text-align: center; color: var(--mut); padding: 34px 10px; font-size: 13.5px; }
