/* =========================================================
   STUDY COMPASS — styles.css
   4-theme CSS variable system · mobile-first · cozy aesthetic
   ========================================================= */

/* ---------- 1. THEME VARIABLE SYSTEM ---------- */
/*
   Four themes are defined via [data-theme="..."] on <html>.
   The default (:root) matches the "morning" theme so the
   site is presentational even before JS runs.
*/
:root,
[data-theme="morning"] {
  --bg:           #FCFBF7;
  --bg-alt:       #F4F1E8;
  --surface:      #FFFFFF;
  --text:         #4A5D23;
  --text-soft:    #6B7A4A;
  --text-muted:   #8A9075;
  --accent:       #4A5D23;
  --accent-soft:  #8FA36A;
  --border:       #E2DEC9;
  --shadow:       0 4px 20px rgba(74, 93, 35, 0.08);
  --shadow-lg:    0 12px 40px rgba(74, 93, 35, 0.12);
  --popup-bg:     #FFFFFF;
  --overlay:      rgba(74, 93, 35, 0.35);
}
svg {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  vertical-align: -0.2em;
}
[data-theme="night"] {
  --bg:           #121212;
  --bg-alt:       #1A1A1A;
  --surface:      #1E1E1E;
  --text:         #E0E0E0;
  --text-soft:    #B5B5B5;
  --text-muted:   #888888;
  --accent:       #A8C0A0;
  --accent-soft:  #6A8262;
  --border:       #2E2E2E;
  --shadow:       0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg:    0 12px 40px rgba(0, 0, 0, 0.55);
  --popup-bg:     #1E1E1E;
  --overlay:      rgba(0, 0, 0, 0.7);
}

[data-theme="library"] {
  --bg:           #F4ECD8;
  --bg-alt:       #EDE3C8;
  --surface:      #FBF6E9;
  --text:         #3B3A36;
  --text-soft:    #5C5A52;
  --text-muted:   #8B887D;
  --accent:       #3B3A36;
  --accent-soft:  #7A6E55;
  --border:       #D9CEB0;
  --shadow:       0 4px 20px rgba(59, 58, 54, 0.1);
  --shadow-lg:    0 12px 40px rgba(59, 58, 54, 0.15);
  --popup-bg:     #FBF6E9;
  --overlay:      rgba(59, 58, 54, 0.4);
}

[data-theme="nature"] {
  --bg:           #E8F5E9;
  --bg-alt:       #D7ECD9;
  --surface:      #F4FBF4;
  --text:         #1B5E20;
  --text-soft:    #2E7D32;
  --text-muted:   #5A8A5E;
  --accent:       #1B5E20;
  --accent-soft:  #4C8C50;
  --border:       #B8D8BA;
  --shadow:       0 4px 20px rgba(27, 94, 32, 0.08);
  --shadow-lg:    0 12px 40px rgba(27, 94, 32, 0.14);
  --popup-bg:     #F4FBF4;
  --overlay:      rgba(27, 94, 32, 0.35);
}

/* ---------- 2. GLOBAL RESET & BASE ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  transition: background-color 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.75; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; color: var(--text); }

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 3. BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: var(--shadow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); opacity: 1; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-alt); opacity: 1; }
.btn-block { width: 100%; }

/* ---------- 4. WELCOME POPUP ---------- */
.welcome-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.welcome-overlay.is-visible { opacity: 1; visibility: visible; }

.welcome-popup {
  background: var(--popup-bg);
  border-radius: 20px;
  padding: 40px 32px;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.welcome-overlay.is-visible .welcome-popup { transform: translateY(0) scale(1); }

.welcome-title { font-size: 1.6rem; margin-bottom: 8px; }
.welcome-subtitle { color: var(--text-soft); margin-bottom: 28px; font-size: 1.05rem; }

.welcome-theme-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}
.welcome-theme-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--preview-bg);
  color: var(--preview-text);
  border-radius: 14px;
  border: 2px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.15s, border-color 0.2s;
}
.welcome-theme-btn:hover {
  transform: translateY(-3px);
  border-color: var(--preview-text);
}
.theme-icon { font-size: 1.8rem; }
.theme-label { font-size: 0.85rem; }

.welcome-memory-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* ---------- 5. STICKY HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s ease;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

.main-nav { display: flex; gap: 26px; }
.main-nav a {
  color: var(--text-soft);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
}
.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s;
}
.main-nav a:hover { opacity: 1; color: var(--text); }
.main-nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 14px; }

