:root {
  --bg: #0f141b;
  --bg2: #171d26;
  --card: #1b2330;
  --card2: #222c3b;
  --line: #2c3748;
  --text: #e6edf5;
  --muted: #8b9ab0;
  --accent: #66c0f4;
  --accent2: #1a9fff;
  --green: #5ccf7a;
  --yellow: #f2c14e;
  --red: #ef5b5b;
  --grey: #6b7789;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 10% -10%, #1b2838 0%, transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0 0 .25em; line-height: 1.2; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .85rem; margin: .5rem 0; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; letter-spacing: .2px; }
.brand.big { font-size: 1.5rem; justify-content: center; margin-bottom: .25rem; }
.logo {
  width: 26px; height: 26px; border-radius: 50%;
  background: conic-gradient(from 200deg, var(--accent2), var(--accent), var(--accent2));
  flex: none; box-shadow: inset 0 0 0 6px #0f141b;
}

/* ---------- Layout ---------- */
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.container { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .8rem 1.25rem; background: rgba(23, 29, 38, .85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.topbar-right { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin: .5rem 0 1.5rem; flex-wrap: wrap; }
.page-head p { margin: 0; }
.row-end { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }

/* ---------- Forms ---------- */
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .85rem; }
input {
  display: block; width: 100%; margin-top: .3rem; padding: .65rem .8rem;
  background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(102, 192, 244, .15); }
.code-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; text-transform: uppercase; font-family: ui-monospace, Consolas, monospace; }
details { margin: .25rem 0 .75rem; }
summary { cursor: pointer; color: var(--muted); font-size: .85rem; margin-bottom: .6rem; }
.form-error {
  background: rgba(239, 91, 91, .12); border: 1px solid rgba(239, 91, 91, .35); color: #ffb3b3;
  padding: .55rem .75rem; border-radius: 8px; font-size: .9rem; margin-bottom: .85rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 1px solid transparent; border-radius: 8px; padding: .6rem 1rem; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--text); background: var(--card2);
  transition: background .15s, border-color .15s, opacity .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #47b4ff, var(--accent2)); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.ghost:hover { color: var(--text); border-color: var(--muted); }
.btn.danger { background: rgba(239, 91, 91, .15); color: #ff9c9c; border-color: rgba(239, 91, 91, .35); }
.btn.danger:hover { background: rgba(239, 91, 91, .25); }
.btn.warn { background: rgba(242, 193, 78, .15); color: var(--yellow); border-color: rgba(242, 193, 78, .4); }
.btn.small { padding: .35rem .7rem; font-size: .85rem; white-space: nowrap; }
.btn.full { width: 100%; }

/* ---------- Auth ---------- */
.auth-card {
  width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 2rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.auth-card > .muted { text-align: center; margin: 0 0 1.25rem; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg2); border-radius: 10px; padding: 4px; margin-bottom: 1.25rem; }
.tab { background: none; border: 0; color: var(--muted); padding: .5rem; border-radius: 7px; cursor: pointer; font: inherit; font-weight: 600; }
.tab.active { background: var(--card2); color: var(--text); }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 3.5rem 1rem; border: 1px dashed var(--line); border-radius: 16px; background: rgba(27, 35, 48, .5); }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 50%; background: var(--card2); position: relative; }
.empty-icon::before { content: "🎮"; font-size: 28px; position: absolute; inset: 0; display: grid; place-items: center; }
.empty p { margin: .25rem 0 1.25rem; }

