:root{--paper:#fafaf8;--surface:#fff;--ink:#292723;--muted:#6c6a63;--line:#e2e1da;--accent:#946126;--accent-light:#f6eedf;--serif:Georgia,"Times New Roman",serif;--sans:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;font-family:var(--sans);font-size:16px;color:var(--ink);background:var(--paper)}*{box-sizing:border-box}body{margin:0}a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}button,input,select{font:inherit}button,a,input,select,summary{touch-action:manipulation}button{cursor:pointer}a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #a47337;outline-offset:3px}[hidden]{display:none!important}.container{width:min(1260px,calc(100% - 64px));margin-inline:auto}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.skip{position:fixed;top:-100px;left:20px;z-index:100;background:var(--ink);color:#fff;padding:15px}.skip:focus{top:10px}.site-header{border-bottom:1px solid var(--line);background:var(--surface)}.header-inner{display:flex;align-items:center;justify-content:space-between;min-height:91px;gap:24px}.brand{display:flex;align-items:center;gap:16px;color:var(--ink)}.brand:hover{text-decoration:none}.brand-monogram{font-family:var(--serif);font-size:1.85rem;color:var(--accent);border-right:1px solid #d9d3c8;padding-right:18px;letter-spacing:-.05em}.brand-monogram span{font-size:.7em}.brand-name{font-size:.8rem;font-weight:700;letter-spacing:.03em}.brand-name>span{display:block;font-size:.75rem;font-weight:400;color:var(--muted);margin-top:3px}.header-inner nav{display:flex;gap:28px}.nav-link{color:#55534d;font-size:.875rem;font-weight:600}.catalog-heading{display:flex;align-items:center;justify-content:space-between;gap:30px;padding:43px 0 30px}.eyebrow{text-transform:uppercase;font-size:.72rem;letter-spacing:.14em;font-weight:750;color:var(--accent);margin:0 0 12px}h1,h2,h3,p{margin-top:0}h1{font-family:var(--serif);font-weight:400;font-size:clamp(2rem,3.4vw,3rem);line-height:1.17;letter-spacing:-.025em;margin-bottom:0}.catalog-heading h1>span{display:block;font-size:.68em;color:var(--muted);margin-top:7px;letter-spacing:0}.catalog-number{padding:18px 0 18px 32px;border-left:1px solid var(--line);min-width:190px}.catalog-number strong{display:block;font-family:var(--serif);font-weight:400;font-size:3rem;line-height:1.1}.catalog-number span{display:block;color:var(--muted);font-size:.85rem;margin-top:7px}.search-bar{display:flex;gap:10px;background:#fff;padding:8px;border:1px solid #cfcabd;border-radius:7px;box-shadow:0 4px 12px #29272304;margin-bottom:30px}.search-bar input{flex:1;min-width:0;border:0;background:transparent;padding:11px 15px;font-size:1rem;color:var(--ink)}input::placeholder{color:#8c8981}.button{display:inline-flex;align-items:center;justify-content:center;gap:27px;padding:12px 24px;border:1px solid transparent;border-radius:4px;font-weight:650;font-size:.9rem;line-height:1.4;text-decoration:none}.button:hover{text-decoration:none}.primary{background:var(--ink);color:#fff}.primary:hover{background:#474137}.secondary{background:#f5f2eb;border-color:#d7cec0;color:#714b21;width:100%;margin-top:20px}.secondary:hover{background:#ece4d7}.catalog-layout{display:grid;grid-template-columns:244px minmax(0,1fr);gap:42px;align-items:start}.filter-panel{padding:20px;background:#f2f2ee;border:1px solid var(--line);border-radius:5px}.filter-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.filter-title h2{font-size:.93rem;font-weight:750;margin:0}.filter-title a{font-size:.76rem}.filter-panel>label{display:block;font-size:.8rem;font-weight:650;margin:18px 0 7px}.filter-panel select,.filter-panel input{display:block;width:100%;border:1px solid #d4d2c9;border-radius:4px;padding:10px;background:#fff;color:var(--ink);font-size:.85rem;min-height:43px}.filter-panel fieldset{border:0;padding:0;margin:19px 0 0}.filter-panel legend{font-size:.8rem;font-weight:650;margin-bottom:7px}.year-fields{display:flex;gap:7px;align-items:center}.year-fields input{min-width:0;width:calc(50% - 10px);padding:10px 7px}.year-fields span{color:#aaa}.search-help{border-top:1px solid #d6d4cb;margin-top:22px;padding-top:16px;font-size:.8rem;color:var(--muted);line-height:1.65}.search-help summary{font-weight:650;cursor:pointer;color:#5e574b}.search-help p{margin:12px 0 0}.search-help code{font-size:.75rem;color:#665036}.results-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:0 0 15px;border-bottom:2px solid #4a4439}.results-heading h2{font-family:var(--serif);font-weight:400;font-size:1.5rem;margin:0}.results-heading>span{font-size:.82rem;color:var(--muted)}.person-result{padding:21px 0 23px;border-bottom:1px solid var(--line)}.result-top{display:flex;align-items:center;justify-content:space-between;gap:15px}.result-top h3{font-family:var(--serif);font-weight:400;font-size:1.45rem;margin:0;line-height:1.4}.result-top h3 a{color:var(--ink)}.result-top h3 a:hover{color:var(--accent)}.open-person{font-size:1.2rem;color:#a18b6e;padding:0 8px}.result-meta{display:flex;gap:12px 20px;flex-wrap:wrap;margin:9px 0 10px;color:var(--muted);font-size:.8rem}.result-meta span:last-child{margin-left:auto;color:#9a8a73}.excerpt{margin:0;font-size:.92rem;line-height:1.65;color:#67635c}.excerpt mark{background:#f5e2b9;color:#594015;border-radius:2px;padding:0 2px}.pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:28px;font-size:.85rem;flex-wrap:wrap}.pagination>div{display:flex;gap:6px}.pagination>div a{display:flex;align-items:center;justify-content:center;min-width:34px;min-height:35px;border:1px solid var(--line);color:var(--muted);border-radius:3px}.pagination a[aria-current=page]{background:var(--ink);border-color:var(--ink);color:#fff}.page-note{font-size:.76rem;color:var(--muted);text-align:center;margin:16px 0}.site-footer{margin-top:64px;border-top:1px solid var(--line);background:#f2f2ef;padding:26px 0}.about{font-size:.84rem;line-height:1.7;color:var(--muted);max-width:880px}.about summary{font-weight:650;color:#59564f;cursor:pointer}.about p{margin:14px 0}.footer-bottom{display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap;color:#8b877e;font-size:.74rem;border-top:1px solid var(--line);padding-top:18px;margin-top:22px}.notice{padding:18px;border-left:3px solid #8b5724;background:#fff6e8;margin-top:20px;font-size:.9rem}.notice.error{color:#773a26}.empty{padding:60px 25px;text-align:center;background:#f3f3ef;margin:24px 0}.empty h3{font-family:var(--serif);font-size:1.6rem;font-weight:400}.empty p{color:var(--muted);line-height:1.7}.empty a{font-size:.9rem}.breadcrumb{display:flex;gap:11px;align-items:center;margin:27px 0;font-size:.8rem;color:var(--muted)}.person-heading{border-bottom:1px solid var(--line);padding-bottom:27px;margin-bottom:32px}.person-heading h1{font-size:clamp(2rem,4vw,3.4rem);max-width:1000px}.life-summary{display:flex;gap:14px 35px;flex-wrap:wrap;margin-top:20px;font-size:.85rem;color:var(--muted)}.life-summary strong{font-weight:550;color:var(--ink);margin-left:8px}.detail-layout{display:grid;grid-template-columns:244px minmax(0,1fr);gap:42px;align-items:start}.person-sidebar{font-size:.85rem}.person-sidebar h2{font-size:.75rem;text-transform:uppercase;letter-spacing:.09em;color:var(--muted);font-weight:750;margin:0 0 12px}.person-sidebar nav{display:flex;flex-direction:column;padding-bottom:22px;border-bottom:1px solid var(--line);margin-bottom:22px}.person-sidebar nav>a{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 0;color:#585348}.person-sidebar nav>a span{font-size:.72rem;color:#948674}.name-facts{background:#f1f1ed;border:1px solid var(--line);border-radius:4px;padding:18px}.name-facts dt{font-size:.73rem;color:var(--muted);margin-top:14px}.name-facts dd{margin:4px 0 0;line-height:1.6;color:var(--ink);overflow-wrap:anywhere}.detail-section{background:#fff;border:1px solid var(--line);border-radius:5px;margin-bottom:24px;padding:25px 28px;scroll-margin-top:20px}.section-heading{display:flex;align-items:center;gap:12px;margin-bottom:20px;padding-bottom:15px;border-bottom:1px solid var(--line);flex-wrap:wrap}.section-heading h2{font-family:var(--serif);font-size:1.4rem;font-weight:400;margin:0}.section-number{font-size:.8rem;color:#a68d6c}.section-note{margin-left:auto;color:var(--muted);font-size:.74rem}.source-biogram{font-family:var(--serif);font-size:1.12rem;line-height:1.85;color:#3d3931;white-space:pre-line}.table-scroll{overflow:auto}table{width:100%;border-collapse:collapse;text-align:left;font-size:.88rem;line-height:1.5}th{font-size:.73rem;text-transform:uppercase;letter-spacing:.04em;font-weight:650;color:var(--muted);padding:0 14px 12px 0}td{vertical-align:top;border-top:1px solid var(--line);padding:15px 14px 15px 0}td:last-child{padding-right:0}td strong{font-weight:600}.source-label{font-size:.78rem;color:var(--muted);margin:7px 0 0}.small{font-size:.8rem;line-height:1.6}.muted{color:var(--muted)}.block{display:block;margin-top:5px}.nowrap{white-space:nowrap}.status{display:inline-block;border:1px solid #ded8cb;color:#7d674b;background:#f6f3ec;border-radius:3px;padding:3px 7px;font-size:.72rem;margin:3px 3px 3px 0;line-height:1.4}.status.uncertain{background:#fbefd9;border-color:#e6cda1;color:#876125}.evidence{margin-top:9px;font-size:.76rem;color:var(--muted)}.evidence summary{cursor:pointer;color:#8f6b3c}.evidence blockquote{margin:12px 0 0;padding:10px 14px;border-left:2px solid #bfaa89;background:#f7f6f2;font-family:var(--serif);font-size:.95rem;line-height:1.7;color:#595045}.information-list>article{border-bottom:1px solid var(--line);padding:13px 0}.information-list>article:first-child{padding-top:0}.information-list>article:last-child{border:0;padding-bottom:0}.information-list p{font-size:.95rem;line-height:1.75;margin-bottom:6px}.kind-label{font-size:.7rem;color:#94836b;text-transform:uppercase;letter-spacing:.06em}.event-code{font-family:var(--serif);font-size:1.15rem}.editorial-notes{background:#f5f2e9;border:1px solid #e1d6c4;border-radius:4px;padding:17px;font-size:.83rem;color:#766447;line-height:1.7}.editorial-notes summary{cursor:pointer;font-weight:650}.editorial-notes ul{margin-bottom:0;padding-left:20px}.citation-line{font-size:.75rem;color:var(--muted);margin-top:23px}.error-page{margin:65px 0}.error-page h1{margin-bottom:25px}@media(min-width:1100px){.person-sidebar{position:sticky;top:20px}}@media(max-width:950px){.container{width:calc(100% - 40px)}.catalog-layout,.detail-layout{grid-template-columns:215px minmax(0,1fr);gap:24px}.catalog-number{min-width:155px;padding-left:22px}.catalog-number strong{font-size:2.6rem}.result-meta span:last-child{margin-left:0}.detail-section{padding:20px}.source-biogram{font-size:1.05rem}.section-note{margin-left:0}.section-heading{gap:8px}}@media(max-width:720px){.container{width:calc(100% - 28px)}.header-inner{min-height:75px;gap:14px}.brand-monogram{font-size:1.45rem;padding-right:12px}.brand-name{font-size:.72rem}.header-inner nav{gap:15px}.nav-link{font-size:.76rem}.catalog-heading{padding:29px 0 24px;display:block}.catalog-heading h1 br{display:none}.catalog-number{border:0;display:flex;align-items:baseline;gap:12px;padding:20px 0 0}.catalog-number strong{font-size:1.8rem}.catalog-number span{margin:0}.search-bar{padding:5px;gap:0}.search-bar input{padding:10px 8px;font-size:.9rem}.search-bar .button{padding:11px 15px;gap:10px}.catalog-layout,.detail-layout{grid-template-columns:1fr;gap:24px}.filter-panel{display:grid;grid-template-columns:1fr 1fr;gap:7px 12px;padding:16px}.filter-title{grid-column:1/-1;margin:0 0 6px}.filter-panel>label{margin:9px 0 0;align-self:end}.filter-panel>select,.filter-panel>input{grid-column:2;grid-row:auto}.filter-panel fieldset{grid-column:1/-1;margin:10px 0}.filter-panel .secondary,.filter-panel .search-help{grid-column:1/-1;margin-top:12px}.filter-panel .year-fields input{width:calc(50% - 10px)}.result-top h3{font-size:1.35rem}.person-heading{padding-bottom:23px;margin-bottom:24px}.person-sidebar nav{display:flex;flex-direction:row;flex-wrap:wrap;gap:4px 15px}.person-sidebar nav>a{padding:6px 0}.name-facts dl{display:grid;grid-template-columns:1fr 1fr;gap:8px 15px;margin-bottom:0}.name-facts dt{margin-top:5px}.name-facts dd{margin:3px 0}.name-facts h2{margin-bottom:16px}.detail-section{padding:20px 16px}.site-footer{margin-top:40px}table{font-size:.82rem}th,td{padding-right:9px}.life-summary{gap:12px}.section-heading h2{font-size:1.3rem}}@media print{.site-header,.site-footer,.person-sidebar,.breadcrumb,.evidence,.editorial-notes{display:none}.container{width:100%}.detail-layout{display:block}.detail-section{border:0;padding:15px 0;break-inside:avoid}body{background:#fff}.person-heading h1{font-size:26pt}.source-biogram{font-size:11pt}a{color:#000}}

.intro{color:var(--muted);line-height:1.75;max-width:900px}.event-filters{display:flex;align-items:end;gap:16px;flex-wrap:wrap;background:#f2f2ee;border:1px solid var(--line);padding:20px;border-radius:5px;margin:25px 0}.event-filters label{display:block;font-size:.8rem;font-weight:650;margin-bottom:8px}.event-filters input,.event-filters select{border:1px solid #d4d2c9;border-radius:4px;padding:10px;background:#fff;max-width:220px;min-height:43px;width:100%}.event-filters>div{flex:1;min-width:115px}.event-filters>a{font-size:.8rem;padding-bottom:12px}.event-notes{margin-bottom:28px}.event-notes p{margin:12px 0 0}.event-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-top:24px}.event-card{background:#fff;border:1px solid var(--line);border-radius:4px;padding:20px}.event-card h2{font-family:var(--serif);font-weight:400;font-size:1.6rem;margin:8px 0}.event-card h2 a{color:var(--ink)}.event-card p{font-size:.8rem;color:var(--muted);margin:0}.role-group>summary{font-family:var(--serif);font-size:1.5rem;cursor:pointer}.role-group>summary>span{font-family:var(--sans);font-size:.8rem;color:var(--muted);margin-left:14px}.role-group[open]>summary{border-bottom:1px solid var(--line);padding-bottom:18px;margin-bottom:20px}.role-group td:first-child{min-width:170px;width:28%}.role-group td:nth-child(2){min-width:150px;width:24%}.role-group td:last-child{min-width:220px}.person-heading h1,.catalog-heading h1{overflow-wrap:break-word}@media(max-width:950px){.event-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:720px){.event-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.event-filters{gap:12px;padding:16px}.header-inner{flex-wrap:wrap;padding:14px 0;gap:16px}.header-inner nav{flex-wrap:wrap}.event-card{padding:15px}.event-card h2{font-size:1.4rem}.role-group>summary{font-size:1.3rem}}

.life-dates-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:20px 28px}.life-dates-grid h3{font-size:.85rem;font-weight:650;margin-bottom:10px;color:var(--muted)}.life-dates-grid p{font-family:var(--serif);font-size:1.2rem;margin-bottom:8px;line-height:1.5}@media(max-width:720px){.life-dates-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.life-dates-grid h3{font-size:.8rem}.life-dates-grid p{font-size:1.05rem}.name-facts dl{display:block}.name-facts dt{margin-top:14px}}

.person-title-row{display:flex;align-items:start;justify-content:space-between;gap:24px}.export-pdf{flex-shrink:0;background:#f5f2eb;border-color:#d7cec0;color:#714b21;margin-top:8px;padding:10px 18px}.export-pdf:hover{background:#ece4d7}@media(max-width:720px){.person-title-row{flex-direction:column;gap:12px}.export-pdf{margin-top:0}}@media print{.export-pdf{display:none}}

.office-dating{min-width:115px;white-space:normal}#offices th:first-child{width:65%}

.event-card h2{font-size:1.25rem;line-height:1.4}.event-card .event-place{margin:9px 0;color:var(--ink)}.event-card .event-date{margin:9px 0 16px;line-height:1.6}.unresolved-events{margin-top:44px}.role-group td:nth-child(3){min-width:90px}#events td:first-child{width:52%}

.event-codes{text-transform:none;overflow-wrap:anywhere;line-height:1.6;display:block}

.role-group td:first-child{width:32%}.role-group td:nth-child(2){width:20%;min-width:125px}.role-group td:nth-child(3){width:48%;min-width:250px}
.role-group .deputies-table{table-layout:fixed;min-width:720px}
.role-group .deputies-table th,.role-group .deputies-table td{min-width:0;overflow-wrap:anywhere}
.role-group .deputies-table th:nth-child(1),.role-group .deputies-table td:nth-child(1){width:28%}
.role-group .deputies-table th:nth-child(2),.role-group .deputies-table td:nth-child(2){width:14%}
.role-group .deputies-table th:nth-child(3),.role-group .deputies-table td:nth-child(3){width:18%}
.role-group .deputies-table th:nth-child(4),.role-group .deputies-table td:nth-child(4){width:40%}

.search-help-button{display:flex;justify-content:space-between;align-items:center;width:100%;margin-top:18px;background:transparent;border-color:var(--line);color:var(--accent);grid-column:1/-1}
.search-help-button span{display:inline-flex;align-items:center;justify-content:center;border:1px solid currentColor;border-radius:50%;width:22px;height:22px;font-size:.8rem}
.search-help-dialog{width:min(760px,calc(100% - 32px));max-height:85vh;max-height:85dvh;padding:0;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink);box-shadow:0 20px 80px #0004;overflow:auto}
.search-help-dialog::backdrop{background:#0008}
.search-help-header{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;gap:20px;background:var(--surface);padding:22px 28px;border-bottom:1px solid var(--line);z-index:1}
.search-help-header h2{font-family:var(--serif);font-weight:400;font-size:1.8rem;margin:0}
.search-help-close{flex-shrink:0;border:1px solid var(--line);background:transparent;color:var(--ink);border-radius:50%;width:40px;height:40px;font-size:1.5rem;line-height:1}
.search-help-close:hover{background:var(--accent-light)}
.search-help-content{padding:8px 28px 24px;line-height:1.7;font-size:.9rem}
.search-help-content section{margin-top:24px;padding-top:8px;border-top:1px solid var(--line)}
.search-help-content h3{font-size:1rem;margin:12px 0;color:var(--ink)}
.search-help-content code{overflow-wrap:anywhere;color:var(--accent);font-size:.9em}
.search-examples{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.4fr);gap:12px 22px}
.search-examples dt,.search-examples dd{margin:0}
.search-help-content li{margin-bottom:8px}
.search-help-is-open{overflow:hidden}
@media(max-width:720px){.search-help-header{padding:16px 18px}.search-help-content{padding:8px 18px 20px}.search-examples{grid-template-columns:1fr;gap:4px}.search-examples dd{margin-bottom:12px}.search-help-header h2{font-size:1.5rem}}
@media print{.search-help-dialog,.search-help-button{display:none}}

.pagination>.pagination-direction{flex-wrap:wrap}
.pagination>.pagination-direction a,.pagination-direction span{padding:8px 10px;min-height:38px}
.pagination-direction span{display:flex;align-items:center;border:1px solid var(--line);border-radius:3px;color:var(--muted);opacity:.55}
@media(max-width:720px){.pagination{justify-content:center}.pagination>.pagination-numbers{order:-1;width:100%;justify-content:center}.pagination>.pagination-direction{justify-content:center}.pagination>.pagination-direction a,.pagination-direction span{padding:8px;font-size:.8rem}}

.search-mode{grid-column:1/-1;border-bottom:1px solid var(--line);padding-bottom:22px;margin-bottom:22px}
.search-mode label{display:block;font-size:.8rem;font-weight:650;margin-bottom:7px}
@media(max-width:720px){.search-mode{padding-bottom:16px;margin-bottom:10px}}

/* Przełącznik w nagłówku; obecna paleta jest motywem domyślnym. */
:root{color-scheme:light}
.header-actions{display:flex;align-items:center;gap:24px}
.ihpan-logo{display:block;height:60px;width:auto;flex-shrink:0;object-fit:contain}
@media screen{[data-theme="dark"] .ihpan-logo{filter:invert(1)}}
@media(max-width:720px){.header-inner{position:relative}.header-inner>.brand{padding-right:58px}.ihpan-logo{position:absolute;top:14px;right:0;height:48px}}
.header-inner nav{align-items:center}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;flex-shrink:0;padding:0;border:1px solid var(--line);border-radius:50%;background:transparent;color:var(--accent)}
.theme-toggle:hover{background:var(--accent-light)}
.theme-toggle .theme-icon-sun{display:none}
:root[data-theme="dark"] .theme-icon-moon{display:none}
:root[data-theme="dark"] .theme-icon-sun{display:block}
@media(max-width:720px){.header-actions{width:100%;justify-content:space-between;gap:16px}.header-actions nav{flex:1}}

/* Ciemna paleta dotyczy ekranu; wydruk zachowuje jasne tło. */
@media screen{
  :root[data-theme="dark"]{color-scheme:dark;--paper:#16191b;--surface:#202427;--ink:#e7e3da;--muted:#b4b2aa;--line:#3b4043;--accent:#dbb279;--accent-light:#342c23}
  [data-theme="dark"] .brand-monogram{border-color:var(--line)}
  [data-theme="dark"] .nav-link,[data-theme="dark"] .excerpt,[data-theme="dark"] .footer-bottom,[data-theme="dark"] .about summary,[data-theme="dark"] .person-sidebar nav>a,[data-theme="dark"] .search-help summary{color:var(--muted)}
  [data-theme="dark"] .search-bar,[data-theme="dark"] .detail-section,[data-theme="dark"] .event-card{background:var(--surface);border-color:var(--line)}
  [data-theme="dark"] .filter-panel,[data-theme="dark"] .event-filters,[data-theme="dark"] .name-facts,[data-theme="dark"] .empty{background:#252a2d}
  [data-theme="dark"] .site-footer{background:#1b1f21}
  [data-theme="dark"] .filter-panel input,[data-theme="dark"] .filter-panel select,[data-theme="dark"] .event-filters input,[data-theme="dark"] .event-filters select{background:var(--paper);border-color:var(--line);color:var(--ink)}
  [data-theme="dark"] input::placeholder{color:#a2a5a4}
  [data-theme="dark"] .search-help,[data-theme="dark"] .results-heading{border-color:var(--line)}
  [data-theme="dark"] .year-fields span{color:var(--muted)}
  [data-theme="dark"] .primary,[data-theme="dark"] .pagination a[aria-current="page"],[data-theme="dark"] .skip{background:var(--accent);color:var(--paper)}
  [data-theme="dark"] .primary:hover{background:#e8c18a}
  [data-theme="dark"] .secondary,[data-theme="dark"] .export-pdf{background:#302a22;border-color:#625640;color:var(--accent)}
  [data-theme="dark"] .secondary:hover,[data-theme="dark"] .export-pdf:hover{background:#3c3226}
  [data-theme="dark"] .source-biogram{color:var(--ink)}
  [data-theme="dark"] .open-person,[data-theme="dark"] .result-meta span:last-child,[data-theme="dark"] .kind-label,[data-theme="dark"] .section-number,[data-theme="dark"] .person-sidebar nav>a span,[data-theme="dark"] .search-help code,[data-theme="dark"] .evidence summary{color:var(--accent)}
  [data-theme="dark"] .excerpt mark{background:#584525;color:#ffdf99}
  [data-theme="dark"] .status,[data-theme="dark"] .editorial-notes{background:#302a22;border-color:#625640;color:#e2c18b}
  [data-theme="dark"] .status.uncertain{background:#3c3020;border-color:#7a603d;color:#f0c682}
  [data-theme="dark"] .notice{background:#34281d;border-color:var(--accent)}
  [data-theme="dark"] .notice.error{color:#edb5a0}
  [data-theme="dark"] .evidence blockquote{background:#272b2d;border-color:#74654d;color:var(--ink)}
  [data-theme="dark"] :focus-visible{outline-color:var(--accent)}
}

/* Zastrzeżenia do pojedynczej funkcji, wspólne dla karty osoby i wydarzenia. */
.participation-notes{display:inline-block;vertical-align:middle;margin-left:4px;font-size:.75rem;font-weight:400;line-height:1.4;max-width:100%}
.participation-note{max-width:100%}
.participation-note>summary{display:inline-flex;align-items:center;justify-content:center;list-style:none;border:0;border-radius:50%;width:28px;height:28px;padding:4px;color:var(--muted);background:transparent;cursor:pointer;text-transform:none;letter-spacing:normal;font-size:inherit;font-weight:400}
.participation-note>summary::-webkit-details-marker{display:none}
.participation-note>summary:hover{color:var(--accent);background:var(--accent-light)}
.participation-info{font-size:1.05rem;line-height:1;flex-shrink:0}
.participation-explanation p{font-size:.85rem;line-height:1.6;margin:10px 0;color:var(--ink);overflow-wrap:anywhere}
.participation-dialog{width:min(520px,calc(100% - 32px));max-height:calc(100dvh - 48px);padding:24px;border:1px solid var(--line);border-radius:7px;background:var(--surface);color:var(--ink);box-shadow:0 20px 70px #0003;overflow:auto}
.participation-dialog::backdrop{background:#0008}
.participation-dialog-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}
.participation-dialog h2{font-family:var(--serif);font-size:1.5rem;font-weight:400;line-height:1.3;margin:0}
.participation-close{flex-shrink:0;width:40px;height:40px;border:1px solid var(--line);border-radius:50%;background:transparent;color:var(--ink);font-size:1.5rem;line-height:1}
.participation-close:hover{background:var(--accent-light)}
#participation-dialog-text{font-size:.95rem;line-height:1.7;white-space:pre-line;overflow-wrap:anywhere;margin:0}
.participation-dialog-open{overflow:hidden}
@media print{.participation-dialog{display:none}.participation-note>summary{width:auto;height:auto;border:0;background:none;padding:0;color:var(--ink)}.participation-info{display:none}.participation-note>summary>.sr-only{position:static;width:auto;height:auto;clip:auto;white-space:normal}}

/* Zmiana języka zachowuje widok i parametry wyszukiwania. */
.language-switch{display:inline-flex;align-items:center;gap:6px;flex-shrink:0;white-space:nowrap;font-size:.8rem;color:var(--muted)}
.language-switch a{display:inline-flex;align-items:center;justify-content:center;min-width:32px;min-height:44px;color:var(--muted);text-decoration:none;border-bottom:2px solid transparent}
.language-switch a[aria-current="true"]{color:var(--accent);border-bottom-color:var(--accent);font-weight:700}
.language-switch a:hover{color:var(--accent)}
@media(max-width:1050px) and (min-width:721px){.header-inner{flex-wrap:wrap;padding-block:14px;gap:12px}.header-actions{gap:14px;margin-left:auto}.header-inner nav{gap:16px}}
@media(max-width:720px){.header-actions{flex-wrap:wrap}.header-actions nav{min-width:180px;gap:14px}.language-switch{gap:2px}}
@media print{.language-switch{display:none}}

/* Informacja o lokalnych preferencjach nie blokuje korzystania z katalogu. */
.storage-notice{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px;padding:10px max(24px,calc((100vw - 1260px)/2));background:#fff5d6;color:#625438;border-bottom:1px solid #e9d9a8}
.storage-notice>div{min-width:0}.storage-notice p{font-size:1rem;line-height:1.55;margin:0}
.storage-notice .storage-notice-close{width:auto;min-height:40px;margin:0;padding:6px 12px;gap:0;font-size:.95rem;font-weight:500;white-space:nowrap;background:transparent;border-color:var(--line);color:var(--ink)}
.storage-notice .storage-notice-close:hover{background:var(--accent-light)}
@media screen{[data-theme="dark"] .storage-notice{background:#352f1e;color:#e5d6ad;border-bottom-color:#625334}}
@media(max-width:480px){.storage-notice{grid-template-columns:minmax(0,1fr);padding:10px 20px;gap:8px 12px}.storage-notice .storage-notice-close{justify-self:end;min-height:44px;padding:6px 10px}}
@media print{.storage-notice{display:none}}

/* Dwa widoki tego samego chronologicznego wykazu, bez zapisu preferencji. */
.events-view-actions{display:flex;align-items:center;gap:20px}
.event-view-switch{display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:5px;padding:2px;gap:2px;font-size:.8rem}
.event-view-switch a{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:34px;padding:5px 10px;color:var(--muted);border-radius:3px;white-space:nowrap;text-decoration:none}
.event-view-switch a:hover{color:var(--accent);background:var(--accent-light)}
.event-view-switch a[aria-current="true"]{background:var(--accent-light);color:var(--accent);font-weight:650}
.event-list-wrapper{margin-top:24px;border:1px solid var(--line);border-radius:4px;background:var(--surface)}
.event-list{min-width:760px;font-size:.9rem}
.event-list th{padding:13px 16px;background:var(--paper)}
.event-list td{padding:16px;overflow-wrap:anywhere}
.event-list-code{width:12%;color:var(--muted);font-size:.8rem}
.event-list-name{width:32%;font-family:var(--serif);font-size:1.15rem}
.event-list td:nth-child(3){width:15%}.event-list td:nth-child(4){width:34%}
.event-list .event-list-count{width:7%;text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
@media(max-width:720px){.events-results-heading{align-items:flex-start;flex-wrap:wrap;gap:12px}.events-view-actions{width:100%;justify-content:space-between;gap:12px}.event-view-switch a{min-height:40px}.event-list th,.event-list td{padding:12px}}

.results-heading .results-count{font-size:1rem;white-space:nowrap}
.results-count strong{font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums}

/* Zastrzeżenia udziału: kolor uzupełnia dostępny przycisk z objaśnieniem. */
tr.participation-uncertain>td{background:#fff8e8}
@media screen{[data-theme="dark"] tr.participation-uncertain>td{background:#363020}}

.filter-panel input:disabled { opacity: .55; cursor: not-allowed; }

.export-menu{position:relative;flex-shrink:0}
.export-menu summary{list-style:none;cursor:pointer;display:flex;gap:14px;align-items:center}
.export-menu summary::-webkit-details-marker{display:none}
.export-options{position:absolute;right:0;top:100%;z-index:20;min-width:190px;padding:6px;background:var(--surface,#fff);border:1px solid var(--line,#d7cec0);border-radius:6px;box-shadow:0 6px 18px #0002}
.export-options a{display:block;padding:10px 12px;white-space:nowrap;border-radius:3px}
.export-options a:hover,.export-options a:focus-visible{background:#f5f2eb;color:#714b21}
[data-theme="dark"] .export-options{background:#25231f;border-color:#625640}
[data-theme="dark"] .export-options a:hover,[data-theme="dark"] .export-options a:focus-visible{background:#3c3226;color:var(--accent)}
@media print{.export-menu{display:none}}

.results-actions{display:flex;align-items:center;justify-content:flex-end;gap:16px;flex-wrap:wrap;color:var(--muted)}
.results-export{font-size:.78rem;padding:7px 10px;border-color:var(--line);color:var(--accent);background:var(--surface);font-weight:600}
.results-export:hover{border-color:var(--accent)}
@media(max-width:720px){.results-heading{flex-wrap:wrap;gap:12px}.results-actions{justify-content:flex-start}}

.app-help-button{border:0;background:transparent;color:var(--muted);font:inherit;font-size:.8rem;padding:8px 3px;min-height:44px;flex-shrink:0}
.app-help-button:hover{color:var(--accent);text-decoration:underline}
.app-help-is-open{overflow:hidden}
@media print{#app-help-dialog,.app-help-button{display:none}}

.career-switch{display:flex;gap:4px;flex-wrap:wrap;margin:0 0 20px;border-bottom:1px solid var(--line)}
.career-switch a{padding:10px 16px;color:var(--muted);font-size:.9rem;border-bottom:2px solid transparent}
.career-switch a[aria-current="true"]{color:var(--accent);border-color:var(--accent);font-weight:650}
.career-year{display:grid;grid-template-columns:90px minmax(0,1fr);gap:18px;margin-top:26px}
.career-year>h3{font-size:1rem;color:var(--muted);font-weight:600;margin:12px 0;overflow-wrap:anywhere}
.career-items{list-style:none;margin:0;padding:0 0 0 22px;border-left:2px solid var(--line)}
.career-item{position:relative;padding:12px 16px;margin:0 0 16px;border:1px solid var(--line);border-radius:5px;overflow-wrap:anywhere}
.career-item::before{content:"";position:absolute;left:-29px;top:20px;width:10px;height:10px;border-radius:50%;background:var(--accent);border:2px solid var(--surface)}
.career-item h4{font-size:1rem;font-weight:600;margin:6px 0 8px;line-height:1.5}
.career-item p{margin-bottom:8px}
.career-date{font-size:.85rem;color:var(--muted);margin:6px 0}
.career-role{font-size:.88rem;line-height:1.6;margin:8px 0}
.career-role strong{font-weight:600}
.career-uncertain{background:#fff6df}
[data-theme="dark"] .career-uncertain{background:#3a3020}
@media(max-width:720px){.career-year{grid-template-columns:1fr;gap:6px}.career-year>h3{margin:0 0 8px}.career-items{margin-left:5px;padding-left:18px}.career-item::before{left:-25px}}
@media print{.career-switch{display:none}.career-year{break-inside:auto}.career-item{break-inside:avoid}}

.event-summary{font-size:1rem;font-weight:600;line-height:1.65;color:var(--ink);gap:14px 30px}
@media(max-width:720px){.event-summary{font-size:.95rem;gap:10px 20px}}

.person-navigation { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.8rem 0; margin-bottom:1.4rem; border-bottom:1px solid var(--line); font-size:.9rem; }
.person-navigation-back { text-align:center; }
@media(max-width:640px) { .person-navigation { flex-wrap:wrap; gap:.75rem; } .person-navigation-back { order:-1; flex-basis:100%; } }

/* Zachowaj geometrię nagłówka przed uruchomieniem JavaScriptu. */
.theme-toggle[hidden]{display:inline-flex!important;visibility:hidden}
/* Długość biogramu nie powinna zmieniać szerokości obszaru strony. */
html{scrollbar-gutter:stable}
@supports not (scrollbar-gutter:stable){html{overflow-y:scroll}}

/* Zestawienia: dwa rankingi i chronologiczna historia posłowania. */
.summaries-intro{max-width:950px;margin-bottom:30px}.summaries-options{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin-top:20px}.summaries-options label{display:flex;align-items:center;gap:9px}.summaries-options input{accent-color:var(--accent);width:18px;height:18px}.summaries-rankings{display:grid;grid-template-columns:1fr 1fr;gap:24px;align-items:start}.summaries-rankings .detail-section{min-width:0;margin-top:0}.summaries-rankings h2{font-size:1.65rem}.summary-count{text-align:right;width:100px;white-space:nowrap}.summary-count strong{font-size:1.15rem;font-variant-numeric:tabular-nums}.summary-territorial{margin:38px 0 50px;scroll-margin-top:24px}.summary-territory-form{display:flex;gap:16px;align-items:end;margin:24px 0;flex-wrap:wrap}.summary-territory-form>div{flex:1;max-width:470px;min-width:220px}.summary-territory-form label{display:block;font-size:.85rem;font-weight:600;margin-bottom:8px}.summary-territory-form select{width:100%;padding:12px;border:1px solid var(--line);border-radius:5px;background:var(--surface);color:var(--ink)}.summary-area-title{font-family:var(--serif);font-size:1.8rem;font-weight:400;margin:30px 0 12px}.summary-area-event h3{font-family:var(--serif);font-weight:400;font-size:1.55rem;margin-bottom:10px}.summary-area-event th:first-child{width:60%}.nav-link[aria-current=page]{color:var(--accent);text-decoration:underline;text-underline-offset:8px}
@media(max-width:900px){.summaries-rankings{grid-template-columns:1fr}.summaries-rankings h2{font-size:1.5rem}}
