.client-portal {
  --portal-ink: #132637;
  --portal-muted: #526576;
  --portal-edge: #d6e1e9;
  --portal-accent: #ffab28;
  background: #f4f7fa;
  color: var(--portal-ink);
  min-height: 70vh;
}
.client-portal [hidden] { display: none !important; }
.portal-shell { width: min(1160px, 100% - 36px); margin: auto; padding: clamp(24px, 5vw, 54px) 0 64px; }
.portal-heading, .portal-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.portal-heading h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0; overflow-wrap: anywhere; }
.client-portal h2 { font-size: 1.24rem; margin: 0 0 8px; }
.client-portal h3 { font-size: 1.05rem; margin: 0; overflow-wrap: anywhere; }
.client-portal p { margin: 0; color: var(--portal-muted); overflow-wrap: anywhere; }
.portal-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 22px 0 16px; }
.portal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.portal-panel { padding: clamp(16px, 3vw, 24px); border: 1px solid var(--portal-edge); border-radius: 14px; background: white; }
.portal-form { display: grid; gap: 14px; margin-top: 14px; }
.portal-auth { max-width: 520px; }
.portal-control { display: grid; gap: 5px; font-weight: 650; font-size: .92rem; }
.portal-control input, .portal-control select, .portal-control textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #aebfca; border-radius: 8px;
  background: white; color: var(--portal-ink); font: inherit; font-weight: 400;
}
.portal-control textarea { min-height: 78px; resize: vertical; }
.portal-primary, .portal-secondary, .portal-quiet {
  font: inherit; font-size: .9rem; font-weight: 700; padding: 9px 14px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; color: var(--portal-ink);
}
.portal-primary, .portal-secondary[aria-pressed="true"] { background: var(--portal-accent); }
.portal-secondary { background: #e8f0f5; border-color: #d3e1ea; }
.portal-quiet { background: transparent; color: #174969; text-decoration: underline; padding-inline: 3px; }
.portal-primary:disabled, .portal-secondary:disabled { opacity: .6; cursor: wait; }
.portal-items { display: grid; gap: 12px; }
.portal-item { border: 1px solid var(--portal-edge); border-radius: 10px; padding: 14px; display: grid; gap: 10px; }
.portal-notice:not(:empty) { background: #fff1d7; border-radius: 8px; padding: 12px; margin-top: 16px; color: #563600; }
.portal-meta { font-size: .85rem; }
.portal-scope { white-space: pre-wrap; }
.portal-tag { border-radius: 99px; background: #edf3f7; color: #25455d; font-size: .8rem; font-weight: 700; padding: 4px 9px; }
.portal-choices { border: 0; padding: 0; margin: 0; }
.portal-choices legend { margin-bottom: 8px; font-weight: 700; }
.portal-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 8px; }
.portal-choice { padding: 8px 10px; display: flex; align-items: center; gap: 9px; min-height: 42px; border: 1px solid var(--portal-edge); border-radius: 8px; }
.portal-choice:has(input:checked) { background: #fff3dc; border-color: #c98516; }
.portal-choice input { width: 17px; height: 17px; accent-color: #935700; flex-shrink: 0; }
.portal-more summary { cursor: pointer; font-weight: 650; color: #174969; }
.portal-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.portal-history { display: grid; gap: 8px; margin-top: 8px; }
.portal-history p { white-space: pre-wrap; }
.portal-footer { padding: 20px; text-align: center; }
@media (max-width: 690px) { .portal-grid { grid-template-columns: 1fr; } }
