/* ============================================================
   sportgame.tw — sgmain.css
   Layout E: Dashboard (Top nav + Right sidebar + Main area)
   Aesthetic: Michel Gondry paper-craft, purple primary
   CSS prefix: sg-
   ============================================================ */

/* --- Reset & Tokens --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sg-purple:     #9B59B6;
  --sg-purple-dk:  #6C3483;
  --sg-purple-lt:  #D7BDE2;
  --sg-yellow:     #F1C40F;
  --sg-yellow-dk:  #D4AC0D;
  --sg-ink:        #1A1228;
  --sg-ink-2:      #3D2B55;
  --sg-ink-3:      #6B5B82;
  --sg-paper:      #FAF8FD;
  --sg-paper-2:    #F0ECF7;
  --sg-paper-3:    #E8E0F3;
  --sg-white:      #FFFFFF;
  --sg-border:     #DDD5EA;

  --sg-nav-h:      60px;
  --sg-sidebar-w:  260px;
  --sg-radius:     12px;
  --sg-radius-sm:  8px;
  --sg-shadow:     0 2px 12px rgba(155,89,182,0.10);
  --sg-shadow-md:  0 6px 24px rgba(155,89,182,0.16);
  --sg-transition: 0.22s ease;

  --sg-font:       'Space Grotesk', 'Noto Sans TC', sans-serif;

  /* Type scale (1.2 minor third) */
  --sg-step-0:  1rem;
  --sg-step-1:  1.2rem;
  --sg-step-2:  1.44rem;
  --sg-step-3:  1.728rem;
  --sg-step-4:  2.074rem;
  --sg-step-5:  2.488rem;

  /* Spacing scale (8 px base) */
  --sg-sp-1:  0.25rem;
  --sg-sp-2:  0.5rem;
  --sg-sp-3:  0.75rem;
  --sg-sp-4:  1rem;
  --sg-sp-5:  1.5rem;
  --sg-sp-6:  2rem;
  --sg-sp-7:  3rem;
  --sg-sp-8:  4rem;
  --sg-sp-9:  6rem;
  --sg-sp-10: 8rem;
}

html { scroll-behavior: smooth; }
body.sg-body {
  font-family: var(--sg-font);
  background: var(--sg-paper);
  color: var(--sg-ink);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--sg-purple); text-decoration: none; }
a:hover { color: var(--sg-purple-dk); }

/* --- Top Navigation --- */
.sg-topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--sg-nav-h);
  background: var(--sg-white);
  border-bottom: 2px solid var(--sg-yellow);
  box-shadow: 0 2px 8px rgba(155,89,182,0.08);
}
.sg-topnav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
}
.sg-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--sg-ink);
  flex-shrink: 0;
}
.sg-nav-brand img { border-radius: 8px; }
.sg-brand-name { color: var(--sg-purple-dk); }
.sg-nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.sg-nav-link {
  padding: 6px 14px;
  border-radius: var(--sg-radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--sg-ink-2);
  transition: background var(--sg-transition), color var(--sg-transition);
}
.sg-nav-link:hover, .sg-nav-link.sg-active {
  background: var(--sg-paper-2);
  color: var(--sg-purple);
}
.sg-nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}
.sg-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--sg-ink);
  border-radius: 2px;
  transition: var(--sg-transition);
}
.sg-mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--sg-white);
  border-bottom: 1px solid var(--sg-border);
  padding: 12px 24px;
}
.sg-mobile-nav.sg-open { display: flex; }
.sg-mobile-link {
  padding: 10px 0;
  font-weight: 500;
  color: var(--sg-ink-2);
  border-bottom: 1px solid var(--sg-paper-3);
}
.sg-mobile-link:last-child { border-bottom: none; }

/* --- Dashboard Layout --- */
.sg-layout {
  display: grid;
  grid-template-columns: 1fr var(--sg-sidebar-w);
  min-height: calc(100vh - var(--sg-nav-h));
  max-width: 1440px;
  margin: 0 auto;
}
.sg-main {
  padding: 32px 36px;
  min-width: 0;
}

/* --- Sidebar --- */
.sg-sidebar {
  position: sticky;
  top: var(--sg-nav-h);
  height: calc(100vh - var(--sg-nav-h));
  overflow-y: auto;
  background: var(--sg-white);
  border-left: 1px solid var(--sg-border);
  padding: 24px 0 24px;
  display: flex;
  flex-direction: column;
}
.sg-sidebar::-webkit-scrollbar { width: 4px; }
.sg-sidebar::-webkit-scrollbar-thumb { background: var(--sg-purple-lt); border-radius: 4px; }

.sg-sidebar-section { margin-bottom: 8px; }
.sg-sidebar-label {
  display: block;
  padding: 6px 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sg-ink-3);
}
.sg-sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  font-size: 0.88rem;
  color: var(--sg-ink-2);
  transition: background var(--sg-transition), color var(--sg-transition);
  border-right: 3px solid transparent;
}
.sg-sidebar-link:hover {
  background: var(--sg-paper-2);
  color: var(--sg-purple);
  border-right-color: var(--sg-purple-lt);
}
.sg-sidebar-link.sg-active {
  background: var(--sg-paper-2);
  color: var(--sg-purple);
  border-right-color: var(--sg-purple);
  font-weight: 600;
}
.sg-sidebar-icon { font-size: 1rem; width: 20px; text-align: center; }

.sg-sidebar-author {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--sg-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sg-sidebar-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--sg-purple-lt);
}
.sg-sidebar-author-name { font-size: 0.82rem; font-weight: 700; color: var(--sg-ink); }
.sg-sidebar-author-title { font-size: 0.72rem; color: var(--sg-ink-3); }

/* --- Buttons --- */
.sg-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  background: var(--sg-purple);
  color: var(--sg-white);
  border-radius: var(--sg-radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background var(--sg-transition), transform var(--sg-transition), box-shadow var(--sg-transition);
}
.sg-btn-primary:hover {
  background: var(--sg-purple-dk);
  color: var(--sg-white);
  transform: translateY(-2px);
  box-shadow: var(--sg-shadow-md);
}
.sg-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 24px;
  border: 2px solid var(--sg-purple);
  color: var(--sg-purple);
  border-radius: var(--sg-radius);
  font-weight: 600;
  font-size: 0.95rem;
  background: transparent;
  transition: all var(--sg-transition);
}
.sg-btn-secondary:hover {
  background: var(--sg-purple);
  color: var(--sg-white);
  transform: translateY(-2px);
}
.sg-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--sg-purple);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: border-color var(--sg-transition);
}
.sg-btn-ghost:hover { border-bottom-color: var(--sg-purple); color: var(--sg-purple); }

/* --- Labels & Tags --- */
.sg-kicker {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sg-purple);
  background: var(--sg-paper-2);
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.sg-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--sg-purple-lt);
  color: var(--sg-purple-dk);
  margin-bottom: 6px;
}
.sg-section-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sg-purple);
  margin-bottom: 6px;
}

/* --- Hero --- */
.sg-hero {
  position: relative;
  border-radius: var(--sg-radius);
  overflow: hidden;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  margin-bottom: 40px;
  border: 3px solid var(--sg-yellow);
}
.sg-hero-bg {
  position: absolute; inset: 0; z-index: 0;
}
.sg-hero-img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.55);
}
.sg-hero-content {
  position: relative;
  z-index: 1;
  padding: 40px 48px;
  max-width: 640px;
}
.sg-hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--sg-white);
  line-height: 1.2;
  margin-bottom: 14px;
}
.sg-hero-title em {
  font-style: normal;
  color: var(--sg-yellow);
}
.sg-hero-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.88);
  margin-bottom: 24px;
  max-width: 480px;
}
.sg-hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

/* --- Stats Bar --- */
.sg-stats-bar {
  background: var(--sg-purple);
  border-radius: var(--sg-radius);
  padding: 28px 36px;
  margin-bottom: 40px;
}
.sg-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.sg-stat-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sg-stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.8); font-weight: 500; }
.sg-big-number {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--sg-yellow);
  line-height: 1;
}

/* --- Sections --- */
.sg-section { margin-bottom: 48px; }
.sg-section-header {
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
}
.sg-section-title {
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  font-weight: 700;
  color: var(--sg-ink);
}
.sg-section-more {
  margin-top: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--sg-purple);
  align-self: flex-start;
}

/* --- Category Grid --- */
.sg-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.sg-category-card {
  position: relative;
  border-radius: var(--sg-radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  border: 2px solid var(--sg-border);
  transition: transform var(--sg-transition), box-shadow var(--sg-transition);
}
.sg-category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sg-shadow-md);
  border-color: var(--sg-purple-lt);
}
.sg-category-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.5);
  transition: filter var(--sg-transition);
}
.sg-category-card:hover img { filter: brightness(0.4); }
.sg-category-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  color: var(--sg-white);
}
.sg-category-icon { font-size: 1.8rem; margin-bottom: 6px; }
.sg-category-overlay h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.sg-category-overlay p { font-size: 0.78rem; opacity: 0.85; }

