.portal-entry { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; background: #f2f0e9; }
.portal-mast {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: calc(1.2rem + env(safe-area-inset-top, 0px)) max(1.2rem, env(safe-area-inset-right, 0px)) 1.2rem max(1.2rem, env(safe-area-inset-left, 0px));
  background: #191b19; color: #fff;
}
.portal-mast > span { font-size: .85rem; color: #deddd6; }
.portal-content {
  flex: 1; display: grid; place-items: center; padding: 2rem max(1.1rem, env(safe-area-inset-right, 0px)) calc(2rem + env(safe-area-inset-bottom, 0px)) max(1.1rem, env(safe-area-inset-left, 0px));
}
.portal-card {
  width: 100%; max-width: 31rem; padding: clamp(1.4rem, 5vw, 3.5rem);
  border: 1px solid rgba(25,27,25,.2); border-top: 4px solid #d7ef42; border-radius: 12px; background: white;
}
.portal-card h1 { font-size: clamp(2.2rem, 5vw, 3rem); font-weight: 400; }
.portal-card > p { color: #55574f; margin: .9rem 0 1.35rem; }
.portal-card .portal-status { margin: .75rem 0 0; font-size: .94rem; }
.portal-status:empty { display: none; }
.portal-card iframe { display: block; width: 100%; height: 48px; border: 0; }
.portal-retry { min-height: 44px; margin-top: .35rem; padding: 0; border: 0; color: #44463f; background: none; font: inherit; font-size: .95rem; text-decoration: underline; text-underline-offset: .2em; }
.portal-card [hidden] { display: none; }
.google-frame { margin: 0; padding: 0; background: transparent; }
#google-button { min-height: 44px; }
.employee-files { list-style: none; margin: 0; padding: 0; }
.employee-files li { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: .75rem; border-top: 1px solid var(--line); }
.file-open { min-height: 46px; padding: .65rem 0; text-align: left; border: 0; background: none; text-decoration: underline; text-underline-offset: .2em; overflow-wrap: anywhere; }
.file-size, .file-status { color: var(--muted); font-size: .86rem; }
.file-status:not(:empty) { margin: .45rem 0; }
.file-views { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0; }
.file-views .btn, .pdf-upload .btn, .file-archive { min-height: 44px; }
.file-views [aria-pressed="true"] { color: #fff; border-color: var(--ink); background: var(--ink); }
.employee-files li:has(.file-archive) { grid-template-columns: minmax(0,1fr) auto auto; }
.pdf-upload { display: grid; grid-template-columns: minmax(0,26rem) auto; gap: .2rem .65rem; align-items: end; justify-content: start; margin-block: .8rem 1.2rem; }
.pdf-upload label { min-width: 0; }
.pdf-upload .btn { grid-column: 2; grid-row: 1; justify-self: start; }
.pdf-upload input { width: 100%; min-height: 44px; }
@media(max-width:640px) {
  .pdf-upload { grid-template-columns: minmax(0,1fr); }
  .pdf-upload .btn { grid-column: auto; grid-row: auto; margin-top: .35rem; }
  .employee-files li:has(.file-archive) { grid-template-columns: minmax(0,1fr) auto; row-gap: 0; }
  .employee-files li:has(.file-archive) .file-size { grid-column: 1; grid-row: 2; padding-bottom: .55rem; }
  .employee-files li .file-archive { grid-column: 2; grid-row: 1 / span 2; }
}
.pdf-reader { box-sizing: border-box; width: min(100%,72rem); max-width: 100vw; height: min(94dvh,66rem); max-height: 100dvh; padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; }
.pdf-reader[open] { display: flex; flex-direction: column; }
.pdf-reader::backdrop { background: rgba(25,27,25,.6); }
.reader-header, .reader-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; padding: .65rem 1rem; }
.reader-header { background: var(--ink); color: white; }
.reader-header > div { flex: 1; min-width: 9rem; }
.reader-label { font-size: .75rem; color: #deddd6; }
.reader-header h2 { margin-top: .18rem; font-size: 1.16rem; overflow-wrap: anywhere; }
.reader-header .btn { color: var(--ink); white-space: nowrap; }
.reader-tools { border-bottom: 1px solid var(--line); }
.reader-paging, .reader-zoom { display: flex; align-items: center; gap: .5rem; }
.pdf-reader .btn { min-height: 44px; }
.page-count, .page-scale { font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.reader-status:not(:empty) { padding: .45rem 1rem; font-size: .9rem; }
.reader-scroll { flex: 1 1 0; min-height: 0; overflow: auto; overscroll-behavior: contain; background: #e3e2db; padding: 10px; }
.reader-scroll canvas { display: block; background: white; margin: 0 auto; }
.reader-text { flex: none; max-height: 30%; overflow: auto; padding: 0 1rem; background: white; }
.reader-text summary { display: list-item; cursor: pointer; line-height: 44px; font-size: .9rem; }
.reader-text pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; margin: 0 0 .75rem; }
@media(max-width:640px), (max-height:480px) {
  .pdf-reader { width: 100vw; height: 100dvh; margin: 0; border: 0; border-radius: 0; padding: env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px); }
  .reader-header, .reader-tools { padding: .4rem .65rem; gap: .3rem; }
  .reader-tools .btn { padding: .4rem .6rem; font-size: .85rem; }
  .reader-paging, .reader-zoom { gap: .4rem; }
}

.role-preview-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; padding: .65rem clamp(1rem,3.6vw,3.6rem); border-bottom: 1px solid var(--line); background: #fff; }
.role-preview-tools label { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.role-preview-tools select { width: auto; max-width: min(25rem,100%); min-height: 44px; }
.role-preview-tools p { font-weight: 600; font-size: .88rem; overflow-wrap: anywhere; }
.role-preview-tools small { display: block; font-size: .78rem; font-weight: 400; color: var(--muted); }
.role-preview-tools:has([data-return-owner]) { border-left: 4px solid #d7ef42; background: var(--paper); }
.folder-import { display: grid; justify-items: start; gap: .65rem; margin-top: 1rem; padding: 1rem 0 0; border-top: 1px solid var(--line); }
.folder-import label { width: min(100%, 26rem); }
.folder-match { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; }
[data-folder-match] { display: grid; gap: .75rem; margin-top: .8rem; max-width: 38rem; }
[data-folder-match] [hidden] { display: none; }
[data-folder-match] [aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
[data-folder-match] :is(button,select,input) { min-height: 44px; }
[data-folder-match] select { max-width: 100%; }
[data-folder-match] label { min-width: 0; }
[data-folder-match-review] { padding: 1rem; border: 1px solid var(--line); border-radius: 8px; }
[data-folder-match-review] dl { display: grid; margin: .75rem 0; overflow-wrap: anywhere; }
[data-folder-match-review] dt { margin-top: .45rem; font-size: .8rem; color: var(--muted); }
[data-folder-match-review] dd { font-size: .95rem; }
@media(max-width:640px) {
  .role-preview-tools label { min-width: 0; max-width: 100%; }
  .role-preview-tools select { font-size: 16px; }
}
