:root {
  --ink: #111718;
  --text: #485250;
  --muted: #7e8884;
  --paper: #f7f5f0;
  --soft: #fbfaf7;
  --white: #ffffff;
  --mist: #e7ede9;
  --sage: #708278;
  --line: rgba(17, 23, 24, 0.14);
  --line-soft: rgba(17, 23, 24, 0.08);
  --shadow: 0 24px 80px rgba(17, 23, 24, 0.08);
  font-family:
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP",
    system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

a { color: inherit; text-decoration: none; touch-action: manipulation; }
button, input, select, textarea { font: inherit; }
button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: 0; }
h1 { margin-bottom: 14px; font-size: clamp(34px, 4.6vw, 64px); line-height: 1.12; }
h2 { margin-bottom: 18px; font-size: clamp(26px, 3vw, 42px); line-height: 1.18; }
h3 { margin-bottom: 8px; font-size: 15px; line-height: 1.45; }
p { color: var(--text); font-size: 14px; line-height: 1.85; }

.header {
  min-height: 78px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 0 clamp(22px, 4vw, 56px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: baseline;
  font-size: 18px;
  font-weight: 900;
}

.brand small,
.label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  gap: 24px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.page {
  min-height: calc(100svh - 78px);
  padding: clamp(38px, 6vw, 76px) clamp(20px, 5vw, 80px);
}

.container {
  width: min(100%, 1160px);
  margin: 0 auto;
  display: grid;
  gap: clamp(28px, 4vw, 48px);
}

.lead {
  max-width: 680px;
  margin-bottom: 0;
  font-size: 15px;
}

.flow {
  display: grid;
  gap: 16px;
  padding: 22px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.flow-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.flow-step::after {
  content: "";
  position: absolute;
  top: 17px;
  left: calc(50% + 20px);
  width: calc(100% - 40px);
  height: 2px;
  background: rgba(112, 130, 120, 0.26);
}

.flow-step:last-child::after { display: none; }

.flow-dot {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(112, 130, 120, 0.34);
  border-radius: 999px;
  background: var(--paper);
  color: var(--sage);
  font-size: 13px;
  font-weight: 950;
}

.flow-step.active .flow-dot {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.flow-step h3 { margin: 0; font-size: 14px; }
.flow-step p { max-width: 230px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
  gap: clamp(28px, 5vw, 62px);
  align-items: stretch;
}

.panel-body { padding: clamp(24px, 4vw, 38px); }

.form {
  display: grid;
  gap: 16px;
}

.signup-card {
  width: min(100%, 560px);
}

.signup-body .container {
  max-width: 760px;
}

.signup-body h1 {
  font-size: clamp(38px, 5vw, 56px);
}

.signup-stack {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label,
.choice-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

textarea {
  min-height: 108px;
  padding-top: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(112, 130, 120, 0.12);
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.button.dark {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.button.block { width: 100%; }

.status {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(231, 237, 233, 0.7);
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
}

.status[data-tone="error"] {
  border-color: rgba(156, 57, 57, 0.26);
  background: rgba(156, 57, 57, 0.08);
  color: #8a2929;
}

.status[data-tone="success"] {
  border-color: rgba(63, 124, 91, 0.28);
  background: rgba(63, 124, 91, 0.1);
  color: #2f6548;
}

.member-status {
  margin: 0 0 18px;
}

.split-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-card {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
}

.choice-card input { display: none; }
.choice-card span { font-size: 13px; font-weight: 900; }
.choice-card small { color: var(--muted); font-size: 11px; font-weight: 800; }
.choice-card:has(input:checked) { border-color: rgba(112, 130, 120, 0.44); background: var(--mist); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.assessment-panel .panel-body {
  display: grid;
  gap: 34px;
}

.assessment-section {
  display: grid;
  gap: 14px;
}

.assessment-step[hidden] {
  display: none !important;
}

.assessment-panel {
  width: min(100%, 860px);
}

.concern-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.concern-detail-list {
  display: grid;
  gap: 14px;
}

.concern-detail-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(247, 245, 240, 0.58);
}

.concern-detail-card h3 {
  font-size: 18px;
}

.detail-multi-field {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 0;
  border: 0;
}

.detail-multi-field legend {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.detail-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-check-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
}

.detail-check-card:has(input:checked) {
  border-color: rgba(112, 130, 120, 0.46);
  background: var(--mist);
}

.detail-check-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.detail-check-main input {
  width: 15px;
  height: 15px;
  accent-color: var(--ink);
}

.detail-check-main strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
}

.detail-frequency {
  display: grid;
  gap: 4px;
}

.detail-frequency small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.detail-frequency select {
  min-height: 36px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 999px;
}

.detail-frequency select:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.health-input-group {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(247, 245, 240, 0.58);
}

.health-input-group h3 {
  margin-bottom: 0;
  font-size: 18px;
}

.summary-card {
  min-height: 108px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.summary-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.step-actions {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
}

.member-body {
  background: var(--paper);
}

.member-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}

.member-sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(247, 245, 240, 0.86);
  backdrop-filter: blur(18px);
}

.member-nav {
  display: grid;
  gap: 4px;
  margin-top: 38px;
}

.member-nav a {
  display: flex;
  align-items: center;
  min-height: 39px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
  font-weight: 780;
}

.member-nav a.active {
  background: var(--ink);
  color: var(--white);
}

.member-view[hidden] {
  display: none !important;
}

.member-note,
.dashboard-card,
.dashboard-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 60px rgba(17, 23, 24, 0.06);
}

.member-note {
  padding: 18px;
}

.member-main {
  padding: 22px clamp(20px, 3.4vw, 44px) 64px;
}

.member-container {
  max-width: 1360px;
  margin: 0 auto;
}

.member-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.section-title h2,
.section-title h3 {
  margin-bottom: 0;
}

.dashboard-overview {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(260px, 0.88fr) minmax(320px, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.progress-overview {
  display: grid;
  grid-template-columns: minmax(480px, 1.35fr) minmax(320px, 0.82fr);
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-work {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(460px, 1.18fr);
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-bottom {
  display: grid;
  grid-template-columns: minmax(360px, 0.84fr) minmax(520px, 1.16fr);
  gap: 14px;
}

.dashboard-card,
.dashboard-panel {
  padding: 20px;
}

.profile-dashboard-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
  align-items: center;
  min-height: 184px;
}

.assessment-dashboard-card,
.state-dashboard-card {
  min-height: 184px;
}

.assessment-dashboard-card p,
.state-dashboard-card p {
  margin-bottom: 12px;
}

.mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.mini-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(247, 245, 240, 0.78);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.avatar-large {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--mist);
  color: var(--sage);
  font-size: 22px;
  font-weight: 950;
}

.avatar-large img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.state-list,
.care-list,
.article-list,
.memo-list {
  display: grid;
  gap: 0;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.article-list {
  gap: 12px;
  border-top: 0;
}

.recommend-card {
  position: relative;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(247, 245, 240, 0.66);
}

.recommend-card-link {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
}

.clickable-card {
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.recommend-card:has(.clickable-card:hover),
.recommend-card:has(.clickable-card:focus-visible),
.clickable-card:hover,
.clickable-card:focus-visible {
  border-color: rgba(112, 130, 120, 0.62);
  box-shadow: 0 16px 46px rgba(17, 23, 24, 0.1);
  outline: 0;
  transform: translateY(-1px);
}

.recommend-card-link:focus-visible {
  border-radius: 10px;
  outline: 2px solid rgba(112, 130, 120, 0.5);
  outline-offset: 4px;
}

.recommend-image {
  display: block;
  min-height: 118px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--mist);
}

.recommend-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.recommend-body {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
}

.recommend-title {
  display: block;
  margin-bottom: 0;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.48;
}

.recommend-excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.save-button {
  justify-self: start;
  position: relative;
  z-index: 2;
  min-height: 34px;
  padding: 0 12px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  touch-action: manipulation;
}

.save-button.saved {
  border-color: var(--sage);
  background: var(--mist);
  color: var(--ink);
}

.save-button:disabled {
  opacity: 0.68;
  cursor: wait;
}

.state-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
}

.care-row,
.article-row,
.memo-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
}

.state-row,
.care-row,
.article-row,
.memo-row {
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-align: left;
}

.state-row:hover,
.care-row:hover,
.article-row:hover,
.memo-row:hover {
  color: var(--ink);
}

.state-row:hover .good,
.care-row:hover h3,
.memo-row:hover h3 {
  color: var(--sage);
}

.state-row h3,
.care-row h3,
.article-row h3,
.memo-row h3 {
  margin-bottom: 3px;
}

.check {
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.check.done {
  border-color: var(--sage);
  background: var(--sage);
}

.good {
  color: var(--sage);
  font-weight: 900;
}

.time,
.pill {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.pill.as-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.chart {
  height: 88px;
  position: relative;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(112, 130, 120, 0.1), rgba(112, 130, 120, 0.03)),
    repeating-linear-gradient(90deg, transparent 0 13.8%, rgba(17, 23, 24, 0.05) 14% 14.2%);
}

.chart svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.week-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.week-stats div {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.8);
}

.metric {
  display: block;
  margin-top: 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 2.4vw, 24px);
}

.training-progress-card {
  display: grid;
  align-content: start;
}

.training-progress-summary {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(247, 245, 240, 0.64);
}

.training-progress-summary h3 {
  margin-bottom: 6px;
  font-size: 18px;
}

.training-progress-summary p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.7;
}

.progress-ring {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, var(--white) 0 54%, transparent 56%),
    conic-gradient(var(--sage) var(--progress), rgba(17, 23, 24, 0.08) 0);
}

.progress-ring strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1;
}