/* --- Article Grid & Cards --- */
.sg-article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.sg-bento-card {
  background: var(--sg-white);
  border-radius: var(--sg-radius);
  border: 1.5px solid var(--sg-border);
  overflow: hidden;
  transition: transform var(--sg-transition), box-shadow var(--sg-transition), border-color var(--sg-transition);
  box-shadow: var(--sg-shadow);
}
.sg-bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sg-shadow-md);
  border-color: var(--sg-purple-lt);
}
.sg-feature-card {
  background: var(--sg-white);
  border-radius: var(--sg-radius);
  border: 1.5px solid var(--sg-border);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: transform var(--sg-transition), box-shadow var(--sg-transition);
}
.sg-feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--sg-purple);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.sg-feature-card:hover::before { transform: scaleX(1); }
.sg-feature-card:hover { transform: translateY(-3px); box-shadow: var(--sg-shadow-md); }
.sg-feature-card h3 { font-size: 1rem; font-weight: 700; margin: 12px 0 8px; color: var(--sg-ink); }
.sg-feature-card p { font-size: 0.85rem; color: var(--sg-ink-3); line-height: 1.6; }

.sg-card-img-wrap { display: block; overflow: hidden; }
.sg-card-img-wrap img {
  width: 100%; height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.sg-bento-card:hover .sg-card-img-wrap img { transform: scale(1.04); }
.sg-card-body { padding: 18px 20px 20px; }
.sg-card-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.sg-card-title a { color: var(--sg-ink); }
.sg-card-title a:hover { color: var(--sg-purple); }
.sg-card-excerpt { font-size: 0.84rem; color: var(--sg-ink-3); line-height: 1.55; margin-bottom: 12px; }
.sg-card-meta { font-size: 0.75rem; color: var(--sg-ink-3); display: flex; gap: 10px; }
.sg-card-link { font-size: 0.84rem; font-weight: 600; color: var(--sg-purple); }
.sg-card-link:hover { color: var(--sg-purple-dk); }

/* --- Tools Promo --- */
.sg-tools-promo {
  background: linear-gradient(135deg, var(--sg-purple-dk) 0%, var(--sg-purple) 100%);
  border-radius: var(--sg-radius);
  padding: 40px 48px;
  margin-bottom: 48px;
  border: 3px solid var(--sg-yellow);
}
.sg-tools-promo-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
}
.sg-tools-promo-text h2 { font-size: 1.6rem; font-weight: 700; color: var(--sg-white); margin-bottom: 10px; }
.sg-tools-promo-text p { color: rgba(255,255,255,0.85); margin-bottom: 24px; font-size: 0.95rem; }
.sg-tools-promo-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sg-tool-mini-card {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--sg-radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sg-white);
  font-size: 0.85rem;
  font-weight: 500;
}
.sg-tool-icon { font-size: 1.3rem; }

/* --- Tools Grid --- */
.sg-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}
.sg-tool-card {
  background: var(--sg-white);
  border: 2px solid var(--sg-border);
  border-radius: var(--sg-radius);
  padding: 28px 24px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  transition: transform var(--sg-transition), box-shadow var(--sg-transition), border-color var(--sg-transition);
  box-shadow: var(--sg-shadow);
}
.sg-tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sg-shadow-md);
  border-color: var(--sg-purple);
}
.sg-tool-card-icon { font-size: 2.2rem; flex-shrink: 0; }
.sg-tool-card-title { font-size: 1.05rem; font-weight: 700; color: var(--sg-ink); margin-bottom: 8px; }
.sg-tool-card-desc { font-size: 0.84rem; color: var(--sg-ink-3); line-height: 1.55; margin-bottom: 12px; }
.sg-tool-card-cta { font-size: 0.84rem; font-weight: 600; color: var(--sg-purple); }

.sg-tools-grid-sm { display: flex; gap: 12px; flex-wrap: wrap; }
.sg-tool-card-sm {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--sg-paper-2);
  border-radius: var(--sg-radius-sm);
  font-size: 0.85rem;
  color: var(--sg-ink-2);
  font-weight: 500;
  transition: background var(--sg-transition), color var(--sg-transition);
}
.sg-tool-card-sm:hover { background: var(--sg-purple); color: var(--sg-white); }
.sg-tool-icon-sm { font-size: 1rem; }

/* --- Steps Grid --- */
.sg-steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.sg-step-card {
  background: var(--sg-white);
  border: 1.5px solid var(--sg-border);
  border-radius: var(--sg-radius);
  padding: 24px;
}
.sg-step-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--sg-purple-lt);
  line-height: 1;
  margin-bottom: 10px;
}
.sg-step-card h3 { font-size: 0.95rem; font-weight: 700; color: var(--sg-ink); margin-bottom: 6px; }
.sg-step-card p { font-size: 0.83rem; color: var(--sg-ink-3); line-height: 1.55; }

/* --- Author Section --- */
.sg-author-section { margin-bottom: 48px; }
.sg-author-card {
  background: var(--sg-white);
  border: 1.5px solid var(--sg-border);
  border-radius: var(--sg-radius);
  padding: 32px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  align-items: center;
}
.sg-author-portrait img {
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--sg-purple-lt);
  box-shadow: 0 0 0 4px var(--sg-paper-2);
}
.sg-author-info h2 { font-size: 1.3rem; font-weight: 700; color: var(--sg-ink); margin-bottom: 4px; }
.sg-author-role { font-size: 0.85rem; color: var(--sg-purple); font-weight: 600; margin-bottom: 12px; }
.sg-author-info p { font-size: 0.88rem; color: var(--sg-ink-2); line-height: 1.6; margin-bottom: 16px; }

/* --- Author Byline (article page) --- */
.sg-author-byline {
  background: var(--sg-paper-2);
  border-left: 4px solid var(--sg-purple);
  border-radius: 0 var(--sg-radius) var(--sg-radius) 0;
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
  align-items: flex-start;
  margin: 40px 0;
}
.sg-author-byline img {
  width: 70px; height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--sg-purple-lt);
}
.sg-author-byline .sg-kicker { margin-bottom: 2px; }
.sg-author-byline strong { font-size: 1rem; font-weight: 700; display: block; margin-bottom: 2px; }
.sg-role { font-size: 0.8rem; color: var(--sg-purple); margin-bottom: 8px; }
.sg-author-byline p { font-size: 0.84rem; color: var(--sg-ink-2); line-height: 1.6; margin-bottom: 10px; }

/* --- About Page --- */
.sg-about-hero {
  position: relative;
  border-radius: var(--sg-radius);
  overflow: hidden;
  min-height: 300px;
  display: flex;
  align-items: flex-end;
  margin-bottom: 40px;
  border: 3px solid var(--sg-yellow);
}
.sg-about-hero-img { position: absolute; inset: 0; z-index: 0; }
.sg-about-hero-img img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.45); }
.sg-about-hero-text { position: relative; z-index: 1; padding: 36px 40px; color: var(--sg-white); }
.sg-about-hero-text h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; margin-bottom: 10px; }
.sg-about-hero-text p { font-size: 0.95rem; opacity: 0.88; }

.sg-author-profile {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: flex-start;
  margin-bottom: 48px;
  padding: 32px;
  background: var(--sg-white);
  border-radius: var(--sg-radius);
  border: 1.5px solid var(--sg-border);
}
.sg-author-profile-img img {
  width: 180px; height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--sg-purple-lt);
}
.sg-author-profile-text h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; }
.sg-author-profile-text .sg-author-role { margin-bottom: 16px; }
.sg-author-profile-text p { font-size: 0.9rem; color: var(--sg-ink-2); line-height: 1.65; margin-bottom: 12px; }
.sg-author-stats { display: flex; gap: 32px; margin-top: 20px; }
.sg-author-stat { display: flex; flex-direction: column; align-items: center; }
.sg-author-stat .sg-big-number { font-size: 2rem; color: var(--sg-purple); }
.sg-author-stat span:last-child { font-size: 0.78rem; color: var(--sg-ink-3); }

/* --- Timeline --- */
.sg-timeline { position: relative; padding-left: 32px; }
.sg-timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: var(--sg-purple-lt);
}
.sg-timeline-item {
  position: relative;
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 16px;
  align-items: flex-start;
}
.sg-timeline-item::before {
  content: '';
  position: absolute;
  left: -28px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--sg-purple);
  border: 3px solid var(--sg-paper);
  box-shadow: 0 0 0 2px var(--sg-purple-lt);
}
.sg-timeline-year {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sg-purple);
  padding-top: 3px;
}
.sg-timeline-content h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.sg-timeline-content p { font-size: 0.84rem; color: var(--sg-ink-3); line-height: 1.55; }

