/* Kreator postaci MG&G - wygląd aplikacji */

:root {
  --ink: #2b1d14;
  --ink-soft: #5b4634;
  --ink-faint: #8a7560;
  --paper: #f7eedb;
  --paper-2: #efe0c0;
  --paper-3: #e4cfa3;
  --line: rgba(74, 50, 28, 0.28);
  --line-strong: rgba(74, 50, 28, 0.55);
  --accent: #8b2c1c;
  --accent-soft: rgba(139, 44, 28, 0.12);
  --gold: #a87a26;
  --ok: #3f6a34;
  --warn: #9a6400;
  --err: #a3271b;
  --shadow: 0 1px 2px rgba(60, 35, 10, 0.18), 0 6px 18px rgba(60, 35, 10, 0.12);
  --font-ui: 'Alegreya', Georgia, 'Times New Roman', serif;
  --font-title: 'Segoe Script', 'Dancing Script', cursive;
  --font-hand: 'Segoe Print', 'Patrick Hand', 'Comic Sans MS', cursive;
  --radius: 6px;
}

* { box-sizing: border-box; }
[v-cloak] { display: none; }

html { background: #d9c39a; }
body {
  margin: 0;
  color: var(--ink);
  font: 17px/1.45 var(--font-ui);
  background: #d9c39a url('../../Typst/assets/background/papier.jpg') center / cover fixed;
  min-height: 100vh;
}

a { color: var(--accent); }
code { font-size: 0.9em; background: var(--paper-2); padding: 0 4px; border-radius: 3px; }
img { max-width: 100%; }

/* ------------------------------------------------------------ układ */

.app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 10px 24px;
  background: rgba(43, 29, 20, 0.92);
  color: var(--paper);
  border-bottom: 3px double var(--gold);
}
.brand { display: flex; align-items: baseline; gap: 14px; }
.brand-title { font: 700 30px/1.1 var(--font-title); color: #f3dfb0; }
.brand-sub { font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; color: #d6bf8e; }
.topbar-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.steps {
  display: flex; gap: 4px; flex-wrap: wrap; justify-content: center;
  padding: 12px 16px 0;
}
.step-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  font: inherit; color: var(--ink-soft);
  background: rgba(247, 238, 219, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.step-tab:hover { background: var(--paper); color: var(--ink); }
.step-tab.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.step-no {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  font-weight: 700; font-size: 14px; border: 1px solid currentColor;
}
.step-dot { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; color: #fff; }
.step-dot.error { background: var(--err); }
.step-dot.warning { background: var(--warn); }

.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px;
  width: 100%; max-width: 2300px; margin: 0 auto; padding: 16px 28px 32px;
  flex: 1;
}
.layout-wide { grid-template-columns: minmax(0, 1fr); max-width: 1600px; }
.aside { position: relative; }
.aside-sticky { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 24px); }
.aside .summary { margin-bottom: 0; min-height: 0; overflow-y: auto; }
.step-nav { display: flex; flex-direction: column; gap: 6px; flex: none; }
.step-next { font-size: 17px; padding: 10px 14px; box-shadow: var(--shadow); }

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 12px 16px 24px; }
  .aside-sticky { position: static; max-height: none; }
  .layout { padding-bottom: 84px; }
  .step-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    flex-direction: row-reverse; padding: 10px 16px;
    background: rgba(43, 29, 20, 0.92); border-top: 3px double var(--gold);
  }
  .step-next { flex: 1; }
  .topbar { padding: 10px 16px; }
}

@media (max-width: 600px) {
  .topbar { padding: 8px 16px; gap: 8px; }
  .brand-title { font-size: 24px; }
  .brand-sub { display: none; }
  .topbar-actions .btn { padding: 4px 9px; font-size: 13.5px; }
  .steps { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding: 10px 16px 4px; }
  .step-tab { flex: none; padding: 6px 12px; }
  .step-title { font-size: 28px; }
  .ability-grid, .spell-grid, .bg-grid { grid-template-columns: minmax(0, 1fr); }
  .spell-card { grid-template-columns: 64px minmax(0, 1fr); }
  .spell-card .framed { width: 64px !important; height: 64px !important; }
}

.footer { text-align: center; font-size: 13px; color: var(--ink-soft); padding: 10px 16px 18px; }

/* ------------------------------------------------------------ elementy */

