/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --green-700: #4a6741;
  --green-600: #6B8F71;
  --green-400: #8fb88a;
  --green-100: #e8f0e7;
  --amber-600: #D4A373;
  --amber-400: #E9C46A;
  --amber-100: #fdf6ec;
  --navy-700: #264653;
  --navy-600: #2a6f7f;
  --gray-900: #1a1a2e;
  --gray-700: #3d3d56;
  --gray-500: #6b6b80;
  --gray-300: #c8c8d4;
  --gray-100: #f4f4f8;
  --white: #ffffff;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --max-width: 1200px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font); color: var(--gray-900); background: var(--white); line-height: 1.6; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--green-700); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
.skip-link { position: absolute; top: -100%; left: 16px; background: var(--green-700); color: var(--white); padding: 8px 16px; border-radius: var(--radius); z-index: 9999; }
.skip-link:focus { top: 16px; }
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.mt-sm { margin-top: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border: 2px solid transparent; border-radius: var(--radius); font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: var(--font); text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--green-700); color: var(--white); border-color: var(--green-700); }
.btn-primary:hover, .btn-primary:focus { background: var(--green-600); border-color: var(--green-600); }
.btn-outline { background: transparent; color: var(--green-700); border-color: var(--green-700); }
.btn-outline:hover, .btn-outline:focus { background: var(--green-100); }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
/* ===== HEADER ===== */
.site-header { background: var(--white); border-bottom: 1px solid var(--gray-300); position: sticky; top: 0; z-index: 100; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--navy-700); }
.logo:hover, .logo:focus { text-decoration: none; color: var(--green-700); }
.site-nav { display: flex; gap: 24px; }
.site-nav a { font-size: 0.9rem; font-weight: 500; color: var(--gray-700); }
.site-nav a:hover, .site-nav a:focus { color: var(--green-700); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.hamburger { display: block; width: 24px; height: 2px; background: var(--gray-900); position: relative; }
.hamburger::before, .hamburger::after { content: ''; display: block; width: 24px; height: 2px; background: var(--gray-900); position: absolute; left: 0; }
.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }
.mobile-nav { display: none; flex-direction: column; padding: 12px 20px; border-top: 1px solid var(--gray-300); background: var(--white); }
.mobile-nav a { padding: 10px 0; font-size: 1rem; font-weight: 500; color: var(--gray-700); }
.mobile-nav[hidden] { display: none; }
/* ===== HERO ===== */
.hero { background: linear-gradient(135deg, var(--green-100) 0%, var(--amber-100) 100%); padding: 80px 0 64px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; color: var(--navy-700); margin-bottom: 16px; line-height: 1.2; }
.hero-sub { font-size: 1.15rem; color: var(--gray-700); max-width: 560px; margin: 0 auto 28px; }
/* ===== SECTIONS ===== */
section { padding: 64px 0; }
.section-title { font-size: 1.75rem; font-weight: 700; color: var(--navy-700); margin-bottom: 8px; }
.section-sub { color: var(--gray-500); margin-bottom: 32px; max-width: 600px; }
/* ===== PLANNER ===== */
.planner-section { background: var(--gray-100); }
.planner-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.controls-panel { background: var(--white); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.control-group { border: none; margin-bottom: 24px; }
.control-group legend { font-weight: 700; font-size: 1rem; color: var(--navy-700); margin-bottom: 12px; padding: 0; }
.field-row { margin-bottom: 14px; }
.field-row label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.field-row input, .field-row select { width: 100%; padding: 8px 12px; border: 2px solid var(--gray-300); border-radius: var(--radius); font-size: 0.95rem; font-family: var(--font); background: var(--white); color: var(--gray-900); }
.field-row input:focus, .field-row select:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(107,143,113,0.2); }
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 2px solid var(--gray-300); border-radius: var(--radius); cursor: pointer; transition: all 0.2s; }
.radio-card:hover { border-color: var(--green-400); }
.radio-card input[type="radio"] { margin-top: 3px; accent-color: var(--green-700); }
.radio-card:has(input:checked) { border-color: var(--green-700); background: var(--green-100); }
.radio-label strong { display: block; font-size: 0.95rem; color: var(--gray-900); }
.radio-label small { font-size: 0.8rem; color: var(--gray-500); }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.save-note { font-size: 0.8rem; color: var(--gray-500); margin-top: 10px; min-height: 1.2em; }
/* ===== PREVIEW ===== */
.preview-panel { background: var(--white); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.preview-title { font-size: 1.1rem; font-weight: 700; color: var(--navy-700); margin-bottom: 16px; }
.shelf-preview { background: var(--gray-100); border-radius: var(--radius); padding: 16px; min-height: 200px; }
.shelf-row { display: flex; align-items: flex-end; height: 40px; margin-bottom: 4px; gap: 1px; }
.shelf-book { height: 100%; border-radius: 2px 2px 0 0; min-width: 3px; transition: all 0.3s; }
.shelf-label { font-size: 0.7rem; font-weight: 600; color: var(--gray-700); margin-top: 4px; text-align: center; }
.shelf-divider { height: 3px; background: var(--gray-300); border-radius: 2px; margin-bottom: 12px; }
.preview-stats { margin-top: 16px; padding: 16px; background: var(--green-100); border-radius: var(--radius); }
.preview-stats p { font-size: 0.9rem; color: var(--gray-700); margin-bottom: 4px; }
.preview-stats strong { color: var(--navy-700); }
.preview-legend { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--gray-700); }
.legend-swatch { width: 14px; height: 14px; border-radius: 3px; }
/* ===== COMPARISON ===== */
.comparison-section { background: var(--white); }
.table-wrap { overflow-x: auto; }
.comparison-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.comparison-table th { background: var(--navy-700); color: var(--white); padding: 12px 16px; text-align: left; font-weight: 600; }
.comparison-table td { padding: 12px 16px; border-bottom: 1px solid var(--gray-300); color: var(--gray-700); }
.comparison-table tr:nth-child(even) td { background: var(--gray-100); }
/* ===== TIPS ===== */
.tips-section { background: var(--amber-100); }
.tips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.tip-card { background: var(--white); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); border-left: 4px solid var(--amber-600); }
.tip-card h3 { font-size: 1rem; font-weight: 700; color: var(--navy-700); margin-bottom: 8px; }
.tip-card p { font-size: 0.9rem; color: var(--gray-700); }
/* ===== GALLERY ===== */
.gallery-section { background: var(--gray-100); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.gallery-card { background: var(--white); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.gallery-card:hover, .gallery-card:focus { transform: translateY(-4px); box-shadow: var(--shadow-lg); outline: none; }
.gallery-img { padding: 20px; background: var(--gray-100); }
.gallery-card h3 { font-size: 1rem; font-weight: 700; color: var(--navy-700); padding: 16px 20px 8px; }
.gallery-before, .gallery-after { font-size: 0.85rem; color: var(--gray-700); padding: 0 20px 8px; }
.gallery-after { padding-bottom: 20px; }
/* ===== WALKTHROUGH ===== */
.walkthrough-section { background: var(--white); }
.walkthrough-steps { list-style: none; counter-reset: steps; }
.walkthrough-steps li { counter-increment: steps; position: relative; padding: 0 0 28px 48px; border-left: 3px solid var(--green-400); margin-left: 16px; }
.walkthrough-steps li::before { content: counter(steps); position: absolute; left: -19px; top: 0; width: 32px; height: 32px; background: var(--green-700); color: var(--white); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; }
.walkthrough-steps li:last-child { border-left-color: transparent; }
.walkthrough-steps strong { display: block; font-size: 1rem; color: var(--navy-700); margin-bottom: 4px; }
.walkthrough-steps p { font-size: 0.9rem; color: var(--gray-700); }
/* ===== FAQ ===== */
.faq-section { background: var(--gray-100); }
.faq-list { max-width: 720px; }
.faq-item { border-bottom: 1px solid var(--gray-300); }
.faq-q { width: 100%; text-align: left; background: none; border: none; padding: 16px 0; font-size: 1rem; font-weight: 600; color: var(--navy-700); cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-family: var(--font); }
.faq-q::after { content: '+'; font-size: 1.3rem; color: var(--green-700); flex-shrink: 0; margin-left: 12px; }
.faq-q[aria-expanded="true"]::after { content: '−'; }
.faq-q:hover { color: var(--green-700); }
.faq-item dd { font-size: 0.9rem; color: var(--gray-700); padding-bottom: 16px; line-height: 1.6; }
.faq-item dd[hidden] { display: none; }
/* ===== FOOTER ===== */
.site-footer { background: var(--navy-700); color: var(--gray-300); padding: 40px 0 24px; }
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; margin-bottom: 24px; }
.footer-brand { font-weight: 700; font-size: 1.1rem; color: var(--white); margin-bottom: 8px; }
.footer-desc { font-size: 0.85rem; max-width: 320px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer nav a { font-size: 0.85rem; color: var(--gray-300); }
.site-footer nav a:hover, .site-footer nav a:focus { color: var(--amber-400); }
.footer-copy { font-size: 0.8rem; color: var(--gray-500); text-align: center; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.1); }
/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .planner-layout { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .nav-toggle { display: block; }
  .mobile-nav { display: flex; }
  .mobile-nav[hidden] { display: none; }
}
@media (max-width: 600px) {
  .hero { padding: 48px 0 40px; }
  section { padding: 40px 0; }
  .controls-panel, .preview-panel { padding: 20px; }
  .tips-grid, .gallery-grid { grid-template-columns: 1fr; }
  .comparison-table { font-size: 0.8rem; }
  .comparison-table th, .comparison-table td { padding: 8px 10px; }
}
/* ===== PRINT ===== */
@media print {
  .site-header, .site-footer, .hero, .controls-panel, .preview-legend, .action-row, .save-note, .nav-toggle, .mobile-nav { display: none !important; }
  body { color: #000; background: #fff; }
  .preview-panel { box-shadow: none; border: 1px solid #ccc; }
  .shelf-preview { background: #fff; }
}



/* 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;
}
