:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-alt: #eaeef5;
  --border: #dbe1eb;
  --text: #161a24;
  --text-muted: #5b6474;
  --accent: #0d9488;
  --accent-text: #ffffff;
  --chip-bg: #eaeef5;
  --chip-active-bg: #0d9488;
  --chip-active-text: #ffffff;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10131c;
    --surface: #181c28;
    --surface-alt: #202533;
    --border: #2c3244;
    --text: #eceef4;
    --text-muted: #9aa3b8;
    --accent: #2dd4bf;
    --accent-text: #072320;
    --chip-bg: #202533;
    --chip-active-bg: #2dd4bf;
    --chip-active-text: #072320;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1rem 0.75rem;
}

.site-title {
  margin: 0;
  font-size: 1.4rem;
}

.site-tagline {
  margin: 0.15rem 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#search-input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

#search-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.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;
}

.filter-select {
  flex: 0 1 160px;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.filter-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.clear-btn {
  flex: 0 0 auto;
  width: 2.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
}

.clear-btn:hover,
.clear-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.chip-row-sub {
  margin-top: 0.4rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--border);
}

.chip-separator {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 0.2rem 0.3rem;
}

.chip {
  border: 1px solid var(--border);
  background: var(--chip-bg);
  color: var(--text);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}

.chip-sub {
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
}

.chip[aria-pressed="true"] {
  background: var(--chip-active-bg);
  color: var(--chip-active-text);
  border-color: var(--chip-active-bg);
}

.filter-relax-note {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
}

.method-section {
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.method-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}

.method-toggle-text h2 {
  margin: 0;
  font-size: 1.1rem;
}

.method-toggle-text p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.method-chevron {
  flex-shrink: 0;
  transition: transform 0.15s ease;
  color: var(--text-muted);
}

.method-section[data-open="true"] .method-chevron {
  transform: rotate(180deg);
}

.method-body {
  padding: 0 1rem 1rem;
}

.method-section[data-open="false"] .method-body {
  display: none;
}

.category-block {
  margin-top: 0.75rem;
}

.category-block h3 {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.65rem;
}

.cut-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.cut-card:hover {
  border-color: var(--accent);
}

.cut-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cut-card h4 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.stat-row {
  display: flex;
  gap: 0.4rem;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.stat-label {
  flex-shrink: 0;
  min-width: 68px;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-recommended .stat-label,
.stat-recommended span:last-child {
  color: var(--accent);
}

.cut-card .notes {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.side-method {
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.side-method-name {
  color: var(--text-muted);
  font-weight: 600;
}

.side-method-name::after {
  content: ':';
}

.side-method-detail {
  display: block;
  color: var(--text);
}

.cut-card-cta {
  display: inline-block;
  margin-top: 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}

.cut-card .breadcrumb {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.3rem;
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.65rem;
}

.no-results {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  color: var(--text-muted);
}

.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

@media (min-width: 640px) {
  .site-title {
    font-size: 1.7rem;
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 1rem;
  overflow-y: auto;
  z-index: 100;
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  padding: 1.5rem 1.25rem 1.25rem;
}

.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 999px;
}

.modal-close:hover,
.modal-close:focus-visible {
  background: var(--chip-bg);
  color: var(--text);
}

.modal-breadcrumb {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.modal-dialog h3 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  padding-right: 1.5rem;
}

.modal-stats {
  margin-bottom: 0.5rem;
}

.modal-section-heading {
  margin: 1.1rem 0 0.5rem;
  font-size: 0.95rem;
}

.modal-alt-intro {
  margin: 0 0 0.6rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.alt-table-wrap {
  overflow-x: auto;
}

.alt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.alt-table th,
.alt-table td {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.alt-table th {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.modal-disclaimer {
  margin-top: 1.1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface-alt);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.modal-disclaimer strong {
  color: var(--text);
}

.recipe-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.recipe-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.recipe-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.recipe-list a {
  color: var(--accent);
  font-size: 0.88rem;
  text-decoration: none;
}

.recipe-list a:hover,
.recipe-list a:focus-visible {
  text-decoration: underline;
}

.recipe-source {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}
