/* ===== CSS Custom Properties ===== */
:root {
  --color-bg: #FFFBEB;
  --color-surface: #FFFFFF;
  --color-surface-alt: #FEF3C7;
  --color-primary: #D97706;
  --color-primary-hover: #B45309;
  --color-primary-light: #FED7AA;
  --color-secondary: #059669;
  --color-secondary-hover: #047857;
  --color-secondary-light: #D1FAE5;
  --color-text: #1C1917;
  --color-text-muted: #57534E;
  --color-text-light: #78716C;
  --color-border: #E7E5E4;
  --color-danger: #DC2626;
  --color-danger-light: #FEE2E2;
  --color-info: #0284C7;
  --color-info-light: #E0F2FE;
  --color-warning: #F59E0B;
  --color-warning-light: #FEF9C3;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  --transition: 150ms ease;
  --container-max: 1100px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); text-decoration: underline; }
button { cursor: pointer; font-family: inherit; font-size: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }
fieldset { border: none; padding: 0; margin: 0; }
legend { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.5rem; }
[hidden] { display: none !important; }

/* ===== Container ===== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ===== Header ===== */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
}
.logo:hover { text-decoration: none; color: var(--color-text); }
.logo-icon { flex-shrink: 0; }
.logo-accent { color: var(--color-primary); }
.main-nav {
  display: flex;
  gap: 1.25rem;
}
.main-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.main-nav a:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  text-decoration: none;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #FEF3C7 0%, #FFFBEB 50%, #ECFDF5 100%);
  padding: 3.5rem 0 3rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto 0.5rem;
}
.hero-meta {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

/* ===== Sections ===== */
.section { padding: 2.5rem 0; }
.section:nth-child(even) { background: var(--color-surface); }
.section:nth-child(odd) { background: var(--color-bg); }
.section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.section-desc {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

/* ===== Setup Grid ===== */
.setup-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 800px) {
  .setup-grid { grid-template-columns: 1fr 300px; }
}

/* ===== Forms ===== */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  color: var(--color-text-muted);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition);
  border: 1.5px solid transparent;
  gap: 0.4rem;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.82rem; }
.btn-primary {
  background: var(--color-primary);
  color: white;
}
.btn-primary:hover:not(:disabled) { background: var(--color-primary-hover); color: white; text-decoration: none; }
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover:not(:disabled) { background: var(--color-surface-alt); text-decoration: none; color: var(--color-text); }
.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}
.btn-ghost:hover:not(:disabled) { background: var(--color-surface-alt); color: var(--color-text); text-decoration: none; }
.btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  color: var(--color-text-light);
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--color-danger-light); color: var(--color-danger); }

