:root {
  color-scheme: light;
  --bg: #fbf7ef;
  --card: rgba(255, 255, 255, 0.88);
  --ink: #27332d;
  --muted: #6f7f74;
  --brand: #7fb99b;
  --brand-deep: #3e8064;
  --brand-2: #ead8b8;
  --warm: #f6ead9;
  --ok: #22a06b;
  --danger: #c65b4b;
  --line: rgba(72, 105, 84, 0.16);
  --shadow: 0 24px 70px rgba(79, 101, 84, .14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 92px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, #e1f0dc 0, transparent 32%),
    radial-gradient(circle at 90% 8%, #f2dfbd 0, transparent 26%),
    linear-gradient(160deg, #fbf7ef 0%, #f7f2e8 48%, #fefefe 100%);
}

body.is-in-tour { padding-bottom: 20px; }
body.is-in-tour .bottom-nav { display: none; }

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: min(960px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 34px;
}

.hero { text-align: center; margin-bottom: 18px; }
.eyebrow { margin: 0 0 6px; color: var(--brand-deep); font-weight: 850; letter-spacing: .08em; font-size: 12px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(38px, 12vw, 72px); letter-spacing: .02em; }
h2 { margin-bottom: 10px; }
h3 { margin: 18px 0 10px; font-size: 15px; color: var(--muted); }
.lead { max-width: 620px; margin: 0 auto; color: var(--muted); line-height: 1.8; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: clamp(18px, 4vw, 34px);
  margin-bottom: 14px;
}

.screen { display: none; }
.screen.is-active { display: block; }
.hidden { display: none !important; }

.home-card { display: grid; gap: 14px; }
.search-box {
  display: grid;
  gap: 7px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
}
.search-box span { color: var(--muted); font-weight: 800; font-size: 12px; }
.search-box input { border: 0; outline: 0; font-size: 17px; color: var(--ink); background: transparent; }

.section-head,
.quick-actions,
.tour-header,
.actions,
.timer-card,
.last-care {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.quick-actions { flex-wrap: wrap; }
.mini-note { color: var(--muted); font-weight: 800; font-size: 13px; }

.category-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scrollbar-width: none;
}
.category-list::-webkit-scrollbar { display: none; }
.category-pill,
.ghost-pill,
.selected-chip,
.additional-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(255,255,255,.86);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  font-weight: 800;
}
.category-pill.is-active,
.selected-chip,
.additional-chip.is-selected {
  color: var(--brand-deep);
  background: #edf7f0;
  border-color: rgba(127, 185, 155, .54);
}

.selected-strip {
  display: flex;
  min-height: 42px;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.empty-selected, .empty-state { color: var(--muted); font-size: 14px; line-height: 1.7; }

.concern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.concern-card,
.search-card,
.history-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.concern-card:hover,
.concern-card:focus-visible,
.search-card:hover,
.search-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(127, 185, 155, .72);
  box-shadow: 0 14px 28px rgba(73, 128, 96, .14);
  outline: none;
}
.concern-card.is-selected { background: #edf7f0; border-color: rgba(62, 128, 100, .62); }
.concern-card strong, .search-card strong, .history-card strong { display: block; font-size: 17px; margin-bottom: 6px; }
.concern-card span, .search-card span, .history-card span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.search-results { display: grid; gap: 10px; }
.search-card.is-point { cursor: default; background: #fffaf4; }
.medical-note, .tour-tip { color: var(--muted); line-height: 1.7; font-size: 14px; }

.ghost-button,
.secondary-button,
.primary-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 850;
}
.ghost-button { background: transparent; color: var(--muted); }
.primary-button { color: white; background: linear-gradient(135deg, var(--brand-deep), var(--brand)); box-shadow: 0 12px 24px rgba(64, 128, 100, .24); }
.primary-button:disabled { opacity: .48; cursor: not-allowed; box-shadow: none; }
.secondary-button { color: var(--brand-deep); background: #edf7f0; }
.secondary-button:disabled { color: #9eb2a6; background: #f2f5f1; cursor: not-allowed; }
.step-label { color: var(--muted); font-weight: 850; }

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #eef2eb;
  overflow: hidden;
  margin: 12px 0 18px;
}
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--brand-deep), var(--brand)); transition: width .2s ease; }

.tour-copy { text-align: center; margin: 18px auto 8px; }
.tour-copy h2 { font-size: clamp(30px, 8vw, 52px); margin-bottom: 8px; }
.tour-copy p:last-child { color: var(--muted); line-height: 1.7; }

.body-stage {
  position: relative;
  width: min(430px, 100%);
  margin: 0 auto 14px;
  aspect-ratio: 360 / 520;
}
.body-illustration { width: 100%; height: 100%; display: block; }
.visual-label {
  position: absolute;
  left: 18px;
  top: 14px;
  z-index: 2;
  margin: 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 850;
  backdrop-filter: blur(8px);
}
.body-stage.visual-foot .hotspot .dot,
.body-stage.visual-leg .hotspot .dot { background: #7b8fca; box-shadow: 0 0 0 6px rgba(123, 143, 202, .18), 0 0 24px rgba(123, 143, 202, .62); }
.body-stage.visual-foot .hotspot .ring,
.body-stage.visual-leg .hotspot .ring { border-color: rgba(123, 143, 202, .7); }
.body-stage.visual-forearm .hotspot .dot { background: #c48b5f; box-shadow: 0 0 0 6px rgba(196, 139, 95, .18), 0 0 24px rgba(196, 139, 95, .62); }
.body-stage.visual-forearm .hotspot .ring { border-color: rgba(196, 139, 95, .7); }
.hotspot {
  --x: 48%; --y: 56%; position: absolute; left: var(--x); top: var(--y);
  width: 86px; height: 86px; border: 0; background: transparent;
  transform: translate(-50%, -50%); cursor: pointer;
}
.hotspot .dot, .hotspot .ring { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); border-radius: 50%; }
.hotspot .dot { width: 18px; height: 18px; background: var(--brand-deep); box-shadow: 0 0 0 6px rgba(62, 128, 100, .18), 0 0 24px rgba(62, 128, 100, .62); z-index: 3; }
.hotspot .ring { width: 26px; height: 26px; border: 3px solid rgba(62, 128, 100, .68); animation: pulse 1.8s ease-out infinite; }
.hotspot .ring-two { animation-delay: .55s; }
.hotspot.is-done .dot { background: var(--ok); box-shadow: 0 0 0 6px rgba(34, 160, 107, .18), 0 0 24px rgba(34, 160, 107, .55); }
.hotspot.is-done .ring { border-color: rgba(34, 160, 107, .7); }
@keyframes pulse { 0% { width: 24px; height: 24px; opacity: .95; } 100% { width: 86px; height: 86px; opacity: 0; } }

.detail-card, .timer-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 14px 16px;
  margin: 0 auto 14px;
  max-width: 560px;
}
.detail-toggle { width: 100%; border: 0; background: transparent; color: var(--brand-deep); font-weight: 850; cursor: pointer; }
.detail-panel { color: var(--muted); font-size: 14px; line-height: 1.7; padding-top: 12px; }
.detail-panel dl { margin: 0; display: grid; gap: 9px; }
.detail-panel dt { color: var(--ink); font-weight: 850; }
.detail-panel dd { margin: 0; }
.timer-label { color: var(--muted); margin-bottom: 0; font-size: 13px; }
#timer-display { font-size: 42px; line-height: 1; }
.strength { display: grid; gap: 4px; color: var(--muted); text-align: right; }
.strength b { color: var(--ink); font-size: 20px; }
.actions { justify-content: center; flex-wrap: wrap; }
.sticky-actions { position: sticky; bottom: 12px; z-index: 10; padding: 8px; background: rgba(251, 247, 239, .72); backdrop-filter: blur(10px); border-radius: 999px; }
.additional-points { max-width: 560px; margin: 14px auto 0; }
.additional-title { color: var(--muted); font-weight: 850; margin-bottom: 8px; }
.additional-title span { display: block; margin-top: 3px; font-size: 12px; font-weight: 700; color: #91a197; }
.additional-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.additional-chip small { color: var(--muted); margin-left: 4px; }
.additional-chip:disabled { cursor: default; opacity: .88; }

.complete { text-align: center; }
.complete-mark {
  width: 78px; height: 78px; display: grid; place-items: center; margin: 0 auto 18px;
  border-radius: 50%; background: #eafaf2; color: var(--ok); font-size: 42px; font-weight: 900;
}
.rating-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 16px; margin: 18px 0; }
.rating-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rating-button { border: 1px solid var(--line); border-radius: 16px; background: #fffaf4; padding: 12px 8px; cursor: pointer; font-weight: 850; }
.rating-button.is-selected { background: #edf7f0; border-color: var(--brand); color: var(--brand-deep); }

.history-list { display: grid; gap: 10px; }
.history-card { cursor: default; }
.history-card p { color: var(--ink); margin: 8px 0; line-height: 1.6; }
.history-card small { color: var(--brand-deep); font-weight: 800; }
.last-care { align-items: flex-end; }
.last-care p { color: var(--muted); line-height: 1.7; margin-bottom: 0; }

.bottom-nav {
  position: fixed;
  left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(420px, calc(100% - 28px));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  background: rgba(255,255,255,.86);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 18px 40px rgba(61, 79, 66, .18);
  backdrop-filter: blur(14px);
  z-index: 20;
}
.nav-button { border: 0; border-radius: 999px; padding: 11px 8px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 850; }
.nav-button.is-active { color: white; background: var(--brand-deep); }

@media (max-width: 560px) {
  .app-shell { width: min(100% - 20px, 480px); padding-top: 18px; }
  .card { border-radius: 24px; }
  .hero { text-align: left; padding: 0 6px; }
  .section-head { align-items: flex-start; }
  .concern-grid { grid-template-columns: 1fr; }
  .timer-card { align-items: flex-start; }
  .actions .primary-button, .actions .secondary-button { flex: 1 1 auto; min-width: 30%; padding-inline: 12px; }
  .sticky-actions { border-radius: 24px; }
  .rating-actions { grid-template-columns: 1fr; }
  .last-care { align-items: stretch; flex-direction: column; }
}
