:root {
  --bg: #f7f9fb;
  --text: #1a202c;
  --card-bg: #ffffff;
  --accent: #2b6cb0;
  --accent-hover: #1e4e82;
  --menu-bg: #e2ecf7;
  --menu-hover: #cbdaf0;
  --link: #0053a0;
  --link-hover: #003366;
  --muted: #5a6575;
  --border: #d5dde8;
}
[data-theme="dark"] {
  --bg: #1e1e1e;
  --text: #f0f0f0;
  --card-bg: #2c2c2c;
  --accent: #90cdf4;
  --accent-hover: #63b3ed;
  --menu-bg: #2f4057;
  --menu-hover: #3c536c;
  --link: #a4d4ff;
  --link-hover: #e0f2ff;
  --muted: #b8c2cf;
  --border: #3d4650;
}

* { box-sizing: border-box; }
html { transition: background-color 0.3s ease, color 0.3s ease; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.container { max-width: 700px; margin: auto; padding: 1rem; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
h1 {
  text-align: center;
  margin: 0.5rem 0 1rem;
  font-size: 1.8rem;
  color: var(--accent);
  flex: 1;
}
.theme-toggle {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  font-size: 0.8rem;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}
.theme-toggle img { width: 32px; height: 32px; object-fit: contain; }
.theme-toggle.rotate { animation: spin 0.4s ease-in-out; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(180deg); } }

/* Quick access tiles on the home screen */
.quick-title, .all-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 1rem 0 0.5rem;
}
.quick {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}
.quick-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 96px;
  padding: 0.8rem;
  border: none;
  border-radius: 12px;
  background: var(--menu-bg);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s ease;
}
.quick-tile:hover { background: var(--menu-hover); }
.quick-tile img { width: 40px; height: 40px; }

.menu-button {
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 1rem;
  border: none;
  background-color: var(--menu-bg);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 8px;
  color: var(--text);
  text-align: left;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.menu-button:hover { background-color: var(--menu-hover); }
.menu-button img { width: 32px; height: 32px; margin-right: 12px; flex-shrink: 0; }

.back-button {
  background-color: var(--accent);
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  font: inherit;
  font-size: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: background 0.2s;
}
.back-button:hover { background-color: var(--accent-hover); }

.banner-img {
  width: 100%;
  height: auto;
  aspect-ratio: 3.5 / 1;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1rem;
  display: block;
}
.section h2 {
  color: var(--accent);
  font-size: 1.4rem;
  margin: 0 0 1rem;
}
.content { line-height: 1.6; }
.content ul, .content ol { padding-left: 1.5rem; margin: 1rem 0; }
.content li { margin-bottom: 0.5rem; line-height: 1.6; }
.content ul { list-style-type: disc; }
.content ol { list-style-type: decimal; }
.content h3 { color: var(--accent); font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.content img { display: block; max-width: 100%; height: auto; margin: 0.75rem 0; border-radius: 8px; }
.content a { color: var(--link); text-decoration: none; font-weight: 500; }
.content a:hover { color: var(--link-hover); text-decoration: underline; }

.hidden { display: none !important; }

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  .menu-button { font-size: 0.95rem; padding: 0.75rem; }
  .menu-button img { width: 28px; height: 28px; margin-right: 10px; }
  .back-button { font-size: 0.8rem; padding: 0.5rem 0.8rem; }
  .banner-img { aspect-ratio: auto; }
}
