/* ============================================================
   RedTeam Xperience â€” v4 (reference layout, red/black/cream)
   ============================================================ */
:root {
  --red: #f01c24;
  --red-700: #c8121a;
  --red-grad: linear-gradient(180deg, #ff5b5c 0%, #ff1a1e 100%);
  --red-soft: #ffe1e2;

  --ink: #16130d;
  --ink-2: #221d15;

  --card: #ffffff;
  --cream: #ffe8e6;

  --text: #1d1a13;
  --text-2: #6f6657;
  --muted: #a79d8b;
  --line: #ece3d2;
  --line-2: #e3d8c4;

  --sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --display: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --shadow-sm: 0 1px 2px rgba(70,55,25,.05), 0 2px 8px rgba(70,55,25,.05);
  --shadow-md: 0 8px 22px rgba(70,55,25,.09), 0 18px 40px rgba(70,55,25,.07);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  background: #d7d4cd;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
h1,h2,h3,h4 { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -.02em; }
p { margin: 0; }

/* ---------- Frame + app panel ---------- */
.frame {
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.app {
  width: 100%;
  display: flex;
  gap: 8px;
  position: relative;
  /* `clip` clips identically to `hidden` (keeps the decorative ::before/::after
     blurs contained) but does NOT establish a scroll container, so the sticky
     .topbar below resolves against the viewport instead of this panel. */
  overflow: clip;
  background:
   radial-gradient(620px 360px at 86% 4%, rgba(241, 72, 78, .09), transparent 70%), radial-gradient(520px 360px at 8% 104%, rgba(241, 72, 78, .045), transparent 72%), linear-gradient(150deg, #fff5f5 0%, #f6ece5 45%, #ffffff 100%);
  padding: 20px 26px 26px 16px;
  box-shadow: 0 30px 70px rgba(60,50,30,.18);
}
.app::before {
  content: ""; position: absolute; top: -180px; right: -90px;
  width: 520px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(241,60,66,.16) 0%, rgba(241,90,96,.06) 44%, transparent 70%);
  filter: blur(40px); pointer-events: none; z-index: 0;
}
.app::after {
  content: ""; position: absolute; top: -70px; right: 90px;
  width: 260px; height: 260px; border-radius: 50%;
  border: 1.5px dashed rgba(241,60,66,.14); pointer-events: none; z-index: 0;
}
.rail, .main { position: relative; }

/* ---------- Left icon rail ---------- */
.rail { flex: 0 0 60px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 2px; }
.rail-logo { width: auto; height: auto;  }
.rail-nav { display: flex; flex-direction: column; gap: 6px; }
.r-item { position: relative; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); transition: background .15s, color .15s; }
.r-item svg { width: 21px; height: 21px; stroke-width: 1.9; }
.r-item:hover { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.r-item.active { background: var(--ink); color: #fff; }
.r-label {
  position: absolute; left: 52px; top: 50%;
  transform: translateY(-50%) translateX(-6px);
  background: var(--ink); color: #fff;
  font-size: 12.5px; font-weight: 600;
  padding: 8px 12px; border-radius: 8px; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s;
  box-shadow: var(--shadow-md); z-index: 80;
}
.r-item:hover .r-label { opacity: 1; transform: translateY(-50%) translateX(0); }
.main { flex: 1; min-width: 0; padding-left: 16px; }

/* ============ Top bar ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  /* Sticky header on scroll — frosted bar that pins to the viewport top while
     the dashboard scrolls underneath (see overflow:clip note on .app). */
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 245, 245, .72);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.topbar.is-stuck {
  border-bottom-color: var(--line-2);
  box-shadow: 0 6px 18px rgba(70, 55, 25, .08);
}
.logo { flex: 0 0 auto; padding: 6px 12px; border: 1px solid rgba(255,255,255,.6); border-radius: 999px; background: rgba(255,255,255,.42); backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2); }
.logo img { height: 20px; width: auto; }

.topnav {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
}
.t-item {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  padding: 8px 7px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.t-item:hover { color: var(--text); background: rgba(255,255,255,.6); }
.t-item.active {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

.actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.set-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* gap: 7px; */
    font-size: 20px;
    text-align: center;
    font-weight: 600;
    color: var(--text);
    border-radius: 999px;
    background: rgba(255, 255, 255, .42);
    backdrop-filter: blur(12px) saturate(1.25);
    -webkit-backdrop-filter: blur(12px) saturate(1.25);
    border: 1px solid rgba(255, 255, 255, .6);
    box-shadow: 0 4px 16px rgba(150, 70, 50, .10);
}
.set-btn svg { width: 15px; height: 15px; }
.set-btn:hover { background: rgba(255,255,255,.62); }
.ic-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.42);
  backdrop-filter: blur(12px) saturate(1.25);
  -webkit-backdrop-filter: blur(12px) saturate(1.25);
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: 0 4px 16px rgba(150,70,50,.10);
  display: grid; place-items: center; color: var(--text); position: relative;
}
.ic-btn svg { width: 18px; height: 18px; }
.ic-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid #f5eee0; }
.ava {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--red-grad); color: #fff;
  font-weight: 700; font-size: 15px; display: grid; place-items: center;
}

/* ============ Greeting ============ */
.hello {
  font-size:20px;
  font-weight: 500;
  letter-spacing: -.03em;
  margin: 28px 0 0 2px;
}

