:root {
  --green: #0f2f2f;
  --paper: #f4f1ec;
  --text: #123d3b;
  --off-white: #e7f1ec;
  --accent: #49a69a;
  --focus: #ffbf69;
  --muted: #3c5855;
  --divider: #456;
  --border: #d5cfc9;
  --footer-bg: #dfeae4;
  --card-bg: #eef3f0;
  --card-header-bg: #e1ebe5;
  --card-border: #c7d5ce;
}

body[data-theme="dark"],
:root[data-theme="dark"] {
  --green: #0c1a1a;
  --paper: #102524;
  --text: #e7f1ec;
  --off-white: #f1f7f5;
  --accent: #49b7a8;
  --focus: #ffd27a;
  --muted: #c7d7d3;
  --divider: #2f4a4a;
  --border: #2f3a39;
  --footer-bg: #12312f;
  --card-bg: #162f2c;
  --card-header-bg: #1c3835;
  --card-border: #2f4f4b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--paper);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--text);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: -999px;
  background: var(--focus);
  color: #000;
  padding: 10px 14px;
  border-radius: 6px;
  font-weight: 700;
  z-index: 10;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  outline: 3px solid #000;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  height: 40px;
  padding: 0 12px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: var(--paper);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.theme-toggle[aria-pressed="true"] {
  background: var(--accent);
  color: var(--green);
  border-color: var(--accent);
}

.theme-toggle[aria-pressed="true"] svg {
  color: var(--green);
  fill: currentColor;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.theme-label {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
}

.theme-toggle:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
  color: var(--accent);
}

.theme-toggle:focus {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.theme-toggle-floating {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  padding: 0 14px;
}

.layout-split {
  display: flex;
  min-height: 100vh;
  background: var(--green);
}

.main-panel {
  flex: 1;
  background: var(--paper);
  padding: 0;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-panel-content {
  padding: 32px 36px;
}

.sidebar-nav {
  width: 32%;
  background: var(--green);
  color: var(--off-white);
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.sidebar-nav a {
  color: var(--off-white);
  text-decoration: none;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.3px;
  padding: 9px 10px;
  border-radius: 6px;
}

.sidebar-nav hr {
  border: none;
  border-top: 1px solid var(--divider);
  width: 80%;
  margin: 0;
}

.sidebar-nav a:hover {
  color: var(--accent);
}

.sidebar-nav a:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.hero-img {
  width: 100%;
  border-radius: 28px;
  margin: 40px auto;
  display: block;
}

.profile-img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  margin: 0 auto 20px;
}

h1,
h2,
h3 {
  color: var(--text);
  text-align: center;
  margin-top: 0;
}

section {
  margin-bottom: 48px;
}

.footer-contact {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--text);
  background: var(--footer-bg);
  margin-top: auto;
}

.footer-contact a {
  color: var(--text);
  font-weight: 600;
}

.page-shell {
  min-height: 100vh;
  background: var(--paper);
  display: flex;
  flex-direction: column;
}

.top-nav {
  background: var(--green);
  color: var(--off-white);
  padding: 16px 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  color: var(--off-white);
  margin-right: auto;
  padding: 8px 0;
}

.brand svg {
  width: 64px;
  height: 48px;
  fill: currentColor;
}

.top-nav nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-left: 8px;
}

.top-nav .theme-toggle {
  margin-left: auto;
}

.top-nav nav a {
  color: var(--off-white);
  text-decoration: none;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 6px;
}

.top-nav nav a:hover {
  color: var(--accent);
}

.top-nav nav a:focus,
.brand:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.page-content {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 40px;
  background: var(--paper);
  border-radius: 12px;
}

audio {
  width: 100%;
}

ul {
  padding-left: 20px;
}

.audio-caption {
  margin-top: 8px;
  font-size: 0.95rem;
  color: var(--text);
}

.affiliates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  justify-content: center;
}

.affiliate-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px 18px;
  background: var(--paper);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.affiliate-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
  text-align: center;
}

.affiliate-card p {
  margin: 0;
  color: var(--text);
  text-align: center;
}

.affiliate-card a {
  color: var(--accent);
  font-weight: 600;
  word-break: break-word;
}

.affiliate-logo {
  width: 100%;
  max-width: 140px;
  max-height: 110px;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  display: block;
  padding: 4px;
}

.affiliate-actions {
  margin-top: 8px;
}

.toggle-desc {
  margin-top: 6px;
  background: var(--accent);
  color: var(--green);
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.toggle-desc:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.affiliates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  justify-content: center;
}

.affiliate-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  background: var(--paper);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.affiliate-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
}

.affiliate-card p {
  margin: 0;
  color: var(--text);
}

.affiliate-card a {
  color: var(--accent);
  font-weight: 600;
  word-break: break-word;
}

.faq-search {
  margin: 16px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-search label {
  font-weight: 600;
  color: var(--text);
}

.faq-search input {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--text);
  font-size: 1rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: var(--card-bg);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.faq-item summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card-header-bg);
  border-bottom: 1px solid var(--card-border);
  border-radius: 10px 10px 0 0;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary:focus {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.faq-item summary::after {
  content: "▸";
  color: var(--accent);
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(90deg);
}

.faq-item .faq-body {
  padding: 0 16px 16px;
  color: var(--text);
  background: var(--card-bg);
  border-radius: 0 0 10px 10px;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .layout-split {
    flex-direction: column;
  }

  .sidebar-nav {
    width: 100%;
    order: -1;
  }

  .main-panel {
    padding: 32px 24px;
  }

  .page-content {
    padding: 32px 24px;
  }
}