@font-face { font-family: Manrope; src: url("/static/fonts/Manrope.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }

:root {
  --bg: #F4EEE7;
  --bg-edge: #E5EAE2;
  --surface: #FFFCF8;
  --card: #FFFFFF;
  --side: #F8F2EB;
  --ink: #25221F;
  --muted: #625953;
  --line: #DED2C7;
  --line-strong: #8E7768;
  --accent: #963F2A;
  --accent-dark: #793524;
  --accent-soft: #F5E4DB;
  --ok: #395744;
  --ok-ink: #395744;
  --ok-bg: #E4EBE1;
  --warn: #7A4A12;
  --warn-bg: #F8ECD9;
  --err: #A32222;
  --err-bg: #FBE9E6;
  --r: 16px;
  --r-s: 10px;
  --shadow: 0 1px 2px rgba(37, 34, 31, .05), 0 6px 18px rgba(37, 34, 31, .05);
  --sans: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; color: var(--ink); font: 16px/1.5 var(--sans);
  background-color: var(--bg);
  background-image: radial-gradient(55% 55% at 10% 6%, rgba(150, 63, 42, .20), transparent 70%), radial-gradient(50% 60% at 94% 16%, rgba(198, 214, 196, .95), transparent 70%),
    radial-gradient(60% 55% at 84% 100%, rgba(150, 63, 42, .16), transparent 70%), radial-gradient(55% 60% at 4% 96%, rgba(198, 214, 196, .9), transparent 70%), linear-gradient(160deg, var(--bg), var(--bg-edge));
  background-attachment: fixed; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--line-strong); outline-offset: 2px; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .875rem; margin-top: 4px; }
.strong { font-weight: 700; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: var(--r-s); z-index: 50; }
.skip:focus { left: 8px; }

/* przyciski */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--card); font-weight: 700; font-size: .9375rem; cursor: pointer; transition: background .15s, border-color .15s; }
.btn:hover:not(:disabled) { border-color: var(--line-strong); color: var(--accent-dark); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--accent-soft); border-color: transparent; }
.btn.small { padding: 0 14px; font-size: .875rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 12px 0; min-height: 44px; color: var(--accent-dark); text-decoration: underline; cursor: pointer; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.actions.wrap { flex-wrap: wrap; margin-top: 12px; }
.toggle { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); background: var(--card); border-radius: var(--r-s); font-weight: 700; font-size: .875rem; cursor: pointer; }
.toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); box-shadow: inset 0 -3px 0 var(--accent); }
.toggle:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--r-s); background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--accent-soft); color: var(--accent-dark); }

/* pola */
.field { margin-top: 18px; }
.field:first-child { margin-top: 0; }
.lbl { display: block; font-weight: 700; font-size: .875rem; margin-bottom: 6px; }
input[type="text"], input[type="password"], select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r-s); }
textarea { resize: vertical; line-height: 1.55; }
::placeholder { color: var(--muted); opacity: .85; }
.form-msg { color: var(--err); font-size: .875rem; font-weight: 600; margin-top: 12px; min-height: 0; }
.form-msg:empty { display: none; }
.segs { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-weight: 600; font-size: .875rem; cursor: pointer; }
.seg input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); font-weight: 800; }
.seg input:checked + span::before { content: "\2713"; margin-right: 6px; }
.seg input:focus-visible + span { outline: 3px solid var(--line-strong); outline-offset: 2px; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 16px; }
.opts .field { margin-top: 14px; }
.sett { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); }
.sett summary { display: flex; align-items: center; min-height: 44px; padding: 0 14px; font-weight: 700; font-size: .875rem; cursor: pointer; border-radius: var(--r-s); }
.sett[open] summary { border-bottom: 1px solid var(--line); border-radius: var(--r-s) var(--r-s) 0 0; }
.sett-b { padding: 4px 14px 16px; }

