:root{
  --bg: #0f0f10;
  --text: #f2f2f2;
  --muted: #b8b8b8;
  --card: #1a1b1e;
  --border: rgba(255,255,255,.10);
  --btn: rgba(255,255,255,.10);
  --btnText: var(--text);
  --accent: #2ea6ff;
  --danger: #ff4d4d;
  --ok: #33d17a;
  --shadow: 0 6px 24px rgba(0,0,0,.25);
  --radius: 14px;
  --pad: 14px;
  --max: 900px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

*{ box-sizing:border-box; }
html, body { height:100%; }
body{
  margin:0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

.topbar{
  position: sticky;
  top:0;
  z-index: 5;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(10px);
}

.title{ display:flex; flex-direction:column; gap:2px; min-width: 0; }
.h1{ font-size: 16px; font-weight: 700; line-height: 1.2; }
.h2{ font-size: 12px; color: var(--muted); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.container{
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px;
}

.filters{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin: 10px 0 14px;
}

.input{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  outline: none;
}

.input::placeholder{ color: var(--muted); }

.seg{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.seg-btn{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 700;
  cursor:pointer;
}

.seg-btn.active{
  border-color: rgba(255,255,255,.25);
  background: rgba(255,255,255,.10);
}

.status{
  margin: 10px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  display:none;
}

.status.show{ display:block; }
.status.ok{ color: var(--ok); }
.status.err{ color: var(--danger); }

.btn{
  border: 1px solid var(--border);
  background: var(--btn);
  color: var(--btnText);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: none;
  user-select:none;
}
.btn:active{ transform: translateY(1px); }
.btn-secondary{ opacity: .9; }

.list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.card{
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--pad);
  box-shadow: var(--shadow);
}

.card-link{
  text-decoration:none;
  color: inherit;
  display:block;
}

.card-title{
  font-size: 16px;
  font-weight: 750;
  margin: 0 0 8px;
}

.card-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin: 0 0 10px;
}

.pill{
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255,255,255,.03);
}

.card-desc{
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.skeleton{
  height: 86px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.10), rgba(255,255,255,.05));
  background-size: 200% 100%;
  animation: sh 1.2s ease-in-out infinite;
}

@keyframes sh{
  0%{ background-position: 0% 50%; }
  100%{ background-position: 200% 50%; }
}

.raw{
  margin-top: 12px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  color: var(--muted);
}

.raw pre{
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0,0,0,.25);
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin: 10px 0 0;
}


/* Favorites */
.btn-fav-on{
  border-color: rgba(255,255,255,.25);
  background: rgba(255,255,255,.12);
}


/* Favorite star button in list cards */
.card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.fav-btn{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: var(--text, #fff);
  border-radius: 12px;
  padding: 6px 10px;
  cursor: pointer;
  line-height: 1;
  user-select:none;
}
.fav-btn:hover{
  background: rgba(255,255,255,.10);
}
.fav-btn.on{
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.12);
}

/* =========================================================
   BOARDTG HIGH CONTRAST OVERRIDES (safe, appended)
   ========================================================= */

/* Base defaults (work even if Telegram theme not applied) */
:root{
  --bg: #0f1115;
  --card: #161a22;
  --text: #f2f4f8;
  --muted: rgba(242,244,248,.72);
  --accent: #2ea6ff;
  --btnText: #0b0e13;
  --border: rgba(255,255,255,.12);
}

html, body{
  background: var(--bg) !important;
  color: var(--text) !important;
}

/* Topbar */
.topbar{
  background: rgba(255,255,255,.06) !important;
  border-bottom: 1px solid var(--border) !important;
}

/* Titles */
.h1, .card-title{
  color: var(--text) !important;
}
.h2{
  color: var(--muted) !important;
}

/* Inputs */
.input{
  background: rgba(255,255,255,.06) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}
.input::placeholder{
  color: rgba(242,244,248,.55) !important;
}

/* Buttons */
.btn{
  background: rgba(255,255,255,.10) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}
.btn:hover{
  background: rgba(255,255,255,.14) !important;
}
.btn.btn-secondary{
  background: rgba(255,255,255,.06) !important;
}

/* Segmented tabs */
.seg-btn{
  background: rgba(255,255,255,.06) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}
.seg-btn.active{
  background: var(--accent) !important;
  border-color: rgba(46,166,255,.55) !important;
  color: #00121f !important;
  font-weight: 700 !important;
}

/* Cards */
.card{
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 8px 28px rgba(0,0,0,.35) !important;
}
.card-desc{
  color: var(--muted) !important;
}

/* Pills */
.pill{
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  color: var(--text) !important;
}

/* Status */
.status{
  color: var(--muted) !important;
}
.status.err{
  color: #ff6b6b !important;
}
.status.ok{
  color: #7CFFB2 !important;
}

/* Favorites button in list: make sure it is always visible */
.fav-btn{
  background: rgba(255,255,255,.10) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  color: var(--text) !important;
}
.fav-btn.on{
  background: rgba(255,215,0,.18) !important;
  border-color: rgba(255,215,0,.35) !important;
  color: #ffd700 !important;
}

/* Make links readable */
a, a:visited{
  color: var(--text) !important;
}
