:root {
  --bg: #050816;
  --panel: rgba(14, 22, 53, 0.82);
  --panel-hover: rgba(22, 33, 76, 0.9);
  --accent: #00eaff;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: rgba(0, 234, 255, 0.2);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  background-image:
    radial-gradient(at 0 0, rgba(37, 99, 235, 0.2), transparent 48%),
    radial-gradient(at 100% 100%, rgba(147, 51, 234, 0.18), transparent 48%);
  background-attachment: fixed;
  color: var(--text);
  font-family: Outfit, Inter, Arial, sans-serif;
}

a { color: inherit; }

.home {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 10;
  padding: 8px 12px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: rgba(5, 8, 22, 0.86);
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

header {
  max-width: 1000px;
  margin: 0 auto;
  padding: 62px 18px 18px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(0, 234, 255, 0.08);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
}

h1 {
  margin: 12px 0 8px;
  font-size: clamp(1.65rem, 4vw, 2.55rem);
  line-height: 1.12;
}

.subtitle { margin: 0; color: var(--muted); }

.ad-slot {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: clamp(280px, 100%, 970px);
  min-height: 0;
  margin: clamp(8px, 1.6vw, 18px) auto;
  padding: 0 clamp(0px, 1vw, 8px);
  overflow-x: hidden;
  text-align: center;
  contain: layout style;
}

.ad-slot:empty {
  display: none;
  margin: 0;
  padding: 0;
}

.ad-slot iframe,
.ad-slot img,
.ad-slot ins,
.ad-slot > div {
  max-width: 100% !important;
  height: auto;
}

.switcher {
  display: inline-block;
  margin-top: 14px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

main {
  width: min(1000px, calc(100% - 24px));
  margin: 0 auto 40px;
}

.tools {
  position: sticky;
  top: 10px;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(5, 8, 22, 0.92);
  backdrop-filter: blur(14px);
}

#search {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  outline: 0;
  background: rgba(255, 255, 255, 0.06);
  color: white;
  font: inherit;
}

#search:focus { border-color: var(--accent); }

#expandAll {
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 234, 255, 0.08);
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

#summary {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

#subjects { display: grid; gap: 12px; }

.subject {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel);
}

.subject summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  font-weight: 800;
}

.subject summary::-webkit-details-marker { display: none; }
.subject summary:hover { background: var(--panel-hover); }
.count { color: var(--accent); font-size: 12px; white-space: nowrap; }

.notes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 9px;
  padding: 0 14px 14px;
}

.note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

.note:hover { border-color: var(--accent); background: rgba(0, 234, 255, 0.08); }
.note-title { min-width: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 600; }
.download { flex: 0 0 auto; color: var(--accent); font-size: 11px; font-weight: 800; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

footer { padding: 10px 16px 28px; text-align: center; color: var(--muted); font-size: 13px; }
footer a { color: var(--accent); }

@media (max-width: 600px) {
  header { padding-top: 58px; }
  .home { top: 9px; left: 9px; font-size: 12px; }
  .tools { grid-template-columns: 1fr; }
  #expandAll { min-height: 38px; }
  #summary { grid-column: auto; }
  .notes { grid-template-columns: 1fr; padding: 0 9px 9px; }
  .subject summary { padding: 13px 12px; }
  .ad-slot { margin: 6px auto; }
  /* no body padding-bottom: site-ads.js reserves the exact rail height
     with #gwc-anchor-spacer, and only while a unit is filled. */
}

/* ultrawide desktops: keep the hub readable, not stretched */
@media (min-width: 1441px) {
  body { max-width: 1240px; margin: 0 auto; }
  .ad-slot { max-width: 970px; }
}

/* short landscape phones: the spacer follows the thinner rail */
@media (orientation: landscape) and (max-height: 480px) {
  .ad-slot { margin: 4px auto; }
}