.search-wrap { position: relative; }
.search-input {
  padding: 9px 14px 9px 36px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  width: 220px;
  transition: width 0.25s, border-color 0.2s;
}
.search-input:focus { outline: none; border-color: var(--accent); width: 260px; }
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.6;
  pointer-events: none;
}

.theme-toggles { display: flex; gap: 4px; }
.theme-toggle-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.2s;
  opacity: 0.55;
}
.theme-toggle-btn:hover { opacity: 1; transform: scale(1.1); background: var(--bg-alt); }
.theme-toggle-btn.is-active {
  opacity: 1;
  background: var(--bg-alt);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
.mobile-menu-btn span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 0 20px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.mobile-nav a {
  padding: 12px 0;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

/* ---------- 6. HERO SECTION ---------- */
.hero {
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 50px;
  align-items: center;
}
.hero-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-alt);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 18px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.hero-headline {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 18px;
  letter-spacing: -0.02em;
}
.hero-subheadline {
  font-size: 1.1rem;
  color: var(--text-soft);
  margin-bottom: 28px;
  max-width: 520px;
}
.hero-cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px; }

.hero-stats { display: flex; gap: 36px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.6rem; color: var(--accent); }
.hero-stats span { font-size: 0.8rem; color: var(--text-muted); }

.hero-visual {
  position: relative;
  height: 360px;
}
.hero-card {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  font-size: 2.5rem;
  box-shadow: var(--shadow);
  animation: floatCard 6s ease-in-out infinite;
}
.hero-card-1 { top: 10%; left: 10%; animation-delay: 0s; }
.hero-card-2 { top: 25%; right: 5%; animation-delay: 1.2s; }
.hero-card-3 { bottom: 25%; left: 0; animation-delay: 2.4s; }
.hero-card-4 { bottom: 5%; right: 15%; animation-delay: 3.6s; }

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* ---------- 7. SECTIONS ---------- */
.section { padding: 70px 0; }
.section-alt { background: var(--bg-alt); }

.section-header { text-align: center; max-width: 640px; margin: 0 auto 50px; }
.section-eyebrow {
  display: block;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  margin-bottom: 12px;
  letter-spacing: -0.015em;
}
.section-subtitle {
  color: var(--text-soft);
  font-size: 1.05rem;
}

/* ---------- 8. TOOLS GRID ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 22px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}
.tool-card:hover,
.tool-card:focus {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-soft);
  outline: none;
}
.tool-card.is-hidden { display: none; }

.tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}
.tool-name { font-size: 1.1rem; margin-bottom: 8px; }
.tool-desc {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-bottom: 18px;
  flex-grow: 1;
}
.tool-link {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
}

.no-results-msg {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-style: italic;
}

/* ---------- 9. BLOG GRID ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 26px;
}
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.blog-card.is-hidden { display: none; }

.blog-thumb {
  background: var(--bg-alt);
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.blog-body { padding: 22px; }
.blog-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg-alt);
  color: var(--accent);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.blog-title { font-size: 1.15rem; margin-bottom: 8px; }
.blog-excerpt { color: var(--text-soft); font-size: 0.9rem; margin-bottom: 14px; }
.blog-link { font-weight: 600; font-size: 0.9rem; color: var(--accent); }

/* ---------- 10. PREMIUM GRID ---------- */
.premium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 26px;
}
.premium-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 24px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}
.premium-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.premium-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 4px 12px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.premium-icon {
  font-size: 2.4rem;
  margin-bottom: 14px;
}
.premium-card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.premium-card p { color: var(--text-soft); font-size: 0.92rem; margin-bottom: 20px; }

