/* ChoreSpinner — dual theme (fun / calm) via CSS custom properties */

html[data-theme="fun"] {
  --bg: #FFFDF7;
  --surface: #ffffff;
  --surface-2: #F7F5FC;
  --border: #E8E3F2;
  --text: #1E1B2E;
  --text-dim: #6B6580;
  --accent: #5B2A86;
  --accent-dark: #43206B;
  --accent-2: #C6F432;
  --accent-2-dark: #9FCE0D;
  --accent-ink: #ffffff;
  --teal: #0FA36B;
  --coral: #FF6B5E;
  --sun: #FFC53D;
  --header-bg: #5B2A86;
  --header-text: #ffffff;
  --header-link: #EDE4FA;
  --header-link-hover: #ffffff;
  --logo-em: #C6F432;
  --btn-bg: #C6F432;
  --btn-ink: #1E1B2E;
  --btn-shadow: 0 5px 0 #9FCE0D;
  --radius: 18px;
  --font-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --display-weight: 900;
  --display-style: normal;
  --display-spacing: -0.03em;
  --cat-kitchen: #FF6B5E;
  --cat-bathroom: #0FA36B;
  --cat-bedroom: #FFC53D;
  --cat-living: #5B2A86;
  --cat-floors: #3AA0FF;
  --cat-outdoor: #8A6D3B;
  --cat-admin: #8A82A0;
  --card-shadow: 0 10px 30px rgba(20, 10, 40, 0.10);
}

html[data-theme="calm"] {
  --bg: #faf8f3;
  --surface: #ffffff;
  --surface-2: #fdfcf8;
  --border: #e8e4da;
  --text: #26302b;
  --text-dim: #5b6a62;
  --accent: #4a7c59;
  --accent-dark: #386144;
  --accent-2: #4a7c59;
  --accent-2-dark: #386144;
  --accent-ink: #ffffff;
  --teal: #4a7c59;
  --coral: #c9a24b;
  --sun: #c9a24b;
  --header-bg: rgba(250, 248, 243, 0.92);
  --header-text: #26302b;
  --header-link: #5b6a62;
  --header-link-hover: #386144;
  --logo-em: #4a7c59;
  --btn-bg: #4a7c59;
  --btn-ink: #ffffff;
  --btn-shadow: 0 6px 16px rgba(74, 124, 89, 0.28);
  --radius: 18px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  --display-weight: 700;
  --display-style: normal;
  --display-spacing: -0.01em;
  --cat-kitchen: #b5654e;
  --cat-bathroom: #4a7c59;
  --cat-bedroom: #c9a24b;
  --cat-living: #6b5b8a;
  --cat-floors: #7fa8c9;
  --cat-outdoor: #8a7a5a;
  --cat-admin: #8a978f;
  --card-shadow: 0 1px 2px rgba(38, 48, 43, 0.04), 0 8px 24px rgba(38, 48, 43, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 920px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: var(--display-weight); }

/* Header */
.site-header {
  background: var(--header-bg);
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px; gap: 12px;
}
.logo {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.15rem; color: var(--header-text);
  text-decoration: none; letter-spacing: -0.02em; flex-shrink: 0;
}
.logo-word { color: var(--header-text); }
.logo-word span { color: var(--logo-em); }
.logo-spin {
  width: 30px; height: 30px; border-radius: 50%;
  background: conic-gradient(var(--accent-2) 0 25%, var(--coral) 25% 50%, var(--sun) 50% 75%, var(--teal) 75% 100%);
  border: 2px solid var(--surface); position: relative; flex: none;
}
.logo-spin::after { content: ""; position: absolute; inset: 8px; background: var(--surface); border-radius: 50%; }
.site-nav { display: flex; gap: 4px; align-items: center; }
.site-nav a {
  color: var(--header-link); text-decoration: none; font-size: 0.85rem; font-weight: 600;
  padding: 7px 11px; border-radius: 9px; transition: 0.15s; white-space: nowrap;
}
.site-nav a:hover { color: var(--header-link-hover); }
.site-nav a.active { background: var(--btn-bg); color: var(--btn-ink); }
.theme-toggle {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 0.8rem; font-weight: 700;
  padding: 7px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: transform 0.12s;
}
.theme-toggle:hover { transform: scale(1.04); }

/* Hero */
.hero { text-align: center; padding: 46px 0 8px; }
.hero h1 {
  font-size: clamp(1.8rem, 4.8vw, 2.8rem);
  letter-spacing: var(--display-spacing); line-height: 1.12;
}
.hero h1 em { font-style: normal; color: var(--accent); }
html[data-theme="fun"] .hero h1 em { color: var(--accent); }
html[data-theme="calm"] .hero h1 em { font-style: italic; }
.hero p { color: var(--text-dim); max-width: 600px; margin: 12px auto 0; font-size: 1.03rem; }

/* Tool card */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 28px;
  margin: 32px auto;
}
.options-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px; margin-bottom: 18px;
}
.option label, .option > .opt-label {
  display: block; font-size: 0.76rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-dim); margin-bottom: 6px;
}
.option select, .option input[type="text"], .option input[type="number"] {
  width: 100%; padding: 11px 12px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  font-size: 0.95rem; font-family: inherit;
}
.option select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239aa7b5' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.option select:focus, .option input:focus { outline: 2px solid var(--accent-dark); border-color: transparent; }

