/* ================================================================
   Malakatech Helpdesk — Main Stylesheet
   Meta/MD Design System · WordPress 6.x
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #f0f2f5;
  --surface:    #ffffff;
  --surface2:   #f5f6f8;
  --border:     #e0e3e8;
  --border2:    #d0d4da;
  --text:       #1c1e21;
  --text-2:     #65676b;
  --text-3:     #8a8d91;
  --blue:       #1877f2;
  --blue-dk:    #1464d2;
  --blue-lt:    #e7f0fd;
  --blue-ring:  rgba(24,119,242,.18);
  --green:      #42b883;
  --green-lt:   #e8f7f0;
  --amber:      #f59e0b;
  --amber-lt:   #fef3c7;
  --red:        #e74c3c;
  --red-lt:     #fdecea;
  --violet:     #7c3aed;
  --violet-lt:  #ede9fe;
  --sidebar-w:  268px;
  --topbar-h:   56px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ── TOPBAR ──────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 1.25rem 0 1rem; gap: 1rem;
}
.topbar-brand {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 700; font-size: .95rem; color: var(--text);
  min-width: calc(var(--sidebar-w) - 1rem);
  text-decoration: none; white-space: nowrap;
}
.topbar-brand img { max-height: 28px; width: auto; }
.logo-box {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: var(--blue);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.topbar-search {
  position: relative; flex: 1; max-width: 440px;
  display: flex; align-items: center;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 0 .75rem; gap: .5rem;
  transition: border-color .15s, box-shadow .15s;
}
.topbar-search:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-ring);
  background: #fff;
}
.topbar-search input {
  flex: 1; border: none; outline: none; background: none;
  font-family: inherit; font-size: .875rem;
  color: var(--text); height: 34px;
}
.topbar-search input::placeholder { color: var(--text-3); }
.icon-muted { color: var(--text-3); flex-shrink: 0; }

/* live search dropdown */
.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.1);
  z-index: 300; overflow: hidden;
}
.search-dropdown[hidden] { display: none; }
.sd-item {
  display: flex; align-items: flex-start; gap: .65rem;
  padding: .7rem .9rem; text-decoration: none; color: var(--text);
  transition: background .12s;
  border-bottom: 1px solid var(--border);
}
.sd-item:last-child { border-bottom: none; }
.sd-item:hover { background: var(--surface2); }
.sd-icon {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin-top: .1rem;
}
.sd-title { font-size: .84rem; font-weight: 600; line-height: 1.3; }
.sd-cat   { font-size: .72rem; color: var(--text-3); margin-top: .15rem; }
.sd-empty { padding: 1rem; text-align: center; color: var(--text-3); font-size: .85rem; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.topbar-btn {
  display: flex; align-items: center; gap: .4rem;
  padding: .45rem .9rem; border-radius: 6px;
  background: var(--blue); color: #fff;
  font-size: .8rem; font-weight: 600; border: none; cursor: pointer;
  font-family: inherit; transition: background .15s; text-decoration: none;
}
.topbar-btn:hover { background: var(--blue-dk); }
.topbar-icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: none;
  background: var(--surface2); color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.topbar-icon-btn:hover { background: var(--border); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, #42a5f5 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: #fff; cursor: pointer; flex-shrink: 0;
}
.mob-toggle {
  display: none; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  border: none; background: var(--surface2); cursor: pointer; color: var(--text-2);
}

/* ── LAYOUT ──────────────────────────────────────────────── */
.layout { display: flex; margin-top: var(--topbar-h); min-height: calc(100vh - var(--topbar-h)); }

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
  overflow-y: auto; overflow-x: hidden;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: .75rem .6rem 1.5rem;
  display: flex; flex-direction: column; gap: 0;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.sb-label {
  font-size: .66rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-3);
  padding: .8rem .65rem .3rem;
}
.sb-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .46rem .65rem; border-radius: 8px;
  cursor: pointer; color: var(--text-2);
  font-size: .855rem; font-weight: 500;
  transition: background .12s, color .12s;
  border: none; background: none; width: 100%; text-align: left;
  font-family: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none;
}
.sb-item:hover { background: var(--surface2); color: var(--text); }
.sb-item.active, .sb-item:is(.current-cat, .current-menu-item) {
  background: var(--blue-lt); color: var(--blue);
}
.sb-item.active .sb-icon { color: var(--blue); }
.sb-icon { flex-shrink: 0; color: var(--text-3); }
.sb-badge {
  margin-left: auto; flex-shrink: 0;
  font-size: .68rem; font-weight: 600;
  padding: .1rem .42rem; border-radius: 99px;
  background: var(--border); color: var(--text-2);
}
.sb-item.active .sb-badge { background: var(--blue); color: #fff; }

/* Category group */
.sb-group { display: flex; flex-direction: column; }
.sb-group-header {
  display: flex; align-items: center; gap: .6rem;
  padding: .46rem .65rem; border-radius: 8px;
  cursor: pointer; color: var(--text-2);
  font-size: .855rem; font-weight: 600;
  transition: background .12s, color .12s;
  border: none; background: none; width: 100%; text-align: left;
  font-family: inherit; user-select: none;
}
.sb-group-header:hover { background: var(--surface2); color: var(--text); }
.sb-group-header.open  { color: var(--text); }
.gh-icon    { flex-shrink: 0; color: var(--text-3); }
.sb-group-header.open .gh-icon { color: inherit; }
.gh-label   { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-badge-sm {
  font-size: .68rem; font-weight: 600; flex-shrink: 0;
  padding: .1rem .4rem; border-radius: 99px;
  background: var(--border); color: var(--text-2);
}
.gh-chevron { margin-left: .25rem; flex-shrink: 0; color: var(--text-3); transition: transform .2s; }
.sb-group-header.open .gh-chevron { transform: rotate(90deg); }

/* Sub-menu */
.sb-sub {
  display: flex; flex-direction: column;
  overflow: hidden; max-height: 0;
  transition: max-height .25s ease;
}
.sb-sub.open { max-height: 800px; }
.sb-sub-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .36rem .65rem .36rem 2.2rem;
  border-radius: 7px; cursor: pointer;
  color: var(--text-2); font-size: .81rem; font-weight: 400;
  transition: background .12s, color .12s;
  border: none; background: none; width: 100%; text-align: left;
  font-family: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none;
}
.sb-sub-item:hover { background: var(--surface2); color: var(--text); }
.sb-sub-item.active { background: var(--blue-lt); color: var(--blue); font-weight: 500; }
.sb-sub-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-3); flex-shrink: 0; transition: background .12s;
}
.sb-sub-item.active .sb-sub-dot { background: var(--blue); }
.sb-sub-item:hover .sb-sub-dot  { background: var(--text-2); }