/* --- Expertise / Values Grid --- */
.sg-expertise-grid, .sg-values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.sg-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: var(--sg-paper-2);
  border-radius: var(--sg-radius-sm);
  font-size: 1.4rem;
  margin-bottom: 12px;
}
.sg-value-card {
  background: var(--sg-white);
  border: 1.5px solid var(--sg-border);
  border-radius: var(--sg-radius);
  padding: 28px 24px;
}
.sg-value-card .sg-value-num {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--sg-yellow);
  line-height: 1;
  margin-bottom: 10px;
}
.sg-value-card h3 { font-size: 0.95rem; font-weight: 700; color: var(--sg-ink); margin-bottom: 8px; }
.sg-value-card p { font-size: 0.84rem; color: var(--sg-ink-3); line-height: 1.55; }

/* --- Contact --- */
.sg-contact-hero { position: relative; margin-bottom: 40px; }
.sg-contact-hero-img { border-radius: var(--sg-radius); overflow: hidden; height: 240px; border: 2px solid var(--sg-yellow); }
.sg-contact-hero-img img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.45); }
.sg-contact-main { display: flex; justify-content: center; margin-bottom: 48px; }
.sg-contact-card {
  background: var(--sg-white);
  border: 2px solid var(--sg-purple-lt);
  border-radius: var(--sg-radius);
  padding: 40px 48px;
  text-align: center;
  max-width: 480px;
  width: 100%;
}
.sg-contact-icon { font-size: 3rem; display: block; margin-bottom: 16px; }
.sg-contact-card h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 12px; }
.sg-contact-card p { font-size: 0.9rem; color: var(--sg-ink-2); margin-bottom: 16px; }
.sg-contact-email {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--sg-purple);
  padding: 10px 20px;
  background: var(--sg-paper-2);
  border-radius: var(--sg-radius-sm);
  margin-bottom: 12px;
}
.sg-contact-types {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}
.sg-contact-note { font-size: 0.78rem; color: var(--sg-ink-3); }

/* --- FAQ --- */
.sg-faq-list { display: flex; flex-direction: column; gap: 4px; }
.sg-faq-item {
  background: var(--sg-white);
  border: 1.5px solid var(--sg-border);
  border-radius: var(--sg-radius-sm);
  overflow: hidden;
  transition: border-color var(--sg-transition);
}
.sg-faq-item:hover { border-color: var(--sg-purple-lt); }
.sg-faq-item[open] { border-color: var(--sg-purple); }
.sg-faq-item summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--sg-ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.sg-faq-item summary::after { content: '+'; color: var(--sg-purple); font-size: 1.2rem; font-weight: 400; }
.sg-faq-item[open] summary::after { content: '−'; }
.sg-faq-body {
  padding: 0 20px 16px;
  font-size: 0.88rem;
  color: var(--sg-ink-2);
  line-height: 1.65;
}
.sg-faq-body a { color: var(--sg-purple); font-weight: 600; }

/* --- Article Page --- */
.sg-article-hero {
  margin-bottom: 28px;
}
.sg-article-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 10px 0 12px;
}
.sg-article-meta {
  font-size: 0.82rem;
  color: var(--sg-ink-3);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sg-article-featured-img {
  border-radius: var(--sg-radius);
  overflow: hidden;
  margin-bottom: 32px;
  border: 2px solid var(--sg-border);
}
.sg-article-featured-img img { width: 100%; max-height: 480px; object-fit: cover; }
.sg-article-faqs { margin: 36px 0; }
.sg-article-faqs h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 16px; }

.sg-related-notes { margin: 40px 0 0; }
.sg-related-notes h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }

/* --- Prose --- */
.sg-prose { max-width: 720px; }
.sg-prose h2 { font-size: 1.4rem; font-weight: 700; margin: 32px 0 14px; color: var(--sg-ink); padding-bottom: 8px; border-bottom: 2px solid var(--sg-paper-3); }
.sg-prose h3 { font-size: 1.1rem; font-weight: 700; margin: 24px 0 10px; color: var(--sg-ink-2); }
.sg-prose h4 { font-size: 1rem; font-weight: 700; margin: 20px 0 8px; color: var(--sg-ink-2); }
.sg-prose p { margin-bottom: 16px; font-size: 0.95rem; line-height: 1.75; color: var(--sg-ink-2); }
.sg-prose a { color: var(--sg-purple); font-weight: 500; text-decoration: underline; }
.sg-prose a:hover { color: var(--sg-purple-dk); }
.sg-prose ul, .sg-prose ol { margin: 0 0 16px 20px; }
.sg-prose li { margin-bottom: 6px; font-size: 0.95rem; color: var(--sg-ink-2); line-height: 1.65; }
.sg-prose blockquote {
  border-left: 4px solid var(--sg-purple);
  background: var(--sg-paper-2);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 var(--sg-radius-sm) var(--sg-radius-sm) 0;
  font-style: italic;
  color: var(--sg-ink-2);
}
.sg-prose code {
  background: var(--sg-paper-3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--sg-purple-dk);
  font-family: 'Courier New', monospace;
}
.sg-prose pre {
  background: var(--sg-ink);
  color: #eee;
  padding: 20px;
  border-radius: var(--sg-radius-sm);
  overflow-x: auto;
  margin: 20px 0;
  font-size: 0.85rem;
}
.sg-prose pre code { background: none; color: inherit; padding: 0; }
.sg-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.88rem;
}
.sg-prose th {
  background: var(--sg-purple);
  color: var(--sg-white);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}
.sg-prose td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--sg-border);
  color: var(--sg-ink-2);
}
.sg-prose tr:nth-child(even) td { background: var(--sg-paper-2); }
.sg-prose strong { font-weight: 700; color: var(--sg-ink); }

/* --- Prose Page (privacy, etc.) --- */
.sg-prose-page .sg-prose { max-width: 800px; }
.sg-prose section { margin-bottom: 32px; }
.sg-prose section h2 { font-size: 1.1rem; }

/* --- Page Hero --- */
.sg-page-wrap { }
.sg-page-hero {
  position: relative;
  margin-bottom: 36px;
}
.sg-page-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 10px;
}
.sg-page-sub { font-size: 0.95rem; color: var(--sg-ink-2); max-width: 600px; }

/* --- Breadcrumb --- */
.sg-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--sg-ink-3);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.sg-breadcrumb a { color: var(--sg-purple); }
.sg-breadcrumb a:hover { color: var(--sg-purple-dk); }

/* --- Tool Page --- */
.sg-tool-page { }
.sg-tool-hero { margin-bottom: 32px; }
.sg-tool-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  background: var(--sg-yellow);
  color: var(--sg-ink);
  border-radius: 4px;
  margin-bottom: 8px;
}
.sg-tool-container {
  background: var(--sg-white);
  border: 2px solid var(--sg-border);
  border-radius: var(--sg-radius);
  padding: 32px;
  margin-bottom: 32px;
}

/* --- Disclaimer Box --- */
.sg-disclaimer-box {
  background: var(--sg-paper-2);
  border: 1.5px solid var(--sg-purple-lt);
  border-radius: var(--sg-radius-sm);
  padding: 14px 20px;
  font-size: 0.83rem;
  color: var(--sg-ink-3);
  margin-bottom: 32px;
}

/* --- CTA Section --- */
.sg-cta-section {
  background: linear-gradient(135deg, var(--sg-purple) 0%, var(--sg-purple-dk) 100%);
  border-radius: var(--sg-radius);
  padding: 48px;
  text-align: center;
  margin-bottom: 48px;
  border: 3px solid var(--sg-yellow);
}
.sg-cta-section h2 { font-size: 1.8rem; font-weight: 700; color: var(--sg-white); margin-bottom: 12px; }
.sg-cta-section p { color: rgba(255,255,255,0.85); margin-bottom: 28px; font-size: 0.95rem; }
.sg-cta-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.sg-cta-section .sg-btn-secondary { border-color: rgba(255,255,255,0.6); color: var(--sg-white); }
.sg-cta-section .sg-btn-secondary:hover { background: rgba(255,255,255,0.15); border-color: var(--sg-white); color: var(--sg-white); }

/* --- Empty State --- */
.sg-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--sg-ink-3);
  font-size: 0.9rem;
}

