/* Volunteer Shift Splitter — styles */
:root {
  --c-primary: #E8642A;
  --c-primary-dark: #C45020;
  --c-primary-light: #FFF0E8;
  --c-accent: #2A8C6E;
  --c-accent-light: #E8F5F0;
  --c-bg: #FAF8F5;
  --c-surface: #FFFFFF;
  --c-surface-alt: #F3F0EB;
  --c-text: #2D2926;
  --c-text-secondary: #6B6560;
  --c-text-muted: #9E9890;
  --c-border: #E0DAD4;
  --c-border-light: #EDE8E2;
  --c-danger: #D64045;
  --c-danger-light: #FDE8E9;
  --c-warning: #E8A82A;
  --c-warning-light: #FDF5E0;
  --c-success: #2A8C6E;
  --c-success-light: #E8F5F0;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
  --max-width: 1120px;
  --header-height: 60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 16px); }

body {
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; top: -100%; left: 16px; z-index: 100;
  background: var(--c-primary); color: #fff; padding: 8px 16px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); font-weight: 600;
}
.skip-link:focus { top: 0; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border-light);
  height: var(--header-height);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1.1rem; color: var(--c-text);
}
.logo:hover { text-decoration: none; }
.logo-icon { flex-shrink: 0; }
.nav { display: flex; gap: 20px; }
.nav a {
  font-size: 0.9rem; font-weight: 500; color: var(--c-text-secondary);
  padding: 4px 0;
}
.nav a:hover { color: var(--c-primary); text-decoration: none; }

/* Hero */
.hero {
  padding: 64px 0 48px;
  background: linear-gradient(135deg, var(--c-primary-light) 0%, var(--c-bg) 100%);
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800; line-height: 1.2; max-width: 640px;
  margin: 0 auto 16px;
}
.hero-sub {
  font-size: 1.1rem; color: var(--c-text-secondary);
  max-width: 520px; margin: 0 auto 32px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  border: 2px solid transparent; transition: all 0.15s ease;
  font-family: var(--font); line-height: 1.4;
}
.btn-primary { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.btn-primary:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); text-decoration: none; color: #fff; }
.btn-secondary { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.btn-secondary:hover { background: #238060; border-color: #238060; text-decoration: none; color: #fff; }
.btn-ghost { background: transparent; color: var(--c-text-secondary); border-color: var(--c-border); }
.btn-ghost:hover { background: var(--c-surface-alt); color: var(--c-text); text-decoration: none; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-icon {
  background: none; border: none; font-size: 1.3rem; cursor: pointer;
  color: var(--c-text-muted); padding: 2px 6px; line-height: 1;
}
.btn-icon:hover { color: var(--c-danger); }

/* Worksheet */
.worksheet-section { padding: 48px 0; }
.worksheet-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}
.worksheet-form h2,
.schedule-panel h2 { font-size: 1.3rem; margin-bottom: 20px; }

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card h3 { font-size: 1rem; margin-bottom: 14px; color: var(--c-text); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--c-text-secondary); }
.field input, .field select {
  padding: 8px 12px; border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); font-size: 0.9rem;
  font-family: var(--font); color: var(--c-text);
  background: var(--c-surface);
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(232,100,42,0.15);
}

.presets { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.presets-label { font-size: 0.8rem; color: var(--c-text-muted); }
.preset-btn {
  padding: 4px 12px; font-size: 0.8rem; font-weight: 500;
  background: var(--c-surface-alt); border: 1px solid var(--c-border);
  border-radius: 20px; cursor: pointer; font-family: var(--font);
  color: var(--c-text-secondary); transition: all 0.15s;
}
.preset-btn:hover { background: var(--c-primary-light); border-color: var(--c-primary); color: var(--c-primary-dark); }

/* Volunteer list */
.volunteer-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.volunteer-row {
  display: grid;
  grid-template-columns: 1fr 90px 20px 90px 60px 70px 32px;
  gap: 6px; align-items: center;
}
.volunteer-row input {
  padding: 6px 8px; border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); font-size: 0.85rem;
  font-family: var(--font); width: 100%;
}
.volunteer-row input:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 2px rgba(232,100,42,0.12);
}
.time-sep { text-align: center; color: var(--c-text-muted); font-size: 0.85rem; }
.hours-label { font-size: 0.75rem; color: var(--c-text-muted); }

.actions-bar { display: flex; gap: 10px; margin-top: 8px; }

/* Schedule panel */
.schedule-panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: calc(var(--header-height) + 20px);
  box-shadow: var(--shadow);
}

.fairness-score {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px; padding: 14px;
  background: var(--c-surface-alt); border-radius: var(--radius-sm);
}
.score-ring {
  width: 56px; height: 56px; position: relative; flex-shrink: 0;
}
.score-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-bg { fill: none; stroke: var(--c-border); stroke-width: 3; }
.score-fill { fill: none; stroke: var(--c-accent); stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray 0.5s ease; }
.score-value {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 0.85rem; font-weight: 700; color: var(--c-text);
}
.score-label { font-size: 0.85rem; font-weight: 600; color: var(--c-text-secondary); }