.sb-divider { height: 1px; background: var(--border); margin: .4rem 0; }

/* Sidebar footer CTA */
.sb-footer { margin-top: auto; padding-top: .75rem; }
.sb-cta {
  padding: .75rem; border-radius: 10px;
  background: var(--blue-lt); border: 1px solid rgba(24,119,242,.15);
}
.sb-cta-head {
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: .35rem; font-size: .78rem; font-weight: 600; color: var(--blue);
}
.sb-cta p { font-size: .73rem; color: var(--text-2); line-height: 1.5; margin-bottom: .55rem; }

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: 8px;
  background: var(--blue); color: #fff;
  font-size: .82rem; font-weight: 600; border: none; cursor: pointer;
  font-family: inherit; transition: background .15s; text-decoration: none;
  justify-content: center; width: 100%;
}
.btn-primary:hover { background: var(--blue-dk); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: 8px;
  background: var(--surface2); color: var(--text-2);
  font-size: .82rem; font-weight: 600;
  border: 1px solid var(--border); cursor: pointer;
  font-family: inherit; transition: border-color .15s; text-decoration: none;
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

/* ── MAIN ──────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1; min-width: 0;
  padding: 2rem 2.25rem;
}

/* ── PAGE HEADER ───────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; gap: .85rem;
  margin-bottom: 1.75rem;
}
.page-header-icon {
  width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.page-header h1 {
  font-size: 1.45rem; font-weight: 700; letter-spacing: -.025em; margin-bottom: .3rem;
}
.page-header p { color: var(--text-2); font-size: .875rem; line-height: 1.6; }

/* ── STATS ROW ─────────────────────────────────────────────── */
.stats-row {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: .85rem; margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: .9rem 1rem;
  display: flex; align-items: center; gap: .8rem;
  transition: box-shadow .15s;
}
.stat-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.07); }
.stat-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-num {
  font-size: 1.3rem; font-weight: 700;
  font-family: 'IBM Plex Mono', monospace; line-height: 1;
}
.stat-label { font-size: .72rem; color: var(--text-2); margin-top: .15rem; }

