:root {
  --green: #14b8a6;
  --green-dark: #0d9488;
  --green-light: #ecfdfa;
  --ink: #18181b;
  --ink-soft: #71717a;
  --bg: #ffffff;
  --card-bg: #fafafa;
  --border: #e4e4e7;
  --radius: 20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app-header {
  text-align: center;
  padding: 12px 0 4px;
}

.app-header h1 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}

.app-header .accent { color: var(--green); }

.subtitle {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
}

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

.card-shortcut {
  background: var(--green-light);
  border: 1px solid var(--green);
}

.card-shortcut .step-label {
  color: var(--green-dark);
}

.step-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.category-grid,
.intensity-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-button {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 2px solid var(--border);
  background: var(--bg);
  border-radius: 14px;
  padding: 14px 18px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  min-height: 56px;
}

.option-button:active { transform: scale(0.98); }

.option-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.option-button.selected .option-icon { color: var(--green-dark); }

.option-text {
  display: flex;
  flex-direction: column;
}

.option-button.selected {
  border-color: var(--green);
  background: var(--green-light);
  color: var(--green-dark);
}

.option-sublabel {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-top: 2px;
}

.option-button.selected .option-sublabel {
  color: var(--green-dark);
  opacity: 0.75;
}

.field {
  margin-bottom: 14px;
}

.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  background: var(--bg);
}

.field input:focus {
  outline: none;
  border-color: var(--green);
}

.url-row {
  display: flex;
  gap: 8px;
}

.url-row input {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
}

.fetch-button {
  appearance: none;
  border: none;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 0 18px;
  cursor: pointer;
  white-space: nowrap;
}

.fetch-button:disabled {
  background: #d7ddda;
  color: #97a19b;
  cursor: not-allowed;
}

.url-status {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 700;
}

.url-status.is-error {
  color: #d64545;
}

.url-status.is-success {
  color: var(--green-dark);
}

.calc-button {
  appearance: none;
  border: none;
  border-radius: 16px;
  background: var(--green);
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  padding: 18px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--green-dark);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.calc-button:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--green-dark);
}

.calc-button:disabled {
  background: #d7ddda;
  box-shadow: 0 4px 0 #c3cac6;
  color: #97a19b;
  cursor: not-allowed;
}

.result {
  text-align: center;
  padding: 28px 20px;
  border-radius: var(--radius);
  background: var(--green-light);
  border: 1px solid var(--green);
}

.result-label {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--green-dark);
}

.result-value {
  margin: 0 0 18px;
  font-weight: 800;
  color: var(--ink);
}

.result-value #resultKcal {
  font-size: 56px;
  line-height: 1;
}

.result-value .unit {
  font-size: 20px;
  margin-left: 4px;
  color: var(--ink-soft);
}

.again-button {
  appearance: none;
  border: 2px solid var(--green);
  background: var(--bg);
  color: var(--green-dark);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 16px;
  box-shadow: 0 2px 0 rgba(20, 184, 166, 0.25);
}

.log-card {
  margin-top: 20px;
}

.log-day {
  margin-bottom: 18px;
}

.log-day:last-child {
  margin-bottom: 0;
}

.log-day-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.log-day-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.log-day-total {
  font-size: 14px;
  font-weight: 800;
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
}

.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}

.entry-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}

.log-day .entry-row:last-child {
  border-bottom: none;
}

.entry-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--ink-soft);
}

.entry-label {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.entry-minutes-input {
  width: 44px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
  padding: 2px;
}

.entry-minutes-input:focus {
  outline: none;
  border-bottom-color: var(--green);
}

.entry-meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.entry-delete {
  appearance: none;
  border: none;
  background: none;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.entry-delete:hover {
  background: rgba(214, 69, 69, 0.12);
  color: #d64545;
}

.disclaimer {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.undo-toast {
  background: var(--green-light);
  border: 1px solid var(--green);
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 16px;
}

.undo-toast[hidden] {
  display: none;
}

.undo-toast span {
  font-size: 13px;
  font-weight: 700;
}

.undo-toast button {
  appearance: none;
  border: none;
  background: none;
  color: var(--green-dark);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

.info-section {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
}

.info-heading {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.info-text {
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.info-formula {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 12px;
  text-align: center;
}

.info-list {
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-soft);
  margin: 0;
  padding-left: 20px;
}

.info-list li {
  margin-bottom: 6px;
}

.faq-list {
  font-size: 13px;
  line-height: 1.8;
  margin: 0;
}

.faq-list dt {
  font-weight: 800;
  color: var(--ink);
  margin-top: 14px;
}

.faq-list dt::before {
  content: "Q. ";
  color: var(--green-dark);
}

.faq-list dd {
  color: var(--ink-soft);
  margin: 4px 0 0;
}

.faq-list dd::before {
  content: "A. ";
  color: var(--ink-soft);
  font-weight: 800;
}

.site-footer {
  max-width: 480px;
  margin: 24px auto 0;
  padding: 20px 20px 40px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--ink-soft);
}

.site-footer a {
  color: var(--ink-soft);
  text-decoration: underline;
}