/* ---------- 10b. LEGAL & CONTACT PAGES ---------- */
.legal-page { max-width: 820px; margin: 0 auto; }
.legal-title {
  font-size: clamp(2rem, 5vw, 2.8rem);
  margin: 14px 0 18px;
  letter-spacing: -0.02em;
}
.legal-intro {
  color: var(--text-soft);
  font-size: 1.05rem;
  margin-bottom: 32px;
  line-height: 1.75;
}
.legal-toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 26px;
  margin-bottom: 40px;
}
.legal-toc h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 12px; }
.legal-toc ul { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.legal-toc a { color: var(--text-soft); font-size: 0.92rem; }
.legal-toc a:hover { color: var(--accent); }

.legal-content h2 {
  font-size: 1.4rem;
  margin: 36px 0 12px;
  scroll-margin-top: 90px;
}
.legal-content p {
  color: var(--text-soft);
  line-height: 1.8;
  margin-bottom: 14px;
}
.legal-content ul {
  margin: 0 0 16px 22px;
  color: var(--text-soft);
  line-height: 1.8;
}
.legal-content ul li { margin-bottom: 6px; }
.legal-content a { text-decoration: underline; }

/* Contact page */
.contact-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 50px;
  align-items: start;
}
.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.form-field { margin-bottom: 18px; }
.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--accent);
}
.form-field textarea { resize: vertical; min-height: 130px; }
.form-status {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-top: 14px;
  display: none;
}
.form-status.is-success { display: block; background: rgba(74, 93, 35, 0.1); color: var(--accent); }
.form-status.is-error { display: block; background: rgba(180, 60, 60, 0.1); color: #b43c3c; }

.contact-aside h3 { font-size: 1.2rem; margin-bottom: 14px; }
.contact-aside p { color: var(--text-soft); line-height: 1.75; margin-bottom: 14px; }
.contact-channels {
  list-style: none;
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.contact-channels li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.95rem;
}
.contact-channels strong { display: block; color: var(--text); }
.contact-channels span { color: var(--text-soft); font-size: 0.88rem; }
.channel-icon { font-size: 1.3rem; flex-shrink: 0; }

@media (max-width: 800px) {
  .contact-layout { grid-template-columns: 1fr; gap: 30px; }
  .legal-toc ul { grid-template-columns: 1fr; }
}

/* ---------- 10c. FLASHCARD MAKER ---------- */
.flashcard-app { display: flex; flex-direction: column; gap: 22px; }

/* Builder: form to add a new card */
.fc-builder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.fc-builder h3 { font-size: 1.05rem; margin-bottom: 14px; }
.fc-builder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}
.fc-builder input,
.fc-builder textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color 0.2s;
}
.fc-builder input:focus,
.fc-builder textarea:focus { outline: none; border-color: var(--accent); }
.fc-builder textarea { resize: vertical; min-height: 60px; }

/* List of created cards */
.fc-deck-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
}
.fc-deck-list h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
  margin-bottom: 12px;
}
.fc-deck-count {
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-alt);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
}
.fc-empty {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.92rem;
}
.fc-card-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  align-items: center;
}
.fc-card-row:last-child { border-bottom: none; }
.fc-card-row .q, .fc-card-row .a { color: var(--text-soft); word-break: break-word; }
.fc-card-row .q::before { content: 'Q: '; font-weight: 700; color: var(--accent); }
.fc-card-row .a::before { content: 'A: '; font-weight: 700; color: var(--accent); }
.fc-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.fc-delete-btn:hover { color: #b43c3c; background: rgba(180, 60, 60, 0.08); }

/* Study mode: large flippable card */
.fc-study {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 24px;
  box-shadow: var(--shadow);
}
.fc-study-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.fc-progress { font-weight: 600; color: var(--accent); }
.fc-clear-btn {
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--text-soft);
  border: 1px solid var(--border);
  cursor: pointer;
}
.fc-clear-btn:hover { color: #b43c3c; border-color: #b43c3c; }

.fc-card-container {
  perspective: 1500px;
  margin: 0 auto 22px;
  max-width: 500px;
  cursor: pointer;
}
.fc-card {
  position: relative;
  width: 100%;
  height: 260px;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}
.fc-card.is-flipped { transform: rotateY(180deg); }
.fc-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 2px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 26px;
  text-align: center;
  background: var(--bg);
}
.fc-card-face .face-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.fc-card-face .face-text {
  font-size: 1.15rem;
  color: var(--text);
  line-height: 1.5;
  overflow-y: auto;
  max-height: 180px;
}
.fc-card-back {
  transform: rotateY(180deg);
  background: var(--bg-alt);
}

.fc-study-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.fc-hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

@media (max-width: 600px) {
  .fc-builder-grid { grid-template-columns: 1fr; }
  .fc-card-row { grid-template-columns: 1fr auto; }
  .fc-card-row .a { grid-column: 1 / -1; padding-left: 12px; }
  .fc-card { height: 220px; }
  .fc-card-face .face-text { font-size: 1rem; }
}