/* Stat card — artikel terpopuler */
.stat-card--popular { align-items: flex-start; }
.stat-popular-info  { min-width: 0; flex: 1; }
.stat-popular-title {
  display: block; font-size: .8rem; font-weight: 600; color: var(--text);
  text-decoration: none; line-height: 1.35; margin-top: .1rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stat-popular-title:hover { color: var(--blue); }
.stat-popular-views {
  display: flex; align-items: center; gap: .25rem;
  font-size: .7rem; color: var(--text-3); margin-top: .25rem;
  font-family: 'IBM Plex Mono', monospace;
}
/* Dim state — plugin belum aktif */
.stat-card--dim { opacity: .65; }
.stat-pending   { color: var(--text-3); font-size: 1.1rem; }
.stat-hint      { display: block; font-size: .65rem; color: var(--text-3); font-style: italic; margin-top: .1rem; }

/* Admin notice */
.mhd-admin-notice {
  display: flex; align-items: flex-start; gap: .6rem;
  background: #fffbeb; border: 1px solid #fcd34d;
  border-radius: 10px; padding: .75rem 1rem;
  font-size: .82rem; color: #92400e; margin-bottom: 1.5rem; line-height: 1.5;
}
.mhd-admin-notice a { color: var(--blue); font-weight: 600; }

/* View count badge on cards */
.card-views {
  display: flex; align-items: center; gap: .25rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem; color: var(--text-3);
}

/* ── SECTION ───────────────────────────────────────────────── */
.sec-block { margin-bottom: 2.25rem; }
.sec-head {
  display: flex; align-items: center; gap: .65rem; margin-bottom: .9rem;
}
.s-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.sec-head h2 { font-size: .975rem; font-weight: 700; }
.s-count { margin-left: auto; font-family: 'IBM Plex Mono', monospace; font-size: .7rem; color: var(--text-3); }
.sec-sep { height: 1px; background: var(--border); margin-bottom: 1.25rem; }

/* ── CARDS GRID ────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: .9rem;
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.1rem 1.2rem;
  transition: box-shadow .15s, border-color .15s, transform .15s;
  animation: fadeUp .35s ease both;
  display: flex; flex-direction: column;
}
.card:hover {
  box-shadow: 0 4px 18px rgba(0,0,0,.08);
  border-color: var(--border2); transform: translateY(-2px);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card:nth-child(1){animation-delay:.04s} .card:nth-child(2){animation-delay:.08s}
.card:nth-child(3){animation-delay:.12s} .card:nth-child(4){animation-delay:.16s}
.card:nth-child(5){animation-delay:.20s} .card:nth-child(6){animation-delay:.24s}

.card-meta { display: flex; align-items: center; gap: .5rem; margin-bottom: .65rem; }
.cat-pill {
  display: inline-flex; align-items: center; gap: .28rem;
  font-size: .68rem; font-weight: 600; padding: .18rem .52rem;
  border-radius: 6px; text-transform: uppercase; letter-spacing: .04em;
  text-decoration: none;
}
.card-level {
  margin-left: auto; font-size: .7rem; color: var(--text-3); font-weight: 500;
  display: flex; align-items: center; gap: .25rem;
}
.card h3 {
  font-size: .9rem; font-weight: 700; line-height: 1.4; margin-bottom: .4rem;
}
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--blue); }
.card p  { font-size: .815rem; color: var(--text-2); line-height: 1.65; margin-bottom: .85rem; flex: 1; }
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border); padding-top: .65rem;
}
.card-time {
  font-family: 'IBM Plex Mono', monospace; font-size: .68rem; color: var(--text-3);
  display: flex; align-items: center; gap: .28rem;
}
.card-cta {
  display: flex; align-items: center; gap: .28rem;
  font-size: .76rem; font-weight: 600; color: var(--blue);
  text-decoration: none; transition: gap .15s;
}
.card:hover .card-cta { gap: .45rem; }

/* ── ARTICLE SINGLE ────────────────────────────────────────── */
.art-breadcrumb {
  display: flex; align-items: center; gap: .4rem;
  font-size: .8rem; color: var(--text-3); margin-bottom: 1.4rem; flex-wrap: wrap;
}
.art-breadcrumb a { color: var(--blue); text-decoration: none; }
.art-breadcrumb a:hover { text-decoration: underline; }
.art-breadcrumb .sep { color: var(--border2); }

.art-header {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.75rem 2rem; margin-bottom: 1.5rem;
}
.art-header-top { display: flex; align-items: flex-start; gap: .85rem; margin-bottom: 1rem; }
.art-header-icon {
  width: 44px; height: 44px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.art-header h1 {
  font-size: 1.35rem; font-weight: 700; line-height: 1.3; letter-spacing: -.025em;
}
.art-meta-row { display: flex; align-items: center; gap: .85rem; flex-wrap: wrap; }
.art-meta-item {
  display: flex; align-items: center; gap: .35rem;
  font-size: .78rem; color: var(--text-3);
}

.art-body {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.75rem 2rem; margin-bottom: 1.5rem;
  font-size: .9rem; line-height: 1.8; color: var(--text-2);
}
.art-body h2, .art-body h3, .art-body h4 {
  color: var(--text); font-weight: 700;
  margin: 1.5rem 0 .55rem;
  padding-bottom: .4rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .4rem;
}
.art-body h2 { font-size: 1.1rem; }
.art-body h3 { font-size: 1rem; }
.art-body h4 { font-size: .9rem; }
.art-body h2:first-child,
.art-body h3:first-child,
.art-body h4:first-child { margin-top: 0; }
.art-body p  { margin: .6rem 0; }
.art-body ol, .art-body ul {
  padding-left: 1.5rem; display: flex; flex-direction: column; gap: .4rem;
}
.art-body li { color: var(--text-2); }
.art-body strong { color: var(--text); font-weight: 600; }
.art-body code {
  font-family: 'IBM Plex Mono', monospace;
  background: var(--surface2); border: 1px solid var(--border);
  padding: .12rem .42rem; border-radius: 5px; font-size: .82rem; color: var(--blue);
}
.art-body pre {
  background: #1c1e21; border-radius: 10px; padding: 1.1rem 1.25rem;
  overflow-x: auto; margin: .85rem 0;
}
.art-body pre code {
  background: none; border: none; color: #e3e8ef;
  font-size: .83rem; line-height: 1.65;
}
.art-body blockquote {
  border-left: 3px solid var(--blue); padding-left: 1rem;
  color: var(--text-2); font-style: italic; margin: .85rem 0;
}
.art-body img { max-width: 100%; border-radius: 8px; margin: .5rem 0; }
.art-body a { color: var(--blue); }

.art-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.art-actions .btn-ghost,
.art-actions .btn-primary { width: auto; }

/* Related */
.related-section { margin-top: 2rem; }
.related-section h3 {
  font-size: .9rem; font-weight: 700; color: var(--text);
  margin-bottom: .85rem; display: flex; align-items: center; gap: .5rem;
}
.related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: .75rem;
}
.related-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: .9rem 1rem;
  transition: box-shadow .15s, border-color .15s; text-decoration: none; color: inherit;
  display: block;
}
.related-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.07); border-color: var(--border2); }
.related-card h4 { font-size: .825rem; font-weight: 600; line-height: 1.4; margin-bottom: .3rem; color: var(--text); }
.related-card span { font-size: .74rem; color: var(--text-3); display: flex; align-items: center; gap: .25rem; }

