/* Figma reference pages: 12:10067–12:10615, 12:12853–12:13476.
   Shared activity primitives are composed without modifying earlier pages. */
.portal-reference{--ref-accent:#146f70;--ref-tint:#e8f7f5;background:var(--ui-bg);}
[data-theme="dark"] .portal-reference{--ref-accent:var(--dark-material);--ref-tint:var(--dark-material-bg);}
.portal-reference .main{background:var(--ui-bg);}
.portal-reference .content{font-family:Manrope,system-ui,sans-serif;color:var(--ui-text);max-width:1600px;padding:36px 40px 56px;}
.portal-reference .page-title{display:flex;align-items:flex-end;gap:16px;margin:0 0 28px;}
.portal-reference .page-title h1{font-size:32px;line-height:42px;font-weight:700;letter-spacing:-.6px;margin:0;}
.portal-reference .page-title .subtitle{font-size:16px;line-height:22px;color:var(--ui-muted);margin:8px 0 0;}
.reference-mobile-label{display:none;}
.reference-icon{display:inline-flex;align-items:center;justify-content:center;flex:none;vertical-align:middle;}
.reference-icon img{display:block;width:auto;height:auto;max-width:none;}
.reference-icon.design-dark{display:none;}[data-theme="dark"] .reference-icon.design-light{display:none;}[data-theme="dark"] .reference-icon.design-dark{display:inline-flex;}
.reference-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
.portal-resources .page-title #add{background:var(--dark-primary,var(--ref-accent));color:var(--ui-cta);border:0;border-radius:12px;min-height:44px;box-shadow:none;gap:8px;}
.resource-layout{--ui-brand:var(--ref-accent);--ui-tint:var(--ref-tint);}
.resource-card .activity-copy{gap:10px;}.resource-card .activity-copy h3{font-size:20px;line-height:26px;}.resource-card .activity-copy p{font-size:15px;line-height:21px;}
.resource-meta-detail{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:13px;color:var(--ref-accent);}
.resource-meta-detail time,.resource-meta-detail>[aria-hidden]{color:var(--ui-muted);}
.resource-external{display:inline-flex;align-items:center;align-self:flex-start;gap:8px;min-height:44px;padding:10px 14px;border-radius:12px;background:var(--ref-tint);color:var(--ref-accent);font-size:14px;line-height:20px;font-weight:600;text-decoration:none;}
.resource-controls{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:28px;}
.resource-subject{display:flex;align-items:center;gap:8px;width:270px;min-width:0;min-height:44px;padding:0 14px;border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-surface);}
.resource-subject select{appearance:none;min-width:0;width:100%;padding:10px 0;border:0;background:transparent;font:400 14px/20px Manrope,system-ui,sans-serif;color:var(--ui-text);}
.resource-order{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:flex-end;color:var(--ui-muted);font-size:13px;line-height:18px;}
.resource-order>span{display:flex;align-items:center;gap:6px;min-height:36px;padding:6px 12px;border:1px solid var(--ui-border);border-radius:99px;background:var(--ui-surface);}
.resource-order select{font:400 13px/18px Manrope,system-ui,sans-serif;padding:8px 10px;border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-surface);color:var(--ui-muted);max-width:100%;}
/* Contact data are unchanged; only their presentation is new. */
.contacts-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:stretch;}
.contact-panel{min-width:0;padding:24px;background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:16px;box-shadow:var(--ui-shadow);}
.contact-panel:nth-child(-n+2){min-height:350px;}
.contact-panel h2{font-size:20px;line-height:26px;font-weight:700;margin:0 0 18px;color:var(--ui-text);}
.contact-intro{font-size:14px;line-height:20px;margin:0 0 18px;color:var(--ui-muted);}
.contact-panel dl{margin:0;}
.contact-row{display:flex;align-items:center;gap:12px;min-height:52px;padding:6px 0;}
.contact-row+.contact-row{border-top:1px solid var(--ui-border);margin-top:2px;}
.contact-symbol{display:flex;align-items:center;justify-content:center;flex:none;width:38px;height:38px;border-radius:12px;background:var(--ui-tint);}
.contact-row>div{min-width:0;flex:1;}
.contact-row dt{font-size:12px;line-height:17px;color:var(--ui-muted);margin:0 0 2px;font-weight:400;}
.contact-row dd{font-size:14px;line-height:20px;color:var(--ui-text);margin:0;overflow-wrap:anywhere;}
.contact-row a{color:var(--ui-brand);text-decoration:underline;text-underline-offset:2px;}
.department-name{display:flex;align-items:center;gap:12px;font-size:15px;line-height:21px;}
.department-name .contact-symbol{width:44px;height:44px;}
.department-name strong{font-weight:600;}
.department-note{margin:12px 0 0;padding:14px;border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-subtle);color:var(--ui-muted);font-size:14px;line-height:20px;}
.electronic-dean{grid-column:1/-1;}
.dean-details{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1fr);gap:28px;min-height:338px;}
.dean-details>section{min-width:0;}
.dean-details h3{display:flex;align-items:center;gap:8px;font-size:13px;line-height:18px;letter-spacing:.4px;text-transform:uppercase;font-weight:600;color:var(--ui-muted);margin:0 0 12px;}
.reception{border-left:1px solid var(--ui-border);padding-left:28px;}
.reception-periods{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:12px;}
.reception-period{border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-subtle);padding:16px;min-width:0;}
.reception-period h4{font-size:14px;line-height:20px;font-weight:600;margin:0 0 4px;}
.reception-period dl>div{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.2fr);gap:8px;padding:9px 0;font-size:13px;line-height:18px;}
.reception-period dl>div+div{border-top:1px solid var(--ui-border);}
.reception-period dt{font-weight:400;color:var(--ui-muted);}.reception-period dd{margin:0;color:var(--ui-text);}
/* Resource editor keeps its original submit handler and fields. */
.portal-ui #modal[data-reference="resources"]{font-family:Manrope,system-ui,sans-serif;color:var(--ui-text);background:var(--ui-surface);width:min(720px,calc(100vw - 32px));border:1px solid var(--ui-border);border-radius:12px;padding:24px;box-shadow:0 12px 32px #07101f24;}
.portal-ui #modal[data-reference="resources"] .modal-head{margin:0 0 18px;gap:16px;}.portal-ui #modal[data-reference="resources"] h2{font-size:20px;line-height:26px;}
.portal-ui #modal[data-reference="resources"] .close{display:flex;align-items:center;justify-content:center;flex:none;width:44px;height:44px;background:transparent;}
.portal-ui #modal[data-reference="resources"] #editor{display:flex;flex-direction:column;gap:18px;}
.portal-ui #modal[data-reference="resources"] .field{display:flex;flex-direction:column;gap:7px;font-size:13px;line-height:18px;font-weight:600;margin:0;color:var(--ui-text);}
.portal-ui #modal[data-reference="resources"] .field[hidden]{display:none;}
.portal-ui #modal[data-reference="resources"] .field input,.portal-ui #modal[data-reference="resources"] .field textarea,.portal-ui #modal[data-reference="resources"] .field select{background:var(--ui-surface);color:var(--ui-text);border:1px solid var(--ui-border);border-radius:12px;padding:12px 14px;min-height:48px;font:400 14px/20px Manrope,system-ui,sans-serif;}
.portal-ui #modal[data-reference="resources"] .field textarea{min-height:100px;white-space:pre-wrap;}
.reference-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;}
.portal-ui #modal[data-reference="resources"] .reference-file-drop{padding:12px;border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-subtle);}
.portal-ui #modal[data-reference="resources"] .reference-file-drop input{border:0;padding:8px 0;background:transparent;font-size:13px;}
.portal-ui #modal[data-reference="resources"] .hint{font-size:13px;line-height:18px;color:var(--ui-muted);margin:0;}
.reference-section-field{order:5;border:1px solid var(--ui-border);border-radius:12px;padding:10px 14px;color:var(--ui-muted);font-size:13px;}
.reference-section-field summary{cursor:pointer;min-height:24px;}.reference-section-field[open] summary{margin-bottom:10px;}
.portal-ui #modal[data-reference="resources"] .form-error{order:6;margin:0;}.portal-ui #modal[data-reference="resources"] .form-error:empty{display:none;}
.portal-ui #modal[data-reference="resources"] .form-buttons{order:7;display:flex;gap:10px;margin:0;}
.portal-ui #modal[data-reference="resources"] .form-buttons button{flex:1;min-height:44px;border-radius:12px;box-shadow:none;font:600 14px/20px Manrope,system-ui,sans-serif;}
.portal-ui #modal[data-reference="resources"] .form-buttons button[type="submit"]{order:-1;background:var(--dark-primary,var(--ui-brand));color:var(--ui-cta);border:0;}
.portal-ui #modal[data-reference="resources"] .form-buttons .secondary{background:var(--ui-subtle);border:1px solid var(--ui-border);color:var(--ui-text);}
.portal-ui #modal[data-reference="resources"] .reference-pin-switch{display:flex;flex-direction:row-reverse;justify-content:space-between;align-items:center;gap:12px;margin:0;padding:12px;border-radius:12px;background:var(--ui-subtle);font-size:14px;line-height:20px;}
.reference-pin-switch{cursor:pointer;}
.portal-ui #modal .reference-pin-switch input[type="checkbox"]{appearance:none;position:relative;display:block;width:38px;height:22px;min-height:22px;flex:0 0 38px;margin:0;padding:0;border:0;border-radius:99px;background:var(--ui-muted);cursor:pointer;}
.portal-ui #modal .reference-pin-switch input[type="checkbox"]:checked{background:var(--ui-brand);}.reference-pin-switch input:before{content:'';position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:50%;background:white;}.reference-pin-switch input:checked:before{left:18px;}
.portal-ui #modal[data-reference="resources"] .check:not(.reference-pin-switch){display:flex;align-items:center;gap:10px;padding:12px;background:var(--ui-subtle);border-radius:12px;font-size:13px;color:var(--ui-text);overflow-wrap:anywhere;}
.portal-ui #modal[data-reference="resources"].reference-delete-dialog{width:min(420px,calc(100vw - 32px));}
.reference-delete-symbol{display:flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:12px;background:var(--ui-danger-bg);}
.portal-ui #modal[data-reference="resources"].reference-delete-dialog .modal-head{position:relative;align-items:flex-start;flex-direction:column;gap:16px;}
.portal-ui #modal[data-reference="resources"].reference-delete-dialog .close{position:absolute;right:0;top:0;}
.portal-ui #modal[data-reference="resources"].reference-delete-dialog .form-buttons button[type="submit"]{order:1;background:var(--dark-danger-solid,var(--ui-danger));color:white;}
@media(max-width:1250px){.dean-details{grid-template-columns:1fr 1fr;gap:20px;}.reception{padding-left:20px;}.reception-periods{grid-template-columns:1fr;}}
@media(max-width:760px){
 .portal-reference .content{padding:24px 16px 32px;}.portal-reference .page-title{align-items:flex-start;flex-wrap:wrap;margin-bottom:20px;}.portal-reference .page-title>div{width:100%;}.portal-reference .page-title h1{font-size:28px;line-height:36px;letter-spacing:-.3px;}.portal-resources .page-title h1{display:flex;align-items:center;justify-content:space-between;gap:16px;}.portal-reference .page-title .subtitle{font-size:15px;line-height:21px;margin-top:8px;}
 .reference-mobile-label{display:inline-flex;flex:none;padding:7px 10px;border-radius:99px;background:var(--ref-tint);color:var(--ref-accent);font-size:11px;line-height:16px;font-weight:500;letter-spacing:0;}
 .resource-controls{flex-direction:column;align-items:stretch;gap:20px;margin-bottom:20px;}.resource-subject{width:100%;}.resource-order{justify-content:flex-start;gap:10px;}.resource-order>span{width:100%;background:var(--ref-tint);color:var(--ref-accent);border:0;border-radius:12px;font-size:12px;min-height:36px;}.resource-order label{margin-left:auto;}.resource-order select{font-size:12px;padding:6px 10px;}
 .resource-card{padding:18px;}.resource-card .activity-copy h3{font-size:18px;line-height:24px;}.resource-card .activity-copy p{font-size:14px;line-height:20px;}.resource-card .activity-badge{font-size:11px;}.resource-meta-detail{font-size:12px;line-height:18px;}.resource-external{align-self:stretch;font-size:13px;}
 .contacts-grid{grid-template-columns:minmax(0,1fr);gap:16px;}.contact-panel{padding:18px;}.contact-panel:nth-child(-n+2){min-height:0;}.contact-panel h2{font-size:18px;line-height:24px;margin-bottom:16px;}.contact-intro{font-size:14px;margin-bottom:14px;}.contact-row dd{font-size:13px;line-height:19px;}.contact-row dt{font-size:11px;line-height:16px;}.department-name{font-size:14px;line-height:20px;}.department-note{font-size:13px;line-height:19px;padding:12px;}
 .dean-details{display:flex;flex-direction:column;gap:22px;min-height:0;}.reception{border-left:0;border-top:1px solid var(--ui-border);padding:20px 0 0;}.reception-periods{grid-template-columns:1fr;gap:12px;}.reception-period{padding:14px;}.reception-period dl>div{grid-template-columns:1fr 1.4fr;}
 .portal-ui #modal[data-reference="resources"]{padding:18px;max-height:calc(100dvh - 32px);}.reference-form-grid{grid-template-columns:1fr;}.portal-ui #modal[data-reference="resources"] .field input,.portal-ui #modal[data-reference="resources"] .field textarea,.portal-ui #modal[data-reference="resources"] .field select{font-size:16px;}
}

