/* Outpatient directory: one selected department, with a persistent desktop selector. */
.outpatient-page { --op-color-primary:#00475b; --op-line:#d5e2df; background:#f5f8f7; color:#354c50; }
.outpatient-heading { width:min(1400px,calc(100% - 64px)); margin:auto; padding:132px 0 34px; }
.outpatient-eyebrow,.department-eyebrow { color:#598078; font-size:11px; font-weight:700; letter-spacing:.15em; }
.outpatient-heading h1 { margin:12px 0 18px; color:#00475b; font-size:clamp(32px,4vw,48px); letter-spacing:.06em; }
.outpatient-heading > p:last-child { font-size:15px; line-height:1.9; }
.page-layout-container { width:min(1400px,calc(100% - 64px)); margin:0 auto 100px; }
.page-layout { display:grid; grid-template-columns:238px minmax(0,1fr); gap:32px; align-items:start; padding-top:24px; }
.sidebar { display:block; width:100%; margin:0; position:sticky; top:104px; max-height:calc(100svh - 128px); overflow-y:auto; padding:4px; }
.sidebar__title { padding:0 10px; margin-bottom:18px; color:#00475b; font-size:18px; letter-spacing:.04em; }
.sidebar__nav { display:grid; gap:8px; margin:0; }
.outpatient-page .sidebar__link::before,.outpatient-page .sidebar__link::after { content:none; }
.sidebar__link { display:flex; align-items:center; gap:12px; min-height:56px; padding:12px 16px; border:1px solid var(--op-line); border-radius:8px; background:#fff; color:#31545a; font-size:14px; font-weight:700; text-decoration:none; line-height:1.65; transition:background-color 180ms ease,color 180ms ease,border-color 180ms ease; }
.sidebar__number { font-size:10px; opacity:.7; flex-shrink:0; }
.sidebar__link:hover { background:#e7f0ed; border-color:#719b8f; }
.sidebar__link[aria-selected="true"] { color:#fff; background:#00475b; border-color:#00475b; box-shadow:0 6px 15px #00475b15; }
.sidebar__link:focus-visible,.department-section:focus-visible,.doctor-card:focus-visible,.modal-close:focus-visible { outline:3px solid #3a8d9d; outline-offset:3px; }
.main-content { min-width:0; width:100%; }
.section-title { font-size:23px; color:#00475b; margin:0 0 16px; }
.certificates-notice { background:#fff; border:1px solid var(--op-line); border-left:3px solid #80a99a; border-radius:4px 10px 10px 4px; padding:16px 20px; margin-bottom:28px; }
.certificates-notice h3 { font-size:15px; margin-bottom:6px; color:#315c59; }
.certificates-notice p { font-size:13px; line-height:1.8; }
.certificates-notice a { color:#00475b; text-decoration:underline; text-underline-offset:3px; }
.department-section { display:block; width:100%; margin-bottom:32px; background:#fff; border:1px solid var(--op-line); border-radius:16px; overflow:hidden; box-shadow:0 12px 32px #214d5410; scroll-margin-top:104px; opacity:1; transform:none; }
.department-section[hidden] { display:none!important; }
.department-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; min-height:180px; padding:28px 34px; background:var(--department-tint,#e8f4f2); border-bottom:1px solid var(--op-line); }
.department-title { font-size:clamp(24px,2.7vw,36px); line-height:1.5; color:#00475b; margin:10px 0; letter-spacing:.03em; }
.department-heading__caption { font-size:12px; letter-spacing:.08em; color:#526f70; }
.department-icon { display:block; flex:0 0 132px; width:132px; height:132px; object-fit:contain; }
.outpatient-title-accessible { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.outpatient-title-glyph { opacity:0; position:relative; }
.outpatient-title-glyph.is-typed { opacity:1; }
.outpatient-title-glyph.is-caret::after { content:""; position:absolute; right:-.08em; top:.12em; height:.95em; border-right:1px solid currentColor; }
.department-content { padding:30px 34px 36px; font-size:15px; line-height:1.95; overflow-wrap:anywhere; }
.department-content > p+p { margin-top:16px; }
.department-content strong { color:#254c53; font-weight:700; }
.department-info-grid { display:block; min-width:0; }
.doctor-list-icon { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:32px; padding-top:26px; border-top:1px solid #e1eae6; }
.doctor-list-icon img { width:30px; height:30px; object-fit:contain; }
.doctor-list-icon span { font-size:19px; color:#00475b; font-weight:700; }
.doctor-comment { flex-basis:100%; padding:10px 14px; background:#f4f7f2; border-radius:4px; color:#526852; font-size:13px; }
.doctor-list { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:16px 0 28px; }
.doctor-card { display:flex; flex-direction:column; justify-content:center; min-height:107px; padding:20px 16px; border:1px solid #ccdeda; border-radius:8px; background:#f8fbfa; cursor:pointer; color:#00475b; transition:background-color 180ms ease,border-color 180ms ease; text-align:left; }
.doctor-card:hover { background:#e9f3ef; border-color:#7caa9b; }
.doctor-card__name,.doctor-card__summary { font-size:17px; font-weight:700; }
.doctor-card__summary { display:flex; align-items:baseline; gap:8px; }
.doctor-card__role { flex-shrink:0; font-size:11px; color:#5e7e75; font-weight:500; }
.doctor-card::after { content:"プロフィールを見る"; display:block; margin-top:10px; font-size:11px; font-weight:500; color:#5c7d77; }
.schedule-table-container { width:100%; margin-top:24px; overflow-x:auto; border-radius:8px; }
.schedule-table { width:100%; table-layout:fixed; border-collapse:separate; border-spacing:0; background:#fff; font-size:14px; line-height:1.6; }
.schedule-table caption { text-align:left; color:#00475b; font-size:17px; font-weight:700; margin-bottom:12px; }
.schedule-hours { display:inline-flex; flex-wrap:wrap; gap:2px 22px; margin-left:20px; color:#3f5c62; font-size:15px; font-weight:500; vertical-align:baseline; }
.schedule-hours b { color:#00475b; font-weight:700; }
.schedule-scroll-hint { display:none; font-size:11px; font-weight:400; color:#587677; margin-top:5px; }
[data-scrollable] .schedule-scroll-hint { display:block; }
.schedule-table th,.schedule-table td { padding:14px 9px; text-align:center; vertical-align:middle; }
.schedule-table th { background:#155564; color:#fff; font-weight:500; }
.schedule-table th:first-child,.schedule-table td:first-child { width:72px; }
.schedule-table td { height:70px; border-bottom:1px solid #dce6e1; background:#f4f8f6; }
.schedule-table tbody tr:nth-child(even) td { background:#fff; }
.schedule-table .time-label { font-weight:700; }
.schedule-table td.time-label,.schedule-table tbody th.time-label { color:#00475b; background:#e7f1ed; }
.schedule-assignments { display:grid; grid-template-columns:minmax(0,1fr); gap:6px; color:#00475b; font-size:14px; }
.schedule-assignments span { display:block; min-height:1.6em; overflow-wrap:anywhere; white-space:pre-line; }
.outpatient-biography { white-space:pre-line; overflow-wrap:anywhere; }
.doctor-list[hidden],.doctor-list-icon[hidden] { display:none; }
[data-outpatient-data="loading"] .doctor-list,[data-outpatient-data="loading"] .schedule-table-container { visibility:hidden; }
.outpatient-data-notice { max-width:1160px; margin:20px auto; padding:16px 24px; color:#5a4527; background:#fff7e8; border-left:3px solid #b27b30; }
.circle-mark { color:#24595d; font-weight:700; white-space:nowrap; }
.cross-mark { color:#8b9e9e; }
.triangle-mark { display:inline-flex; flex-direction:column; align-items:center; color:#906934; font-weight:700; }
.triangle-note { font-size:11px; line-height:1.4; color:#586c6e; font-weight:400; }
.schedule-table--saturday { margin-top:20px; }
.image-only { margin-top:28px; }
.image-only img { display:block; width:100%; max-width:640px; border-radius:12px; }
.modal { --profile-tint:#e8f4f2; --profile-bg-main:#f4f9ff; --profile-bg-left:#f9ffff; --profile-bg-right:#dbedff; display:none; position:fixed; inset:0; z-index:10000; }
.modal.is-open { display:block; }
.modal-bg { position:absolute; inset:0; background:#233b484a; backdrop-filter:blur(8px); }
.modal-container { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); display:flex; flex-direction:column; isolation:isolate; width:min(780px,calc(100% - 40px)); max-height:85dvh; padding:0; border:1px solid #cbd7dc; background:linear-gradient(135deg,var(--profile-bg-left) 0%,var(--profile-bg-main) 50%,var(--profile-bg-right) 100%); border-radius:20px; overflow:hidden; box-shadow:0 20px 60px #233b4826,0 4px 14px #233b480d; }
/* Adapt the supplied watercolor flow and shimmer to the shared profile card colors. Like the reference, the flow layer is an elongated rectangle that rotates, so its edges sweep across the card as light wedges; its sides follow the card size so the sweep stays in view without leaving the card bare. The flow layer and shimmer keep a constant opacity, and the shimmer bands sit off-center, so the flat center area does not flicker. A fixed radial mask on the wrapper also fades the rotating layer out toward the center, leaving the base gradient steady there while the edges keep sweeping across the sides. */
.modal-watercolor { --wc-deep:color-mix(in srgb,var(--profile-bg-main) 45%,var(--profile-bg-right)); position:absolute; z-index:0; inset:0; container-type:size; overflow:hidden; border-radius:inherit; pointer-events:none; -webkit-mask-image:radial-gradient(ellipse 50% 50% at 50% 50%,transparent 25%,#000 90%); mask-image:radial-gradient(ellipse 50% 50% at 50% 50%,transparent 25%,#000 90%); }
.modal-watercolor::before { --wc-short:max(calc(min(100cqw,100cqh) * 1.12 + 36px),calc(hypot(100cqw,100cqh) * .72)); content:""; position:absolute; top:50%; left:50%; width:max(200cqw,var(--wc-short)); height:var(--wc-short); translate:-50% -50%; opacity:.8; background:radial-gradient(circle at 20% 20%,color-mix(in srgb,var(--wc-deep) 55%,transparent) 0%,transparent 60%),radial-gradient(circle at 80% 80%,color-mix(in srgb,var(--wc-deep) 40%,transparent) 0%,transparent 70%),radial-gradient(circle at 40% 60%,color-mix(in srgb,var(--wc-deep) 45%,transparent) 0%,transparent 65%),radial-gradient(circle at 60% 30%,color-mix(in srgb,var(--wc-deep) 35%,transparent) 0%,transparent 55%),color-mix(in srgb,var(--profile-bg-main) 75%,transparent); }
@container (orientation:portrait) { .modal-watercolor::before { width:var(--wc-short); height:max(200cqh,var(--wc-short)); } }
.modal-watercolor::after { content:""; position:absolute; inset:-12px; opacity:.5; background:linear-gradient(45deg,transparent 5%,#ffffff66 20%,transparent 35%),linear-gradient(-45deg,transparent 65%,#ffffff40 80%,transparent 95%); }
.modal.is-open .modal-watercolor::before { animation:outpatient-watercolor-flow 12s ease-in-out infinite; }
.modal.is-open .modal-watercolor::after { animation:outpatient-watercolor-shimmer 8s ease-in-out infinite; }
#modal-content-area { position:relative; z-index:1; min-height:0; padding:52px 36px 36px; overflow-y:auto; overscroll-behavior:contain; scrollbar-color:#c7d3d9 transparent; scrollbar-width:thin; }
.modal.is-open .modal-container { animation:outpatient-profile-appear .5s ease-out; }
@keyframes outpatient-profile-appear { from { opacity:0; transform:translate(-50%,calc(-50% + 12px)); } to { opacity:1; transform:translate(-50%,-50%); } }
@keyframes outpatient-watercolor-flow { 0%,100% { transform:translate(0,0) scale(1) rotate(0deg); } 25% { transform:translate(15px,-10px) scale(1.2) rotate(45deg); } 50% { transform:translate(-8px,12px) scale(.9) rotate(90deg); } 75% { transform:translate(-12px,-8px) scale(1.1) rotate(135deg); } }
@keyframes outpatient-watercolor-shimmer { 0%,100% { transform:translate(0,0); } 25% { transform:translate(5px,-3px); } 50% { transform:translate(-3px,5px); } 75% { transform:translate(-5px,-2px); } }
.modal-close { position:absolute; z-index:2; top:10px; right:12px; display:grid; place-items:center; width:44px; height:44px; padding:0; border:1px solid #d0dce1; border-radius:50%; background:#ffffffed; color:#315c64; font-size:28px; line-height:1; cursor:pointer; transition:background-color 180ms ease,box-shadow 180ms ease; }
.modal-close:hover { background:var(--profile-tint); box-shadow:0 3px 10px #233b4814; }
.modal-content-grid { display:grid; grid-template-columns:180px minmax(0,1fr); gap:28px; }
.modal-content-grid:not(:has(.modal-image)) { grid-template-columns:minmax(0,1fr); }
.modal-image img { display:block; width:180px; height:177.3px; padding:6px; object-fit:cover; border:1px solid #dce4e8; border-radius:12px; background:#fff; box-shadow:0 5px 16px #233b4810; }
.modal-text { font-size:14px; line-height:1.9; overflow-wrap:anywhere; }
.modal-text h3 { color:#00475b; font-size:23px; margin-bottom:20px; padding-bottom:16px; border-bottom:1px solid #d6e0e5; }
.modal-text p+p { margin-top:16px; }
.modal-text hr { margin:20px 0; border:0; border-top:1px solid #dbe6e1; }
.modal-text a { text-decoration:underline; color:#00475b; }
.modal-role { display:inline-block; margin-left:8px; padding:2px 9px; border-radius:20px; background:var(--profile-tint); color:#45616b; font-size:12px; font-weight:500; line-height:1.7; vertical-align:middle; }
.no-image-placeholder { width:180px; min-height:160px; background:#eef4f1; display:grid; place-items:center; }
@media(max-width:1279px) {
    .doctor-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:899px) {
    .outpatient-heading,.page-layout-container { width:calc(100% - 40px); }
    .outpatient-heading { padding-top:112px; }
    .page-layout { grid-template-columns:1fr; gap:28px; padding-top:8px; }
    .sidebar { position:static; max-height:none; overflow:visible; padding:0; }
    .sidebar__title { padding:0; font-size:16px; margin-bottom:14px; }
    .sidebar__nav { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
    .sidebar__link { justify-content:center; padding:10px 8px; font-size:13px; text-align:center; }
    .sidebar__number { display:none; }
    .department-heading { padding:24px; }
    .department-content { padding:26px; }
    .schedule-table th,.schedule-table td { padding:12px 4px; }
}
@media(max-width:560px) {
    .outpatient-heading,.page-layout-container { width:calc(100% - 32px); }
    .outpatient-heading { padding-bottom:24px; }
    .outpatient-heading h1 { font-size:32px; }
    .outpatient-heading > p:last-child { font-size:14px; }
    .section-title { font-size:21px; }
    .certificates-notice { padding:15px 17px; }
    .department-heading { gap:12px; min-height:150px; padding:22px 18px; }
    .department-title { font-size:24px; }
    .department-icon { flex-basis:88px; width:88px; height:88px; }
    .department-eyebrow { font-size:9px; letter-spacing:.1em; }
    .department-heading__caption { font-size:10px; letter-spacing:0; }
    .department-content { padding:22px 18px 28px; font-size:14px; }
    .doctor-list { grid-template-columns:1fr; }
    .doctor-card { padding:16px; }
    #modal-content-area { padding:60px 22px 26px; }
    .modal-content-grid { grid-template-columns:1fr; gap:20px; }
    .modal-image img { width:140px; height:138px; }
    /* Transpose the schedule on phones: weekdays run down the first column and AM/PM run across. Grid column flow reorders the existing cells, so static and server-rendered tables need no extra markup. */
    .schedule-table { --schedule-rows:6; display:grid; grid-auto-flow:column; grid-template-columns:72px minmax(0,1fr); grid-template-rows:auto repeat(var(--schedule-rows),auto); font-size:13px; }
    .schedule-table:has(tbody tr:nth-child(2)) { grid-template-columns:72px repeat(2,minmax(0,1fr)); }
    .schedule-table:has(thead th:last-child:nth-child(2)) { --schedule-rows:2; }
    .schedule-table:has(thead th:last-child:nth-child(3)) { --schedule-rows:3; }
    .schedule-table:has(thead th:last-child:nth-child(4)) { --schedule-rows:4; }
    .schedule-table:has(thead th:last-child:nth-child(5)) { --schedule-rows:5; }
    .schedule-table:has(thead th:last-child:nth-child(7)) { --schedule-rows:7; }
    .schedule-table caption { grid-column:1 / -1; grid-row:1; }
    .schedule-hours { display:flex; margin:6px 0 0; }
    .schedule-table thead,.schedule-table tbody,.schedule-table tr { display:contents; }
    .schedule-table th,.schedule-table td { display:grid; place-items:center; width:auto; height:auto; min-height:52px; padding:10px 8px; border-bottom:1px solid #dce6e1; }
    .schedule-table th:first-child,.schedule-table td:first-child { width:auto; }
    .schedule-table tbody tr:nth-child(n) .time-label { background:#155564; color:#fff; }
    .schedule-table tbody :is(th,td) { border-left:1px solid #dce6e1; }
}
@media(prefers-reduced-motion:reduce) { .outpatient-page *, .outpatient-page *::before, .outpatient-page *::after { transition:none!important; animation:none!important; } }
@media(prefers-reduced-motion:reduce) { .outpatient-title-glyph { opacity:1; } .outpatient-title-glyph.is-caret::after { content:none; } }
@media print { .sidebar { display:none; } .page-layout { display:block; } .department-section[hidden] { display:block!important; } .department-section { break-inside:avoid; } .outpatient-title-glyph { opacity:1; } .outpatient-title-glyph.is-caret::after { content:none; } }
