* { box-sizing: border-box; }
:root {
  --bg: #f4f8fb;
  --surface: #ffffff;
  --line: #d7e2ea;
  --text: #1f2a37;
  --muted: #627386;
  --blue: #2563eb;
  --blue-soft: #e8f1ff;
  --green: #0f8f72;
  --green-soft: #e6f6f1;
  --warning: #9a5b00;
  --warning-soft: #fff4dd;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}
main { padding: 18px; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 24px;
  padding: 28px;
  background: linear-gradient(120deg, #ffffff, #eef8f5);
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 820px; margin-bottom: 10px; font-size: 30px; line-height: 1.25; }
h2 { margin-bottom: 8px; font-size: 18px; }
h3 { margin: 16px 0 8px; font-size: 15px; }
.lead { max-width: 860px; margin-bottom: 0; color: var(--muted); }
.auth-card, .panel, .summary-card, .step-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(31, 42, 55, 0.04);
}
.auth-card { padding: 16px; }
.auth-card label { display: block; margin-bottom: 8px; font-weight: 700; }
.auth-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
input, textarea, select, button {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c8d4df;
  border-radius: 7px;
  font: inherit;
}
textarea { resize: vertical; }
button {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
  font-weight: 700;
  cursor: pointer;
}
button:hover { filter: brightness(0.96); }
button.secondary {
  background: #ffffff;
  color: var(--text);
  border-color: #b9c8d5;
}
button.small { width: auto; padding: 8px 12px; font-size: 13px; }
.status-pill, .tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 10px 0 0;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.status-pill.neutral, .tag { background: #eef2f6; color: var(--muted); }
.status-pill.ok, .tag.green { background: var(--green-soft); color: var(--green); }
.status-pill.error, .tag.warning { background: var(--warning-soft); color: var(--warning); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.summary-card { padding: 16px; }
.summary-card span, .summary-card small { display: block; color: var(--muted); }
.summary-card strong { display: block; margin: 4px 0; font-size: 28px; line-height: 1.1; }
.notice {
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid #bfe3d8;
  border-radius: 8px;
  background: var(--green-soft);
  color: #125b4a;
}
.notice p { margin: 0; }
.steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.step-card {
  position: relative;
  padding: 14px;
  min-height: 154px;
}
.step-card.active { border-color: #9bd4c3; background: #fbfffd; }
.step-number {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
}
.step-card p { margin: 0; color: var(--muted); font-size: 13px; }
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 16px;
}
.panel { padding: 16px; }
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.help { color: var(--muted); font-size: 14px; }
.form-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px;
  margin-top: 8px;
}
.list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.item {
  padding: 11px;
  border: 1px solid #e0e8ef;
  border-radius: 7px;
  background: #fbfdff;
  cursor: pointer;
}
.item:hover { border-color: #a9c5e8; background: #f7fbff; }
.item strong { display: block; margin-bottom: 4px; }
.muted { color: var(--muted); font-size: 13px; }
.label {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 11px;
  font-weight: 700;
}
.detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e0e8ef;
  white-space: pre-wrap;
}
.message-box, pre {
  overflow: auto;
  max-height: 360px;
  background: #f2f6f9;
  border-radius: 7px;
  padding: 10px;
}
.message-box:empty { display: none; }
#weeklyPack, #weeklyResult { margin-top: 8px; }
@media (max-width: 1100px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  main { padding: 12px; }
  .hero, .dashboard-grid, .summary-grid, .steps, .form-row, .auth-row {
    grid-template-columns: 1fr;
  }
  .hero { padding: 18px; }
  h1 { font-size: 24px; }
  .step-card { min-height: auto; }
  button.small { width: 100%; }
}
