/* Tylko rozszerzenie; kolory i szerokość pochodzą z obecnego portalu. */
[hidden] { display: none !important; }
.portal-tabs { display: flex; gap: 6px; padding: 5px; margin: 22px 0; background: #f1f5f9; border-radius: 9px; }
.portal-tab { flex: 1; border: 0; border-radius: 6px; padding: 11px 8px; background: transparent; color: #526174; font-size: .9rem; font-weight: 600; cursor: pointer; }
.portal-tab[aria-selected="true"] { background: white; color: var(--primary-color); box-shadow: 0 1px 5px #18354a16; }
.portal-tab:focus-visible, .orders-button:focus-visible { outline: 3px solid #0082c955; outline-offset: 3px; }
.orders-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.orders-heading h3 { color: var(--primary-color); font-size: 1.15rem; margin-bottom: 6px; }
.orders-muted { font-size: .86rem; line-height: 1.5; color: #64748b; }
.orders-list { display: grid; gap: 12px; }
.order-card { padding: 18px; border: 1px solid var(--border-color); border-radius: 9px; }
.order-card h4 { font-size: .98rem; line-height: 1.45; overflow-wrap: anywhere; }
.order-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 9px; }
.order-reference { color: #64748b; font-size: .78rem; margin-bottom: 5px; }
.order-stage { color: #526174; font-size: .86rem; line-height: 1.5; margin-top: 6px; overflow-wrap: anywhere; }
.order-stage strong { color: var(--primary-color); font-weight: 600; }
.order-description { color: #526174; font-size: .86rem; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; margin: 10px 0; }
.order-status { display: inline-block; border-radius: 20px; padding: 5px 10px; background: #edf4fb; color: #216493; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.order-status[data-status="collecting"] { background: #fff3db; color: #855800; }
.order-status[data-status="awaiting_payment"], .order-status[data-status="awaiting_confirmation"] { background: #fff3db; color: #855800; }
.order-action-hint { color: #855800; font-size: .86rem; line-height: 1.5; margin-top: 12px; overflow-wrap: anywhere; }
.order-status[data-status="done"] { background: #e9f5ec; color: #2e6a3d; }
.order-status[data-status="cancel"] { background: #f0f1f3; color: #64748b; }
.order-card-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #edf0f3; }
.orders-button { border: 1px solid var(--primary-color); border-radius: 6px; padding: 9px 12px; background: white; color: var(--primary-hover); font-size: .84rem; font-weight: 600; cursor: pointer; }
.orders-button.primary { background: var(--primary-color); color: white; }
.orders-button:disabled { opacity: .5; cursor: default; }
.orders-message { font-size: .88rem; line-height: 1.5; margin: 12px 0; color: #64748b; }
.orders-message[data-error="true"] { color: var(--error-color); }
.survey-notice { display: grid; gap: 7px; min-width: 0; max-width: 100%; padding: 13px 15px; background: #edf6fc; border-radius: 7px; margin: 16px 0 22px; font-size: .85rem; line-height: 1.5; color: #315b76; overflow-wrap: anywhere; white-space: normal; }
.survey-notice p { min-width: 0; margin: 0; }
.survey-notice-year { font-weight: 700; }
.survey-back { display: inline-block; margin-bottom: 20px; }
.survey-notice a { color: var(--primary-hover); overflow-wrap: anywhere; }
.survey-field { margin-bottom: 19px; }
.survey-field label { display: block; margin-bottom: 7px; font-weight: 600; font-size: .9rem; line-height: 1.5; }
.survey-field input, .survey-field textarea, .survey-field select { width: 100%; border: 1px solid var(--border-color); border-radius: 6px; padding: 11px; background: white; color: var(--text-color); font-size: 1rem; }
.survey-field textarea { min-height: 100px; resize: vertical; }
.survey-field :is(input, textarea, select):focus { outline: 2px solid #0082c933; border-color: var(--primary-color); }
.survey-field [aria-invalid="true"] { border-color: var(--error-color); }
.survey-field-error { color: var(--error-color); font-size: .78rem; line-height: 1.4; margin-top: 6px; }
.survey-prefill { display: block; color: #64748b; font-size: .76rem; margin-top: 5px; }
.survey-prefill-actions { display: grid; justify-items: start; gap: 8px; margin: 18px 0; }
.survey-section { margin:18px 0; padding:16px; border:1px solid var(--border-color); border-radius:8px; }
.survey-section>summary { color:var(--primary-color); font-size:.95rem; font-weight:600; cursor:pointer; line-height:1.5; }
.survey-section[open]>summary { margin-bottom:18px; }
.survey-section>.survey-field:last-child { margin-bottom:0; }
.survey-help { color:#64748b; font-size:.78rem; line-height:1.5; margin-top:6px; overflow-wrap:anywhere; }
.survey-help a { color:var(--primary-hover); }
.survey-confirm { display: flex; align-items: flex-start; gap: 9px; font-size: .86rem; line-height: 1.5; margin: 20px 0; }
.survey-confirm input { margin-top: 4px; width: 17px; height: 17px; flex-shrink: 0; }
.survey-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.portal-footer { border-top: 1px solid #edf0f3; margin-top: 26px; padding-top: 18px; text-align: center; color: #84909f; font-size: .75rem; line-height: 1.5; }
@media (max-width: 540px) { .order-card { padding: 14px; } .order-card-top { flex-direction: column; gap: 9px; } .orders-heading { gap: 8px; } .survey-actions .orders-button { flex: 1; } }

/* Pola i elementy flex/grid muszą móc zwęzić się do szerokości telefonu. */
.portal-tabs, .portal-tab, #portalDocumentsPanel, #portalOrdersPanel,
.orders-list, .order-card, .orders-heading > *, .order-card-top > *,
.portal-survey, .survey-section, .survey-field { min-width: 0; max-width: 100%; }
.order-reference, .orders-muted, .survey-field label, .survey-section > summary,
.survey-prefill, .survey-field-error, .survey-confirm { overflow-wrap: anywhere; }
.survey-field input, .survey-field textarea, .survey-field select { min-width: 0; max-width: 100%; }
.orders-button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.survey-field .survey-file-picker { position: absolute; width: 1px; height: 1px; min-height: 1px; padding: 0; margin: -1px; border: 0; clip: rect(0,0,0,0); clip-path: inset(50%); overflow: hidden; }
.survey-file-drop-zone { margin-top: 10px; }
.survey-file-drop-zone:focus-visible { outline: 3px solid var(--primary-color); outline-offset: 3px; }
.survey-file-drop-zone[aria-disabled="true"] { opacity: .6; cursor: default; }
.survey-upload-status { margin: 10px 0; padding: 12px; border-radius: 8px; background: #eef7fc; color: #275c73; white-space: pre-line; overflow-wrap: anywhere; }
.survey-upload-status[data-error="true"] { background: #fff1f1; border: 1px solid #d63344; color: #9e1525; }
.survey-file-list { list-style: none; padding: 0; margin: 12px 0; }
.survey-file-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #e3e9ed; }
.survey-file-row a { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; color: #007fa7; }
.survey-file-row .orders-button { padding: 6px 12px; }
.survey-file-list .survey-help { margin: 0; }

@media (max-width: 600px) {
  .portal-tab, .orders-button { min-height: 44px; }
  .portal-tab { font-size: .95rem; }
  .orders-heading { flex-direction: column; align-items: stretch; }
  .orders-heading > .orders-button { align-self: flex-start; }
  .order-status { max-width: 100%; white-space: normal; }
  .survey-section { padding: 13px; margin: 16px 0; }
  .survey-section > summary { min-height: 32px; }
  .survey-notice { padding: 13px; gap: 8px; font-size: .9rem; }
  .survey-field input, .survey-field select, .survey-field textarea { min-height: 44px; font-size: 16px; }
  .survey-field input[type="date"] { min-inline-size: 0; }
  .survey-actions { flex-direction: column; align-items: stretch; }
  .survey-actions .orders-button, .survey-prefill-actions .orders-button { width: 100%; }
  .survey-prefill-actions { justify-items: stretch; }
  .survey-confirm { gap: 10px; }
  .survey-confirm input { width: 22px; height: 22px; }
}
