:root{font-family:"Noto Sans JP",system-ui,-apple-system,sans-serif;color:#1d2940;background:#f5f6fa;font-size:16px;line-height:1.7}*{box-sizing:border-box}body{margin:0}header{background:#164f46;color:white;padding:28px max(24px,calc((100% - 1056px)/2))}header p{margin:8px 0 0;color:#d5e7df;font-size:.9rem}.brand{font-size:1.45rem;letter-spacing:.04em}.prototype{display:inline-block;margin-left:16px;padding:2px 10px;border:1px solid #94bdb2;border-radius:6px;font-size:.75rem;vertical-align:middle}main{max-width:1104px;margin:auto;padding:24px}.notice{background:#fff8e7;border:1px solid #eadcaf;border-radius:10px;padding:16px 20px;font-size:.85rem;color:#62532d}.notice strong{font-size:.9rem}summary{cursor:pointer;margin-top:6px}nav{display:flex;gap:8px;margin:28px 0;border-bottom:1px solid #dce1eb}nav a{padding:12px 24px;text-decoration:none;color:#59657a;font-weight:650}nav a[aria-current]{color:#292e92;border-bottom:3px solid #292e92;background:#eef0fb;border-radius:8px 8px 0 0}.eyebrow{font-size:.78rem;color:#68758b;margin:0;letter-spacing:.08em}h1{font-size:1.8rem;margin:3px 0 20px}h2{font-size:1.12rem;margin:0 0 6px}.card{background:#fff;border:1px solid #e0e5ee;border-radius:12px;padding:26px;margin-bottom:22px;box-shadow:0 3px 12px #153e2d04}.hint,small{font-size:.82rem;color:#64718a}.hint{margin:0 0 20px}.fields{display:grid;grid-template-columns:1fr 1fr;gap:20px}label{display:block;font-size:.92rem;font-weight:650}label span{font-size:.7rem;color:#71502d;background:#f7eddf;border-radius:4px;padding:2px 6px;margin-left:5px}input,select,textarea{display:block;width:100%;font:inherit;font-weight:400;padding:11px 12px;border:1px solid #bac4d5;border-radius:7px;background:#fff;color:#1d2940;margin-top:7px;min-height:46px}textarea{resize:vertical}.wide{grid-column:1/-1}.actions{display:flex;align-items:center;gap:24px;margin-top:22px}button,.button{display:inline-block;font:inherit;font-size:.9rem;background:#292e92;color:#fff;border:0;border-radius:7px;padding:11px 22px;cursor:pointer;text-decoration:none;font-weight:650}button:hover,.button:hover{background:#1f246f}a{color:#292e92;text-underline-offset:4px}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid #dd9c35;outline-offset:3px}.secondary{background:#f0f2f7;color:#35425d}.secondary:hover{background:#e5e9f3}.filter{display:flex;gap:12px;align-items:flex-end;margin:18px 0}.filter label{min-width:240px;max-width:75%}.table-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse;text-align:left;font-size:.9rem}thead{background:#f5f7fb;color:#5a6880}th,td{padding:16px 12px;border-bottom:1px solid #e6eaf1;vertical-align:top}tbody th{font-weight:650;min-width:150px}td small,th small{display:block;font-weight:400}.links{display:flex;gap:18px;flex-wrap:wrap}.content{white-space:pre-wrap;overflow-wrap:anywhere;min-width:180px;max-width:440px}.date{white-space:nowrap}.badge{display:block;width:max-content;font-size:.7rem;border-radius:5px;padding:1px 7px;background:#fff0df;color:#865920;margin-top:4px}.today{background:#e0f0e6;color:#19583a}.empty{padding:28px;text-align:center;border:1px dashed #d4dbe7;border-radius:8px;background:#f8f9fc;color:#5f6d85}.empty .button{margin-top:14px}.success,.error{padding:14px 18px;border-radius:8px;margin-bottom:20px}.success{background:#e1f0e5;color:#1e623b}.error{background:#fff0ed;color:#9b3829;border:1px solid #e4b7ab}footer{font-size:.78rem;color:#64718a;text-align:center;padding:8px 0 24px}@media(max-width:640px){main{padding:16px}header{padding:22px 16px}.brand{font-size:1.15rem}.prototype{margin-left:10px}nav a{flex:1;text-align:center;padding:12px 8px;font-size:.9rem}nav{gap:3px}.card{padding:20px 16px}.fields{grid-template-columns:1fr;gap:16px}.filter label{min-width:0;flex:1}.filter button{white-space:nowrap;padding:11px 14px}.notice{padding:14px}h1{font-size:1.5rem}}

button:disabled{background:#dce4df;color:#66786e;cursor:not-allowed}

.question-guide{border:1px solid #dce2ef;border-radius:8px;background:#f8f9fd;padding:14px 16px}.question-guide>summary{font-weight:650;color:#292e92;margin:0}.question-guide[open]>summary{margin-bottom:14px}.guide-controls{border:0;padding:0;margin:0;min-width:0}.guide-controls legend{font-weight:650;margin-bottom:14px}.guide-controls h3{font-size:.95rem;margin:18px 0 8px}.guide-preview{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;font-size:.85rem;background:white;border:1px solid #dce2ee;border-radius:7px;padding:14px;min-height:64px;margin:0 0 16px}.guide-feedback{font-size:.85rem;color:#245b43;margin:12px 0 0}.guide-feedback:empty{display:none}.guide-controls label{min-width:0}

.voice-input{border:1px solid #c8dcdf;border-radius:8px;background:#f5f9fa;padding:14px 16px}.voice-input>summary{font-weight:650;color:#292e92;margin:0}.voice-input[open]>summary{margin-bottom:14px}.voice-controls{border:0;padding:0;margin:0;min-width:0}.voice-controls legend{font-weight:650;margin-bottom:14px}.voice-notice{padding:12px;border-radius:6px;background:#fff7e6;color:#66542c;font-size:.85rem}.voice-status{font-size:.88rem;color:#245b43}.voice-consent{display:flex;align-items:flex-start;gap:10px;font-size:.88rem}.voice-consent input{display:inline-block;width:18px;height:18px;min-height:18px;flex:0 0 auto;margin:5px 0 0}.voice-controls .actions{flex-wrap:wrap;margin-bottom:16px}.voice-interim{white-space:pre-wrap;overflow-wrap:anywhere}.voice-interim:empty{display:none}

[data-calculator] fieldset{border:0;padding:0;margin:0;min-width:0}[data-calculator] .actions{flex-wrap:wrap}[data-calculator] [data-calculation-result]:not(:empty){border-top:1px solid #dbe5de;margin-top:22px;padding-top:22px}[data-calculator] details{margin-top:16px}[data-calculator] caption{text-align:left;color:#5a6880;padding:12px 0;font-size:.88rem}.calculation-options{background:#f8f9fd;border:1px solid #e0e5ef;border-radius:8px;padding:12px 16px}.calculation-options>.fields{margin-top:16px}.calculation-options button{margin-top:12px}.calculation-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px;margin:18px 0}.calculation-metrics>div{background:#f0f2fb;border-radius:8px;padding:16px}.calculation-metrics dt{font-size:.85rem;color:#5a6880}.calculation-metrics dd{margin:6px 0 0;font-size:1.5rem;font-weight:700;overflow-wrap:anywhere}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:640px){.calculation-metrics{grid-template-columns:1fr}}

.calculation-warning{padding:12px 14px;background:#fff6e6;border-left:3px solid #bd9035;border-radius:4px;color:#715327;font-size:.86rem}

.team-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.team-bar form { margin: 0; }
.notification-link { padding: 5px 10px; border-radius: 6px; background: #eaeaff; font-weight: 700; }
.handover-notice { overflow-wrap: anywhere; }
.handover-notice.is-unread { border-left: 4px solid #30309a; }
.handover-notice h2 { font-size: 1.15rem; }
.handover-notice form { margin-bottom: 0; }
.notification-state { color: #30309a; font-weight: 700; }
.team-bar button { margin: 0; }

.backup-pagination { flex-wrap: wrap; align-items: center; gap: 16px; margin: 16px 0 0; border: 0; }
.backup-pagination [aria-disabled] { color: #64718a; padding: 11px 18px; }
.backup-pagination a { padding: 11px 18px; }

.deal-confidence,.deal-competitor { margin: 0; min-width: 0; border: 1px solid #dce1eb; border-radius: 8px; padding: 16px; }
.deal-confidence legend,.deal-competitor legend { font-weight: 650; padding: 0 6px; }
.confidence-options { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.confidence-options label,.inline-choice { display: flex; align-items: center; gap: 8px; }
.confidence-options label { padding: 8px 12px; border: 1px solid #dce1eb; border-radius: 7px; }
.confidence-options input,.inline-choice input { width: 20px; height: 20px; min-height: 0; margin: 0; flex: 0 0 auto; accent-color: #292e92; }
.deal-competitor .inline-choice { margin-bottom: 12px; }
.deal-competitor .hint { margin: 8px 0 0; }
.deal-summary { margin-top: 12px; border-top: 1px solid #e6eaf1; padding-top: 8px; white-space: normal; overflow-wrap: anywhere; }

.hospital-registration > summary,.hospital-results > summary { font-weight: 650; color: #292e92; padding: 4px 0; }
.hospital-entry { margin-top: 20px; }
.hospital-search { margin: 16px 0; }
.hospital-search label { max-width: 640px; }
.hospital-search .actions { flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.hospital-results { margin-top: 16px; }
.hospital-results th,.hospital-results td { overflow-wrap: anywhere; }
.directory-pagination { flex-wrap: wrap; align-items: center; gap: 16px; margin: 16px 0; border: 0; }
.directory-pagination a,.directory-pagination [aria-disabled] { padding: 11px 18px; }
.directory-pagination [aria-disabled] { color: #64718a; }
.directory-jump { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.directory-jump label { min-width: 140px; }
@media (max-width: 640px) {
  .hospital-results table,.hospital-results tbody { display: block; }
  .hospital-results thead { display: none; }
  .hospital-results tr { display: block; padding: 16px 0; border-bottom: 1px solid #e6eaf1; }
  .hospital-results th,.hospital-results td { display: block; min-width: 0; padding: 0; border: 0; }
  .hospital-results td:nth-child(2) { margin-top: 4px; color: #64718a; }
  .hospital-results td:nth-child(2)::before { content: "営業担当："; }
  .hospital-results .links { display: flex; margin-top: 8px; gap: 20px; }
}

.deal-assignee { margin-top: 6px; color: #292e92; }

.case-title { margin: 0 0 10px; white-space: normal; overflow-wrap: anywhere; }

.case-alerts { margin: 0 0 22px; padding: 18px 20px; border: 1px solid #dce1eb; border-radius: 10px; background: #f8f9fc; overflow-wrap: anywhere; }
.case-alerts.due { border-color: #d3ad58; background: #fff8e7; }
.case-alerts.neglected { border-color: #d89a8e; background: #fff0ed; }
.case-alerts p { margin: 6px 0; }
.case-alerts .hint { margin-bottom: 0; }
.case-alerts li { margin: 10px 0; }
.case-alerts li span { font-size: .85rem; }
.case-progress { padding: 6px 10px; border-radius: 5px; font-size: .82rem; white-space: normal; background: #f0f3f8; }
.case-progress.due { background: #fff1cf; color: #755014; }
.case-progress.neglected { background: #ffe1d9; color: #933d29; font-weight: 650; }
.case-progress.won { background: #e1f0e5; color: #1e623b; }
.case-filter { flex-wrap: wrap; }
.case-filter > div { min-width: 200px; }

.hospital-contacts { min-width: 0; margin: 0; border: 1px solid #bac4d5; border-radius: 10px; padding: 18px; }
.hospital-contacts > legend { font-weight: 650; padding: 0 6px; }
.required-label { font-size: .7rem; color: #71502d; background: #f7eddf; border-radius: 4px; padding: 2px 6px; }
.contact-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; }
.contact-group { min-width: 0; border: 1px solid #dce1eb; border-radius: 8px; padding: 16px; background: #f8f9fc; }
.contact-group.selected { border-color: #292e92; background: #f0f2fd; }
.contact-kind,.contact-check { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.contact-kind { font-size: 1rem; margin-bottom: 8px; }
.contact-kind input,.contact-check input { margin: 0; width: 20px; height: 20px; min-height: 0; flex: 0 0 auto; accent-color: #292e92; }
.contact-roles { min-width: 0; margin: 0; padding: 0; border: 0; }
.contact-roles > legend { font-size: .8rem; color: #64718a; }
.contact-roles:disabled { opacity: .55; }
.contact-options { margin: 8px 0 14px; }
.contact-roles input[type=text],.contact-roles input:not([type]) { min-width: 0; }
.contact-summary { border-top: 1px solid #e6eaf1; padding-top: 10px; margin: 12px 0 0; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 700px) { .contact-grid { grid-template-columns: minmax(0,1fr); } .hospital-contacts { padding: 14px; } }
.contact-group { display: flex; flex-direction: column; }
.contact-roles { display: flex; flex-direction: column; flex: 1; }
.contact-options { flex: 1; }

.contact-group[hidden] { display: none; }
.contact-panels > .contact-group + .contact-group { margin-top: 14px; }
.contact-panels > .contact-group[hidden] + .contact-group { margin-top: 0; }

.product-candidates { min-width: 0; padding: 14px 16px; border: 1px solid #dce1eb; border-radius: 8px; background: #f8f9fc; }
.product-candidates > summary,.product-summary > summary { color: #292e92; font-weight: 650; cursor: pointer; }
.product-row { margin-top: 12px; padding: 12px; background: white; border: 1px solid #dce5de; border-radius: 7px; }
.product-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 12px; }
.product-fields label { min-width: 0; }
.product-summary { white-space: normal; margin: 10px 0; }
.product-summary table { font-size: .8rem; }
@media(max-width:700px) { .product-fields { grid-template-columns: 1fr; } }

.yen-input { display: flex; align-items: center; gap: 8px; }
.yen-input input { min-width: 0; flex: 1; }
.yen-input > span { flex: 0 0 auto; color: #35425d; }
.yen-input,.yen-input > span { background: transparent; font-size: inherit; padding: 0; margin-left: 0; }

.history-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.history-heading h2 { margin: 0; }
.history-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 12px 0 0; padding: 12px 0; border-bottom: 0; }
.history-pagination a { padding: 4px; }
.history-pagination span { color: #64718a; }
#deal-entry,#deal-history { scroll-margin-top: 20px; }

#deal-history > .table-wrap > table > tbody > tr > td,#deal-history > .table-wrap > table > tbody > tr > th { padding: 10px 12px; }
#deal-history .content { white-space: normal; }
#deal-history .case-title { margin: 0 0 4px; }
#deal-history .deal-assignee { margin-top: 2px; }
.deal-status-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#deal-history .case-progress { margin: 0; padding: 2px 7px; font-size: .75rem; }
.deal-angle { font-size: .75rem; color: #5a6880; white-space: nowrap; }
.deal-preview { margin: 5px 0; font-size: .84rem; line-height: 1.5; overflow-wrap: anywhere; }
.deal-expanded > summary { margin: 0; font-size: .8rem; color: #292e92; }
.deal-full-content { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Local brand lockup: blue wordmark, quiet white space, system sans serif. */
.app-header { background: #fff; color: #171b48; border-top: 4px solid #22258b; border-bottom: 1px solid #e0e4ee; padding: 24px max(24px,calc((100% - 1056px)/2)); }
.brand-lockup { display: flex; align-items: center; gap: 28px; min-width: 0; }
.brand-logo { display: block; width: 190px; height: 64px; object-fit: contain; flex: 0 0 auto; }
.brand-divider { height: 48px; width: 1px; background: #d8dcec; flex: 0 0 auto; }
.brand-copy { min-width: 0; }
.brand-name { font-family: Aptos,"Segoe UI","Helvetica Neue",Arial,sans-serif; font-size: clamp(1.65rem,3vw,2.15rem); line-height: 1.15; letter-spacing: -.035em; white-space: nowrap; }
.brand-main { font-weight: 750; }
.brand-support { font-weight: 400; color: #555b80; }
.app-header .brand-tagline { margin: 8px 0 0; font-size: .75rem; letter-spacing: .07em; color: #67718b; }
.brand-prototype { margin-left: auto; border: 1px solid #d5d9eb; border-radius: 5px; padding: 3px 10px; font-size: .68rem; color: #596287; white-space: nowrap; flex: 0 0 auto; background: #f7f8fc; }
@media(max-width:700px) { .app-header { padding: 15px 20px 22px; } .brand-lockup { flex-wrap: wrap; column-gap: 16px; row-gap: 5px; } .brand-logo { width: 148px; height: 49px; order: 0; } .brand-divider { display: none; } .brand-prototype { order: 1; } .brand-copy { order: 2; flex-basis: 100%; } .brand-name { font-size: 1.8rem; } .app-header .brand-tagline { margin-top: 7px; font-size: .7rem; letter-spacing: .035em; } }
@media(max-width:360px) { .brand-name { font-size: 1.55rem; } }

/* Application theme: neutral surfaces, MUNTEX blue and readable hierarchy. */
:root { --ink: #1d2940; --muted: #64718a; --accent: #292e92; --border: #e0e5ee; --surface: #fff; font-family: "Segoe UI", "Noto Sans JP", "Yu Gothic UI", Meiryo, system-ui, sans-serif; background: #f5f6fa; color: var(--ink); line-height: 1.65; }
main { max-width: 1168px; padding: 24px 32px 40px; }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.025em; margin: 4px 0 24px; }
h2 { font-size: 1.06rem; font-weight: 700; letter-spacing: -.01em; }
.eyebrow { font-size: .7rem; letter-spacing: .09em; text-transform: uppercase; }
.card { border-radius: 8px; box-shadow: none; padding: 26px 28px; margin-bottom: 22px; }
.hint { line-height: 1.65; }
a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
button,.button { min-height: 44px; border: 1px solid transparent; border-radius: 5px; padding: 10px 18px; font-size: .85rem; font-weight: 650; }
.secondary { border-color: #d7deeb; background: #fff; color: #35425d; }
.secondary:hover { background: #f0f2f8; border-color: #bcc7dc; }
button:disabled { color: #6a7487; background: #e8ecf2; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible { outline: 3px solid #8d99de; outline-offset: 3px; }
input,select,textarea { border-radius: 5px; border-color: #bac4d5; min-width: 0; min-height: 44px; font-size: .9rem; padding: 10px 12px; }
input:hover,select:hover,textarea:hover { border-color: #8592b5; }
input:focus,select:focus,textarea:focus { border-color: var(--accent); }
input::placeholder,textarea::placeholder { color: #78849a; }
input[type=checkbox],input[type=radio] { accent-color: var(--accent); }
label { font-size: .85rem; font-weight: 650; }
label > span:not(.yen-input),.required-label { background: #eef0f8; color: #555d7f; font-size: .65rem; }
.fields { gap: 22px; }
.fields > * { min-width: 0; }
.actions { gap: 16px; flex-wrap: wrap; }
main > nav[aria-label="メインメニュー"] { position: sticky; top: 0; z-index: 20; background: #f5f6fa; margin: 22px 0 26px; gap: 6px; border-bottom: 1px solid #dce2ed; }
main > nav[aria-label="メインメニュー"] > a { border-radius: 0; padding: 14px 22px 12px; color: #64718a; font-size: .88rem; border-bottom: 3px solid transparent; }
main > nav[aria-label="メインメニュー"] > a:hover { color: var(--accent); background: #eceff7; }
main > nav[aria-label="メインメニュー"] > a[aria-current] { background: transparent; color: var(--accent); border-bottom-color: var(--accent); }
.notice { border-radius: 6px; border-color: #dce2ef; background: #eef1f8; color: #4c5974; font-size: .8rem; padding: 13px 16px; }
.prototype-notice { display: flex; flex-wrap: wrap; align-items: center; column-gap: 24px; row-gap: 6px; padding: 10px 16px; border-left: 3px solid #7984c3; }
.notice-overview { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.prototype-notice .notice-overview strong { font-size: .75rem; color: #303966; white-space: nowrap; }
.prototype-notice > details { flex: 1; min-width: 210px; }
.prototype-notice summary { margin: 0; font-size: .75rem; color: #505d80; }
.prototype-notice details[open] { flex-basis: 100%; }
.prototype-notice p { margin: 9px 0 0; }
.team-bar { border-bottom: 1px solid var(--border); padding: 0 0 14px; gap: 10px 18px; font-size: .78rem; color: #64718a; }
.team-bar > span:first-child { color: var(--ink); font-weight: 650; }
.team-bar form { margin-left: auto; }
.team-bar button { min-height: 34px; padding: 5px 12px; font-size: .75rem; }
.filter { padding: 16px; background: #f6f8fc; border: 1px solid #e6eaf2; border-radius: 6px; flex-wrap: wrap; gap: 12px; }
.filter label { min-width: 180px; flex: 1; max-width: none; }
.filter button { flex: 0 0 auto; }
table { font-size: .85rem; }
thead { background: #f5f7fb; color: #5a6880; }
thead th { font-size: .73rem; font-weight: 650; padding: 12px; }
td,th { padding: 13px 12px; }
tbody > tr:hover { background: #fafbfe; }
.table-wrap { border-radius: 5px; }
.date { color: #64718a; font-size: .76rem; font-variant-numeric: tabular-nums; }
.entry-group { border: 0; padding: 23px 0 0; margin: 0; min-width: 0; border-top: 1px solid var(--border); }
.entry-group > legend { padding: 0 14px 0 0; font-size: .9rem; font-weight: 700; color: #243253; }
.entry-group > legend > span { display: inline-block; margin-right: 6px; font-size: .7rem; color: #7984a7; font-weight: 500; font-variant-numeric: tabular-nums; }
#deal-entry .entry > .fields { gap: 32px; }
#deal-entry .entry > .actions { justify-content: flex-start; border-top: 1px solid var(--border); padding-top: 20px; margin-top: 28px; }
.question-guide,.voice-input,.product-candidates { background: #f8f9fd; border-color: #e0e5ef; border-radius: 6px; }
.product-candidates > summary,.question-guide > summary,.voice-input > summary { font-size: .85rem; }
.product-row { border-radius: 5px; }
.hospital-contacts,.deal-confidence,.deal-competitor { border-color: #dce2ed; border-radius: 6px; }
.hospital-contacts > legend,.deal-confidence > legend,.deal-competitor > legend { font-size: .85rem; }
.contact-group { border-radius: 5px; background: #fafbfe; }
.contact-kind { font-size: .9rem; }
.contact-roles > legend { color: #64718a; }
.confidence-options { gap: 8px; }
.confidence-options label { font-size: .8rem; padding: 8px 10px; }
.confidence-options label:has(input:checked) { background: #eef0fc; border-color: #7e89ca; color: #292e92; }
.case-alerts { background: #f8f9fc; border-color: #e0e5ee; border-radius: 6px; }
.case-alerts.clear { border-left: 3px solid #b5bed2; }
.case-alerts.due { border-color: #ead3a2; border-left: 3px solid #bd8520; background: #fffaf0; }
.case-alerts.neglected { border-color: #e7b7ac; border-left: 3px solid #b94d39; background: #fff6f3; }
.case-alerts h2 { font-size: .95rem; }
.case-alerts li { margin: 8px 0; }
.case-progress { color: #59667f; }
.case-progress.won { color: #1e623b; }
.deal-expanded > summary { font-size: .75rem; }
.deal-preview { font-size: .8rem; }
.deal-angle { color: #64718a; }
.empty { border-color: #d6deeb; background: #fafbfe; border-radius: 6px; }
.calculation-metrics > div { background: #f1f3fb; border: 1px solid #e0e5f1; border-radius: 6px; }
.calculation-metrics dd { color: #262d70; font-variant-numeric: tabular-nums; }
.yen-input,.yen-input > span { color: var(--ink); background: transparent; padding: 0; margin-left: 0; font-size: inherit; }
.login-page main { max-width: 600px; padding-top: 38px; }
.login-page h1 { text-align: center; font-size: 1.5rem; }
.login-page .fields { grid-template-columns: 1fr; }
.login-page .card { margin-top: 20px; }
.login-page .card button { width: 100%; margin-top: 24px; }
.login-page main > p { color: #64718a; font-size: .78rem; }
footer { border-top: 1px solid var(--border); margin-top: 30px; padding-top: 22px; color: #64718a; }
#deal-entry,#deal-history,#hospital-list,#hospital-registration { scroll-margin-top: 90px; }
@media(max-width:700px) {
  main { padding: 18px 16px 28px; }
  .card { padding: 20px 16px; }
  main > nav[aria-label="メインメニュー"] { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; margin: 18px 0 22px; }
  main > nav[aria-label="メインメニュー"] > a { padding: 12px 3px 10px; font-size: .77rem; text-align: center; white-space: nowrap; }
  .fields { grid-template-columns: 1fr; gap: 18px; }
  .filter { padding: 12px; }
  .filter label { min-width: 140px; }
  .filter button { padding: 10px 14px; }
  .prototype-notice { padding: 10px 12px; }
  .notice-overview { row-gap: 3px; }
  .notice-overview > span { font-size: .72rem; }
  .team-bar { gap: 8px 12px; }
  .history-heading { align-items: flex-start; }
  .history-heading .button { font-size: .78rem; padding: 9px 12px; }
  .entry-group { padding-top: 18px; }
  .login-page main { padding-top: 25px; }
}
@media(prefers-reduced-motion:no-preference) { button,a,input,select,textarea { transition: background-color .15s, border-color .15s, color .15s; } }
@media(max-width:700px) {
  #deal-history > .table-wrap > table,#deal-history > .table-wrap > table > tbody { display: block; }
  #deal-history > .table-wrap > table > thead { display: none; }
  #deal-history > .table-wrap > table > tbody > tr { display: grid; grid-template-areas: "date action" "hospital hospital" "content content"; grid-template-columns: minmax(0,1fr) auto; padding: 14px 0; gap: 3px 12px; border-bottom: 1px solid var(--border); }
  #deal-history > .table-wrap > table > tbody > tr > td,#deal-history > .table-wrap > table > tbody > tr > th { display: block; padding: 0; border: 0; min-width: 0; }
  #deal-history > .table-wrap > table > tbody > tr > .date { grid-area: date; }
  #deal-history > .table-wrap > table > tbody > tr > th { grid-area: hospital; margin-bottom: 5px; }
  #deal-history > .table-wrap > table > tbody > tr > .content { grid-area: content; max-width: none; }
  #deal-history > .table-wrap > table > tbody > tr > td:last-child { grid-area: action; font-size: .8rem; }
  #deal-history th small { display: inline; margin-right: 10px; font-size: .7rem; }
}
@media(max-width:700px) {
  input,select,textarea { font-size: 1rem; }
}

/* Elapsed-case colors are independent of the order-confidence colors. */
.case-progress.age-green { background: #e5f3e9; color: #246345; }
.case-progress.age-yellow { background: #fff4c2; color: #805b0c; }
.case-progress.age-red { background: #fff0ed; color: #963827; }
[data-confidence="1"],[data-confidence="2"] { --level-color: #963827; --level-background: #fff0ed; }
[data-confidence="3"],[data-confidence="4"] { --level-color: #273c9b; --level-background: #eef1fc; }
[data-confidence="5"] { --level-color: #246345; --level-background: #e5f3e9; }
.deal-angle[data-confidence] { background: var(--level-background); color: var(--level-color); padding: 2px 7px; border-radius: 4px; }
.confidence-detail[data-confidence]:not([data-confidence=""]) { color: var(--level-color); }
.confidence-options label[data-confidence] { color: var(--level-color); }
.confidence-options label[data-confidence] input { accent-color: var(--level-color); }
.confidence-options label[data-confidence]:has(input:checked) { background: var(--level-background); border-color: var(--level-color); color: var(--level-color); }
.deal-intake { min-width: 0; padding: 16px; background: #f8f9fd; border: 1px solid #e0e5ef; border-radius: 6px; }
.intake-source,.intake-request { min-width: 0; border: 0; padding: 0; margin: 0 0 16px; }
.intake-source > legend,.intake-request > legend { font-size: .85rem; font-weight: 650; margin-bottom: 8px; }
.intake-options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.intake-choice { display: flex; align-items: center; gap: 8px; border: 1px solid #dce2ed; border-radius: 5px; padding: 8px 10px; background: #fff; font-size: .8rem; }
.intake-choice input { width: 18px; height: 18px; min-height: 0; margin: 0; flex: 0 0 auto; }
.intake-choice:has(input:checked) { background: #eef0fc; border-color: #7e89ca; color: #292e92; }
.intake-creator { font-weight: 650; font-size: .9rem; margin: 10px 0; }
.deal-intake > .hint { margin: 4px 0 0; }
.deal-creator { color: #64718a; margin-top: 2px; }
.intake-summary { border-top: 1px solid #e6eaf1; padding-top: 8px; margin-top: 10px; }

.deal-intake [hidden] { display: none; }
.case-search { align-items: flex-end; }
.draft-panel { border: 1px solid #d6ddef; background: #f5f7fd; border-radius: 6px; padding: 10px 12px; margin: 0 0 14px; font-size: .8rem; }
.draft-panel p { margin: 3px 0 8px; }
.draft-panel details { margin-top: 6px; }
.draft-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.draft-actions button { padding: 6px 10px; font-size: .78rem; min-height: 36px; }
.draft-panel [hidden] { display: none; }
.draft-error { border-color: #c67e71; background: #fff7f4; }
.outcome-choices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-bottom: 8px; }
.outcome-choice { justify-content: center; padding: 8px 6px; gap: 6px; }
.outcome-choice:has(input:checked) { border-color: #5363ad; background: #eef0fc; }
.outcome-choice:has(input[value=won]:checked) { border-color: #548263; background: #edf7ef; color: #23452d; }
.outcome-choice:has(input[value=lost]:checked) { border-color: #7b8492; background: #eceff3; color: #374151; }
.note-outcome [hidden] { display: none; }
.note-outcome [data-outcome-label] { font: inherit; padding: 0; margin: 0; color: inherit; background: none; }
.cases-table tbody > tr.case-won,.cases-table tbody > tr.case-won:hover { background: #edf7ef; color: #23452d; }
.cases-table tbody > tr.case-lost,.cases-table tbody > tr.case-lost:hover { background: #eceff3; color: #374151; }
.cases-table .case-lost a { color: #334566; }
.outcome-summary { margin: 6px 0; font-size: .82rem; }
.outcome-summary p { white-space: pre-wrap; overflow-wrap: anywhere; }
.credit-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 8px; }
.credit-heading h2 { margin: 0; }
.credit-heading .credit-tax-note { flex: 1 1 420px; margin: 0; color: #b42318; font-size: .85rem; font-weight: 600; overflow-wrap: anywhere; }
.calculation-metrics .amount-tax { display: inline-block; margin-left: 2px; font-size: .65em; font-weight: 500; white-space: nowrap; }
.note-method-choices { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 8px; margin-bottom: 12px; }
.note-method-summary { font-size: .82rem; color: #53617a; margin: 8px 0; overflow-wrap: anywhere; }
.case-search label:first-child { flex-basis: 260px; }
.cases-table th small { display: block; margin-top: 4px; }
.quote-price { font-variant-numeric: tabular-nums; font-weight: 650; }
.quote-mobile-label { display: none; }
.case-quotes summary { overflow-wrap: anywhere; }
.case-quotes summary small { display: block; font-weight: 400; }
.case-quotes ul { padding-left: 18px; margin: 8px 0 0; }
.case-quotes li { margin-top: 6px; overflow-wrap: anywhere; }
.case-timeline { list-style: none; padding: 0; margin: 18px 0; }
.case-timeline > li { display: grid; grid-template-columns: 112px minmax(0,1fr); gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.case-timeline time { font-size: .8rem; color: #64718a; font-variant-numeric: tabular-nums; }
.timeline-type { display: inline-block; font-size: .73rem; padding: 3px 8px; border-radius: 4px; background: #eef1fc; color: #273c9b; font-weight: 650; }
.timeline-type.plan-pending { background: #fff4c2; color: #805b0c; }
.timeline-type.plan-done { background: #e5f3e9; color: #246345; }
.timeline-type.plan-cancelled { background: #edf0f4; color: #64718a; }
.timeline-content { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; }
.case-timeline .actions { gap: 8px; margin: 10px 0 0; }
.case-timeline .actions button { padding: 6px 10px; font-size: .75rem; min-height: 36px; }
#case-note-form,#case-plan-form,#case-timeline,#case-profile { scroll-margin-top: 90px; }
.case-detail .card { padding: 18px 20px; margin-bottom: 14px; }
.case-detail > p { margin: 8px 0 12px; }
.case-detail .history-heading { margin-bottom: 8px; gap: 10px; }
.case-detail .card > p { margin: 6px 0; }
.case-detail .deal-status-line { margin: 8px 0; }
.case-detail .actions { margin-top: 12px; gap: 10px; }
.case-detail .case-timeline { margin: 10px 0 0; }
.case-detail .case-timeline > li { grid-template-columns: 86px 108px minmax(0,1fr) 228px; align-items: start; gap: 10px; padding: 9px 0; }
.case-timeline > li > * { min-width: 0; }
.timeline-kind { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.timeline-kind .badge { white-space: normal; }
.case-detail .timeline-body > p { margin: 0; }
.timeline-preview { overflow-wrap: anywhere; }
.timeline-full { margin-top: 3px; font-size: .82rem; }
.timeline-full summary { margin: 0; color: #292e92; }
.timeline-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 3px; }
.case-detail .timeline-meta .note-method-summary { margin: 0; }
.timeline-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; font-size: .78rem; }
.case-detail .timeline-controls .actions { margin: 0; gap: 5px; }
.case-detail .timeline-controls button { padding: 5px 8px; }
.case-detail .case-timeline p { margin: 5px 0; }
.case-detail .case-timeline .actions { margin-top: 6px; gap: 8px; }
.case-detail .history-pagination:empty { display: none; }
.case-detail .history-pagination { margin: 12px 0 0; }
.case-detail .fields { gap: 14px; }
.case-detail .entry-group { padding-top: 12px; }
.case-detail .hint { margin-bottom: 10px; }
.case-detail .note-method-choices { margin-bottom: 8px; }
.case-detail .hospital-contacts { padding: 12px 14px; }
@media(min-width:701px) and (max-width:1050px) {
  .case-detail .case-timeline > li { grid-template-columns: 82px 96px minmax(0,1fr) 148px; }
}
@media(max-width:700px) {
  .case-detail .card { padding: 16px 12px; }
  .case-detail .case-timeline > li { grid-template-columns: 90px minmax(0,1fr); gap: 5px 8px; }
  .timeline-kind { flex-direction: row; flex-wrap: wrap; }
  .timeline-body,.timeline-controls { grid-column: 1 / -1; }
  .timeline-controls { justify-content: flex-start; }
  .case-timeline > li { grid-template-columns: 1fr; gap: 6px; }
  .cases-table,.cases-table tbody { display: block; }
  .cases-table thead { display: none; }
  .cases-table tbody > tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--border); }
  .cases-table tbody > tr > th,.cases-table tbody > tr > td { display: block; min-width: 0; padding: 3px 0; border: 0; }
  .quote-mobile-label { display: block; color: #64718a; font-size: .75rem; }
}

/* Short optional steps stay visually distinct from the main registration. */
.initial-note { border-top: 1px solid var(--border, #dce2eb); padding-top: 1rem; }
.initial-note > fieldset { margin-top: .75rem; border: 1px solid #dce2eb; border-radius: 8px; padding: 1rem; min-width: 0; }
.reuse-previous { display: grid; gap: .4rem; justify-items: start; }
.reuse-previous [data-reuse-status]:empty { display: none; }
.hospital-picker { display: grid; align-content: start; gap: .4rem; min-width: 0; }
.hospital-picker select, .hospital-picker input { width: 100%; min-width: 0; }
.hospital-matches { display: grid; gap: .3rem; }
.hospital-matches[hidden] { display: none; }
.hospital-matches button { width: 100%; text-align: left; white-space: normal; overflow-wrap: anywhere; font-size: .85rem; padding: .5rem .65rem; }
.hospital-matches button[aria-pressed=true] { border-color: #302b91; background: #eef0ff; }

/* Search follows one reading order: keyword, hospital, filters, action, results. */
.case-search { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 16px 20px; padding: 20px; }
.case-search > label,.case-search .hospital-picker label { min-width: 0; max-width: none; }
.case-search .case-search-keyword,.case-search > .hospital-picker,.case-search-actions { grid-column: 1 / -1; }
.case-search > .hospital-picker { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 20px; align-items: start; }
.case-search > .hospital-picker > small,.case-search > .hospital-picker > .hospital-matches { grid-column: 1 / -1; }
.case-search-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding-top: 4px; }
.hospital-picker.has-hospital-results > small,.hospital-picker.no-hospital-results > small { display: block; border-radius: 6px; padding: 10px 12px; color: #173e70; background: #e8f1ff; border: 1px solid #b8cfee; }
.hospital-picker.no-hospital-results > small { background: #fff6e5; border-color: #e4ce9f; color: #715323; }
.has-hospital-results .hospital-matches { padding: 10px; background: #edf4ff; border: 1px solid #b8cfee; border-radius: 6px; }
.hospital-matches button { background: #fff; border: 1px solid #c5d6ef; }
.case-search .hospital-matches { grid-template-columns: repeat(2,minmax(0,1fr)); }
.case-results { margin-top: 24px; min-width: 0; }
.case-results-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
.case-results-heading h3,.case-results-heading p { margin: 0; }
.case-results-heading h3 { font-size: 1.05rem; }
.case-results-heading strong { font-size: 1.15rem; }
.case-results.search-complete { background: #edf4ff; border: 1px solid #b8cfee; border-left: 4px solid #3269ad; border-radius: 8px; padding: 18px; }
.search-complete .case-results-heading { color: #173e70; }
.search-complete .cases-table tbody > tr.case-open { background: #f7faff; }
.search-complete .empty { background: #fff; }
@media(max-width:640px) {
  .case-search { grid-template-columns: minmax(0,1fr); padding: 14px; gap: 14px; }
  .case-search > .hospital-picker,.case-search .hospital-matches { grid-template-columns: minmax(0,1fr); }
  .case-results.search-complete { padding: 12px; }
}

.search-complete .plans-table tbody > tr { background: #f7faff; }
@media(max-width:640px) {
  .plans-table,.plans-table tbody { display: block; }
  .plans-table thead { display: none; }
  .plans-table tbody > tr { display: grid; gap: 12px; padding: 14px; border: 1px solid #d7e2f2; border-radius: 6px; margin-bottom: 10px; }
  .plans-table tbody > tr > td,.plans-table tbody > tr > th { display: block; min-width: 0; max-width: none; padding: 0; border: 0; overflow-wrap: anywhere; }
  .plans-table tbody > tr > :nth-child(1)::before { content: '対応日'; }
  .plans-table tbody > tr > :nth-child(2)::before { content: '病院・状態'; }
  .plans-table tbody > tr > :nth-child(3)::before { content: '対応内容'; }
  .plans-table tbody > tr > :nth-child(4)::before { content: '対象案件'; }
  .plans-table tbody > tr > :only-child::before { content: none; }
  .plans-table tbody > tr > *::before { display: block; font-size: .75rem; font-weight: 650; color: #64718a; margin-bottom: 3px; }
}

.entry-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin: 0 0 22px; }
.entry-choices > div { padding: 20px; border: 1px solid #d6dfef; border-radius: 8px; background: #fff; }
.entry-choices > div:first-child { background: #edf4ff; border-color: #b8cfee; }
.entry-choices h2 { font-size: 1.05rem; }
.entry-choices p { font-size: .85rem; color: #52627a; margin: 6px 0 14px; }
.case-precheck { padding: 12px; background: #edf4ff; border-radius: 6px; font-size: .85rem; }
.case-action-heading { margin-top: 16px; font-size: .85rem; font-weight: 700; }
.case-actions { flex-wrap: wrap; gap: 10px; margin: 8px 0 16px; padding: 12px; background: #f3f6fc; border-radius: 7px; }
.supplementary-input,.supplementary-info { border: 1px solid #dce3f0; border-radius: 7px; padding: 12px; background: #f8faff; }
.supplementary-input > summary,.supplementary-info > summary { color: #354776; font-size: .85rem; font-weight: 650; margin: 0; }
.supplementary-input[open] > summary,.supplementary-info[open] > summary { margin-bottom: 14px; }
.applied-conditions { margin: 16px 0; padding: 12px 14px; border: 1px solid #dce3ee; border-radius: 7px; background: #f8f9fc; font-size: .82rem; overflow-wrap: anywhere; }
.applied-conditions ul { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 8px 0; list-style: none; }
.applied-conditions li { background: #e8edf7; color: #324664; border-radius: 5px; padding: 3px 8px; }
.field-error,form label > span.field-error { display: block; margin: 6px 0 0; padding: 0; color: #a12e26; background: transparent; font-size: .8rem; font-weight: 600; line-height: 1.6; }
input[aria-invalid=true],select[aria-invalid=true],textarea[aria-invalid=true] { border-color: #b63d34; background-color: #fff5f3; }
.client-error { font-size: .85rem; }
@media(max-width:640px) {
  .entry-choices { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .entry-choices > div { padding: 16px; }
  .case-actions { align-items: stretch; }
  .case-actions > a { flex: 1 1 100%; text-align: center; }
}

#case-status-panel { border-top: 2px solid #d5dfee; margin-top: 8px; padding-top: 18px; scroll-margin-top: 90px; }
.note-save-actions { flex-wrap: wrap; gap: 12px; }
.status-only-help { margin: 12px 0 0; }
.save-confirmation { border: 1px solid #a8d5b9; font-weight: 650; }
.save-toast { position: fixed; top: 18px; right: 18px; z-index: 1000; max-width: min(460px,calc(100vw - 36px)); padding: 16px 20px; border: 1px solid #94c8a9; border-radius: 8px; background: #e1f0e5; color: #185b35; box-shadow: 0 6px 24px #1b3f2626; font-weight: 650; pointer-events: none; }
form[aria-busy=true] button:disabled { cursor: wait; opacity: .65; }
@media(max-width:640px) {
  .note-save-actions > button { flex: 1 1 100%; }
  .save-toast { top: 12px; right: 12px; max-width: calc(100vw - 24px); font-size: .85rem; }
}
#case-note-form [data-hospital-contacts][hidden],.note-save-actions [hidden] { display: none; }
.save-action-feedback { margin: 12px 0; font-size: .88rem; overflow-wrap: anywhere; }
.save-action-feedback[hidden] { display: none; }
.save-action-feedback a { display: block; margin-top: 8px; font-weight: 650; }
.draft-panel { scroll-margin-top: 90px; }

.summary-admin-links { display: flex; gap: 16px; flex-wrap: wrap; }
.summary-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 16px 0; }
.summary-metrics > div { display: grid; gap: 3px; border: 1px solid #dce3ee; border-radius: 7px; padding: 14px; background: #f6f8fc; }
.summary-metrics strong { font-size: 1.6rem; color: #252d70; }
.summary-metrics span { font-size: .85rem; font-weight: 650; }
.summary-overview { display: flex; gap: 32px; align-items: center; flex-wrap: wrap; margin: 22px 0; }
.summary-pie { display: block; position: relative; flex: 0 0 auto; width: 160px; height: 160px; border-radius: 50%; margin: 10px auto; }
.summary-overview .summary-pie { margin: 10px 0; }
.summary-legend { margin: 12px 0; padding: 0; list-style: none; min-width: 0; }
.summary-legend li { display: grid; grid-template-columns: 10px minmax(0,1fr) auto auto; align-items: center; gap: 8px; padding: 5px 0; font-size: .82rem; }
.summary-legend i { width: 10px; height: 10px; border-radius: 2px; }
.summary-legend small { text-align: right; min-width: 48px; }
.staff-summary-charts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.staff-summary-chart { border: 1px solid #dce3ee; border-radius: 8px; padding: 16px; background: #fff; min-width: 0; scroll-margin-top: 24px; }
.staff-summary-chart h3 { font-size: 1rem; margin: 0 0 4px; overflow-wrap: anywhere; }
.staff-summary-chart .hint { margin: 0; }
.staff-summary-table td,.staff-summary-table th { padding: 12px 10px; }
.staff-summary-table td { white-space: nowrap; }
.summary-definition { margin: 16px 0 0; font-size: .85rem; }
@media(max-width:900px) { .staff-summary-charts { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:640px) {
  .summary-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .summary-metrics > div { padding: 10px; }
  .summary-metrics strong { font-size: 1.3rem; }
  .staff-summary-charts { grid-template-columns: minmax(0,1fr); }
  .summary-overview { justify-content: center; gap: 12px; }
  .summary-overview .summary-legend { width: 100%; }
  .sales-summary .filter { display: grid; grid-template-columns: minmax(0,1fr); }
  .sales-summary .filter label { min-width: 0; max-width: none; }
}

.summary-pie .pie-count { font-size: 25px; font-weight: 700; fill: #1d2940; }
.summary-pie .pie-caption { font-size: 13px; fill: #64718a; }
.summary-legend .part-won { background: #268158; }
.summary-legend .part-lost { background: #87909e; }
.summary-legend .part-alerts { background: #c44a40; }
.summary-legend .part-other { background: #3768b5; }

.summary-table-help { display: none; }
@media(max-width:640px) { .summary-table-help { display: block; margin-bottom: 8px; } }

#case-status-panel.closure-highlight { background: #f1f5ff; border: 2px solid #5966ba; border-radius: 8px; padding: 16px; outline: none; }
.closure-instructions h3 { margin: 0 0 8px; }
.closure-instructions ol { margin: 0 0 8px; padding-left: 24px; line-height: 1.7; }
.closure-instructions p { margin: 0 0 14px; color: #41516b; font-size: .9rem; }

/* Case detail: distinguish saved information from each independent input area. */
.case-detail .case-section { border-top: 4px solid #596983; margin-bottom: 28px; }
.case-detail .case-section-overview { background: #f7f9fc; }
.case-detail .case-section-history { border-top-color: #687e98; }
.case-detail .case-section-note { border-top-color: #394db1; }
.case-detail .case-section-plan { border-top-color: #397c85; }
.case-detail .card > .case-section-label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid #dce3ee; color: #4b5d75; font-size: .8rem; font-weight: 650; }
.case-section-label > span { display: inline-block; padding: 3px 9px; border-radius: 4px; background: #e6ebf3; color: #34465f; }
.case-section-note .case-section-label > span { background: #e9edff; color: #293c9b; }
.case-section-plan .case-section-label > span { background: #e5f1f2; color: #285e65; }
.case-detail .case-section > h2 { margin-bottom: 14px; }
.case-detail .case-section-note .note-methods,
.case-detail .case-section-note [data-next-plan] { min-width: 0; border: 1px solid #dce3ee; border-radius: 8px; padding: 12px 14px; background: #f7f9fc; }
.case-detail .case-section-note [data-next-plan] { background: #f2f8f9; border-color: #cedfe2; }
.case-detail .case-section-note #case-status-panel { background: #f5f5fc; border: 1px solid #d9daed; border-left: 4px solid #666db4; border-radius: 8px; padding: 14px; }
.case-detail .case-section-note #case-status-panel.closure-highlight { background: #f1f5ff; border: 2px solid #5966ba; border-left-width: 4px; }
.case-detail .note-save-actions { border-top: 1px solid #dce3ee; padding-top: 16px; }
@media(max-width:700px) {
  .case-detail .case-section { margin-bottom: 22px; }
  .case-detail .case-section-note .note-methods,
  .case-detail .case-section-note [data-next-plan],
  .case-detail .case-section-note #case-status-panel { padding: 10px; }
}

.case-transfer-link { display: inline-block; margin-top: 8px; font-weight: 650; }
.case-delete-link { text-align: right; font-size: .82rem; }
.operation-review { max-width: 740px; margin: 0 auto 24px; border-top: 4px solid #4a61a6; }
.operation-review > p { overflow-wrap: anywhere; }
.operation-review .actions { flex-wrap: wrap; gap: 12px; }
button.danger { background: #a33c36; }
button.danger:hover { background: #842f2b; }

/* Return to the page start without submitting forms or leaving the screen. */
.has-back-to-top { padding-bottom: 80px; }
.back-to-top { position: fixed; right: 20px; bottom: max(18px,env(safe-area-inset-bottom)); z-index: 40; min-height: 44px; padding: 10px 16px; border: 1px solid #d4daf0; border-radius: 22px; box-shadow: 0 3px 14px #26365630; font-size: .82rem; white-space: nowrap; }
.back-to-top[hidden] { display: none; }
.back-to-top > span { margin-right: 4px; font-size: 1.1rem; }
@media(max-width:640px) {
  .back-to-top { right: 12px; bottom: max(12px,env(safe-area-inset-bottom)); padding: 10px 14px; }
}

/* Compact case results stay in their own scrolling frame; paging stays outside. */
#case-results-title { scroll-margin-top: 90px; }
.case-results .case-list-hint { margin: 0 0 8px; font-size: .76rem; }
.case-list-scroll { max-height: min(62vh,560px); overflow: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; border: 1px solid #cfd8e7; border-radius: 8px; background: #fff; }
.case-list-scroll:focus-visible { outline: 3px solid #858fca; outline-offset: 3px; }
.compact-cases { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: .81rem; }
.compact-cases .case-col-main { width: 25%; }
.compact-cases .case-col-staff { width: 18%; }
.compact-cases .case-col-status { width: 24%; }
.compact-cases .case-col-quote { width: 20%; }
.compact-cases .case-col-actions { width: 13%; }
.compact-cases thead th { position: sticky; top: 0; z-index: 2; padding: 9px 10px; background: #edf1f8; color: #42526b; font-size: .73rem; }
.compact-cases tbody > tr > th,.compact-cases tbody > tr > td { min-width: 0; padding: 9px 10px; vertical-align: top; overflow-wrap: anywhere; line-height: 1.45; }
.compact-cases .case-row-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-weight: 700; line-height: 1.4; }
.compact-cases th .case-row-hospital { margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-cases th .case-row-date { margin-top: 1px; font-size: .7rem; font-variant-numeric: tabular-nums; }
.compact-cases .case-row-person { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 650; }
.compact-cases .deal-angle { display: inline-block; margin: 3px 0 0; padding: 1px 6px; font-size: .7rem; }
.compact-cases .case-row-people { margin-top: 4px; font-size: .7rem; }
.compact-cases .case-row-people summary { margin: 0; color: #53627c; }
.compact-cases .case-row-people small { margin-top: 4px; }
.compact-cases .deal-status-line { gap: 4px; }
.compact-cases .case-progress { margin: 0; padding: 3px 6px; font-size: .74rem; line-height: 1.4; }
.compact-cases .case-row-next { margin-top: 4px; font-size: .72rem; }
.compact-cases .outcome-summary { margin: 4px 0 0; font-size: .72rem; }
.compact-cases .outcome-summary summary { margin: 0; }
.compact-cases .outcome-summary p { margin: 5px 0; }
.compact-cases .case-quotes { margin: 0; }
.compact-cases .case-quotes summary { margin: 0; }
.compact-cases .case-quotes summary small { font-size: .69rem; margin-top: 2px; }
.compact-cases .case-quotes li { font-size: .74rem; }
.compact-cases .case-row-actions > a { display: block; width: fit-content; min-height: 28px; margin: 0; padding: 3px 0; font-size: .74rem; white-space: nowrap; }
@media(min-width:701px) and (max-width:1050px) {
  .compact-cases { min-width: 800px; }
}
@media(max-width:700px) {
  .case-list-scroll { max-height: min(68vh,600px); }
  .compact-cases,.compact-cases tbody { display: block; width: 100%; }
  .compact-cases colgroup,.compact-cases thead { display: none; }
  .compact-cases tbody > tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px 12px; padding: 12px; }
  .compact-cases tbody > tr > th,.compact-cases tbody > tr > td { display: block; padding: 0; border: 0; }
  .compact-cases .case-row-main,.compact-cases .case-row-status,.compact-cases .case-row-actions { grid-column: 1 / -1; }
  .compact-cases .case-row-main { padding-bottom: 7px; border-bottom: 1px solid #dce3ee; }
  .compact-cases [data-label]::before { content: attr(data-label); display: block; color: #62718a; font-size: .69rem; margin-bottom: 2px; }
  .compact-cases .case-row-status .deal-status-line { display: inline-flex; margin-right: 7px; }
  .compact-cases .case-row-next { display: inline; }
  .compact-cases .case-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; border-top: 1px solid #dce3ee; padding-top: 5px; }
  .compact-cases .case-row-actions > a { min-height: 36px; display: inline-flex; align-items: center; }
  .compact-cases .case-row-people summary { font-size: .7rem; }
}
@media(max-width:700px) {
  .compact-cases .case-row-main { grid-row: 1; }
  .compact-cases .case-row-staff { grid-column: 1; grid-row: 2; }
  .compact-cases .case-quote-cell { grid-column: 2; grid-row: 2; }
  .compact-cases .case-row-status { grid-row: 3; }
  .compact-cases .case-row-actions { grid-row: 4; }
}

.user-profile { max-width: 400px; margin: 12px 0; }
.user-profile label { margin: 12px 0; }
.user-profile .hint { overflow-wrap: anywhere; margin: 12px 0; }
@media (max-width: 640px) {
  .user-management-table, .user-management-table tbody, .user-management-table tr, .user-management-table td { display: block; width: 100%; }
  .user-management-table thead { display: none; }
  .user-management-table tr { border-bottom: 1px solid var(--border, #e6eaf1); padding: 14px 0; }
  .user-management-table td { border: 0; padding: 5px 8px; overflow-wrap: anywhere; }
  .user-management-table td:first-child { font-weight: 700; }
  .user-management-table td:nth-child(2)::before { content: '権限：'; }
  .user-management-table td:nth-child(3)::before { content: '状態：'; }
  .user-management-table .user-profile { max-width: none; }
}

.user-delete { max-width: 400px; margin: 12px 0; overflow-wrap: anywhere; }
.user-delete > summary { color: #9b3030; }
.user-delete .inline-choice { margin: 14px 0; }

nav[aria-label="メインメニュー"] { flex-wrap: wrap; }