.progress-timeline {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.progress-step {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  position: relative;
}

.progress-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 24px;
  bottom: -12px;
  width: 1px;
  background: var(--line);
}

.progress-step > span {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.progress-step.active > span {
  border-color: var(--sage);
  background: var(--sage);
}

.progress-step h3 {
  margin-bottom: 3px;
  font-size: 15px;
}

.progress-step p {
  margin-bottom: 0;
  font-size: 12px;
  line-height: 1.7;
}

.plan-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.plan {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(247, 245, 240, 0.66);
}

.map-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.map-tabs .button {
  width: auto;
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
}

.map-card {
  min-height: 236px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--mist);
}

.map-card iframe {
  width: 100%;
  height: 100%;
  min-height: 236px;
  display: block;
  border: 0;
  filter: saturate(0.72) contrast(0.94) brightness(1.03);
}

.place-list {
  display: grid;
  gap: 0;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.place-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
}

.place-row:hover,
.place-row:focus-visible {
  background: rgba(233, 239, 235, 0.5);
  outline: 0;
}

.bar {
  height: 7px;
  overflow: hidden;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(17, 23, 24, 0.08);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--sage);
}

.record-primary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
}

.record-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.record {
  min-height: 74px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(247, 245, 240, 0.7);
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  text-align: left;
}

