:root {
  font-family: Inter, system-ui, sans-serif;
  color: #172d42;
  background: #edf3f8;
  line-height: 1.5;
  --muted: #486078;
  --line: #cbd9e5;
  --blue: #185b90;
  --orange: #dd7f44;
  --bar-bg: #143650;
  --bar-accent: #55a7cd;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.wrap { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.masthead { background: var(--bar-bg); color: #fff; border-bottom: 4px solid var(--bar-accent); }
.masthead-content { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.app-masthead .masthead-content { width: min(1280px, calc(100% - 32px)); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; font-weight: 650; }
.brand .cross, #stop-server { flex-shrink: 0; }
.stop-error { margin-top: 14px; }
.shutdown-reminder { margin-bottom: 16px; color: var(--muted); font-size: .9rem; }
.cross { display: grid; place-items: center; border-radius: 9px; background: #e2f3ff; color: #144b71; width: 34px; height: 34px; font-size: 26px; line-height: 1; }
.app-top { background: #edf3f8; }
.intro { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px; padding: 44px 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.app-top .intro { margin-bottom: 0; }
.app-content { padding-top: 26px; }
@media screen and (min-width: 1024px) and (min-height: 480px) {
  .app-top { position: sticky; top: 0; z-index: 5; }
  html { scroll-padding-top: var(--app-scroll-padding, 0px); }
}
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.04em; line-height: 1.12; }
h2 { font-size: 1.2rem; line-height: 1.3; }
.intro p { margin-top: 10px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding-bottom: 40px; }
.card { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 22px; border: 1px solid var(--line); border-top: 3px solid #669fc2; border-radius: 12px; background: #fff; box-shadow: 0 3px 12px #16365009; }
.case { color: var(--muted); padding: 10px 12px; background: #eef5fa; border-radius: 6px; overflow-wrap: anywhere; }
.card form { display: flex; flex-direction: column; flex: 1; gap: 16px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.fields label:only-child { grid-column: 1 / -1; }
.scenario-options { grid-column: 1 / -1; min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.scenario-options legend { padding: 0; font-size: .9rem; font-weight: 650; }
.scenario-choices { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 5px; }
.scenario-choices label { display: flex; align-items: center; gap: 6px; min-height: 26px; font-weight: 400; cursor: pointer; }
.scenario-choices input { width: auto; margin: 0; padding: 0; accent-color: var(--blue); }
label { display: block; font-size: .9rem; font-weight: 650; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; color: inherit; background: white; border: 1px solid #9fb5c8; border-radius: 7px; padding: 9px 10px; font: inherit; font-weight: 400; }
textarea { resize: vertical; }
select { appearance: none; padding-right: 30px; background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='m2 2 5 5 5-5' fill='none' stroke='%23375770' stroke-width='2'/%3E%3C/svg%3E") right 10px center / 12px no-repeat; }
button { font: inherit; font-size: .9rem; font-weight: 650; border: 1px solid transparent; border-radius: 7px; padding: 9px 14px; background: var(--blue); color: white; cursor: pointer; }
button:hover { background: #104570; }
button:disabled { opacity: .65; cursor: wait; }
button.secondary, button.close { color: #174a70; background: #fff; border-color: #b2c9da; }
button.secondary:hover, button.close:hover { background: #e2f1fb; }
.transfer-button { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; background: var(--orange); text-align: left; }
.transfer-button:hover { background: var(--orange); box-shadow: inset 0 0 0 2px #172d4266; }
.transfer-button svg { flex: none; }
:focus-visible { outline: 3px solid #127fbb; outline-offset: 3px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: auto; }
.footer-actions { border-top: 1px solid var(--line); padding: 20px 0 32px; text-align: right; }
@media screen {
  body { display: flex; flex-direction: column; min-height: 100vh; }
  .app-footer { margin-top: auto; }
}
.app-footer { background: var(--bar-bg); color: #fff; border-top: 4px solid var(--bar-accent); }
.app-footer-content { display: grid; gap: 12px; padding-block: 16px; }
.app-footer-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.app-footer-nav :is(button, a) { min-height: 44px; background: transparent; color: inherit; border-color: #7595ad; }
.app-footer-nav a { display: inline-flex; align-items: center; padding: 8px 14px; border: 1px solid #7595ad; border-radius: 6px; font-size: .9rem; font-weight: 700; text-decoration: none; }
.app-footer-nav :is(button, a):hover { background: #254b68; border-color: #b8d6ea; }
.app-footer-nav :is(button, a):focus-visible { outline-color: #b8e1ff; }
.app-footer-copyright { padding-top: 12px; border-top: 1px solid #52738d; color: #d7e5f0; font-size: .85rem; }
.privacy-body { display: grid; gap: 12px; }
.privacy-body a { color: var(--blue); }
dialog { width: min(690px, calc(100% - 32px)); max-height: 90dvh; padding: 0; border: 1px solid var(--line); border-radius: 12px; color: inherit; box-shadow: 0 20px 65px #142c4a40; }
dialog.results { width: min(1800px, calc(100% - 24px)); max-width: calc(100% - 24px); }
.results .dialog-body { padding-inline: clamp(10px, 1.4vw, 22px); }
dialog::backdrop { background: #10294080; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; background: #eef5fa; border-bottom: 1px solid var(--line); }
button.close { padding: 0; width: 36px; height: 36px; font-size: 1.4rem; line-height: 1; }
.dialog-body { padding: 22px; }
#bibliography { width: min(850px, calc(100% - 32px)); }
#bibliography .dialog-head { position: sticky; top: 0; z-index: 1; }
.bibliography-body { display: grid; gap: 16px; }
.bibliography-body h3 { margin: 0; font-size: 1.05rem; }
.bibliography-body ul { margin: 8px 0; padding-left: 22px; }
.bibliography-body li + li { margin-top: 4px; }
.bibliography-body a { color: var(--blue); }
.bibliography-body summary { cursor: pointer; font-weight: 650; margin-bottom: 6px; }
.reference-decisions > .help { margin: 4px 0 8px; }
.reference-decisions details { border-top: 1px solid var(--line); padding-block: 9px; scroll-margin-top: 80px; }
.reference-decisions details summary { margin: 0; }
.reference-decisions details p { margin-top: 8px; }
.qualification-reference { display: inline-block; color: var(--blue); font-size: .875rem; font-weight: 650; }
.bibliography-products { columns: 2 180px; }
.bibliography-products li { break-inside: avoid; }
.editor-form { display: grid; gap: 12px; }
.sql, code { font-family: ui-monospace, monospace; }
.help { color: var(--muted); font-weight: 400; font-size: .875rem; }
.error { color: #8a2633; }
.scroll-table { overflow: auto; max-height: 57dvh; border: 1px solid var(--line); border-radius: 7px; }
table { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: 100%; font-size: .85rem; }
th, td { padding: 9px clamp(4px, .65vw, 11px); text-align: left; border-bottom: 1px solid #dfe8f0; vertical-align: top; overflow-wrap: anywhere; }
td { white-space: pre-line; }
th { position: sticky; top: 0; background: #e7f1f8; }
tbody tr:nth-child(even) { background: #f5f8fb; }
.result-count { margin-bottom: 10px; color: var(--muted); }
.result-table-title { margin: 0 0 10px; font-size: 1.125rem; line-height: 1.35; }
@media (max-width: 760px) {
  .scroll-table table, .scroll-table tbody, .scroll-table tr { display: block; }
  .scroll-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .scroll-table td {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 8px;
    padding: 7px 10px;
  }
  .scroll-table td::before {
    content: attr(data-column) / "";
    font-weight: 650;
  }
  .scroll-table tbody tr + tr { border-top: 2px solid var(--line); }
}
@media (max-width: 680px) {
  .wrap { width: calc(100% - 32px); }
  .intro { padding-top: 28px; }
  .cards { grid-template-columns: 1fr; }
  .card, .dialog-body { padding: 16px; }
}
@media (max-width: 390px) { .fields { grid-template-columns: 1fr; } }

.workspace-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.workspace-nav button:not(.transfer-button) { background: transparent; border-color: #7294ad; }
.workspace-nav button[aria-pressed="true"] { color: #173e5d; background: #e9f4fb; border-color: #e9f4fb; }
.workspace-nav button[aria-pressed="false"]:hover { background: #26516e; }
#qualification-form, #qual-result { display: grid; gap: 16px; padding-bottom: 32px; }
@media (min-width: 681px) { #qualification-intro { padding-top: 32px; } }
p.instruction { color: var(--orange); font-weight: 700; }
.qual-fields, .qual-entry { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.qual-entry { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.1fr); align-items: end; }
.qual-history-row { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; margin-bottom: 8px; }
.qual-cycle { margin: 12px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.qual-cycle-title { margin: 0; font-weight: 650; }
.qual-cycle-doses { display: grid; gap: 8px; margin-bottom: 10px; }
.qual-cycle-row input[type="date"] { max-width: 20rem; }
.qual-question, .qual-product-row { min-width: 0; border: 0; padding: 10px 0; margin: 0; }
.qual-question + .qual-question { margin-top: 8px; border-top: 1px solid var(--line); }
.qual-question legend, .qual-product-row legend { padding: 0 8px 0 0; font-weight: 650; font-size: .95rem; }
.qual-options { display: flex; flex-wrap: wrap; gap: 7px; }
.qual-options label, .qual-inline { display: flex; align-items: center; gap: 7px; }
.qual-options label { min-height: 34px; padding: 5px 9px; border-radius: 6px; background: #edf5fb; font-weight: 450; }
.qual-options input, .qual-inline input { width: auto; margin: 0; accent-color: var(--blue); }
.qual-extra { margin-top: 10px; }
.qual-extra > label:only-child { max-width: 590px; }
.qual-product-row > label { margin-top: 10px; }
.qual-product-row > button { margin-top: 7px; }
.qual-product-row + .qual-product-row { border-top: 1px solid var(--line); margin-top: 12px; }
.qual-product-help { margin-top: 6px; overflow-wrap: anywhere; }
.qual-actions { flex-wrap: wrap; }
#qual-transfer .dialog-body { display: grid; gap: 12px; }
#qual-transfer .close { width: 44px; height: 44px; }
.qual-transfer-account { padding: 8px 10px; border-radius: 6px; background: #eef5fa; }
#qual-transfer-code { text-align: center; }
#qual-transfer-code strong { display: block; font-size: 1.65rem; letter-spacing: 0.14em; }
#qual-transfer-camera { display: block; width: min(100%, 360px); max-height: 34dvh; margin-inline: auto; background: #102940; }
#qual-transfer-send-form { display: grid; gap: 12px; }
#qual-transfer-send-form > label { border-top: 1px solid var(--line); padding-top: 12px; }
#qual-transfer-send-form > button { justify-content: center; min-height: 48px; font-size: 1rem; }
#qual-transfer-code-input { min-height: 44px; font-size: 1rem; text-transform: uppercase; }
#qual-transfer-login { overflow-wrap: anywhere; }
#qual-transfer-status:empty { display: none; }
#qual-result h3, #qual-print h3 { margin: 0; font-size: 1.05rem; }
#qual-result ul { margin: 0; padding-left: 21px; }
#qual-result details, .qual-joint:not(:empty), .qual-plan:not(:empty) { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; overflow-x: auto; }
#qual-result summary { cursor: pointer; font-weight: 650; }
#qual-result details table, #qual-result .qual-plan table { margin-top: 10px; }
.qual-alert, .qual-status { padding: 10px 12px; border-radius: 6px; background: #e1eef7; font-weight: 650; }
.qual-alert { background: #faeeed; color: #791f2a; }
.qual-result-card.qual-card-conflict { border-top-color: #a63340; }
#qual-conflict-dialog .actions { margin-top: 14px; }
#qual-conflict-body ul { margin: 0; padding-left: 20px; }
.qual-joint p, .qual-plan p { margin-top: 8px; }
.qual-print-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.qual-note-hint { margin-top: 5px; }
#qual-result textarea[aria-invalid="true"] { border-color: #9f4b56; }
.qual-print-actions button:disabled { cursor: not-allowed; }
#qual-print { display: none; }
@media (max-width: 1023px) {
  .masthead-content { flex-wrap: wrap; }
  .workspace-nav { order: 1; width: 100%; }
  .desktop-receive { display: none; }
}
@media (max-width: 570px) {
  .qual-fields, .qual-entry { grid-template-columns: minmax(0, 1fr); }
  .qual-history-row button { justify-self: start; }
  #qual-result table { table-layout: auto; }
}
@media print {
  @page { size: A4 portrait; margin: 10mm 12mm; }
  html, body { background: white; color: black; }
  body.qual-printing > :not(#qual-print) { display: none !important; }
  body.qual-printing #qual-print { display: block !important; font: 9pt/1.25 system-ui, sans-serif; }
  #qual-print h1 { font-size: 17pt; margin: 0 0 16pt; letter-spacing: normal; text-align: center; }
  #qual-print h3 { font-size: 11pt; margin: 7pt 0 3pt; break-after: avoid; }
  #qual-print p { margin: 3pt 0; }
  #qual-print table { border-collapse: collapse; font-size: 8.5pt; table-layout: fixed; }
  #qual-print th, #qual-print td { position: static; border: 1px solid #9ca5ab; padding: 2pt 4pt; overflow-wrap: anywhere; }
  #qual-print .qual-print-page + .qual-print-page { break-before: page; }
  #qual-print .qual-print-page > h3:first-child { margin-top: 0; }
  #qual-print .qual-print-interview th:first-child { width: 67%; }
  #qual-print :is(.qual-plan-table, .qual-decision-table) th:nth-child(1) { width: 20%; }
  #qual-print :is(.qual-plan-table, .qual-decision-table) th:nth-child(2) { width: 19%; }
  #qual-print :is(.qual-plan-table, .qual-decision-table) th:nth-child(3) { width: 18%; }
  #qual-print .qual-decision-table th:nth-child(3) { width: 22%; }
  #qual-print .qual-plan-table th:nth-child(2) { width: 23%; }
  #qual-print .qual-plan-table :is(th, td) { padding-block: 1.5pt; }
  #qual-print .qual-print-declarations { break-inside: avoid; }
  #qual-print .qual-print-observation { border: 1px solid currentColor; break-inside: avoid; }
  #qual-print .qual-print-signature { margin-top: 24pt; break-inside: avoid; }
  #qual-print thead { display: table-header-group; }
  #qual-print tr { break-inside: avoid; }
  #qual-print .qual-performed td { height: 21pt; }
}
#qual-print-preview { width: min(900px, calc(100% - 32px)); }
#qual-print-notice-copy p + p { margin-top: 12px; }
#qual-print-notice .actions { margin-top: 20px; flex-wrap: wrap; }
#qual-print-preview h1 { font-size: 1.55rem; letter-spacing: -.02em; margin-bottom: 22px; text-align: center; }
#qual-print-preview-body .qual-print-patient-fields,
#qual-print .qual-print-patient-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px; }
.qual-print-name { display: flex; flex: 1 1 35mm; align-items: baseline; gap: 5px; }
.qual-print-name-line { flex: 1; height: 1em; border-bottom: 1px dotted currentColor; }
.qual-print-pesel { display: inline-flex; align-items: center; gap: 6px; }
.qual-print-pesel-digits { display: inline-flex; border-left: 1px solid currentColor; }
.qual-print-pesel-digits > span { width: 5mm; height: 6mm; border: 1px solid currentColor; border-left: 0; }
#qual-print-preview-body h3 { margin: 18px 0 6px; font-size: 1rem; }
#qual-print-preview-body p { margin: 6px 0; overflow-wrap: anywhere; }
#qual-print-preview-body .qual-print-page + .qual-print-page { margin-top: 24px; padding-top: 12px; border-top: 2px solid var(--line); }
#qual-print-preview-body .qual-print-signature { margin-top: 32px; }
#qual-print-preview-body .qual-performed td { height: 40px; }

.login-layout { display: grid; align-content: center; flex: 1; padding-block: 36px; }
.login-card { width: min(440px, 100%); margin-inline: auto; padding: clamp(20px, 5vw, 36px); }
.login-card h1 { font-size: clamp(1.75rem, 5vw, 2.25rem); }
.login-card button { min-height: 44px; }
.admin-login .login-extra,
[data-email-accounts] .login-extra,
[data-manual-accounts] .login-extra,
[data-manual-accounts] #access-requests { display: none; }
.web-account { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.web-account p { font-size: .85rem; }
@media (min-width: 1024px) {
  .app-masthead .workspace-nav, .app-masthead .web-account { flex-wrap: nowrap; }
  .app-masthead .masthead-content { white-space: nowrap; }
  .mobile-receive { display: none; }
}
@media (min-width: 1024px) and (max-width: 1120px) {
  .app-masthead .masthead-content, .app-masthead .brand { gap: 8px; }
  .app-masthead .web-account { gap: 6px; }
  .app-masthead .workspace-nav { gap: 5px; }
  .app-masthead button { padding-inline: 8px; }
  .app-masthead .header-link { font-size: .875rem; }
  .app-masthead #access-until { white-space: normal; }
}

.header-link { color: #fff; font-weight: 650; }
.admin-main { padding-bottom: 32px; }
.admin-main .card { margin-bottom: 16px; }
#admin-status { min-height: 1.5em; margin-bottom: 14px; }
.admin-account-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 12px; }
.admin-table { overflow-x: auto; }
.admin-table th { text-align: left; }
.admin-table td { vertical-align: top; overflow-wrap: anywhere; }
.admin-table button, .admin-table label { margin: 3px 4px 3px 0; }
.admin-table input { width: 7rem; }
.admin-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
#admin-bug-reports { margin-top: 24px; }
#admin-bug-status:empty { display: none; }
#admin-bug-reports th:nth-child(-n+2) { width: 23%; }
#admin-bug-reports td:nth-child(3) { white-space: pre-wrap; }
