/* BondCare Phase 1-A — Shared components
   共通カード・ボタン・入力・下部ナビ・タブ・チップ・タイムライン */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--bc-tap);
  padding: 13px 18px;
  border-radius: var(--bc-r-pill);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn--primary {
  background: var(--bc-navy-900);
  color: var(--bc-white);
  box-shadow: var(--bc-shadow-sm);
}
.btn--primary:active {
  background: var(--bc-navy-800);
}

.btn--secondary {
  background: var(--bc-white);
  color: var(--bc-navy-900);
  border-color: var(--bc-navy-900);
}
.btn--secondary:active {
  background: var(--bc-bg);
}

.btn--ghost {
  background: transparent;
  color: var(--bc-navy-800);
  border-color: var(--bc-border);
}

.btn--gold {
  background: var(--bc-gold-500);
  color: var(--bc-white);
}

.btn-row {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

/* text link row (画像①の下部リンク) */
.bc-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--bc-tap);
  padding: 10px 2px;
  color: var(--bc-navy-800);
  font-size: 14px;
  border-bottom: 1px solid var(--bc-border-soft);
}
.bc-link-row:last-child {
  border-bottom: none;
}
.bc-link-row__left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bc-link-row__chev {
  color: var(--bc-muted-2);
}

/* ---------- Cards ---------- */
.card {
  background: var(--bc-card);
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-r-md);
  box-shadow: var(--bc-shadow-sm);
  padding: 16px;
}

.card--tint {
  background: var(--bc-card-tint);
}

.card--flat {
  box-shadow: none;
}

.card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--bc-navy-800);
}

.card__title .ic {
  color: var(--bc-navy-700);
}

/* Hero action card — 施術後の記録をはじめる (画像⑥) */
.hero-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bc-navy-900);
  color: var(--bc-white);
  border-radius: var(--bc-r-lg);
  padding: 20px;
  box-shadow: var(--bc-shadow-md);
  position: relative;
  overflow: hidden;
}
.hero-card__ring {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1.5px solid rgba(230, 211, 164, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bc-gold-300);
}
.hero-card__body {
  flex: 1;
}
.hero-card__title {
  font-family: var(--bc-font-mincho);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.hero-card__sub {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 4px;
  line-height: 1.6;
}
.hero-card__subxs {
  font-size: 11.5px;
  color: rgba(230, 211, 164, 0.85);
  margin-top: 3px;
}
.hero-card__chev {
  color: rgba(230, 211, 164, 0.8);
}

/* metric mini cards (画像⑥下段) */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.metric {
  background: var(--bc-card);
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-r-md);
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--bc-shadow-sm);
}
.metric .ic {
  color: var(--bc-navy-700);
}
.metric__label {
  font-size: 11.5px;
  color: var(--bc-muted);
  margin-top: 6px;
}
.metric__value {
  font-family: var(--bc-font-mincho);
  font-size: 20px;
  color: var(--bc-navy-900);
  font-weight: 600;
}
.metric__value small {
  font-size: 12px;
  margin-left: 2px;
}

/* two-column card row */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* list rows inside cards */
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bc-border-soft);
}
.list-row:last-child {
  border-bottom: none;
}
.list-row__time {
  font-variant-numeric: tabular-nums;
  color: var(--bc-navy-800);
  font-weight: 600;
  font-size: 14px;
  min-width: 46px;
}
.list-row__main {
  flex: 1;
}
.list-row__name {
  font-size: 14.5px;
  color: var(--bc-text);
}
.list-row__meta {
  font-size: 12px;
  color: var(--bc-warning);
  margin-top: 2px;
}
.list-row--stack {
  align-items: flex-start;
}
.list-row--link {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--bc-border-soft);
  gap: 8px;
}
.list-row--link:last-child {
  border-bottom: none;
}
.list-row--link .list-row__chev {
  align-self: center;
  color: var(--bc-muted-2);
}
/* ホーム要フォロー: 前回、先生が伝えた一言（1行・省略） */
.list-row__msg {
  font-family: var(--bc-font-mincho);
  font-size: 11.5px;
  color: var(--bc-muted);
  margin-top: 4px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-row__chev {
  color: var(--bc-muted-2);
}

.card__foot-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--bc-border-soft);
  color: var(--bc-navy-800);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--bc-r-pill);
  font-size: 12.5px;
  border: 1px solid var(--bc-border);
  color: var(--bc-text-2);
  background: var(--bc-white);
}
.chip--active {
  background: var(--bc-navy-900);
  color: var(--bc-white);
  border-color: var(--bc-navy-900);
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--bc-r-pill);
  font-size: 12px;
  font-weight: 700;
  background: var(--bc-gold-300);
  color: var(--bc-navy-900);
}
.dot-flag {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bc-warning);
  display: inline-block;
}

/* ---------- Inputs ---------- */
.field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 16px;
  background: var(--bc-white);
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-r-md);
  margin-bottom: 12px;
  box-shadow: var(--bc-shadow-sm);
}
.field:focus-within {
  border-color: var(--bc-navy-600);
}
.field .ic {
  color: var(--bc-navy-700);
  flex: 0 0 auto;
}
.field input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--bc-text);
  min-width: 0;
}
.field input::placeholder {
  color: var(--bc-muted-2);
}
.field__toggle {
  background: none;
  border: none;
  color: var(--bc-muted);
  display: inline-flex;
  padding: 6px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--bc-tap);
  color: var(--bc-text-2);
  font-size: 14px;
}
.check-box {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--bc-border);
  border-radius: 6px;
  flex: 0 0 auto;
}