/* ---------- 10d. HOMEWORK CALCULATOR ---------- */
.calc-app { display: flex; flex-direction: column; gap: 22px; }

.calc-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-alt);
  padding: 6px;
  border-radius: 12px;
  flex-wrap: wrap;
}
.calc-tab {
  flex: 1;
  min-width: 110px;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-soft);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.calc-tab:hover { color: var(--text); }
.calc-tab.is-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow);
}

.calc-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 26px;
  box-shadow: var(--shadow);
  display: none;
}
.calc-panel.is-active { display: block; }
.calc-panel h3 { font-size: 1.15rem; margin-bottom: 6px; }
.calc-panel .calc-desc {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-bottom: 22px;
}

.calc-field { margin-bottom: 16px; }
.calc-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.calc-field input,
.calc-field select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.calc-field input:focus,
.calc-field select:focus { outline: none; border-color: var(--accent); }

.calc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.calc-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.calc-result {
  margin-top: 22px;
  padding: 22px 20px;
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: 12px;
  text-align: center;
}
.calc-result .result-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.calc-result .result-value {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-bottom: 6px;
}
.calc-result .result-detail {
  font-size: 0.88rem;
  color: var(--text-soft);
}

/* GPA grade rows */
.gpa-rows { margin-bottom: 14px; }
.gpa-row {
  display: grid;
  grid-template-columns: 1fr 130px auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.gpa-row input,
.gpa-row select {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}
.gpa-row input:focus,
.gpa-row select:focus { outline: none; border-color: var(--accent); }
.gpa-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.gpa-remove-btn:hover { color: #b43c3c; background: rgba(180, 60, 60, 0.08); }
.gpa-add-row {
  margin-top: 4px;
  background: var(--bg-alt);
  color: var(--accent);
  border: 1.5px dashed var(--border);
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
.gpa-scale-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 10px;
  font-style: italic;
}

@media (max-width: 600px) {
  .calc-row { grid-template-columns: 1fr; }
  .gpa-row { grid-template-columns: 1fr; gap: 6px; }
  .gpa-row .gpa-remove-btn { justify-self: start; }
  .calc-result .result-value { font-size: 2rem; }
}

/* ---------- 10e. QUIZ GENERATOR ---------- */
.quiz-app { display: flex; flex-direction: column; gap: 22px; }
.quiz-tabs { display: flex; gap: 6px; background: var(--bg-alt); padding: 6px; border-radius: 12px; flex-wrap: wrap; }
.quiz-tab { flex: 1; min-width: 120px; padding: 10px 14px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; color: var(--text-soft); background: transparent; border: none; cursor: pointer; transition: background 0.2s, color 0.2s; }
.quiz-tab:hover { color: var(--text); }
.quiz-tab.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.quiz-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 28px 26px; box-shadow: var(--shadow); display: none; }
.quiz-panel.is-active { display: block; }
.quiz-panel h3 { font-size: 1.15rem; margin-bottom: 6px; }
.quiz-panel .quiz-desc { color: var(--text-soft); font-size: 0.9rem; margin-bottom: 22px; }
.quiz-field { margin-bottom: 16px; }
.quiz-field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.quiz-field textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font-family: inherit; font-size: 0.92rem; line-height: 1.6; resize: vertical; min-height: 160px; transition: border-color 0.2s; }
.quiz-field textarea:focus { outline: none; border-color: var(--accent); }
.quiz-field select { padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-family: inherit; font-size: 0.92rem; }
.quiz-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.quiz-questions { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.quiz-q-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; padding: 12px; background: var(--bg-alt); border-radius: 10px; align-items: center; font-size: 0.9rem; }
.quiz-q-row input { width: 100%; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-family: inherit; font-size: 0.9rem; }
.quiz-q-row input:focus { outline: none; border-color: var(--accent); }
.quiz-q-remove { background: none; border: none; color: var(--text-muted); font-size: 1.1rem; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.quiz-q-remove:hover { color: #b43c3c; background: rgba(180, 60, 60, 0.08); }
.quiz-empty { text-align: center; padding: 28px 20px; color: var(--text-muted); font-style: italic; font-size: 0.92rem; }
.quiz-take-progress { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; font-size: 0.88rem; color: var(--text-muted); }
.quiz-take-progress strong { color: var(--accent); font-weight: 700; }
.quiz-take-q { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 12px; padding: 22px 20px; margin-bottom: 16px; }
.quiz-take-q .q-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 6px; }
.quiz-take-q .q-text { font-size: 1.05rem; color: var(--text); line-height: 1.5; margin-bottom: 14px; }
.quiz-take-q input { width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-family: inherit; font-size: 0.95rem; }
.quiz-take-q input:focus { outline: none; border-color: var(--accent); }
.quiz-take-q input.is-correct { border-color: #4a8a3a; background: rgba(74, 138, 58, 0.08); }
.quiz-take-q input.is-wrong { border-color: #b43c3c; background: rgba(180, 60, 60, 0.08); }
.quiz-feedback { font-size: 0.85rem; margin-top: 8px; display: none; }
.quiz-feedback.is-visible { display: block; }
.quiz-feedback.is-correct { color: #4a8a3a; }
.quiz-feedback.is-wrong { color: #b43c3c; }
.quiz-result { margin-top: 24px; padding: 30px 24px; background: var(--bg-alt); border: 1px dashed var(--border); border-radius: 14px; text-align: center; }
.quiz-result .result-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 10px; }
.quiz-result .result-value { font-size: 2.6rem; font-weight: 800; color: var(--accent); line-height: 1.1; margin-bottom: 8px; }
.quiz-result .result-detail { font-size: 0.92rem; color: var(--text-soft); }
@media (max-width: 600px) { .quiz-q-row { grid-template-columns: 1fr; } .quiz-tab { min-width: 90px; font-size: 0.82rem; padding: 9px 8px; } }

/* ---------- 10f. STUDY PLANNER ---------- */
.planner-app { display: flex; flex-direction: column; gap: 22px; }
.planner-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 20px; box-shadow: var(--shadow); }
.planner-toolbar h3 { font-size: 1.1rem; margin: 0; display: flex; align-items: center; gap: 10px; }
.planner-week-pill { font-size: 0.78rem; font-weight: 600; background: var(--bg-alt); color: var(--accent); padding: 4px 12px; border-radius: 999px; }
.planner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.planner-stat { display: flex; flex-direction: column; align-items: center; padding: 6px 14px; border-left: 1px solid var(--border); }
.planner-stat:first-of-type { border-left: none; }
.planner-stat strong { font-size: 1.3rem; color: var(--accent); font-weight: 800; }
.planner-stat span { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.planner-stats-group { display: flex; }
.planner-grid-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); overflow-x: auto; }
.planner-grid { display: grid; grid-template-columns: 70px repeat(7, minmax(120px, 1fr)); gap: 6px; min-width: 900px; }
.planner-corner { background: transparent; padding: 10px 6px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); text-align: center; }
.planner-day-header { background: var(--bg-alt); padding: 10px 8px; border-radius: 8px; text-align: center; font-size: 0.82rem; font-weight: 700; color: var(--text); }
.planner-day-header .day-name { display: block; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.7rem; color: var(--text-muted); }
.planner-day-header .day-date { font-size: 0.92rem; color: var(--accent); }
.planner-day-header.is-today { background: var(--accent); color: var(--bg); }
.planner-day-header.is-today .day-name, .planner-day-header.is-today .day-date { color: var(--bg); }
.planner-time-label { padding: 8px 4px; font-size: 0.7rem; font-weight: 600; color: var(--text-muted); text-align: right; border-right: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: flex-end; }
.planner-cell { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; min-height: 56px; padding: 4px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.planner-cell:hover { background: var(--bg-alt); border-color: var(--accent-soft); }
.planner-cell.is-empty::before { content: '+'; color: var(--text-muted); font-size: 1rem; font-weight: 600; margin: auto; opacity: 0; transition: opacity 0.15s; }
.planner-cell:hover.is-empty::before { opacity: 1; }
.task-chip { background: var(--accent); color: var(--bg); border-radius: 6px; padding: 4px 8px; font-size: 0.78rem; font-weight: 600; line-height: 1.3; cursor: pointer; display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; transition: opacity 0.15s; word-break: break-word; }
.task-chip:hover { opacity: 0.85; }
.task-chip.is-done { background: var(--bg-alt); color: var(--text-muted); text-decoration: line-through; border: 1px solid var(--border); }
.task-chip .chip-delete { background: none; border: none; color: inherit; font-size: 0.85rem; padding: 0 0 0 4px; cursor: pointer; opacity: 0.6; line-height: 1; }
.task-chip .chip-delete:hover { opacity: 1; }
.planner-modal-overlay { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 9998; opacity: 0; visibility: hidden; transition: opacity 0.25s ease, visibility 0.25s ease; }
.planner-modal-overlay.is-visible { opacity: 1; visibility: visible; }
.planner-modal { background: var(--popup-bg, var(--surface)); border-radius: 20px; padding: 28px 26px; max-width: 440px; width: 100%; box-shadow: var(--shadow-lg); transform: translateY(12px) scale(0.97); transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
.planner-modal-overlay.is-visible .planner-modal { transform: translateY(0) scale(1); }
.planner-modal h3 { font-size: 1.15rem; margin-bottom: 18px; }
.planner-modal .planner-field { margin-bottom: 14px; }
.planner-modal .planner-field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 5px; color: var(--text); }
.planner-modal .planner-field input, .planner-modal .planner-field select { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-family: inherit; font-size: 0.92rem; transition: border-color 0.2s; }
.planner-modal .planner-field input:focus, .planner-modal .planner-field select:focus { outline: none; border-color: var(--accent); }
.planner-modal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.planner-modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.planner-modal-actions .btn-danger { background: transparent; color: #b43c3c; border: 1.5px solid #b43c3c; }
.planner-modal-actions .btn-danger:hover { background: rgba(180, 60, 60, 0.08); }
.planner-empty-banner { text-align: center; padding: 20px; background: var(--bg-alt); border: 1px dashed var(--border); border-radius: 12px; color: var(--text-soft); font-size: 0.92rem; }
.planner-empty-banner strong { color: var(--accent); }
@media (max-width: 760px) { .planner-toolbar { flex-direction: column; align-items: stretch; } .planner-actions { justify-content: center; } .planner-stats-group { justify-content: center; } }

/* ---------- 10g. ESSAY OUTLINE GENERATOR ---------- */
.essay-app { display: flex; flex-direction: column; gap: 22px; }
.essay-meta { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px 26px; box-shadow: var(--shadow); }
.essay-meta h3 { font-size: 1.1rem; margin-bottom: 14px; }
.essay-field { margin-bottom: 16px; }
.essay-field:last-child { margin-bottom: 0; }
.essay-field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.essay-field label .hint { font-weight: 400; font-size: 0.78rem; color: var(--text-muted); margin-left: 6px; }
.essay-field input, .essay-field textarea { width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-family: inherit; font-size: 0.95rem; line-height: 1.5; transition: border-color 0.2s; }
.essay-field input:focus, .essay-field textarea:focus { outline: none; border-color: var(--accent); }
.essay-field textarea { resize: vertical; min-height: 70px; }
.essay-body-builder { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px 26px; box-shadow: var(--shadow); }
.essay-body-builder h3 { font-size: 1.1rem; margin-bottom: 4px; display: flex; justify-content: space-between; align-items: center; }
.essay-body-builder .builder-desc { font-size: 0.88rem; color: var(--text-soft); margin-bottom: 18px; }
.essay-body-count { font-size: 0.78rem; font-weight: 600; background: var(--bg-alt); color: var(--accent); padding: 4px 10px; border-radius: 999px; }
.essay-paragraph { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 12px; padding: 18px 18px 14px; margin-bottom: 14px; position: relative; }
.essay-paragraph-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.essay-paragraph-header .para-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.essay-paragraph-remove { background: none; border: none; color: var(--text-muted); font-size: 0.95rem; padding: 4px 10px; border-radius: 6px; cursor: pointer; transition: color 0.2s, background 0.2s; }
.essay-paragraph-remove:hover { color: #b43c3c; background: rgba(180, 60, 60, 0.08); }
.essay-paragraph .essay-field { margin-bottom: 10px; }
.essay-paragraph .essay-field:last-child { margin-bottom: 0; }
.essay-add-para { width: 100%; background: var(--bg); color: var(--accent); border: 1.5px dashed var(--border); padding: 12px; border-radius: 10px; font-weight: 600; font-size: 0.92rem; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.essay-add-para:hover { border-color: var(--accent); background: var(--bg-alt); }
.essay-conclusion { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px 26px; box-shadow: var(--shadow); }
.essay-conclusion h3 { font-size: 1.1rem; margin-bottom: 14px; }
.essay-preview { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 26px 26px 22px; box-shadow: var(--shadow); }
.essay-preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.essay-preview-header h3 { font-size: 1.15rem; margin: 0; }
.essay-preview-actions { display: flex; gap: 8px; }
.essay-preview-actions .btn { padding: 8px 16px; font-size: 0.88rem; }
.essay-outline { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 12px; padding: 22px 24px; font-family: 'Lora', Georgia, serif; font-size: 0.95rem; line-height: 1.7; color: var(--text); }
.essay-outline .outline-section { margin-bottom: 16px; }
.essay-outline .outline-section:last-child { margin-bottom: 0; }
.essay-outline .outline-roman { font-weight: 700; color: var(--accent); font-size: 1rem; display: block; margin-bottom: 4px; }
.essay-outline .outline-section-content { padding-left: 20px; border-left: 2px solid var(--border); margin-left: 4px; }
.essay-outline .outline-item { margin-bottom: 6px; font-size: 0.92rem; }
.essay-outline .outline-item:last-child { margin-bottom: 0; }
.essay-outline .outline-item .item-label { font-weight: 700; color: var(--text); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.06em; display: block; margin-bottom: 2px; font-family: 'Inter', sans-serif; }
.essay-outline .outline-item .item-text { color: var(--text-soft); font-style: italic; }
.essay-outline .outline-empty { color: var(--text-muted); font-style: italic; text-align: center; padding: 20px; }
.essay-copy-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--accent); color: var(--bg); padding: 12px 22px; border-radius: 999px; font-size: 0.88rem; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transition: opacity 0.25s, transform 0.25s, visibility 0.25s; z-index: 9997; }
.essay-copy-toast.is-visible { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
@media (max-width: 600px) { .essay-preview-header { flex-direction: column; align-items: stretch; } .essay-preview-actions { justify-content: stretch; } .essay-preview-actions .btn { flex: 1; } .essay-outline { padding: 16px; font-size: 0.9rem; } .essay-outline .outline-section-content { padding-left: 14px; } }

/* ---------- 10h. BLOG PAGE ---------- */
.blog-page { max-width: 1100px; margin: 0 auto; }
.blog-featured { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; overflow: hidden; margin-bottom: 50px; box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s; }
.blog-featured:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.blog-featured-thumb { background: var(--bg-alt); min-height: 240px; display: flex; align-items: center; justify-content: center; font-size: 4rem; }
.blog-featured-body { padding: 36px 36px 36px 0; display: flex; flex-direction: column; justify-content: center; }
.blog-featured-body .blog-tag { margin-bottom: 12px; }
.blog-featured-body h2 { font-size: 1.6rem; margin-bottom: 12px; line-height: 1.3; }
.blog-featured-body .blog-meta { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 14px; }
.blog-featured-body p { color: var(--text-soft); line-height: 1.7; margin-bottom: 18px; }
.blog-page .blog-grid { margin-bottom: 40px; }
.blog-article { max-width: 760px; margin: 0 auto; }
.blog-article-header { margin-bottom: 30px; text-align: center; }
.blog-article-header .blog-tag { margin-bottom: 14px; }
.blog-article-header h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.2; margin-bottom: 14px; letter-spacing: -0.015em; }
.blog-article-meta { font-size: 0.85rem; color: var(--text-muted); display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.blog-article-meta span { display: flex; align-items: center; gap: 5px; }
.blog-article-hero { background: var(--bg-alt); border-radius: 20px; min-height: 220px; display: flex; align-items: center; justify-content: center; font-size: 4rem; margin-bottom: 30px; }
.blog-article-body { font-family: 'Lora', Georgia, serif; font-size: 1.08rem; line-height: 1.8; color: var(--text); }
.blog-article-body p { margin-bottom: 22px; }
.blog-article-body h2 { font-family: 'Inter', sans-serif; font-size: 1.4rem; margin: 36px 0 14px; color: var(--text); scroll-margin-top: 90px; }
.blog-article-body h3 { font-family: 'Inter', sans-serif; font-size: 1.15rem; margin: 28px 0 10px; color: var(--accent); }
.blog-article-body ul, .blog-article-body ol { margin: 0 0 22px 24px; line-height: 1.8; }
.blog-article-body li { margin-bottom: 8px; }
.blog-article-body blockquote { border-left: 3px solid var(--accent); padding: 8px 0 8px 22px; margin: 22px 0; font-style: italic; color: var(--text-soft); }
.blog-article-body a { color: var(--accent); text-decoration: underline; }
.blog-article-body strong { color: var(--text); }
.blog-article-footer { margin-top: 50px; padding-top: 30px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.blog-author { display: flex; align-items: center; gap: 12px; }
.blog-author-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--bg-alt); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.blog-author-info strong { display: block; font-size: 0.95rem; }
.blog-author-info span { font-size: 0.82rem; color: var(--text-muted); }
@media (max-width: 800px) { .blog-featured { grid-template-columns: 1fr; } .blog-featured-thumb { min-height: 180px; } .blog-featured-body { padding: 24px 26px 30px; } .blog-article-body { font-size: 1rem; } }
@media (max-width: 600px) { .blog-article-footer { flex-direction: column; align-items: flex-start; } }

/* ---------- 11. TOOL PAGE TEMPLATE LAYOUT ---------- */
.tool-page-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
  text-align: left;
}

/* Interactive tool interface */
.tool-interface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 50px 30px;
  text-align: center;
  margin-bottom: 36px;
  box-shadow: var(--shadow);
}
.timer-display {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.timer-mode {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}
.timer-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.timer-meta {
  font-size: 0.88rem;
  color: var(--text-soft);
}

/* Rich-text article */
.tool-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px;
}
.tool-article h2 { font-size: 1.6rem; margin-bottom: 16px; }
.tool-article h3 {
  font-size: 1.2rem;
  margin: 26px 0 10px;
  color: var(--accent);
}
.tool-article p {
  margin-bottom: 16px;
  color: var(--text-soft);
  line-height: 1.75;
}
.tool-article a { color: var(--accent); text-decoration: underline; }

/* Sidebar */
.tool-page-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 90px;
}

.ad-slot {
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.ad-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.ad-placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.sidebar-promo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px;
}
.sidebar-promo h3 { font-size: 1.1rem; margin-bottom: 18px; }
.promo-list { list-style: none; display: flex; flex-direction: column; gap: 18px; }
.promo-list li { display: flex; gap: 12px; }
.promo-icon { font-size: 1.4rem; flex-shrink: 0; }
.promo-list strong { display: block; font-size: 0.92rem; margin-bottom: 2px; }
.promo-list p { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 4px; }
.promo-list a { font-size: 0.82rem; font-weight: 600; }

/* ---------- 12. ABOUT ---------- */
.about-inner { max-width: 760px; }
.about-text p { color: var(--text-soft); margin-bottom: 16px; line-height: 1.75; }

/* ---------- 13. FOOTER ---------- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding-top: 50px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 40px;
  padding-bottom: 40px;
}
.footer-brand p {
  color: var(--text-soft);
  margin-top: 10px;
  font-size: 0.92rem;
  max-width: 320px;
}
.footer-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}
.footer-nav h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.footer-nav a {
  display: block;
  padding: 6px 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  text-align: center;
}
.footer-bottom p { color: var(--text-muted); font-size: 0.85rem; }

/* ---------- 14. RESPONSIVE (mobile-first refinements) ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 30px; }
  .hero-visual { display: none; }
  .tool-page-layout { grid-template-columns: 1fr; }
  .tool-page-sidebar { position: static; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .main-nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .mobile-nav.is-open { display: flex; }
  .search-input { width: 150px; }
  .search-input:focus { width: 180px; }
  .hero-stats { gap: 22px; }
  .hero-stats strong { font-size: 1.3rem; }
  .tool-article { padding: 26px 20px; }
  .tool-interface { padding: 36px 18px; }
}

@media (max-width: 480px) {
  .header-inner { gap: 8px; padding: 12px 16px; }
  .logo { font-size: 1rem; }
  .search-input { width: 130px; padding-left: 32px; }
  .search-input:focus { width: 150px; }
  .theme-toggles { gap: 0; }
  .theme-toggle-btn { width: 30px; height: 30px; font-size: 0.9rem; }
  .welcome-popup { padding: 30px 22px; }
  .welcome-theme-buttons { grid-template-columns: 1fr 1fr; gap: 10px; }
  .welcome-theme-btn { padding: 14px 8px; }
  .theme-label { font-size: 0.78rem; }
  .hero-cta-row .btn { width: 100%; }
}

/* ---------- 15. ACCESSIBILITY ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Focus ring for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.tool-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.quiz-tab svg {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0;
}
.quiz-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.promo-icon svg {
  width: 28px;
  height: 28px;
}