.record small {
  display: block;
  margin-bottom: 4px;
  color: var(--sage);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 900;
  letter-spacing: 0;
}

.record b {
  align-self: center;
  max-width: 128px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
}

.record b.done {
  border-color: rgba(112, 130, 120, 0.32);
  background: rgba(226, 236, 230, 0.72);
  color: var(--ink);
}

.record em {
  grid-column: 1 / -1;
  margin-top: -2px;
  color: var(--text);
  font-size: 12px;
  font-style: normal;
  line-height: 1.55;
  font-weight: 760;
}

.record-section {
  margin-top: 18px;
}

.record-section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  padding-top: 2px;
}

.record-section-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.concern-record-grid {
  grid-template-columns: 1fr;
}

.concern-record {
  min-height: 92px;
}

.compact-status {
  margin: 12px 0 0;
  padding: 10px 12px;
}

.record-panel {
  min-height: 276px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
}

.records-view {
  min-height: auto;
}

.record-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.record-summary-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 174px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(247, 245, 240, 0.62);
}

.record-summary-card h3 {
  margin: 0;
  font-size: 26px;
}

.record-summary-card p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.75;
}

.record-collapsed-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.record-collapsed-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.record-collapsed-row small {
  display: block;
  margin-bottom: 4px;
  color: var(--sage);
  font-size: 11px;
  font-weight: 900;
}

