:root {
  --ink: #101820;
  --navy: #111c28;
  --navy-2: #182938;
  --paper: #f4f0e7;
  --paper-2: #e8e0d1;
  --gold: #c39b52;
  --gold-light: #e2c27c;
  --rust: #a44833;
  --green: #3f695c;
  --muted: #6e746f;
  --line: rgba(16, 24, 32, .14);
  --shadow: 0 18px 50px rgba(14, 19, 23, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  color: #f7f2e8;
  background: rgba(14, 24, 33, .96);
  border-bottom: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; }
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 42px;
  color: var(--navy); background: var(--gold);
  font: 700 1.45rem/1 "Source Serif 4", serif;
  clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%);
}
.brand strong, .brand small { display: block; line-height: 1; }
.brand strong { font: 700 1.25rem/1 "Source Serif 4", serif; letter-spacing: .02em; }
.brand small { margin-top: 4px; color: var(--gold-light); font-size: .68rem; letter-spacing: .24em; text-transform: uppercase; }
nav { display: flex; align-self: stretch; }
nav a { display: grid; place-items: center; padding: 0 18px; color: #bac2c7; font-size: .92rem; }
nav a.active { color: white; border-bottom: 2px solid var(--gold); }
.profile-button { justify-self: end; display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 7px; color: white; background: transparent; border: 1px solid rgba(255,255,255,.14); border-radius: 3px; cursor: pointer; }
.profile-button:hover { border-color: var(--gold); }
.profile-button .avatar { display: grid; place-items: center; width: 34px; height: 34px; background: var(--rust); border-radius: 2px; font-weight: 700; font-size: .8rem; }
.profile-button strong, .profile-button small { display: block; text-align: left; line-height: 1.25; }
.profile-button strong { font-size: .78rem; }
.profile-button small { color: var(--gold-light); font-size: .68rem; }

main { overflow: hidden; }
.dashboard {
  position: relative;
  min-height: 510px;
  display: grid;
  align-items: end;
  grid-template-columns: 1.3fr .7fr;
  padding: 78px max(24px, calc((100vw - 1240px) / 2)) 58px;
  color: white;
  background: var(--navy);
}
.dashboard-art, .dashboard-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.dashboard-art { object-fit: cover; object-position: center; }
.dashboard-overlay { background: linear-gradient(90deg, rgba(11,20,29,.99) 0%, rgba(11,20,29,.82) 36%, rgba(11,20,29,.18) 74%, rgba(11,20,29,.22) 100%), linear-gradient(0deg, rgba(11,20,29,.7), transparent 55%); }
.dashboard-copy, .dashboard-stats { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 10px; color: var(--gold-light); font-size: .72rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.eyebrow.dark { color: #8a6732; }
.dashboard h1 { margin: 0; font: 600 clamp(5rem, 11vw, 9rem)/.85 "Source Serif 4", serif; letter-spacing: -.06em; }
.dashboard h1 .slash { padding: 0 .06em; color: var(--gold); font-weight: 400; }
.rank-line { margin: 22px 0 18px; color: #ccd1d2; }
.rank-line strong { color: white; }
.rank-line i { color: var(--gold-light); font-family: "Source Serif 4", serif; font-weight: 500; }
.progress-track { overflow: hidden; width: min(520px, 100%); height: 5px; background: rgba(255,255,255,.18); }
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--gold), #f0d38d); transition: width .35s ease; }
.next-rank { margin: 10px 0 0; color: #99a4a9; font-size: .82rem; }
.dashboard-stats { justify-self: end; display: grid; gap: 1px; width: 270px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.13); box-shadow: var(--shadow); }
.dashboard-stats div { display: grid; grid-template-columns: minmax(92px,auto) 1fr; align-items: center; gap: 10px; min-height: 74px; padding: 12px 18px; background: rgba(14,27,38,.78); backdrop-filter: blur(10px); }
.dashboard-stats strong { color: var(--gold-light); font: 600 clamp(1.45rem,2vw,2rem)/1 "Source Serif 4", serif; white-space: nowrap; }
.dashboard-stats span { color: #c7ced1; font-size: .83rem; }

.intro, .canon { max-width: 1240px; margin: 0 auto; padding-inline: 24px; }
.intro { display: grid; grid-template-columns: 1.15fr .85fr; gap: 80px; padding-top: 76px; padding-bottom: 70px; border-bottom: 1px solid var(--line); }
h2 { margin: 0; font: 600 clamp(2.25rem, 5vw, 4.25rem)/1.04 "Source Serif 4", serif; letter-spacing: -.035em; }
.intro > p { margin: 27px 0 0; color: #535b59; font-family: "Source Serif 4", serif; font-size: 1.08rem; line-height: 1.75; }
.source-link { color: #725322; text-decoration: underline; text-decoration-color: rgba(114,83,34,.4); text-underline-offset: 3px; }
.source-link:hover { text-decoration-color: currentColor; }

.canon { padding-top: 66px; padding-bottom: 90px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.section-head h2 { font-size: clamp(2.2rem, 4vw, 3.6rem); }
.result-count { margin: 0 0 8px; color: var(--muted); font-size: .85rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; padding: 14px; background: #ebe5da; border: 1px solid var(--line); }
.search { position: relative; flex: 1 1 280px; max-width: 420px; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; transform: translateY(-50%); fill: none; stroke: #6b716f; stroke-width: 1.8; }
.search input { width: 100%; min-height: 46px; padding: 10px 14px 10px 43px; color: var(--ink); background: var(--paper); border: 1px solid transparent; outline: none; }
.search input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(195,155,82,.18); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter { min-height: 40px; padding: 7px 12px; color: #5d6462; background: transparent; border: 1px solid transparent; cursor: pointer; font-size: .78rem; font-weight: 600; }
.filter:hover { color: var(--ink); background: rgba(255,255,255,.55); }
.filter.active { color: white; background: var(--navy); }

.book-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.book-card { display: grid; grid-template-columns: 62px minmax(0,1fr) auto; align-items: center; gap: 16px; min-height: 108px; padding: 14px 14px 14px 0; background: rgba(255,255,255,.48); border: 1px solid var(--line); transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.book-card:hover { transform: translateY(-2px); background: rgba(255,255,255,.78); box-shadow: 0 12px 30px rgba(18,27,33,.08); }
.book-card.is-read { background: rgba(220,230,221,.65); border-color: rgba(63,105,92,.32); }
.number { align-self: stretch; display: grid; place-items: center; color: #8b7042; border-right: 1px solid var(--line); font: 600 1.35rem/1 "Source Serif 4", serif; }
.book-copy { min-width: 0; }
.book-copy h3 { margin: 0 0 5px; font: 600 1.08rem/1.25 "Source Serif 4", serif; }
.detail-link { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: color .16s ease, text-decoration-color .16s ease; }
.detail-link:hover, .detail-link:focus-visible { color: #7a5624; text-decoration-color: currentColor; }
.author-link { color: #596765; }
.volume-link { color: #342f28; }
.uk-flag { display: inline-block; margin-left: 7px; font: 400 .78rem/1 system-ui, sans-serif; vertical-align: .08em; cursor: help; }
.book-copy p { overflow: hidden; margin: 0; color: #68706d; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.badge { padding: 2px 6px; color: #806332; background: #eee3cb; font-size: .62rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.badge.new { color: white; background: var(--rust); }
.badge.fraction { color: #334b44; background: #dfe8e1; }
.badge.language { color: #3a4f67; background: #dfe6ee; }
.volumes { grid-column: 2 / -1; margin-top: -2px; border-top: 1px solid var(--line); }
.volumes summary { padding: 10px 0 2px; color: #67542f; cursor: pointer; font-size: .74rem; font-weight: 700; }
.volumes summary span { margin-left: 5px; color: var(--muted); }
.volume-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: 6px; padding: 10px 0 2px; }
.volume-grid label { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 7px 9px; background: #eee8dc; border: 1px solid var(--line); cursor: pointer; font-size: .72rem; line-height: 1.25; }
.volume-grid input { accent-color: var(--green); }
.volume-grid small { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-right: 7px; color: #7b6336; border: 1px solid rgba(123,99,54,.28); font-size: .62rem; }
.status { min-width: 148px; height: 40px; padding: 0 34px 0 11px; color: var(--ink); background-color: var(--paper); border: 1px solid var(--line); border-radius: 0; cursor: pointer; font-size: .76rem; font-weight: 600; }
.status[data-current="read"] { color: white; background-color: var(--green); }
.status[data-current="reading"] { color: white; background-color: #836738; }
.status[data-current="want"] { color: white; background-color: var(--rust); }
.empty-state { padding: 72px 24px; text-align: center; border: 1px dashed #aaa08e; }
.empty-state h3 { margin: 0; font: 600 1.5rem "Source Serif 4", serif; }
.empty-state p { color: var(--muted); }

footer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 36px; min-height: 160px; padding: 36px max(24px, calc((100vw - 1240px) / 2)); color: #aeb7ba; background: var(--navy); }
.footer-brand { color: white; }
footer p { margin: 0; font-size: .8rem; }
footer > a { justify-self: end; color: #d0b875; border-bottom: 1px solid rgba(208,184,117,.4); font-size: .8rem; }
footer button { padding: 10px 0; color: #d0b875; background: transparent; border: 0; border-bottom: 1px solid rgba(208,184,117,.4); cursor: pointer; font-size: .76rem; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 28px; padding: 12px 18px; color: white; background: #0e1821; border: 1px solid rgba(255,255,255,.15); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: .2s ease; font-size: .84rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.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; }

/* Podstrony redakcyjne */
.detail-page, .editorial-page { overflow: hidden; background: var(--paper); }
.detail-hero, .editorial-hero {
  min-height: 410px;
  padding: 72px max(24px, calc((100vw - 1120px) / 2)) 68px;
  color: white;
  background: radial-gradient(circle at 82% 25%, rgba(195,155,82,.2), transparent 30%), linear-gradient(135deg, #0e1923, #182b39 68%, #273b45);
}
.detail-hero .back-link { display: inline-block; margin-bottom: 68px; color: #bac4c8; font-size: .86rem; }
.detail-hero .back-link:hover { color: var(--gold-light); }
.detail-hero h1, .editorial-hero h1 { max-width: 900px; margin: 0; font: 600 clamp(3.25rem, 8vw, 7.2rem)/.92 "Source Serif 4", serif; letter-spacing: -.055em; }
.detail-byline { margin: 22px 0 0; color: var(--gold-light); font-size: 1.05rem; }
.detail-byline a { border-bottom: 1px solid rgba(226,194,124,.45); }
.detail-lead, .editorial-hero > p:last-child { max-width: 780px; margin: 32px 0 0; color: #d4d9da; font: 500 1.18rem/1.7 "Source Serif 4", serif; }
.detail-lead a { color: var(--gold-light); text-decoration: underline; text-underline-offset: 3px; }
.detail-grid, .editorial-grid, .rank-explainer { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.7fr); gap: 70px; max-width: 1120px; margin: 0 auto; padding: 78px 24px; }
.content-panel h2, .related-section h2, .sources-section h2, .editorial-grid h2, .method-section h2, .rank-section h2, .rank-explainer h2 { margin: 0 0 26px; font-size: clamp(2rem,4vw,3.25rem); }
.prose { color: #414a48; font: 500 1.08rem/1.82 "Source Serif 4", serif; }
.prose p { margin: 0; }
.loading-copy { min-height: 145px; }
.facts-panel { align-self: start; padding: 28px; background: #ebe4d7; border-top: 4px solid var(--gold); box-shadow: var(--shadow); }
.facts-heading { margin-top: 34px; }
.fact-list { display: grid; gap: 1px; background: rgba(16,24,32,.12); }
.fact-list > div { display: grid; gap: 4px; padding: 14px 16px; background: #f5f0e7; }
.fact-list span { color: var(--muted); font-size: .75rem; }
.fact-list strong { font-size: .9rem; }
.fact-list a, .text-link { color: #725322; text-decoration: underline; text-underline-offset: 3px; }
.quiet { margin: 0; color: var(--muted); font-size: .86rem; }
.related-section, .sources-section, .method-section, .rank-section { max-width: 1120px; margin: 0 auto; padding: 72px 24px; border-top: 1px solid var(--line); }
.related-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; margin: 30px 0 0; padding: 0; background: var(--line); list-style: none; }
.related-list li { display: grid; grid-template-columns: 54px 1fr; align-items: center; min-height: 66px; padding: 10px 18px 10px 0; background: rgba(255,255,255,.56); }
.related-list li > span { display: grid; place-items: center; align-self: stretch; color: #8b7042; border-right: 1px solid var(--line); font: 600 1rem "Source Serif 4", serif; }
.related-list li > a, .author-works li div > a { padding-left: 18px; color: #2d332f; font: 600 1rem/1.3 "Source Serif 4", serif; }
.related-list li.current { background: #e4eadf; box-shadow: inset 4px 0 var(--green); }
.author-works li div { display: grid; padding-left: 18px; }
.author-works li div > a { padding-left: 0; }
.author-works small { margin-top: 3px; color: var(--muted); font-size: .72rem; text-transform: uppercase; }
.sources-section ul { display: grid; gap: 12px; padding-left: 20px; color: #4d5552; }
.sources-section li { padding-left: 6px; }
.sources-section a { color: #725322; text-decoration: underline; text-underline-offset: 3px; }
.source-note { max-width: 820px; color: var(--muted); font: 500 1rem/1.7 "Source Serif 4", serif; }
.editorial-hero { min-height: 520px; display: flex; flex-direction: column; justify-content: end; }
.editorial-grid article > p { color: #4b5351; font: 500 1.08rem/1.78 "Source Serif 4", serif; }
.quote-panel { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 18px 16px; padding: 30px; color: white; background: var(--navy); }
.quote-panel strong { color: var(--gold-light); font: 600 2.25rem/1 "Source Serif 4", serif; }
.quote-panel span { color: #c9d0d2; font-size: .86rem; }
.method-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 34px; }
.method-cards article { min-height: 220px; padding: 28px; background: rgba(255,255,255,.55); border: 1px solid var(--line); }
.method-cards article > span { color: #9a7840; font: 600 1rem "Source Serif 4", serif; }
.method-cards h3 { margin: 36px 0 10px; font: 600 1.45rem "Source Serif 4", serif; }
.method-cards p { margin: 0; color: var(--muted); }
.rank-explainer { align-items: center; }
.rank-explainer p { color: #4b5351; font: 500 1.08rem/1.75 "Source Serif 4", serif; }
.primary-link { display: inline-block; margin-top: 18px; padding: 12px 18px; color: white; background: var(--navy); font-weight: 700; font-size: .86rem; }
.fraction-example { display: grid; grid-template-columns: auto auto auto; place-content: center; align-items: center; gap: 12px; min-height: 270px; color: white; background: var(--navy); }
.fraction-example span { color: var(--gold-light); font: 600 4rem/1 "Source Serif 4", serif; }
.fraction-example b { color: #829198; font-size: 2rem; }
.fraction-example strong { grid-column: 1/-1; text-align: center; color: #d8dddf; }
.rank-list { display: grid; gap: 8px; margin-top: 34px; }
.rank-card { display: grid; grid-template-columns: 72px 1fr; align-items: center; min-height: 94px; background: rgba(255,255,255,.55); border: 1px solid var(--line); }
.rank-card > span { display: grid; place-items: center; align-self: stretch; color: #8b7042; border-right: 1px solid var(--line); font: 600 1.2rem "Source Serif 4", serif; }
.rank-card > div { padding: 16px 22px; }
.rank-card h2 { margin: 0; font-size: 1.5rem; }
.rank-card h2 i { color: #856431; font-weight: 500; }
.rank-card p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.not-found { min-height: 70vh; padding: 120px max(24px,calc((100vw - 1000px)/2)); }
.not-found h1 { max-width: 760px; margin: 0; font: 600 clamp(2.8rem,7vw,6rem)/1 "Source Serif 4",serif; }

/* Puste szablony redakcyjne */
.editorial-empty-grid { align-items: start; }
.editorial-placeholder { min-height: 220px; padding: 30px; background: rgba(255,255,255,.48); border: 1px dashed rgba(16,24,32,.24); }
.editorial-placeholder h2 { margin: 0 0 18px; font-size: clamp(2rem,4vw,3.25rem); }
.editorial-placeholder > p:last-child { max-width: 620px; margin: 0; color: var(--muted); font: 500 1.05rem/1.75 "Source Serif 4",serif; }
.compact-placeholder { min-height: 0; }
.facts-panel .compact-placeholder { margin-top: 28px; padding: 22px 0 0; background: transparent; border-width: 1px 0 0; }
.facts-panel .compact-placeholder .facts-heading { margin: 0 0 12px; }

/* Konto czytelnika — interfejs przygotowany pod Supabase */
.header-text-link { justify-self: end; padding: 10px 0; color: var(--gold-light); border-bottom: 1px solid rgba(226,194,124,.4); font-size: .82rem; font-weight: 700; }
.header-text-link:hover { color: white; border-color: white; }
.auth-body { min-height: 100vh; background: var(--paper); }
.auth-page { min-height: calc(100vh - 76px); display: grid; grid-template-columns: minmax(0,1.15fr) minmax(420px,.85fr); }
.auth-context { display: flex; flex-direction: column; justify-content: end; padding: clamp(54px,8vw,110px) max(32px,calc((100vw - 1240px)/2)) clamp(56px,8vw,100px); color: white; background: radial-gradient(circle at 78% 22%,rgba(195,155,82,.2),transparent 26%),linear-gradient(135deg,#0e1923,#182b39 68%,#273b45); }
.auth-context h1 { max-width: 760px; margin: 0; font: 600 clamp(3.25rem,6.5vw,6.8rem)/.92 "Source Serif 4",serif; letter-spacing: -.055em; }
.auth-context p:not(.eyebrow) { max-width: 650px; margin: 30px 0 0; color: #cbd2d4; font: 500 1.1rem/1.7 "Source Serif 4",serif; }
.auth-context > a { width: fit-content; margin-top: 34px; color: var(--gold-light); border-bottom: 1px solid rgba(226,194,124,.4); font-weight: 700; font-size: .86rem; }
.auth-card { align-self: center; width: min(100% - 48px,520px); margin: 48px auto; padding: clamp(30px,5vw,54px); background: rgba(255,255,255,.58); border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-card h2 { margin: 0 0 34px; font-size: clamp(2.4rem,4vw,3.75rem); }
.auth-card form { display: grid; gap: 20px; }
.auth-card form > label { display: grid; gap: 8px; color: #3c4543; font-size: .83rem; font-weight: 700; }
.auth-card input[type="email"], .auth-card input[type="text"], .auth-card input[type="password"] { width: 100%; min-height: 50px; padding: 11px 13px; color: var(--ink); background: #fbf8f2; border: 1px solid rgba(16,24,32,.22); border-radius: 0; outline: none; }
.auth-card input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(195,155,82,.18); }
.auth-card label > small { color: var(--muted); font-weight: 500; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 72px !important; }
.password-toggle { position: absolute; top: 50%; right: 10px; padding: 7px; color: #6d5630; background: transparent; border: 0; cursor: pointer; transform: translateY(-50%); font-size: .72rem; font-weight: 700; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; font-size: .78rem; }
.form-row-single { justify-content: flex-end; }
.form-row > a, .auth-switch a { color: #725322; text-decoration: underline; text-underline-offset: 3px; }
.check-label { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 8px !important; font-weight: 500 !important; }
.check-label input { accent-color: var(--green); }
.auth-submit, .secondary-button { min-height: 50px; padding: 11px 18px; color: white; background: var(--navy); border: 1px solid var(--navy); cursor: pointer; font-weight: 700; }
.auth-submit:hover, .secondary-button:hover { background: var(--navy-2); }
.auth-submit:disabled, .secondary-button:disabled { opacity: .5; cursor: not-allowed; }
.auth-status { min-height: 24px; margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.auth-status[data-type="error"] { color: #9b3327; }
.auth-status[data-type="success"] { color: var(--green); }
.auth-switch { margin: 28px 0 0; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }
.auth-page-compact .auth-context h1 { max-width: 690px; font-size: clamp(3rem,5.4vw,5.8rem); }
.account-page { min-height: calc(100vh - 76px); max-width: 1000px; margin: 0 auto; padding: 90px 24px; }
.account-page h1 { margin: 0; font: 600 clamp(3.2rem,7vw,6rem)/.95 "Source Serif 4",serif; letter-spacing: -.05em; }
.account-lead { max-width: 700px; color: var(--muted); font: 500 1.08rem/1.75 "Source Serif 4",serif; }
.account-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; margin-top: 54px; padding: 28px; background: rgba(255,255,255,.58); border: 1px solid var(--line); box-shadow: var(--shadow); }
.account-avatar { display: grid; place-items: center; width: 58px; height: 64px; color: var(--navy); background: var(--gold); font: 700 2rem "Source Serif 4",serif; clip-path: polygon(0 0,100% 0,100% 82%,50% 100%,0 82%); }
.account-card span, .account-card strong, .account-card small { display: block; }
.account-card span { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.account-card strong { margin-top: 3px; font-size: 1.05rem; }
.account-card small { margin-top: 6px; color: var(--muted); }
.account-admin-link { display: inline-block; margin-top: 24px; padding: 12px 18px; color: white; background: var(--green); font-size: .86rem; font-weight: 700; }
.account-admin-link[hidden] { display: none; }

/* Blog oraz strona autora projektu */
.blog-index { max-width: 1120px; margin: 0 auto; padding: 76px 24px 90px; }
.blog-head-actions { display: flex; align-items: center; gap: 20px; }
.blog-head-actions .primary-link { margin: 0; }
.admin-blog-link[hidden] { display: none; }
.blog-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.blog-card { display: flex; flex-direction: column; min-height: 300px; padding: 30px; background: rgba(255,255,255,.58); border: 1px solid var(--line); }
.blog-card-meta { margin: 0 0 30px; color: #8a6732; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.blog-card h3 { margin: 0; font: 600 clamp(1.65rem,3vw,2.35rem)/1.08 "Source Serif 4",serif; letter-spacing: -.025em; }
.blog-card h3 a:hover { color: #725322; }
.blog-card-excerpt { flex: 1; margin: 18px 0 24px; color: var(--muted); font: 500 1rem/1.7 "Source Serif 4",serif; }
.blog-empty { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 22px; min-height: 170px; padding: 28px 32px; background: rgba(255,255,255,.52); border: 1px dashed rgba(16,24,32,.25); }
.blog-empty[hidden] { display: none; }
.blog-empty > span { color: var(--gold); font-size: 2.2rem; }
.blog-empty h3 { margin: 0; font: 600 1.8rem "Source Serif 4",serif; }
.blog-empty p { margin: 8px 0 0; color: var(--muted); }
.blog-topics { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 40px; }
.blog-topics article { min-height: 220px; padding: 28px; background: rgba(255,255,255,.55); border: 1px solid var(--line); }
.blog-topics span { color: #9a7840; font: 600 1rem "Source Serif 4",serif; }
.blog-topics h3 { margin: 36px 0 10px; font: 600 1.45rem "Source Serif 4",serif; }
.blog-topics p { margin: 0; color: var(--muted); }
.about-me-layout { display: grid; grid-template-columns: 180px minmax(0,1.35fr) minmax(280px,.65fr); gap: 32px; align-items: start; max-width: 1120px; margin: 0 auto; padding: 78px 24px 90px; }
.about-me-monogram { display: grid; place-items: center; width: 180px; aspect-ratio: 1; color: var(--navy); background: var(--gold); font: 600 4.5rem "Source Serif 4",serif; clip-path: polygon(0 0,100% 0,100% 84%,50% 100%,0 84%); }
.about-me-copy { min-height: 300px; }
.about-me-layout .facts-panel { margin: 0; }

/* Panel administratora i artykuly */
.admin-page { max-width: 1120px; margin: 0 auto; padding: 76px 24px 100px; }
.admin-heading { max-width: 760px; }
.admin-heading h1 { margin: 0; font: 600 clamp(3.4rem,7vw,6.6rem)/.93 "Source Serif 4",serif; letter-spacing: -.05em; }
.admin-heading > p:last-child { max-width: 680px; color: var(--muted); font: 500 1.08rem/1.75 "Source Serif 4",serif; }
.admin-locked { margin-top: 46px; padding: 30px; background: rgba(255,255,255,.55); border: 1px solid var(--line); }
.admin-locked[hidden], .admin-workspace[hidden] { display: none; }
.admin-locked h2 { font-size: 2rem; }
.admin-workspace { margin-top: 50px; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.admin-tabs button { min-width: 112px; padding: 11px 18px; color: #4c5553; background: transparent; border: 1px solid rgba(16,24,32,.22); cursor: pointer; font-weight: 700; }
.admin-tabs button:hover, .admin-tabs button.active { color: white; background: var(--navy); border-color: var(--navy); }
.admin-view { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(280px,.6fr); gap: 44px; align-items: start; }
.admin-view[hidden] { display: none; }
.admin-form { display: grid; gap: 22px; padding: 30px; background: rgba(255,255,255,.58); border: 1px solid var(--line); box-shadow: var(--shadow); }
.admin-form-title { margin: 0; font-size: 2rem; }
.admin-form label { display: grid; gap: 8px; color: #3c4543; font-size: .83rem; font-weight: 700; }
.admin-form input, .admin-form textarea, .admin-form select { width: 100%; padding: 12px 13px; color: var(--ink); background: #fbf8f2; border: 1px solid rgba(16,24,32,.22); border-radius: 0; outline: none; }
.admin-form textarea { resize: vertical; line-height: 1.6; }
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(195,155,82,.18); }
.admin-form label small { color: var(--muted); font-weight: 500; }
.admin-form-row { display: grid; grid-template-columns: minmax(0,.55fr) minmax(0,1fr); gap: 14px; }
.admin-checks { display: grid; gap: 10px; padding: 16px; background: rgba(235,228,215,.65); border: 1px solid var(--line); }
.admin-checks label { display: flex; align-items: center; gap: 9px; }
.admin-checks input { width: auto; }
.admin-form select[multiple] { min-height: 190px; padding: 5px; }
.admin-form select[multiple] option { padding: 7px 9px; }
.editorial-fieldset { display: grid; gap: 18px; margin: 0; padding: 20px; background: rgba(255,255,255,.34); border: 1px solid var(--line); }
.editorial-fieldset legend { padding: 0 8px; color: var(--ink); font: 600 1.25rem "Source Serif 4",serif; }
.admin-field-help { margin: -4px 0 2px; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.source-editor { display: grid; gap: 14px; }
.source-editor-row { display: grid; grid-template-columns: minmax(0,.75fr) minmax(0,1.15fr); gap: 12px; padding: 16px; background: rgba(235,228,215,.55); border-left: 3px solid var(--gold); }
.source-editor-row label:last-of-type { grid-column: 1/-1; }
.site-content-form { align-content: start; }
.site-content-groups { display: grid; gap: 14px; }
.site-content-group { background: rgba(255,255,255,.36); border: 1px solid var(--line); }
.site-content-group[hidden] { display: none; }
.site-content-group summary { padding: 16px 18px; color: var(--ink); cursor: pointer; font: 600 1.2rem "Source Serif 4",serif; }
.site-content-group[open] summary { border-bottom: 1px solid var(--line); }
.site-content-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; padding: 18px; }
.site-content-field.multiline { grid-column: 1/-1; }
.site-content-field[hidden] { display: none; }
.site-content-search { max-width: 520px; }
.site-content-actions { position: sticky; bottom: 12px; z-index: 4; padding: 14px; background: rgba(251,248,242,.96); border: 1px solid var(--line); box-shadow: var(--shadow); }
.site-content-actions .secondary-button { text-decoration: none; }
.site-content-help p { margin-top: 14px; color: var(--muted); line-height: 1.7; }
[data-content-key] { white-space: pre-line; }
.source-remove-button { grid-column: 1/-1; justify-self: start; }
.source-add-button { justify-self: start; }
.admin-form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-cancel-button { color: var(--ink); background: transparent; border-color: rgba(16,24,32,.25); }
.admin-cancel-button:hover { color: white; }
.admin-cancel-button[hidden] { display: none; }
.admin-delete-button { padding: 10px 14px; color: #9b3327; background: transparent; border: 1px solid rgba(155,51,39,.4); cursor: pointer; font-weight: 700; }
.admin-delete-button:hover { color: white; background: #9b3327; }
.admin-delete-button[hidden] { display: none; }
.media-upload-panel { display: grid; gap: 16px; margin: 0; padding: 20px; background: rgba(235,228,215,.52); border: 1px solid var(--line); }
.media-upload-panel legend { padding: 0 8px; color: var(--ink); font: 600 1.25rem "Source Serif 4",serif; }
.media-upload-panel > .secondary-button { width: fit-content; }
.media-upload-preview { display: grid; gap: 10px; padding: 12px; background: rgba(255,255,255,.55); border: 1px dashed rgba(16,24,32,.24); }
.media-upload-preview[hidden] { display: none; }
.media-upload-preview img { display: block; max-width: min(100%,320px); max-height: 320px; margin: 0 auto; object-fit: contain; }
.media-upload-preview p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.admin-posts { padding: 28px; background: #ebe4d7; border-top: 4px solid var(--gold); }
.admin-posts h2 { margin-bottom: 24px; font-size: 2.4rem; }
.admin-posts > div { display: grid; gap: 8px; color: var(--muted); font-size: .86rem; }
.admin-post-item { display: grid; gap: 7px; padding: 16px; background: rgba(255,255,255,.6); border: 1px solid var(--line); }
.admin-post-item strong { color: var(--ink); font: 600 1rem/1.35 "Source Serif 4",serif; }
.admin-post-item > small { color: var(--muted); font-size: .72rem; }
.admin-post-item a { width: fit-content; color: #725322; text-decoration: underline; text-underline-offset: 3px; font-size: .78rem; }
.admin-post-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 3px; }
.admin-post-actions button { padding: 6px 10px; color: #725322; background: transparent; border: 1px solid rgba(114,83,34,.35); cursor: pointer; font-size: .78rem; font-weight: 700; }
.admin-post-actions button:hover { color: white; background: #725322; }
.admin-post-actions .admin-delete-button { color: #9b3327; border-color: rgba(155,51,39,.4); }
.admin-post-actions .admin-delete-button:hover { color: white; background: #9b3327; }
.admin-post-actions button:disabled { opacity: .5; cursor: not-allowed; }
.admin-post-status { width: fit-content; padding: 2px 6px; color: #765d31; background: #eee3cb; font-size: .62rem; font-weight: 700; text-transform: uppercase; }
.admin-post-status.published { color: white; background: var(--green); }
.admin-list-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.admin-list-heading h2 { margin-bottom: 12px; }
.admin-list-heading span { color: #80622f; font-size: .8rem; font-weight: 700; }
.admin-search { display: grid; gap: 7px; margin-bottom: 18px; color: #4c5553; font-size: .76rem; font-weight: 700; }
.admin-search input { width: 100%; padding: 10px 11px; color: var(--ink); background: #fbf8f2; border: 1px solid rgba(16,24,32,.22); }
.admin-catalog-list > div:last-child { max-height: 760px; overflow: auto; padding-right: 3px; }
.blog-article-page { background: var(--paper); }
.blog-article-page article { max-width: 840px; min-height: 70vh; margin: 0 auto; padding: 72px 24px 110px; }
.blog-article-page .back-link { display: inline-block; margin-bottom: 70px; color: #725322; border-bottom: 1px solid rgba(114,83,34,.35); font-size: .86rem; }
.blog-article-page h1 { margin: 0; font: 600 clamp(3rem,7vw,6rem)/.96 "Source Serif 4",serif; letter-spacing: -.05em; }
.blog-article-lead { margin: 30px 0 0; color: #59615f; font: 500 1.25rem/1.65 "Source Serif 4",serif; }
.blog-article-content { margin-top: 58px; color: #343c3a; font: 500 1.1rem/1.88 "Source Serif 4",serif; }
.blog-article-content p { margin: 0 0 1.45em; }
.article-media { margin: 42px 0; }
.article-media img { display: block; width: auto; max-width: 100%; max-height: 760px; margin: 0 auto; box-shadow: 0 18px 44px rgba(16,24,32,.14); }
.article-media figcaption, .book-cover figcaption { max-width: 680px; margin: 12px auto 0; color: var(--muted); font: 500 .78rem/1.55 "DM Sans",sans-serif; text-align: center; }
.article-media figcaption a, .book-cover figcaption a { color: #725322; text-decoration: underline; text-underline-offset: 3px; }
.book-cover { max-width: 1120px; margin: 64px auto 0; padding: 0 24px; text-align: center; }
.book-cover[hidden] { display: none; }
.book-cover img { display: block; width: auto; max-width: min(100%,420px); max-height: 680px; margin: 0 auto; background: #e8e0d2; box-shadow: 0 24px 60px rgba(7,15,22,.25); }
.author-portrait { max-width: 1120px; margin: 64px auto 0; padding: 0 24px; text-align: center; }
.author-portrait[hidden] { display: none; }
.author-portrait img { display: block; width: min(100%,360px); max-height: 520px; margin: 0 auto; object-fit: cover; background: #e8e0d2; box-shadow: 0 24px 60px rgba(7,15,22,.25); }
.author-portrait figcaption { max-width: 680px; margin: 12px auto 0; color: var(--muted); font: 500 .78rem/1.55 "DM Sans",sans-serif; text-align: center; }
.author-portrait figcaption a { color: #725322; text-decoration: underline; text-underline-offset: 3px; }
.editorial-content { min-width: 0; }
.editorial-section + .editorial-section { margin-top: 58px; padding-top: 48px; border-top: 1px solid var(--line); }
.editorial-copy { color: #343c3a; font: 500 1.08rem/1.85 "Source Serif 4",serif; }
.editorial-copy p { margin: 0 0 1.35em; white-space: pre-line; }
.editorial-copy p:last-child { margin-bottom: 0; }
.compact-copy { font-size: .96rem; line-height: 1.7; }
.facts-note { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.facts-note .facts-heading { margin: 0 0 12px; }
.editorial-empty-message { color: var(--muted); font-style: italic; }
.detail-sources { padding-top: 58px; padding-bottom: 58px; }
.source-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: sources; }
.source-list li { position: relative; display: grid; gap: 5px; padding: 18px 20px 18px 58px; background: rgba(255,255,255,.5); border: 1px solid var(--line); counter-increment: sources; }
.source-list li::before { position: absolute; top: 18px; left: 20px; color: #8a6732; content: counter(sources, decimal-leading-zero); font-weight: 700; }
.source-list a { width: fit-content; color: #725322; text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
.source-list span { color: var(--muted); font-size: .84rem; line-height: 1.55; }
.source-list .editorial-empty-message { display: block; padding-left: 20px; }
.source-list .editorial-empty-message::before { content: none; }
.blog-article-source { display: grid; gap: 8px; margin-top: 48px; padding: 20px 22px; background: rgba(235,228,215,.7); border-left: 3px solid var(--gold); }
.blog-article-source[hidden] { display: none; }
.blog-article-source span { color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.blog-article-source a { width: fit-content; color: #725322; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 860px) {
  .site-header { grid-template-columns: auto 1fr auto; height: 68px; gap: 10px; padding-inline: 16px; }
  nav { display: flex; justify-content: center; }
  nav a { padding: 0 9px; font-size: .78rem; }
  .dashboard { min-height: 600px; grid-template-columns: 1fr; gap: 38px; padding-top: 58px; }
  .dashboard-art { object-position: 64% center; }
  .dashboard-overlay { background: linear-gradient(90deg, rgba(11,20,29,.98), rgba(11,20,29,.5)), linear-gradient(0deg, rgba(11,20,29,.88), transparent); }
  .dashboard-stats { justify-self: stretch; grid-template-columns: repeat(3,1fr); width: 100%; }
  .dashboard-stats div { grid-template-columns: 1fr; gap: 5px; text-align: center; }
  .intro { grid-template-columns: 1fr; gap: 12px; }
  .book-list { grid-template-columns: 1fr; }
  .detail-grid, .editorial-grid, .rank-explainer { grid-template-columns: 1fr; gap: 38px; padding-block: 58px; }
  .related-list { grid-template-columns: 1fr; }
  .method-cards { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr; gap: 18px; }
  footer > a { justify-self: start; }
  .auth-page { min-height: auto; grid-template-columns: 1fr; }
  .auth-context { min-height: 430px; padding: 70px 24px 54px; }
  .auth-context h1 { font-size: clamp(3rem,9vw,5rem); }
  .auth-card { margin-block: 40px; }
  .blog-topics { grid-template-columns: 1fr; }
  .blog-list, .admin-view { grid-template-columns: 1fr; }
  .about-me-layout { grid-template-columns: 140px 1fr; }
  .about-me-monogram { width: 140px; }
  .about-me-layout .facts-panel { grid-column: 1/-1; }
}
@media (max-width: 560px) {
  .site-header { gap: 6px; padding-inline: 8px; }
  .site-header .brand > span:last-child { display: none; }
  nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav a { flex: 0 0 auto; padding: 0 5px; font-size: .66rem; }
  .profile-button > span:last-child { display: none; }
  .profile-button { padding: 5px; }
  .dashboard { min-height: 620px; padding-bottom: 34px; }
  .dashboard h1 { font-size: 5.5rem; }
  .dashboard-stats { grid-template-columns: 1fr; }
  .dashboard-stats div { grid-template-columns: 54px 1fr; min-height: 58px; text-align: left; }
  .intro, .canon { padding-inline: 18px; }
  .intro { padding-top: 54px; padding-bottom: 50px; }
  .canon { padding-top: 48px; }
  .toolbar { padding: 10px; }
  .filters { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .filter { white-space: nowrap; }
  .book-card { grid-template-columns: 48px minmax(0,1fr); padding-right: 10px; }
  .status { grid-column: 2; width: 100%; }
  .detail-hero, .editorial-hero { min-height: 420px; padding: 48px 18px; }
  .detail-hero .back-link { margin-bottom: 48px; }
  .detail-hero h1, .editorial-hero h1 { font-size: 3.2rem; }
  .detail-grid, .editorial-grid, .rank-explainer, .related-section, .sources-section, .method-section, .rank-section { padding-inline: 18px; }
  .header-text-link { font-size: .72rem; }
  .auth-card { width: calc(100% - 28px); padding: 28px 20px; }
  .form-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .account-page { padding: 56px 18px; }
  .account-card { grid-template-columns: auto 1fr; }
  .account-card .secondary-button { grid-column: 1/-1; width: 100%; }
  .about-me-layout { grid-template-columns: 1fr; padding: 56px 18px; }
  .about-me-monogram { width: 116px; }
  .blog-index { padding: 54px 18px 72px; }
  .blog-index .section-head { align-items: flex-start; flex-direction: column; }
  .blog-head-actions { width: 100%; justify-content: space-between; }
  .blog-empty { grid-template-columns: 1fr; }
  .admin-page { padding: 54px 18px 72px; }
  .admin-form { padding: 22px 18px; }
  .admin-form-row { grid-template-columns: 1fr; }
  .source-editor-row { grid-template-columns: 1fr; }
  .source-editor-row label:last-of-type { grid-column: auto; }
  .site-content-fields { grid-template-columns: 1fr; }
  .site-content-field.multiline { grid-column: auto; }
  .source-remove-button { grid-column: auto; }
  .blog-article-page article { padding: 52px 18px 80px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
