/* Compact personal area: notice and documents. */
.portal-intro { padding-block: 45px 25px; }
.portal-content { padding-bottom: 60px; }
.portal-notice { border-left: 3px solid var(--color-primary); padding: 18px 22px; background: #eef1ed; margin-bottom: 38px; }
.portal-notice h2 { font-size: 1rem; margin-bottom: 7px; }
.portal-notice p { font-size: .95rem; color: var(--color-muted); }
.portal-section { margin-top: 35px; }
.portal-section > h2 { font-size: clamp(1.7rem, 2.5vw, 2.2rem); margin-bottom: 22px; }
.portal-rows { border-top: 1px solid var(--color-line); }
.portal-row { display: flex; justify-content: space-between; align-items: center; gap: 25px; padding-block: 22px; border-bottom: 1px solid var(--color-line); }
.portal-row h3 { font-size: 1.15rem; font-weight: 500; }
.portal-document-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.portal-document-actions button { padding: 4px 0; border: 0; border-bottom: 1px solid var(--color-primary); background: transparent; color: var(--color-text); font-size: .85rem; cursor: pointer; }
.portal-document-actions button:hover { color: var(--color-primary); }
body.portal-modal-open { overflow: hidden; }
.portal-dialog { width: min(720px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 30px; border: 1px solid var(--color-line); background: var(--color-bg); color: var(--color-text); }
.portal-dialog::backdrop { background: #182c3280; }
.portal-dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 22px; margin-bottom: 22px; }
.portal-dialog-heading h2 { font-size: clamp(1.4rem, 2.5vw, 2rem); line-height: 1.2; }
.portal-dialog-heading h2:focus { outline: none; }
.portal-dialog-close { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border: 1px solid var(--color-line); border-radius: 50%; background: transparent; color: var(--color-accent); font-size: 1.8rem; cursor: pointer; }
#portal-document-text { white-space: pre-line; font-size: .95rem; line-height: 1.8; }
@media(max-width:600px) {
 .portal-intro { padding-block: 30px 20px; }
 .portal-content { padding-bottom: 40px; }
 .portal-row { flex-direction: column; align-items: flex-start; gap: 14px; }
 .portal-notice { padding: 16px 18px; }
 .portal-dialog { padding: 22px; }
}
/* Existing database workflows, kept separate from the compact document list. */
.admin-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:20px; margin-bottom:25px; }
.portal-heading { display:flex; align-items:center; justify-content:space-between; gap:24px; }
.portal-heading h1 { margin-bottom:0; }
.portal-heading + .lead { margin-top:18px; }
#portal-account { flex:0 0 auto; }
#portal-logout { cursor:pointer; }
@media(max-width:600px) { .portal-heading { flex-wrap:wrap; gap:18px; } #portal-account { width:100%; } }
.portal-document-actions a { color:var(--color-accent); font-size:.85rem; text-underline-offset:4px; }
.portal-empty { padding-block:24px; }
#portal-admin { margin-top:0; margin-bottom:38px; }
.admin-form input:not([type="checkbox"]), .admin-form textarea, .admin-form select { width:100%; min-height:46px; padding:10px 12px; border:1px solid var(--color-line); border-radius:5px; color:var(--color-text); background:white; font:inherit; }
.admin-form { display:grid; gap:20px; white-space:normal; }
.admin-form label { display:grid; gap:8px; }
.admin-form .admin-check { display:flex; align-items:center; gap:12px; }
.admin-check input { width:20px; height:20px; flex:0 0 20px; }
.admin-form small { color:var(--color-muted); font-size:.8rem; }
.admin-form fieldset { border:1px solid var(--color-line); padding:16px; display:grid; gap:14px; }
[data-admin-status], .admin-form-status, #portal-status { margin-block:16px; }
#portal-welcome-text { white-space:pre-line; }
@media(max-width:600px) { .portal-document-actions { flex-direction:column; width:100%; text-align:center; gap:15px; } .admin-toolbar { align-items:stretch; flex-direction:column; } }

.portal-welcome.has-image { display:grid; grid-template-columns:minmax(150px,260px) minmax(0,1fr); align-items:start; gap:28px; }
.portal-welcome-image { display:block; width:100%; height:auto; max-height:320px; object-fit:contain; }
@media(max-width:600px) { .portal-welcome.has-image { grid-template-columns:1fr; gap:20px; } .portal-welcome-image { max-width:260px; justify-self:center; } }

.admin-accordion { border-top:1px solid var(--color-line); }
.admin-area { border-bottom:1px solid var(--color-line); }
.admin-area > summary { display:flex; align-items:center; justify-content:space-between; gap:20px; padding-block:22px; cursor:pointer; list-style:none; }
.admin-area > summary::-webkit-details-marker { display:none; }
.admin-area > summary h3 { margin:0; font-size:1.2rem; font-weight:500; }
.admin-area-symbol { position:relative; flex:0 0 18px; width:18px; height:18px; color:var(--color-accent); }
.admin-area-symbol::before,.admin-area-symbol::after { content:""; position:absolute; top:50%; left:50%; width:14px; height:1.5px; background:currentColor; transform:translate(-50%,-50%); }
.admin-area-symbol::after { transform:translate(-50%,-50%) rotate(90deg); }
.admin-area[open] > summary .admin-area-symbol::after { display:none; }
.admin-area[open] > summary { color:var(--color-accent); }
.admin-area-content { padding-bottom:25px; }
.admin-area-content .admin-toolbar { justify-content:flex-end; margin-bottom:15px; }
.admin-area .portal-row h4 { margin:0; font-size:1.15rem; font-weight:500; }
@media(max-width:600px) { .admin-area > summary { padding-block:20px; } .admin-area > summary h3 { font-size:1.1rem; } }

.portal-document-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:24px; }
.portal-document-card { min-width:0; display:flex; flex-direction:column; overflow:hidden; border:1px solid var(--color-line); border-radius:16px; background:#fff; }
.portal-document-preview { display:flex; align-items:center; justify-content:center; height:230px; overflow:hidden; background:#edf0ed; border-bottom:1px solid var(--color-line); }
.portal-document-preview object,.portal-document-preview img { display:block; width:100%; height:100%; object-fit:contain; pointer-events:none; }
.portal-document-preview img { padding:16px; }
.portal-file-placeholder { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:14px; width:100%; height:100%; color:var(--color-accent); font-size:.85rem; }
.portal-document-copy { flex:1; display:flex; flex-direction:column; padding:20px; }
.portal-document-copy h3 { font-size:1rem; font-weight:500; line-height:1.4; margin:0 0 22px; overflow-wrap:anywhere; }
.portal-document-card .portal-document-actions { margin-top:auto; justify-content:space-between; gap:12px; }
@media(max-width:1100px) { .portal-document-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:820px) { .portal-document-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; } }
@media(max-width:520px) { .portal-document-grid { grid-template-columns:1fr; } .portal-document-preview { height:280px; } .portal-document-card .portal-document-actions { flex-direction:column; align-items:center; gap:16px; } }

.portal-document-preview canvas { display:block; max-width:100%; max-height:100%; background:white; box-shadow:0 2px 8px #203b4012; }