/* --- Footer --- */
.sg-footer {
  background: var(--sg-ink);
  color: rgba(255,255,255,0.8);
  padding: 48px 36px 0;
  margin-top: 0;
}
.sg-footer-inner {
  max-width: 100%;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sg-footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sg-white);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 12px;
}
.sg-footer-logo img { border-radius: 6px; }
.sg-footer-tagline { font-size: 0.82rem; color: rgba(255,255,255,0.55); }
.sg-footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.sg-footer-col-title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sg-yellow); margin-bottom: 12px; }
.sg-footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.sg-footer-col a { font-size: 0.84rem; color: rgba(255,255,255,0.65); transition: color var(--sg-transition); }
.sg-footer-col a:hover { color: var(--sg-white); }
.sg-footer-bottom { padding: 20px 0; }
.sg-footer-disclaimer { font-size: 0.75rem; color: rgba(255,255,255,0.4); margin-bottom: 8px; line-height: 1.6; }
.sg-footer-copy { font-size: 0.75rem; color: rgba(255,255,255,0.3); }

/* --- Scroll Reveal Animations --- */
.sg-reveal, .sg-reveal-left, .sg-reveal-scale { opacity: 0; transition: opacity 0.6s ease, transform 0.6s ease; }
.sg-reveal { transform: translateY(24px); }
.sg-reveal-left { transform: translateX(-24px); }
.sg-reveal-scale { transform: scale(0.96); }
.sg-reveal.sg-visible, .sg-reveal-left.sg-visible, .sg-reveal-scale.sg-visible {
  opacity: 1;
  transform: none;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .sg-reveal, .sg-reveal-left, .sg-reveal-scale { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --- Responsive: Tablet --- */
@media (max-width: 1100px) {
  .sg-category-grid { grid-template-columns: repeat(2, 1fr); }
  .sg-expertise-grid { grid-template-columns: repeat(2, 1fr); }
  .sg-steps-grid { grid-template-columns: repeat(2, 1fr); }
  .sg-tools-promo-inner { grid-template-columns: 1fr; }
  .sg-footer-inner { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 900px) {
  :root { --sg-sidebar-w: 0px; }
  .sg-layout { grid-template-columns: 1fr; }
  .sg-sidebar { display: none; }
  .sg-main { padding: 24px 20px; }
  .sg-nav-links { display: none; }
  .sg-nav-toggle { display: flex; }
  .sg-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .sg-author-card { grid-template-columns: 1fr; text-align: center; }
  .sg-author-profile { grid-template-columns: 1fr; text-align: center; }
  .sg-author-profile-img img { margin: 0 auto; }
  .sg-author-stats { justify-content: center; }
  .sg-values-grid { grid-template-columns: 1fr; }
  .sg-contact-types { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .sg-hero { min-height: 320px; }
  .sg-hero-content { padding: 24px 20px; }
  .sg-category-grid { grid-template-columns: 1fr; }
  .sg-tools-promo { padding: 28px 24px; }
  .sg-tools-promo-cards { grid-template-columns: 1fr; }
  .sg-cta-section { padding: 32px 20px; }
  .sg-footer-cols { grid-template-columns: 1fr 1fr; }
  .sg-author-byline { grid-template-columns: 1fr; }
  .sg-expertise-grid { grid-template-columns: 1fr; }
  .sg-steps-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   GONDRY PAPER-CRAFT EXTENSIONS
   Michel Gondry / The Science of Sleep aesthetic additions
   ============================================================ */

/* --- Stamp badge (paper-stamp feel) --- */
.sg-stamp {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sg-purple);
  border: 2.5px solid var(--sg-purple);
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 14px;
  position: relative;
  box-shadow: 2px 2px 0 var(--sg-purple-lt);
}
.sg-stamp-yellow {
  color: var(--sg-yellow-dk);
  border-color: var(--sg-yellow);
  box-shadow: 2px 2px 0 var(--sg-yellow);
}
.sg-stamp-green {
  color: #1E8449;
  border-color: #2ECC71;
  box-shadow: 2px 2px 0 #2ECC71;
}

/* --- Highlight text (tape highlight style) --- */
.sg-highlight-text {
  position: relative;
  font-style: normal;
  color: var(--sg-yellow);
  text-shadow: 0 1px 0 rgba(0,0,0,0.3);
}

/* --- Nav highlight item --- */
.sg-nav-highlight { color: var(--sg-purple); font-weight: 700; }
.sg-nav-highlight:hover { color: var(--sg-purple-dk); }

/* --- Hero overlay + craft shapes --- */
.sg-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(155,89,182,0.35) 0%, rgba(26,18,40,0.7) 100%);
  z-index: 0;
}
.sg-craft-shapes { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sg-craft-dot {
  position: absolute;
  border-radius: 50%;
  opacity: 0.45;
  animation: sg-float 6s ease-in-out infinite alternate;
}
.sg-craft-dot-1 { width: 80px; height: 80px; background: var(--sg-yellow); top: 12%; right: 18%; animation-delay: 0s; }
.sg-craft-dot-2 { width: 48px; height: 48px; background: var(--sg-purple-lt); top: 55%; right: 8%; animation-delay: 1.5s; }
.sg-craft-dot-3 { width: 32px; height: 32px; background: #4ECDC4; top: 25%; right: 38%; animation-delay: 3s; }
.sg-craft-tape {
  position: absolute;
  height: 14px;
  opacity: 0.5;
  border-radius: 3px;
  transform: rotate(-8deg);
}
.sg-craft-tape-1 { width: 80px; background: var(--sg-yellow); top: 18%; right: 30%; transform: rotate(12deg); }
.sg-craft-tape-2 { width: 56px; background: #FF6B9D; bottom: 28%; right: 22%; transform: rotate(-5deg); }

@keyframes sg-float {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-18px) rotate(8deg); }
}
@media (prefers-reduced-motion: reduce) {
  .sg-craft-dot { animation: none; }
}

/* --- Hero badges strip --- */
.sg-hero-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.sg-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--sg-white);
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* ============================================================
   HOMEPAGE: LAB DASHBOARD
   Data-dense, technical. Sidebar + main content pattern.
   ============================================================ */

/* S1: Dashboard Hero — compact command header */
.sg-dash-hero {
  background: var(--sg-ink);
  border-bottom: 3px solid var(--sg-yellow);
  padding: var(--sg-sp-6) var(--sg-sp-7);
  display: flex;
  align-items: center;
  gap: var(--sg-sp-7);
  margin-bottom: var(--sg-sp-7);
  border-radius: var(--sg-radius);
  overflow: hidden;
  position: relative;
}
.sg-dash-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg,transparent,transparent 39px,rgba(155,89,182,0.06) 39px,rgba(155,89,182,0.06) 40px),
    repeating-linear-gradient(90deg,transparent,transparent 39px,rgba(155,89,182,0.06) 39px,rgba(155,89,182,0.06) 40px);
  pointer-events: none;
}
.sg-dash-hero-img {
  width: 180px;
  height: 180px;
  flex-shrink: 0;
  border-radius: var(--sg-radius);
  overflow: hidden;
  border: 2px solid var(--sg-purple);
  position: relative;
  z-index: 1;
}
.sg-dash-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.sg-dash-hero-text { position: relative; z-index: 1; }
.sg-dash-hero-text h1 {
  font-size: var(--sg-step-4);
  font-weight: 800;
  color: var(--sg-white);
  line-height: 1.2;
  margin-bottom: var(--sg-sp-3);
}
.sg-dash-hero-text h1 em {
  font-style: normal;
  color: var(--sg-yellow);
}
.sg-dash-hero-text p {
  color: rgba(255,255,255,0.7);
  font-size: var(--sg-step-0);
  line-height: 1.65;
  max-width: 540px;
  margin-bottom: var(--sg-sp-5);
}
.sg-dash-hero-actions { display: flex; gap: var(--sg-sp-3); flex-wrap: wrap; }
.sg-dash-hero-stats {
  display: flex;
  gap: var(--sg-sp-5);
  margin-left: auto;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.sg-dash-stat {
  text-align: center;
  padding: var(--sg-sp-3) var(--sg-sp-4);
  border: 1px solid rgba(155,89,182,0.3);
  border-radius: var(--sg-radius-sm);
  background: rgba(155,89,182,0.08);
}
.sg-dash-stat-num {
  font-size: var(--sg-step-3);
  font-weight: 800;
  color: var(--sg-yellow);
  display: block;
  line-height: 1;
}
.sg-dash-stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  display: block;
  margin-top: var(--sg-sp-1);
}

/* S2: Sidebar + Main two-column dashboard body */
.sg-dash-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--sg-sp-6);
  align-items: start;
}

