/* やり直し英語：マイカルテ（/yarinaoshi/karte/）。クラス名は kt- で始まる。スマホを基準に、広い画面で足す */
.kt { padding: 6px 0 56px; max-width: 880px; }
.kt .ic { width: 1.2em; height: 1.2em; flex: none; }
.kt-load, .kt-nojs { text-align: center; color: var(--ink2); padding: 40px 0; display: flex; gap: 10px; justify-content: center; align-items: center; }
.kt-spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--brand); animation: kt-spin .8s linear infinite; }
@keyframes kt-spin { to { transform: rotate(360deg); } }
.kt-note { font-size: 12.5px; color: var(--ink3); text-align: center; margin: 10px 0 0; line-height: 1.7; }
.kt-go { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0 0; }
.kt-say { font-size: 14px; color: var(--ink2); margin: 0 0 12px; line-height: 1.8; }

/* ── はじめの画面 ── */
.kt-intro { display: grid; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: 22px 18px 24px; box-shadow: var(--sh2); text-align: center; }
.kt-owl { width: 150px; height: auto; margin: 0 auto; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .12)); animation: kt-bob 3.6s ease-in-out infinite; }
@keyframes kt-bob { 50% { transform: translateY(-6px) rotate(-1.5deg); } }
.kt-intro h2 { font-size: clamp(21px, 5.6vw, 28px); font-weight: 900; margin: 0 0 8px; }
.kt-intro > div > p { color: var(--ink2); font-size: 15px; margin: 0 0 14px; }
.kt-intro > div > .kt-go { margin: 22px 0 0; } .kt-intro > div > .kt-note { margin: 12px 0 0; }
.kt-flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: kf; text-align: left; }
.kt-flow li { counter-increment: kf; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; align-items: center; background: var(--bg2); border-radius: 16px; padding: 12px 14px; line-height: 1.5; }
.kt-flow li::before { content: counter(kf); grid-row: 1 / 3; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 800 16px/34px var(--en); text-align: center; }
.kt-flow b { font-size: 15.5px; } .kt-flow span { font-size: 13px; color: var(--ink2); }

