:root {
  --bg: #f4f8f7;
  --surface: #ffffff;
  --surface-soft: #edf6f3;
  --text: #172321;
  --muted: #667570;
  --line: #d8e5e1;
  --primary: #17786e;
  --primary-dark: #115e57;
  --primary-soft: #dff1ed;
  --danger: #b74646;
  --shadow: 0 16px 45px rgba(30, 74, 66, .08);
  --radius-lg: 25px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .98), transparent 30rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(23, 120, 110, .28);
  outline-offset: 3px;
}

.site-header {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.brand {
  min-width: 0;
  color: var(--text);
  text-decoration: none;
  font-size: 1.02rem;
  font-weight: 850;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 14px;
}

.header-note {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.language-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 7px 4px;
  color: var(--primary-dark);
  font-size: .86rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-shell {
  width: min(calc(100% - 28px), 900px);
  margin: 0 auto;
  padding: 22px 0 72px;
}

.hero {
  padding: 34px 0 27px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .1em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.15rem, 7vw, 4.5rem);
  line-height: 1.12;
  letter-spacing: -.045em;
}

.lead {
  max-width: 640px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 1rem;
}

.answer-card {
  margin: 10px auto 22px;
  padding: 31px;
  border-radius: var(--radius-lg);
  color: #fff;
  background: linear-gradient(135deg, #18776d, #115a53);
  box-shadow: 0 22px 52px rgba(16, 92, 85, .18);
  text-align: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .17);
  font-size: .76rem;
  font-weight: 800;
}

.answer-label {
  margin: 13px 0 1px;
  color: rgba(255, 255, 255, .82);
  font-size: .9rem;
  font-weight: 750;
}

.answer-time {
  margin: 0;
  font-size: clamp(3.35rem, 12vw, 6rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -.055em;
  font-variant-numeric: tabular-nums;
}

.answer-date {
  margin: 9px 0 0;
  color: rgba(255, 255, 255, .78);
  font-size: .88rem;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 670px;
  margin: 26px auto 0;
  text-align: left;
}

.answer-mini {
  min-width: 0;
  padding: 15px 17px;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 16px;
  background: rgba(255, 255, 255, .09);
}

.answer-mini span {
  display: block;
  color: rgba(255, 255, 255, .72);
  font-size: .76rem;
  font-weight: 700;
}

.answer-mini strong {
  display: block;
  margin-top: 2px;
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
}

.answer-note {
  margin: 17px 0 0;
  color: rgba(255, 255, 255, .76);
  font-size: .8rem;
}

.scroll-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 45px;
  margin-top: 19px;
  padding: 9px 20px;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 999px;
  color: #fff;
  background: transparent;
  font-weight: 800;
}

.scroll-button:hover {
  background: rgba(255, 255, 255, .1);
}

.section-card {
  margin-top: 20px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}

.step {
  margin: 0 0 3px;
  color: var(--primary);
  font-size: .74rem;
  font-weight: 850;
  letter-spacing: .12em;
}

h2 {
  margin: 0;
  font-size: 1.52rem;
  line-height: 1.35;
}

.text-button {
  min-height: 44px;
  border: 0;
  padding: 7px 4px;
  color: var(--primary);
  background: transparent;
  font-size: .86rem;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr .8fr .75fr;
  gap: 14px;
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: #465753;
  font-size: .88rem;
  font-weight: 750;
}

.field input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: #fff;
  outline: none;
  font-weight: 700;
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus,
.task-name:focus,
.task-minutes:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22, 121, 111, .11);
}

.input-unit {
  position: relative;
  min-width: 0;
}

.input-unit input {
  padding-right: 43px;
}

.input-unit b {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: .83rem;
}

