/* ============================================================
   ノウカノ（チョコ君）共通デザインシステム
   正本: C:\Users\nouka\ATAI-workspace\_tsubasa\workspace\noukano_choko_mock\mock.html
   （2026-08-10 社長承認「デザインはモックの通りでOKです。実装してください」）
   ここに定義したトークン・コンポーネントを index/rec/karte/settings/am の5画面が共通で参照する。
   ============================================================ */
:root{
  --paper:#f7f5ef;
  --ink:#1a1a1a;
  --black:#111;
  --lime:#c6e84c;
  --muted:#69675f;
  --navy:#0a1f44;
  --blue:#2f6df6;
  --line-green:#06c755;
  --warn:#e8590c;
  --ok:#2f9e44;
}
*{box-sizing:border-box;}

/* ===== アプリシェル（2026-08-11 追加）=====
   社長指摘「ブラウザみたいにスクロールで画面が動く」への対応。
   ページ自体（html/body）は絶対にスクロールさせず、.content だけが動く。
   min-height:0 が無いと flex の子（.content）が縮まずページ全体が伸びてしまう。 */
html, body{ height:100%; margin:0; overflow:hidden; overscroll-behavior:none; }
svg{
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.icon-accent{ stroke:var(--lime); }

/* ===== app header（画面上部・ネイビー） ===== */
.app-header{
  flex-shrink:0;
  min-height:88px;
  background:var(--navy);
  display:flex;
  align-items:flex-end;
  padding:calc(env(safe-area-inset-top) + 14px) 20px 14px;
  color:#fff;
}
.header-home{ justify-content:space-between; align-items:flex-end; }
.header-home-left{ display:flex; flex-direction:column; gap:4px; }
.greet{ font-size:14px; opacity:.85; font-weight:600; }
.logo{ font-size:21px; font-weight:900; letter-spacing:.5px; }
.avatar-circle{
  width:36px;height:36px;border-radius:50%;flex-shrink:0;
  background:radial-gradient(circle at 30% 30%, var(--lime), var(--blue));
  border:2px solid rgba(255,255,255,.6);
}
.header-title{ font-size:21px; font-weight:900; }
.header-caption{ font-size:13px; opacity:.85; font-weight:600; margin-top:4px; }
.header-sub{ flex-direction:column; align-items:flex-start; justify-content:center; }

/* ===== app header: 下層ページ用（戻る矢印つき） ===== */
.header-nav{ align-items:center; gap:10px; }
.header-nav .header-title{ flex:1; min-width:0; }
.header-nav .header-caption{ margin-top:2px; }
.header-back{
  flex-shrink:0; width:40px; height:40px; margin-left:-8px;
  display:flex; align-items:center; justify-content:center;
  background:none; border:none; color:#fff; padding:0; cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.header-back svg{ width:24px; height:24px; }
.header-action{
  flex-shrink:0; display:flex; align-items:center; gap:6px;
  min-height:40px; padding:9px 16px; border-radius:20px;
  background:rgba(255,255,255,.14); color:#fff; border:none;
  font-size:14px; font-weight:800; cursor:pointer; font-family:inherit;
  text-decoration:none; white-space:nowrap;
}
.header-action svg{ width:17px; height:17px; }

/* ===== content area =====
   ここだけがスクロールする。min-height:0 が無いと flex 子が縮まずページ全体が伸びる（2026-08-11）。 */
.content{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  padding:20px;
}
.section-title{
  font-size:18px;
  font-weight:900;
  color:var(--ink);
  margin:22px 0 12px;
}
.section-title.first{ margin-top:20px; }

/* ===== feature cards（ホーム／記録する 導線カード） ===== */
.feature-card{
  display:flex; align-items:center; gap:14px;
  min-height:96px; background:#fff;
  border:1px solid #ececE0; border-radius:16px;
  padding:14px 18px; margin-bottom:14px;
  box-shadow:0 2px 8px rgba(0,0,0,.04);
  text-decoration:none; color:inherit; width:100%;
}
a.feature-card{ cursor:pointer; }
.feature-card.featured{ background:var(--navy); border:2px solid var(--lime); }
.feature-card.judgement-card{ height:auto; min-height:118px; align-items:flex-start; padding:18px; }
.fc-icon{
  width:48px; flex-shrink:0; color:var(--navy);
  display:flex; align-items:center; justify-content:center;
}
.fc-icon svg{ width:32px; height:32px; }
.featured .fc-icon{ color:#fff; }
.fc-body{ flex:1; display:flex; flex-direction:column; gap:6px; min-width:0; }
.fc-title{ flex:1; font-size:18px; font-weight:800; color:var(--ink); }
.featured .fc-title{ color:#fff; }
.fc-comment{ font-size:13px; color:rgba(255,255,255,.85); font-weight:600; line-height:1.5; }
.fc-arrow{ font-size:24px; color:var(--muted); font-weight:700; flex-shrink:0; }
.featured .fc-arrow{ color:var(--lime); }
.feature-card.method-btn{ height:auto; min-height:88px; }

.grad1{ background:linear-gradient(135deg,#c6e84c,#2f6df6); }
.grad2{ background:linear-gradient(135deg,#2f6df6,#0a1f44); }
.grad3{ background:linear-gradient(135deg,#69675f,#c6e84c); }
.grad4{ background:linear-gradient(135deg,#0a1f44,#69675f); }

/* ===== recent records（ホーム） ===== */
.recent-row{
  display:flex; align-items:center; gap:12px; background:#fff;
  border-radius:14px; padding:12px 14px; margin-bottom:10px;
  box-shadow:0 2px 6px rgba(0,0,0,.04);
  text-decoration:none; color:inherit;
}
.recent-date{ font-size:12px; color:var(--muted); font-weight:700; width:52px; flex-shrink:0; }
.recent-field{ flex:1; font-size:15px; font-weight:800; color:var(--ink); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.recent-tag{
  display:inline-block; font-size:11px; font-weight:700;
  color:var(--navy); background:#eef2ff;
  padding:4px 10px; border-radius:10px; flex-shrink:0;
}

/* ===== mutual-link card（ホーム最下部） ===== */
.link-card{
  display:flex; align-items:center; gap:12px; background:#fff;
  border:1px dashed #c9c9be; border-radius:14px;
  padding:14px 16px; margin-top:20px; margin-bottom:14px;
  text-decoration:none; color:inherit;
}
.link-card-icon{
  width:36px; height:36px; border-radius:8px; background:#eef2ff; color:var(--navy);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.link-card-icon svg{ width:20px; height:20px; }
.link-card-text{ flex:1; font-size:13px; font-weight:700; color:var(--muted); line-height:1.5; }
.link-card-arrow{ color:var(--muted); font-size:18px; }

/* ===== auto-filled info box（記録） ===== */
.info-box{
  background:#fff; border:1px solid #ececE0; border-radius:16px;
  padding:6px 18px; margin-top:20px;
}
.info-row{
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 0; border-bottom:1px solid #f0f0ea;
}
.info-row:last-child{ border-bottom:none; }
.info-label{ font-size:13px; color:var(--muted); font-weight:700; }
.info-value{ font-size:16px; color:var(--ink); font-weight:800; margin-top:2px; }
.info-main{ display:flex; flex-direction:column; }
.info-change{ font-size:13px; color:var(--blue); font-weight:700; background:none; border:none; cursor:pointer; font-family:inherit; }

/* ===== footer CTA（共通） ===== */
.next-footer{ flex-shrink:0; padding:16px 20px 20px; }
.btn-next{
  display:block; width:100%; min-height:56px; border-radius:14px;
  background:var(--lime); color:#111; font-size:18px; font-weight:900;
  text-align:center; line-height:56px; border:none; cursor:pointer; font-family:inherit;
}
.btn-next:disabled{ background:#dfe0d3; color:#8a897d; }

/* ===== category chips（カルテ） ===== */
.chip-row{ display:flex; gap:8px; padding:16px 20px 4px; overflow-x:auto; flex-shrink:0; }
.chip{
  flex-shrink:0; padding:9px 16px; border-radius:20px;
  font-size:14px; font-weight:700; border:1px solid #ddd;
  color:var(--muted); background:#fff; white-space:nowrap; cursor:pointer; font-family:inherit;
  min-height:40px;
}
.chip.active{ background:var(--navy); color:#fff; border-color:var(--navy); }

/* ===== timeline（カルテ） ===== */
.timeline-date{ font-size:14px; font-weight:800; color:var(--muted); margin:16px 0 10px; }
.timeline-date.first{ margin-top:4px; }
.karte-row{
  display:flex; align-items:center; gap:12px; background:#fff;
  border-radius:14px; padding:12px 14px; margin-bottom:10px;
  box-shadow:0 2px 6px rgba(0,0,0,.04);
  text-decoration:none; color:inherit; position:relative;
}
.karte-thumb{ width:56px; height:56px; border-radius:10px; flex-shrink:0; }
.karte-body{ flex:1; display:flex; flex-direction:column; gap:6px; min-width:0; }
.karte-tag{
  display:inline-block; width:fit-content; font-size:11px; font-weight:700;
  color:var(--navy); background:#eef2ff;
  padding:3px 9px; border-radius:10px;
}
.karte-memo{
  font-size:14px; font-weight:700; color:var(--ink); line-height:1.4;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.karte-time{ font-size:12px; color:var(--muted); font-weight:600; }

.outline-btn-row{ display:flex; gap:12px; padding:14px 20px 20px; flex-shrink:0; flex-wrap:wrap; }
.outline-btn{
  flex:1; min-width:120px; min-height:52px; border-radius:14px; border:2px solid var(--navy);
  color:var(--navy); font-size:15px; font-weight:800;
  display:flex; align-items:center; justify-content:center; gap:8px;
  background:#fff; cursor:pointer; font-family:inherit; text-decoration:none;
}
.outline-btn svg{ width:18px; height:18px; }
.outline-btn.locked{ opacity:.65; }

/* ===== settings sections ===== */
.field-row{
  display:flex; align-items:center; gap:12px; background:#fff;
  border-radius:14px; padding:12px 14px; margin-bottom:10px;
  box-shadow:0 2px 6px rgba(0,0,0,.04);
  text-decoration:none; color:inherit;
}
.field-icon{
  width:40px; height:40px; border-radius:10px; background:#eef2ff; color:var(--navy);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.field-icon svg{ width:22px; height:22px; }
.field-info{ flex:1; min-width:0; }
.field-name{ font-size:15px; font-weight:800; color:var(--ink); }
.field-area{ font-size:12px; color:var(--muted); font-weight:600; margin-top:2px; }
.field-arrow{ color:var(--muted); font-size:18px; }
.field-action-row{ display:flex; gap:10px; margin-top:6px; margin-bottom:24px; }
.field-add-btn{
  flex:1; min-height:48px; border-radius:12px; background:var(--navy); color:#fff;
  font-size:14px; font-weight:800; display:flex; align-items:center; justify-content:center; gap:6px;
  border:none; cursor:pointer; font-family:inherit;
}
.field-locate-btn{
  flex:1; min-height:48px; border-radius:12px; border:2px solid var(--navy); color:var(--navy);
  font-size:14px; font-weight:800; display:flex; align-items:center; justify-content:center; gap:6px;
  background:#fff; cursor:pointer; font-family:inherit;
}
.field-add-btn svg,.field-locate-btn svg{ width:18px; height:18px; }

.tag-row{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:6px; }
.tag-chip{
  padding:9px 16px; border-radius:20px; background:#eef2ff;
  color:var(--navy); font-size:14px; font-weight:700;
  display:inline-flex; align-items:center; gap:6px;
}
.tag-chip .tag-del{ display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; color:var(--navy); opacity:.6; cursor:pointer; }
.tag-chip .tag-del svg{ width:12px; height:12px; }
.edit-btn{
  padding:9px 16px; border-radius:20px; border:1px solid #ccc;
  color:var(--muted); font-size:13px; font-weight:700;
  display:inline-flex; align-items:center; gap:6px;
  background:#fff; cursor:pointer; font-family:inherit;
  min-height:40px;
}
.edit-btn svg{ width:14px; height:14px; }

/* ===== today's judgement ===== */
.question{
  font-size:22px; font-weight:900; color:var(--ink);
  text-align:center; padding:26px 10px 22px; line-height:1.5;
}
.reason-row{
  display:flex; align-items:center; gap:14px; background:#fff;
  border-radius:14px; padding:14px 16px; margin-bottom:10px;
  box-shadow:0 2px 6px rgba(0,0,0,.04);
}
.reason-icon{
  width:40px; height:40px; border-radius:10px; background:#eef2ff; color:var(--navy);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.reason-icon svg{ width:22px; height:22px; }
.reason-label{ flex:1; font-size:14px; color:var(--muted); font-weight:700; }
.reason-value{ font-size:17px; color:var(--ink); font-weight:900; }
.quote-card{
  background:#fff; border-left:4px solid var(--lime); border-radius:12px;
  padding:14px 16px; margin-top:18px; box-shadow:0 2px 8px rgba(0,0,0,.04);
}
.quote-label{ font-size:12px; color:var(--muted); font-weight:700; margin-bottom:6px; }
.quote-text{ font-size:14px; color:var(--ink); font-weight:600; line-height:1.6; }

/* ===== bottom tab bar（共通） ===== */
.tab-bar{
  flex:0 0 auto; min-height:78px; background:#fff;
  border-top:1px solid #ececec;
  display:flex; justify-content:space-around; align-items:center;
  padding-bottom:env(safe-area-inset-bottom);
  /* 直前の要素がflex:1で伸びていない状態（読み込み中・空状態など）でも
     必ず画面下端に張り付くようにする。 */
  margin-top:auto;
}
.tab-item{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; flex:1;
  min-height:56px; text-decoration:none; color:inherit; padding:8px 4px;
}
.tab-icon{ color:#9a988f; line-height:0; }
.tab-icon svg{ width:22px; height:22px; }
.tab-label{ font-size:11px; color:var(--muted); font-weight:600; }
.tab-item.active .tab-icon{ color:var(--navy); }
.tab-item.active .tab-label{ color:var(--navy); font-weight:800; }

/* ===== icon list（プラン・アップグレード画面の特典リスト） ===== */
.icon-list{ list-style:none; }
.icon-li{
  display:flex; align-items:flex-start; gap:12px;
  padding:13px 0; border-top:1px dashed #edf0f4;
  font-size:15px; line-height:1.6; color:var(--ink);
}
.icon-li:first-child{ border-top:none; }
.icon-li .li-icon{
  flex-shrink:0; width:22px; height:22px; margin-top:1px; color:var(--ok);
  display:flex; align-items:center; justify-content:center;
}
.icon-li .li-icon svg{ width:20px; height:20px; }
.icon-li.plus .li-icon{ color:var(--warn); }
.icon-li b{ color:var(--navy); }

/* ===== base page layout（各画面のbodyで使う） =====
   height（min-height ではない）でビューポートに固定するのがアプリシェルの要。
   min-heightだと中身がその高さを超えて伸び、ページ自体がスクロールしてしまう（2026-08-11）。 */
.nk-page{
  font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,sans-serif;
  background:var(--paper); color:var(--ink); max-width:480px; margin:0 auto;
  display:flex; flex-direction:column;
  height:100vh; height:100dvh;
}
[hidden]{ display:none !important; }

/* ===== 印刷（提出用の栽培記録表など）はアプリシェルの高さ制約を解除する（2026-08-11） =====
   .content を overflow-y:auto の固定高さのままにすると、印刷時に見えている分しか出ない。 */
@media print{
  html, body{ height:auto !important; overflow:visible !important; }
  body.nk-page{ display:block !important; height:auto !important; max-width:none !important; }
  .content{ overflow:visible !important; height:auto !important; flex:none !important; }
  .app-header, .tab-bar{ display:none !important; }
}

/* ===== ホーム画面の圧縮ナビ行（2026-08-11 追加） =====
   フルサイズの feature-card だと4枚以上は1画面に収まらないため、
   二次的な導線（記録する・カルテ等）は既存の field-row と同じ密度のリンク行にする。 */
.nav-row{
  display:flex; align-items:center; gap:12px; background:#fff;
  border-radius:14px; padding:11px 14px; margin-bottom:10px;
  box-shadow:0 2px 6px rgba(0,0,0,.04);
  text-decoration:none; color:inherit; min-height:64px;
}
.nav-row .fc-icon{ width:40px; }
.nav-row .fc-icon svg{ width:24px; height:24px; }
.nav-row .fc-title{ font-size:18px; }
.nav-row .fc-arrow{ font-size:22px; }

/* ===== くわしく（折りたたみ）＝details/summary（2026-08-11 追加） =====
   閉じている間は高さ0で1画面に収める。開いた分は.contentが内側スクロールする。 */
.more-details{ margin-top:4px; }
.more-details summary{
  list-style:none; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:6px;
  min-height:44px; padding:10px 16px; border-radius:12px; background:#fff;
  border:1.5px solid #e0e6ef; color:var(--muted); font-size:14px; font-weight:800;
}
.more-details summary::-webkit-details-marker{ display:none; }
.more-details summary .chev{ transition:transform .15s; }
.more-details[open] summary .chev{ transform:rotate(180deg); }
.more-details .more-body{ padding-top:12px; }

/* LINE外で開いた時の案内ボタン（2026-08-10 追加） */
.nk-open-line{
  display:block; margin:12px auto 0; max-width:260px;
  min-height:48px; line-height:48px; padding:0 18px;
  border-radius:12px; background:#06c755; color:#fff;
  font-size:16px; font-weight:800; text-align:center; text-decoration:none;
}

/* ===== 初回同意ゲート（2026-08-10 追加・.add-sheet系のボトムシートに準拠） ===== */
.nk-consent-overlay{
  position:fixed; inset:0; z-index:200;
  background:rgba(10,23,48,.55);
  display:none; align-items:flex-end;
}
.nk-consent-card{
  width:100%; min-width:0; max-width:480px; margin:0 auto; max-height:92dvh; overflow-y:auto;
  background:#fff; border-radius:20px 20px 0 0;
  padding:24px 20px calc(env(safe-area-inset-bottom) + 20px);
  box-shadow:0 -8px 30px rgba(10,23,48,.16);
  box-sizing:border-box;
}
.nk-consent-title{ font-size:20px; font-weight:900; color:var(--navy); margin-bottom:14px; }
.nk-consent-body{ font-size:16px; color:var(--ink); line-height:1.7; margin-bottom:10px; }
.nk-consent-links{ display:flex; flex-direction:column; gap:2px; margin:14px 0; }
.nk-consent-links a{
  color:var(--blue); font-size:16px; font-weight:700; text-decoration:underline;
  min-height:44px; display:flex; align-items:center;
}
.nk-consent-notes{
  background:#fbfcfe; border:1px solid #ececE0; border-radius:14px;
  padding:14px 16px; margin:14px 0; display:flex; flex-direction:column; gap:12px;
}
.nk-consent-note-row{ display:flex; gap:10px; align-items:flex-start; font-size:14.5px; color:var(--muted); line-height:1.6; }
.nk-consent-note-row svg{ width:18px; height:18px; flex-shrink:0; color:var(--warn); margin-top:1px; }
.nk-consent-agree-btn{
  display:block; width:100%; min-height:56px; border-radius:14px;
  background:var(--lime); color:#111; font-size:18px; font-weight:900;
  text-align:center; line-height:56px; border:none; cursor:pointer; font-family:inherit; margin-top:18px;
}
.nk-consent-agree-btn:disabled{ background:#dfe0d3; color:#8a897d; }
.nk-consent-foot{ font-size:13px; color:var(--muted); text-align:center; margin-top:10px; line-height:1.6; }
.nk-consent-error{
  display:none; margin-top:14px; padding:12px 14px; border-radius:12px;
  background:#fdece2; color:#7a3a12; font-size:14px; line-height:1.6;
}
.nk-consent-retry-btn{
  display:inline-block; margin-top:8px; min-height:40px; padding:0 16px;
  border-radius:10px; border:1.5px solid #7a3a12; background:#fff; color:#7a3a12;
  font-size:14px; font-weight:800; cursor:pointer; font-family:inherit;
}

/* 防除の法令メモ。ステップ3が1画面に収まらなくなるため畳んで置く（消していない・2026-08-11） */
.dnote-fold{ font-size:14px; color:var(--muted); line-height:1.7; margin-top:8px; }
.dnote-fold summary{ min-height:44px; display:flex; align-items:center; color:#33415c; font-weight:800; cursor:pointer; }

/* ===== 入力時に画面が拡大しないようにする（2026-08-11 社長指摘）=====
   iOSは input/textarea/select の文字が16px未満だと、タップした瞬間に画面を自動で拡大する。
   アプリシェル（height:100dvh・overflow:hidden）と重なると画面が崩れて見えるため、
   入力欄の文字は必ず16px以上にする。ここは新しく足された入力欄の受け皿（下限の保証）で、
   個別に小さい指定を書くと個別の方が勝つので、各画面側でも16px未満を作らないこと。 */
input, textarea, select { font-size: 16px; }