.record-collapsed-row span {
  font-size: 18px;
  font-weight: 900;
}

.record-collapsed-row b {
  align-self: start;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--mist);
  color: var(--ink);
  font-size: 12px;
}

.record-collapsed-row p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
}

.home-recommend-panel .article-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feed-panel {
  min-height: 276px;
}

.dashboard-bottom-memo {
  margin-top: 14px;
}

.saved-library-panel {
  margin: 14px 0;
}

.saved-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(247, 245, 240, 0.74);
}

.saved-tabs button {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.saved-tabs button.active {
  background: var(--ink);
  color: var(--white);
}

.saved-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.saved-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(247, 245, 240, 0.66);
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.saved-item:hover,
.saved-item:focus-visible {
  border-color: rgba(112, 130, 120, 0.62);
  box-shadow: 0 14px 40px rgba(17, 23, 24, 0.1);
  outline: 0;
  transform: translateY(-1px);
}

.saved-item img,
.saved-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--mist);
  object-fit: cover;
  color: var(--sage);
  font-weight: 900;
}

.saved-item h3 {
  margin-bottom: 4px;
  font-size: 14px;
  line-height: 1.45;
}

.saved-item p,
.saved-empty {
  margin-bottom: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.65;
}

.record-dialog {
  width: min(760px, calc(100vw - 36px));
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
}

.record-dialog::backdrop {
  background: rgba(17, 23, 24, 0.34);
  backdrop-filter: blur(6px);
}

.record-modal {
  position: relative;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 90px rgba(17, 23, 24, 0.2);
}

