:root{
  --bg:#0b0f17; --panel:#111827; --muted:#7c8aa5; --soft:#1f2937; --accent:#22d3ee;
  --text:#e5e7eb; --title:#f9fafb; --ring: rgba(34,211,238,.35);
}
html,body{height:100%}
body{
  background: radial-gradient(1200px 800px at 70% -10%, #0c1a2e 0%, #0b0f17 55%),
              url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="160" height="160" viewBox="0 0 160 160"><circle cx="2" cy="2" r="2" fill="white" opacity="0.15"/><circle cx="80" cy="50" r="1.5" fill="white" opacity="0.25"/><circle cx="120" cy="120" r="1.2" fill="white" opacity="0.2"/></svg>');
  background-repeat: no-repeat, no-repeat;
  background-size: cover, cover;
  background-attachment: fixed, fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-smooth: always;
}
.starfield{
  position:fixed;
  inset:0;
  pointer-events:none;
  overflow:hidden;
  z-index:-1;
}
.galaxy-image{
  position:absolute;
  width:400px;
  height:400px;
  background-size:contain;
  background-repeat:no-repeat;
  background-position:center;
  opacity:1;
  mix-blend-mode:screen;
  filter:blur(0.2px);
  animation:galaxy-rotate 200s linear infinite;
  will-change:transform;
  pointer-events:none;
}
@keyframes galaxy-rotate{
  from{transform:rotate(0deg);}
  to{transform:rotate(360deg);}
}
.animations-paused .galaxy-image{
  animation-play-state:paused;
}
.nebula-cloud{
  position:absolute;
  border-radius:50%;
  mix-blend-mode:screen;
  opacity:0.5;
  filter:blur(28px);
  animation:nebula-drift 140s linear infinite;
}
.nebula-cloud:nth-child(odd){opacity:0.4;}
@keyframes nebula-drift{
  from{transform:rotate(0deg) scale(1);}
  to{transform:rotate(360deg) scale(1.05);}
}
.animations-paused .starfield span,
.animations-paused .nebula-cloud{
  animation-play-state:paused;
}
.starfield span{
  position:absolute;
  display:block;
  border-radius:50%;
  background:rgba(255,255,255,.85);
  box-shadow:0 0 6px rgba(255,255,255,.5);
  animation:star-twinkle 2s infinite ease-in-out;
}
@keyframes star-twinkle{
  0%,100%{opacity:.2; transform:scale(1);}
  50%{opacity:.7; transform:scale(1.4);}
}
main.container{
  position:relative;
}
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  box-shadow: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(34,211,238,.4);
  box-shadow: 0 20px 45px rgba(14,116,144,.18);
}
.tool-card{
  padding:20px 20px 22px;
  display:flex;
  position:relative;
  cursor:pointer;
}
.tool-card .card-content{
  display:flex;
  flex-direction:column;
  gap:10px;
  height:100%;
}
.tool-card .card-title{
  margin:4px 0 0;
  color: var(--title);
  font-weight:800;
  letter-spacing:.3px;
  font-size:1.15rem;
}
.tool-card .card-description{
  margin:0;
  color: rgba(226,232,240,.82);
  line-height:1.5;
  font-size:0.95rem;
}
.tool-tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:6px 0 12px;
}
.tag{
  font-size:12px;
  letter-spacing:.03em;
  text-transform:uppercase;
  color:#e6fbff;
  background:rgba(34,211,238,.12);
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(34,211,238,.22);
  box-shadow:0 1px 0 rgba(255,255,255,.08) inset;
  transition:background .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease;
}
.tool-tags .tag{
  cursor:pointer;
}
.tool-tags .tag:hover{
  box-shadow:0 0 0 3px rgba(34,211,238,.25), 0 1px 0 rgba(255,255,255,.12) inset;
  border-color:rgba(34,211,238,.45);
  color:#f6fdff;
}
.tag.selected{
  background: linear-gradient(180deg, #0e7490, #0c4a6e);
  border-color: rgba(34,211,238,.5);
  box-shadow:0 0 0 2px rgba(34,211,238,.18), 0 1px 0 rgba(255,255,255,.1) inset;
  color:#f1fbff;
}
.hide-btn{
  position:absolute;
  right:14px;
  top:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(15,23,42,.6);
  color:#dbeafe;
  border-radius:999px;
  padding:6px 14px;
  font-size:11px;
  letter-spacing:.05em;
  text-transform:uppercase;
  transition:background .18s ease, border-color .18s ease, color .18s ease;
}
.hide-btn:hover{background:rgba(34,211,238,.12); border-color:rgba(34,211,238,.35); color:#f8fafc;}
.hide-btn.is-hidden{
  background:rgba(8,47,73,.6);
  border-color:rgba(14,116,144,.6);
  opacity:1;
  filter:none;
}
.btn-primary {
  --bg1:#0ea5b3; --bg2:#06b6d4;
  background: linear-gradient(180deg, var(--bg2), var(--bg1));
  color:#02242a; font-weight:700; border:1px solid rgba(255,255,255,.1);
  box-shadow: 0 6px 18px rgba(34,211,238,.15), inset 0 1px 0 rgba(255,255,255,.2);
}
.btn-outline-primary {
  background: var(--soft); color: var(--text); font-weight:600;
  border:1px solid rgba(255,255,255,.1);
}
.btn-outline-primary:hover { filter: brightness(1.05); }
.btn.pill{
  color:#ffffff;
  font-weight:600;
}
.search-group{min-width:260px;}
.search-field{
  flex:1 1 260px;
  display:flex;
  min-width:0;
  align-items:center;
  gap:10px;
  background:var(--soft);
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  padding:10px 12px;
  transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.search-field--with-button{
  position:relative;
  gap:8px;
}
.search-field--with-button .search-input{
  padding-right:92px;
}
.search-field .search-clear{
  position:absolute;
  right:8px;
  top:50%;
  transform:translateY(-50%);
  padding:6px 12px;
  border-radius:10px;
  font-size:0.85rem;
  line-height:1;
  white-space:nowrap;
  min-width:68px;
  background:linear-gradient(180deg,#0ea5b3,#0284c7);
  border:1px solid rgba(255,255,255,.2);
  box-shadow:0 6px 14px rgba(15,118,209,.25);
}
.search-field:focus-within{
  border-color:rgba(34,211,238,.45);
  box-shadow:0 0 0 3px rgba(34,211,238,.25);
  transform:translateY(-1px);
}
.search-icon{flex-shrink:0; opacity:.85;}
.search-input{
  border:none;
  outline:none;
  flex:1;
  background:transparent;
  color:var(--text);
  font-size:15px;
}
.search-input::placeholder{color:#8ea0c0;}
@media (max-width: 575.98px){
  .search-group{
    align-items:flex-start;
  }
  .search-field{
    width:100%;
    flex:0 0 auto;
  }
}
.tool-actions{
  margin-top:auto;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.tool-actions.stacked{
  flex-direction:column;
  align-items:stretch;
}
.tool-actions.stacked .action-btn{
  width:100%;
  justify-content:center;
}
.action-btn{
  --bg1:#0ea5b3; --bg2:#06b6d4;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.1);
  background:linear-gradient(180deg, var(--bg2), var(--bg1));
  color:#02242a;
  font-weight:700;
  font-size:14px;
  text-decoration:none;
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease;
  box-shadow:0 6px 18px rgba(34,211,238,.15), inset 0 1px 0 rgba(255,255,255,.2);
  cursor:pointer;
}
.action-btn.secondary{
  background:var(--soft);
  color:var(--text);
  font-weight:600;
  box-shadow:none;
}
.action-btn:hover{transform:translateY(-1px); filter:brightness(1.05);}
.action-btn svg path{stroke:#a9e9f5;}
.tag.muted{
  border-style:dashed;
  opacity:.7;
}
.tag:empty{display:none;}
.tool-modal{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  pointer-events:none;
  transition:opacity .3s ease;
  z-index:1100;
}
.tool-modal.is-visible{
  opacity:1;
  pointer-events:auto;
}
.tool-modal__overlay{
  position:absolute;
  inset:0;
  background:rgba(2,6,23,.82);
}
.tool-modal__panel{
  position:relative;
  width:min(720px,calc(100vw - 2.5rem));
  max-height:calc(100vh - 3rem);
  background:rgba(10,12,20,.96);
  border:1px solid rgba(255,255,255,.08);
  border-radius:22px;
  padding:1.8rem;
  box-shadow:0 35px 60px rgba(0,0,0,.55);
  overflow-y:auto;
  z-index:1;
}
.tool-modal__close{
  position:absolute;
  top:1rem;
  right:1rem;
  border:none;
  background:rgba(15,23,42,.6);
  color:#f8fafc;
  width:38px;
  height:38px;
  border-radius:50%;
  font-size:1.4rem;
  line-height:1;
  cursor:pointer;
}
.tool-modal__media{
  width:100%;
  height:240px;
  border-radius:18px;
  overflow:hidden;
  margin-bottom:1.25rem;
  background:rgba(15,23,42,.75);
  border:1px solid rgba(148,163,184,.2);
  display:flex;
  align-items:center;
  justify-content:center;
}
.tool-modal__media img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.tool-modal__media-placeholder{
  width:100%;
  height:100%;
  background:linear-gradient(135deg, rgba(37,99,235,.4), rgba(59,130,246,.25));
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  letter-spacing:.25em;
  color:#e2e8f0;
  text-transform:uppercase;
}
.tool-modal__status{
  font-size:.8rem;
  letter-spacing:.35em;
  text-transform:uppercase;
  color:#cbd5f5;
  margin-bottom:.35rem;
}
.tool-modal__title{
  font-size:2rem;
  font-weight:800;
  margin-bottom:.4rem;
  color:#f8fafc;
}
.tool-modal__short{
  color:rgba(226,232,240,.92);
  margin-bottom:.8rem;
}
.tool-modal__long{
  color:rgba(226,232,240,.85);
  line-height:1.65;
  margin-bottom:1.2rem;
}
.tool-modal__tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:1.4rem;
}
.tool-modal__actions{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
}
.tool-modal__actions .action-btn{
  flex:1 1 180px;
  justify-content:center;
}
body.modal-open{
  overflow:hidden;
}
.page-header{
  border-bottom:1px solid rgba(255,255,255,.08);
  padding-bottom:1rem;
}
.site-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(34, 211, 238, 0.3));
  transition: filter 0.3s ease, transform 0.3s ease;
}
.site-logo:hover {
  filter: drop-shadow(0 4px 12px rgba(34, 211, 238, 0.5));
  transform: scale(1.05);
}
@media (max-width: 576px) {
  .site-logo {
    height: 40px;
  }
}
.sky-switches{
  position:fixed;
  top:14px;
  right:14px;
  display:flex;
  gap:10px;
  align-items:center;
  z-index:10;
}
.switch{
  display:inline-flex;
  align-items:center;
  gap:6px;
  background:rgba(15,23,42,0.72);
  border:1px solid rgba(255,255,255,0.08);
  padding:6px 10px;
  border-radius:12px;
  color:#cbd5e1;
  font-size:12px;
  line-height:1;
}
.switch input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.switch .slider{
  position:relative;
  width:34px;
  height:18px;
  background:rgba(255,255,255,0.15);
  border-radius:999px;
  box-shadow:inset 0 1px 3px rgba(0,0,0,0.35);
  transition:background .18s ease;
}
.switch .slider::after{
  content:'';
  position:absolute;
  top:2px;
  left:2px;
  width:14px;
  height:14px;
  background:linear-gradient(180deg,#cbd5e1,#94a3b8);
  border-radius:50%;
  box-shadow:0 2px 6px rgba(0,0,0,0.35);
  transition:transform .18s ease;
}
.switch input:checked + .slider{
  background:rgba(96,165,250,0.35);
}
.switch input:checked + .slider::after{
  background:linear-gradient(180deg,#60a5fa,#2563eb);
  transform:translateX(16px);
}
.switch-label{
  letter-spacing:.02em;
}
.btn-blue{
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  color:#f8fafc;
  font-weight:600;
  border:1px solid rgba(37,99,235,.45);
  box-shadow:0 6px 18px rgba(59,130,246,.22), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-blue:hover { filter: brightness(1.06); color:#ffffff; }
.btn-blue:focus-visible { outline:2px solid rgba(147,197,253,.45); outline-offset:3px; }
#toggleHidden,
#resetHidden{
  padding:6px 12px;
  font-size:0.9rem;
  line-height:1.2;
  background:linear-gradient(180deg,#0ea5b3,#0284c7);
  border:1px solid rgba(255,255,255,.2);
  box-shadow:0 6px 14px rgba(15,118,209,.25);
  color:#f8fafc;
}
.tag-btn {
  border:1px solid rgba(255,255,255,.08);
  border-radius:999px;
  padding:.35rem .8rem;
  margin:4px 8px 4px 0;
}
.tag-btn.selected{
  background: linear-gradient(180deg, #0e7490, #075985); color:#e6fbff; box-shadow:0 1px 0 rgba(255,255,255,.08) inset;
  outline:2px solid var(--ring);
}
.tag-btn:not(.selected){ background: #1f2a44; color: #9bb2d6; }
.is-hidden { opacity:.55; filter:saturate(.9) }

/* News Banner */
.news-banner {
    background: linear-gradient(135deg, rgba(14,116,144,0.15), rgba(12,74,110,0.12));
    border: 1px solid rgba(34,211,238,0.25);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.news-banner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.news-banner-header:hover {
    background: rgba(34,211,238,0.08);
}

.news-banner-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--title);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

.news-banner-title svg {
    color: var(--accent);
}

.news-count {
    color: var(--muted);
    font-weight: 400;
    font-size: 0.85rem;
}

.news-toggle {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0.25rem;
    transition: transform 0.3s ease;
}

.news-banner.expanded .news-toggle svg {
    transform: rotate(180deg);
}

.news-banner-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.news-banner.expanded .news-banner-content {
    max-height: 500px;
    overflow-y: auto;
    padding: 0 1rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(34,211,238,0.5) rgba(255,255,255,0.05);
}

.news-banner.expanded .news-banner-content::-webkit-scrollbar {
    width: 8px;
}

.news-banner.expanded .news-banner-content::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
}

.news-banner.expanded .news-banner-content::-webkit-scrollbar-thumb {
    background: rgba(34,211,238,0.5);
    border-radius: 4px;
}

.news-banner.expanded .news-banner-content::-webkit-scrollbar-thumb:hover {
    background: rgba(34,211,238,0.7);
}

.news-item {
    padding: 0.75rem 0;
}

.news-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.news-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.news-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid;
}

.news-badge-cg {
    background: rgba(59,130,246,0.12);
    border-color: rgba(59,130,246,0.3);
    color: #93c5fd;
}

.news-badge-alert {
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.3);
    color: #fca5a5;
}

.news-badge-update {
    background: rgba(34,211,238,0.12);
    border-color: rgba(34,211,238,0.3);
    color: #67e8f9;
}

.news-badge-event {
    background: rgba(168,85,247,0.12);
    border-color: rgba(168,85,247,0.3);
    color: #c4b5fd;
}

.event-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid;
}

.event-status-upcoming {
    background: rgba(96,165,250,0.12);
    border-color: rgba(96,165,250,0.3);
    color: #93c5fd;
}

.event-status-ongoing {
    background: rgba(34,197,94,0.15);
    border-color: rgba(34,197,94,0.4);
    color: #86efac;
}

.pulse-dot {
    display: inline-block;
    animation: pulse-opacity 2s ease-in-out infinite;
}

@keyframes pulse-opacity {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.news-item-time {
    color: var(--muted);
    font-size: 0.8rem;
}

.news-item-title {
    color: var(--title);
    font-weight: 700;
    font-size: 1rem;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.news-item-content {
    color: rgba(226,232,240,0.85);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 0.5rem;
}

.news-item-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.news-item-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.news-item-link:hover {
    color: #7dd3fc;
}

.news-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 0.75rem 0;
}

/* Responsive */
@media (max-width: 575.98px) {
    .news-banner-title {
        font-size: 0.85rem;
    }
    .news-item-title {
        font-size: 0.95rem;
    }
    .news-item-content {
        font-size: 0.85rem;
    }
}