.card {
  background: rgba(247, 238, 219, 0.94);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 16px;
  position: relative;
}
.card::before {
  content: ''; position: absolute; inset: 4px; border: 1px solid var(--line); border-radius: 3px; pointer-events: none;
}

.step { padding-bottom: 8px; }
.step-title { font: 700 34px/1.2 var(--font-title); margin: 4px 0 10px; color: var(--ink); }
.section-title { font: 700 24px/1.2 var(--font-title); margin: 26px 0 6px; }
.section-title small { font: 400 15px var(--font-ui); color: var(--ink-soft); margin-left: 8px; }
.card-title { font: 700 21px/1.2 var(--font-title); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.hint { color: var(--ink-soft); margin: 0 0 12px; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.85em; }
.over { color: var(--err); }

.btn {
  font: inherit; font-size: 15px;
  padding: 6px 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}
.btn:hover:not(:disabled) { background: var(--paper-2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff7ea; }
.btn.primary:hover:not(:disabled) { background: #74220f; }
.btn.small { padding: 2px 10px; font-size: 14px; }
.btn.ghost { background: transparent; color: #f3dfb0; border-color: rgba(243, 223, 176, 0.45); }
.btn.ghost:hover { background: rgba(243, 223, 176, 0.12); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}

input, select, textarea {
  font: inherit; color: var(--ink);
  background: #fffaf0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 6px 8px;
}
.field { display: flex; flex-direction: column; gap: 4px; font-weight: 700; }
.field input { font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.inline-field { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; }
.notes-input { width: 100%; resize: vertical; }

.badge {
  display: inline-block; font-size: 12.5px; line-height: 1.3;
  padding: 1px 8px; border-radius: 999px;
  background: var(--paper-2); border: 1px solid var(--line);
  color: var(--ink-soft);
}
.badge.bad { background: #f6d7cf; border-color: #d99a8c; color: var(--err); }
.badge.section { background: transparent; font-style: italic; }
.badge.good { background: #e3ecd8; border-color: #b9cfa8; color: var(--ok); }
.counter { display: inline-block; min-width: 26px; text-align: center; font-weight: 700; }

/* Treść z podręcznika */
/* max-width: none - inaczej w wąskich komórkach tabel (np. koszt w sklepie) ikony były ściskane w poziomie */
.tp-icon, .sys-icon { height: 1.15em; width: auto; max-width: none; vertical-align: -0.2em; }
.tp-par + .tp-par { margin-top: 0.35em; }
.tp-action { margin-top: 0.35em; }
.tp-table { border-collapse: collapse; margin: 6px 0; font-size: 0.9em; }
.tp-table td, .tp-table th { border: 1px solid var(--line-strong); padding: 1px 8px; text-align: left; vertical-align: top; }
.tp-list { margin: 4px 0; padding-left: 20px; }
.tp-illustration { max-height: 140px; }

/* ------------------------------------------------------------ krok 1 */

.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 14px; }
.bg-card {
  position: relative; overflow: hidden;
  background: rgba(247, 238, 219, 0.92);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s;
}
.bg-card:hover { transform: translateY(-2px); }
.bg-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--shadow); background: #fbf3e2; }
.bg-card header { display: flex; align-items: center; gap: 10px; }
.bg-card h4 { margin: 0; font: 700 23px/1.2 var(--font-title); }
.bg-desc { font-style: italic; color: var(--ink-soft); margin: 6px 0; }
.bg-image { position: absolute; right: -10px; bottom: -10px; height: 150px; opacity: 0.22; pointer-events: none; }
.radio-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink-soft); flex: none; }
.selected .radio-dot { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, transparent 50%); }
.perks { margin: 6px 0 0; padding-left: 18px; font-size: 15px; }
.perks li { margin-bottom: 4px; }
.perks .tp-par { display: inline; }
.pet-card { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #f6f0d8; }
.pet-card > img { width: 36px; height: 36px; opacity: 0.7; }
.pet-card > span { flex: 1; min-width: 200px; }
.pet-perk .tp-par { display: inline; }
.pet-suggestions { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pet-suggestions .chip { text-transform: capitalize; }

/* tożsamość postaci: obrazek obok imion */
.identity { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; align-items: start; }
.identity-fields { align-content: start; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 800px) { .identity-fields { grid-template-columns: minmax(0, 1fr); } }
.identity-notes { grid-column: 1 / -1; }
.identity-notes textarea { font-weight: 400; min-height: 120px; }
@media (max-width: 600px) { .identity { grid-template-columns: minmax(0, 1fr); } }

.image-upload { display: flex; flex-direction: column; gap: 6px; }
.image-upload-frame {
  position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden;
  font: inherit; color: var(--ink-soft); cursor: pointer;
  background: rgba(255, 250, 240, 0.7); border: 2px dashed var(--line-strong); border-radius: var(--radius);
}
.image-upload.filled .image-upload-frame { border-style: solid; background: #fffaf0; }
.image-upload.dragging .image-upload-frame { border-color: var(--accent); background: var(--accent-soft); }
.image-upload-frame > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-upload-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 100%; padding: 10px; text-align: center; }
.image-upload-empty img { width: 64px; height: 64px; opacity: 0.45; }
.image-upload-empty span { font-weight: 700; }
.image-upload-empty small { font-size: 13px; }
.image-upload-actions { display: flex; gap: 6px; justify-content: center; }
.image-upload-error { color: var(--err); font-size: 13px; }
.portrait-thumb { width: 48px; height: 48px; flex: none; object-fit: cover; border-radius: 50%; border: 2px solid var(--line-strong); }

/* ------------------------------------------------------------ krok 2 */

.attr-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.attr-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: rgba(247, 238, 219, 0.94); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow);
}
.attr-name { font: 700 22px var(--font-title); }
.attr-current { font-size: 14px; color: var(--ink-soft); text-align: center; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg button {
  font: 700 18px var(--font-ui); width: 46px; padding: 4px 0;
  background: var(--paper); border: 0; border-right: 1px solid var(--line); cursor: pointer; color: var(--ink);
}
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: var(--paper); }
@media (max-width: 600px) { .attr-row { grid-template-columns: 1fr; } }

.tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid var(--line-strong); margin-bottom: 12px; }
.tab {
  display: flex; align-items: center; gap: 6px;
  font: inherit; padding: 8px 14px; margin-bottom: -2px;
  background: rgba(247, 238, 219, 0.6); color: var(--ink-soft);
  border: 1px solid var(--line); border-bottom: 2px solid var(--line-strong);
  border-radius: var(--radius) var(--radius) 0 0; cursor: pointer;
}
.tab.active { background: var(--paper); color: var(--ink); border-color: var(--line-strong); border-bottom-color: var(--paper); font-weight: 700; }
.tab .count { font-size: 13px; padding: 0 7px; border-radius: 999px; background: var(--paper-3); }
.tab .count.done { background: #cfe0c4; color: var(--ok); }
.tab .count.over { background: #f6d7cf; color: var(--err); }
.tabs .search { margin-left: auto; min-width: 220px; margin-bottom: 4px; }

.ability-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.ability {
  display: flex; flex-direction: column; gap: 6px;
  background: rgba(247, 238, 219, 0.95); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow); font-size: 15.5px;
}
.ability header { display: flex; align-items: center; gap: 8px; }
.ability h4 { margin: 0; font: 700 20px/1.2 var(--font-title); flex: 1; }
.ability.selectable { cursor: pointer; transition: transform 0.12s, box-shadow 0.12s; }
.ability.selectable:hover { transform: translateY(-2px); }
.ability.selectable.unavailable { cursor: not-allowed; }
.ability.selectable.unavailable:hover { transform: none; }
.check-box {
  position: relative; flex: none; width: 18px; height: 18px;
  border: 2px solid var(--ink-soft); border-radius: 3px; background: #fffaf0;
}
.ability.selected .check-box { border-color: var(--ok); background: var(--ok); }
.ability.selected .check-box::after {
  content: ''; position: absolute; left: 4px; top: 0; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.stepper { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.ability .badges { display: flex; gap: 4px; flex-wrap: wrap; }
.ability-desc { flex: 1; }
.ability-items { font-size: 14px; color: var(--ink-soft); font-style: italic; }

.ability.selected { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(63, 106, 52, 0.55), var(--shadow); background: #f6f4df; }
.ability.unavailable { opacity: 0.6; }
.ability.invalid { border-color: var(--err); box-shadow: 0 0 0 2px rgba(163, 39, 27, 0.5), var(--shadow); }

/* awans */
.attr-pick { font: inherit; color: var(--ink); cursor: pointer; transition: transform 0.12s, box-shadow 0.12s; }
.attr-pick:hover { transform: translateY(-2px); }
.attr-pick.on { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(63, 106, 52, 0.6), var(--shadow); background: #f6f4df; }
.attr-change { font-size: 18px; }
.levelup-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.levelup-head .section-title { margin-bottom: 0; }
.levelup-head .search { min-width: 240px; }
.levelup-actions {
  position: sticky; bottom: 12px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 20px;
}
.levelup-summary { font-size: 17px; }
.levelup-history { margin: 0 0 10px; padding-left: 24px; }
.check-box.radio { border-radius: 50%; }
.ability.selected .check-box.radio::after { left: 3px; top: 3px; width: 8px; height: 8px; border: 0; border-radius: 50%; background: #fff; transform: none; }
.summary-level { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.summary-level .summary-sub { margin-bottom: 0; }
.levelup-btn { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 700; white-space: nowrap; }
.levelup-btn:hover:not(:disabled) { background: #33572a; }

/* ------------------------------------------------------------ krok 3 */

.spell-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 12px; }
.spell-card {
  display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px;
  background: rgba(247, 238, 219, 0.95); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow); font-size: 15px;
}
.spell-card h4 { margin: 0; font: 700 20px var(--font-title); }
.spell-card .meta { font-size: 13px; font-style: italic; color: var(--ink-soft); margin-bottom: 4px; }
.spell-card .meta-list { margin-top: 6px; font-size: 14px; border-top: 1px dashed var(--line); padding-top: 4px; }
.spell-card .meta-list .tp-par { display: inline; }
.spell-card.selectable { cursor: pointer; }
.spell-card.selected { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(63, 106, 52, 0.55), var(--shadow); background: #f6f4df; }
.spell-card.unavailable { opacity: 0.55; }
.recipe-row { padding: 3px 0; border-bottom: 1px dotted var(--line); }
.recipe-row .tp-par { display: inline; }
.recipe-row.with-art { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: center; padding: 4px 0; }
.recipe-art { width: 52px; min-height: 52px; }

.framed { position: relative; display: inline-block; flex: none; }
.framed img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

/* ------------------------------------------------------------ krok 4 */

.plain-list { margin: 0 0 8px; padding-left: 20px; }
.choice { margin: 8px 0; }
.choice-label { font-weight: 700; margin-bottom: 4px; }
.choice-selects { display: flex; gap: 6px; flex-wrap: wrap; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.pick {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font: inherit; font-size: 14px; padding: 8px 4px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.pick:hover { background: var(--paper-2); }
.pick.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: #fbf3e2; font-weight: 700; }

.budget { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.budget-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); }
.budget-chip.done { background: #e3ecd8; }
.budget-chip.over { background: #f6d7cf; color: var(--err); }

.shop { width: 100%; border-collapse: collapse; }
.shop td { padding: 5px 8px; border-bottom: 1px dotted var(--line); }
.shop tr.bought { background: rgba(63, 106, 52, 0.08); }
.shop-cost { white-space: nowrap; width: 1%; }
.shop-qty { white-space: nowrap; width: 1%; text-align: right; }
.cost-icons { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.cost-icons .sys-icon { height: 1.3em; }
.purchase-detail { margin-top: 8px; padding: 8px 10px; background: var(--paper-2); border-radius: var(--radius); }
.ability-gear { padding: 4px 0; border-bottom: 1px dotted var(--line); }

.inventory { width: 100%; border-collapse: collapse; }
.inventory td { padding: 4px 8px; border-bottom: 1px dotted var(--line); vertical-align: middle; }
.inv-img { width: 52px; }
.inv-qty { white-space: nowrap; text-align: right; }
.inv-src { max-width: 280px; }
.add-item { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.add-item input[list] { flex: 1; min-width: 220px; }
.add-item input[type=number] { width: 80px; }
.gold-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.gold-label { font-size: 19px; }
.gold-buttons { display: flex; gap: 4px; margin-left: auto; }

@media (max-width: 700px) {
  .inv-src { display: none; }
  .tabs .search { margin-left: 0; width: 100%; }
}

/* dymek z opisem przedmiotu (Tippy.js) */
.tippy-box[data-theme~='parchment'] {
  background: #fbf4e4; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(40, 25, 10, 0.35);
  font: 15px/1.4 var(--font-ui);
}
.tippy-box[data-theme~='parchment'] > .tippy-content { padding: 10px 12px; }
.tippy-box[data-theme~='parchment'] > .tippy-arrow { color: #fbf4e4; }
.item-tip { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; align-items: start; }
.tip-art { position: relative; width: 84px; height: 84px; }
.tip-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.tip-name { font: 700 19px/1.2 var(--font-title); }
.tip-meta { font-size: 13px; font-style: italic; color: var(--ink-soft); margin: 2px 0 6px; }
.tip-price { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.tip-desc .tp-table { font-size: 13px; }

/* pojęcia w opisach (statusy, dolegliwości, przywołańcy) - najechanie pokazuje dymek */
.term { border-bottom: 1px dotted currentColor; cursor: help; }
.term-tip { display: flex; gap: 10px; align-items: flex-start; }
.term-tip .tip-name { display: flex; align-items: center; gap: 6px; }
.term-tip .tip-desc .tp-par { display: block; }
.tip-monster { width: 90px; height: 100px; object-fit: contain; flex: none; }
.tip-stats { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.tip-stat { display: inline-flex; align-items: center; gap: 2px; padding: 0 5px; border: 1px solid var(--line-strong); border-radius: 5px; font-size: 13px; font-weight: 700; }

/* ------------------------------------------------------------ podsumowanie */

.summary-head { display: flex; align-items: center; gap: 10px; }
.summary-name { font: 700 26px/1.2 var(--font-title); }
.summary-sub { color: var(--ink-soft); margin-bottom: 10px; }
.summary-attrs { display: flex; justify-content: space-around; padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary-attr { display: flex; align-items: center; gap: 6px; font-size: 22px; }
.summary-stats { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 10px 0; }
.summary-stat { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 6px; font-size: 15px; cursor: help; }
.summary-issues { display: flex; flex-direction: column; gap: 4px; }
.issue {
  text-align: left; font: inherit; font-size: 14px; line-height: 1.35;
  padding: 5px 8px; border-radius: 4px; border: 1px solid transparent; cursor: pointer;
}
.issue.error { background: #f6d7cf; color: #7b1d13; border-color: #e0a99c; }
.issue.warning { background: #f4e3bd; color: #6d4700; border-color: #e1c27c; }
.issue.ok { background: #e3ecd8; color: var(--ok); cursor: default; }
.system-warnings { margin-top: 10px; font-size: 13px; color: var(--ink-soft); }
.system-warnings ul { padding-left: 18px; margin: 4px 0; }

/* ------------------------------------------------------------ krok 5 */

.sheet-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sheet-options { display: flex; gap: 18px; flex-wrap: wrap; }
.sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.warn-box { background: #f4e3bd; color: #6d4700; }
.sheet-preview { overflow: hidden; }
.sheet-scale { transform-origin: top left; }


.loading, .load-error { max-width: 760px; margin: 40px auto; }

/* ------------------------------------------------------------ ekran startowy */

.home { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 48px 20px 32px; text-align: center; }
.home-title { font: 700 56px/1.15 var(--font-title); margin: 0 0 8px; }
.home-sub { font-size: 19px; color: var(--ink-soft); margin: 0 0 36px; }
.home-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 24px; }
.home-tile {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 40px 24px 34px;
  font: inherit; color: var(--ink);
  background: rgba(247, 238, 219, 0.95);
  border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.home-tile:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.home-tile img { width: 96px; height: 96px; opacity: 0.85; }
.home-tile-title { font: 700 34px/1.2 var(--font-title); text-transform: uppercase; letter-spacing: 0.04em; }
.home-tile-sub { color: var(--ink-soft); }
.home-continue { margin-top: 28px; font-size: 17px; padding: 10px 18px; }
.load-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.load-head .section-title { margin: 0; }
.saved-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; text-align: left; }
.saved-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px; cursor: pointer;
  background: rgba(247, 238, 219, 0.95); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: transform 0.12s, box-shadow 0.12s;
}
.saved-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.saved-card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.saved-card header h3 { flex: 1; }
.saved-card h3 { margin: 0; font: 700 22px/1.2 var(--font-title); }
.saved-card .badge { white-space: nowrap; }
.saved-sub { color: var(--ink-soft); font-size: 15px; }
.saved-attrs { display: flex; gap: 14px; font-weight: 700; }
.saved-card footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--line); }
.saved-note { margin-top: 8px; font-size: 13px; color: var(--ok); }
.busy-overlay { position: fixed; inset: 0; background: rgba(30, 20, 10, 0.55); display: grid; place-items: center; z-index: 50; }
.busy-overlay .card { font-size: 20px; }