/* Persistent sidebar nav */
.sg-dash-sidebar {
  position: sticky;
  top: calc(var(--sg-nav-h) + var(--sg-sp-4));
  background: var(--sg-white);
  border: 1.5px solid var(--sg-border);
  border-radius: var(--sg-radius);
  padding: var(--sg-sp-4) 0;
  overflow: hidden;
}
.sg-dash-sidebar-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sg-ink-3);
  padding: 0 var(--sg-sp-4) var(--sg-sp-3);
  border-bottom: 1px solid var(--sg-border);
  margin-bottom: var(--sg-sp-2);
}
.sg-dash-sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--sg-sp-2);
  padding: var(--sg-sp-2) var(--sg-sp-4);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--sg-ink-2);
  transition: background var(--sg-transition), color var(--sg-transition), border-color var(--sg-transition);
  border-left: 3px solid transparent;
}
.sg-dash-sidebar-link:hover {
  background: var(--sg-paper-2);
  color: var(--sg-purple);
  border-left-color: var(--sg-purple-lt);
}
.sg-dash-sidebar-link-icon { width: 20px; text-align: center; font-size: 1rem; }

/* Main content column */
.sg-dash-main { min-width: 0; }
.sg-dash-section { margin-bottom: var(--sg-sp-7); }

/* Section header shared */
.sg-dash-section-head {
  display: flex;
  align-items: baseline;
  gap: var(--sg-sp-3);
  margin-bottom: var(--sg-sp-5);
  border-bottom: 2px solid var(--sg-border);
  padding-bottom: var(--sg-sp-3);
}
.sg-dash-section-head h2 {
  font-size: var(--sg-step-2);
  font-weight: 700;
  color: var(--sg-ink);
}
.sg-dash-section-head .sg-section-more {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sg-purple);
}
.sg-section-sub { font-size: 0.9rem; color: var(--sg-ink-3); margin-top: 6px; max-width: 600px; }

/* S2: World Cup — featured alert banner */
.sg-dash-alert {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--sg-sp-5);
  align-items: center;
  background: linear-gradient(135deg, var(--sg-ink) 0%, var(--sg-ink-2) 100%);
  border: 2px solid var(--sg-yellow);
  border-radius: var(--sg-radius);
  padding: var(--sg-sp-5) var(--sg-sp-6);
  margin-bottom: var(--sg-sp-7);
}
.sg-dash-alert-img {
  width: 120px;
  height: 120px;
  border-radius: var(--sg-radius-sm);
  overflow: hidden;
  border: 2px solid var(--sg-yellow);
  flex-shrink: 0;
}
.sg-dash-alert-img img { width: 100%; height: 100%; object-fit: cover; }
.sg-dash-alert-text h2 {
  font-size: var(--sg-step-2);
  font-weight: 700;
  color: var(--sg-white);
  margin-bottom: var(--sg-sp-2);
}
.sg-dash-alert-text p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.65;
  margin-bottom: var(--sg-sp-3);
}
.sg-dash-alert-data {
  display: flex;
  gap: var(--sg-sp-4);
  flex-shrink: 0;
}
.sg-dash-alert-data .sg-dash-stat { border-color: rgba(241,196,15,0.3); background: rgba(241,196,15,0.08); }

/* S3: Metric panels — data readout cards */
.sg-metric-panels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sg-sp-4);
  margin-bottom: var(--sg-sp-5);
}
.sg-metric-panel {
  background: var(--sg-white);
  border: 1.5px solid var(--sg-border);
  border-radius: var(--sg-radius);
  padding: var(--sg-sp-5);
  display: flex;
  gap: var(--sg-sp-4);
  align-items: flex-start;
  transition: border-color var(--sg-transition), box-shadow var(--sg-transition);
  position: relative;
}
.sg-metric-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--sg-purple-lt);
  border-radius: var(--sg-radius) 0 0 var(--sg-radius);
}
.sg-metric-panel:hover { border-color: var(--sg-purple-lt); box-shadow: var(--sg-shadow); }
.sg-metric-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--sg-paper-2);
  border-radius: var(--sg-radius-sm);
  font-size: 1.5rem;
  flex-shrink: 0;
}
.sg-metric-body h3 { font-size: 0.95rem; font-weight: 700; color: var(--sg-ink); margin-bottom: var(--sg-sp-1); }
.sg-metric-body p { font-size: 0.82rem; color: var(--sg-ink-3); line-height: 1.55; margin-bottom: var(--sg-sp-2); }
.sg-metric-link { font-size: 0.8rem; font-weight: 700; color: var(--sg-purple); }
.sg-metric-link:hover { color: var(--sg-purple-dk); }

/* S4: Split data view — image left, details right */
.sg-data-split {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--sg-sp-6);
  align-items: center;
  margin-bottom: var(--sg-sp-7);
}
.sg-data-split-img {
  position: relative;
  border-radius: var(--sg-radius);
  overflow: hidden;
  border: 2px solid var(--sg-border);
}
.sg-data-split-img img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 280px; }
.sg-data-split-badge {
  position: absolute;
  bottom: 12px; left: 12px;
  background: var(--sg-purple);
  color: var(--sg-white);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
}
.sg-data-split-body h2 { font-size: var(--sg-step-2); font-weight: 700; margin: var(--sg-sp-2) 0 var(--sg-sp-3); line-height: 1.3; }
.sg-data-split-body p { font-size: 0.9rem; color: var(--sg-ink-2); line-height: 1.65; margin-bottom: var(--sg-sp-4); }
.sg-data-tags {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sg-sp-2);
  margin-bottom: var(--sg-sp-4);
}
.sg-data-tag {
  display: flex; align-items: center; gap: var(--sg-sp-2);
  background: var(--sg-paper-2);
  border-radius: var(--sg-radius-sm);
  padding: var(--sg-sp-2) var(--sg-sp-3);
  font-size: 0.82rem;
  color: var(--sg-ink-2);
}
.sg-data-tag span { font-size: 1rem; flex-shrink: 0; }

/* S5: Console-style card grid — Casino */
.sg-console-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sg-sp-4);
  margin-bottom: var(--sg-sp-5);
}
.sg-console-card {
  background: var(--sg-ink);
  border: 1.5px solid var(--sg-ink-2);
  border-radius: var(--sg-radius);
  padding: var(--sg-sp-5);
  color: var(--sg-white);
  transition: border-color var(--sg-transition), transform var(--sg-transition);
}
.sg-console-card:hover { border-color: var(--sg-purple); transform: translateY(-3px); }
.sg-console-card-icon { font-size: 2rem; margin-bottom: var(--sg-sp-3); display: block; }
.sg-console-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: var(--sg-sp-2); }
.sg-console-card p { font-size: 0.82rem; color: rgba(255,255,255,0.65); line-height: 1.55; margin-bottom: var(--sg-sp-3); }
.sg-console-link { font-size: 0.8rem; font-weight: 700; color: var(--sg-yellow); }
.sg-console-link:hover { color: var(--sg-yellow-dk); }
.sg-console-hero-img {
  grid-column: span 3;
  border-radius: var(--sg-radius);
  overflow: hidden;
  border: 2px solid var(--sg-ink-2);
  position: relative;
  max-height: 280px;
}
.sg-console-hero-img img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.5); }
.sg-console-hero-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--sg-sp-5) var(--sg-sp-6);
  background: linear-gradient(to top, rgba(26,18,40,0.85) 0%, transparent 60%);
}
.sg-console-hero-overlay h2 { font-size: var(--sg-step-2); font-weight: 700; color: var(--sg-white); margin-bottom: var(--sg-sp-2); }
.sg-console-hero-overlay p { font-size: 0.88rem; color: rgba(255,255,255,0.7); max-width: 500px; }