.record-modal h2 {
  margin-top: 6px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

.record-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.record-modal-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.record-modal > .record-modal-section:first-of-type {
  margin-top: 18px;
}

.record-modal-section h3 {
  margin: 4px 0 0;
  font-size: 18px;
}

.record-modal-section p {
  margin: 8px 0 0;
  max-width: 560px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.75;
}

.concern-modal-grid {
  grid-template-columns: 1fr;
}

.field {
  display: grid;
  gap: 8px;
  font-weight: 900;
}

.field span {
  color: var(--text);
  font-size: 12px;
}

.field small {
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(247, 245, 240, 0.72);
  color: var(--ink);
  font: inherit;
  font-weight: 760;
}

.field textarea {
  padding: 12px 14px;
  resize: vertical;
}

.field-wide {
  grid-column: 1 / -1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.chat-launcher {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: end;
}

.chat-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.chat-pop {
  width: min(360px, calc(100vw - 104px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 22px 80px rgba(17, 23, 24, 0.16);
  backdrop-filter: blur(18px);
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.chat-toggle:checked ~ .chat-pop {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.chat-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.chat-pop-head h3 {
  margin-bottom: 0;
}

.chat-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

.chat-box {
  display: grid;
  gap: 10px;
  max-height: 260px;
  margin-top: 14px;
  overflow: auto;
}

.chat-message {
  max-width: 92%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(247, 245, 240, 0.72);
}

.chat-message p {
  margin-bottom: 0;
}

.chat-message.user {
  justify-self: end;
  background: var(--ink);
  color: var(--white);
}

.chat-message.user p {
  color: rgba(255, 255, 255, 0.78);
}

.chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
}

.chat-input span {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 760;
}

.chat-input .button {
  width: auto;
}

.chat-fab {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 18px 48px rgba(17, 23, 24, 0.18);
  cursor: pointer;
}

.chat-fab svg {
  width: 25px;
  height: 25px;
  display: block;
}

.button.full {
  width: 100%;
  margin-top: 16px;
}

.button.ghost {
  background: transparent;
}

@media (max-width: 840px) {
  .header,
  .auth-layout,
  .summary-grid,
  .form-grid,
  .member-shell,
  .member-topbar,
  .dashboard-overview,
  .progress-overview,
  .dashboard-work,
  .dashboard-bottom {
    grid-template-columns: 1fr;
  }

  .member-sidebar {
    position: static;
    z-index: auto;
    height: auto;
    padding: 18px 22px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .member-main {
    position: relative;
    z-index: 1;
  }

  .member-nav {
    grid-template-columns: repeat(4, max-content);
    overflow-x: auto;
    margin-top: 18px;
  }

  .member-note {
    display: none;
  }

  .header {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .nav {
    gap: 16px;
    overflow-x: auto;
    font-size: 12px;
  }

  .flow-track {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .flow-step {
    grid-template-columns: 34px 1fr;
    justify-items: start;
    gap: 12px;
    text-align: left;
  }

  .flow-step::after {
    top: 38px;
    left: 16px;
    width: 2px;
    height: calc(100% - 18px);
  }

  .flow-step p {
    grid-column: 2;
    max-width: none;
  }

  .dashboard-work,
  .dashboard-bottom {
    grid-template-columns: 1fr;
  }

  .record-summary-grid {
    grid-template-columns: 1fr;
  }

  .home-recommend-panel .article-list {
    grid-template-columns: 1fr;
  }

  .saved-list {
    grid-template-columns: 1fr 1fr;
  }

  .map-card,
  .map-card iframe {
    min-height: 220px;
  }

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

  .detail-check-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .page { padding: 30px 18px 46px; }
  .header { min-height: 70px; padding-inline: 18px; }
  .brand { font-size: 16px; }
  .nav { display: none; }
  h1 { font-size: 34px; }
  .training-progress-summary {
    grid-template-columns: 1fr;
  }

  .progress-ring {
    width: 76px;
    height: 76px;
  }
  h2 { font-size: 28px; }
  .panel-body { padding: 22px 18px; }
  .concern-grid { grid-template-columns: 1fr; }
  .detail-check-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .detail-frequency select {
    width: 100%;
  }
  .button { width: 100%; }
  .assessment-panel .panel-body { gap: 28px; }
  .concern-detail-card { padding: 18px; }
  .member-main { padding: 18px 14px calc(120px + env(safe-area-inset-bottom)); }

  .member-nav a,
  .state-row,
  .care-row,
  .memo-row,
  .record-collapsed-row,
  .place-row,
  .saved-item,
  .recommend-card-link,
  .save-button,
  .map-tabs .button,
  [data-saved-tab] {
    min-height: 44px;
  }

  .map-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .profile-dashboard-card,
  .state-row,
  .care-row,
  .article-row,
  .memo-row,
  .record-primary {
    grid-template-columns: 1fr;
  }

  .recommend-card {
    padding: 10px;
  }

  .recommend-card-link {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
  }

  .recommend-image {
    min-height: 96px;
  }

  .save-button {
    min-height: 44px;
    min-width: 76px;
    margin-top: 10px;
    padding-inline: 16px;
    font-size: 12px;
  }
  .record-grid,
  .record-modal-grid,
  .week-stats {
    grid-template-columns: 1fr 1fr;
  }

  .concern-record-grid,
  .concern-modal-grid {
    grid-template-columns: 1fr;
  }

  .saved-list {
    grid-template-columns: 1fr;
  }

  .saved-item {
    grid-template-columns: 68px minmax(0, 1fr) auto;
  }

  .saved-item img,
  .saved-icon {
    width: 68px;
    height: 68px;
  }

  .record-modal {
    padding: 22px 18px;
  }

  .record-modal-grid {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .chat-launcher {
    right: 18px;
    bottom: 18px;
  }

  .chat-pop {
    width: calc(100vw - 92px);
  }

  .chat-input {
    grid-template-columns: 1fr;
  }

  .chat-input .button {
    width: 100%;
  }
}