/* ── 問診・ミニ診断 ── */
.kt-q { background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: 16px 16px 22px; box-shadow: var(--sh2); animation: kt-in .28s ease both; }
@keyframes kt-in { from { opacity: 0; transform: translateY(8px); } }
.kt-prog { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 800; color: var(--ink3); margin-bottom: 16px; }
.kt-back { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line2); background: var(--card); display: grid; place-items: center; flex: none; }
.kt-pb { flex: 1; height: 9px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.kt-pb i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--gold)); border-radius: 99px; transition: width .4s; }
.kt-q h2 { font-size: clamp(20px, 5.4vw, 26px); font-weight: 900; margin: 0 0 6px; }
.kt-sub { color: var(--ink2); font-size: 14px; margin: 0 0 16px; }
.kt-opts { display: grid; gap: 9px; }
.kt-opt { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--card); border: 2px solid var(--line2); border-radius: 16px; padding: 13px 14px; line-height: 1.45; min-height: 58px; transition: border-color .12s, background .12s, transform .08s; }
.kt-opt:hover { border-color: var(--ink3); } .kt-opt:active { transform: scale(.985); }
.kt-opt b { display: block; font-size: 15.5px; } .kt-opt small { display: block; font-size: 12.5px; color: var(--ink3); margin-top: 1px; }
.kt-opt .kt-ck { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line2); display: grid; place-items: center; flex: none; color: transparent; }
.kt-opt .kt-ck .ic { width: 16px; height: 16px; stroke-width: 3; }
.kt-opt[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-bg); }
.kt-opt[aria-pressed="true"] .kt-ck { background: var(--brand); border-color: var(--brand); color: #fff; }
.kt-ab { width: 30px; height: 30px; border-radius: 10px; background: var(--bg2); display: grid; place-items: center; font: 800 14px var(--en); flex: none; }
.kt-opt[aria-pressed="true"] .kt-ab { background: var(--brand); color: #fff; }
.kt-area { display: inline-block; font-size: 12px; font-weight: 800; color: var(--c); border: 1.5px solid var(--c); border-radius: 99px; padding: 1px 12px; margin: 0 0 10px; }
.kt-en { font-family: var(--en); font-weight: 700; font-size: clamp(18px, 5vw, 22px); background: var(--bg2); border-radius: 14px; padding: 14px 16px; margin: 10px 0 16px; line-height: 1.6; }
.kt-quiz h2 { font-size: clamp(17px, 4.6vw, 21px); }
.kt-skip { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; margin: 16px 0 0; }
.kt-skip button { background: none; border: 0; color: var(--ink2); font-size: 13.5px; font-weight: 700; text-decoration: underline; text-underline-offset: .25em; padding: 8px 6px; }
.kt-skip .kt-dk { border: 1.5px solid var(--line2); border-radius: 99px; text-decoration: none; padding: 9px 26px; }
.kt-rules { margin: 0 0 4px; padding-left: 1.2em; font-size: 14px; color: var(--ink2); line-height: 1.8; }
.kt-rules li + li { margin-top: 4px; }
.kt-name { display: flex; align-items: center; gap: 10px; margin: 0; }
.kt-name input { flex: 1; min-width: 0; font: 800 20px var(--jp); padding: 13px 16px; border-radius: 14px; border: 2px solid var(--line2); background: var(--bg); color: var(--ink); }
.kt-name input:focus { border-color: var(--brand); outline: none; }
.kt-name span { font-weight: 800; font-size: 17px; }

/* ── 作成中 ── */
.kt-making { text-align: center; padding: 26px 0 40px; }
.kt-making h2 { font-size: 22px; font-weight: 900; margin: 6px 0 14px; }
.kt-making ul { list-style: none; margin: 0 auto; padding: 0; display: inline-grid; gap: 8px; text-align: left; }
.kt-making li { display: flex; gap: 9px; align-items: center; font-weight: 700; color: var(--ink2); opacity: 0; animation: kt-line .4s ease forwards; animation-delay: calc(var(--i) * .5s + .2s); }
.kt-making li .ic { color: var(--ok); stroke-width: 3; }
@keyframes kt-line { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; } }
.kt-write { animation: kt-write .5s ease-in-out infinite alternate; }
@keyframes kt-write { to { transform: rotate(3deg) translateX(4px); } }

/* ── カルテの用紙 ── */
.kt-k { display: grid; gap: 22px; }
.kt-k.is-fresh .kt-paper { animation: kt-pop .6s cubic-bezier(.2, .9, .3, 1.15) both; }
@keyframes kt-pop { from { opacity: 0; transform: translateY(26px) scale(.97); } }
.kt-paper { background: var(--card); border: 1px solid var(--line2); border-radius: 22px; box-shadow: var(--sh2); overflow: hidden; position: relative; }
.kt-paper::before { content: ""; display: block; height: 10px; background: linear-gradient(90deg, var(--coral), var(--gold), var(--teal), var(--blue), var(--violet)); }
.kt-ph { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 16px 18px 12px; border-bottom: 2px dashed var(--line2); }
.kt-pk { font-size: 11.5px; font-weight: 800; letter-spacing: .28em; color: var(--brand-d); margin: 0 0 2px; }
.kt-ph h2 { font-size: clamp(22px, 6vw, 30px); font-weight: 900; margin: 0 0 4px; }
.kt-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; font: 700 12px var(--en); color: var(--ink3); margin: 0; }
.kt-stamp { width: 84px; height: auto; flex: none; margin: -4px -4px -8px 0; }
.kt-dx { margin: 0; display: grid; grid-template-columns: 1fr 1fr; }
.kt-dx > div { padding: 11px 18px; border-bottom: 1px solid var(--line); min-width: 0; }
.kt-dx > div:nth-child(odd) { border-right: 1px solid var(--line); }
.kt-dx dt { font-size: 11.5px; font-weight: 800; color: var(--ink3); letter-spacing: .1em; }
.kt-dx dd { margin: 1px 0 0; font-weight: 900; font-size: 15.5px; line-height: 1.45; }
.kt-dx dd small { font-size: 12px; color: var(--ink2); font-weight: 700; }
.kt-dx > div:first-child dd { color: var(--brand-d); }
.kt-body { display: grid; gap: 4px; padding: 14px 18px 4px; }
.kt-body h3, .kt-menu h3 { font-size: 13px; font-weight: 900; letter-spacing: .14em; color: var(--ink3); margin: 0 0 8px; display: flex; align-items: center; gap: 7px; }
.kt-find p { font-size: 14.5px; line-height: 1.85; margin: 0 0 9px; }
.kt-scores { display: grid; gap: 9px; align-content: start; padding-bottom: 10px; }
.kt-scores h3 { margin-bottom: 2px; }
.kt-sc { display: grid; grid-template-columns: 6.4em 1fr 4.4em; align-items: center; gap: 9px; font-size: 13px; font-weight: 800; }
.kt-sc i { display: block; height: 12px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.kt-sc u { display: block; height: 100%; background: var(--c); border-radius: 99px; text-decoration: none; animation: kt-grow .9s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left; }
@keyframes kt-grow { from { transform: scaleX(0); } }
.kt-sc b { text-align: right; font-family: var(--en); color: var(--c); white-space: nowrap; }
.kt-goalbox { margin: 4px 18px 14px; background: var(--gold-bg); border-radius: 16px; padding: 12px 15px; }
.kt-goalbox p { margin: 0; font-size: 14.5px; line-height: 1.75; font-weight: 700; }
.kt-goalbox p:first-child { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--gold); letter-spacing: .08em; margin-bottom: 2px; }
.kt-track { list-style: none; margin: 0; padding: 4px 10px 14px; display: flex; gap: 0; }
.kt-track li { flex: 1 1 0; min-width: 0; display: grid; justify-items: center; gap: 2px; text-align: center; position: relative; line-height: 1.35; padding: 0 2px; }
.kt-track li::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 4px; background: var(--line2); z-index: 0; }
.kt-track li:first-child::before { display: none; }
.kt-track li.is-done::before, .kt-track li.is-pass::before, .kt-track li.is-now::before { background: var(--ok); }
.kt-track i { width: 30px; height: 30px; border-radius: 50%; background: var(--card); border: 3px solid var(--line2); display: grid; place-items: center; position: relative; z-index: 1; color: #fff; }
.kt-track i .ic { width: 17px; height: 17px; stroke-width: 3; }
.kt-track .is-done i, .kt-track .is-pass i { background: var(--ok); border-color: var(--ok); }
.kt-track .is-now i { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 5px var(--brand-bg); animation: kt-pulse 1.8s ease-in-out infinite; }
@keyframes kt-pulse { 50% { box-shadow: 0 0 0 9px transparent; } }
.kt-track b { font-size: 11.5px; font-weight: 800; } .kt-track small { font-size: 10.5px; color: var(--ink3); font-weight: 700; }
.kt-track .is-now small { color: var(--brand-d); }
.kt-prog2 { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; padding: 12px 18px 16px; border-top: 2px dashed var(--line2); font-size: 12.5px; font-weight: 800; color: var(--ink2); }
.kt-prog2 b { grid-column: 1 / -1; font-family: var(--en); color: var(--ink); font-size: 13.5px; }

/* ── 今日やること ── */
.kt-today { background: var(--ink); color: var(--bg); border-radius: 24px; padding: 18px 16px 20px; box-shadow: var(--sh2); }
.kt-today h2 { font-size: 20px; font-weight: 900; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.kt-today h2 .ic { color: #ffb347; }
.kt-todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.kt-todo > li > a:first-child { display: flex; align-items: center; gap: 12px; background: var(--card); color: var(--ink); border-radius: 18px; padding: 13px 14px; text-decoration: none; line-height: 1.45; transition: transform .1s; }
.kt-todo > li > a:first-child:hover { transform: translateX(3px); }
.kt-n { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font: 800 16px/34px var(--en); text-align: center; flex: none; }
.kt-todo .is-sub .kt-n { background: var(--teal); } .kt-todo .is-more .kt-n { background: var(--bg2); color: var(--ink2); }
.kt-tt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.kt-tt small { font-size: 11.5px; font-weight: 800; color: var(--ink3); display: flex; align-items: center; gap: 5px; }
.kt-tt b { font-size: 16px; } .kt-tt em { font-style: normal; font-size: 12.5px; color: var(--ink2); }
.kt-m { font: 800 12.5px var(--en); color: var(--ink2); background: var(--bg2); border-radius: 99px; padding: 3px 10px; white-space: nowrap; flex: none; }
.kt-pdf { display: inline-flex; align-items: center; gap: 6px; color: inherit; opacity: .85; font-size: 13px; font-weight: 700; margin: 7px 0 0 6px; }
.kt-today .kt-note { color: inherit; opacity: .7; }
.kt-fin { text-align: center; } .kt-fin img { width: 130px; height: auto; } .kt-fin p { margin: 6px 0 0; } .kt-fin b { display: block; font-size: 18px; }

/* ── タブ ── */
.kt-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; position: sticky; top: calc(var(--hd) + 6px); z-index: 5; background: var(--bg); padding: 6px; border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--sh1); }
.kt-tabs button { display: grid; justify-items: center; gap: 2px; border: 0; background: none; border-radius: 13px; padding: 8px 2px; font-size: 11.5px; font-weight: 800; color: var(--ink2); line-height: 1.3; }
.kt-tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.kt-ptitle { display: none; }
.kt-panel { animation: kt-in .25s ease both; }

/* ── 道順 ── */
.kt-road { display: grid; gap: 10px; }
.kt-stage { background: var(--card); border: 1.5px solid var(--line); border-radius: 20px; overflow: hidden; }
.kt-stage.is-now { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.kt-stage > summary { list-style: none; display: flex; align-items: center; gap: 11px; padding: 13px 13px; cursor: pointer; }
.kt-stage > summary::-webkit-details-marker, .kt-opt2 > summary::-webkit-details-marker { display: none; }
.kt-no { width: 36px; height: 36px; border-radius: 12px; background: var(--c); color: #fff; font: 800 17px/36px var(--en); text-align: center; flex: none; }
.kt-stage.is-fin .kt-no { background: var(--ok); }
.kt-st { flex: 1; min-width: 0; display: grid; gap: 2px; line-height: 1.4; }
.kt-st b { font-size: 16px; } .kt-st small { font-size: 12px; color: var(--ink3); font-weight: 700; }
.kt-bar { display: block; height: 6px; background: var(--bg2); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.kt-bar i { display: block; height: 100%; background: var(--c); border-radius: 99px; }
.kt-stage.is-fin .kt-bar i { background: var(--ok); }
.kt-badge { font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: var(--bg2); color: var(--ink2); white-space: nowrap; flex: none; }
.kt-stage.is-now .kt-badge { background: var(--c); color: #fff; } .kt-stage.is-fin .kt-badge { background: var(--ok-bg); color: var(--ok); }
.kt-tg { transition: transform .2s; color: var(--ink3); } details[open] > summary > .kt-tg { transform: rotate(90deg); }
.kt-in { padding: 2px 13px 14px; }
.kt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: kl; }
.kt-ls { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 13px; background: var(--bg); text-decoration: none; color: var(--ink); line-height: 1.45; border: 1px solid transparent; }
.kt-ls:hover { border-color: var(--c, var(--brand)); }
.kt-ls .kt-ck { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line2); display: grid; place-items: center; flex: none; color: transparent; }
.kt-ls .kt-ck .ic { width: 14px; height: 14px; stroke-width: 3.2; }
.kt-ls.is-done .kt-ck { background: var(--ok); border-color: var(--ok); color: #fff; }
.kt-ls.is-done .kt-lt { color: var(--ink3); }
.kt-lt { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 700; }
.kt-lt em { display: inline-block; font-style: normal; font-size: 11px; font-weight: 800; background: var(--ng-bg); color: var(--ng); border-radius: 99px; padding: 0 8px; margin-left: 7px; vertical-align: 1px; }
.kt-ls small { font: 700 11.5px var(--en); color: var(--ink3); white-space: nowrap; } .kt-ls > .ic { color: var(--ink3); width: 15px; height: 15px; }
.kt-opt2 { margin-top: 9px; border: 1.5px dashed var(--line2); border-radius: 14px; }
.kt-opt2 > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; font-size: 13.5px; font-weight: 800; color: var(--ink2); cursor: pointer; }
.kt-opt2 .kt-list { padding: 0 8px 8px; }
.kt-comp { margin-top: 12px; } .kt-comp p { font-size: 12px; font-weight: 800; color: var(--ink3); margin: 0 0 6px; letter-spacing: .06em; }
.kt-comp div, .kt-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.kt .chip { white-space: normal; }

/* ── メニュー ── */
.kt-menu, .kt-cures, .kt-ans { display: grid; gap: 12px; }
.kt-menu section, .kt-cure, .kt-ans section { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; }
.kt-menu h3 { font-size: 15.5px; letter-spacing: 0; color: var(--ink); margin-bottom: 12px; } .kt-menu h3 .ic { color: var(--brand); }
.kt-seg { display: flex; gap: 4px; margin-bottom: 14px; }
.kt-seg span { display: grid; justify-items: center; padding: 10px 4px; border-radius: 12px; background: var(--brand); color: #fff; line-height: 1.3; min-width: 0; }
.kt-seg span:nth-child(2) { background: var(--teal); } .kt-seg span:nth-child(3) { background: var(--blue); } .kt-seg span:nth-child(4) { background: var(--violet); }
.kt-seg b { font: 800 15px var(--en); } .kt-seg small { font-size: 10.5px; font-weight: 700; opacity: .95; text-align: center; }
.kt-week { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.kt-week li { display: grid; justify-items: center; gap: 1px; padding: 9px 0; border-radius: 12px; background: var(--bg2); color: var(--ink3); line-height: 1.3; }
.kt-week li.on { background: var(--brand-bg); color: var(--brand-d); box-shadow: inset 0 0 0 1.5px var(--brand); }
.kt-week b { font-size: 14px; } .kt-week small { font-size: 10px; font-weight: 800; }
.kt-pace { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 12px; }
.kt-pace div { display: grid; gap: 1px; padding: 10px 12px; border-radius: 14px; background: var(--bg2); line-height: 1.4; }
.kt-pace div.on { grid-column: 1 / -1; background: var(--ink); color: var(--bg); }
.kt-pace small { font-size: 11px; font-weight: 800; opacity: .7; } .kt-pace b { font-size: 13px; } .kt-pace span { font: 800 18px var(--jp); color: var(--brand-d); }
.kt-pace .on span { color: #ffb347; font-size: 22px; }

/* ── 悩みへの処方・答え合わせ ── */
.kt-cure h3 { font-size: 16.5px; font-weight: 900; margin: 0 0 6px; }
.kt-cure p { font-size: 14.5px; color: var(--ink2); margin: 0 0 12px; line-height: 1.8; }
.kt-chip-p { background: var(--bg2); }
.kt-ans section.ng { border-color: color-mix(in srgb, var(--ng) 45%, var(--line)); }
.kt-ans-h { display: flex; align-items: center; gap: 9px; margin: 0 0 6px; font-size: 12.5px; font-weight: 800; color: var(--ink3); }
.kt-ans-h b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; background: var(--ok-bg); color: var(--ok); }
.kt-ans .ng .kt-ans-h b { background: var(--ng-bg); color: var(--ng); }
.kt-ans-q { font-weight: 700; margin: 0 0 6px; font-size: 14.5px; line-height: 1.7; }
.kt-ans-a { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 13.5px; margin: 0 0 6px; } .kt-ans-a span:first-child:not(:last-child) { color: var(--ng); }
.kt-ans-x { font-size: 13.5px; color: var(--ink2); margin: 0 0 10px; line-height: 1.8; }
.kt-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.kt-foot .btn { box-shadow: inset 0 0 0 1.5px var(--line2); }

@media (min-width: 720px) {
  .kt-intro { grid-template-columns: 220px 1fr; text-align: left; align-items: center; padding: 34px; gap: 28px; }
  .kt-owl { width: 200px; } .kt-intro .kt-go { justify-content: flex-start; } .kt-intro .kt-note { text-align: left; }
  .kt-q { padding: 26px 32px 32px; } .kt-opts2 { grid-template-columns: 1fr 1fr; }
  .kt-ph { padding: 24px 30px 16px; } .kt-stamp { width: 120px; margin: -10px -6px -14px 0; }
  .kt-dx { grid-template-columns: repeat(4, 1fr); } .kt-dx > div { padding: 14px 20px; border-right: 1px solid var(--line); } .kt-dx > div:last-child { border-right: 0; }
  .kt-body { grid-template-columns: 1.35fr 1fr; gap: 30px; padding: 20px 30px 8px; }
  .kt-goalbox { margin: 4px 30px 16px; } .kt-track { padding: 6px 22px 18px; } .kt-prog2 { padding: 14px 30px 18px; grid-template-columns: auto 1fr auto; } .kt-prog2 b { grid-column: auto; }
  .kt-today { padding: 26px 28px; } .kt-today h2 { font-size: 23px; }
  .kt-tabs button { grid-auto-flow: column; justify-content: center; align-items: center; gap: 7px; font-size: 14px; padding: 11px 4px; }
  .kt-in { padding: 2px 18px 18px; } .kt-stage > summary { padding: 16px 18px; }
  .kt-menu section, .kt-cure, .kt-ans section { padding: 22px 24px; }
  .kt-pace { grid-template-columns: repeat(4, 1fr); }
}

/* ── 印刷・PDF（A4 縦）：1 枚目＝カルテと今日やること、2 枚目から＝道順・メニュー・処方・答え合わせ ── */
.kt-printhd, .kt-printft { display: none; }
@page { size: A4; margin: 11mm 12mm 12mm; }
@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --bg: #fff; --bg2: #f3efe7; --card: #fff; --ink: #1c2333; --ink2: #3f4759; --ink3: #6b7385; --line: #d9d2c4; --line2: #b9b09d;
    --brand: #e2552f; --brand-d: #c2401d; --brand-bg: #fdeee8; --gold: #b47a00; --gold-bg: #fdf3d7; --coral: #e2552f; --teal: #0b8f84; --blue: #2563c9; --blue-bg: #e8f0fd; --violet: #6c4bc4; --green: #3d8a2e;
    --ok: #1d8a4e; --ok-bg: #e2f5ea; --ng: #cf3a3a; --ng-bg: #fdeaea; --mark: #ffe680; color-scheme: light;
  }
  html { font-size: 10.5pt; } body { background: #fff !important; color: #1c2333; }
  .hd, .ft, .ph, .drawer, .scrim, .totop, .readbar, .skip, .sr, .kt-tabs, .kt-foot, .kt-go, .kt-note, .kt-tg, .kt-from, .kt-pdf, .kt-deep, .kt-ls > .ic, .kt-todo a > .ic { display: none !important; }
  .kt, .kt * { animation: none !important; transition: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .kt { max-width: none; width: 100%; padding: 0; margin: 0; }
  .kt a { color: inherit; text-decoration: none; }
  .kt-k { display: block; }
  .kt-printhd { display: flex; justify-content: space-between; align-items: baseline; font-size: 9pt; font-weight: 800; color: #6b7385; border-bottom: 1px solid #b9b09d; padding-bottom: 2mm; margin: 0 0 4mm; letter-spacing: .08em; }
  .kt-printft { display: block; margin: 5mm 0 0; font-size: 8.5pt; color: #6b7385; text-align: center; }

  /* 1 枚目：カルテの用紙 */
  .kt-paper { box-shadow: none; border: 1.5px solid #1c2333; border-radius: 4mm; break-inside: avoid; }
  .kt-paper::before { height: 3mm; }
  .kt-ph { padding: 4mm 6mm 3mm; } .kt-ph h2 { font-size: 20pt; } .kt-stamp { width: 24mm; margin: -2mm 0 -3mm; }
  .kt-dx { grid-template-columns: repeat(4, 1fr); } .kt-dx > div { padding: 2.5mm 4mm; border-right: 1px solid var(--line); } .kt-dx > div:last-child { border-right: 0; }
  .kt-dx dd { font-size: 11.5pt; }
  .kt-body { grid-template-columns: 1.4fr 1fr; gap: 7mm; padding: 4mm 6mm 1mm; }
  .kt-find p { font-size: 9.5pt; line-height: 1.7; margin-bottom: 1.6mm; }
  .kt-sc { font-size: 9.5pt; } .kt-goalbox { margin: 1mm 6mm 3mm; padding: 2.5mm 4mm; } .kt-goalbox p { font-size: 10pt; }
  .kt-track { padding: 1mm 4mm 3mm; } .kt-track .is-now i { box-shadow: none; }
  .kt-prog2 { padding: 2.5mm 6mm 3mm; grid-template-columns: auto 1fr auto; } .kt-prog2 b { grid-column: auto; }
  .kt-today { background: #fff; color: #1c2333; border: 1.5px solid #1c2333; border-radius: 4mm; box-shadow: none; padding: 4mm 5mm; margin-top: 5mm; break-inside: avoid; }
  .kt-today h2 { font-size: 13pt; margin-bottom: 2.5mm; } .kt-today h2 .ic { color: var(--brand); }
  .kt-todo { gap: 1.5mm; } .kt-todo > li > a:first-child { border: 1px solid var(--line2); border-radius: 3mm; padding: 2mm 3mm; }
  .kt-tt b { font-size: 11pt; } .kt-n { width: 7mm; height: 7mm; font-size: 10pt; line-height: 7mm; }

  /* 2 枚目から */
  .kt-panel, .kt-panel[hidden] { display: block !important; }
  .kt-ptitle { display: block; font-size: 13pt; font-weight: 900; margin: 6mm 0 3mm; padding-bottom: 1.5mm; border-bottom: 2px solid #1c2333; }
  #kt-p-road { break-before: page; } #kt-p-road .kt-ptitle { margin-top: 0; }
  .kt-road { gap: 2.5mm; }
  .kt-stage { border: 1px solid var(--line2); border-radius: 3mm; box-shadow: none !important; }
  .kt-stage > summary { padding: 2mm 3mm; gap: 3mm; break-after: avoid; } .kt-no { width: 8mm; height: 8mm; line-height: 8mm; font-size: 11pt; border-radius: 2mm; }
  .kt-st b { font-size: 11.5pt; } .kt-bar { display: none; } .kt-in { padding: 0 3mm 2.5mm; }
  .kt-say { font-size: 9pt; margin-bottom: 2mm; line-height: 1.6; }
  .kt-list { grid-template-columns: 1fr 1fr; gap: 1mm 4mm; } .kt-list li { break-inside: avoid; }
  .kt-ls { background: none; border: 0; border-bottom: 1px dotted var(--line2); border-radius: 0; padding: 1.2mm 0; gap: 2mm; }
  .kt-ls .kt-ck { width: 4mm; height: 4mm; border-radius: 1mm; border: 1.2px solid #1c2333; } .kt-ls .kt-ck .ic { width: 3mm; height: 3mm; }
  .kt-ls.is-done .kt-ck { background: #1c2333; border-color: #1c2333; } .kt-ls.is-done .kt-lt { color: inherit; }
  .kt-lt { font-size: 9.5pt; } .kt-lt em { font-size: 7.5pt; } .kt-ls small { font-size: 8pt; }
  .kt-opt2 { margin-top: 2mm; border-radius: 2mm; } .kt-opt2 > summary { padding: 1.5mm 3mm; font-size: 9pt; }
  .kt-comp { margin-top: 2mm; } .kt .chip { border: 1px solid var(--line2); padding: .6mm 2.5mm; font-size: 8.5pt; background: none; }
  .kt-menu { grid-template-columns: 1fr 1fr; gap: 3mm; } .kt-menu section:last-child { grid-column: 1 / -1; }
  .kt-menu section, .kt-cure, .kt-ans section { border: 1px solid var(--line2); border-radius: 3mm; padding: 3mm 4mm; break-inside: avoid; }
  .kt-menu h3 { font-size: 11pt; margin-bottom: 2mm; } .kt-rules { font-size: 9pt; line-height: 1.6; }
  .kt-seg { margin-bottom: 2.5mm; } .kt-seg span { padding: 1.5mm 1mm; } .kt-week { margin-bottom: 2mm; } .kt-week li { padding: 1.5mm 0; }
  .kt-pace { grid-template-columns: repeat(5, 1fr); gap: 2mm; margin-bottom: 2mm; } .kt-pace div.on { grid-column: auto; } .kt-pace div { padding: 2mm; } .kt-pace b { font-size: 8.5pt; } .kt-pace span, .kt-pace .on span { font-size: 11pt; }
  .kt-cures { gap: 2.5mm; } .kt-cure h3 { font-size: 11pt; margin-bottom: 1mm; } .kt-cure p { font-size: 9.5pt; margin-bottom: 2mm; line-height: 1.65; }
  .kt-ans { grid-template-columns: 1fr 1fr; gap: 2.5mm; } .kt-ans > .kt-say { grid-column: 1 / -1; margin: 0; }
  .kt-ans-q, .kt-ans-a, .kt-ans-x { font-size: 9pt; margin-bottom: 1mm; line-height: 1.6; } .kt-ans-h { margin-bottom: 1mm; } .kt-ans-h b { width: 6mm; height: 6mm; font-size: 10pt; }
}
@media (prefers-reduced-motion: reduce) { .kt-owl, .kt-write, .kt-track .is-now i { animation: none; } }

/* レベル診断との連携の案内 */
.kt-from { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; background: var(--blue-bg); color: var(--ink); border-radius: 16px; padding: 12px 16px; font-size: 14px; font-weight: 700; line-height: 1.7; margin: 0 0 4px; }
.kt-from span { flex: 1 1 260px; }
.kt-deep { margin-top: 4px; }
/* 印刷では、閉じている段階の中身も必ず出す（ブラウザの印刷メニューから刷った場合の保険） */
@media print { .kt details::details-content { content-visibility: visible !important; display: block !important; height: auto !important; } }