/* ── PAGINATION ────────────────────────────────────────────── */
.nav-links {
  display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.5rem;
}
.nav-links a, .nav-links span {
  padding: .4rem .85rem; border-radius: 8px;
  border: 1px solid var(--border); font-size: .82rem; font-weight: 500;
  text-decoration: none; color: var(--text-2);
  transition: border-color .15s, background .15s;
}
.nav-links a:hover { border-color: var(--blue); color: var(--blue); }
.nav-links .current { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── EMPTY STATE ───────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--text-3);
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
}
.empty-state p { font-size: .875rem; }

/* ── FOOTER ────────────────────────────────────────────────── */
.site-footer {
  margin-left: var(--sidebar-w);
  border-top: 1px solid var(--border);
  padding: 1.25rem 2.25rem;
  background: var(--surface);
}
.footer-inner {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  font-size: .8rem; color: var(--text-3);
}
.footer-inner a { color: var(--blue); text-decoration: none; }
.footer-sep { color: var(--border2); }

/* ── PRINT ─────────────────────────────────────────────────── */
@media print {
  .topbar, .sidebar, .site-footer, .art-actions, .related-section { display: none !important; }
  .main { margin-left: 0 !important; padding: 0 !important; }
}

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .22s; z-index: 150;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 1.25rem 1rem; }
  .site-footer { margin-left: 0; }
  .stats-row { grid-template-columns: repeat(2,1fr); }
  .mob-toggle { display: flex; }
  .topbar-brand { min-width: auto; }
}
@media (max-width: 540px) {
  .cards-grid { grid-template-columns: 1fr; }
  .stats-row  { grid-template-columns: 1fr 1fr; }
  .art-header { padding: 1.25rem 1.1rem; }
  .art-body   { padding: 1.25rem 1.1rem; }
  .related-grid { grid-template-columns: 1fr; }
}
/* ================================================================
   TICKER — TV News Style
   ================================================================ */

