/* toolkit chrome — 10ツール共通のヘッダー（固定バー 52px）＋ハンバーガーメニュー（右ドロワー）。
   配信: https://go.pint-home.com/tk/chrome.css（開閉は同じ場所の chrome.js。React のページは client/shared/toolkit-chrome）。
   DOM は src/lib/toolkit-chrome/render.ts の出力。クラス名を変えるときは render.ts・ToolkitChrome.tsx・chrome.js もそろえる。
   色・フォントは TOOLKIT_DESIGN_SPEC のトークン。ページ側に --paper 等の変数があればそれを使い、無ければ同じ値で描く。
   ページ CSS より後に読むこと（body の padding-top をページの指定で消さないため）。 */
:root {
  --tk-paper: var(--paper, #F7F6F2);
  --tk-card: var(--card, #FFFFFF);
  --tk-ink: var(--ink, #1F1F1F);
  --tk-sub: var(--sub, #6B6862);
  --tk-line: var(--line, #DAD6CD);
  --tk-gothic: var(--gothic, 'Zen Kaku Gothic New', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', sans-serif);
  --tk-latin: var(--latin, 'Inter', 'Helvetica Neue', Arial, sans-serif);
  --tk-bar-h: 52px;
}

/* 固定バーの分だけ本文を下げる。ページ側の固定バー（sticky/fixed）は外す */
body { padding-top: var(--tk-bar-h); }

/* ---- ヘッダー ---- */
.tk-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: var(--tk-bar-h); box-sizing: border-box;
  background: var(--tk-paper); border-bottom: 1px solid var(--tk-line);
  color: var(--tk-ink); font-family: var(--tk-gothic);
}
.tk-bar-inner {
  display: flex; align-items: center; gap: 10px;
  max-width: 680px; height: 100%; margin: 0 auto; padding: 0 10px 0 12px; box-sizing: border-box;
}
.tk-back {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; box-sizing: border-box;
  border: 1.5px solid var(--tk-ink); border-radius: 999px; background: var(--tk-card); color: var(--tk-ink);
  font-family: var(--tk-latin); font-weight: 600; font-size: 11px; letter-spacing: .08em; line-height: 1;
  text-decoration: none; white-space: nowrap; flex: none;
}
.tk-title {
  flex: 1; min-width: 0; margin: 0;
  font-family: var(--tk-gothic); font-weight: 700; font-size: 15px; line-height: 1.3; color: var(--tk-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tk-menu-btn, .tk-drawer-close {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; margin: 0;
  border: 1.5px solid var(--tk-ink); border-radius: 999px; background: var(--tk-card); color: var(--tk-ink);
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.tk-menu-btn svg, .tk-drawer-close svg { display: block; }

/* ---- 背面のスクロール固定（chrome.js / React が body に付ける。top は開いた時のスクロール位置を JS が入れる） ---- */
body.tk-menu-open { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }

/* ---- ドロワー ---- */
.tk-drawer-backdrop { position: fixed; inset: 0; z-index: 120; background: rgba(31, 31, 31, .35); }
.tk-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 121; box-sizing: border-box;
  width: min(88vw, 360px); padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  background: var(--tk-card); border-left: 1px solid var(--tk-line); box-shadow: -8px 0 24px -16px rgba(0, 0, 0, .35);
  color: var(--tk-ink); font-family: var(--tk-gothic); font-size: 14px; line-height: 1.6;
}
.tk-drawer[hidden], .tk-drawer-backdrop[hidden] { display: none; }
.tk-drawer:not([hidden]) { animation: tk-slide-in .22s cubic-bezier(.2, .8, .2, 1) both; }
.tk-drawer-backdrop:not([hidden]) { animation: tk-fade-in .18s ease both; }
@keyframes tk-slide-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes tk-fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .tk-drawer:not([hidden]), .tk-drawer-backdrop:not([hidden]) { animation: none; }
}

.tk-drawer-head {
  display: flex; align-items: center; justify-content: space-between; height: var(--tk-bar-h);
  margin: 0 -16px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--tk-line);
}
.tk-drawer-brand { font-family: var(--tk-latin); font-weight: 800; font-size: 18px; letter-spacing: -.01em; color: var(--tk-ink); }

.tk-drawer-home {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; margin: 16px 0 6px; padding: 10px 16px; box-sizing: border-box;
  border: 1.5px solid var(--tk-ink); border-radius: 999px; background: var(--tk-card); color: var(--tk-ink);
  font-weight: 700; font-size: 15px; text-decoration: none;
}

.tk-eyebrow {
  margin: 20px 0 6px; font-family: var(--tk-latin); font-weight: 600; font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--tk-sub);
}

/* 10 TOOLS */
.tk-tools { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--tk-line); }
.tk-tools li { border-top: 1px solid var(--tk-line); }
.tk-tool {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 5px 0; box-sizing: border-box;
  color: var(--tk-ink); text-decoration: none; font-size: 14px; line-height: 1.4;
}
.tk-tool[aria-current="page"] { font-weight: 700; }
.tk-num {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; box-sizing: border-box;
  border: 1px solid var(--tk-line); border-radius: 999px; background: var(--tk-paper);
  font-family: var(--tk-latin); font-weight: 600; font-size: 12px; color: var(--tk-ink);
}
.tk-num--lavender { background: #DCD9F2; border-color: #B9B3E2; }
.tk-num--mint { background: #D8EEDF; border-color: #A8D4B6; }
.tk-num--yellow { background: #FCEFB4; border-color: #E9CF6E; }
.tk-num--peach { background: #F8D8C8; border-color: #E6AE93; }
.tk-num--sage { background: #DCE9D5; border-color: #AFCBA5; }
.tk-num--blue { background: #CFE0F5; border-color: #95B7E0; }
.tk-tool-main { flex: 1; min-width: 0; }
.tk-here {
  flex: none; padding: 2px 8px; border-radius: 999px; background: var(--tk-ink); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 1.5; letter-spacing: .02em;
}

/* THIS PAGE（各ページが a.tk-item / button.tk-item を差し込む） */
.tk-page-items { border-bottom: 1px solid var(--tk-line); }
.tk-item {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin: 0; padding: 6px 0 6px 12px; box-sizing: border-box;
  border: 0; border-top: 1px solid var(--tk-line); border-radius: 0; background: none;
  color: var(--tk-ink); font-family: inherit; font-size: 14px; line-height: 1.4; text-align: left; text-decoration: none;
  cursor: pointer; -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent;
}
.tk-item small, .tk-item .tk-item-sub { margin-left: auto; font-size: 12px; color: var(--tk-sub); }

/* NEXT STEP */
.tk-cta { display: grid; gap: 10px; margin-top: 8px; }
.tk-cta-primary, .tk-cta-secondary {
  display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 10px 16px; box-sizing: border-box;
  border: 1.5px solid var(--tk-ink); border-radius: 999px; font-weight: 700; font-size: 15px; text-decoration: none;
}
.tk-cta-primary { background: var(--tk-ink); color: #fff; }
.tk-cta-secondary { background: var(--tk-card); color: var(--tk-ink); }
.tk-drawer-note { margin: 14px 0 0; font-size: 12px; line-height: 1.6; color: var(--tk-sub); }

@media print {
  .tk-bar, .tk-drawer, .tk-drawer-backdrop { display: none !important; }
  body { padding-top: 0; }
}
