/* Projects and teaching surfaces share the workspace palette. */
html:has(.r3-page),body:has(.r3-page){min-width:0}
body.p1-r3-active #page-content{overflow:auto!important}
.r3-page{display:flex!important;height:auto!important;min-height:100%;overflow:visible!important;gap:16px!important;color:var(--ui-text)}
.r3-page h2,.r3-page h3,.r3-page h4,.r3-page .card .card-title h3,.r3-page .card .card-title strong{color:var(--ui-text)!important}
.r3-page p,.r3-page small,.r3-page label{color:var(--ui-muted)}
.r3-page .card,.r3-page .teach-detail{background:var(--ui-panel);border-color:var(--ui-line)}
.r3-page .page-head,.r3-page .head-actions,.r3-page .row-actions,.r3-page .teach-nav{flex-wrap:wrap}
.r3-toolbar{display:flex;align-items:end;gap:12px;flex-wrap:wrap;padding:12px 0;border-block:1px solid var(--ui-line)}
.r3-toolbar label,.r3-activities label{display:flex;flex-direction:column;gap:6px}
.r3-toolbar select,.r3-toolbar input,.r3-activities select,.r3-page textarea{min-width:0;max-width:100%;background:var(--ui-panel);color:var(--ui-text);border:1px solid var(--ui-border-strong);padding:9px;border-radius:4px}
.r3-toolbar .r3-grow{flex:1;min-width:180px}
.r3-toolbar input{width:100%}
.r3-project-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.r3-project-grid .card-title>div{min-width:0;overflow-wrap:anywhere}
.r3-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 24px;margin:16px 0}
.r3-meta div{min-width:0}
.r3-meta dt{font-size:12px;color:var(--ui-muted);margin-bottom:5px}
.r3-meta dd{margin:0;color:var(--ui-text);overflow-wrap:anywhere}
.r3-meta dd small{display:block;margin-top:4px;color:var(--ui-muted);font-size:11px}
.r3-description,.r3-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7}
.r3-description{max-height:180px;overflow:auto}
.r3-counts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.r3-page .summary-card{background:var(--ui-panel);border:1px solid var(--ui-line);border-radius:5px;min-height:140px;padding:14px}
.r3-page .summary-card strong{font-size:28px;color:var(--ui-accent);margin:12px 0 8px}
.r3-page .summary-card small{font-size:13px;color:var(--ui-accent)}
.r3-page .summary-card>span{font-size:12px;color:var(--ui-accent);display:block;overflow-wrap:anywhere}
.r3-page .summary-link{color:var(--ui-accent);position:static;margin-top:10px;display:block}
.r3-overview-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.r3-object{display:block;width:100%;padding:14px 0;text-align:left;border:0;border-bottom:1px solid var(--ui-line);background:transparent;color:var(--ui-text)}
.r3-object strong,.r3-object small{display:block;white-space:normal;overflow-wrap:anywhere}
.r3-object strong{font-size:14px}
.r3-object small{font-size:12px;color:var(--ui-muted);line-height:1.6;margin-top:4px}
.r3-object:hover{background:var(--ui-selected)}
.r3-object:focus-visible,.r3-page button:focus-visible,.r3-page select:focus-visible,.r3-page input:focus-visible,.r3-page textarea:focus-visible{outline:2px solid var(--ui-focus);outline-offset:3px}
.r3-unavailable{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.r3-quick-card .quick-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.r3-quick-card .quick-btn{min-width:0;padding:12px;display:flex;gap:10px;background:var(--ui-panel);border:1px solid var(--ui-line);white-space:normal;align-items:center;text-align:left}
.r3-quick-card .quick-copy{min-width:0;flex:1}
.r3-quick-card .quick-copy b,.r3-quick-card .quick-copy small{white-space:normal;overflow-wrap:anywhere;display:block}
.r3-quick-card .quick-copy small{font-size:11px;margin-top:6px;color:var(--ui-muted)}
.r3-quick-card .quick-symbol{position:static;width:auto;height:auto;color:var(--ui-accent);font-size:12px}
.r3-quick-card .quick-open{display:none}
.r3-health{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px}
.r3-resource-summary{display:grid;grid-template-columns:1fr 1fr 1.5fr;gap:20px;margin:18px 0}
.r3-resource-summary>div{min-width:0}
.r3-resource-summary dt{color:var(--ui-accent);font-size:13px}
.r3-resource-summary dd{margin:8px 0;color:var(--ui-accent);font-size:22px;font-weight:600;overflow-wrap:anywhere}
.r3-resource-summary small{display:block;line-height:1.7;overflow-wrap:anywhere}
.r3-backup-summary{border-top:1px solid var(--ui-line);padding-top:16px}
.r3-backup-summary h4{margin:0 0 12px}
.r3-backup-summary p{line-height:1.7;overflow-wrap:anywhere}
.r3-page .teach-layout{display:grid;grid-template-columns:minmax(230px,.8fr) minmax(0,1.7fr);gap:18px;align-items:start}
.r3-page .teach-list{max-height:none;overflow:visible;background:var(--ui-panel)}
.r3-page .teach-item{grid-template-columns:28px minmax(0,1fr);position:relative;border-color:var(--ui-line);color:var(--ui-text);min-height:90px}
.r3-page .teach-item strong{white-space:normal;color:var(--ui-text)}
.r3-page .teach-item small{white-space:normal;color:var(--ui-muted)}
.r3-page .teach-item em{grid-column:2;margin:5px 0 0;text-align:left;white-space:normal;font-size:11px}
.r3-page .teach-item.active{background:var(--ui-selected)}
.r3-page .teach-detail{position:sticky;top:0;padding:22px;min-width:0}
.r3-page .teach-detail p,.r3-page .teach-detail strong{color:var(--ui-muted)!important}
.r3-page .teach-detail>.field{display:block;background:transparent;border:0;padding:12px 0;color:var(--ui-muted)}
.r3-page .teach-detail textarea{display:block;width:100%;margin-top:8px;min-height:110px}
.r3-teaching-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;border-block:1px solid var(--ui-line);padding:16px 0;margin:20px 0}
.r3-teaching-facts section{min-width:0}
.r3-teaching-facts section+section{border-left:1px solid var(--ui-line);padding-left:18px}
.r3-teaching-facts h4{margin:0 0 12px}
.r3-teaching-facts code{font-size:11px;color:var(--ui-muted);overflow-wrap:anywhere}
#modal:has([data-r3-private]) .modal-card{width:min(840px,100%)}
#modal [data-r3-private] .field{display:block}
#modal [data-r3-private] .r3-meta dd{color:inherit}
#modal .r3-text{max-height:360px;overflow:auto}
#r3-project-delete-dialog{box-sizing:border-box;width:min(480px,calc(100% - 32px));max-height:calc(100% - 32px);padding:20px;border:1px solid var(--ui-line);border-radius:6px;background:var(--ui-panel);color:var(--ui-text);overflow:auto}
#r3-project-delete-dialog::backdrop{background:rgba(16,35,43,.55)}
#r3-project-delete-dialog h2{margin:0;font-size:20px}
#r3-project-delete-dialog p{line-height:1.55}
#r3-project-delete-dialog .row-actions{justify-content:flex-end;flex-wrap:wrap;margin-top:18px;gap:8px}
#r3-project-delete-dialog [aria-disabled="true"]{opacity:.6;cursor:default}
#r3-project-delete-dialog button:focus-visible{outline:2px solid var(--ui-focus);outline-offset:3px}
@media(pointer:coarse){#r3-project-delete-dialog button{min-height:44px}}
@media(max-width:1150px){.r3-counts{grid-template-columns:repeat(3,minmax(0,1fr))}.r3-project-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:850px){
  body.p1-r3-active .app-shell{grid-template-columns:170px minmax(0,1fr)}
  body.p1-r3-active .topbar{height:auto;min-height:90px;flex-wrap:wrap;padding-block:12px}
  body.p1-r3-active .top-actions{min-width:0!important;display:flex!important;flex-wrap:wrap;justify-content:flex-start}
  body.p1-r3-active .topbar>div:first-child{min-width:0}
  body.p1-r3-active .topbar p{white-space:normal!important}
  body.p1-r3-active .status-pills{flex-wrap:wrap}
  .r3-counts,.r3-unavailable{grid-template-columns:repeat(2,minmax(0,1fr))}
  .r3-resource-summary{grid-template-columns:minmax(0,1fr)}
  .r3-quick-card .quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .r3-overview-grid,.r3-page .teach-layout{grid-template-columns:minmax(0,1fr)}
  .r3-page .teach-detail{position:static}
  .r3-page .teach-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:600px){
  body.p1-r3-active .app-shell{grid-template-columns:122px minmax(0,1fr)}
  body.p1-r3-active .sidebar{padding-inline:4px}
  body.p1-r3-active .brand-copy span,body.p1-r3-active .brand-copy small,body.p1-r3-active .brand-logo,body.p1-r3-active .local-badge small{display:none}
  body.p1-r3-active .brand{padding-inline:4px}
  body.p1-r3-active .brand strong{font-size:12px}
  body.p1-r3-active .nav-item{font-size:12px;padding-inline:4px;gap:4px;overflow-wrap:anywhere}
  body.p1-r3-active .topbar h1{font-size:20px}
  body.p1-r3-active .main-area{padding-inline:8px}
  body.p1-r3-active .demo-banner{height:auto;padding-block:8px}
  .r3-counts,.r3-unavailable,.r3-page .teach-list,.r3-teaching-facts,.r3-health,.r3-meta{grid-template-columns:minmax(0,1fr)}
  .r3-quick-card .quick-grid{grid-template-columns:minmax(0,1fr)}
  .r3-teaching-facts section+section{border-left:0;border-top:1px solid var(--ui-line);padding:16px 0 0}
  .r3-toolbar label,.r3-toolbar .r3-grow{width:100%;min-width:0}
  .r3-toolbar select{width:100%}
  #modal:has([data-r3-private]) .form-grid{grid-template-columns:minmax(0,1fr)}
}
