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

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5c5c5c;
  --accent: #b85c38;
  --accent-hover: #9a4a2c;
  --border: #e0dcd5;
  --border-focus: #b85c38;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 8px;
  --radius-lg: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max-width: 880px;
  --header-height: 56px;
}

html { font-size: 17px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius);
  z-index: 1000;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
}
.logo svg { flex-shrink: 0; color: var(--accent); }
.nav-list { display: flex; list-style: none; gap: 20px; }
.nav-list a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
.nav-list a:hover, .nav-list a:focus-visible { color: var(--text); border-bottom-color: var(--accent); }

/* Main */
main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 20px 48px;
  width: 100%;
}

/* Finder Section */
.finder-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-sm);
}
.finder-container { max-width: 700px; margin: 0 auto; }
.finder-section h1 { font-size: 1.6rem; margin-bottom: 6px; }
.finder-sub { color: var(--text-muted); margin-bottom: 20px; font-size: 0.95rem; }

/* Presets */
.preset-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.preset-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.preset-btn {
  font-size: 0.82rem;
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s;
  color: var(--text);
}
.preset-btn:hover, .preset-btn:focus-visible { background: #f0ece6; border-color: var(--accent); }
.preset-reset { background: transparent; border-style: dashed; }

/* Form */
.mat-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.form-group select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%235c5c5c'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-group select:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -1px; }

/* Results */
.results-area { min-height: 60px; }
.result-card {
  background: #fdfaf7;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
  position: relative;
}
.result-card:hover, .result-card:focus-visible { box-shadow: var(--shadow-md); border-color: var(--accent); }
.result-card h3 { font-size: 1.05rem; margin-bottom: 2px; display: flex; align-items: center; gap: 8px; }
.result-card .rank-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}
.result-card .material-name { font-weight: 700; }
.result-card .thickness { color: var(--text-muted); font-size: 0.9rem; }
.result-card .why { font-size: 0.9rem; color: var(--text-muted); margin-top: 6px; display: none; }
.result-card.expanded .why { display: block; }
.result-card .expand-hint { font-size: 0.78rem; color: var(--accent); margin-top: 4px; }
.result-card.expanded .expand-hint { display: none; }
.empty-state { color: var(--text-muted); font-style: italic; padding: 20px 0; text-align: center; }

/* Action Bar */
.action-bar { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }
.action-btn {
  padding: 8px 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s;
}
.action-btn:hover { background: #f5f2ed; }

/* Info Sections */
.info-section {
  margin-bottom: 36px;
  padding: 0 4px;
}
.info-section h2 {
  font-size: 1.3rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

/* Comparison Table */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 600px;
}
.comparison-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f5f2ed;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.comparison-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.comparison-table tbody tr:hover { background: #fdfaf7; }

/* Scenario Grid */
.scenario-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.scenario-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.scenario-card h3 { font-size: 1rem; margin-bottom: 8px; }
.scenario-card p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 8px; }
.scenario-card p:last-child { margin-bottom: 0; }

/* Mistakes & DIY Lists */
.mistakes-list, .diy-list { list-style: none; padding: 0; }
.mistakes-list li, .diy-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.mistakes-list li:last-child, .diy-list li:last-child { border-bottom: none; }

/* FAQ */
.faq-list dt {
  font-weight: 600;
  margin-top: 16px;
  font-size: 0.95rem;
}
.faq-list dd {
  margin-left: 0;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.faq-list dd:last-of-type { border-bottom: none; }

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-inner nav { display: flex; justify-content: center; gap: 16px; margin: 10px 0; flex-wrap: wrap; }
.footer-inner nav a { color: var(--text-muted); text-decoration: underline; }
.footer-inner nav a:hover { color: var(--text); }
.footer-version { font-size: 0.78rem; margin-top: 8px; }

/* Responsive */
@media (max-width: 600px) {
  .mat-form { grid-template-columns: 1fr; }
  .finder-section { padding: 24px 16px; }
  .finder-section h1 { font-size: 1.35rem; }
  .preset-bar { gap: 6px; }
  .preset-btn { font-size: 0.78rem; padding: 5px 10px; }
  .scenario-grid { grid-template-columns: 1fr; }
  .action-bar { justify-content: stretch; }
  .action-btn { flex: 1; text-align: center; }
}

@media (min-width: 900px) {
  .finder-section { padding: 40px 36px; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