/* S6: Tag cluster — Lottery */
.sg-tag-cluster-section {
  background: var(--sg-paper-2);
  border: 1.5px solid var(--sg-border);
  border-radius: var(--sg-radius);
  padding: var(--sg-sp-6);
  margin-bottom: var(--sg-sp-7);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sg-sp-6);
  align-items: center;
}
.sg-tag-cluster-text h2 { font-size: var(--sg-step-2); font-weight: 700; margin: var(--sg-sp-2) 0 var(--sg-sp-3); }
.sg-tag-cluster-text p { font-size: 0.9rem; color: var(--sg-ink-2); line-height: 1.65; margin-bottom: var(--sg-sp-4); }
.sg-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sg-sp-2);
  margin-bottom: var(--sg-sp-4);
}
.sg-tag-pill {
  background: var(--sg-white);
  border: 1.5px solid var(--sg-purple-lt);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 14px;
  color: var(--sg-purple-dk);
  transition: background var(--sg-transition), color var(--sg-transition);
}
.sg-tag-pill:hover { background: var(--sg-purple); color: var(--sg-white); border-color: var(--sg-purple); }
.sg-tag-cluster-visual { position: relative; border-radius: var(--sg-radius); overflow: hidden; }
.sg-tag-cluster-visual img { width: 100%; border-radius: var(--sg-radius); display: block; }
.sg-tag-balls {
  position: absolute;
  bottom: 16px; left: 16px;
  display: flex; gap: 8px;
}
.sg-lball {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 800;
  color: var(--sg-white);
  border: 2px solid rgba(255,255,255,0.6);
}
.sg-lball-1 { background: #E74C3C; }
.sg-lball-2 { background: var(--sg-purple); }
.sg-lball-3 { background: #2ECC71; }
.sg-lball-4 { background: var(--sg-yellow-dk); }

/* S7: Article feed — recent articles */
.sg-article-feed { margin-bottom: var(--sg-sp-5); }
.sg-article-feed .sg-article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sg-sp-4);
}
.sg-article-feed .sg-article-card {
  background: var(--sg-white);
  border: 1.5px solid var(--sg-border);
  border-radius: var(--sg-radius);
  overflow: hidden;
  transition: transform var(--sg-transition), box-shadow var(--sg-transition);
}
.sg-article-feed .sg-article-card:hover { transform: translateY(-3px); box-shadow: var(--sg-shadow-md); }
.sg-card-img-wrap img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.sg-card-body { padding: var(--sg-sp-4); }
.sg-tag { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 3px; background: var(--sg-purple); color: var(--sg-white); margin-bottom: var(--sg-sp-2); }
.sg-card-title { font-size: 0.92rem; font-weight: 700; color: var(--sg-ink); margin-bottom: var(--sg-sp-1); line-height: 1.35; }
.sg-card-title a { color: inherit; }
.sg-card-title a:hover { color: var(--sg-purple); }
.sg-card-excerpt { font-size: 0.82rem; color: var(--sg-ink-3); line-height: 1.5; }
.sg-card-meta { font-size: 0.75rem; color: var(--sg-ink-3); margin-top: var(--sg-sp-2); }

/* S7b: Empty state */
.sg-empty-state-rich {
  background: var(--sg-paper-2);
  border: 2px dashed var(--sg-purple-lt);
  border-radius: var(--sg-radius);
  padding: 56px 32px;
  text-align: center;
}
.sg-empty-craft { margin-bottom: 16px; }
.sg-empty-icon { font-size: 3rem; }
.sg-empty-state-rich h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; color: var(--sg-ink); }
.sg-empty-state-rich p { font-size: 0.9rem; color: var(--sg-ink-3); margin-bottom: 24px; }
.sg-empty-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* S8: Risk — horizontal warning cards */
.sg-risk-banner {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: var(--sg-sp-5);
  align-items: start;
  margin-bottom: var(--sg-sp-7);
}
.sg-risk-banner-text h2 { font-size: var(--sg-step-2); font-weight: 700; margin: var(--sg-sp-2) 0 var(--sg-sp-3); }
.sg-risk-banner-text p { font-size: 0.88rem; color: var(--sg-ink-2); line-height: 1.65; margin-bottom: var(--sg-sp-4); }
.sg-risk-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sg-sp-3);
}
.sg-risk-tile {
  background: var(--sg-white);
  border: 1.5px solid var(--sg-border);
  border-radius: var(--sg-radius-sm);
  padding: var(--sg-sp-3) var(--sg-sp-4);
  display: flex; gap: var(--sg-sp-3); align-items: flex-start;
  transition: border-color var(--sg-transition);
}
.sg-risk-tile:hover { border-color: var(--sg-purple-lt); }
.sg-risk-tile-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 2px; }
.sg-risk-tile h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 3px; }
.sg-risk-tile p { font-size: 0.78rem; color: var(--sg-ink-3); line-height: 1.5; }
.sg-risk-banner-img { border-radius: var(--sg-radius); overflow: hidden; border: 2px solid var(--sg-border); }
.sg-risk-banner-img img { width: 100%; display: block; }

/* S9: FAQ — accordion */
.sg-faq-list { max-width: 680px; }
.sg-faq-item { border-bottom: 1px solid var(--sg-border); }
.sg-faq-item summary {
  padding: var(--sg-sp-4) 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--sg-ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--sg-sp-3);
}
.sg-faq-item summary::before { content: '+'; color: var(--sg-purple); font-size: 1.2rem; font-weight: 700; flex-shrink: 0; width: 20px; text-align: center; }
.sg-faq-item[open] summary::before { content: '-'; }
.sg-faq-item summary::-webkit-details-marker { display: none; }
.sg-faq-body {
  padding: 0 0 var(--sg-sp-4) 32px;
  font-size: 0.88rem;
  color: var(--sg-ink-2);
  line-height: 1.65;
}

/* S10: Widget teaser — interactive game preview */
.sg-widget-teaser {
  background: linear-gradient(135deg, var(--sg-purple-dk) 0%, var(--sg-purple) 100%);
  border-radius: var(--sg-radius);
  padding: var(--sg-sp-6);
  margin-bottom: var(--sg-sp-7);
  border: 3px solid var(--sg-yellow);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sg-sp-6);
  align-items: center;
}
.sg-widget-teaser-text h2 { font-size: var(--sg-step-3); font-weight: 700; color: var(--sg-white); margin: var(--sg-sp-3) 0; }
.sg-widget-teaser-text p { color: rgba(255,255,255,0.85); margin-bottom: var(--sg-sp-5); }
.sg-widget-teaser-hint { font-size: 0.82rem; color: rgba(255,255,255,0.6); margin-top: var(--sg-sp-3); }
.sg-widget-teaser-hint a { color: rgba(255,255,255,0.85); text-decoration: underline; font-weight: 600; }
.sg-widget-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sg-sp-2);
}
.sg-widget-card {
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--sg-radius-sm);
  padding: var(--sg-sp-3);
  font-size: 0.82rem;
  color: var(--sg-white);
  font-weight: 500;
  transition: background var(--sg-transition);
}
.sg-widget-card:hover { background: rgba(255,255,255,0.18); }
.sg-widget-card-term { background: rgba(241,196,15,0.12); border-color: rgba(241,196,15,0.35); font-weight: 700; }

/* S11: Compliance footer bar */
.sg-compliance-bar {
  background: var(--sg-paper-2);
  border: 2px solid var(--sg-border);
  border-left: 5px solid var(--sg-purple);
  border-radius: var(--sg-radius);
  padding: var(--sg-sp-5) var(--sg-sp-6);
  margin-bottom: var(--sg-sp-7);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sg-sp-5);
  align-items: flex-start;
}
.sg-compliance-icon { font-size: 2.2rem; padding-top: 4px; }
.sg-compliance-text h2 { font-size: var(--sg-step-1); font-weight: 700; margin-bottom: var(--sg-sp-2); }
.sg-compliance-text p { font-size: 0.88rem; color: var(--sg-ink-2); line-height: 1.65; margin-bottom: var(--sg-sp-3); }
.sg-compliance-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sg-compliance-list li { font-size: 0.84rem; color: var(--sg-ink-2); display: flex; align-items: flex-start; gap: 8px; }
.sg-compliance-list li::before { content: '·'; color: var(--sg-purple); font-size: 1.2rem; line-height: 1.2; flex-shrink: 0; }
.sg-compliance-list a { color: var(--sg-purple); font-weight: 600; }

/* S12: Flowchart methodology — vertical connected steps */
.sg-flowchart {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  margin-bottom: var(--sg-sp-7);
  padding-left: var(--sg-sp-7);
}
.sg-flowchart::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 24px;
  bottom: 24px;
  width: 3px;
  background: var(--sg-purple-lt);
  border-radius: 2px;
}
.sg-flow-step {
  position: relative;
  padding: var(--sg-sp-4) 0;
}
.sg-flow-step::before {
  content: attr(data-step);
  position: absolute;
  left: calc(-1 * var(--sg-sp-7) + 4px);
  top: var(--sg-sp-4);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--sg-purple);
  color: var(--sg-white);
  font-size: 0.75rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.sg-flow-step h3 { font-size: 1rem; font-weight: 700; margin-bottom: var(--sg-sp-1); }
.sg-flow-step p { font-size: 0.88rem; color: var(--sg-ink-2); line-height: 1.6; }

/* S13: Site directory grid */
.sg-directory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sg-sp-4);
  margin-bottom: var(--sg-sp-5);
}
.sg-directory-card {
  position: relative;
  border-radius: var(--sg-radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  display: block;
  border: 2px solid var(--sg-border);
  transition: transform var(--sg-transition), box-shadow var(--sg-transition);
}
.sg-directory-card:hover { transform: translateY(-4px); box-shadow: var(--sg-shadow-md); }
.sg-directory-card img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.48); transition: filter var(--sg-transition); }
.sg-directory-card:hover img { filter: brightness(0.38); }
.sg-directory-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  padding: var(--sg-sp-4);
  color: var(--sg-white);
}
.sg-directory-overlay h3 { font-size: 0.92rem; font-weight: 700; line-height: 1.3; margin-bottom: 4px; }
.sg-directory-overlay p { font-size: 0.74rem; opacity: 0.85; }
.sg-directory-footer { display: flex; gap: var(--sg-sp-4); align-items: center; }