details {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

summary {
  min-height: 44px;
  width: fit-content;
  padding: 8px 0;
  color: var(--primary);
  font-size: .87rem;
  font-weight: 800;
  cursor: pointer;
}

.advanced-inner {
  max-width: 280px;
  margin-top: 13px;
}

.helper {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: .8rem;
}

.helper-compact {
  margin-top: -8px;
  margin-bottom: 16px;
}

.sub-divider {
  height: 1px;
  margin: 25px 0;
  background: var(--line);
}

.template-label {
  margin: 0 0 10px;
  color: #465753;
  font-size: .9rem;
  font-weight: 800;
}

.templates {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.template-button {
  min-height: 44px;
  padding: 8px 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: #fff;
  font-size: .88rem;
  font-weight: 780;
}

.template-button:hover,
.template-button.is-active {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.add-button {
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid var(--primary);
  border-radius: 12px;
  color: var(--primary-dark);
  background: #fff;
  font-weight: 800;
}

.add-button:hover {
  background: var(--primary-soft);
}

.tasks {
  display: grid;
  gap: 10px;
}

.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 122px 44px 44px 44px;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.task-name,
.task-minutes {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: #fff;
  outline: none;
  font-weight: 650;
}

.task-name {
  padding: 10px 12px;
}

.task-minutes {
  padding: 10px 38px 10px 12px;
}

.task-minutes-wrap {
  position: relative;
  min-width: 0;
}

.task-minutes-wrap span {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  pointer-events: none;
}

.icon-button {
  width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  color: #63716e;
  background: transparent;
  font-weight: 850;
}

.icon-button:hover:not(:disabled) {
  color: var(--primary-dark);
  background: var(--surface-soft);
}

.icon-button:disabled {
  color: #b6c0bd;
  cursor: default;
}

.remove-task {
  color: #8a4a4a;
}

.prep-total {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: .87rem;
}

.prep-total strong {
  color: var(--primary-dark);
  font-size: 1.08rem;
}

.calculate-button {
  width: 100%;
  min-height: 55px;
  margin-top: 18px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--primary-dark);
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(17, 94, 87, .16);
}

.calculate-button:hover {
  background: #0d514b;
}

.error-box {
  display: none;
  margin-top: 13px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #8a3131;
  background: #fdeaea;
  font-size: .84rem;
  font-weight: 700;
}

.error-box.is-visible {
  display: block;
}

.schedule-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 17px;
}

.copy-button {
  min-height: 44px;
  padding: 7px 13px;
  border: 1px solid var(--primary);
  border-radius: 11px;
  color: var(--primary);
  background: #fff;
  font-size: .83rem;
  font-weight: 800;
}

.copy-button:hover {
  background: var(--primary-soft);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 92px 20px minmax(0, 1fr);
  gap: 12px;
  min-height: 84px;
}

.timeline-time {
  padding-top: 1px;
  color: var(--primary-dark);
  font-size: 1.14rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.timeline-marker {
  position: relative;
}

.timeline-marker::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 5px var(--primary-soft);
}

.timeline-marker::after {
  content: "";
  position: absolute;
  top: 24px;
  bottom: -3px;
  left: 9px;
  width: 2px;
  background: var(--line);
}

.timeline-item:last-child .timeline-marker::after {
  display: none;
}

.timeline-content strong {
  display: block;
  font-size: 1.02rem;
  line-height: 1.4;
}

.timeline-content span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .85rem;
}

.info-box {
  margin-top: 4px;
  padding: 17px 18px;
  border-radius: 15px;
  color: #38544f;
  background: var(--surface-soft);
  font-size: .86rem;
}

.copy-fallback {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}

.copy-fallback label {
  display: block;
  margin-bottom: 8px;
  color: #38544f;
  font-size: .86rem;
  font-weight: 800;
}

.copy-fallback textarea {
  width: 100%;
  resize: vertical;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: #fff;
}

.copy-fallback-close {
  min-height: 44px;
  margin-top: 8px;
  padding: 8px 16px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  color: var(--primary-dark);
  background: #fff;
  font-weight: 800;
}

.footer {
  padding: 28px 12px 0;
  color: var(--muted);
  text-align: center;
  font-size: .78rem;
}

.answer-card.is-warning {
  background: linear-gradient(135deg, #a86616, #814807);
}

.answer-card.is-danger {
  background: linear-gradient(135deg, var(--danger), #843131);
}

@media (max-width: 720px) {
  .site-header {
    padding: 17px 16px;
    gap: 12px;
  }

  .page-shell {
    width: min(calc(100% - 22px), 900px);
    padding-top: 4px;
  }

  .hero {
    padding: 28px 7px 20px;
  }

  .lead {
    font-size: .93rem;
  }

  .answer-card,
  .section-card {
    padding: 23px 19px;
    border-radius: 21px;
  }

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

  .form-grid .field:last-child {
    grid-column: 1 / -1;
  }

  .task-row {
    grid-template-columns: minmax(0, 1fr) 112px 44px 44px 44px;
    gap: 6px;
  }
}

@media (max-width: 560px) {
  .header-note {
    display: none;
  }

  .header-actions {
    gap: 0;
  }

  .hero h1 {
    font-size: 2.28rem;
  }

  .answer-time {
    font-size: 3.7rem;
  }

  .answer-grid {
    gap: 8px;
  }

  .answer-mini {
    padding: 13px 12px;
  }

  .answer-mini strong {
    font-size: 1.2rem;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 11px;
  }

  .form-grid .field:last-child {
    grid-column: auto;
  }

  .section-heading {
    margin-bottom: 18px;
  }

  .task-row {
    grid-template-columns: minmax(0, 1fr) 44px 44px 44px;
    gap: 7px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }

  .task-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .task-name {
    grid-column: 1 / -1;
  }

  .task-minutes-wrap {
    grid-column: 1;
  }

  .timeline-item {
    grid-template-columns: 72px 16px minmax(0, 1fr);
    gap: 8px;
    min-height: 80px;
  }

  .timeline-time {
    font-size: 1rem;
  }

  .schedule-head {
    align-items: flex-start;
  }
}

@media (max-width: 360px) {
  .site-header {
    padding-right: 10px;
    padding-left: 10px;
    gap: 8px;
  }

  .brand {
    font-size: .92rem;
  }

  .language-link {
    font-size: .8rem;
  }

  .page-shell {
    width: min(calc(100% - 16px), 900px);
  }

  .answer-card,
  .section-card {
    padding-right: 15px;
    padding-left: 15px;
  }

  .hero h1 {
    font-size: 2.05rem;
  }

  .answer-mini strong {
    font-size: 1.08rem;
  }

  .schedule-head {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
