/* ===== CSS Custom Properties ===== */
:root {
  --color-bg: #1a1410;
  --color-surface: #241d17;
  --color-surface-raised: #2e241d;
  --color-border: #3d3228;
  --color-text: #f0e8df;
  --color-text-muted: #a89888;
  --color-text-dim: #7a6c5e;
  --color-accent: #e8a040;
  --color-accent-hover: #f0b058;
  --color-accent-dim: #8a5a18;
  --color-success: #5cb878;
  --color-warning: #e8a040;
  --color-danger: #d96060;
  --color-focus: #e8a040;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --max-width: 1200px;
  --header-height: 60px;
  --transition: 0.2s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover, a:focus-visible {
  color: var(--color-accent-hover);
}

img, svg {
  display: block;
  max-width: 100%;
}

button, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

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

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

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

/* ===== Header ===== */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.logo:hover, .logo:focus-visible {
  color: var(--color-accent);
}
.logo-icon {
  color: var(--color-accent);
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  gap: 20px;
}
.site-nav a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--color-text);
  border-bottom-color: var(--color-accent);
}

/* ===== Hero ===== */
.hero-section {
  padding: 48px 0 32px;
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg) 100%);
}

.hero-tagline {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 8px;
}

.hero-content h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 12px;
  color: var(--color-text);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 600px;
  line-height: 1.5;
}

/* ===== Worksheet Section ===== */
.worksheet-section {
  padding: 32px 0 48px;
}

.worksheet-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  align-items: start;
}

/* ===== Config Panel ===== */
.config-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: calc(var(--header-height) + 16px);
  max-height: calc(100vh - var(--header-height) - 32px);
  overflow-y: auto;
}

.config-panel h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.config-intro {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.field-group,
.presets-group {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.field-select,
.field-textarea {
  width: 100%;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  padding: 10px 12px;
  font-size: 0.9rem;
  transition: border-color var(--transition);
  appearance: auto;
}

.field-select:hover,
.field-textarea:hover {
  border-color: var(--color-text-dim);
}

.field-select:focus,
.field-textarea:focus {
  border-color: var(--color-accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(232, 160, 64, 0.15);
}

.field-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  margin-top: 4px;
}

.config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.save-status {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--color-success);
  min-height: 1.2em;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: var(--color-bg);
}

.btn-secondary {
  background: var(--color-surface-raised);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover, .btn-secondary:focus-visible {
  border-color: var(--color-text-dim);
  background: var(--color-border);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  color: var(--color-text);
  background: var(--color-surface-raised);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.8rem;
}

/* ===== Checklist Area ===== */
.checklist-area {
  min-width: 0;
}

.checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.checklist-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
}

.checklist-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.total-time {
  font-size: 0.85rem;
  color: var(--color-accent);
  font-weight: 600;
  background: rgba(232, 160, 64, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
}

.checklist-actions {
  display: flex;
  gap: 8px;
}

/* ===== Checklist Output ===== */
.checklist-output {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

.checklist-placeholder {
  color: var(--color-text-dim);
  font-style: italic;
  text-align: center;
  padding: 32px 0;
}

.checklist-phase {
  margin-bottom: 24px;
}

.checklist-phase:last-child {
  margin-bottom: 0;
}

.phase-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.phase-number {
  background: var(--color-accent);
  color: var(--color-bg);
  font-weight: 700;
  font-size: 0.75rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.phase-title {
  font-weight: 700;
  font-size: 1rem;
  flex: 1;
}

.phase-time {
  font-size: 0.78rem;
  color: var(--color-text-dim);
  white-space: nowrap;
}

.checklist-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.checklist-item:hover {
  background: rgba(255,255,255,0.02);
}

.item-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}

.item-content {
  flex: 1;
  min-width: 0;
}

.item-label {
  font-size: 0.9rem;
  cursor: pointer;
  display: block;
  line-height: 1.4;
}

.checklist-item.checked .item-label {
  text-decoration: line-through;
  color: var(--color-text-dim);
}

.item-pitfall {
  font-size: 0.78rem;
  color: var(--color-warning);
  margin-top: 2px;
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.item-pitfall::before {
  content: "\26A0";
  font-size: 0.7rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ===== Progress Bar ===== */
.progress-bar {
  height: 6px;
  background: var(--color-surface-raised);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 0.78rem;
  color: var(--color-text-dim);
  text-align: right;
}

/* ===== Tips Section ===== */
.tips-section {
  padding: 48px 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.tips-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.tip-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.tip-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-accent);
}

.tip-card p {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* ===== Scenario Section ===== */
.scenario-section {
  padding: 48px 0;
  border-top: 1px solid var(--color-border);
}

.scenario-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.scenario-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
}

.scenario-details p {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.scenario-details strong {
  color: var(--color-text);
}

.scenario-gear {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  height: fit-content;
}

.scenario-gear h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--color-accent);
}

.scenario-gear ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scenario-gear li {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  padding-left: 18px;
  position: relative;
  line-height: 1.45;
}

.scenario-gear li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: 700;
}

/* ===== FAQ Section ===== */
.faq-section {
  padding: 48px 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.faq-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 720px;
}

.faq-item dt {
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--color-text);
}

.faq-item dd {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* ===== Footer ===== */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
}

.footer-note {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  max-width: 500px;
}

.footer-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-nav a {
  font-size: 0.82rem;
  color: var(--color-text-dim);
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--color-accent);
}

.footer-meta {
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

/* ===== Print Styles ===== */
@media print {
  .site-header,
  .config-panel,
  .checklist-actions,
  .config-actions,
  .progress-bar,
  .progress-text,
  .site-footer,
  .tips-section,
  .scenario-section,
  .faq-section,
  .hero-section {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .checklist-area {
    display: block;
  }

  .checklist-output {
    border: 1px solid #ccc;
    background: #fff;
  }

  .checklist-header {
    margin-bottom: 16px;
  }

  .checklist-header h2 {
    font-size: 1.4rem;
  }

  .item-checkbox {
    -webkit-appearance: checkbox;
    appearance: checkbox;
  }

  .checklist-phase {
    break-inside: avoid;
  }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .worksheet-layout {
    grid-template-columns: 1fr;
  }

  .config-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .scenario-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 14px;
  }

  .hero-section {
    padding: 32px 0 20px;
  }

  .checklist-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .checklist-meta {
    width: 100%;
    justify-content: space-between;
  }

  .tips-grid {
    grid-template-columns: 1fr;
  }

  .config-actions {
    flex-direction: column;
  }

  .config-actions .btn {
    width: 100%;
  }
}



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