/* =========================================================
   デザインの決まりごと（色・文字・余白）
   モチーフ：滅菌インジケーターテープ（処理が済むと色が変わる斜線）
   ========================================================= */
:root {
  --ink: #1B2230;      /* 文字・濃い面 */
  --steel: #566070;    /* 補足の文字 */
  --pouch: #ECEFF2;    /* 背景（滅菌パウチの白） */
  --paper: #FFFFFF;    /* カード面 */
  --line: #D6DCE4;     /* 罫線 */
  --blue: #3346D3;     /* 操作・いまの段階（光重合照射器のブルー） */
  --blue-t: #E3E7FC;
  --blue-dk: #2433A8;
  --amber: #F0A93A;    /* 期限の警告にだけ使う */
  --amber-t: #FCEBCF;
  --pink-ink: #8A2B4B; /* 悩み */
  --pink-t: #F8E0E8;
  --on-dark-sub: #B9C1CF;
  --jp: 'IBM Plex Sans JP', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', sans-serif;
  --num: 'Bricolage Grotesque', 'IBM Plex Sans JP', sans-serif;
  --nav-h: 78px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--jp);
  color: var(--ink);
  background: #DCE1E7;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dk); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.num { font-family: var(--num); font-weight: 700; letter-spacing: -0.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- アプリの枠（PCでは中央にスマホ幅で表示） ---------- */
.shell {
  position: relative;
  max-width: 440px;
  min-height: 100%;
  margin: 0 auto;
  background: var(--pouch);
  box-shadow: 0 0 0 1px rgba(27, 34, 48, 0.06);
}
.screen {
  padding: 28px 20px calc(var(--nav-h) + 32px);
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: rise 0.25s ease-out;
}
.screen--sub { padding-top: 12px; }
.screen--paper { background: var(--paper); min-height: 100vh; }
.screen--with-bar { padding-bottom: 170px; }

/* ---------- 文字 ---------- */
.h1 { margin: 0; font-size: 28px; line-height: 1.3; font-weight: 700; text-wrap: pretty; }
.h1 .num { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.h2 { margin: 0; font-size: 15px; font-weight: 700; }
.sub { font-size: 13px; color: var(--steel); }
.meta { font-size: 12px; color: var(--steel); }
.section { display: flex; flex-direction: column; gap: 10px; }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section__link { font-size: 13px; font-weight: 700; background: none; border: none; color: var(--blue); padding: 8px 0; }
.header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.header__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.back {
  display: inline-flex; align-items: center; gap: 2px; height: 44px; margin-left: -6px;
  font-size: 14px; font-weight: 500; color: var(--steel); background: none; border: none; padding: 0;
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 22px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); flex-shrink: 0;
}