/* ============ Stat strip ============ */
.strip {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 34px;
  align-items: center;
  padding: 0px 6px 26px !important;
}
.splitbar { display: flex; flex-direction: column; gap: 12px; }
.legends { display: flex; gap: 22px; flex-wrap: wrap; }
.lg { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.lg b { color: var(--text); font-weight: 700; }
.lg .d { width: 9px; height: 9px; border-radius: 3px; }
.d-dark { background: var(--ink); }
.d-red { background: var(--red); }
.d-soft { background: #ff9b9d; }
.d-hatch { background: repeating-linear-gradient(45deg, #cdbfa6, #cdbfa6 2px, transparent 2px, transparent 4px); }
.track { display: flex; gap: 5px; height: 34px; }
.seg { border-radius: 8px; height: 100%; }
.s-dark { background: var(--ink); }
.s-red { background: var(--red-grad); }
.s-soft { background: #ff9b9d; }
.s-hatch { background: repeating-linear-gradient(45deg, #d3c6ae, #d3c6ae 4px, #e8ddca 4px, #e8ddca 8px); }

.bignums {display: grid;grid-template-columns: repeat(3, 1fr);align-items: center;gap: 20px;}
.bn {display: flex;align-items: center;gap: 14px;padding: 19px 22px;position: relative;background-color: #ffffff52;border-radius: 5px;box-shadow: var(--shadow-sm);}
.bn-ic { width: 48px; height: 48px; border-radius: 13px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; flex: 0 0 48px; box-shadow: 0 6px 14px rgba(240,28,36,.10); }
.bn-ic svg { width: 24px; height: 24px; }
.bn-txt {min-width: 0;width: 100%;}
.bn .v { font-family: var(--display); font-size: 42px; font-weight: 700; line-height: .92; letter-spacing: -.03em; color: var(--text); }
.bn .k { font-size: 12px; color: var(--text-2); font-weight: 500; line-height: 1.25; margin-top: 6px; }

/* ============ Bento board ============ */
.board {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.82fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "courses courses userbox"
    "perf    comp    userbox";
  gap: 20px;
}
.card {
  background: var(--card);
  border-radius: 14px;
  padding: 22px 22px;
  box-shadow: var(--shadow-sm);
}
.courses-area { grid-area: courses; align-self: start; }
.courses-area .sec-head { margin-bottom: 14px; }
.perf { grid-area: perf; }
.comp { grid-area: comp; }
.userbox { grid-area: userbox; display: flex; flex-direction: column; gap: 12px; background: var(--card); border-radius: 16px; padding: 12px; box-shadow: var(--shadow-sm); }

.c-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.c-head h3 { font-size: 16px; }
.exp {
  margin-left: auto;
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--text-2);
}
.exp svg { width: 15px; height: 15px; }
.exp:hover { background: var(--cream); color: var(--text); }

/* ---------- Schedule ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 18px; }
.wd { text-align: center; padding: 9px 0; border-radius: 9px; }
.wd .dn { display: block; font-size: 10.5px; color: var(--muted); font-weight: 600; }
.wd .dt { display: block; font-size: 14px; font-weight: 600; margin-top: 4px; }
.wd.on { background: var(--ink); }
.wd.on .dn { color: rgba(255,255,255,.65); }
.wd.on .dt { color: #fff; }

.timeline { display: flex; flex-direction: column; gap: 12px; }
.tl-row { display: grid; grid-template-columns: 46px 1fr; gap: 12px; align-items: start; }
.tm { font-size: 11.5px; color: var(--muted); font-weight: 600; font-family: var(--mono); padding-top: 4px; }
.tl-line { height: 1px; background: var(--line); margin-top: 9px; }
.ev { background: var(--cream); border-radius: 10px; padding: 11px 13px; }
.ev-t { font-size: 13px; font-weight: 600; }
.ev-s { font-size: 11px; color: var(--text-2); font-weight: 500; margin-top: 3px; }
.ev-av { display: inline-flex; margin-top: 9px; }
.ev-av i {
  width: 22px; height: 22px; border-radius: 50%; margin-left: -6px;
  display: grid; place-items: center; font-size: 9.5px; font-weight: 700; font-style: normal;
  border: 2px solid var(--card); background: var(--line-2); color: var(--text);
}
.ev-av i:first-child { margin-left: 0; }
.ev-dark { background: var(--ink); }
.ev-dark .ev-t { color: #fff; }
.ev-dark .ev-s { color: rgba(255,255,255,.6); }
.ev-dark .ev-av i { border-color: var(--ink); background: #39322a; color: #fff; }
.ev-red { background: var(--red-grad); }
.ev-red .ev-t { color: #fff; }
.ev-red .ev-s { color: rgba(255,255,255,.85); }
.ev-red .ev-av i { border-color: #ff3338; background: rgba(255,255,255,.25); color: #fff; }

/* ---------- Courses table ---------- */
.search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--cream); border-radius: 999px;
  padding: 8px 14px; width: 200px;
}
.search svg { width: 15px; height: 15px; color: var(--muted); }
.search input { border: none; outline: none; background: none; font-family: inherit; font-size: 12.5px; flex: 1; color: var(--text); }
.table-card .exp { margin-left: 0; }

.thead, .trow {
  display: grid;
  grid-template-columns: 2.2fr 1fr 0.8fr 1fr;
  align-items: center;
  gap: 10px;
}
.thead { padding: 0 8px 12px; border-bottom: 1px solid var(--line); }
.thead span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.col-prog, .col-st { text-align: left; }
.trow { padding: 12px 8px; border-radius: 10px; }
.trow.sel { background: #fff; box-shadow: var(--shadow-sm); }
.col-name { display: flex; align-items: center; gap: 11px; min-width: 0; }
.check { width: 19px; height: 19px; border-radius: 6px; background: var(--red); display: grid; place-items: center; flex: 0 0 19px; }
.check svg { width: 12px; height: 12px; color: #fff; }
.logo-tile {
  width: 34px; height: 34px; border-radius: 8px; flex: 0 0 34px;
  display: grid; place-items: center; color: #fff;
  font-family: var(--display); font-weight: 700; font-size: 11px;
}
.l-red { background: var(--red-grad); }
.l-ink { background: linear-gradient(135deg,#221d15,#0e0c09); }
.l-dark { background: linear-gradient(135deg,#3a332a,#1c1812); }
.nm { font-size: 13px; font-weight: 600; line-height: 1.25; min-width: 0; }
.nm small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.col-cat { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.col-prog { font-size: 13px; font-weight: 700; font-family: var(--display); }
.pill { font-size: 11.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px; display: inline-block; }
.pill.ok { background: #e2f3e7; color: #2f8a52; }
.pill.active { background: var(--red-soft); color: var(--red-700); }
.pill.pend { background: var(--cream); color: var(--text-2); }

/* ---------- Learning Activity (black) ---------- */
.activity { background: var(--ink); color: #fff; }
.activity .c-head h3 { color: #fff; }
.activity .exp { border-color: rgba(255,255,255,.18); color: rgba(255,255,255,.7); }
.activity .exp:hover { background: rgba(255,255,255,.1); color: #fff; }
.act-nums { display: flex; gap: 26px; margin-bottom: 18px; }
.an { display: flex; align-items: flex-start; gap: 6px; }
.an .num { font-family: var(--display); font-size: 42px; font-weight: 600; line-height: 1; letter-spacing: -.03em; }
.an .ar { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; margin-top: 4px; }
.an .ar svg { width: 13px; height: 13px; }
.an .ar.up { background: rgba(95,208,138,.18); color: #5fd08a; }
.an .ar.dn { background: rgba(255,107,108,.18); color: #ff6b6c; }
.dotgrid { display: grid; grid-template-columns: repeat(var(--cols, 13), 1fr); gap: 9px; }
.dotgrid .g { width: 100%; aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,.10); }
.dotgrid .g.mid { background: #ffb24a; }
.dotgrid .g.on { background: var(--red); box-shadow: 0 0 8px rgba(240,28,36,.6); }

/* ---------- Course Performance (line chart) ---------- */
.perf .legend { display: flex; gap: 14px; margin-left: auto; }
.perf .legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.perf .legend .ld { width: 8px; height: 8px; border-radius: 50%; }
.ld.grey { background: #c9bda5; }
.ld.red { background: var(--red); }
.year { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; background: var(--cream); padding: 7px 12px; border-radius: 999px; }
.year svg { width: 13px; height: 13px; }
.perf .exp { margin-left: 0; }
.chart { display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.yax { display: flex; flex-direction: column; justify-content: space-between; height: 180px; text-align: right; }
.yax span { font-size: 10px; color: var(--muted); font-family: var(--mono); transform: translateY(-4px); }
.plot { position: relative; height: 180px; }
.lines { width: 100%; height: 100%; overflow: visible; }
.lines .grid { stroke: var(--line); stroke-width: 1; }
.lines polyline { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ln-grey { stroke: #cdc0a8; stroke-dasharray: 5 6; }
.ln-red { stroke: var(--red); }
.perf .tip { position: absolute; transform: translate(-50%,-130%); background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; font-family: var(--mono); padding: 5px 9px; border-radius: 8px; white-space: nowrap; }
.perf .tip::after { content:""; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%) rotate(45deg); width: 8px; height: 8px; background: var(--ink); border-radius: 1px; }
.tip-line { position: absolute; top: 0; bottom: 0; width: 1.5px; background: var(--line-2); }
.tip-dot { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--red); border: 2.5px solid var(--card); transform: translate(-50%,-50%); }
.xax { display: flex; justify-content: space-between; margin: 12px 0 0 40px; }
.xax span { font-size: 11px; color: var(--text-2); font-weight: 500; }
.xax span.on { color: var(--red); font-weight: 700; }

/* ---------- Composition (donut) ---------- */
.donut-wrap { display: flex; justify-content: center; padding: 10px 0 18px; }
.donut {
  width: 150px; height: 150px; border-radius: 50%;
  background: conic-gradient(var(--red) 0% 67%, var(--ink) 67% 100%);
  display: grid; place-items: center; position: relative;
}
.d-hole { position: absolute; inset: 24px; background: var(--card); border-radius: 50%; z-index: 1; }
.d-val { position: relative; z-index: 2; font-family: var(--display); font-size: 32px; font-weight: 600; text-align: center; letter-spacing: -.02em; }
.d-val small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: .02em; margin-top: 2px; }
.comp-legend { display: flex; justify-content: center; gap: 22px; }
.cl { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; font-family: var(--display); }
.cl b { color: var(--text-2); font-weight: 500; font-family: var(--sans); font-size: 12px; }
.cl .dot { width: 9px; height: 9px; border-radius: 50%; }
.cl .dot.red { background: var(--red); }
.cl .dot.dark { background: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1399px) {
  .board { grid-template-columns: 1.4fr 1fr 0.92fr; }
}
@media (max-width: 1180px) {
  .board {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "courses courses"
      "perf    comp"
      "userbox userbox";
  }
  .userbox { flex-direction: row; }
  .userbox .idcard2, .userbox .support2 { flex: 1 1 0; }
  .explore-grid { grid-template-columns: repeat(2, 1fr); }
  .feed { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .feed { grid-template-columns: 1fr; }
  .promo { grid-template-columns: 1fr; }
  .explore-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .app { padding: 16px;}
  .main { padding-left: 0; }
  .strip { grid-template-columns: 1fr; gap: 20px; }
  .board {
    grid-template-columns: 1fr;
    grid-template-areas: "courses" "perf" "comp" "userbox";
  }
  .userbox { flex-direction: column; }
  .hello { font-size: 34px; }
  .course-grid { grid-template-columns: 1fr; }
  .explore-grid { grid-template-columns: 1fr; }
  .promo { grid-template-columns: 1fr; text-align: left; }
  .promo .info { text-align: left; justify-content: flex-start; }
  .feed { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hello { font-size: 28px; }
  .bignums { grid-template-columns: 1fr; gap: 10px; }
  .bn:not(:first-child)::before { display: none; }
  .legends { gap: 12px; }
  .set-btn { padding: 8px 10px; }
}
/* ============================================================
   Sections below the bento â€” My Courses cards, Promo, Feed
   ============================================================ */
.section { margin-top: 32px; }
.sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.sec-head h2 { font-size: 20px; letter-spacing: -.025em; }
.sec-head .count { font-family: var(--mono); font-size: 12px; font-weight: 700; background: var(--red-soft); color: var(--red); padding: 3px 9px; border-radius: 999px; }
.sec-head .link { margin-left: auto; font-size: 13.5px; font-weight: 600; color: var(--red); display: inline-flex; align-items: center; gap: 5px; }
.sec-head .link svg { width: 16px; height: 16px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--sans); font-weight: 600; font-size: 14px; padding: 12px 22px; border-radius: 999px; transition: transform .12s, box-shadow .15s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn-red { background: var(--red-grad); color: #fff; box-shadow: 0 8px 20px rgba(240,28,36,.30); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn svg { width: 17px; height: 17px; }

/* Course cards */
.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.course { background: var(--card); border-radius: 14px; padding: 22px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.course:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.c-top { display: flex; align-items: flex-start; justify-content: space-between;margin-bottom: 30px; }
.c-logo { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 13px; color: #fff; background: linear-gradient(135deg,#3a332a,#16130d); }
.c-logo.l-red { background: var(--red-grad); }
.c-logo.l-ink { background: linear-gradient(135deg,#221c14,#0e0c09); }
.c-logo.l-dark { background: linear-gradient(135deg,#221c14,#0e0c09); }
.c-save { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.c-save svg { width: 15px; height: 15px; }
.c-save.on { color: var(--red); }
.c-meta { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 16px; }
.c-title { font-family: var(--display); font-size: 25px; font-weight: 600; line-height: 1.3; margin-top: 8px; min-height: 44px; text-wrap: pretty; color: var(--text); }
.c-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.c-tags span { font-size: 12px; font-weight: 500; color: var(--text-2); background: var(--cream); border: 1px solid var(--line); padding: 5px 11px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.c-tags span svg { width: 13px; height: 13px; color: var(--muted); }
.c-prog { margin-top: 18px; }
.c-prog .pt { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.c-prog .pt .pc { color: var(--red); }
.c-prog .pt .rem { color: var(--muted); font-weight: 500; }
.c-prog .bar { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.c-prog .bar i { display: block; height: 100%; background: var(--red-grad); border-radius: 999px; }
.c-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.c-foot .lessons { font-size: 13px; font-weight: 500; color: var(--text-2); display: inline-flex; align-items: center; gap: 7px; }
.c-foot .lessons svg { width: 16px; height: 16px; color: var(--muted); }
.c-foot .btn { padding: 10px 18px; }

/* Promo CTA */
.promo { background: linear-gradient(120deg,#17130d 0%,#221c14 100%); border-radius: 14px; padding: 30px 32px; color: #fff; position: relative; overflow: hidden; display: grid; grid-template-columns: 1.1fr 1fr auto; gap: 26px; align-items: center; }
.promo .grid-ov { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px,transparent 1px), linear-gradient(90deg,rgba(255,255,255,.05) 1px,transparent 1px); background-size: 30px 30px; }
.promo .glow { position: absolute; right: 30%; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(240,28,36,.30), transparent 70%); }
.promo h3 { font-size: 24px; line-height: 1.15; position: relative; color: #fff; }
.promo .mid { position: relative; }
.promo .mid p { font-size: 13.5px; color: #c7bfb2; line-height: 1.5; margin-bottom: 16px; }
.promo .info { position: relative; text-align: right; display: flex; align-items: center; gap: 22px; justify-content: flex-end; }
.promo .info .k { font-size: 12px; color: #a99f90; font-weight: 500; }
.promo .info .v { font-family: var(--display); font-size: 17px; font-weight: 600; margin: 2px 0 12px; }
.promo .info .v.price { color: #ff6b6c; margin-bottom: 0; }
.promo .info .enr { color: #9aa0ac; font-size: 13px; font-weight: 500; }
.promo .pthumb { width: 116px; height: 96px; border-radius: 11px; background: linear-gradient(135deg,#2a0d10,#7c1c20); position: relative; overflow: hidden; display: grid; place-items: center; flex: 0 0 116px; }
.promo .pthumb .code { font-family: var(--display); font-weight: 800; color: #fff; font-size: 20px; letter-spacing: .04em; position: relative; z-index: 1; }
.promo .pthumb::after { content: ""; position: absolute; inset: 0; background: radial-gradient(80px 60px at 70% 30%, rgba(240,28,36,.5), transparent 70%); }

/* Community Feeds */
.feed-card { background: #fff7f2; border-radius: 14px; padding: 26px 28px 28px;  }
.avastack { display: flex; align-items: center; }
.avastack .a { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--card); margin-left: -8px; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; }
.avastack .a:first-child { margin-left: 0; }
.avastack .more { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--card); margin-left: -8px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; }
.composer { display: flex; align-items: center; gap: 12px; background: var(--cream); border-radius: 11px; padding: 11px 12px 11px 14px; margin-top: 20px; }
.composer .ava { width: 40px; height: 40px; border-radius: 50%; background: var(--red-grad); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; flex: 0 0 40px; }
.composer input { flex: 1; border: none; background: none; outline: none; font-family: inherit; font-size: 14px; color: var(--text); }
.composer .tools { display: flex; gap: 4px; }
.composer .tools button { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.composer .tools button:hover { background: #e7ddc9; color: var(--red); }
.composer .tools button svg { width: 18px; height: 18px; }
.feed { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.post { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.post .ph { display: flex; align-items: center; gap: 11px; }
.post .ph .ava { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; flex: 0 0 42px; }
.post .ph .who { font-size: 14px; font-weight: 600; line-height: 1.15; }
.post .ph .who span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.post .ph .tag { margin-left: auto; font-size: 11px; font-weight: 600; padding: 4px 11px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; }
.post .ph .tag.win { color: var(--red); background: var(--red-soft); }
.post .ph .tag.tip { color: #9a7b1e; background: #f4ecd6; }
.post .ph .tag.res { color: #5a6675; background: #eceef2; }
.post .pf .act.sh { margin-left: 0; padding: 6px 11px; }
.post .txt { font-size: 14px; color: var(--text-2); line-height: 1.6; margin-top: 13px; }
.post .media { height: 118px; border-radius: 10px; margin-top: 14px; position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 12px; }
.post .media.m-red { background: linear-gradient(135deg,#fff1f1,#ffe0e1); }
.post .media.m-blue { background: linear-gradient(135deg,#f6efe1,#ece1cb); }
.post .media .dots { position: absolute; inset: 0; background-image: radial-gradient(rgba(0,0,0,.05) 1.4px, transparent 1.4px); background-size: 16px 16px; }
.post .media .chip { position: relative; z-index: 2; background: #fff; border-radius: 999px; padding: 6px 13px; font-size: 12.5px; font-weight: 600; color: var(--text); box-shadow: var(--shadow-sm); display: inline-flex; align-items: center; gap: 7px; }
.post .media .chip .ic { width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; }
.post .media .chip .ic svg { width: 12px; height: 12px; color: #fff; }
.post .pf { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.post .pf .act { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--text-2); background: var(--cream); border: 1px solid var(--line); padding: 6px 13px; border-radius: 999px; }
.post .pf .act svg { width: 16px; height: 16px; }
.post .pf .time { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 500; }

/* ============================================================
   Per-card soft red glow
   ============================================================ */
.card, .course, .feed-card, .post {
  background-image: radial-gradient(170px 150px at 100% 0%, rgba(241,84,90,.06), transparent 60%);
}

/* ============================================================
   Explore More Courses
   ============================================================ */
.explore-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.xcard { position: relative; height: 392px; background-color: #19150f; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-md); transition: transform .15s, box-shadow .15s; }
.xcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.x-media { position: absolute; inset: 0; overflow: hidden; }
.xm-1 { background: linear-gradient(150deg, #3a1d1f, #140f0c); }
.xm-2 { background: linear-gradient(150deg, #2b2620, #141009); }
.xm-3 { background: linear-gradient(150deg, #222a31, #10110c); }
.x-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.x-media::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(11,8,5,.95) 0%, rgba(11,8,5,.5) 42%, rgba(11,8,5,.05) 72%, transparent 100%); }
.x-badge2 { position: absolute; top: 12px; left: 12px; z-index: 2; background: rgba(255,255,255,.92); color: var(--text); font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; box-shadow: var(--shadow-sm); }
.x-badge2 i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.x-rate2 { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(20,15,12,.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff; font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px; }
.x-info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 20px 18px; color: #fff; }
.x-name { font-family: var(--display); font-size: 17px; font-weight: 700; line-height: 1.3; color: #fff; }
.x-desc { font-size: 12.5px; line-height: 1.5; color: rgba(255,255,255,.82); margin-top: 7px; text-wrap: pretty; }
.x-foot2 { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.2); }
.x-meta2 { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.88); }
.x-meta2 svg { width: 15px; height: 15px; color: #ff8f8b; }
.x-go2 { width: 40px; height: 40px; border-radius: 50%; background: var(--red-grad); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 16px rgba(240,28,36,.3); transition: transform .15s; flex: 0 0 40px; }
.xcard:hover .x-go2 { transform: translateX(3px); }
.x-go2 svg { width: 18px; height: 18px; }

/* ============================================================
   Community Feeds â€” redesigned posts
   ============================================================ */
.post { padding: 18px; }
.achv { display: inline-flex; align-items: center; gap: 9px; margin-top: 13px; background: var(--cream); border: 1px solid var(--line); border-radius: 10px; padding: 9px 13px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.achv-ic { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: 0 0 22px; }
.achv-ic svg { width: 13px; height: 13px; }

/* ============================================================
   TWEAKS â€” expressive feel-reshaping overrides
   (defaults: vibe=balanced, corners=soft, density=comfortable
    match the base design, so no rules needed for those)
   ============================================================ */

/* ---- Vibe: soft (calm, flat, pale) ---- */
html[data-vibe="soft"] {
  --shadow-sm: 0 1px 2px rgba(60,48,24,.03), 0 2px 6px rgba(60,48,24,.03);
  --shadow-md: 0 4px 12px rgba(60,48,24,.05), 0 10px 22px rgba(60,48,24,.04);
}
html[data-vibe="soft"] .app {
  background:
    radial-gradient(620px 360px at 86% 4%, rgba(241,72,78,.045), transparent 70%),
    linear-gradient(150deg, #f8f2ed 0%, #f6f0ea 50%, #f7f1ec 100%);
}
html[data-vibe="soft"] .app::before { opacity: .38; }
html[data-vibe="soft"] .app::after { opacity: .45; }
html[data-vibe="soft"] .btn-red,
html[data-vibe="soft"] .x-go,
html[data-vibe="soft"] .ava { box-shadow: none; }
html[data-vibe="soft"] .ev-red { background: linear-gradient(160deg,#f6b6b3,#ef9b98); }
html[data-vibe="soft"] .post-bar { background: #e7c3c2; }

/* ---- Vibe: bold (punchy, saturated, deep) ---- */
html[data-vibe="bold"] {
  --shadow-sm: 0 2px 4px rgba(60,40,20,.08), 0 3px 10px rgba(60,40,20,.07);
  --shadow-md: 0 10px 26px rgba(60,40,20,.13), 0 22px 46px rgba(60,40,20,.10);
}
html[data-vibe="bold"] .app {
  background:
    radial-gradient(720px 460px at 86% 2%, rgba(241,52,60,.22), transparent 66%),
    radial-gradient(520px 380px at 6% 104%, rgba(241,52,60,.10), transparent 72%),
    linear-gradient(150deg, #f7eae3 0%, #f6e6de 45%, #f8e5e0 100%);
}
html[data-vibe="bold"] .app::before { opacity: 1; width: 640px; height: 540px; filter: blur(30px); }
html[data-vibe="bold"] .app::after { opacity: 1; border-color: rgba(241,55,62,.30); }
html[data-vibe="bold"] .btn-red { box-shadow: 0 10px 28px rgba(240,28,36,.50); }
html[data-vibe="bold"] .x-go { box-shadow: 0 8px 22px rgba(240,28,36,.55); }
html[data-vibe="bold"] .post-bar { width: 4px; }
html[data-vibe="bold"] .t-item.active,
html[data-vibe="bold"] .r-item.active { box-shadow: 0 8px 20px rgba(20,16,12,.30); }

/* ---- Corners: sharp ---- */
html[data-corners="sharp"] .app { border-radius: 0; }
html[data-corners="sharp"] .card,
html[data-corners="sharp"] .course,
html[data-corners="sharp"] .feed-card,
html[data-corners="sharp"] .post,
html[data-corners="sharp"] .xcard,
html[data-corners="sharp"] .promo,
html[data-corners="sharp"] .pthumb { border-radius: 4px; }
html[data-corners="sharp"] .ev,
html[data-corners="sharp"] .achv,
html[data-corners="sharp"] .r-item,
html[data-corners="sharp"] .rail-logo,
html[data-corners="sharp"] .c-logo,
html[data-corners="sharp"] .logo-tile,
html[data-corners="sharp"] .x-tile,
html[data-corners="sharp"] .bn-ic { border-radius: 3px; }
html[data-corners="round"] .bn-ic { border-radius: 15px; }

/* ---- Corners: round ---- */
html[data-corners="round"] .app { border-radius: 38px; }
html[data-corners="round"] .card,
html[data-corners="round"] .course,
html[data-corners="round"] .feed-card,
html[data-corners="round"] .post,
html[data-corners="round"] .xcard,
html[data-corners="round"] .promo,
html[data-corners="round"] .pthumb { border-radius: 26px; }
html[data-corners="round"] .ev,
html[data-corners="round"] .achv,
html[data-corners="round"] .r-item,
html[data-corners="round"] .rail-logo,
html[data-corners="round"] .c-logo,
html[data-corners="round"] .logo-tile,
html[data-corners="round"] .x-tile,
html[data-corners="round"] .bn-ic,
html[data-corners="round"] .exp { border-radius: 15px; }

/* ---- Density: cozy ---- */
html[data-density="cozy"] .card { padding: 16px; }
html[data-density="cozy"] .board { gap: 14px; }
html[data-density="cozy"] .course-grid,
html[data-density="cozy"] .explore-grid { gap: 14px; }
html[data-density="cozy"] .feed { gap: 14px; }
html[data-density="cozy"] .section { margin-top: 22px; }
html[data-density="cozy"] .course { padding: 16px; }
html[data-density="cozy"] .feed-card { padding: 20px; }
html[data-density="cozy"] .strip { padding: 16px 6px 20px; }
html[data-density="cozy"] .hello { margin-top: 12px; }

/* ---- Density: airy ---- */
html[data-density="airy"] .card { padding: 28px; }
html[data-density="airy"] .board { gap: 30px; }
html[data-density="airy"] .course-grid,
html[data-density="airy"] .explore-grid { gap: 28px; }
html[data-density="airy"] .feed { gap: 26px; }
html[data-density="airy"] .section { margin-top: 46px; }
html[data-density="airy"] .course { padding: 26px; }
html[data-density="airy"] .feed-card { padding: 32px; }
html[data-density="airy"] .strip { padding: 30px 6px 36px; }
html[data-density="airy"] .hello { margin-top: 26px; font-size: 20px; }

/* ============================================================
   User details + support (right column)
   ============================================================ */
.userbox { min-width: 0; }
.idcard2 {
  background:linear-gradient(165deg, #fcdcd726 0%, #f4b6b047 100%);
  border-radius: 12px;
  padding: 24px 20px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.idcard2::after { content: ""; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.32), transparent 70%); pointer-events: none; }
.id-ava { width: 78px; height: 78px; border-radius: 50%; margin: 0 auto; background: #fce6e3; border: 4px solid rgba(255,255,255,.75); display: grid; place-items: center; position: relative; }
.id-ava svg { width: 36px; height: 36px; color: #bd8d88; }
.id-name { font-family: var(--display); font-size: 19px; font-weight: 700; color: var(--text); margin-top: 13px; position: relative; }
.id-sid { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; letter-spacing: .03em; color: #7a5550; background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.6); padding: 5px 12px; border-radius: 999px; margin-top: 11px; position: relative; }
.id-sid .ok { width: 7px; height: 7px; border-radius: 50%; background: #41b06a; }
.id-stats { display: flex; gap: 9px; margin-top: 18px; position: relative; }
.id-stats .ist { flex: 1; background: rgba(255,255,255,.5); border-radius: 12px; padding: 12px 6px; }
.id-stats .ist .v { font-family: var(--display); font-size: 19px; font-weight: 700; color: var(--text); line-height: 1; }
.id-stats .ist .k { font-size: 10.5px; color: #8a6560; font-weight: 500; margin-top: 4px; }
.id-feat { margin-top: 16px; border-radius: 12px; background: linear-gradient(160deg, #f01c24, #ed2a2f); padding: 16px; text-align: left; color: #fff; position: relative; overflow: hidden; }
.id-feat .lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; opacity: .92; }
.id-feat .ttl { font-family: var(--display); font-size: 17px; font-weight: 700; margin-top: 4px; }
.id-feat .bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.35); margin-top: 13px; overflow: hidden; }
.id-feat .bar i { display: block; height: 100%; width: 64%; background: #fff; border-radius: 999px; }
.id-feat .pc { font-size: 11.5px; font-weight: 600; margin-top: 9px; }
.id-feat::after { content: ""; position: absolute; right: -25px; bottom: -32px; width: 92px; height: 92px; border-radius: 50%; background: rgba(255,255,255,.16); }

.support2 {
  background: linear-gradient(165deg, #fcdcd726 0%, #f4b6b047 100%);
  border-radius: 12px;
  padding: 22px 20px;
  flex: 1;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.support2::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.28), transparent 70%); pointer-events: none; }
.sp-ico { width: 48px; height: 48px; border-radius: 13px; background: var(--red-grad); display: grid; place-items: center; box-shadow: 0 8px 18px rgba(240,28,36,.32); position: relative; }
.sp-ico svg { width: 24px; height: 24px; color: #fff; }
.support2 h3 { font-size: 18px; color: var(--text); margin-top: 16px; position: relative; }
.support2 p { font-size: 13px; color: #7a5550; line-height: 1.55; margin-top: 8px; position: relative; }
.support2 .btn { align-self: flex-start; margin-top: 18px; position: relative; }

/* corner-tweak coverage for the soft-red cards */
html[data-corners="sharp"] .idcard2,
html[data-corners="sharp"] .support2,
html[data-corners="sharp"] .id-feat,
html[data-corners="sharp"] .id-stats .ist,
html[data-corners="sharp"] .sp-ico { border-radius: 4px; }
html[data-corners="round"] .idcard2,
html[data-corners="round"] .support2 { border-radius: 26px; }
html[data-corners="round"] .id-feat,
html[data-corners="round"] .id-stats .ist,
html[data-corners="round"] .sp-ico { border-radius: 16px; }
html[data-corners="sharp"] .userbox { border-radius: 5px; }
html[data-corners="round"] .userbox { border-radius: 28px; }

/* ============================================================
   THEME TOGGLE BUTTON (top bar)
   ============================================================ */
.theme-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.42);
  backdrop-filter: blur(12px) saturate(1.25);
  -webkit-backdrop-filter: blur(12px) saturate(1.25);
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: 0 4px 16px rgba(150,70,50,.10);
  display: grid; place-items: center; color: var(--text);
}
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn:hover { background: rgba(255,255,255,.62); }
.theme-btn .ic-sun { display: none; }
.theme-btn .ic-moon { display: block; }
html[data-theme="dark"] .theme-btn .ic-sun { display: block; }
html[data-theme="dark"] .theme-btn .ic-moon { display: none; }

/* Smooth cross-fade when switching themes */
body, .app, .card, .course, .feed-card, .post, .bn, .userbox,
.idcard2, .support2, .composer, .r-item, .set-btn, .ic-btn, .theme-btn,
.c-tags span, .id-stats .ist {
  transition: background-color .35s ease, color .35s ease,
              border-color .35s ease, box-shadow .35s ease;
}

/* ============================================================
   DARK MODE
   ============================================================ */
html[data-theme="dark"] {
  --red: #ff3b41;
  --red-700: #ff6166;
  --red-soft: #3a1b1d;

  --ink: #322b22;
  --ink-2: #3d3527;

  --card: #1b1813;
  --cream: #241f18;

  --text: #f3ede1;
  --text-2: #b4a995;
  --muted: #7f7665;
  --line: #2b251d;
  --line-2: #39311f;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.30);
  --shadow-md: 0 8px 22px rgba(0,0,0,.45), 0 18px 40px rgba(0,0,0,.35);
}

html[data-theme="dark"] body { background: #0e0b09; }

html[data-theme="dark"] .app {
  background:
    radial-gradient(620px 360px at 86% 4%, rgba(241,72,78,.13), transparent 70%),
    radial-gradient(520px 360px at 8% 104%, rgba(241,72,78,.06), transparent 72%),
    linear-gradient(150deg, #1a1410 0%, #141009 45%, #181210 100%);
  box-shadow: 0 30px 70px rgba(0,0,0,.55);
}
html[data-theme="dark"] .app::after { border-color: rgba(241,90,96,.18); }

/* Glassy top-bar controls */
html[data-theme="dark"] .set-btn,
html[data-theme="dark"] .ic-btn,
html[data-theme="dark"] .theme-btn {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 4px 16px rgba(0,0,0,.30);
}
html[data-theme="dark"] .set-btn:hover,
html[data-theme="dark"] .ic-btn:hover,
html[data-theme="dark"] .theme-btn:hover { background: rgba(255,255,255,.11); }
html[data-theme="dark"] .ic-btn .dot { border-color: var(--card); }

/* Left rail hover */
html[data-theme="dark"] .r-item:hover { background: rgba(255,255,255,.08); color: var(--text); box-shadow: none; }

/* Stat strip */
html[data-theme="dark"] .bn { background-color: rgba(255,255,255,.03); }
html[data-theme="dark"] .d-hatch { background: repeating-linear-gradient(45deg, #4a4030, #4a4030 2px, transparent 2px, transparent 4px); }
html[data-theme="dark"] .s-hatch { background: repeating-linear-gradient(45deg, #4a4030, #4a4030 4px, #2e271c 4px, #2e271c 8px); }

/* Community feed surface */
html[data-theme="dark"] .feed-card { background-color: #1d1812; }

/* User box (right column) — pink glass becomes warm-dark glass */
html[data-theme="dark"] .idcard2,
html[data-theme="dark"] .support2 {
  background: linear-gradient(165deg, rgba(255,90,92,.10) 0%, rgba(240,40,46,.10) 100%);
}
html[data-theme="dark"] .id-ava { background: #3a201e; border-color: rgba(255,255,255,.12); }
html[data-theme="dark"] .id-ava svg { color: #d98e88; }
html[data-theme="dark"] .id-sid { color: #d99a93; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.10); }
html[data-theme="dark"] .id-stats .ist { background-color: rgba(255,255,255,.05); }
html[data-theme="dark"] .id-stats .ist .k { color: #b78f8a; }
html[data-theme="dark"] .support2 p { color: #c2a39e; }

/* Composer tool hover */
html[data-theme="dark"] .composer .tools button:hover { background: rgba(255,255,255,.08); }

/* Per-card soft glow, a touch stronger on dark (re-applied after bg overrides) */
html[data-theme="dark"] .card,
html[data-theme="dark"] .course,
html[data-theme="dark"] .feed-card,
html[data-theme="dark"] .post {
  background-image: radial-gradient(170px 150px at 100% 0%, rgba(241,84,90,.10), transparent 60%);
}
/* ============================================================
   DROPDOWN MENUS (notifications + user)
   ============================================================ */
.menu { position: relative; }
.menu .dropdown {
  position: absolute; right: 0; top: calc(100% + 12px);
  width: min(330px, calc(100vw - 24px));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 8px;
  z-index: 300;
  opacity: 0; visibility: hidden;
  transform: translateY(-8px) scale(.98);
  transform-origin: top right;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.menu.open .dropdown { opacity: 1; visibility: visible; transform: none; }
.menu .dropdown::before {
  content: ""; position: absolute; top: -6px; right: 16px;
  width: 12px; height: 12px; background: var(--card);
  border-left: 1px solid var(--line); border-top: 1px solid var(--line);
  transform: rotate(45deg); border-radius: 2px;
}

/* Notifications panel */
.dd-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 10px; }
.dd-head h4 { font-size: 15px; font-family: var(--display); }
.dd-badge { font-size: 10.5px; font-weight: 700; font-family: var(--mono); background: var(--red-soft); color: var(--red); padding: 2px 8px; border-radius: 999px; }
.dd-clear { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.dd-clear:hover { color: var(--red); }
.dd-list { display: flex; flex-direction: column; max-height: 322px; overflow-y: auto; }
.noti { display: flex; gap: 11px; padding: 10px; border-radius: 11px; position: relative; transition: background .15s; }
.noti:hover { background: var(--cream); }
.noti.unread::after { content: ""; position: absolute; top: 13px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.noti-ic { width: 36px; height: 36px; border-radius: 10px; flex: 0 0 36px; display: grid; place-items: center; color: #fff; }
.noti-ic svg { width: 17px; height: 17px; }
.ni-red { background: var(--red-grad); }
.ni-ink { background: linear-gradient(135deg,#3a332a,#16130d); }
.ni-soft { background: #ff9b9d; }
.noti-body { display: flex; flex-direction: column; min-width: 0; }
.noti-t { font-size: 13px; font-weight: 600; color: var(--text); }
.noti-s { font-size: 12px; color: var(--text-2); line-height: 1.4; margin-top: 2px; }
.noti-time { font-size: 10.5px; color: var(--muted); font-weight: 500; margin-top: 4px; font-family: var(--mono); }
.dd-foot { display: block; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--red); padding: 11px; margin-top: 4px; border-top: 1px solid var(--line); }
.dd-foot:hover { background: var(--cream); border-radius: 0 0 11px 11px; }

/* User menu panel */
.user-dd { width: min(258px, calc(100vw - 24px)); }
.ud-head { display: flex; align-items: center; gap: 11px; padding: 10px 10px 12px; }
.ud-ava { width: 42px; height: 42px; border-radius: 50%; flex: 0 0 42px; background: var(--red-grad); color: #fff; font-weight: 700; font-size: 16px; display: grid; place-items: center; }
.ud-info { display: flex; flex-direction: column; min-width: 0; }
.ud-name { font-size: 14px; font-weight: 700; color: var(--text); }
.ud-mail { font-size: 11px; color: var(--muted); font-family: var(--mono); margin-top: 2px; }
.ud-list { display: flex; flex-direction: column; }
.ud-item { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--text); transition: background .15s, color .15s; }
.ud-item svg { width: 17px; height: 17px; color: var(--text-2); }
.ud-item:hover { background: var(--cream); }
.ud-item:hover svg { color: var(--red); }
.ud-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.ud-danger { color: var(--red); }
.ud-danger svg { color: var(--red); }
.ud-danger:hover { background: var(--red-soft); }

/* ============================================================
   ENTRANCE + GRAPH ANIMATIONS
   ============================================================ */
html.js-anim .hello,
html.js-anim .strip,
html.js-anim .courses-area,
html.js-anim .perf,
html.js-anim .comp,
html.js-anim .userbox,
html.js-anim .section,
html.js-anim .course,
html.js-anim .xcard,
html.js-anim .post { opacity: 0; transform: translateY(18px); will-change: opacity, transform; }

html.js-anim .is-visible {
  opacity: 1 !important; transform: none !important;
  transition: opacity .6s cubic-bezier(.22,.61,.36,1), transform .6s cubic-bezier(.22,.61,.36,1);
}
.course-grid .course:nth-child(1) {background-image: url(../image/security-img-1.jpg);}
.course-grid .course:nth-child(2) {background-image: url(../image/security-img-2.jpg);}
.course-grid .course:nth-child(3) {background-image: url(../image/security-img-3.jpg);}

/* Graph element transitions (revealed by JS once their card is visible) */
html.js-anim .c-prog .bar i,
html.js-anim .id-feat .bar i,
html.js-anim .track .seg { transition: width 1.1s cubic-bezier(.5,0,.1,1); }
html.js-anim .lines polyline { transition: stroke-dashoffset 1.5s ease; }

/* Donut sweep (animatable via @property where supported) */
@property --p { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
html.js-anim .donut { --p: 0%; background: conic-gradient(var(--red) 0% var(--p), var(--ink) var(--p) 100%); }
html.js-anim .donut.go { animation: donutSweep 1.2s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes donutSweep { from { --p: 0%; } to { --p: 67%; } }

@media (prefers-reduced-motion: reduce) {
  html.js-anim .hello, html.js-anim .strip, html.js-anim .courses-area,
  html.js-anim .perf, html.js-anim .comp, html.js-anim .userbox,
  html.js-anim .section, html.js-anim .course, html.js-anim .xcard,
  html.js-anim .post { opacity: 1 !important; transform: none !important; }
}
/* ============================================================
   MOBILE NAV (hamburger drawer)
   ============================================================ */
.nav-toggle {
  width: 40px; height: 40px; border-radius: 12px;
  display: none; place-items: center;
  background: rgba(255,255,255,.42);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: 0 4px 16px rgba(150,70,50,.10);
  color: var(--text); margin-right: 6px; flex: 0 0 auto;
}
.nav-toggle svg { width: 21px; height: 21px; }
.nav-toggle .ic-x { display: none; }
.app.nav-open .nav-toggle .ic-bars { display: none; }
.app.nav-open .nav-toggle .ic-x { display: block; }

.rail-drawer-head { display: none; }
.nav-backdrop { display: none; }

html[data-theme="dark"] .nav-toggle {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 4px 16px rgba(0,0,0,.30);
}

@media (max-width:1400px) {
 html[data-density="airy"] .board {
    gap: 15px;
}
html[data-density="airy"] .course-grid, html[data-density="airy"] .explore-grid {
    gap: 15px;
}
html[data-density="airy"] .feed {
    gap: 15px;
}
.c-title{font-size: 20px;}
}

@media (max-width: 760px) {
  body { overflow-x: hidden; }
  .nav-toggle { display: grid; }
  .rail-logo { margin-right: auto; }
  .set-btn { display: none; }          /* settings still available in the user menu */
  .actions { gap: 6px; }
  .menu .dropdown{    width: min(330px, calc(85vw - 24px))}
  /* Slide-in drawer */
  .rail {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 252px; max-width: 84vw;
    flex-direction: column; gap: 4px;
    padding: 16px 12px 22px;
    background: var(--card);
    box-shadow: none;
    border-right: 1px solid var(--line);
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    z-index: 1000; overflow-y: auto; align-items: stretch;
  }
  .app.nav-open .rail { transform: translateX(0); }

  .rail-drawer-head { display: flex; align-items: center; padding: 4px 10px 16px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
  .rail-drawer-head img { height: 24px; width: auto; }

  .rail-nav { flex-direction: column; gap: 3px; width: 100%; }
  .r-item { width: 100%; height: 48px; justify-content: flex-start; gap: 14px; padding: 0 14px; border-radius: 12px;display: flex; }
  .r-item svg { width: 20px; height: 20px; flex: 0 0 20px; }
  .r-item .r-label {
    position: static; opacity: 1; pointer-events: auto;
    transform: none; background: none; color: inherit;
    box-shadow: none; padding: 0; white-space: nowrap;
    font-size: 14px; font-weight: 600; z-index: auto;
  }
  .r-item:hover .r-label { transform: none; }

  .nav-backdrop {
    display: block; position: fixed; inset: 0;
    background: rgba(15,10,8,.55);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden;
    transition: opacity .3s ease, visibility .3s; z-index: 990;
  }
  .app.nav-open .nav-backdrop { opacity: 1; visibility: visible; }
}
/* ============================================================
   RESPONSIVE GRID OVERRIDES
   These MUST come last: the base .course-grid / .explore-grid /
   .feed / .promo rules are declared later in the file than the
   main @media block, so without this they'd win at mobile widths.
   ============================================================ */
@media (max-width: 1180px) {
  .explore-grid { grid-template-columns: repeat(2, 1fr); }
  .feed { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .explore-grid { grid-template-columns: repeat(2, 1fr); }
  .feed { grid-template-columns: 1fr; }
  .promo { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .course-grid { grid-template-columns: 1fr; }
  .explore-grid { grid-template-columns: 1fr; }
  .feed { grid-template-columns: 1fr; }
  .promo { grid-template-columns: 1fr; text-align: left; }
  .promo .info { text-align: left; justify-content: flex-start; }
}
/* Stat cards: stack on mobile so they never force a min-width overflow.
   (Kept last to override the base .bignums and the airy-density .hello.) */
@media (max-width: 760px) {
  .bignums { grid-template-columns: 1fr; gap: 12px; }
  .bn { padding: 16px 18px; }
  .bn:not(:first-child)::before { display: none; }
  html[data-density="airy"] .hello,
  .hello { font-size: 27px; margin-top: 34px; margin-bottom: 15px;}
}
/* ============================================================
   MOBILE OVERFLOW FIX
   'airy' density's large padding inflates each grid item's
   min-content size; with default minmax(auto,1fr) tracks this
   forces the column wider than the viewport (clipped by .app).
   Fix: minmax(0,1fr) so columns shrink, + tame airy on phones.
   ============================================================ */
@media (max-width: 760px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .course-grid,
  .explore-grid,
  .feed { grid-template-columns: minmax(0, 1fr); }
  .main, .courses-area, .perf, .comp, .userbox,
  .section, .feed-card, .course { min-width: 0; }

  /* Section headers wrap instead of pushing See All / links off-screen */
  .sec-head { flex-wrap: wrap; }

  /* Tame 'airy' density on phones (its desktop spacing is too large) */
  html[data-density="airy"] .card,
  html[data-density="airy"] .feed-card { padding: 18px; }
  html[data-density="airy"] .course { padding: 18px; }
  html[data-density="airy"] .board { gap: 16px; }
  html[data-density="airy"] .course-grid,
  html[data-density="airy"] .explore-grid,
  html[data-density="airy"] .feed { gap: 16px; }
  html[data-density="airy"] .section { margin-top: 26px; }
  html[data-density="airy"] .strip { padding: 18px 4px 22px; }
  html[data-density="airy"] .hello { font-size: 30px; margin-top: 14px; }
}
@media (max-width: 760px) {
  /* Composer: let the input shrink so the Post button stays in view */
  .composer input { min-width: 0; }
  /* Card headers (Course Performance / Progress Composition): wrap controls */
  .c-head { flex-wrap: wrap; }
}
/* Dark mode: remove the course photo backgrounds (keep the soft red glow) */
html[data-theme="dark"] .course-grid .course:nth-child(1),
html[data-theme="dark"] .course-grid .course:nth-child(2),
html[data-theme="dark"] .course-grid .course:nth-child(3) {
  background-image: radial-gradient(170px 150px at 100% 0%, rgba(241,84,90,.10), transparent 60%);
}
/* ============================================================
   LEFT RAIL — sticky on scroll + expand/collapse (desktop)
   ============================================================ */
@media (min-width: 761px) {
  /* overflow:clip clips the decorative glows like hidden did, but does NOT
     create a scroll container, so position:sticky on the rail works. */
  .app { overflow: clip; }

  .rail {
    position: sticky;
    top: 28px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
    overflow: visible;
    /* overflow-x: hidden; */
    scrollbar-width: none;
    transition: flex-basis .25s ease;
    z-index: 8;
  }
  .rail::-webkit-scrollbar { display: none; }

  /* Collapse / expand toggle button */
  .rail-toggle {
    width: 44px; height: 38px; border-radius: 10px;
    display: grid; place-items: center;
    color: var(--text-2); margin-bottom: 4px; flex: 0 0 auto;
    transition: background .15s, color .15s;
  }
  .rail-toggle:hover { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
  .rail-toggle svg { width: 20px; height: 20px; }
  .rail-toggle .ic-collapse { display: none; }

  /* ---- Expanded state (icon + text, like the mobile drawer) ---- */
  html.rail-expanded .rail { flex-basis: 218px; align-items: stretch; }
  html.rail-expanded .rail-nav { width: 100%; }
  html.rail-expanded .r-item {
    width: 100%; height: 46px; justify-content: flex-start;
    gap: 13px; padding: 0 14px;display: flex;
  }
  html.rail-expanded .r-item svg { flex: 0 0 21px; }
  html.rail-expanded .r-item .r-label {
    position: static; opacity: 1; pointer-events: auto;
    transform: none; background: none; color: inherit;
    box-shadow: none; padding: 0; font-size: 14px; font-weight: 600;
    white-space: nowrap; z-index: auto;
  }
  html.rail-expanded .r-item:hover .r-label { transform: none; }
  html.rail-expanded .rail-toggle {
    width: 100%; place-items: center start; padding: 0 12px;
  }
  html.rail-expanded .rail-toggle .ic-expand { display: none; }
  html.rail-expanded .rail-toggle .ic-collapse { display: block; }

}

/* Hide the rail toggle on mobile (the hamburger handles nav there) */
@media (max-width: 760px) {
  .rail-toggle { display: none; }
    .idcard2{overflow: visible;}
  .support2{overflow: visible;}
}

/* Dark-mode hover for the rail toggle */
html[data-theme="dark"] .rail-toggle:hover { background: rgba(255,255,255,.08); color: var(--text); box-shadow: none; }
/* ============================================================
   SITE FOOTER (white theme) + rail logout button
   ============================================================ */
.site-footer { background: #ffffff; border-top: 1px solid var(--line-2); border-radius: 14px; margin-top: 36px; box-shadow: var(--shadow-sm); }
.site-footer .sf-inner { padding: 32px 34px; display: flex; align-items: center; gap: 44px; flex-wrap: wrap; }
.sf-brand img { height: 30px; width: auto; }
.sf-contact { display: flex; flex-direction: column; gap: 11px; }
.sf-contact a { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); font-weight: 500; }
.sf-contact a:hover { color: var(--red); }
.sf-contact a svg { width: 16px; height: 16px; color: var(--muted); }
.sf-download { margin-left: auto; display: flex; flex-direction: column; gap: 13px; align-items: flex-end; }
.sf-dl-label { font-size: 13px; color: var(--text-2); font-weight: 600; line-height: 1.35; text-align: right; }
.sf-stores { display: flex; gap: 12px; }
.sf-store { display: inline-flex; align-items: center; gap: 9px; background: var(--ink); color: #fff; border-radius: 11px; padding: 8px 16px; transition: transform .12s, box-shadow .15s; }
.sf-store:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.sf-store > svg { width: 22px; height: 22px; }
.sf-store .st { display: flex; flex-direction: column; line-height: 1.12; }
.sf-store .st .s { font-size: 9px; opacity: .82; }
.sf-store .st .b { font-size: 14px; font-weight: 700; font-family: var(--display); }
.sf-socials { display: flex; gap: 9px; }
.sf-socials a { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--cream); color: var(--text-2); transition: background .15s, color .15s; }
.sf-socials a:hover { background: var(--red); color: #fff; }
.sf-socials svg { width: 16px; height: 16px; }

html[data-theme="dark"] .site-footer { background: #1b1813; border-top-color: var(--line); }
html[data-theme="dark"] .sf-store { background: #2c251c; }
html[data-theme="dark"] .sf-socials a { background: rgba(255,255,255,.05); }

@media (max-width: 760px) {
  .site-footer .sf-inner { gap: 26px; padding: 24px 20px; }
  .sf-download { margin-left: 0; align-items: flex-start; }
  .sf-dl-label { text-align: left; }
}

/* ---- Rail logout button (light-red floating) ---- */
.r-logout {
  margin-top: auto; position: relative;
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; flex: 0 0 auto;
  background: var(--red-soft); color: var(--red);
  box-shadow: 0 8px 18px rgba(240,28,36,.18);
  transition: background .15s, box-shadow .15s, transform .12s;
}
.r-logout:hover { background: #ffd2d3; box-shadow: 0 12px 24px rgba(240,28,36,.32); transform: translateY(-1px); }
.r-logout:active { transform: translateY(0); }
.r-logout svg { width: 20px; height: 20px; }
.r-logout .r-label {
  position: absolute; left: 52px; top: 50%;
  transform: translateY(-50%) translateX(-6px);
  background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 8px 12px; border-radius: 8px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
  box-shadow: var(--shadow-md); z-index: 80;
}
.r-logout:hover .r-label { opacity: 1; transform: translateY(-50%) translateX(0); }
html[data-theme="dark"] .r-logout { background: #3a1c1e; box-shadow: 0 8px 18px rgba(0,0,0,.35); }
html[data-theme="dark"] .r-logout:hover { background: #4a2224; }

/* give the rail full height so the logout pins to the bottom */
@media (min-width: 761px) { .rail { height: calc(100vh - 40px); } }

/* expanded rail: logout shows inline label */
@media (min-width: 761px) {
  html.rail-expanded .r-logout { width: 100%; display: flex; align-items: center; justify-content: flex-start; gap: 13px; padding: 0 14px; }
  html.rail-expanded .r-logout .r-label { position: static; opacity: 1; transform: none; background: none; color: inherit; box-shadow: none; padding: 0; font-size: 14px; pointer-events: auto; }
}
/* mobile drawer: logout inline label */
@media (max-width: 760px) {
  .r-logout { width: 100%; height: 48px; display: flex; align-items: center; justify-content: flex-start; gap: 14px; padding: 0 14px; }
  .r-logout .r-label { position: static; opacity: 1; transform: none; background: none; color: inherit; box-shadow: none; padding: 0; font-size: 14px; font-weight: 600; pointer-events: auto; }
}
/* ============================================================
   Sticky top bar on scroll  +  icon-only Setting button
   ============================================================ */
/* overflow:clip (not hidden) so the sticky header works at every width */
.app { overflow: clip; }

.topbar {
  position: sticky; top: 0; z-index: 95;
  padding: 12px 6px; margin: -4px -6px 10px;
  /* background: rgba(255,250,244,.82); */
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
html[data-theme="dark"] .topbar { background: rgba(24,19,14,.86); border-bottom-color: var(--line); }

/* Setting button: icon only (drop the "Setting" text) to match the icon row */
.set-btn {
  width: 38px; height: 38px; padding: 0; gap: 0;
  font-size: 0; border-radius: 50%; justify-content: center;
}
.set-btn svg { width: 18px; height: 18px; }
/* Explore badge: dark glassy pill in dark mode (was a white pill with
   invisible light text). Matches the rating chip. */
html[data-theme="dark"] .x-badge2 {
  background: rgba(20,15,12,.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: #fff; box-shadow: none; border: 1px solid rgba(255,255,255,.12);
}