* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 16px/1.5 Arial, sans-serif; color: #17233a; background: #f1f5f9; }
.portal-header { display: flex; align-items: center; gap: 16px; padding: 16px max(20px, calc((100% - 1100px) / 2)); background: #0a2342; color: white; }
.logo { width: 90px; max-height: 60px; object-fit: contain; background: white; border-radius: 6px; padding: 3px; }
.portal-header strong, .portal-header span { display: block; }
.account { margin-left: auto; display: flex; align-items: center; gap: 12px; }
main { max-width: 1100px; margin: auto; padding: 20px; }
h1 { margin-bottom: 4px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; border: 0; border-radius: 6px; padding: 10px 16px; background: #145cc2; color: white; }
button:disabled { opacity: .6; cursor: not-allowed; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.tabs button[aria-pressed="false"] { background: #475569; }
.notice, #portalMessage:not(:empty) { padding: 12px; background: #e0f2fe; border-radius: 6px; }
.card { background: white; border: 1px solid #cbd5e1; border-radius: 10px; margin: 14px 0; padding: 18px; box-shadow: 0 2px 6px #0001; }
.card h3 { margin-top: 0; }
details > summary { cursor: pointer; font-weight: bold; }
.badge { display: inline-block; padding: 3px 8px; background: #e2e8f0; border-radius: 6px; font-size: .85rem; font-weight: bold; }
.approved { color: #166534; background: #dcfce7; }
.line { padding: 10px 0; border-top: 1px solid #cbd5e1; overflow-wrap: anywhere; }
.line p { margin: 4px 0; }
.photo { margin: 12px 0; max-width: 100%; }
.photo-frame { max-width: 100%; }
.photo-frame img { display: block; max-width: 100%; width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
figcaption { margin-top: 4px; overflow-wrap: anywhere; }
label { display: block; margin-top: 12px; font-weight: bold; }
input, textarea { display: block; width: 100%; padding: 10px; margin-top: 4px; border: 1px solid #94a3b8; border-radius: 5px; }
canvas { display: block; width: min(100%, 480px); height: 160px; border: 1px solid #64748b; background: white; touch-action: none; margin: 8px 0; }
.signature-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.secondary { background: #475569; }
dialog { max-width: 95vw; max-height: 95vh; border: 0; border-radius: 10px; padding: 16px; }
dialog::backdrop { background: #000c; }
dialog img { display: block; max-width: 85vw; max-height: 75vh; width: auto; height: auto; margin: 12px auto; }
@media (max-width: 600px) {
  .portal-header { flex-wrap: wrap; }
  .account { width: 100%; margin-left: 0; justify-content: space-between; }
  main { padding: 14px; }
  .tabs button { flex: 1 1 180px; }
}