.day-checks { display: flex; gap: 6px; flex-wrap: wrap; }
.day-checks label {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 11px; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); border: 1.5px solid var(--border);
  font-size: 0.82rem; font-weight: 700; color: var(--text-dim);
  text-transform: none; letter-spacing: 0; margin-bottom: 0;
  user-select: none; transition: 0.15s;
}
.day-checks input { position: absolute; opacity: 0; pointer-events: none; }
.day-checks label.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.name-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 8px; }
.name-slots input {
  padding: 9px 10px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px; font-size: 0.9rem; font-family: inherit;
}

.check-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 0.92rem; color: var(--text-dim); }
.check-row input { width: 17px; height: 17px; accent-color: var(--accent); }

.btn-primary {
  width: 100%; padding: 15px;
  background: var(--btn-bg); color: var(--btn-ink);
  font-size: 1.05rem; font-weight: 800; font-family: inherit;
  border: none; border-radius: 12px; cursor: pointer;
  transition: transform 0.12s;
  box-shadow: var(--btn-shadow);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  flex: 1; padding: 11px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  font-size: 0.92rem; font-weight: 700; font-family: inherit; cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.schedule-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* Output */
.tool-output { display: none; margin-top: 26px; }
.tool-output.visible { display: block; }
.out-title { font-size: 1.25rem; letter-spacing: -0.01em; }
.out-sub { color: var(--text-dim); font-size: 0.9rem; margin: 2px 0 14px; }

/* Weekly schedule grid (day cards) */
.week-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.day-card {
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
  padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 7px;
}
.day-card h4 {
  font-family: var(--font-body);
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-dim); padding-bottom: 6px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: baseline;
}
.day-card h4 .mins { color: var(--accent); letter-spacing: 0; }
.day-card.rest-day { opacity: 0.75; }
.day-card .rest-note { color: var(--text-dim); font-size: 0.82rem; font-style: italic; }
.task-line { font-size: 0.83rem; line-height: 1.35; display: flex; gap: 7px; align-items: flex-start; }
.task-line .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 5px; }
.task-line .who { display: block; font-size: 0.72rem; color: var(--text-dim); font-weight: 600; }
.dot.kitchen  { background: var(--cat-kitchen); }
.dot.bathroom { background: var(--cat-bathroom); }
.dot.bedroom  { background: var(--cat-bedroom); }
.dot.living   { background: var(--cat-living); }
.dot.floors   { background: var(--cat-floors); }
.dot.outdoor  { background: var(--cat-outdoor); }
.dot.admin    { background: var(--cat-admin); }
.legend { display: flex; gap: 13px; flex-wrap: wrap; margin-top: 12px; font-size: 0.75rem; font-weight: 700; color: var(--text-dim); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.deferred-note { margin-top: 12px; font-size: 0.82rem; color: var(--text-dim); }

/* Chore chart table (people x days) */
.chart-scroll { overflow-x: auto; }
table.chore-chart { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 640px; }
table.chore-chart th {
  text-align: left; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-dim); padding: 6px 10px;
  border-bottom: 2px solid var(--border);
}
table.chore-chart td {
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  padding: 10px; vertical-align: top; font-size: 0.82rem;
}
table.chore-chart td.person-cell { font-weight: 800; color: var(--accent); white-space: nowrap; background: var(--surface); }
table.chore-chart .task-line { margin-bottom: 5px; }