/* obudowa */
.app { flex: 1; min-height: 0; margin: 24px 32px; display: grid; grid-template-columns: 248px minmax(0, 1fr); background: rgba(255, 252, 248, .74); -webkit-backdrop-filter: blur(28px) saturate(1.25); backdrop-filter: blur(28px) saturate(1.25); border: 1px solid rgba(255, 255, 255, .95); border-radius: 22px; box-shadow: 0 0 0 1px rgba(222, 210, 199, .75), 0 30px 80px rgba(121, 53, 36, .16), 0 4px 14px rgba(37, 34, 31, .05); overflow: hidden; }
.side { display: flex; flex-direction: column; padding: 20px; background: rgba(248, 242, 235, .72); border-right: 1px solid var(--line); min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.125rem; }
.brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--accent-soft); border: 1px solid var(--line); }
.new-btn { width: 100%; margin-top: 16px; border-radius: 12px; box-shadow: 0 8px 18px rgba(150, 63, 42, .28); }
.side nav { margin-top: 16px; }
.area { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-s); background: none; font-weight: 700; font-size: .875rem; text-align: left; cursor: pointer; }
.area[aria-current] { background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; }
.side-h { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 0 4px 6px; }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; margin: 20px -8px 12px; padding: 0 8px; }
.pad { padding: 4px; font-size: .875rem; }
.sk { display: block; width: 100%; text-align: left; min-height: 44px; padding: 6px 10px; border: 0; border-radius: var(--r-s); background: none; cursor: pointer; }
.sk:hover { background: var(--card); }
.sk[aria-current] { background: var(--card); }
.sk[aria-current] .sk-t { font-weight: 800; }
.sk-t { display: block; font-weight: 600; font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-m { display: block; font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-align: left; cursor: pointer; }
.user-card:hover { border-color: var(--line-strong); }
.user-i { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--ok-bg); color: var(--ok-ink); font-weight: 800; text-transform: uppercase; }
.user-b { flex: 1; min-width: 0; display: grid; }
.user { font-weight: 700; font-size: .875rem; text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-s { font-size: .75rem; color: var(--muted); }
.user-a { color: var(--muted); font-size: 1.25rem; line-height: 1; }
.foot-btn { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; min-height: 48px; padding: 0 12px; border: 0; border-radius: var(--r-s); background: none; font-weight: 600; cursor: pointer; }
.foot-btn:hover { background: var(--accent-soft); }
.set-list { display: grid; gap: 2px; margin: 4px -12px -8px; }
.count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--ok-bg); color: var(--ok-ink); font-size: .8rem; text-align: center; }
.count:empty { display: none; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line-strong); }
.dot-ok { background: var(--ok); border-color: var(--ok); }
.dot-warn { background: transparent; border-color: var(--accent); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: radial-gradient(48% 38% at 50% 22%, rgba(245, 228, 219, .85), rgba(245, 228, 219, 0) 72%); }
.ctx { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 16px 8px 24px; border-bottom: 1px solid var(--line); }
.crumbs { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; font-size: .9375rem; font-weight: 600; white-space: nowrap; }
.crumb-root, .crumb-sep { color: var(--muted); }
.crumb-cur { font-weight: 800; }
.crumb-doc { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.crumb-doc::before { content: "/"; margin-right: 8px; }
.ctx-state { display: flex; align-items: center; gap: 8px; font-size: .875rem; }
.status { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; border: 0; border-radius: var(--r-s); background: none; color: var(--muted); font-weight: 600; cursor: pointer; }
.status:hover { background: var(--accent-soft); color: var(--accent-dark); }
.menu-btn { display: none; }
.pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; font-weight: 700; font-size: .8125rem; white-space: nowrap; }
.pill-ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill-warn { background: var(--accent-soft); color: var(--accent-dark); border: 1px solid var(--accent); }
.bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 24px; font-size: .9rem; font-weight: 600; }
.bar-err { background: var(--err-bg); color: var(--err); }
.bar-warn { background: var(--warn-bg); color: var(--warn); justify-content: center; }
.bar-info { background: var(--warn-bg); color: var(--warn); }
.bar-ok { background: var(--ok-bg); color: var(--ok-ink); }
.bar span { flex: 1; min-width: 200px; }
#offline { flex: none; }
.tabs { display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.tab { flex: none; min-height: 48px; padding: 0 16px; border: 0; border-radius: var(--r-s) var(--r-s) 0 0; background: none; font-weight: 600; font-size: .875rem; color: var(--muted); cursor: pointer; }
.tab:hover { color: var(--ink); background: var(--side); }
.tab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; box-shadow: inset 0 -3px 0 var(--accent); }
.tab:focus-visible { outline-offset: -3px; }
.content { flex: 1; min-height: 0; overflow-y: auto; }