/* ---------- 進み具合の帯（インジケーター） ---------- */
.strip { display: flex; gap: 3px; }
.strip__seg {
  flex: 1 1 0; height: 8px; border-radius: 2px; border: 1px solid var(--line);
  background: repeating-linear-gradient(-45deg, var(--line) 0 2px, transparent 2px 4px);
}
.strip--sm .strip__seg { height: 6px; }
.strip--lg .strip__seg { height: 14px; }
.strip__seg--done { background: var(--ink); border-color: var(--ink); }
.strip__seg--now { border-color: var(--blue); background: repeating-linear-gradient(-45deg, var(--blue) 0 2px, transparent 2px 4px); }
.strip--lost .strip__seg--done { background: var(--steel); border-color: var(--steel); }
.strip--dark .strip__seg { border-color: rgba(255,255,255,.22); background: repeating-linear-gradient(-45deg, rgba(255,255,255,.22) 0 2px, transparent 2px 4px); }
.strip--dark .strip__seg--done { background: #fff; border-color: #fff; }
.strip--dark .strip__seg--now { border-color: #9AA6FF; background: repeating-linear-gradient(-45deg, #9AA6FF 0 2px, transparent 2px 4px); }
.strip--dark .strip__seg { transform-origin: left; animation: fillIn .45s calc(.15s + var(--i) * .09s) ease-out both; }

/* ---------- ラベル ---------- */
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.tag--want { color: var(--blue); background: var(--blue-t); border-radius: 4px; }
.tag--worry { color: var(--pink-ink); background: var(--pink-t); border-radius: 11px; }
.due { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.due--over, .due--today { background: var(--amber); }
.due--soon { background: var(--amber-t); }
.due--later { background: transparent; color: var(--steel); padding: 0; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.badge--ok { border: 1px solid var(--ink); padding: 1px 7px; }
.badge--check { background: var(--amber-t); }
.badge--no { color: var(--steel); border: 1px solid var(--line); padding: 1px 7px; }
.badge--won { background: var(--ink); color: #fff; border-radius: 10px; padding: 3px 10px; }
.badge--lost { color: var(--steel); border: 1px solid var(--line); border-radius: 10px; padding: 2px 10px; }

/* ---------- 次のフォロー（ホームの主役） ---------- */
.hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 18px;
  padding: 26px 20px 18px; border-radius: 22px; background: var(--ink); color: #fff;
}
.hero::before { /* 滅菌パウチの圧着部 */
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 9px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.16) 0 1px, transparent 1px 4px);
}
.hero__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hero__label { font-size: 13px; font-weight: 500; color: var(--on-dark-sub); }
.hero__title { font-size: 22px; line-height: 1.4; font-weight: 700; color: #fff; }
.hero__title:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.hero__sub { font-size: 13px; color: var(--on-dark-sub); }
.hero__state { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--on-dark-sub); }
.hero__state strong { color: #fff; }
.hero__actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }
.empty-hero {
  display: flex; flex-direction: column; gap: 14px; padding: 22px 20px;
  border-radius: 22px; border: 1.5px dashed var(--steel);
}
.empty-hero__title { font-size: 18px; font-weight: 700; line-height: 1.5; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 18px; border-radius: 14px; font-size: 14px; font-weight: 700;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); white-space: nowrap;
}
.btn:hover { color: var(--ink); border-color: var(--steel); }
.btn--lg { height: 54px; font-size: 15px; border-radius: 16px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dk); border-color: var(--blue-dk); color: #fff; }
.btn--ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--ink:hover { color: #fff; }
.btn--white { background: #fff; border-color: #fff; color: var(--ink); }
.btn--ghost-dark { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
.btn--ghost-dark:hover { border-color: #fff; color: #fff; }
.btn--danger { color: #A3262A; border-color: #E8C2C3; }
.btn--dashed { border: 1.5px dashed var(--steel); background: transparent; }
.btn[disabled] { background: var(--line); border-color: var(--line); color: var(--steel); cursor: default; }
.btn-row { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tool {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  height: 64px; border-radius: 16px; border: 1px solid var(--line); background: var(--paper);
  color: var(--ink); font-size: 12px; font-weight: 700;
}
.tool:hover { color: var(--ink); border-color: var(--steel); }
.tool--primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.tool--primary:hover { color: #fff; background: var(--blue-dk); }
.tool[aria-disabled="true"] { color: var(--line); pointer-events: none; }

/* ---------- 選択チップ・タブ ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 44px; padding: 0 15px; border-radius: 22px; font-size: 14px; font-weight: 500;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line);
}
.chip--sm { height: 40px; padding: 0 14px; border-radius: 20px; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 700; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.tab { flex: 1 1 0; height: 40px; border: none; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--steel); background: transparent; }
.tab[aria-selected="true"] { background: var(--ink); color: #fff; font-weight: 700; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--pouch); }
.seg__btn { flex: 1 1 0; height: 48px; border: none; border-radius: 12px; font-size: 15px; font-weight: 700; color: var(--steel); background: transparent; }
.seg__btn[aria-checked="true"].seg__btn--want { background: var(--blue); color: #fff; }
.seg__btn[aria-checked="true"].seg__btn--worry { background: var(--pink-ink); color: #fff; }

/* ---------- 一覧 ---------- */
.list { display: flex; flex-direction: column; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line); }
.row { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; color: var(--ink); }
a.row:hover { color: var(--ink); background: #F7F8FA; }
.row__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row__title { font-size: 16px; font-weight: 700; line-height: 1.45; }
.row__strip { display: grid; grid-template-columns: minmax(0, 1fr) 30px; align-items: center; gap: 12px; }
.row__stage { font-size: 12px; font-weight: 700; text-align: right; }
.row--inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.row__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row__name { font-size: 15px; font-weight: 700; }
.chev { color: var(--steel); flex-shrink: 0; }

.empty {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 20px;
  border-radius: 18px; border: 1.5px dashed var(--line); font-size: 14px; line-height: 1.7; color: var(--steel);
}

/* 今日のルート */
.route { display: flex; flex-direction: column; }
.route__item { display: grid; grid-template-columns: 56px 20px minmax(0, 1fr); column-gap: 10px; min-height: 58px; color: var(--ink); }
.route__item:hover { color: var(--ink); }
.route__item:hover .route__name { text-decoration: underline; text-underline-offset: 3px; }
.route__time { padding-top: 1px; font-family: var(--num); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.route__rail { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 7px; }
.route__dot { width: 10px; height: 10px; border-radius: 5px; border: 2px solid var(--ink); background: var(--pouch); flex-shrink: 0; }
.route__dot--next { width: 14px; height: 14px; border-radius: 7px; border: none; background: var(--blue); box-shadow: 0 0 0 4px var(--blue-t); }
.route__dot--done { background: var(--ink); }
.route__line { flex-grow: 1; width: 2px; background: repeating-linear-gradient(180deg, var(--steel) 0 3px, transparent 3px 6px); }
.route__body { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; }
.route__name { font-size: 16px; font-weight: 700; }

/* 商品 */
.thumb {
  width: 56px; height: 56px; flex-shrink: 0; border-radius: 14px;
  background: repeating-linear-gradient(-45deg, var(--line) 0 2px, transparent 2px 7px), var(--pouch);
}
.product { display: flex; gap: 14px; padding: 14px 16px; color: var(--ink); }
a.product:hover { color: var(--ink); background: #F7F8FA; }
.product__body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.product__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pick {
  display: grid; grid-template-columns: 20px 52px minmax(0, 1fr); align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px; border-radius: 16px; text-align: left; background: var(--paper);
  border: 1px solid var(--line); color: var(--ink);
}
.pick[aria-checked="true"] { border: 2px solid var(--blue); padding: 11px 13px; }
.radio { width: 18px; height: 18px; border-radius: 9px; border: 2px solid var(--line); }
.pick[aria-checked="true"] .radio { border: 6px solid var(--blue); }
.pick .thumb { width: 52px; height: 52px; border-radius: 12px; }

/* 引用 */
.quote { margin: 0; padding: 18px; border-radius: 18px; background: var(--paper); }
.quote blockquote { margin: 0; padding-left: 1em; text-indent: -1em; font-size: 17px; line-height: 1.85; font-weight: 500; text-wrap: pretty; white-space: pre-wrap; }

/* 段階の切り替え */
.stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
.step { display: flex; flex-direction: column; gap: 8px; min-height: 44px; padding: 0; border: none; background: transparent; text-align: left; font-size: 12px; font-weight: 500; color: var(--steel); }
.step__bar { height: 14px; border-radius: 2px; border: 1px solid var(--line); background: repeating-linear-gradient(-45deg, var(--line) 0 2px, transparent 2px 4px); }
.step--done { color: var(--ink); }
.step--done .step__bar { background: var(--ink); border-color: var(--ink); }
.step--now { color: var(--blue); font-weight: 700; }
.step--now .step__bar { border-color: var(--blue); background: repeating-linear-gradient(-45deg, var(--blue) 0 2px, transparent 2px 4px); }
.step:disabled { cursor: default; }

/* 経緯 */
.timeline { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 52px minmax(0, 1fr); row-gap: 6px; font-size: 13px; }
.timeline li { display: contents; }
.timeline .num { font-weight: 600; color: var(--steel); }

/* 定義リスト */
.facts { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; row-gap: 4px; font-size: 13px; }
.facts dt { color: var(--steel); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- 入力フォーム ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: 700; color: var(--steel); }
.field__hint { font-size: 12px; color: var(--steel); }
.input, .textarea, .select {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--paper); font-size: 16px;
}
.textarea { padding: 12px 14px; line-height: 1.7; resize: vertical; min-height: 96px; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-t); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
fieldset.field { margin: 0; padding: 0; border: none; }
fieldset.field legend { padding: 0 0 8px; }
.prompt { font-size: 20px; line-height: 1.45; font-weight: 700; }

.url-box { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 20px; background: var(--ink); color: #fff; }
.url-box__label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.url-box__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.url-box .input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); color: #fff; }
.url-box .input::placeholder { color: var(--on-dark-sub); }

.search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); color: var(--steel); }
.search input { flex-grow: 1; border: none; outline: none; background: transparent; font-size: 15px; color: var(--ink); min-width: 0; }

/* ---------- 下部メニュー ---------- */
.nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 20;
  width: 100%; max-width: 440px; height: var(--nav-h);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
  padding: 0 8px 10px; background: var(--paper); border-top: 1px solid var(--line);
}
.nav__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; font-size: 11px; font-weight: 500; color: var(--steel); }
.nav__item:hover { color: var(--ink); }
.nav__item::after { content: ''; width: 18px; height: 3px; border-radius: 2px; background: transparent; }
.nav__item[aria-current="page"] { color: var(--ink); font-weight: 700; }
.nav__item[aria-current="page"]::after { background: var(--ink); }
.nav__fab { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: -30px; color: var(--ink); font-size: 11px; font-weight: 700; justify-self: center; }
.nav__fab:hover { color: var(--ink); }
.nav__fab-circle {
  display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 30px;
  background: var(--blue); color: #fff; box-shadow: 0 0 0 5px var(--paper), 0 10px 22px rgba(51,70,211,.35);
  transition: transform .15s ease;
}
.nav__fab:active .nav__fab-circle { transform: scale(.94); }

/* ---------- 画面下に固定の操作バー ---------- */
.bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 20;
  width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 10px;
  padding: 14px 20px 22px; background: var(--paper); border-top: 1px solid var(--line);
}
.bar__info { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bar--done { background: var(--ink); color: #fff; border-top: none; }
.bar--done .strip__seg { transform-origin: left; animation: fillIn .5s ease-out both; }

/* ---------- 下から出るシート ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  background: rgba(27, 34, 48, 0.45); animation: fade .2s ease-out;
}
.sheet {
  width: 100%; max-width: 440px; max-height: 85vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  padding: 10px 20px 24px; background: var(--paper); border-radius: 24px 24px 0 0; animation: rise .25s ease-out;
}
.sheet__grip { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--line); }
.sheet__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sheet__title { margin: 0; font-size: 17px; font-weight: 700; }
.text-btn { height: 44px; padding: 0 4px; border: none; background: transparent; font-size: 14px; font-weight: 700; color: var(--steel); }

/* 記録完了の画面 */
.done-screen {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 22px;
  padding: 40px 28px; background: var(--ink); color: #fff; animation: fade .25s ease-out;
}
.done-screen__title { margin: 0; font-size: 28px; line-height: 1.35; font-weight: 700; }
.done-screen__text { margin: 0; font-size: 14px; line-height: 1.7; color: var(--on-dark-sub); }

/* 通知 */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translateX(-50%); z-index: 60;
  max-width: 360px; width: calc(100% - 40px); padding: 14px 16px; border-radius: 14px;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px rgba(27,34,48,.3);
  animation: toastIn .2s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@keyframes fillIn { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =========================================================
   v2 追加・上書き（WEBアプリ版）
   ========================================================= */
:root { --nav-h: 80px; --safe-b: env(safe-area-inset-bottom, 0px); }
body { font-feature-settings: "palt" 1; }
p, blockquote, textarea { font-feature-settings: normal; }
.num, [class*="num"] { font-variant-numeric: tabular-nums; }
input::placeholder, textarea::placeholder { color: #6B7482; }
::selection { background: var(--blue-t); }
a[href], button, .chip, .tab { transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease, color .15s ease; }
a[href]:active, button:active { transform: scale(.97); }
.hidden { display: none !important; }

.screen { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 32px); }
.screen--with-add { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 110px); }
.screen--with-bar { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 170px); }
.h1 { font-size: 30px; line-height: 1.25; }
.h1--sub { font-size: 25px; line-height: 1.35; word-break: auto-phrase; text-wrap: balance; }
.header { align-items: flex-end; }
.header--top { align-items: flex-start; }
.header__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* 下のメニュー：今いる画面はアイコンを濃い帯で囲む */
.nav { height: calc(var(--nav-h) + var(--safe-b)); padding: 0 6px calc(12px + var(--safe-b)); grid-template-columns: repeat(5, minmax(0, 1fr)); }
.nav__item { gap: 4px; min-height: 60px; }
.nav__item::after { display: none; }
.nav__pill { display: flex; align-items: center; justify-content: center; width: 54px; height: 30px; border-radius: 15px; }
.nav__item[aria-current="page"] .nav__pill { background: var(--ink); color: #fff; }

/* 小さな丸ボタン・追加ボタン */
.pill-btn { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px; border-radius: 22px; border: none; background: var(--blue); color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pill-btn:hover { background: var(--blue-dk); color: #fff; }
.pill-btn--ghost { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.pill-btn--ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--steel); }
.round-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); flex-shrink: 0; }

/* メニューの上に固定する主ボタン */
.addbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 15; width: 100%; max-width: 440px; padding: 14px 20px; background: linear-gradient(rgba(236,239,242,0), var(--pouch) 35%); }
.addbar .btn { box-shadow: 0 10px 22px rgba(51,70,211,.3); }
.addbar a[href]:active, .addbar button:active { transform: scale(.98); }
.bar { bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 15; }
.toast { bottom: calc(var(--nav-h) + var(--safe-b) + 90px); z-index: 70; }

/* 選択チップ（ラジオボタンを使う） */
.chip { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; user-select: none; }
.chip input, .seg__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip:has(input:checked) { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 700; }
.chip:has(input:focus-visible), .seg__opt:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips--scroll .chip { flex-shrink: 0; height: 38px; padding: 0 12px; font-size: 13px; background: var(--pouch); border-color: var(--pouch); font-weight: 700; }
.seg { position: relative; }
.seg__opt { position: relative; flex: 1 1 0; display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 12px; font-size: 15px; font-weight: 700; color: var(--steel); cursor: pointer; }
.seg__opt:has(input:checked) { background: var(--ink); color: #fff; }
.seg__opt--want:has(input:checked) { background: var(--blue); }
.seg__opt--worry:has(input:checked) { background: var(--pink-ink); }
.tabs .tab { font-weight: 500; }

/* リマインドのチェック */
.rem { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.rem__check { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -10px 0 -10px -10px; padding: 0; border: none; background: transparent; flex-shrink: 0; }
.rem__box { width: 22px; height: 22px; box-sizing: border-box; border-radius: 7px; border: 2px solid var(--ink); background: var(--paper); display: flex; align-items: center; justify-content: center; }
.rem--done .rem__box { border: none; background: var(--blue); color: #fff; animation: pop .25s ease-out; }
.rem__body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; text-align: left; background: none; border: none; padding: 0; color: var(--ink); }
.rem__text { font-size: 16px; font-weight: 700; line-height: 1.45; word-break: auto-phrase; text-wrap: pretty; }
.rem--done .rem__text { font-weight: 500; color: var(--steel); text-decoration: line-through; }
.qty { flex-shrink: 0; min-width: 44px; height: 30px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--pouch); font-family: var(--num); font-size: 16px; font-weight: 700; }
.group-head { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.group-head::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--ink); }
.group-head .h2 { flex-grow: 1; }
.fold { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 4px; border: none; background: transparent; font-size: 14px; font-weight: 700; color: var(--steel); }
.fold svg { transition: transform .15s; }
.fold[aria-expanded="true"] svg { transform: rotate(90deg); }

/* 取り組み：達成率メーター（塗り＝達成、青い線＝今日） */
.meter { position: relative; height: 14px; border-radius: 3px; background: repeating-linear-gradient(-45deg, var(--line) 0 2px, transparent 2px 4px); }
.meter__fill { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--ink); transform-origin: left; animation: fillIn .6s ease-out both; }
.meter__mark { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1px; border-radius: 2px; background: var(--blue); box-shadow: 0 0 0 2px var(--paper); }
.meter--dark { background: repeating-linear-gradient(-45deg, rgba(255,255,255,.22) 0 2px, transparent 2px 4px); }
.meter--dark .meter__fill { background: #fff; }
.meter--dark .meter__mark { background: #9AA6FF; box-shadow: 0 0 0 2px var(--ink); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--steel); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.goal-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 20px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); }
a.goal-card:hover { color: var(--ink); border-color: var(--steel); }
.big { font-family: var(--num); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.pace { flex-shrink: 0; display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12px; font-weight: 700; border: 1px solid var(--ink); }
.pace--late { background: var(--amber); border-color: var(--amber); }
.statbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.statbar > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; }
.statbar > div + div { border-left: 1px solid var(--line); }
.statbar .v { font-family: var(--num); font-size: 24px; font-weight: 700; line-height: 1.1; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 4px; }
.follow-btn { flex-shrink: 0; height: 44px; padding: 0 16px; border-radius: 22px; border: none; background: var(--amber); font-size: 14px; font-weight: 700; color: var(--ink); }
.won-badge { flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; }

/* 探すボタン */
.find-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.find-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 64px; padding: 0 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 11px; font-weight: 700; text-align: center; overflow: hidden; }
.find-btn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.find-btn:hover { color: var(--ink); border-color: var(--steel); }

/* 解決策 */
.sol { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; }
.type-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.type--product { border: 1px solid var(--ink); }
.type--service { background: var(--ink); color: #fff; }
.type--advice { background: var(--pouch); }
.res { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 18px; font-size: 12px; font-weight: 700; }
.res--none { border: 1.5px dashed var(--steel); background: transparent; color: var(--ink); }
.res--ok { border: 1px solid var(--ink); background: var(--ink); color: #fff; }
.res--ng { border: 1px solid var(--line); background: var(--paper); color: var(--steel); text-decoration: line-through; }

/* 注意書き */
.notice { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.5; color: var(--steel); }
.alert { display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--amber); color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.55; }
.alert svg { flex-shrink: 0; margin-top: 1px; }
.mode-banner { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--paper); border: 1px dashed var(--steel); font-size: 12px; color: var(--steel); }

/* シート（フォーム） */
.scrim { z-index: 60; }
.sheet { max-height: 90vh; max-height: 90dvh; padding-bottom: calc(24px + var(--safe-b)); }
.sheet .btn--lg { flex-shrink: 0; }
.sheet .danger-link { align-self: center; height: 44px; border: none; background: transparent; color: #A3262A; font-size: 13px; font-weight: 700; }
.photo-preview { width: 100%; max-height: 300px; object-fit: contain; border-radius: 16px; background: #0F141C; }

/* 得意先一覧 */
.client-row { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 16px; color: var(--ink); }
a.client-row:hover { color: var(--ink); background: #F7F8FA; }
.today-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 4px; background: var(--blue); box-shadow: 0 0 0 3px var(--blue-t); }
.count-badge { flex-shrink: 0; font-size: 12px; font-weight: 700; background: var(--pouch); padding: 3px 9px; border-radius: 10px; }

/* 成績 */
.bars { display: flex; flex-direction: column; gap: 14px; padding: 18px 16px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); }
.bars__row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 82px; align-items: center; gap: 10px; font-size: 13px; }
.bars__track { height: 14px; border-radius: 3px; background: repeating-linear-gradient(-45deg, var(--line) 0 2px, transparent 2px 4px); }
.bars__fill { display: block; height: 100%; border-radius: 3px; background: var(--steel); transform-origin: left; animation: fillIn .5s ease-out both; }
.bars__row:first-child .bars__fill { background: var(--ink); }

/* ログイン */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--ink); color: #fff; position: relative; }
.login::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 12px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.14) 0 1px, transparent 1px 4px); }
.login__brand { flex-grow: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 22px; padding: 60px 28px 36px; }
.login__brand .strip__seg { height: 18px; }
.login__title { margin: 0; font-size: 44px; line-height: 1.15; font-weight: 700; letter-spacing: .02em; }
.login__lead { margin: 0; font-size: 16px; line-height: 1.7; color: var(--on-dark-sub); }
.login__form { display: flex; flex-direction: column; gap: 14px; padding: 28px 24px calc(30px + var(--safe-b)); border-radius: 28px 28px 0 0; background: var(--paper); color: var(--ink); }
.login__error { padding: 10px 12px; border-radius: 10px; background: #FBE4E4; color: #8A1F1F; font-size: 13px; font-weight: 700; }

@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* PCでは画面の中央にスマホ幅で表示 */
@media (min-width: 700px) {
  body { padding: 0; }
  .shell { box-shadow: 0 0 0 1px rgba(27,34,48,.06), 0 30px 80px rgba(27,34,48,.12); }
}

/* 通知は画面の上に出す（入力シートやボタンに重ならないように） */
.toast { top: calc(16px + env(safe-area-inset-top, 0px)); bottom: auto; animation: toastDown .2s ease-out; }
@keyframes toastDown { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.mode-banner .text-btn { white-space: nowrap; flex-shrink: 0; }

/* =========================================================
   v3 追加：注文メモ・カレンダー・アカウント作成
   ========================================================= */
/* リマインド＝得意先ごとのメモ */
.memo-list { display: flex; flex-direction: column; gap: 12px; }
.memo-list--done { opacity: .85; }
.memo { display: flex; flex-direction: column; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; }
.memo > .rem + .rem { border-top: 1px solid var(--line); }
.memo__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 8px; padding: 14px 8px 12px 16px; border-bottom: 1px solid var(--line); }
.memo__title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.memo__client { margin: 0; font-size: 16px; line-height: 1.4; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memo__segs { grid-column: 1 / -1; display: flex; gap: 3px; padding-right: 8px; }
.memo__seg { flex: 1 1 0; max-width: 56px; height: 6px; border-radius: 2px; border: 1px solid var(--line); background: repeating-linear-gradient(-45deg, var(--line) 0 2px, transparent 2px 4px); }
.memo__seg--done { background: var(--ink); border-color: var(--ink); }
.memo .rem { min-height: 52px; padding: 10px 16px; }
.memo .rem__text { flex-grow: 1; min-width: 0; font-size: 15px; font-weight: 500; }
.round-btn--plain { border: none; background: transparent; color: var(--steel); }

/* リマインドの入力：内容・個数の行 */
.lines { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; margin: 0 -4px; padding: 2px 4px; }
.line { display: grid; grid-template-columns: 20px minmax(0, 1fr) 72px 44px; gap: 8px; align-items: center; }
.line--head { align-items: end; }
.line__num { font-family: var(--num); font-size: 14px; font-weight: 700; text-align: right; color: var(--steel); }
.line .input { height: 48px; padding: 0 12px; }
.line__q { text-align: center; font-family: var(--num); font-size: 18px; font-weight: 700; padding: 0 6px !important; }
.line__rm { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: none; border-radius: 22px; background: transparent; color: var(--steel); }
.lines .line:last-child .line__rm { visibility: hidden; }
.lines .line:last-child .line__num { color: var(--line); }
.daypick { display: grid; grid-template-columns: 1fr 1fr minmax(0, 1.6fr); gap: 6px; }
.daypick__btn { height: 44px; border-radius: 12px; border: 1px solid var(--pouch); background: var(--pouch); font-size: 14px; font-weight: 700; color: var(--ink); }
.daypick__btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.daypick__date { height: 44px; min-width: 0; padding: 0 10px; font-size: 15px; font-weight: 700; }
.daypick__date.is-on { background: var(--ink); border-color: var(--ink); color: #fff; color-scheme: dark; }

/* 案件の候補 */
.cand-list { display: flex; flex-direction: column; gap: 8px; }
.cand { display: flex; flex-direction: column; gap: 2px; }
.cand__tools { display: flex; justify-content: flex-end; gap: 12px; padding: 0 4px; }
.cand__tools .text-btn { display: inline-flex; align-items: center; gap: 4px; height: 36px; font-size: 12px; }

/* カレンダー */
.mk { flex-shrink: 0; display: inline-block; box-sizing: border-box; }
.mk--rem { border-radius: 1.5px; background: var(--ink); }
.mk--goal { border-radius: 50%; background: var(--blue); }
.mk--case { transform: rotate(45deg) scale(.85); border-radius: 1px; background: var(--amber); outline: 1px solid #B57412; outline-offset: -1px; }
.mk--faded { opacity: .4; }
.cal-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cal-filter { display: flex; align-items: center; justify-content: center; gap: 5px; height: 40px; padding: 0 4px; border-radius: 20px; border: 1px solid var(--line); background: var(--paper); font-size: 12px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.cal-filter[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.cal { display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 10px; border-radius: 20px; background: var(--paper); border: 1px solid var(--line); }
.cal__head { display: flex; align-items: center; justify-content: space-between; }
.cal__title { margin: 0; display: flex; align-items: baseline; gap: 6px; font-size: 16px; font-weight: 700; }
.cal__wd, .cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal__wd { font-size: 11px; font-weight: 700; color: var(--steel); text-align: center; }
.cal__grid { row-gap: 2px; }
.cal__day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 62px; padding: 0; border-radius: 12px; border: 1.5px solid transparent; background: transparent; color: var(--ink); }
.cal__day.is-sel { background: var(--blue-t); border-color: var(--blue); }
.cal__num { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 14px; font-family: var(--num); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cal__day.is-sun .cal__num { color: #A23A2C; }
.cal__day.is-sel .cal__num { font-weight: 700; }
.cal__day.is-today .cal__num { background: var(--ink); color: #fff; font-weight: 700; }
.cal__marks { display: flex; gap: 3px; height: 7px; align-items: center; }
.cal__edge { display: inline-flex; align-items: center; height: 13px; padding: 0 4px; border-radius: 3px; background: var(--blue); color: #fff; font-size: 9px; font-weight: 700; line-height: 1; white-space: nowrap; }
.cal-active { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 16px; background: var(--blue-t); }
.cal-active__label { font-size: 12px; font-weight: 700; color: var(--blue-dk); }
.cal-active__item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; min-height: 44px; color: var(--ink); }
.cal-active__item:hover { color: var(--ink); }
.cal-active__name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-active__left { font-size: 12px; font-weight: 700; color: var(--blue-dk); }
.cal-active__bar { grid-column: 1 / -1; height: 5px; border-radius: 2px; background: repeating-linear-gradient(-45deg, #9AA6FF 0 2px, transparent 2px 4px); overflow: hidden; }
.cal-active__bar span { display: block; height: 100%; border-radius: 2px; background: var(--blue); }
.cal-ev { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px 12px 16px; color: var(--ink); }
.cal-ev:hover { color: var(--ink); background: #F7F8FA; }
.cal-ev > .mk { align-self: flex-start; margin-top: 4px; }
.cal-ev__kind { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 11px; font-weight: 700; color: var(--steel); }
.cal-ev__kind span { font-weight: 500; }
.cal-ev__title { font-size: 15px; font-weight: 700; line-height: 1.45; word-break: auto-phrase; }
.cal-ev--done .cal-ev__title { color: var(--steel); text-decoration: line-through; }
.chev { display: flex; color: var(--steel); flex-shrink: 0; }

/* ログイン・アカウント作成 */
.login__tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--pouch); }
.login__tabs button { flex: 1 1 0; height: 42px; border: none; border-radius: 10px; background: transparent; font-size: 14px; font-weight: 500; color: var(--steel); }
.login__tabs button[aria-selected="true"] { background: var(--paper); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(27,34,48,.14); }
.login--signup .login__title, .login--sent .login__title { font-size: 32px; }
.login--signup .login__brand, .login--sent .login__brand { padding-top: 32px; padding-bottom: 28px; }
.login__form { gap: 16px; padding-top: 20px; }
.pw { position: relative; }
.pw .input { width: 100%; padding-right: 72px; }
.pw__show { position: absolute; top: 4px; right: 4px; height: 44px; padding: 0 12px; border: none; border-radius: 10px; background: transparent; font-size: 13px; font-weight: 700; color: var(--blue); }
.rules { margin: -6px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.rule { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--steel); }
.rule__box { display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); background: repeating-linear-gradient(-45deg, var(--line) 0 2px, transparent 2px 4px); color: #fff; }
.rule--ok .rule__box { background: var(--blue); border-color: var(--blue); }
.field__hint--bad { color: #A23A2C; margin-top: -8px; }
.login__mail { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 18px; background: var(--blue-t); color: var(--blue); }
.login__steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; border-radius: 14px; border: 1px solid var(--line); }
.login__steps li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; font-size: 14px; }
.login__steps li + li { border-top: 1px solid var(--line); }
.login__steps .num { color: var(--blue); font-size: 15px; }
.cand .pick { grid-template-columns: 22px minmax(0, 1fr); width: 100%; text-align: left; }
.login__demo { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--amber-t); color: var(--ink); font-size: 12px; line-height: 1.6; font-weight: 500; }
.login__demo svg { flex-shrink: 0; margin-top: 1px; }