.schedule-output { min-height: 120px; }
.empty-state {
  text-align: center; padding: 24px 16px; color: var(--c-text-muted);
}
.empty-state svg { margin-bottom: 10px; opacity: 0.5; }
.empty-state p { font-size: 0.9rem; }

.schedule-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.schedule-table th {
  text-align: left; padding: 8px 10px; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--c-text-muted); border-bottom: 2px solid var(--c-border);
}
.schedule-table td {
  padding: 10px; border-bottom: 1px solid var(--c-border-light);
  vertical-align: middle;
}
.schedule-table tr:hover td { background: var(--c-surface-alt); }
.slot-time { font-weight: 600; white-space: nowrap; }
.slot-person { font-weight: 500; }
.slot-locked { color: var(--c-text-muted); font-size: 0.8rem; margin-left: 4px; }
.slot-warning { color: var(--c-warning); font-size: 0.8rem; margin-left: 4px; }
.slot-empty { color: var(--c-danger); font-style: italic; }
.slot-actions { white-space: nowrap; }
.slot-actions button {
  background: none; border: 1px solid var(--c-border); border-radius: 4px;
  padding: 2px 8px; font-size: 0.75rem; cursor: pointer; font-family: var(--font);
  color: var(--c-text-secondary); margin-left: 4px;
}
.slot-actions button:hover { background: var(--c-surface-alt); }

.export-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--c-border-light);
}

.coverage-note {
  margin-top: 12px; padding: 10px 14px;
  border-radius: var(--radius-sm); font-size: 0.85rem;
}
.coverage-ok { background: var(--c-success-light); color: var(--c-success); }
.coverage-warn { background: var(--c-warning-light); color: #8B6914; }
.coverage-bad { background: var(--c-danger-light); color: var(--c-danger); }

/* Guide section */
.guide-section { padding: 48px 0 64px; }
.guide-section h2 { font-size: 1.5rem; margin-bottom: 28px; text-align: center; }
.guide-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; margin-bottom: 36px;
}
.guide-card {
  background: var(--c-surface); border: 1px solid var(--c-border-light);
  border-radius: var(--radius); padding: 20px;
}
.guide-card h3 { font-size: 0.95rem; margin-bottom: 8px; }
.guide-card p { font-size: 0.9rem; color: var(--c-text-secondary); line-height: 1.55; }

.guide-scenarios, .guide-mistakes, .guide-faq {
  margin-bottom: 32px;
}
.guide-scenarios h3, .guide-mistakes h3, .guide-faq h3 {
  font-size: 1.1rem; margin-bottom: 14px;
}
.scenario {
  padding: 12px 16px; margin-bottom: 8px;
  background: var(--c-surface); border-left: 3px solid var(--c-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem; color: var(--c-text-secondary);
}
.guide-mistakes ul { padding-left: 20px; }
.guide-mistakes li { margin-bottom: 10px; font-size: 0.9rem; color: var(--c-text-secondary); }
.guide-mistakes li strong { color: var(--c-text); }

.guide-faq details {
  background: var(--c-surface); border: 1px solid var(--c-border-light);
  border-radius: var(--radius-sm); margin-bottom: 8px; padding: 14px 16px;
}
.guide-faq summary {
  font-weight: 600; font-size: 0.9rem; cursor: pointer;
  color: var(--c-text);
}
.guide-faq details p {
  margin-top: 8px; font-size: 0.9rem; color: var(--c-text-secondary);
  line-height: 1.55;
}

/* Footer */
.site-footer {
  background: var(--c-surface); border-top: 1px solid var(--c-border-light);
  padding: 24px 0;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; font-size: 0.85rem; color: var(--c-text-muted);
}
.footer-inner a { color: var(--c-text-muted); }
.footer-inner a:hover { color: var(--c-primary); }
.footer-nav { display: flex; gap: 16px; }
.footer-note { font-size: 0.78rem; }

/* Print */
@media print {
  .site-header, .hero, .worksheet-form, .export-actions,
  .site-footer, .guide-section, .btn, .slot-actions { display: none !important; }
  .worksheet-grid { display: block; }
  .schedule-panel { position: static; box-shadow: none; border: none; padding: 0; }
  body { background: #fff; color: #000; }
  .schedule-table td, .schedule-table th { border-color: #ccc; }
}

/* Responsive */
@media (max-width: 900px) {
  .worksheet-grid { grid-template-columns: 1fr; }
  .schedule-panel { position: static; }
}
@media (max-width: 640px) {
  .nav { gap: 12px; }
  .nav a { font-size: 0.82rem; }
  .hero { padding: 40px 0 32px; }
  .form-row { grid-template-columns: 1fr; }
  .volunteer-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px; padding: 10px;
    border: 1px solid var(--c-border-light);
    border-radius: var(--radius-sm);
  }
  .volunteer-row .time-sep,
  .volunteer-row .hours-label { display: none; }
  .volunteer-row input[type="text"] { grid-column: 1 / -1; }
  .volunteer-row .remove-vol { position: absolute; right: 4px; top: 4px; }
  .volunteer-row { position: relative; }
  .footer-inner { flex-direction: column; text-align: center; }
  .presets { flex-direction: column; align-items: flex-start; }
}

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 100;
  background: var(--c-text); color: #fff;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(8px);
  transition: all 0.3s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* Focus styles */
*:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}



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