/* --- Category color accents --- */
.sg-dir-c1 { border-color: #F1C40F; }
.sg-dir-c2 { border-color: var(--sg-purple-lt); }
.sg-dir-c3 { border-color: #2ECC71; }
.sg-dir-c4 { border-color: #E74C3C; }
.sg-dir-c5 { border-color: #3498DB; }
.sg-dir-c6 { border-color: var(--sg-purple); }

/* ============================================================
   HOMEPAGE RESPONSIVE — Lab Dashboard
   ============================================================ */
@media (max-width: 1100px) {
  .sg-dash-hero { flex-direction: column; align-items: flex-start; padding: var(--sg-sp-5); }
  .sg-dash-hero-stats { margin-left: 0; }
  .sg-dash-body { grid-template-columns: 1fr; }
  .sg-dash-sidebar { position: static; }
  .sg-dash-alert { grid-template-columns: 1fr; }
  .sg-dash-alert-img { display: none; }
  .sg-dash-alert-data { margin-top: var(--sg-sp-3); }
  .sg-console-grid { grid-template-columns: 1fr 1fr; }
  .sg-console-hero-img { grid-column: span 2; }
  .sg-data-split { grid-template-columns: 1fr; }
  .sg-tag-cluster-section { grid-template-columns: 1fr; }
  .sg-risk-banner { grid-template-columns: 1fr 1fr; }
  .sg-risk-banner-img { display: none; }
  .sg-article-feed .sg-article-grid { grid-template-columns: repeat(2, 1fr); }
  .sg-directory-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sg-dash-hero-img { width: 120px; height: 120px; }
  .sg-dash-hero-text h1 { font-size: var(--sg-step-3); }
  .sg-dash-hero-stats { flex-wrap: wrap; gap: var(--sg-sp-2); }
  .sg-metric-panels { grid-template-columns: 1fr; }
  .sg-console-grid { grid-template-columns: 1fr; }
  .sg-console-hero-img { grid-column: span 1; }
  .sg-risk-banner { grid-template-columns: 1fr; }
  .sg-risk-tiles { grid-template-columns: 1fr; }
  .sg-widget-teaser { grid-template-columns: 1fr; }
  .sg-widget-preview { display: none; }
  .sg-article-feed .sg-article-grid { grid-template-columns: 1fr; }
  .sg-directory-grid { grid-template-columns: 1fr; }
  .sg-compliance-bar { grid-template-columns: 1fr; }
  .sg-compliance-icon { display: none; }
  .sg-flowchart { padding-left: var(--sg-sp-6); }
}

/* ============================================================
   TOOLS LAYOUT EXTENSIONS
   ============================================================ */

/* Tool hub hero */
.sg-tool-hub-hero {
  position: relative;
  border-radius: var(--sg-radius);
  overflow: hidden;
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  margin-bottom: 40px;
  border: 3px solid var(--sg-yellow);
}
.sg-tool-hub-hero-bg { position: absolute; inset: 0; z-index: 0; }
.sg-tool-hub-hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.sg-tool-hub-hero-content { position: relative; z-index: 1; padding: 36px 40px; }
.sg-tool-hub-hero-content h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 700; color: var(--sg-white); margin: 12px 0 8px; }

/* Tool featured grid */
.sg-tools-featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
.sg-tool-featured-card {
  background: var(--sg-white);
  border: 2px solid var(--sg-border);
  border-radius: var(--sg-radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-decoration: none;
  transition: transform var(--sg-transition), box-shadow var(--sg-transition), border-color var(--sg-transition);
  box-shadow: var(--sg-shadow);
}
.sg-tool-featured-card:hover { transform: translateY(-5px); box-shadow: var(--sg-shadow-md); border-color: var(--sg-purple); }
.sg-tool-featured-icon { font-size: 2.5rem; margin-bottom: 8px; }
.sg-tool-featured-body h2 { font-size: 1.1rem; font-weight: 700; color: var(--sg-ink); margin: 6px 0 10px; }
.sg-tool-featured-body p { font-size: 0.84rem; color: var(--sg-ink-3); line-height: 1.6; margin-bottom: 20px; flex-grow: 1; }
.sg-tool-cta { margin-top: auto; pointer-events: none; }

/* ============================================================
   QUICK REFERENCE TOOL STYLES
   ============================================================ */
.sg-quick-ref-tool { }
.sg-qr-controls { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.sg-qr-search-wrap { position: relative; }
.sg-qr-search {
  width: 100%;
  padding: 12px 44px 12px 16px;
  border: 2px solid var(--sg-border);
  border-radius: var(--sg-radius);
  font-size: 0.95rem;
  font-family: var(--sg-font);
  color: var(--sg-ink);
  background: var(--sg-white);
  transition: border-color var(--sg-transition), box-shadow var(--sg-transition);
}
.sg-qr-search:focus { outline: none; border-color: var(--sg-purple); box-shadow: 0 0 0 3px var(--sg-purple-lt); }
.sg-qr-search-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 1.1rem; pointer-events: none; }
.sg-qr-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.sg-qr-filter {
  padding: 6px 16px;
  border: 2px solid var(--sg-border);
  border-radius: 20px;
  background: var(--sg-white);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sg-ink-2);
  cursor: pointer;
  transition: all var(--sg-transition);
  font-family: var(--sg-font);
}
.sg-qr-filter:hover { border-color: var(--sg-purple-lt); color: var(--sg-purple); }
.sg-qr-filter.sg-active { background: var(--sg-purple); border-color: var(--sg-purple); color: var(--sg-white); }
.sg-qr-count { font-size: 0.8rem; color: var(--sg-ink-3); margin-bottom: 12px; }
.sg-qr-list { display: flex; flex-direction: column; gap: 10px; }
.sg-qr-item {
  background: var(--sg-white);
  border: 1.5px solid var(--sg-border);
  border-radius: var(--sg-radius-sm);
  padding: 18px 20px;
  transition: border-color var(--sg-transition);
}
.sg-qr-item:hover { border-color: var(--sg-purple-lt); }
.sg-qr-item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sg-qr-term { font-size: 1rem; font-weight: 700; color: var(--sg-ink); margin: 0; }
.sg-qr-def { font-size: 0.88rem; color: var(--sg-ink-2); line-height: 1.6; margin-bottom: 8px; }
.sg-qr-more { font-size: 0.8rem; font-weight: 600; color: var(--sg-purple); }
.sg-qr-no-result { text-align: center; padding: 40px 20px; background: var(--sg-paper-2); border-radius: var(--sg-radius); font-size: 0.9rem; color: var(--sg-ink-3); }
.sg-qr-no-result a { color: var(--sg-purple); font-weight: 600; }

/* Category badges in quick ref */
.sg-qr-cat-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  color: var(--sg-white);
  flex-shrink: 0;
}
.sg-cat-sports { background: var(--sg-purple); }
.sg-cat-football { background: #2ECC71; }
.sg-cat-casino { background: #E74C3C; }
.sg-cat-lottery { background: #3498DB; }

.sg-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.sg-hidden { display: none !important; }

/* ============================================================
   QUIZ TOOL STYLES
   ============================================================ */
.sg-quiz-tool { }
.sg-quiz-start, .sg-quiz-active, .sg-quiz-result { }
.sg-quiz-intro {
  background: var(--sg-white);
  border: 2px solid var(--sg-border);
  border-radius: var(--sg-radius);
  padding: 48px 40px;
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}
.sg-quiz-icon { font-size: 3rem; margin-bottom: 16px; }
.sg-quiz-intro h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 12px; }
.sg-quiz-intro p { font-size: 0.9rem; color: var(--sg-ink-2); margin-bottom: 20px; }
.sg-quiz-meta { list-style: none; margin: 0 0 28px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sg-quiz-meta li { font-size: 0.82rem; color: var(--sg-ink-3); background: var(--sg-paper-2); padding: 4px 12px; border-radius: 20px; }
.sg-quiz-start-btn { min-width: 160px; }

.sg-quiz-progress-bar {
  height: 6px;
  background: var(--sg-paper-3);
  border-radius: 3px;
  margin-bottom: 8px;
  overflow: hidden;
}
.sg-quiz-progress-fill {
  height: 100%;
  background: var(--sg-purple);
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}
.sg-quiz-progress-text { font-size: 0.78rem; color: var(--sg-ink-3); margin-bottom: 20px; }

.sg-quiz-question-wrap { margin-bottom: 16px; }
.sg-quiz-question {
  font-size: 1rem;
  font-weight: 600;
  color: var(--sg-ink);
  line-height: 1.5;
  margin-bottom: 16px;
}
.sg-quiz-options { display: flex; flex-direction: column; gap: 10px; }
.sg-quiz-option {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: 2px solid var(--sg-border);
  border-radius: var(--sg-radius-sm);
  background: var(--sg-white);
  font-size: 0.9rem;
  font-family: var(--sg-font);
  color: var(--sg-ink);
  cursor: pointer;
  transition: border-color var(--sg-transition), background var(--sg-transition);
  line-height: 1.45;
}
.sg-quiz-option:hover:not([aria-disabled="true"]) { border-color: var(--sg-purple-lt); background: var(--sg-paper-2); }
.sg-quiz-option[aria-disabled="true"] { cursor: default; }
.sg-quiz-correct { border-color: #2ECC71 !important; background: #EAFAF1 !important; color: #1A7A45 !important; font-weight: 600; }
.sg-quiz-wrong { border-color: #E74C3C !important; background: #FDEDEC !important; color: #922B21 !important; }

.sg-quiz-explanation { margin: 16px 0; }
.sg-quiz-exp-inner {
  background: var(--sg-paper-2);
  border-left: 4px solid var(--sg-purple);
  border-radius: 0 var(--sg-radius-sm) var(--sg-radius-sm) 0;
  padding: 16px 20px;
  font-size: 0.88rem;
  color: var(--sg-ink-2);
  line-height: 1.65;
}
.sg-quiz-exp-inner strong { display: block; margin-bottom: 6px; font-size: 0.95rem; }
.sg-quiz-nav { margin-top: 16px; }

.sg-quiz-result {
  text-align: center;
  background: var(--sg-white);
  border: 2px solid var(--sg-border);
  border-radius: var(--sg-radius);
  padding: 48px 32px;
}
.sg-quiz-result-icon { font-size: 3rem; display: block; margin-bottom: 12px; }
.sg-quiz-result h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 12px; }
.sg-quiz-score { font-size: 2rem; font-weight: 700; color: var(--sg-purple); margin: 12px 0; }
.sg-quiz-result p { font-size: 0.9rem; color: var(--sg-ink-2); margin-bottom: 24px; }
.sg-quiz-result-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   MATCHING GAME STYLES
   ============================================================ */
.sg-match-game { }
.sg-match-intro {
  background: var(--sg-white);
  border: 2px solid var(--sg-border);
  border-radius: var(--sg-radius);
  padding: 48px 40px;
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
}
.sg-match-icon-big { font-size: 3.5rem; margin-bottom: 14px; }
.sg-match-intro h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 12px; }
.sg-match-intro p { font-size: 0.9rem; color: var(--sg-ink-2); margin-bottom: 20px; }
.sg-match-stats {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--sg-ink-2);
  font-weight: 500;
  margin-bottom: 20px;
  background: var(--sg-paper-2);
  border-radius: var(--sg-radius-sm);
  padding: 12px 20px;
}

.sg-match-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.sg-match-card {
  min-height: 88px;
  border: 2px solid var(--sg-border);
  border-radius: var(--sg-radius-sm);
  background: var(--sg-white);
  cursor: pointer;
  font-size: 0.82rem;
  font-family: var(--sg-font);
  color: var(--sg-ink);
  transition: all var(--sg-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
}
.sg-match-card:hover:not(.sg-card-matched) { border-color: var(--sg-purple-lt); background: var(--sg-paper-2); transform: translateY(-2px); }
.sg-match-card.sg-card-flipped { border-color: var(--sg-purple); background: var(--sg-paper-2); }
.sg-match-card.sg-card-matched { border-color: #2ECC71; background: #EAFAF1; color: #1A7A45; cursor: default; }
.sg-card-back { font-size: 1.8rem; }
.sg-card-front { font-size: 0.8rem; font-weight: 600; }

.sg-match-win {
  text-align: center;
  background: var(--sg-white);
  border: 3px solid var(--sg-yellow);
  border-radius: var(--sg-radius);
  padding: 48px 32px;
}
.sg-match-win-icon { font-size: 3.5rem; display: block; margin-bottom: 12px; }
.sg-match-win h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 12px; }
.sg-match-win p { font-size: 0.9rem; color: var(--sg-ink-2); margin-bottom: 12px; }
.sg-match-win-sub { color: var(--sg-ink-3); font-size: 0.85rem; margin-bottom: 28px; }

/* ============================================================
   ABOUT PAGE IMPROVEMENTS
   ============================================================ */
.sg-author-stat .sg-big-number { color: var(--sg-purple); }

/* ============================================================
   RESPONSIVE ADDITIONS (inner pages + tools)
   ============================================================ */
@media (max-width: 1100px) {
  .sg-tools-featured-grid { grid-template-columns: 1fr; }
  .sg-match-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .sg-match-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 620px) {
  .sg-tools-featured-grid { grid-template-columns: 1fr; }
  .sg-match-grid { grid-template-columns: repeat(2, 1fr); }
  .sg-qr-filters { gap: 6px; }
  .sg-quiz-intro, .sg-match-intro { padding: 32px 20px; }
  .sg-footer-cols { grid-template-columns: 1fr; }
}

/* ============================================================
   LAB / EXPERIMENT MOTION SYSTEM
   Theme: 運彩玩法實驗室 — scientific, analytical, restrained
   ============================================================ */

/* --- 1. Bubble Particles --- */
.sg-bubble-container {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.sg-bubble {
  position: absolute;
  bottom: -12px;
  border-radius: 50%;
  opacity: 0.18;
  filter: blur(1px);
  animation: sg-bubble-rise linear infinite;
}
@keyframes sg-bubble-rise {
  0%   { transform: translateY(0) translateX(0); }
  25%  { transform: translateY(-30vh) translateX(6px); }
  50%  { transform: translateY(-60vh) translateX(-4px); }
  75%  { transform: translateY(-85vh) translateX(5px); }
  100% { transform: translateY(-120%) translateX(-2px); opacity: 0; }
}

/* --- 2. Chemical Reaction Color Shift --- */
.sg-react {
  border-top: 3px solid var(--sg-purple);
}
.sg-react.sg-react-visible {
  animation: sg-reaction 1.2s ease-out 1 forwards;
}
@keyframes sg-reaction {
  0%   { border-top-color: var(--sg-purple); }
  30%  { border-top-color: var(--sg-yellow); }
  60%  { border-top-color: var(--sg-purple-lt); }
  100% { border-top-color: var(--sg-purple); }
}

/* --- 3. Split-Text Reveal (data printout) --- */
.sg-char {
  display: inline-block;
  opacity: 0;
  transition: opacity 0.01s ease;
  font-family: 'Space Grotesk', 'Courier New', monospace;
}
.sg-char-visible {
  opacity: 1;
}

/* --- 4. Beaker Fill Progress --- */
.sg-beaker-fill {
  background-image: linear-gradient(
    0deg,
    rgba(155, 89, 182, 0.15) 0%,
    rgba(155, 89, 182, 0.15) 50%,
    transparent 50%,
    transparent 100%
  );
  background-size: 100% 200%;
  background-position: 0 0;
  transition: background-position 1s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.sg-beaker-fill.sg-beaker-active {
  background-position: 0 100%;
}

/* --- 5. Graph Paper Grid Background --- */
.sg-graph-grid {
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      rgba(155, 89, 182, 0.04) 39px,
      rgba(155, 89, 182, 0.04) 40px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      rgba(155, 89, 182, 0.04) 39px,
      rgba(155, 89, 182, 0.04) 40px
    );
}

/* --- 6. 3D Card Tilt --- */
.sg-tilt-card {
  transition: transform 0.18s ease-out, box-shadow var(--sg-transition), border-color var(--sg-transition);
  will-change: transform;
}

/* --- 7. Staggered Grid Reveal --- */
.sg-stagger-item {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.sg-stagger-item.sg-stagger-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--sg-paper-2);
}
::-webkit-scrollbar-thumb {
  background: var(--sg-purple-lt);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--sg-purple);
}

/* --- Selection --- */
::selection {
  background: var(--sg-purple);
  color: var(--sg-white);
}

/* --- Reduced Motion Override (motion system) --- */
@media (prefers-reduced-motion: reduce) {
  .sg-bubble { animation: none; display: none; }
  .sg-react.sg-react-visible { animation: none; }
  .sg-char { opacity: 1; transition: none; }
  .sg-beaker-fill { transition: none; background-position: 0 100%; }
  .sg-stagger-item { opacity: 1; transform: none; transition: none; }
  .sg-tilt-card { transition: none; }
}
