@media screen {
  #page-patient-detail .header-title-area { min-width:0; }
  #detail-patient-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .patient-create-wrap { position:relative; flex-shrink:0; }
  .patient-create-toggle { min-height:40px; padding:8px 12px; border:1px solid #79b9b4; border-radius:9px; background:#eaf9f4; color:#175960; font:inherit; font-size:14px; font-weight:650; cursor:pointer; }
  .patient-create-toggle:disabled { opacity:.6; cursor:wait; }
  .patient-create-menu { position:absolute; top:calc(100% + 9px); right:0; width:220px; padding:8px; border:1px solid #d3e3e6; border-radius:12px; background:#fff; box-shadow:0 8px 24px #163e5026; z-index:200; }
  .patient-create-menu[hidden] { display:none!important; }
  .patient-create-menu button { display:block; width:100%; padding:12px; border:0; border-radius:8px; background:#fff; color:#244c59; text-align:left; cursor:pointer; font:inherit; font-size:14px; }
  .patient-create-menu button:hover,.patient-create-menu button:focus-visible { background:#eaf6f2; outline:2px solid #35918b; outline-offset:-2px; }
  #patient-detail-status { grid-column:1/-1; }
  #patient-detail-status:empty { display:none; }
  .detail-workspace { gap:16px; }
  .detail-workspace > .presence-panel,.detail-workspace > .presence-warning { grid-column:1/-1; margin:0; }
  .detail-workspace .detail-context-bar { display:block; padding-top:6px; }
  .detail-context-bar > p { margin:0 0 4px; font-size:14px; font-weight:650; }
  .detail-context-bar .detail-navigation-hint { font-size:12px; color:var(--gray-500); font-weight:400; margin-bottom:14px; }
  .detail-section-buttons { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
  .detail-section-button { display:flex; align-items:center; gap:12px; text-align:left; padding:16px; min-height:90px; border:1px solid #dce7ec; border-radius:16px; background:#fff; color:#264554; cursor:pointer; transition:transform .16s ease,border-color .16s ease,background-color .16s ease; font:inherit; }
  .detail-section-button:disabled { cursor:wait; opacity:.65; }
  .detail-section-icon { display:grid; place-items:center; width:42px; height:42px; flex:0 0 42px; border-radius:13px; color:#167579; background:#eaf5f4; transition:transform .16s ease; }
  .detail-section-icon svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
  .detail-section-label { display:grid; gap:3px; flex:1; min-width:0; }
  .detail-section-label strong { font-size:16px; }
  .detail-section-label small { font-size:11px; line-height:1.4; color:#647c87; }
  .detail-section-label [data-detail-count] { color:#35686e; font-size:12px; font-weight:600; }
  .detail-section-chevron { font-size:20px; transition:transform .16s ease; }
  .detail-section-button.is-open { border-color:#219c9a; background:#eff9f7; }
  .detail-section-button.is-open .detail-section-icon { transform:translateY(-2px); }
  .detail-section-button.is-open .detail-section-chevron { transform:rotate(180deg); }
  .detail-section-button:focus-visible,.overview-scope button:focus-visible,.overview-record-link:focus-visible { outline:3px solid #268eac; outline-offset:3px; }
  .patient-detail-panel { grid-column:1/-1; min-width:0; animation:detail-reveal .16s ease-out; }
  .patient-detail-panel[hidden] { display:none!important; }
  #detail-panel-access #access-workspace { margin:0; }
  .detail-workspace > .patient-detail-panel.records-section { margin:0!important; }
  .overview-kicker { color:#527d85; font-size:12px; }
  .overview-scope { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; padding:14px 0; font-size:12px; color:#56717d; }
  .overview-scope button,.overview-record-link { border:1px solid #cee2e5; border-radius:8px; padding:7px 10px; background:#f3faf9; color:#146f73; cursor:pointer; font:inherit; }
  .overview-record-link { font-size:12px; margin-top:14px; }
  .overview-columns { display:grid; grid-template-columns:1.1fr 1fr; gap:18px; }
  .overview-columns > section { min-width:0; border:1px solid #dfe9ee; border-radius:14px; padding:18px; background:#f9fcfd; }
  .overview-columns h2 { font-size:16px; color:#244b5a; margin:0 0 12px; }
  .overview-operation { background:#faf9fd!important; border-color:#e8e3f3!important; }
  .overview-source + .overview-source { border-top:1px dashed #c9dce4; margin-top:16px; padding-top:14px; }
  .overview-source .fistula-source-note { margin:0 0 5px; color:#417980; font-size:12px; }
  .overview-access { margin:0 0 14px; font-size:12px; color:#677d89; overflow-wrap:anywhere; }
  .overview-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:0; }
  .overview-metrics dt { color:#637d89; font-size:12px; margin-bottom:4px; }
  .overview-metrics dd { margin:0; font-size:16px; font-weight:600; color:#214857; overflow-wrap:anywhere; }
  .overview-assessment,.overview-footnote,.overview-archive { font-size:12px; line-height:1.65; color:#647c87; margin:14px 0 0; overflow-wrap:anywhere; }
  .overview-notice { font-size:12px; line-height:1.6; color:#88642d; background:#fff6e5; padding:9px 12px; border-radius:8px; margin:10px 0; }
  .overview-empty { font-size:13px; color:#728793; padding:12px 0; }
  @keyframes detail-reveal { from { opacity:.4; transform:translateY(5px); } to { opacity:1; transform:translateY(0); } }
  @media (hover:hover) { .detail-section-button:not(:disabled):hover { transform:translateY(-2px); border-color:#219c9a; } }
  @media (max-width:768px) {
    .detail-workspace { gap:12px; }
    .detail-section-buttons { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
    .detail-section-button { gap:8px; padding:12px 10px; min-height:96px; border-radius:12px; }
    .detail-section-icon { width:32px; height:36px; flex-basis:32px; border-radius:10px; }
    .detail-section-icon svg { width:21px; height:21px; }
    .detail-section-label strong { font-size:14px; }
    .detail-section-label small { font-size:10px; }
    .detail-section-chevron { font-size:16px; }
    .overview-columns { grid-template-columns:1fr; gap:12px; }
    .overview-columns > section { padding:14px; }
    .overview-metrics dd { font-size:15px; }
  }
  @media (prefers-reduced-motion:reduce) { .patient-detail-panel { animation:none; } .detail-section-button,.detail-section-icon,.detail-section-chevron { transition:none; } }
}