/* ekran startowy */
.welcome { max-width: 928px; margin: 0 auto; padding: 18px 24px 28px; text-align: center; }
.welcome-av { position: relative; display: inline-block; }
.welcome-av::before { content: ""; position: absolute; inset: -22px -130px -16px; border-radius: 50%; background: radial-gradient(closest-side, rgba(150, 63, 42, .36), rgba(235, 190, 168, .42) 45%, rgba(245, 228, 219, 0)); }
.welcome-img { position: relative; display: block; height: 132px; width: auto; object-fit: contain; }
.welcome-h { font-size: 2.125rem; line-height: 1.18; letter-spacing: -.01em; margin-top: 10px; font-weight: 800; }
.welcome-h em { font-style: normal; color: var(--accent); }
.welcome-h span, .welcome-h strong { display: block; }
.welcome-h strong { font-weight: 800; }
.welcome > .muted { margin-top: 6px; font-size: .9375rem; }
.cmd { display: flex; flex-direction: column; min-height: 148px; margin-top: 18px; padding: 16px 18px 12px; text-align: left; background: var(--card); border: 1px solid rgba(255, 255, 255, .95); border-radius: 18px; box-shadow: 0 0 0 1px var(--line), 0 20px 50px rgba(150, 63, 42, .17), 0 2px 6px rgba(37, 34, 31, .05); }
.cmd:focus-within { box-shadow: 0 0 0 3px var(--line-strong), 0 20px 50px rgba(150, 63, 42, .17); }
.cmd textarea { flex: 1; min-height: 52px; padding: 2px 0 8px; border: 0; border-radius: 0; resize: none; outline: none; }
.cmd-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line); }
.cmd-l { font-size: .875rem; font-weight: 600; color: var(--muted); }
.cmd-sel { width: auto; padding: 0 12px; border-color: var(--line); border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; font-size: .875rem; }
.cmd-bar .btn { margin-left: auto; border-radius: 999px; padding: 0 22px; box-shadow: 0 8px 18px rgba(150, 63, 42, .28); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.tile { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 9px 16px; background: rgba(255, 255, 255, .86); border: 1px solid rgba(222, 210, 199, .8); border-radius: var(--r); box-shadow: 0 8px 24px rgba(121, 53, 36, .07); text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile:last-child { grid-column: 1 / -1; }
.tile:hover { border-color: var(--line-strong); box-shadow: 0 12px 30px rgba(121, 53, 36, .13); transform: translateY(-1px); }
.tile svg { flex: none; width: 44px; height: 44px; padding: 10px; border-radius: 14px; background: linear-gradient(140deg, #F9ECE5, #EDCDBE); color: var(--accent-dark); }
.tile-sage svg { background: linear-gradient(140deg, #EDF2EA, #CFDCCB); color: var(--ok-ink); }
.tile-b { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tile-t { font-weight: 800; line-height: 1.35; }
.tile-d { font-size: .875rem; line-height: 1.35; color: var(--muted); }
.tile-a { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--accent-dark); }

/* praca */
.work { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 880px; margin: 0 auto; padding: 24px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; }
.out { display: grid; gap: 14px; min-width: 0; }
.out > div:empty { display: none; }
.out-h { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.in-h { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 14px; }
.empty { padding: 28px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--muted); text-align: center; }
.h { font-size: 1.0625rem; font-weight: 800; }
.h3 { font-size: .9375rem; font-weight: 800; }
.h4 { font-size: .8125rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.res-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.toggles { display: flex; gap: 6px; }
.sec { margin-top: 18px; }
.list { list-style: disc; padding-left: 20px; margin-top: 6px; }
.list li { margin-top: 4px; }
.note-ok { color: var(--ok-ink); background: var(--ok-bg); border-radius: var(--r-s); padding: 8px 12px; font-weight: 700; font-size: .875rem; }
.note-ok::before { content: "\2713\00a0"; }
.note-ok:empty { display: none; }
.calm { background: var(--ok-bg); border-color: transparent; color: var(--ok-ink); }

.progress { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.progress-img { height: 120px; width: auto; }
.steps { display: grid; gap: 8px; counter-reset: s; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); font-size: .8rem; font-weight: 700; }
.steps li.done { color: var(--ok-ink); }
.steps li.done::before { content: "\2713"; background: var(--ok-bg); border-color: var(--ok); }
.steps li.now { color: var(--ink); font-weight: 700; }
.steps li.now::before { background: var(--accent); border-color: var(--accent); color: #fff; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--accent-soft); } }
.qs { list-style: disc; padding-left: 20px; margin: 10px 0; }

.editor { min-height: 280px; }
.diff, .orig-text { padding: 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.diff del { background: var(--err-bg); color: var(--err); text-decoration: line-through; }
.diff ins { background: var(--ok-bg); color: var(--ok-ink); text-decoration: underline; text-decoration-thickness: 2px; }
.orig { margin-top: 12px; }
.res .actions .btn.ghost { border-color: var(--line); background: var(--card); }

.ctrl { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.stat { margin-top: 4px; color: var(--muted); font-size: .875rem; min-height: 1.4em; }
.stat-ok { color: var(--ok-ink); font-weight: 700; }
.stat-err { color: var(--err); font-weight: 700; }
.items li { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-s); background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; }
.items li p { margin-top: 4px; }
.block .h4 { color: var(--accent-dark); }
.block .h4::before { content: "! "; font-weight: 800; }
.block .items li { background: var(--accent-soft); border: 1px solid var(--accent); }
.block .items .btn { margin-top: 8px; }
.frag { background: var(--warn-bg); padding: 0 4px; border-radius: 4px; font-weight: 600; quotes: "\201E" "\201D"; }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.sug summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.ready { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.done-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.feedback { margin-top: 10px; }
.fb-form { margin-top: 10px; }
.lesson { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--card); }
.lesson-t { font-weight: 600; }

/* korekta */
.props-list { margin-top: 12px; display: grid; gap: 12px; }
.prop { padding: 14px; border: 1px solid var(--line); border-radius: var(--r-s); overflow-wrap: anywhere; }
.prop[data-stan="tak"] { border-color: var(--ok); background: var(--ok-bg); }
.prop[data-stan="nie"] { opacity: .75; }
.ctx-line { line-height: 1.55; }
mark { background: var(--err-bg); color: var(--err); border-radius: 3px; padding: 0 2px; text-decoration: underline wavy; text-underline-offset: 3px; }
.fix { margin-top: 6px; }
.fix strong { background: var(--ok-bg); color: var(--ok-ink); padding: 0 4px; border-radius: 4px; }
.fix.manual { color: var(--warn); font-weight: 700; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag { padding: 2px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .78rem; font-weight: 600; color: var(--muted); }
.tag-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.tag-ok { background: var(--ok-bg); color: var(--ok-ink); border-color: transparent; }
.prop .actions { margin-top: 10px; }

/* dialogi i szuflada */
.drawer { margin: 0 0 0 auto; height: 100vh; height: 100dvh; max-height: none; width: min(480px, 100vw); border: 0; padding: 0; background: var(--surface); color: var(--ink); box-shadow: -8px 0 30px rgba(37, 34, 31, .15); }
.drawer::backdrop { background: rgba(37, 34, 31, .35); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: var(--side); border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.dlg-head h2 { font-size: 1.1rem; }
.dlg-body { padding: 8px 20px 24px; }
.modal { width: min(400px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 18px; padding: 24px; background: var(--card); color: var(--ink); box-shadow: 0 18px 48px rgba(37, 34, 31, .18); }
.modal::backdrop { background: rgba(37, 34, 31, .35); }
.modal h2 { font-size: 1.2rem; }
.modal form h2 { margin-bottom: 16px; }
.actions.end { justify-content: flex-end; flex-wrap: wrap; }
.lacz { display: grid; gap: 8px; justify-items: start; margin-top: 6px; width: 100%; }
.lacz a.btn { text-decoration: none; color: inherit; }
.lacz-form { width: 100%; }
.lacz-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; width: 100%; }
.lacz-row input { flex: 1; min-width: 160px; width: auto; }
.kod { font: 700 1.4rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; user-select: all; }
.conns li { margin-top: 14px; display: grid; gap: 4px; justify-items: start; }

/* logowanie */
.login { flex: 1; min-height: 0; overflow-y: auto; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 18px 48px rgba(37, 34, 31, .09); padding: 28px 24px; text-align: center; }
.login-card .field { text-align: left; }
.login-card .btn { width: 100%; margin-top: 18px; }
.login-img { height: 150px; width: auto; }
.login-card h1 { font-size: 1.5rem; font-weight: 800; }

.scrim { position: fixed; inset: 0; background: rgba(37, 34, 31, .35); z-index: 40; }

/* szkło: półprzezroczyste powierzchnie na kolorowym tle; pola tekstowe zostają prawie pełne dla czytelności */
body { background-image: radial-gradient(42% 48% at 8% 4%, rgba(150, 63, 42, .46), transparent 72%), radial-gradient(40% 52% at 96% 12%, rgba(150, 184, 150, .85), transparent 72%),
  radial-gradient(36% 40% at 58% 46%, rgba(240, 178, 140, .55), transparent 75%), radial-gradient(46% 50% at 88% 100%, rgba(150, 63, 42, .38), transparent 72%),
  radial-gradient(44% 52% at 2% 98%, rgba(150, 184, 150, .8), transparent 72%), linear-gradient(160deg, var(--bg), var(--bg-edge)); }
.app { background: linear-gradient(135deg, rgba(255, 255, 255, .56), rgba(255, 250, 245, .34)); -webkit-backdrop-filter: blur(40px) saturate(1.6); backdrop-filter: blur(40px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, .85); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 0 0 1px rgba(142, 119, 104, .16), 0 34px 90px rgba(121, 53, 36, .24), 0 4px 14px rgba(37, 34, 31, .06); }
.side { background: rgba(255, 255, 255, .26); border-right: 1px solid rgba(255, 255, 255, .75); }
.main { background: radial-gradient(46% 36% at 50% 22%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 72%); }
.ctx, .tabs, .cmd-bar { border-color: rgba(142, 119, 104, .22); }
.card, .tile, .cmd, .user-card, .empty, .sett, .lesson, .login-card { background: rgba(255, 255, 255, .56); border: 1px solid rgba(255, 255, 255, .85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 0 0 1px rgba(142, 119, 104, .12), 0 12px 32px rgba(121, 53, 36, .11); }
.cmd { background: rgba(255, 255, 255, .7); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(142, 119, 104, .14), 0 22px 56px rgba(150, 63, 42, .2); }
.cmd:focus-within { box-shadow: inset 0 1px 0 #fff, 0 0 0 3px var(--line-strong), 0 22px 56px rgba(150, 63, 42, .2); }
.cmd textarea { background: transparent; }
.empty { border-style: dashed; border-color: rgba(142, 119, 104, .5); box-shadow: none; background: rgba(255, 255, 255, .3); }
.login-card, .modal, .drawer { -webkit-backdrop-filter: blur(30px) saturate(1.5); backdrop-filter: blur(30px) saturate(1.5); }
.modal, .drawer { background: rgba(255, 252, 248, .78); }
.dlg-head { background: rgba(255, 255, 255, .5); }
.btn:not(.primary):not(.ghost), .toggle, .seg span, .tile-a, .sk:hover, .sk[aria-current] { background-color: rgba(255, 255, 255, .7); }
.toggle[aria-pressed="true"], .seg input:checked + span { background-color: var(--accent-soft); }
input[type="text"], input[type="password"], select, textarea { background-color: rgba(255, 255, 255, .88); }
.cmd-sel { background-color: rgba(245, 228, 219, .85); }
.diff, .orig-text, .items li { background: rgba(255, 255, 255, .6); }
.block .items li { background: var(--accent-soft); }

@media (min-width: 1120px) {
  .work { grid-template-columns: minmax(0, 52fr) minmax(0, 48fr); max-width: 1280px; }
}

@media (max-width: 899px) {
  .app { margin: 0; border: 0; border-radius: 0; box-shadow: none; grid-template-columns: minmax(0, 1fr); }
  .side { background: rgba(255, 250, 246, .84); -webkit-backdrop-filter: blur(30px) saturate(1.5); backdrop-filter: blur(30px) saturate(1.5); position: fixed; z-index: 45; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-100%); visibility: hidden; transition: transform .2s, visibility .2s; }
  .side.open { transform: none; visibility: visible; }
  .menu-btn { display: inline-flex; padding: 0 12px; border-color: var(--line); background: var(--card); }
  .ctx { padding: 6px 8px 6px 16px; gap: 8px; }
  .crumb-root, .crumb-sep, #btn-ust2 { display: none; }
  .ctx-state { flex-direction: column-reverse; align-items: flex-end; gap: 0; }
  .status { padding: 0 8px; }
  .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 0 8px; }
  .tab { min-height: 52px; padding: 6px 4px; font-size: .8125rem; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; }
  .bar { padding: 10px 16px; }
  .work { padding: 16px; }
  .welcome { padding: 14px 16px 28px; }
  .welcome-img { height: 96px; }
  .welcome-av::before { inset: -10px -50px -4px; }
  .welcome-h { font-size: 1.625rem; margin-top: 6px; }
  .cmd { margin-top: 14px; padding: 14px 14px 12px; }
  .cmd-sel { flex: 1; min-width: 0; }
  .cmd-bar .btn { width: 100%; }
  .tiles { grid-template-columns: 1fr; }
  .tile:last-child { grid-column: auto; }
  .card { padding: 16px; }
  .actions { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Okienko „Modyfikacje Moniki” w menu: szybkie zgłoszenie błędu albo poprawki */
.mod-box { margin: 12px 0; }
.mod-box textarea { width: 100%; min-height: 72px; resize: vertical; font-size: .9rem; }
.mod-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.mod-box .hint { margin-top: 6px; min-height: 1.2em; }

/* Szkice i „Nowy szkic” są odnośnikami (otwieranie w nowej karcie): wyglądają jak dotąd */
a.sk, a.new-btn { color: inherit; text-decoration: none; }
a.new-btn { color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
/* Poprawka zaznaczonego fragmentu */
.frag-box { margin-top: 10px; }
.frag-form { margin-top: 8px; }

/* Słownik synonimów: pływające okienko bez tła, praca obok trwa dalej */
.syn-open { width: 100%; margin: 12px 0 0; }
.syn { position: fixed; inset: auto 24px 24px auto; margin: 0; z-index: 40; width: min(360px, calc(100vw - 32px)); max-height: min(560px, calc(100dvh - 48px));
  display: none; flex-direction: column; padding: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; color: var(--ink);
  background: rgba(255, 252, 248, .9); -webkit-backdrop-filter: blur(30px) saturate(1.5); backdrop-filter: blur(30px) saturate(1.5);
  box-shadow: 0 18px 48px rgba(37, 34, 31, .22); }
.syn[open] { display: flex; }
.syn-form { display: flex; gap: 8px; padding: 12px 16px 8px; }
.syn-form input { flex: 1; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: rgba(255, 255, 255, .88); }
.syn-wynik { overflow-y: auto; padding: 4px 16px 16px; }
.syn-gr { margin-top: 10px; }
.syn-lista { display: flex; flex-wrap: wrap; gap: 6px; }
.syn-slowo { border: 1px solid var(--line); background: rgba(255, 255, 255, .8); border-radius: 999px; padding: 6px 12px; min-height: 32px; font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; }
.syn-slowo:hover, .syn-slowo:focus-visible { border-color: var(--accent); color: var(--accent-dark); }
.syn-slowo.ok { background: var(--accent-soft); border-color: var(--accent); }
.syn-slowo.podobne { border-style: dashed; }
.syn-wynik .hint { margin-top: 10px; }
@media (max-width: 599px) { .syn { inset: auto 16px 16px 16px; width: auto; } }
.syn-monika { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.syn-monika .syn-lista { margin-top: 4px; }