/* ===== Preset Buttons ===== */
.preset-fieldset { margin-bottom: 1.25rem; }
.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.preset-btn {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  transition: all var(--transition);
}
.preset-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.preset-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* ===== Categories ===== */
.categories-fieldset { margin-bottom: 1.25rem; }
.categories-list { margin-bottom: 0.75rem; }
.category-row {
  display: grid;
  grid-template-columns: 1fr 80px 32px;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.category-row input { margin: 0; }
.category-row .cat-slots { text-align: center; }

/* ===== Info Cards ===== */
.setup-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.info-card {
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid rgba(217, 119, 6, 0.15);
}
.info-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.info-card p, .info-card li {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.checklist {
  list-style: none;
  padding: 0;
}
.checklist li::before {
  content: "☐ ";
  color: var(--color-primary);
  font-weight: 700;
}

/* ===== Form Actions ===== */
.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ===== Board ===== */
.board-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.board-event-name {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}
.board-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.board-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-light);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 2px dashed var(--color-border);
}
.board-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}
.stat-badge.open { background: var(--color-info-light); color: var(--color-info); }
.stat-badge.claimed { background: var(--color-secondary-light); color: var(--color-secondary); }
.stat-badge.dietary { background: var(--color-warning-light); color: #92400E; }
.board-columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.board-category {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.board-category-header {
  padding: 0.75rem 1rem;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.board-category-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-light);
}
.board-slots {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.slot-card {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  transition: all var(--transition);
}
.slot-card.open {
  border-style: dashed;
  background: var(--color-bg);
}
.slot-card.open:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}
.slot-card.open .slot-claim-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.5rem;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--color-primary);
  background: transparent;
  transition: all var(--transition);
}
.slot-card.open .slot-claim-btn:hover {
  background: var(--color-primary);
  color: white;
  border-style: solid;
}
.slot-card.claimed {
  border-color: var(--color-secondary);
  background: var(--color-secondary-light);
}
.slot-person {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}
.slot-dish {
  font-size: 0.85rem;
  color: var(--color-text);
  margin-bottom: 0.2rem;
}
.slot-dietary {
  font-size: 0.75rem;
  color: var(--color-warning);
  background: var(--color-warning-light);
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-top: 0.2rem;
}
.slot-contact {
  font-size: 0.72rem;
  color: var(--color-text-light);
  margin-top: 0.2rem;
}
.slot-unclaim {
  font-size: 0.72rem;
  color: var(--color-danger);
  margin-top: 0.4rem;
  padding: 0.2rem 0;
}
.slot-unclaim:hover { text-decoration: underline; }

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}
.modal-content {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  z-index: 1;
}
.modal-content h3 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
}
.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* ===== History ===== */
.history-list {
  display: grid;
  gap: 0.75rem;
}
.history-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  gap: 1rem;
  flex-wrap: wrap;
}
.history-card-info h3 {
  font-size: 1rem;
  font-weight: 600;
}
.history-card-meta {
  font-size: 0.82rem;
  color: var(--color-text-light);
  margin-top: 0.15rem;
}
.history-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.history-empty {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-light);
}

/* ===== Tips ===== */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.tip-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.tip-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--color-primary);
}
.tip-card p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* ===== FAQ ===== */
.faq-list {
  max-width: 700px;
}
.faq-item {
  border-bottom: 1px solid var(--color-border);
}
.faq-toggle {
  width: 100%;
  text-align: left;
  padding: 1rem 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-toggle::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--color-primary);
  flex-shrink: 0;
}
.faq-toggle[aria-expanded="true"]::after { content: "−"; }
.faq-item dd {
  padding: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* ===== Footer ===== */
.site-footer {
  margin-top: auto;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  text-align: center;
}
.footer-brand {
  font-weight: 700;
  color: var(--color-primary);
}
.footer-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-nav a {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.footer-note, .footer-updated {
  font-size: 0.78rem;
  color: var(--color-text-light);
}

/* ===== Print Styles ===== */
@media print {
  .site-header, .site-footer, .hero, .section-setup, .section-history, .section-tips, .section-faq,
  .board-actions, .slot-unclaim, .slot-claim-btn, .setup-sidebar {
    display: none !important;
  }
  body { background: white; color: black; }
  .section { padding: 0; }
  .board-columns { display: block; }
  .board-category { break-inside: avoid; margin-bottom: 1rem; page-break-inside: avoid; }
  .slot-card { border: 1px solid #ccc; }
  .slot-card.open { background: #f9f9f9; }
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .main-nav { gap: 0.75rem; }
  .main-nav a { font-size: 0.8rem; }
  .hero { padding: 2.5rem 0 2rem; }
  .form-row { grid-template-columns: 1fr; }
  .category-row { grid-template-columns: 1fr 60px 32px; }
  .history-card { flex-direction: column; align-items: flex-start; }
  .preset-buttons { flex-direction: column; }
  .preset-btn { text-align: center; }
  .board-stats { gap: 0.75rem; }
}

/* ===== Focus Styles ===== */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: var(--color-text);
  color: white;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
  animation: toast-in 200ms ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Printable Output ===== */
#printable-output { display: none; }
@media print {
  #printable-output { display: block; }
}



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