/* selectable option cards (画像②⑤) */
.option {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 0 16px;
  background: var(--bc-white);
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-r-md);
  margin-bottom: 12px;
  box-shadow: var(--bc-shadow-sm);
  width: 100%;
  text-align: left;
  color: var(--bc-text);
  font-size: 15px;
}
.option .ic {
  color: var(--bc-navy-700);
}
.option__chev {
  margin-left: auto;
  color: var(--bc-muted-2);
}
.option--selected {
  border-color: var(--bc-navy-800);
  box-shadow: 0 0 0 1px var(--bc-navy-800), var(--bc-shadow-sm);
}

/* ---------- Bottom nav ---------- */
.app-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  width: 100%;
  max-width: var(--bc-shell-max);
  height: var(--bc-nav-h);
  background: var(--bc-white);
  border-top: 1px solid var(--bc-border-soft);
  box-shadow: var(--bc-shadow-nav);
  display: flex;
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom);
}
.app-nav__item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--bc-muted);
  font-size: 12px;
  font-weight: 500;
  min-height: var(--bc-tap);
  padding-top: 6px;
  background: none;
  border: none;
}
.app-nav__item .ic {
  width: 25px;
  height: 25px;
}
.app-nav__ic {
  position: relative;
  display: inline-flex;
}
/* 角丸の件数バッジ（シルバー／赤） */
.nav-badge {
  position: absolute;
  top: -7px;
  right: -12px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.nav-badge--silver {
  background: #dfe3ea;
  color: #5f6b7e;
}
.nav-badge--red {
  background: var(--bc-danger);
  color: #fff;
}
.app-nav__item--active {
  color: var(--bc-navy-900);
  font-weight: 600;
}
.app-nav__item--active .ic {
  color: var(--bc-navy-900);
}
/* 履歴はシルバー表記 */
.app-nav__item--silver,
.app-nav__item--silver .ic {
  color: #aab2c0;
}
/* お知らせ（ベル）: 通常はシルバー、知らせがあれば赤 */
.app-nav__item--bell .ic {
  color: #aab2c0;
}
.app-nav__item--alert .ic {
  color: var(--bc-danger);
}
/* 選択状態の小さなゴールドアクセント（上部の短いバー） */
.app-nav__item--active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--bc-gold-500);
}

/* ---------- Tabs (patient detail: 4 main) ---------- */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bc-bg);
  border: 1px solid var(--bc-border-soft);
  border-radius: var(--bc-r-pill);
  padding: 4px;
  margin: 4px 0 16px;
}
.tabs__item {
  flex: 1;
  min-height: 38px;
  border: none;
  background: transparent;
  border-radius: var(--bc-r-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--bc-muted);
}
.tabs__item--active {
  background: var(--bc-navy-900);
  color: var(--bc-white);
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 22px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: var(--bc-border);
}
.tl-item {
  position: relative;
  padding: 0 0 18px 0;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bc-white);
  border: 2px solid var(--bc-gold-500);
}
.tl-item__date {
  font-size: 12px;
  color: var(--bc-muted);
}
.tl-item__title {
  font-size: 14.5px;
  color: var(--bc-text);
  margin-top: 2px;
}
.tl-item__sub {
  font-size: 12.5px;
  color: var(--bc-muted);
  margin-top: 2px;
}
/* フォロータブ: 送信済みメッセージ（先生の言葉の記録） */
.sent-msg {
  font-family: var(--bc-font-mincho);
  font-size: 14px;
  line-height: 1.85;
  color: var(--bc-navy-900);
  margin-top: 5px;
  background: var(--bc-card-tint);
  border: 1px solid var(--bc-border-soft);
  border-left: 3px solid var(--bc-gold-300);
  border-radius: var(--bc-r-sm);
  padding: 12px 14px;
}

/* ---------- Chart / record fields ---------- */
.kv {
  padding: 12px 0;
  border-bottom: 1px solid var(--bc-border-soft);
}
.kv:last-child {
  border-bottom: none;
}
.kv__label {
  font-size: 12px;
  color: var(--bc-navy-700);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.kv__value {
  font-size: 14.5px;
  color: var(--bc-text);
  margin-top: 4px;
  line-height: 1.75;
}

/* progress bar (setup) */
.progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 20px;
}
.progress__track {
  flex: 1;
  height: 6px;
  border-radius: var(--bc-r-pill);
  background: var(--bc-border);
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  background: var(--bc-navy-800);
  border-radius: var(--bc-r-pill);
}
.progress__label {
  font-size: 12.5px;
  color: var(--bc-navy-800);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* small footnote / consent */
.footnote {
  font-size: 11.5px;
  color: var(--bc-muted);
  line-height: 1.7;
}

/* safe area helper strip like 画像① bottom */
.safe-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--bc-muted);
  font-size: 12px;
  margin-top: 18px;
}
.safe-note .ic {
  color: var(--bc-gold-500);
}
