.portal-page { min-width: 280px; }
.portal-header { border-bottom: 1px solid var(--line); }
.portal-navigation { min-height: 88px; display: flex; align-items: center; gap: 28px; }
.portal-navigation .brand { margin-right: auto; }
.portal-back { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--silver); white-space: nowrap; }
.portal-back:hover { color: var(--frost); text-decoration: underline; }
.portal-account { display: flex; align-items: center; gap: 18px; min-width: 0; }
.portal-account > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 250px; color: var(--muted); font-size: 13px; }
.portal-quiet-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid #454451; border-radius: 999px; padding: 9px 18px; background: transparent; color: var(--silver); font-size: 13px; font-weight: 500; line-height: 1.5; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.portal-quiet-button:hover { background: #242330; color: var(--frost); border-color: var(--silver); }
.portal-quiet-button:active { transform: scale(.98); }
.portal-quiet-button:disabled { cursor: wait; opacity: .5; }
.portal-entry { display: grid; grid-template-columns: 1.15fr .85fr; gap: 100px; padding-top: 100px; padding-bottom: 110px; align-items: start; }
.entry-copy h1 { font-size: clamp(48px,5.1vw,74px); line-height: 1.06; max-width: 650px; }
.entry-copy > p { margin-top: 28px; max-width: 450px; color: var(--silver); font-size: 19px; line-height: 1.6; }
.entry-art { margin: 36px 0 0; overflow: hidden; border-radius: 12px; }
.entry-art img { width: 100%; aspect-ratio: 1.8; object-fit: cover; object-position: 67% center; }
.entry-copy .entry-note { color: var(--muted); font-size: 14px; max-width: 410px; margin-top: 23px; }
.entry-signin { padding-top: 10px; min-width: 0; }
.entry-heading { margin-bottom: 34px; }
.entry-heading h2 { font-size: 29px; line-height: 1.2; }
.entry-heading p { font-size: 16px; line-height: 1.6; margin-top: 14px; }
.auth-options { display: flex; align-items: stretch; gap: 6px; margin-bottom: 28px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; }
.auth-option { flex: 1; min-width: 0; min-height: 46px; padding: 10px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--silver); font: inherit; font-size: 14px; line-height: 1.4; cursor: pointer; transition: color .2s, background .2s; }
.auth-option:hover { color: var(--frost); background: #242330; }
.auth-option[aria-pressed=true] { background: var(--frost); color: var(--ink, #0f0e1a); }
.passcode-auth { padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.passcode-help { margin-top: 14px; font-size: 14px; line-height: 1.65; }
.passcode-auth > .button { width: 100%; margin-top: 25px; justify-content: center; }
.passcode-auth > .button:disabled { cursor: wait; opacity: .55; }
.passcode-back { display: inline-flex; align-items: center; min-height: 44px; margin-top: 16px; padding: 8px 0; background: none; border: 0; color: var(--silver); font: inherit; font-size: 13px; cursor: pointer; }
.passcode-back:hover { color: var(--frost); text-decoration: underline; }
.auth-option:focus-visible, .passcode-back:focus-visible { outline: 2px solid var(--frost); outline-offset: 3px; }
.portal-loading { color: var(--silver); padding: 26px 0; font-size: 16px; }
.portal-notice { border-top: 1px solid var(--line); padding: 29px 0 8px; }
.portal-notice h3 { font-size: 25px; line-height: 1.2; }
.portal-notice p { margin-top: 15px; font-size: 16px; line-height: 1.65; }
.portal-notice button { margin-top: 24px; }
.invitation-help { border-top: 1px solid var(--line); margin-top: 34px; padding-top: 24px; font-size: 14px; line-height: 1.7; }
.invitation-help a { display: inline-flex; align-items: center; gap: 8px; color: var(--frost); min-height: 44px; }
.invitation-help a:hover { text-decoration: underline; }
#auth-mount { min-width: 0; }
#auth-mount .cl-rootBox, #auth-mount .cl-cardBox { width: 100%; max-width: 100%; }
#auth-mount .cl-card { box-shadow: none; }
.portal-library { padding-top: 84px; }
.library-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 70px; padding-bottom: 60px; }
.library-heading h1 { font-size: clamp(46px,4.8vw,68px); line-height: 1.06; }
.library-heading p { max-width: 630px; margin-top: 26px; font-size: 19px; line-height: 1.6; }
.library-heading > .text-link { flex-shrink: 0; font-size: 14px; }
.portal-status { color: var(--silver); font-size: 16px; line-height: 1.6; }
.portal-status:empty { display: none; }
.portal-status:not(:empty) { padding-bottom: 26px; }
.portal-recovery { padding: 30px 0 70px; border-top: 1px solid var(--line); }
.portal-recovery p { max-width: 540px; margin-bottom: 24px; }
.catalog-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 28px; border-top: 1px solid var(--line); padding: 25px 0 20px; }
.catalog-scope { display: flex; align-items: center; gap: 26px; flex-shrink: 0; }
.scope-button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 12px 0; color: var(--muted); font-size: 15px; font-weight: 500; min-height: 48px; }
.scope-button[aria-pressed=true] { color: var(--frost); border-bottom-color: var(--silver); }
.scope-button:hover { color: var(--frost); }
.catalog-controls { display: flex; gap: 16px; min-width: 0; }
.portal-search { width: 230px; min-width: 0; }
.portal-category { min-width: 0; }
.portal-page input:not([type=checkbox]), .portal-page select { width: 100%; min-width: 0; border: 1px solid #57566f; border-radius: 8px; padding: 13px 15px; min-height: 48px; background: var(--twilight); color: var(--frost); font: inherit; font-size: 16px; line-height: 1.45; caret-color: var(--frost); }
.portal-page select { padding-right: 34px; }
.portal-page input::placeholder { color: #a7aabb; opacity: 1; }
.portal-page input:focus-visible, .portal-page select:focus-visible { outline: 2px solid var(--frost); outline-offset: 3px; }
.catalog-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; padding-bottom: 20px; }
.catalog-summary p { font-size: 13px; }
.demo-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 60px 36px; }
.demo-card { min-width: 0; }
.demo-visual { display: block; position: relative; aspect-ratio: 1.65; overflow: hidden; border-radius: 12px; background: var(--surface); }
.demo-visual img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .4s var(--ease); }
a.demo-visual:hover img { transform: scale(1.015); }
.demo-image-fallback { height: 100%; display: flex; align-items: center; justify-content: center; padding: 32px; color: var(--muted); font-size: 14px; }
.demo-guided-visual { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(28px,3vw,44px); background: var(--twilight); }
.demo-guided-type { display: flex; flex-direction: column; gap: 15px; }
.demo-guided-name { font-size: clamp(29px,3.4vw,49px); font-weight: 500; line-height: 1.08; letter-spacing: -.035em; color: var(--silver); overflow-wrap: anywhere; }
.demo-guided-category { font-size: 15px; color: var(--muted); }
.demo-guided-note { border-top: 1px solid var(--line); padding-top: 18px; font-size: 12px; line-height: 1.5; color: var(--silver); margin-top: 25px; }
.demo-meta { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 24px; }
.demo-meta p { font-size: 13px; line-height: 1.5; }
.demo-access { font-size: 12px; line-height: 1.4; padding: 6px 11px; border: 1px solid #454451; border-radius: 999px; white-space: nowrap; color: var(--muted); }
.demo-access[data-access=granted] { color: var(--frost); border-color: var(--silver); }
.demo-card h2 { font-size: 30px; line-height: 1.18; margin-top: 13px; letter-spacing: -.03em; }
.demo-description { margin-top: 14px; font-size: 16px; line-height: 1.65; max-width: 560px; }
.demo-action { margin-top: 17px; font-size: 14px; }
.demo-card h2 a:hover { color: var(--silver); }
.catalog-empty { padding: 70px 0 90px; border-top: 1px solid var(--line); }
.catalog-empty h2 { font-size: 32px; }
.catalog-empty p { margin-top: 18px; max-width: 530px; }
.catalog-empty button { margin-top: 25px; }
.portal-help { border-top: 1px solid var(--line); margin-top: 90px; padding: 65px 0 95px; }
.portal-help h2 { font-size: 36px; line-height: 1.2; }
.portal-help p { font-size: 17px; margin-top: 20px; }
.portal-help .text-link { margin-top: 18px; }
.portal-admin { margin-top: 90px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.portal-admin > summary { cursor: pointer; padding: 29px 0; font-size: 23px; line-height: 1.4; color: var(--frost); }
.admin-summary-note { font-size: 14px; color: var(--muted); margin-left: 24px; }
.admin-content { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; padding: 25px 0 64px; }
.admin-content > section { min-width: 0; }
.admin-section-heading h2 { font-size: 29px; line-height: 1.2; }
.admin-section-heading p { font-size: 15px; margin-top: 16px; line-height: 1.65; }
.admin-content form, .member-picker { margin-top: 29px; }
.portal-field { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.portal-field label, .portal-page legend { font-size: 14px; font-weight: 500; color: var(--frost); }
.portal-page fieldset { margin: 27px 0 26px; padding: 0; border: 0; min-width: 0; }
.portal-page legend { padding: 0 0 16px; }
.permission-options { display: grid; grid-template-columns: 1fr; gap: 0; }
.permission-option { display: flex; align-items: flex-start; gap: 13px; min-height: 44px; padding: 10px 0; font-size: 15px; line-height: 1.5; color: var(--silver); cursor: pointer; }
.permission-option input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--frost); flex-shrink: 0; }
.permission-option:has(input:checked) { color: var(--frost); }
.permission-option:has(input:disabled) { cursor: default; opacity: .6; }
.permission-option span { min-width: 0; overflow-wrap: anywhere; }
.permission-option small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.admin-status { font-size: 14px; color: var(--silver); line-height: 1.65; margin-top: 18px; overflow-wrap: anywhere; }
.admin-status:empty { display: none; }
.member-picker { display: flex; align-items: flex-end; gap: 16px; }
.member-picker .portal-field { flex: 1; }
.member-pagination { margin-top: 18px; }
.member-admin-note { margin-top: 22px; font-size: 14px; line-height: 1.65; color: var(--silver); }
.permission-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.revoke-confirmation { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.revoke-confirmation p { color: var(--silver); font-size: 15px; margin-bottom: 20px; overflow-wrap: anywhere; }
.pending-section { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 28px; }
.pending-section h3 { font-size: 23px; line-height: 1.2; margin-bottom: 10px; }
.pending-invitation { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 19px 0; border-bottom: 1px solid var(--line); }
.pending-invitation > div { min-width: 0; }
.pending-invitation p { font-size: 14px; color: var(--silver); overflow-wrap: anywhere; }
.pending-invitation small { display: block; color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 5px; }
.pending-invitation button { flex-shrink: 0; font-size: 12px; max-width: 160px; }
.portal-page [data-error=true] { color: var(--frost); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media(max-width:1100px) {
  .portal-entry { gap: 55px; grid-template-columns: 1fr 1fr; padding-top: 78px; }
  .library-heading { gap: 30px; align-items: flex-start; flex-direction: column; }
  .admin-content { gap: 48px; }
  .portal-account > span { max-width: 180px; }
}
@media(max-width:850px) {
  .portal-navigation { min-height: 76px; gap: 20px; flex-wrap: wrap; padding-block: 13px; }
  .portal-navigation .brand img { width: 130px; }
  .portal-account { order: 3; flex-basis: 100%; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; }
  .portal-account > span { max-width: none; }
  .portal-entry { grid-template-columns: 1fr; gap: 55px; padding-top: 65px; padding-bottom: 80px; }
  .entry-copy { max-width: 640px; }
  .entry-copy h1 { font-size: 58px; }
  .entry-art { display: none; }
  .entry-copy .entry-note { margin-top: 24px; max-width: 500px; }
  .entry-signin { max-width: 500px; width: 100%; padding: 35px 0 0; border-top: 1px solid var(--line); }
  .portal-library { padding-top: 58px; }
  .catalog-toolbar { align-items: stretch; flex-direction: column; gap: 24px; }
  .catalog-controls { width: 100%; }
  .portal-search { flex: 1; width: auto; }
  .portal-category { flex: 1; }
  .demo-grid { gap: 50px 24px; }
  .demo-card h2 { font-size: 27px; }
  .demo-meta { gap: 10px; align-items: flex-start; flex-direction: column; }
  .admin-content { grid-template-columns: 1fr; gap: 50px; }
  .admin-members { border-top: 1px solid var(--line); padding-top: 45px; }
  .permission-options { grid-template-columns: 1fr 1fr; column-gap: 24px; }
}
@media(max-width:540px) {
  .passcode-auth { padding: 23px 20px; }
  .portal-back { font-size: 12px; gap: 5px; }
  .portal-back .arrow { width: 16px; height: 16px; }
  .portal-navigation { gap: 12px; }
  .portal-navigation .brand img { width: 115px; }
  .portal-entry { padding-top: 49px; gap: 35px; }
  .entry-copy h1 { font-size: clamp(41px,10vw,54px); line-height: 1.08; }
  .entry-copy > p { font-size: 17px; margin-top: 23px; }
  .entry-copy .entry-note { font-size: 13px; }
  .entry-heading h2 { font-size: 27px; }
  .portal-library { padding-top: 48px; }
  .library-heading { padding-bottom: 35px; gap: 20px; }
  .library-heading h1 { font-size: 44px; }
  .library-heading p { font-size: 17px; margin-top: 23px; }
  .catalog-controls { flex-direction: column; gap: 12px; }
  .catalog-scope { gap: 28px; }
  .catalog-summary { align-items: flex-start; }
  .catalog-summary p { max-width: 210px; }
  .demo-grid { grid-template-columns: 1fr; gap: 44px; }
  .demo-meta { flex-direction: row; align-items: center; margin-top: 21px; }
  .demo-card h2 { font-size: 29px; }
  .demo-description { font-size: 15px; }
  .portal-admin { margin-top: 60px; }
  .portal-admin > summary { font-size: 22px; }
  .admin-summary-note { display: block; margin-left: 22px; margin-top: 8px; font-size: 13px; }
  .admin-content { padding-bottom: 40px; }
  .permission-options { grid-template-columns: 1fr; }
  .member-picker { gap: 12px; }
  .member-picker > button { padding-inline: 13px; }
  .pending-invitation { flex-direction: column; gap: 12px; }
  .portal-help { margin-top: 65px; padding: 48px 0 70px; }
  .portal-help h2 { font-size: 32px; }
}
@media(prefers-reduced-motion:reduce) {
  a.demo-visual:hover img, .portal-quiet-button:active { transform: none; }
}