/* ---------- Account cards ---------- */
.accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); gap: 1.25rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; }
.card-head { padding: 1.1rem 1.25rem .9rem; display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.card-title { min-width: 0; }
.card-title h3 { font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-title .sub { color: var(--muted); font-size: .8rem; }
.card-title .sub a { color: inherit; }

.badge {
  display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .65rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700; white-space: nowrap; background: var(--card2); color: var(--muted);
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.running { color: var(--green); background: rgba(92, 207, 122, .12); }
.badge.running .dot { animation: pulse 1.6s infinite; }
.badge.connecting { color: var(--accent); background: rgba(102, 192, 244, .12); }
.badge.blocked, .badge.idle { color: var(--yellow); background: rgba(242, 193, 78, .12); }
.badge.error, .badge.auth_failed { color: var(--red); background: rgba(239, 91, 91, .12); }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }

.status-msg { padding: 0 1.25rem; margin: -.4rem 0 .9rem; color: var(--muted); font-size: .85rem; }
.relink-box {
  margin: 0 1.25rem 1rem; padding: .75rem .9rem; border-radius: 10px; font-size: .9rem;
  background: rgba(239, 91, 91, .1); border: 1px solid rgba(239, 91, 91, .3);
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
}

.controls { display: flex; gap: 1rem; padding: .9rem 1.25rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(15, 20, 27, .35); flex-wrap: wrap; align-items: center; justify-content: space-between; }
.control { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: var(--muted); }

.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg button { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; font-size: .85rem; padding: .35rem .8rem; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
.seg button .dot { width: 8px; height: 8px; border-radius: 50%; }
.seg button[data-persona="online"] .dot { background: var(--green); }
.seg button[data-persona="offline"] .dot { background: var(--grey); }
.seg button.active { background: var(--card2); color: var(--text); }

.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; margin: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; cursor: pointer; transition: background .2s; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; }
.switch input:checked + span { background: var(--accent2); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(102, 192, 244, .3); }

.games { padding: 1rem 1.25rem; }
.games-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .6rem; }
.games-head h4 { margin: 0; font-size: .95rem; }
.games-head .count { color: var(--muted); font-size: .8rem; }
.game-list { list-style: none; margin: 0 0 .9rem; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.game {
  display: flex; align-items: center; gap: .75rem; padding: .4rem .5rem .4rem .4rem;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
}
.game img, .game .ph { width: 92px; height: 35px; border-radius: 5px; object-fit: cover; flex: none; background: var(--card2); }
.game .info { min-width: 0; flex: 1; }
.game .name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game .appid { color: var(--muted); font-size: .75rem; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--muted);
  cursor: pointer; font-size: 1.15rem; line-height: 1; flex: none;
}
.icon-btn:hover { color: var(--red); background: rgba(239, 91, 91, .12); border-color: rgba(239, 91, 91, .3); }
.no-games { color: var(--muted); font-size: .85rem; padding: .6rem 0 .9rem; }

.search { position: relative; }
.search input { margin: 0; padding-right: 2.2rem; }
.search .spin { position: absolute; right: .7rem; top: 50%; margin-top: -8px; width: 16px; height: 16px; border-width: 2px; }
.results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; list-style: none; margin: 0; padding: 4px;
  background: var(--card2); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
  max-height: 320px; overflow: auto;
}
.results li { display: flex; align-items: center; gap: .65rem; padding: .4rem .5rem; border-radius: 7px; cursor: pointer; }
.results li:hover, .results li.active { background: rgba(102, 192, 244, .12); }
.results li img { width: 64px; height: 24px; object-fit: cover; border-radius: 3px; background: var(--bg2); }
.results li .r-name { flex: 1; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results li .r-id { color: var(--muted); font-size: .75rem; }
.results li.disabled { opacity: .5; cursor: default; }
.results .msg { color: var(--muted); font-size: .85rem; cursor: default; }
.quick { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.chip { background: var(--bg2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: .2rem .65rem; font-size: .78rem; cursor: pointer; font: inherit; font-size: .78rem; }
.chip:hover { color: var(--text); border-color: var(--accent); }

.card-foot { margin-top: auto; display: flex; justify-content: space-between; gap: .5rem; padding: .75rem 1.25rem; border-top: 1px solid var(--line); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(5, 8, 12, .7); display: grid; place-items: center; padding: 1rem; z-index: 50; animation: fade .15s; }
.modal { position: relative; width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1.6rem; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); animation: pop .18s; }
.modal.small { max-width: 380px; }
.modal h2 { margin-bottom: 1rem; }
.modal-close { position: absolute; right: .8rem; top: .7rem; background: none; border: 0; color: var(--muted); font-size: 1.5rem; cursor: pointer; }
.modal-close:hover { color: var(--text); }
.waiting { text-align: center; padding: 1.5rem 0; color: var(--muted); }
.waiting .spinner { margin: 0 auto 1rem; }
.success-icon { width: 56px; height: 56px; margin: .5rem auto 1rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; background: rgba(92, 207, 122, .15); color: var(--green); }
[data-step="done"] p { text-align: center; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { transform: scale(.96); opacity: 0 } }

/* ---------- Misc ---------- */
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.toast {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 100;
  background: var(--card2); border: 1px solid var(--line); padding: .7rem 1.1rem; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4); max-width: calc(100% - 2rem);
}
.toast.error { border-color: rgba(239, 91, 91, .5); color: #ffb3b3; }

@media (max-width: 560px) {
  .topbar .muted { display: none; }
  .topbar { padding: .6rem .9rem; }
  .relink-box { flex-direction: column; align-items: stretch; }
  .controls { flex-direction: column; align-items: stretch; }
  .control { justify-content: space-between; }
  .game img, .game .ph { width: 64px; height: 24px; }
}
.results li .ph { width: 64px; height: 24px; border-radius: 3px; background: var(--bg2); flex: none; }

/* ---------- Neue Bereiche: Spielstatus, Karten, Dauer-Login ---------- */
.badge.farming { color: #c39bff; background: rgba(155, 109, 255, .14); }
.badge.farming .dot { animation: pulse 1.6s infinite; }

.section { padding: 1rem 1.25rem; border-top: 1px solid var(--line); }
.section .hint { margin: .45rem 0 0; }
.inline-form { display: flex; gap: .5rem; align-items: center; }
.inline-form input { margin: 0; }
.inline-input { flex: 1; }

.farm-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.farm-summary { color: var(--muted); font-size: .85rem; }
.farm-summary.warn { color: var(--yellow); }
.farm-list { list-style: none; margin: .7rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; max-height: 236px; overflow: auto; }
.farm-item { display: flex; align-items: center; gap: .65rem; padding: .3rem .5rem .3rem .3rem; border-radius: 8px; background: var(--bg2); border: 1px solid var(--line); }
.farm-item img, .farm-item .ph { width: 64px; height: 24px; border-radius: 3px; object-fit: cover; flex: none; background: var(--card2); }
.farm-item .info { flex: 1; min-width: 0; }
.farm-item .name { font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.farm-item .appid { color: var(--muted); font-size: .72rem; }
.farm-item .drops { font-size: .78rem; font-weight: 700; color: #c39bff; white-space: nowrap; }
.farm-item .now { font-size: .72rem; font-weight: 700; color: var(--green); white-space: nowrap; }
.farm-item.current { border-color: rgba(155, 109, 255, .55); background: rgba(155, 109, 255, .08); }

.login-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.login-info { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.login-actions { display: flex; gap: .4rem; }
.guard-code { font-family: ui-monospace, Consolas, monospace; font-weight: 700; color: var(--text); background: var(--bg2); border: 1px solid var(--line); padding: .15rem .5rem; border-radius: 6px; letter-spacing: .12em; }

label.check { display: flex; gap: .6rem; align-items: flex-start; color: var(--text); font-size: .85rem; cursor: pointer; }
label.check input { width: auto; margin: .2rem 0 0; flex: none; accent-color: var(--accent2); }
label.check span { color: var(--muted); }
label.check b { color: var(--text); }

@media (max-width: 560px) {
  .farm-row, .login-row { flex-direction: column; align-items: stretch; }
}

/* ---------- Chat & Auto-Antwort ---------- */
textarea, select {
  display: block; width: 100%; margin-top: .3rem; padding: .6rem .8rem; font: inherit; color: var(--text);
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; outline: none; resize: vertical;
}
select { width: auto; display: inline-block; margin: 0 0 0 .5rem; padding: .4rem .6rem; }
textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(102, 192, 244, .15); }
.inline-label { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; }
.pill { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; margin-left: .35rem; }
.ar-summary { color: var(--muted); font-size: .85rem; margin-top: .45rem; overflow-wrap: anywhere; }
.ar-editor { margin-top: .8rem; padding: .9rem; border-radius: 10px; background: rgba(15, 20, 27, .45); border: 1px solid var(--line); }
.ar-editor .row-end { margin-top: .6rem; }

.chat-modal { max-width: 980px; height: min(760px, calc(100vh - 2rem)); display: flex; flex-direction: column; }
.chat-modal h2 { margin-bottom: .2rem; padding-right: 2rem; }
.chat-modal > .hint { margin: 0 0 .9rem; }
.chat-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.chat-list { list-style: none; margin: 0; padding: 0; overflow: auto; border-right: 1px solid var(--line); background: rgba(15, 20, 27, .35); }
.chat-item { display: flex; align-items: center; gap: .6rem; padding: .65rem .75rem; cursor: pointer; border-bottom: 1px solid rgba(44, 55, 72, .5); }
.chat-item:hover { background: rgba(102, 192, 244, .06); }
.chat-item.active { background: rgba(102, 192, 244, .13); }
.chat-item .info { flex: 1; min-width: 0; }
.chat-item .name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item .last { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item .meta { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.chat-item .time { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.empty-list, .empty-thread { color: var(--muted); font-size: .88rem; padding: 1.2rem; text-align: center; }
.avatar { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex: none; background: var(--card2); }

.chat-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread-head { display: flex; align-items: center; gap: .6rem; padding: .6rem .9rem; border-bottom: 1px solid var(--line); min-height: 52px; }
.thread-head .name { flex: 1; font-weight: 700; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-head .name:hover { color: var(--accent); }
.messages { flex: 1; overflow: auto; padding: 1rem; display: flex; flex-direction: column; gap: .55rem; }
.msg { display: flex; flex-direction: column; max-width: 78%; }
.msg.in { align-self: flex-start; }
.msg.out, .msg.auto { align-self: flex-end; align-items: flex-end; }
.bubble { padding: .5rem .75rem; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; }
.msg.in .bubble { background: var(--card2); border-bottom-left-radius: 4px; }
.msg.out .bubble { background: #1f5f8f; border-bottom-right-radius: 4px; }
.msg.auto .bubble { background: rgba(155, 109, 255, .22); border: 1px dashed rgba(155, 109, 255, .5); border-bottom-right-radius: 4px; }
.msg-meta { color: var(--muted); font-size: .7rem; margin-top: .15rem; }
.reply-form { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--line); }
.reply-form input { margin: 0; }

@media (max-width: 720px) {
  .chat-layout { grid-template-columns: 1fr; grid-template-rows: 170px 1fr; }
  .chat-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .msg { max-width: 90%; }
}

/* ---------- Language switch ---------- */
.lang-switch { display: inline-flex; align-items: center; gap: .35rem; margin: 0; color: var(--muted); font-size: .85rem; }
.lang-switch select { margin: 0; padding: .32rem 1.6rem .32rem .55rem; font-size: .85rem; border-radius: 8px; cursor: pointer; }
.auth-card { position: relative; }
.auth-lang { position: absolute; top: .9rem; right: .9rem; }
.auth-card .brand.big { margin-top: 1rem; }
.seg button { white-space: nowrap; }

/* ---------- Collapsible account cards (one column) ---------- */
.accounts { grid-template-columns: 1fr; gap: .8rem; max-width: 920px; }
.card-head { cursor: pointer; align-items: center; user-select: none; border-radius: 16px; transition: background .15s; }
.card-head:hover { background: rgba(102, 192, 244, .04); }
.card-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.card-head .card-title { flex: 1; }
.card-head .status-msg { padding: 0; margin: .2rem 0 0; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { font-size: 1.5rem; line-height: 1; color: var(--muted); transform: rotate(90deg); transition: transform .2s; width: 1rem; text-align: center; flex: none; }
.card.collapsed .chevron { transform: rotate(0deg); }
.head-right { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.head-info { display: flex; gap: .35rem; flex-wrap: wrap; }
.chip-info { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; color: var(--muted); background: var(--bg2); border: 1px solid var(--line); padding: .18rem .55rem; border-radius: 999px; white-space: nowrap; }
.chip-info .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--grey); }
.chip-info.persona-online .dot { background: var(--green); }
.chip-info.unread { color: #fff; background: var(--red); border-color: var(--red); }
.card-body > .relink-box { margin-top: .1rem; }
.card.collapsed .card-head { border-radius: 16px; }
@media (max-width: 560px) {
  .card-head { flex-wrap: wrap; }
  .head-right { width: 100%; justify-content: flex-start; padding-left: 1.6rem; }
}

/* ---------- Page navigation ---------- */
.page-nav { display: flex; gap: .25rem; padding: .5rem 1.25rem 0; border-bottom: 1px solid var(--line); background: rgba(23, 29, 38, .6); overflow-x: auto; }
.page-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; padding: .55rem .9rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.page-nav a:hover { color: var(--text); }
.page-nav a.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- Tool pages (comments / invites) ---------- */
.tool-page { max-width: 920px; }
.tool-bar { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.tool-bar .inline-label { margin: 0; gap: .6rem; }
.tool-bar select { margin: 0; min-width: 220px; }
.notice { background: rgba(242, 193, 78, .1); border: 1px solid rgba(242, 193, 78, .35); color: var(--yellow); padding: .7rem .9rem; border-radius: 10px; margin-bottom: 1rem; font-size: .9rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1.25rem; margin-bottom: 1rem; }
.panel h2 { font-size: 1.1rem; margin-bottom: .9rem; }
.field-title { font-size: .85rem; color: var(--muted); margin: .4rem 0 .4rem; }
.radio-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .8rem; }
label.radio { display: inline-flex; align-items: center; gap: .45rem; margin: 0; padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 9px; background: var(--bg2); color: var(--text); cursor: pointer; font-size: .88rem; }
label.radio input { width: auto; margin: 0; accent-color: var(--accent2); }
label.radio:has(input:checked) { border-color: var(--accent); background: rgba(102, 192, 244, .1); }
.sched-fields { display: flex; gap: .75rem; flex-wrap: wrap; }
.sched-fields label { margin-bottom: .3rem; }
.sched-fields select { width: 100%; margin: .3rem 0 0; display: block; padding: .6rem .8rem; }
.short-input { max-width: 160px; }
.warn-hint { color: var(--yellow); }
.grow { flex: 1; min-width: 0; }
.inline-form select { margin: 0; flex: 1; padding: .6rem .8rem; }

/* friend picker */
.fp { border: 1px solid var(--line); border-radius: 12px; padding: .7rem; background: rgba(15, 20, 27, .35); margin-bottom: .8rem; }
.fp-bar { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.fp-bar input { margin: 0; }
.fp-count { display: block; color: var(--muted); font-size: .8rem; margin: .5rem 0 .3rem; }
.fp-status { color: var(--muted); font-size: .85rem; padding: .4rem 0; }
.fp-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .3rem; }
.fp-item { display: flex; align-items: center; gap: .5rem; margin: 0; padding: .35rem .5rem; border-radius: 8px; cursor: pointer; color: var(--text); font-size: .87rem; }
.fp-item:hover { background: rgba(102, 192, 244, .07); }
.fp-item input { width: auto; margin: 0; accent-color: var(--accent2); flex: none; }
.fp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar.small { width: 26px; height: 26px; border-radius: 6px; }

/* scheduled jobs */
.job { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; margin-bottom: .7rem; background: var(--bg2); }
.job.disabled { opacity: .65; }
.job-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .4rem; }
.job-head h3 { font-size: 1rem; margin: 0; }
.job-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.job-line { font-size: .86rem; margin-top: .25rem; overflow-wrap: anywhere; }
.job-line.live { color: var(--accent); font-weight: 600; }
.warn-text { color: var(--yellow); }
.job-errors { margin-top: .4rem; font-size: .82rem; color: var(--muted); }
.job-errors ul { margin: .3rem 0 0; padding-left: 1.2rem; max-height: 180px; overflow: auto; }
.progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin: .45rem 0 .2rem; }
.progress .bar { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: width .3s; }

/* ---------- Friend requests / keyword replies ---------- */
.sub-row { margin-top: .9rem; padding-top: .8rem; border-top: 1px dashed var(--line); }
.kw-rules { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .6rem; }
.kw-rule { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: .7rem 2.4rem .2rem .8rem; background: var(--bg2); }
.kw-top { display: flex; gap: .6rem; flex-wrap: wrap; }
.kw-top label { margin-bottom: .5rem; }
.kw-top select { display: block; margin: .3rem 0 0; padding: .6rem .7rem; }
.kw-rule label { margin-bottom: .5rem; }
.kw-remove { position: absolute; top: .4rem; right: .4rem; }
.fa-log { list-style: none; margin: .6rem 0 0; padding: 0; font-size: .8rem; color: var(--muted); }
.fa-log li { padding: .15rem 0; overflow-wrap: anywhere; }
.fa-log .fa-log-title { font-weight: 600; color: var(--text); }

/* ---------- 2FA / backup ---------- */
.sep { border: 0; border-top: 1px solid var(--line); margin: 1.3rem 0 1rem; }
.modal h3 { font-size: 1rem; margin-bottom: .5rem; }
.mt { margin-top: .6rem; }
.center { text-align: center; }
.ok-text { color: var(--green); font-size: .9rem; margin: 0 0 .5rem; }
.code-input.wide { letter-spacing: .25em; font-size: 1.3rem; }
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin: .5rem 0 1rem; }
.qr { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 10px; image-rendering: pixelated; }
.secret-key { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; background: var(--bg2); border: 1px solid var(--line); padding: .35rem .6rem; border-radius: 6px; letter-spacing: .05em; user-select: all; text-align: center; overflow-wrap: anywhere; }
.backup-codes { font-family: ui-monospace, Consolas, monospace; background: var(--bg2); border: 1px solid var(--line); padding: .8rem 1rem; border-radius: 10px; columns: 2; font-size: 1rem; letter-spacing: .08em; margin: .5rem 0; }
.modal { max-height: calc(100vh - 2rem); overflow: auto; }
#twofa-form h2 { margin-bottom: .4rem; }

/* ---------- 2FA method choice ---------- */
.methods { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 12px; }
.method { display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px; border: 1px solid var(--border, #2a3f5a); border-radius: 8px; cursor: pointer; margin: 0; }
.method:hover { border-color: #66c0f4; }
.method input { width: auto; margin-top: 3px; }
.method-text { display: flex; flex-direction: column; gap: 2px; }
.method-text small { color: #8f98a0; font-size: 12px; }
.method.unavailable { opacity: .55; cursor: not-allowed; }
.method:has(input:checked) { border-color: #66c0f4; background: rgba(102,192,244,.08); }
.field-title { font-size: 13px; color: #c7d5e0; margin-top: 4px; }
.small-wait { padding: 14px 0 4px; }
.row-end.tight { margin: 0 0 8px; }
.bot-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px 0 4px; min-height: 26px; }
.hint-link { display: inline-block; font-size: 13px; margin: 0 0 10px; color: #66c0f4; }
a.btn { text-decoration: none; display: block; text-align: center; }
