/* 一画面の密度を上げ、スクロールはページ全体だけにする。 */
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.print-only{display:none}
body{font-size:13px;line-height:1.5}
main{max-width:1600px;padding:14px 22px 30px}
.topbar{min-height:54px;padding:0 22px;gap:28px}.brand{font-size:19px}.brand-mark{width:30px;height:30px}.brand-sub{font-size:8px}
h1{font-size:22px}h2{font-size:15px;margin-bottom:10px}h3{font-size:13px}.panel{padding:14px;margin-bottom:12px;border-radius:8px}
.page-head{margin-bottom:14px}.button{padding:7px 11px}.button.small{padding:4px 8px;font-size:11px}.note{margin:8px 0;padding:9px 12px}.empty{padding:20px 12px}
.case-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.case-bar h1{font-size:21px;margin:0}.case-bar>span{font-size:11px}.case-edit{margin-left:auto}.back-link{font-size:11px;white-space:nowrap}
.case-context{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:7px 0;font-size:11px;color:var(--muted)}.extraction-inline{color:#85591f;font-weight:700}
.tabs{margin-bottom:10px;gap:23px}.tabs a{padding:7px 0;font-size:12px}.tabs .manual-link{margin-left:auto;font-size:11px}
.next-action{padding:10px 14px;border-radius:8px;margin-bottom:12px;gap:12px}.next-action h2{font-size:14px;margin:0 0 3px}.next-action .eyebrow{display:none}.next-action p{font-size:11px}.next-action .actions{gap:6px;max-width:55%}.next-action .button{padding:6px 9px;font-size:11px}
.case-workspace{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:14px;align-items:start}.case-workspace>div{min-width:0}
.panel-title{margin-bottom:9px}.panel-title a{font-size:11px}.actual-wire{display:flex;flex-wrap:wrap;gap:4px 10px;padding:8px 10px;background:var(--teal-soft);border:1px solid #c8ddd1;margin-bottom:8px;border-radius:4px;font-size:11px}.actual-wire b{color:var(--teal)}.actual-wire small{margin-left:auto}
.progress-panel{padding:12px}.plan-matrix{border-collapse:collapse;table-layout:fixed;width:100%;font-size:12px}.plan-matrix th,.plan-matrix td{border:1px solid #d5deda;padding:8px 9px;text-align:left;vertical-align:top;overflow-wrap:anywhere}.plan-matrix thead th{background:#edf3ef;font-weight:700;color:#526960;font-size:11px;position:sticky;top:0;z-index:1}.plan-matrix th:nth-child(1){width:20%}.plan-matrix th:nth-child(2),.plan-matrix th:nth-child(3){width:24%}.plan-matrix th:nth-child(4){width:21%}.plan-matrix th:nth-child(5){width:11%}.plan-matrix tbody th{font-weight:500}.plan-matrix th strong{display:block;font-size:12px;margin-bottom:4px}.plan-matrix .badge{font-size:10px;padding:1px 4px;margin:1px 3px 0 0}.wire-cell{white-space:pre-wrap;line-height:1.55}.plan-matrix .current>th,.plan-matrix .current>td{background:#e4f2eb}.plan-matrix .current>th{border-left:3px solid var(--teal)}.plan-matrix .omitted{background:#f5f6f5;color:#7d8682}.aux-summary{display:block;margin-top:4px;white-space:pre-wrap}.phase-instructions>td{background:#f8faf8;padding:14px}.instruction-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}.instruction-grid h4{color:var(--teal);margin:0 0 6px;font-size:12px}.instruction-grid p{margin:0 0 7px;font-size:12px}.instruction-grid .note{margin:4px 0;padding:8px}
.mini-matrix{font-size:11px}.mini-matrix th,.mini-matrix td{padding:6px}.mini-matrix th:nth-child(1){width:28%}.mini-matrix th:nth-child(2),.mini-matrix th:nth-child(3){width:27%}.mini-matrix th:nth-child(4){width:18%}.mini-matrix th strong{font-size:11px}.mini-matrix .button{padding:4px;font-size:10px;white-space:normal}.mini-matrix .instruction-grid{grid-template-columns:1fr}.mini-matrix .phase-instructions td{padding:10px}
.manual-checkpoint{display:flex;flex-direction:column;gap:3px;background:#fff7e8;border-left:3px solid #b48539;padding:8px 10px;margin:9px 0;font-size:11px}.manual-checkpoint small{font-size:10px}.workspace-actions{gap:6px}
.exchange-panel{padding:12px}.compact-composer{border:1px solid #c9ddd2;background:#f8fcf9;border-radius:7px;padding:10px;margin-bottom:12px}.composer-head{display:flex;justify-content:space-between;gap:8px;font-size:12px}.composer-head span{font-size:10px}.compact-composer .direct-choices{gap:4px;margin:7px 0}.compact-composer .choice-button{font-size:11px;padding:4px 7px}.compact-composer textarea{min-height:62px;padding:8px;font-size:12px}.compact-composer .composer-row{margin-top:7px;font-size:11px}.compact-composer .check{font-size:11px}.followup-field{display:flex;align-items:center;gap:5px}.followup-field input{padding:3px 6px;max-width:135px}
.history-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:10px 0}.history-heading h2{margin:0}.history-heading .chips{gap:4px}.message{margin-bottom:12px;max-width:96%}.message-meta{font-size:10px;gap:6px;margin-bottom:3px}.bubble{padding:8px 10px;font-size:12px}.message-actions{margin-top:3px;gap:5px}.reply-quote{padding:3px 6px;margin-bottom:5px}.message-full{margin:0}.message-full>summary{color:var(--ink);font-size:12px;font-weight:400;white-space:pre-line}.message-full>summary b{color:var(--teal);font-size:11px}.message-full[open]>summary{font-size:10px;color:var(--muted)}.message-full[open]>.preline{margin-top:8px}.attachment{padding:5px 0;font-size:11px;gap:6px}
.sheet-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:9px;font-size:11px}.sheet-actions{margin-left:auto;display:flex;gap:5px}.plan-sheet{padding:0;border:0;box-shadow:none;max-width:none}.plan-facts{display:grid;grid-template-columns:90px minmax(0,1fr) 90px minmax(0,1.4fr);gap:0;margin:0;font-size:12px;border:1px solid #d5deda;border-bottom:0}.plan-facts dt,.plan-facts dd{padding:7px 10px;margin:0;border-bottom:1px solid #d5deda;overflow-wrap:anywhere}.plan-facts dt{background:#f0f4f1;color:#587164;font-weight:700}.plan-extra{margin:0 0 10px;padding:6px 10px;border:1px solid #d5deda;border-top:0;font-size:12px}.plan-extra summary{font-size:11px}.sheet-foot{font-size:11px;color:var(--muted);padding:7px 0}
.progress-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}.visit-checks .field{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;border-bottom:1px solid var(--line);padding:4px 0;font-size:11px}.visit-checks .direct-choices{margin:0;gap:3px}.visit-checks .choice-button{font-size:10px;padding:4px 6px}
.edit-matrix .field>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.edit-matrix .choice-button{font-size:10px;padding:3px 5px}.edit-matrix .direct-choices{gap:3px;margin:0}.edit-matrix input{padding:6px;font-size:12px}.edit-matrix .phase-instructions .field>span{position:static;width:auto;height:auto;clip-path:none}.publish-controls{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding-top:12px}.publish-controls>.field{flex:1 1 350px}.publish-controls textarea{min-height:54px}
.overview-heading{display:flex;align-items:center;gap:12px;margin:2px 0 10px}.overview-heading h1{margin:0;font-size:21px}.overview-heading .head-actions{margin-left:auto}.overview-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:8px}.overview-toolbar .chips{gap:5px}.overview-toolbar .search{max-width:250px}.overview-toolbar .search input{padding:6px 10px}.view-toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:start;margin:8px 0}.clinic-choices{margin:4px 0 0;flex:1;min-width:240px}.clinic-choices[open]{flex-basis:100%}.clinic-choices .chips{padding-top:8px}.overview-panel{padding:0}.overview-grid{table-layout:fixed;border-collapse:collapse;width:100%;font-size:11px}.overview-grid th{background:#edf3ef;color:#557063;text-align:left;padding:7px 9px;position:sticky;top:0;z-index:1}.overview-grid td{padding:8px 9px;border-top:1px solid var(--line);vertical-align:middle;overflow-wrap:anywhere}.overview-grid th:nth-child(1){width:20%}.overview-grid th:nth-child(2){width:9%}.overview-grid th:nth-child(3){width:13%}.overview-grid th:nth-child(4){width:20%}.overview-grid th:nth-child(5){width:20%}.overview-grid th:nth-child(6){width:8%}.overview-grid th:nth-child(7){width:10%}.overview-grid small{display:block;font-size:10px;margin-top:2px}.patient-link{font-weight:700;color:var(--ink)}.overview-grid .overdue{color:var(--red)}.overview-grid tbody tr:hover{background:#f3f8f5}.overview-grid .row-urgent td:first-child{border-left:3px solid var(--red)}
.form-grid{gap:10px}.form-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.field{font-size:11px}.choice-button{padding:5px 8px;font-size:11px}.direct-choices{margin:3px 0 6px;gap:4px}.stat-grid{gap:12px}.stat-row,.account-row,.audit-row{padding:8px 0}.login{margin:10px auto}.login-intro{margin-bottom:12px}.account-group{padding:12px 0 0}.account-group h2{font-size:14px}footer{padding:12px 22px;font-size:10px}
@media(max-width:1000px){.next-action{flex-direction:row;align-items:center}.next-action .actions{max-width:52%;justify-content:flex-end}.case-workspace{gap:10px}.instruction-grid{gap:12px}.plan-matrix{font-size:11px}.form-grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:740px){main{padding:10px}.topbar{padding:0 10px;gap:12px}.case-workspace{grid-template-columns:1fr}.case-bar h1{font-size:18px}.case-context{gap:5px 10px}.case-edit{margin-left:0}.next-action{align-items:flex-start;flex-direction:column;gap:8px}.next-action .actions{max-width:100%;width:auto}.next-action .button{width:auto}.tabs{gap:16px}.tabs a{font-size:11px}.manual-link{display:none}.plan-matrix th,.plan-matrix td{padding:5px;font-size:10px}.plan-matrix th strong{font-size:10px}.plan-matrix .button{padding:4px;font-size:10px}.plan-facts{grid-template-columns:65px minmax(0,1fr)}.instruction-grid,.progress-form-grid{grid-template-columns:1fr}.sheet-actions{margin-left:0}.visit-checks .field{display:block}.overview-toolbar .search{max-width:none;width:100%;margin:0}.overview-grid th:nth-child(2),.overview-grid td:nth-child(2),.overview-grid th:nth-child(5),.overview-grid td:nth-child(5){display:none}.overview-grid th:nth-child(1){width:25%}.overview-grid th:nth-child(4){width:30%}.overview-grid th:nth-child(7){width:16%}.overview-grid td{padding:7px 5px}.form-grid.three{grid-template-columns:1fr}.choice-button{min-height:32px}}
@media print{.print-only{display:block}.no-print,.sheet-tools,.sheet-foot{display:none!important}.plan-matrix th,.plan-matrix td{font-size:10px;padding:5px}.plan-matrix thead th{position:static}.phase-instructions[hidden]{display:table-row!important}.phase-instructions{break-inside:avoid}.plan-matrix button{display:none}.plan-extra{display:block}.plan-extra>*{display:block}.plan-facts{grid-template-columns:70px 1fr 70px 1fr}.instruction-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.plan-matrix .current>th,.plan-matrix .current>td{background:white}}

/* 診断記録は中央のみ。院と中央の会話は現在の状態の下に時系列で並べる。 */
.diagnosis-record small{font-size:10px}.treatment-status{display:grid;grid-template-columns:1.2fr 1.3fr 1fr;background:white;border:1px solid #b8d2c4;border-top:3px solid var(--teal);border-radius:6px;margin-bottom:10px}.treatment-status>div{padding:12px 15px;min-width:0;border-right:1px solid #dbe6df}.treatment-status>div:last-child{border:0}.status-label{display:block;font-size:11px;color:var(--muted);margin-bottom:5px}.treatment-status strong{display:block;font-size:19px;line-height:1.4}.treatment-status small,.treatment-status a{display:block;font-size:10px;margin-top:5px}.status-wire span{display:block;font-size:11px;color:var(--muted)}.status-wire b{font-size:15px;color:var(--ink);font-weight:600;overflow-wrap:anywhere}
.timeline-actions{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin:10px 0}.timeline-actions>a:last-child{margin-left:auto}.timeline-panel{padding:12px 20px}.timeline-panel .history-heading{margin:0 0 10px;flex-wrap:wrap}.history-heading h2 small{font-weight:400;font-size:10px;margin-left:8px}.timeline-day{display:flex;align-items:center;gap:12px;margin:14px 0 12px;color:#5b7067;font-size:11px}.timeline-day:before,.timeline-day:after{content:"";flex:1;height:1px;background:var(--line)}.timeline-day time{background:#f1f5f2;border-radius:14px;padding:3px 12px}.chronology .message{max-width:85%;margin-bottom:13px}.chronology .bubble{font-size:13px;line-height:1.7;padding:10px 13px}.speaker-side{font-size:10px;font-weight:600;color:var(--teal)}.timeline-panel .compact-composer{margin-top:20px;margin-bottom:0;padding:12px}.timeline-panel .compact-composer textarea{min-height:65px}.timeline-panel .message-full>summary{font-size:13px}
.clinic-grid th:nth-child(1){width:22%}.clinic-grid th:nth-child(2){width:16%}.clinic-grid th:nth-child(3){width:22%}.clinic-grid th:nth-child(4){width:20%}.clinic-grid th:nth-child(5){width:9%}.clinic-grid th:nth-child(6){width:11%}
/* ワイヤーシーケンス原票の見出し、列順、上顎・下顎の対を再現する。 */
.excel-document{background:#fff;border:1px solid #9eaaa1;padding:13px 15px;color:#202b26}.excel-title{display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:2px solid #65786a;padding:0 2px 6px}.excel-title h2{font-size:20px;letter-spacing:.18em;margin:0}.excel-title>span{font-size:11px}.excel-meta{width:100%;border-collapse:collapse;table-layout:fixed;font-size:11px;margin:7px 0 10px}.excel-meta th,.excel-meta td{border:1px solid #aeb9b1;padding:5px 7px;text-align:left;vertical-align:top;overflow-wrap:anywhere}.excel-meta th{width:9%;background:#eef2ed;font-weight:600}.excel-meta td:nth-child(2){width:23%}.excel-meta td:nth-child(4){width:29%}.excel-meta td:nth-child(6){width:21%}
.excel-sequence{border-collapse:collapse;table-layout:fixed;width:100%;font-size:11px;line-height:1.5}.excel-sequence th,.excel-sequence td{border:1px solid #a5b1a8;padding:5px 6px;vertical-align:top;overflow-wrap:anywhere}.excel-sequence thead th{background:#e9efdf;text-align:center;vertical-align:middle;font-size:10px;color:#263b2c}.excel-sequence thead small{display:block;font-size:9px;font-weight:400;color:#4e6151}.excel-sequence .col-check{width:3%}.excel-sequence .col-phase{width:17%}.excel-sequence .col-el{width:6%}.excel-sequence .col-size{width:4.5%}.excel-sequence .col-site{width:7%}.excel-sequence .col-jaw{width:4.5%}.excel-sequence .col-aux{width:3.5%}.excel-sequence .col-bu{width:5%}.excel-sequence .col-notes{width:46%}.excel-phase-name{text-align:left;background:#f4f6ee;font-size:12px;font-weight:500}.excel-phase-name b{font-weight:600}.excel-phase-name small{display:block;font-size:10px;margin-top:6px;line-height:1.45;color:#526353}.excel-phase-name .badge{font-size:9px;margin-top:5px}.excel-sequence .excel-check{font-size:15px;text-align:center;padding:5px 2px;background:#f4f6ee}.excel-sequence .excel-jaw{font-size:10px;text-align:center;font-weight:500;background:#f9faf7;vertical-align:middle}.excel-el,.excel-aux{font-size:10px;text-align:center}.excel-sequence .excel-aux{padding:5px 2px}.excel-phase+tbody>tr:first-child>*{border-top:2px solid #819385}.sheet-wire{font-size:10px;background:#f2f6f3;padding:3px 5px;margin-bottom:4px;white-space:pre-wrap}.sheet-wire b{font-weight:500;color:#556b5c}.excel-off .excel-phase-name,.excel-off .excel-check{background:#f2f2f0;color:#6b716e}.excel-current .excel-phase-name{box-shadow:inset 4px 0 var(--teal);background:#e6f1e8}.excel-footnotes{font-size:10px;color:#58665c;padding-top:9px}.excel-footnotes p{margin-bottom:5px}
@media(min-width:1150px){.excel-sequence{font-size:12px}.excel-sequence th,.excel-sequence td{padding:7px 9px}.excel-phase-name{font-size:13px}}
@media(max-width:740px){.treatment-status{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr)}.treatment-status>div:first-child{grid-column:1/-1;border-right:0;border-bottom:1px solid #dbe6df}.treatment-status>div{padding:9px 11px}.treatment-status strong{font-size:17px}.status-wire b{font-size:12px}.timeline-panel{padding:10px}.chronology .message{max-width:95%}.timeline-actions>a:last-child{margin-left:0}.clinic-grid th:nth-child(2),.clinic-grid td:nth-child(2),.clinic-grid th:nth-child(5),.clinic-grid td:nth-child(5){display:table-cell}.clinic-grid th:nth-child(4),.clinic-grid td:nth-child(4){display:none}.clinic-grid th:nth-child(1){width:27%}.clinic-grid th:nth-child(3){width:27%}.clinic-grid th:nth-child(6){width:18%}.excel-document{padding:8px 5px}.excel-meta th,.excel-meta td{padding:4px 3px;font-size:9px}.excel-sequence th,.excel-sequence td{padding:4px 2px;font-size:9px}.excel-phase-name small{font-size:9px}.sheet-wire{padding:2px;font-size:9px}.excel-sequence thead th,.excel-sequence thead small{font-size:8px}.excel-sequence .excel-check{font-size:12px}.excel-footnotes{font-size:9px}}
@media print{.excel-document{border:0;padding:0}.excel-sequence{font-size:10px}.excel-sequence thead{display:table-header-group}.excel-sequence th,.excel-sequence td{padding:4px}.excel-phase{break-inside:avoid}.excel-title{margin-top:0}.excel-sequence .excel-current .excel-phase-name{box-shadow:none}.excel-footnotes{font-size:9px}}
.excel-sequence thead th{padding:5px 2px;overflow-wrap:normal}.excel-sequence thead tr:nth-child(2) th{white-space:nowrap;font-size:9px}

/* 実施報告も相談も一つの投稿欄で入力し、同じ履歴へ送る。 */
.composer-modes,.report-reasons{display:flex;gap:5px;flex-wrap:wrap}.composer-head{align-items:center;flex-wrap:wrap}.visit-heading{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:10px 0}.visit-heading>.field{display:flex;align-items:center;gap:6px}.visit-heading input{width:145px;padding:4px}.procedure-picker{border:0;padding:0;margin:9px 0}.procedure-picker legend{font-size:11px;font-weight:600;margin-bottom:5px}.procedure-chips{display:flex;gap:5px;flex-wrap:wrap}.procedure-chips .check{padding:5px 9px;border:1px solid var(--line);border-radius:5px;background:white}.procedure-chips .check:has(input:checked){background:var(--teal-soft);border-color:var(--teal)}.procedure-detail{border:1px solid #d7e3dc;padding:8px 10px;border-radius:5px;margin:7px 0;background:white;min-width:0}.procedure-detail legend{font-size:11px;font-weight:600}.procedure-detail>.field{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.procedure-detail .direct-choices{margin:0}.procedure-detail input[type=text],.procedure-detail>input{padding:6px;font-size:12px;width:100%;margin-top:5px}.procedure-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 9px}.wire-report-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.wire-choices{display:flex;gap:3px;flex-wrap:wrap;margin-top:4px}.wire-choices .button{padding:2px 4px;font-size:10px}.report-checks,.report-evidence{margin:8px 0}.report-checks>summary,.report-evidence>summary{font-size:11px;font-weight:600}.report-checks .visit-checks{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}.report-checks .visit-checks .field{display:block}.evidence-inputs{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.evidence-inputs input[type=file]{padding:4px;font-size:11px;max-width:250px}.phase-photo-check{margin-top:6px}.report-scan-hint{font-size:10px;margin:5px 0}.compact-composer .composer-body{margin-top:9px}.composer-body>span{font-size:11px}.visit-message-date{font-size:11px;color:var(--muted);margin-bottom:5px}.visit-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 15px}.visit-facts>div{border-bottom:1px solid #dbe6df;padding:3px 0}.visit-facts b{display:block;font-size:11px;color:var(--teal)}.visit-facts span{font-size:13px;overflow-wrap:anywhere}.visit-note{margin-top:8px}.reported-checks{font-size:11px;margin-top:7px}
@media(max-width:740px){.procedure-details,.wire-report-grid,.report-checks .visit-checks{grid-template-columns:1fr}.visit-facts{grid-template-columns:1fr}.report-reasons .button{font-size:10px;padding:4px 6px}.composer-modes .button{padding:4px 7px}}
.visit-heading>.field>span{white-space:nowrap}

/* 画面だけを調整し、A4計画書の印刷用スタイルを保つ。 */
@media screen{
  :root{--ink:#20343b;--muted:#52656e;--teal:#09665d;--amber:#855015;--red:#a33134}
  body{font-family:"BIZ UDPGothic","BIZ UDPゴシック","Meiryo","メイリオ",sans-serif;font-size:15px;line-height:1.55;font-weight:400}
  main{max-width:1200px;padding:12px 16px 28px;overflow-wrap:anywhere}
  footer{max-width:1200px;padding:12px 16px;font-size:12px}
  .topbar{min-height:58px;padding:0 max(16px,calc((100% - 1168px)/2));gap:24px;flex-wrap:nowrap}
  nav{gap:22px;flex-wrap:nowrap;min-width:0}nav a{font-size:14px;font-weight:700}
  .brand-sub{font-size:12px;font-weight:600;letter-spacing:0}
  .user-switch{font-size:12px;font-weight:700;min-width:0;overflow-wrap:anywhere}
  h1,.overview-heading h1,.case-bar h1{font-size:23px;line-height:1.4}
  h2,.next-action h2,.account-group h2{font-size:17px}
  h3,.phase-item h3{font-size:15px}
  h1,h2,h3,h4,.patient-link,.field,.button,.choice-button,summary{font-weight:700}
  .panel{padding:12px;margin-bottom:12px}.overview-panel,.table-panel,.plan-sheet{padding:0}
  .page-head{margin-bottom:12px;gap:10px;flex-wrap:wrap}
  .panel-title,.overview-heading,.account-row,.audit-row{flex-wrap:wrap}
  .detail-grid{gap:14px}.metrics{gap:12px;margin-bottom:16px}.metric{padding:12px 14px}
  .table-heading{padding:12px 14px 8px}.list-foot{padding:10px 14px}
  .button{font-size:14px;padding:6px 10px}
  .button.small,.next-action .button,.mini-matrix .button,.plan-matrix .button,
  .compact-composer .choice-button,.visit-checks .choice-button,.edit-matrix .choice-button,
  .wire-choices .button,.report-reasons .button,.composer-modes .button{font-size:12px;font-weight:700;padding:4px 7px}
  .choice-button{font-size:12px;font-weight:700;padding:5px 8px}
  input:not([type=checkbox]):not([type=radio]),select,textarea,
  .compact-composer textarea,.edit-matrix input,.procedure-detail input[type=text],.procedure-detail>input{font-size:15px;padding:7px 9px}
  input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}
  .field,label.check,.compact-composer .check{font-size:14px;font-weight:700}
  .status-label{font-weight:700}
  small,.eyebrow,.metric-note,.badge,.case-table th,.case-table small,.list-foot,
  .phase-number,.wire-row b,.date-divider,.message-meta,.count-dot,.case-bar>span,
  .back-link,.case-context,.tabs .manual-link,.next-action p,.panel-title a,
  .actual-wire,.plan-matrix thead th,.plan-matrix .badge,.mini-matrix th strong,
  .manual-checkpoint,.manual-checkpoint small,.composer-head span,
  .compact-composer .composer-row,.message-full>summary b,.message-full[open]>summary,
  .attachment,.sheet-tools,.plan-extra summary,.sheet-foot,.visit-checks .field,
  .overview-grid small,.diagnosis-record small,.status-label,
  .treatment-status small,.treatment-status a,.status-wire span,
  .history-heading h2 small,.timeline-day,.speaker-side,.excel-title>span,
  .excel-sequence thead th,.excel-sequence thead small,.excel-sequence thead tr:nth-child(2) th,
  .excel-phase-name small,.excel-phase-name .badge,.excel-sequence .excel-jaw,.excel-el,.excel-aux,
  .sheet-wire,.excel-footnotes,.procedure-picker legend,.procedure-detail legend,
  .report-checks>summary,.report-evidence>summary,.evidence-inputs input[type=file],
  .report-scan-hint,.composer-body>span,.visit-message-date,.visit-facts b,.reported-checks{font-size:12px}
  .badge{color:var(--muted)}.badge.teal{color:var(--teal)}.badge.amber{color:var(--amber)}.badge.red{color:var(--red)}
  .tabs{gap:20px}.tabs a{font-size:14px;font-weight:700}
  .case-table td,.case-table .next-cell,.plan-matrix,.mini-matrix,.plan-matrix th strong,
  .overview-grid,.excel-meta,.excel-meta th,.excel-meta td,.excel-sequence,
  .excel-sequence th,.excel-sequence td,.excel-phase-name{font-size:14px}
  .case-table td{padding:10px 9px}.overview-grid th,.overview-grid td{padding:7px 8px}
  .overview-grid th,.plan-matrix th,.excel-meta th,.excel-sequence thead th{font-weight:700;overflow-wrap:anywhere}
  .plan-matrix th,.plan-matrix td{padding:7px}.mini-matrix th,.mini-matrix td{padding:6px}
  .excel-document{padding:10px 12px}.excel-sequence th,.excel-sequence td{padding:6px 5px}
  .excel-sequence thead th{font-size:12px;padding:5px 2px;overflow-wrap:anywhere}
  .excel-sequence thead tr:nth-child(2) th{white-space:normal}
  .excel-phase-name{font-weight:700}.excel-sequence .excel-jaw{font-weight:700}
  .excel-phase-name small,.excel-sequence thead small,.sheet-wire b,.excel-footnotes,
  .excel-off .excel-phase-name,.excel-off .excel-check,.plan-matrix .omitted,.phase-item.skipped,
  .reply-quote,.note,.extract-banner small{color:var(--muted)}
  .warning{color:var(--amber)}.extraction-inline{color:var(--amber)}
  .bubble,.chronology .bubble,.message-full>summary,.timeline-panel .message-full>summary,
  .compact-composer textarea,.jaw-grid p,.instruction-grid p,.wire-row,.key-values,
  .visit-facts span{font-size:15px}
  .note,.account-row,.audit-row,.stat-row,.login-intro,.plan-facts,.plan-extra{font-size:14px}
  .message-meta{gap:6px}.chronology .bubble{padding:9px 12px;line-height:1.6}
  .timeline-panel{padding:12px 14px}.timeline-panel .compact-composer{margin-top:14px}
  .composer-head{font-size:14px}.reply-quote{font-size:12px}
  .status-wire b{font-size:15px;font-weight:700}
  .case-bar>*,.case-context>*,.next-action>div,.account-row>div,.audit-row>div{min-width:0}
  .treatment-status{grid-template-columns:minmax(0,1.2fr) minmax(0,1.3fr) minmax(0,1fr)}
  .treatment-status>div{padding:10px 12px}.treatment-status strong{font-size:18px}
  .plan-matrix .instruction-grid{gap:12px}.plan-matrix .phase-instructions td{padding:10px}
  .next-action{padding:10px 14px}.next-action .actions{max-width:55%}
}

@media screen and (max-width:1100px){
  .detail-grid,.case-workspace{grid-template-columns:minmax(0,1fr)}
  .form-grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media screen and (max-width:740px){
  main{padding:10px}.topbar{padding:0 10px;gap:10px}
  nav{gap:12px}nav a{font-size:12px}.user-switch{font-size:12px}
  .tabs{gap:12px}.tabs a{font-size:12px}.case-bar h1{font-size:20px}
  .form-grid.three{grid-template-columns:minmax(0,1fr)}
  .next-action .actions{max-width:100%}.next-action .button{font-size:12px}
  .plan-matrix th,.plan-matrix td{padding:5px;font-size:12px}.plan-matrix th strong{font-size:12px}
  .plan-matrix .button{padding:4px;font-size:12px}
  .treatment-status{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr)}
  .treatment-status strong{font-size:17px}.chronology .message{max-width:95%}
  .excel-document{padding:8px}.excel-title h2{font-size:20px}
  .excel-meta,.excel-meta tbody,.excel-meta tr{display:block}
  .excel-meta tr{display:flex;flex-wrap:wrap}
  .excel-meta th{flex:0 0 28%;width:auto}.excel-meta td{flex:1 1 72%;width:auto}
  .excel-meta th,.excel-meta td{padding:6px;font-size:12px}
  .excel-sequence,.excel-sequence tbody{display:block}.excel-sequence colgroup{display:none}
  .excel-sequence thead,.overview-grid thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .excel-sequence .excel-phase{border:1px solid #a5b1a8;margin-top:10px}
  .excel-sequence tr{display:flex;flex-wrap:wrap}
  .excel-sequence th,.excel-sequence td{min-width:0;padding:7px 6px;font-size:13px;border-width:0 1px 1px 0}
  .excel-sequence .excel-check{flex:0 0 10%;font-size:15px}
  .excel-sequence .excel-phase-name{flex:1 1 90%}
  .excel-sequence .excel-jaw{order:1;flex:0 0 100%;text-align:left;font-size:13px;background:#edf3ef}
  .excel-sequence .excel-el{order:2;flex:1 1 33.333%}
  .excel-sequence .excel-el[colspan]{flex-basis:100%}
  .excel-sequence .excel-aux{order:3;flex:1 1 33.333%}
  .excel-sequence .excel-notes{order:4;flex:0 0 100%;font-size:15px}
  .excel-sequence td[data-label]::before{content:attr(data-label);display:block;color:var(--muted);font-size:12px;font-weight:700;margin-bottom:3px}
  .excel-sequence .excel-phase-name small,.sheet-wire,.excel-footnotes{font-size:12px}
  .overview-grid,.overview-grid tbody{display:block}
  .overview-grid tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 12px;padding:10px;border-top:1px solid var(--line)}
  .overview-grid td:nth-child(n){display:block;width:auto;padding:0;border:0;font-size:14px}
  .overview-grid td:first-child{grid-column:1/-1;padding-bottom:6px;border-bottom:1px solid var(--line)}
  .overview-grid td[data-label]::before{content:attr(data-label);display:block;color:var(--muted);font-size:12px;font-weight:700}
  .central-grid td:nth-child(4),.central-grid td:nth-child(5),
  .clinic-grid td:nth-child(3),.clinic-grid td:nth-child(4){grid-column:1/-1}
  .overview-grid .row-urgent{border-left:3px solid var(--red)}
  .overview-grid .row-urgent td:first-child{border-left:0}
}
/* ログイン後のサイトの選択: 院の名前を横に並べて、縦に長くしない */
.login .account-group .direct-choices{display:flex;flex-wrap:wrap;gap:8px}
.login .account-group .direct-choices .button{width:auto}
.login form .button{width:auto}
/* 左上は名前だけ(ロゴは置かない)。狭い画面でも名前を小さくして出す */
@media(max-width:650px){.topbar .brand>span:last-child{display:inline;font-size:13px;letter-spacing:0}}
/* ボタンで開いた入力欄(装着済み・セット・報告など)は右上の「閉じる」で戻せる */
.action-panel{position:relative}.action-close{display:flex;justify-content:flex-end;margin:-6px -6px 4px 0}
/* 原表のまま取り込んだ計画書。画面の中にスクロールを作らず、幅に合わせて折り返す */
.raw-sheet-table{width:100%;table-layout:fixed;border-collapse:collapse;font-size:11px}.raw-sheet-table td{border:1px solid var(--line);padding:3px 4px;vertical-align:top;overflow-wrap:anywhere}