.reference-upload-icon{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:12px;background:var(--ref-tint);}

/* Document templates use the same cards, typography and actions as the portal. */
.document-template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;}
.document-template-card{display:flex;flex-direction:column;align-items:flex-start;gap:20px;min-width:0;padding:24px;background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:16px;box-shadow:var(--ui-shadow);}
.template-symbol{display:flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:12px;background:var(--ui-tint);color:var(--ui-brand);}
.template-symbol svg{width:20px;height:20px;}
.template-copy h2{margin:0 0 8px;font-size:20px;line-height:26px;font-weight:700;}
.template-copy p{margin:0;color:var(--ui-muted);font-size:15px;line-height:22px;}
.template-open{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;margin-top:auto;padding:10px 16px;border-radius:12px;background:var(--dark-primary,var(--ui-brand));color:var(--ui-cta);font-size:14px;line-height:20px;font-weight:600;text-decoration:none;}
.template-open svg{width:16px;height:16px;}
.template-open svg [stroke]:not([stroke="none"]){stroke:currentColor;}
.template-open:focus-visible{outline:2px solid var(--ui-brand);outline-offset:3px;}
@media(hover:hover) and (pointer:fine){.template-open:hover{background:var(--dark-primary-hover,color-mix(in srgb,var(--ui-brand) 90%,var(--ui-text)));color:var(--ui-cta);}}
@media(max-width:760px){.document-template-grid{grid-template-columns:1fr;gap:16px;}.document-template-card{padding:20px;gap:16px;}.template-copy h2{font-size:18px;line-height:24px;}}