/* Outer container — fixed height, no text wrap */
.ticker-wrap {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;           /* CRITICAL: clips the scrolling track   */
  margin-bottom: 1.75rem;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
  position: relative;
}

/* "TERBARU" label — fixed left */
.ticker-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: 0 1rem;
  flex-shrink: 0;             /* never shrink                          */
  background: var(--blue);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 2;
}

/* Fade edge after label */
.ticker-label::after {
  content: '';
  position: absolute;
  left: 110px;               /* roughly label width */
  top: 0; bottom: 0;
  width: 24px;
  background: linear-gradient(to right, var(--surface), transparent);
  z-index: 3;
  pointer-events: none;
}

/* Viewport that masks overflow */
.ticker-track-wrap {
  flex: 1;
  min-width: 0;              /* CRITICAL: lets flex child shrink       */
  overflow: hidden;          /* CRITICAL: masks scrolling items        */
  position: relative;
}

/* The moving strip — sits inside the viewport */
.ticker-track {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;         /* CRITICAL: single line                  */
  height: 44px;
  width: max-content;        /* grows to fit all items                 */
  animation: ticker-run 40s linear infinite;
  will-change: transform;
}

@keyframes ticker-run {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-33.3334%); }
}

/* Pause state */
.ticker-track.is-paused {
  animation-play-state: paused;
}

/* Individual news item */
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: 0 1.75rem;
  height: 44px;
  white-space: nowrap;       /* CRITICAL: no line breaks               */
  flex-shrink: 0;
  text-decoration: none;
  color: var(--text);
  border-right: 1px solid var(--border);
  transition: background .12s;
  font-size: .855rem;
  line-height: 1;
}
.ticker-item:hover {
  background: var(--blue-lt);
}

/* Blinking dot */
.ticker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: ticker-blink 1.8s ease-in-out infinite;
}
@keyframes ticker-blink {
  0%,100% { opacity: 1; }
  50%      { opacity: .3; }
}

/* Category pill */
.ticker-cat {
  font-size: .66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .15rem .48rem;
  border-radius: 4px;
  background: var(--blue-lt);
  color: var(--blue);
  flex-shrink: 0;
  white-space: nowrap;
}

/* Title */
.ticker-title {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;       /* CRITICAL                               */
}

/* Separator dot */
.ticker-sep {
  color: var(--border2);
  flex-shrink: 0;
}

/* Timestamp */
.ticker-time {
  display: flex;
  align-items: center;
  gap: .22rem;
  font-size: .68rem;
  color: var(--text-3);
  font-family: 'IBM Plex Mono', monospace;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Pause / Play button */
.ticker-pause-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  flex-shrink: 0;
  background: var(--surface2);
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.ticker-pause-btn:hover {
  background: var(--blue-lt);
  color: var(--blue);
}

/* Mobile */
@media (max-width: 680px) {
  .ticker-wrap,
  .ticker-track,
  .ticker-item    { height: 38px; }
  .ticker-cat     { display: none; }
  .ticker-time    { display: none; }
  .ticker-pause-btn { width: 36px; }
  .ticker-item    { padding: 0 1.1rem; }
}