/* Chore wheel */
.wheel-wrap { display: flex; flex-direction: column; align-items: center; padding: 10px 0; }
.wheel-pointer {
  width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent;
  border-top: 22px solid var(--accent); margin-bottom: -6px; z-index: 2; position: relative;
}
#chore-wheel {
  width: min(320px, 80vw); height: min(320px, 80vw); border-radius: 50%;
  border: 6px solid var(--surface); box-shadow: var(--card-shadow);
  transition: transform 4s cubic-bezier(0.12, 0.6, 0.04, 1);
}
.wheel-result {
  margin-top: 22px; text-align: center; min-height: 64px;
}
.wheel-result .picked { font-size: 1.3rem; font-weight: 800; font-family: var(--font-display); }
.wheel-result .picked-meta { color: var(--text-dim); font-size: 0.88rem; }

/* Checklist */
.room-block { margin-bottom: 22px; }
.room-block h3 { font-size: 1.05rem; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.room-block h3 .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.check-item {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 6px; cursor: pointer; font-size: 0.92rem;
}
.check-item input { width: 17px; height: 17px; accent-color: var(--accent); margin-top: 3px; flex: none; }
.check-item.done { opacity: 0.55; text-decoration: line-through; }
.check-item .mins-tag { margin-left: auto; font-size: 0.75rem; font-weight: 700; color: var(--text-dim); white-space: nowrap; }
.checklist-progress { font-size: 0.9rem; font-weight: 700; color: var(--accent); margin: 10px 0 18px; }

/* Content sections */
.content-section { padding: 28px 0; }
.content-section h2 { font-size: 1.5rem; letter-spacing: var(--display-spacing); margin-bottom: 14px; }
.content-section h3 { font-size: 1.1rem; margin: 22px 0 8px; }
.content-section p, .content-section li { color: var(--text-dim); font-size: 0.97rem; }
.content-section p + p { margin-top: 12px; }
.content-section ul, .content-section ol { padding-left: 22px; margin-top: 8px; }
.content-section a { color: var(--accent); }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border); padding: 4px 0; }
.faq-item summary {
  cursor: pointer; font-weight: 700; padding: 13px 0;
  list-style: none; position: relative; padding-right: 28px;
}
.faq-item summary::after {
  content: "+"; position: absolute; right: 4px; color: var(--accent);
  font-size: 1.2rem; font-weight: 400;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item p { padding: 0 0 14px; color: var(--text-dim); }

/* Related tools */
.related-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px; margin-top: 16px;
}
.related-card {
  display: block; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; text-decoration: none;
  box-shadow: var(--card-shadow);
  transition: border-color 0.15s, transform 0.15s;
}
.related-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.related-card .ico { font-size: 1.5rem; display: block; margin-bottom: 8px; }
.related-card h3 { color: var(--text); font-size: 1rem; margin: 0 0 4px; }
.related-card p { color: var(--text-dim); font-size: 0.85rem; margin: 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 48px; padding: 28px 0;
  text-align: center; font-size: 0.85rem; color: var(--text-dim);
}
.site-footer nav { display: flex; gap: 18px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }
.site-footer a { color: var(--text-dim); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* Legal pages */
.legal-page h1 { font-size: 1.8rem; margin: 40px 0 20px; letter-spacing: -0.02em; }
.legal-page h2 { font-size: 1.2rem; margin: 26px 0 10px; }
.legal-page p, .legal-page li { color: var(--text-dim); }
.legal-page ul { padding-left: 22px; }

@media (max-width: 640px) {
  .tool-card { padding: 20px 16px; }
  .site-nav a { padding: 7px 7px; font-size: 0.78rem; }
  .site-nav a:not(.active):nth-child(n+3) { display: none; }
}

/* Print: schedule only */
@media print {
  .site-header, .site-footer, .hero p, .options-grid, .btn-primary,
  .schedule-actions, .content-section, .theme-toggle, .check-row,
  .name-slots, .day-checks { display: none !important; }
  body { background: #fff; color: #000; }
  .tool-card { border: none; box-shadow: none; margin: 0; padding: 0; }
  .tool-output { display: block !important; }
  .week-grid { grid-template-columns: repeat(2, 1fr); }
  .day-card { break-inside: avoid; }
}
