:root {
  --bg: #1a1714;
  --bg-soft: #241f1b;
  --bg-card: #2b2520;
  --bg-elevated: #332c25;
  --border: #3d352d;
  --border-soft: #2f2923;
  --text: #ece5dc;
  --text-muted: #b3a89a;
  --text-dim: #8a7f72;
  --accent: #d4a373;
  --accent-strong: #e0b88a;
  --accent-soft: #a87a4f;
  --success: #8aaa7a;
  --danger: #c97b6b;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.25);
  --max-width: 1180px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

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

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 0.5em;
  font-weight: 600;
}

.hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 400;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
}
.brand:hover { text-decoration: none; color: var(--accent-strong); }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--accent);
}
.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9rem;
}
.site-nav a { color: var(--text-muted); }
.site-nav a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero {
  padding: 4rem 1.5rem 3rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.hero-copy .lede {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 48ch;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.panel-title {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}

.field {
  margin-bottom: 1.25rem;
}
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}
input[type="text"],
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s;
}
input[type="text"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(212,163,115,0.15);
}
textarea { resize: vertical; min-height: 80px; }

.seg {
  display: flex;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.seg-btn {
  flex: 1;
  padding: 0.55rem 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.seg-btn:not(:last-child) { border-right: 1px solid var(--border); }
.seg-btn.is-active {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: #1a1714;
  flex: 1;
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover { border-color: var(--accent-soft); color: var(--text); }
.btn-small { padding: 0.45rem 0.85rem; font-size: 0.8rem; }

/* Result section */
.result-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.result-empty {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-illo {
  color: var(--accent-soft);
  margin-bottom: 1rem;
}
.result-empty h2 { font-size: 1.3rem; }
.result-empty p { color: var(--text-muted); max-width: 50ch; margin: 0 auto; }

.result-live { animation: fadein 0.3s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.result-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.day-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.day-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.day-item:hover { border-color: var(--accent-soft); }
.day-item.is-done {
  background: var(--bg-soft);
  opacity: 0.7;
}
.day-num {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--accent);
  line-height: 1;
  min-width: 2.5rem;
  padding-top: 0.15rem;
}
.day-body h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}
.day-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}
.day-check {
  margin-left: auto;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0.75rem;
  transition: all 0.15s;
}
.day-item.is-done .day-check {
  background: var(--success);
  border-color: var(--success);
  color: #1a1714;
}
.result-foot {
  margin-top: 1.25rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* Content sections */
.content-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--border-soft);
}
.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
}
.content-main h2 { margin-bottom: 1rem; }
.content-main h3 { margin-top: 1.75rem; margin-bottom: 0.5rem; }

.bullet-list {
  padding-left: 1.25rem;
  margin: 0 0 1.5rem;
}
.bullet-list li {
  margin-bottom: 0.6rem;
  color: var(--text-muted);
}
.bullet-list li strong { color: var(--text); }

.side-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.side-card h3 { font-size: 0.95rem; margin-bottom: 0.75rem; }
.side-list {
  padding-left: 1.1rem;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.side-list li { margin-bottom: 0.4rem; }
.diff-list { margin: 0; font-size: 0.88rem; }
.diff-list > div { margin-bottom: 0.75rem; }
.diff-list dt { font-weight: 600; color: var(--text); }
.diff-list dd { margin: 0.2rem 0 0; color: var(--text-muted); }
.side-card p { font-size: 0.88rem; color: var(--text-muted); margin: 0; }

/* History */
.history-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}
.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}
.history-item .hi-label { color: var(--text); }
.history-item .hi-meta { color: var(--text-dim); font-size: 0.8rem; }
.history-empty {
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem;
  background: var(--bg-soft);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

/* FAQ */
.faq-section { padding-bottom: 4rem; }
.faq-list {
  display: grid;
  gap: 0.5rem;
}
.faq-list details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
}
.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--accent);
  transition: transform 0.2s;
}
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-soft);
  padding: 2.5rem 1.5rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.footer-brand { font-weight: 600; color: var(--text); margin-bottom: 0.25rem; }
.footer-note { color: var(--text-muted); font-size: 0.9rem; max-width: 60ch; margin-bottom: 1rem; }
.footer-links { display: flex; gap: 1.25rem; font-size: 0.85rem; margin-bottom: 1rem; }
.footer-meta { color: var(--text-dim); font-size: 0.8rem; margin: 0; }

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  z-index: 100;
  animation: toastin 0.25s ease;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Print */
@media print {
  .site-header, .site-footer, .hero-panel, .result-actions, .history-section, .faq-section, .content-side, .result-foot { display: none !important; }
  body { background: #fff; color: #1a1714; }
  .result-section { padding: 0; }
  .day-item { border: 1px solid #ccc; break-inside: avoid; }
  .day-num { color: #a87a4f; }
}

/* Responsive */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .content-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero { padding: 2.5rem 1.25rem 2rem; }
  .content-section { padding: 2rem 1.25rem; }
  .header-inner { padding: 0.75rem 1.25rem; }
  .site-nav { gap: 0.85rem; font-size: 0.82rem; }
  .form-actions { flex-direction: column; }
  .result-head { flex-direction: column; }
  .day-item { padding: 1rem; gap: 0.85rem; }
  .day-num { font-size: 1.25rem; min-width: 2rem; }
}

@media (max-width: 480px) {
  .site-nav a:nth-child(3) { display: none; }
  .hero-copy h1 { font-size: 1.75rem; }
  .panel-card { padding: 1.25rem; }
}



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