/* Poczta NexoraHost.pl: ten sam język wizualny co nexorahost.pl (tło #08090a, cienkie linie, jedna limonka, Inter) */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(assets/font/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(assets/font/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root, :root[data-theme="dark"] {
  --tlo: #08090a; --panel: #0f1011; --panel2: #161718; --obrys: #23252a; --obrys2: #383b3f;
  --papier: #fff; --jasny: #d0d6e0; --mgla: #8a8f98; --mgla2: #62666d;
  --akcent: #dcf23a; --akcent-jasny: #e8f86e; --akcent-ciemny: #b9cf1f; --na-akcent: #08090a;
  --akcent-tlo: #121407; --akcent-obrys: #3a4316; --akcent-ikona: #dcf23a;
  --blad: #eb5757; --online: #3fb950;
  --zaznaczone: #14170a; --hover: #131415; --cien: 0 14px 40px rgba(0,0,0,.55);
  --av-s: 28%; --av-l: 24%; --av-t: 78%;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --tlo: #f2f3ef; --panel: #ffffff; --panel2: #f6f7f3; --obrys: #e3e5de; --obrys2: #cfd2c9;
  --papier: #0b0c0d; --jasny: #2b2e33; --mgla: #646a71; --mgla2: #8b9097;
  --akcent: #dcf23a; --akcent-jasny: #e5f760; --akcent-ciemny: #b9cf1f; --na-akcent: #0b0c0d;
  --akcent-tlo: #f1f8c4; --akcent-obrys: #d3e55a; --akcent-ikona: #66770a;
  --blad: #d63c3c; --online: #2a9d3d;
  --zaznaczone: #f6fad4; --hover: #f7f8f4; --cien: 0 14px 40px rgba(20,24,10,.16);
  --av-s: 45%; --av-l: 88%; --av-t: 26%;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body { margin: 0; height: 100%; background: var(--tlo); color: var(--jasny); font: 400 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv01', 'ss03'; -webkit-font-smoothing: antialiased; overflow: hidden; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--jasny); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--akcent); color: #08090a; }
.muted { color: var(--mgla); }
code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--panel2); border: 1px solid var(--obrys); padding: 1px 5px; border-radius: 4px; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--obrys2); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--mgla2); background-clip: content-box; border: 3px solid transparent; }

/* ---------- przyciski i pola ---------- */
.btn { height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--obrys2); background: var(--panel2); color: var(--papier); font-weight: 510; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--obrys); }
.btn-accent { background: var(--akcent); border-color: var(--akcent); color: var(--na-akcent); font-weight: 590; }
.btn-accent:hover { background: var(--akcent-jasny); border-color: var(--akcent-jasny); }
.btn-accent:active { background: var(--akcent-ciemny); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--mgla); }
.btn-ghost:hover { background: var(--obrys); color: var(--papier); }
.btn-block { width: 100%; height: 44px; }
.icon-btn { width: 40px; height: 40px; border-radius: 8px; display: inline-grid; place-items: center; color: var(--mgla); transition: background .12s, color .12s; flex: none; position: relative; }
.icon-btn:hover { background: var(--obrys); color: var(--papier); }
.icon-btn.sm { width: 32px; height: 32px; } .icon-btn.sm svg { width: 18px; height: 18px; }
.icon-btn[disabled] { opacity: .35; pointer-events: none; }
.field { display: block; margin-bottom: 14px; } .field > span { display: block; font-size: 13px; color: var(--mgla); margin-bottom: 6px; }
.field input { width: 100%; height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--obrys2); background: var(--tlo); font-size: 16px; color: var(--papier); }
.field input::placeholder { color: var(--mgla2); }
.field input:focus { outline: none; border-color: var(--akcent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--akcent) 22%, transparent); }

/* ---------- avatary i etykiety ---------- */
.av { width: 36px; height: 36px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; font-weight: 590; font-size: 14px;
  background: hsl(var(--h, 200) var(--av-s) var(--av-l)); color: hsl(var(--h, 200) 60% var(--av-t)); user-select: none; }
.av.me { background: var(--akcent); color: #08090a; }
.av.sys { background: #111113; border: 1px solid #2a2b2f; padding: 0; overflow: hidden; } .av.sys img { width: 100%; height: 100%; }
.av.sm { width: 28px; height: 28px; font-size: 12px; }
.chip-l { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 5px; border: 1px solid var(--obrys2); font-size: 11.5px; font-weight: 510; color: var(--jasny); white-space: nowrap; vertical-align: 1px; background: transparent; }
.chip-l::before, .dot { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--mgla)); flex: none; }
.dot { display: inline-block; }

/* ---------- logowanie ---------- */
.login { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 24px 16px; overflow: auto; background: var(--tlo); z-index: 50; }
:root[data-theme="dark"] .login::before, :root[data-theme="dark"] .login::after { content: ''; position: fixed; width: 80rem; height: 80rem; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255,255,255,.108), rgba(255,255,255,.105) 8.4%, rgba(255,255,255,.097) 17.2%, rgba(255,255,255,.082) 27%, rgba(255,255,255,.059) 38.5%, rgba(255,255,255,.032) 51.9%, rgba(255,255,255,.019) 61%, rgba(255,255,255,.009) 71.1%, rgba(255,255,255,.003) 81.2%, rgba(255,255,255,0)); }
:root[data-theme="dark"] .login::before { top: calc(4vh - 23rem); left: -45rem; } :root[data-theme="dark"] .login::after { right: -45rem; bottom: calc(2vh - 23rem); }
.login-box { position: relative; z-index: 1; margin-top: auto; width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--obrys); border-radius: 12px; padding: 32px 28px 24px; }
.login-mark { display: block; margin-bottom: 20px; }
.login h1 { margin: 0; font-size: 22px; font-weight: 590; color: var(--papier); letter-spacing: -.022em; }
.login-sub { margin: 4px 0 24px; color: var(--mgla); }
.login-err { color: var(--blad); margin: -4px 0 12px; font-size: 13px; }
.login-demo { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--obrys); color: var(--mgla); font-size: 13px; }
.login-demo p { margin: 0 0 12px; } .login-demo strong { color: var(--jasny); font-weight: 590; }
.login-demo-btns { display: flex; gap: 8px; } .login-demo-btns .btn { flex: 1; }
.login-foot { position: relative; z-index: 1; margin: 20px 0 auto; font-size: 12.5px; color: var(--mgla2); }

/* ---------- szkielet aplikacji ---------- */
.app { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 64px minmax(0, 1fr); height: 100%; height: 100dvh; }
.top { display: flex; align-items: center; gap: 8px; padding: 0 16px 0 8px; min-width: 0; position: relative; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; width: 240px; flex: none; padding-left: 8px; }
.brand-text { font-size: 17px; letter-spacing: -.02em; color: var(--mgla); font-weight: 400; white-space: nowrap; } .brand-text b { color: var(--papier); font-weight: 590; }
.search { position: relative; flex: 1; max-width: 720px; display: flex; align-items: center; }
.search input { width: 100%; height: 44px; border-radius: 10px; border: 1px solid var(--obrys); background: var(--panel); padding: 0 44px 0 44px; font-size: 15px; color: var(--papier); -webkit-appearance: none; appearance: none; }
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--mgla); }
.search input:focus { outline: none; border-color: var(--obrys2); background: var(--panel2); }
.search-ic { position: absolute; left: 13px; color: var(--mgla); pointer-events: none; }
.search-clear { position: absolute; right: 4px; }
.search-hint { position: absolute; top: 50px; left: 0; right: 0; background: var(--panel2); border: 1px solid var(--obrys2); border-radius: 10px; padding: 8px; box-shadow: var(--cien); z-index: 30; }
.search-hint p { margin: 4px 8px 6px; font-size: 12px; color: var(--mgla); }
.search-hint button { display: flex; width: 100%; justify-content: space-between; padding: 8px; border-radius: 6px; font-size: 13.5px; color: var(--papier); text-align: left; }
.search-hint button:hover { background: var(--obrys); } .search-hint button span { color: var(--mgla); }
.top-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.avatar-btn { border-radius: 50%; padding: 0; margin-left: 4px; } .avatar-btn .av { width: 34px; height: 34px; }
.avatar-btn:hover .av { box-shadow: 0 0 0 2px var(--obrys2); }

.shell { display: flex; min-height: 0; min-width: 0; position: relative; }
.side { width: 272px; flex: none; overflow-y: auto; padding: 4px 12px 16px 12px; transition: width .18s; }
.main { flex: 1; min-width: 0; display: flex; background: var(--panel); border: 1px solid var(--obrys); border-radius: 12px; margin: 0 12px 12px 0; overflow: hidden; }
.list-col { flex: 1; min-width: 0; display: flex; flex-direction: column; container: lista / inline-size; }
.view-col { flex: 1; min-width: 0; display: none; flex-direction: column; border-left: 1px solid var(--obrys); }
.main.open .list-col { display: none; } .main.open .view-col { display: flex; border-left: 0; }
@media (min-width: 1000px) {
  .main.split .list-col { flex: none; width: clamp(400px, 40%, 560px); border-right: 0; }
  .main.split .view-col { display: flex; border-left: 1px solid var(--obrys); }
  .main.split.open .list-col { display: flex; }
  .main.split .back { display: none; }
}
.scrim { display: none; }

/* ---------- pasek boczny ---------- */
.side-brand { display: none; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.compose-btn { width: 100%; height: 48px; border-radius: 10px; margin: 6px 0 14px; font-size: 15px; }
.acc-list { display: grid; gap: 6px; margin-bottom: 14px; }
.acc { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--obrys); text-align: left; min-width: 0; background: transparent; transition: border-color .12s, background .12s; }
.acc:hover { background: var(--hover); border-color: var(--obrys2); }
.acc.on { border-color: var(--akcent-obrys); background: var(--akcent-tlo); }
.acc-t { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.acc-t b { color: var(--papier); font-weight: 590; font-size: 14px; } .acc-t small { color: var(--mgla); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--akcent); color: #08090a; font-size: 12px; font-weight: 590; display: grid; place-items: center; }
.nav { display: grid; gap: 1px; }
.nav-i { display: flex; align-items: center; gap: 14px; height: 38px; padding: 0 12px; border-radius: 8px; color: var(--jasny); position: relative; min-width: 0; }
.nav-i:hover { background: var(--obrys); }
.nav-i span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-i em { font-style: normal; font-size: 12.5px; color: var(--mgla); font-variant-numeric: tabular-nums; }
.nav-i.on { background: var(--akcent-tlo); color: var(--papier); font-weight: 590; box-shadow: inset 0 0 0 1px var(--akcent-obrys); }
.nav-i.on svg { color: var(--akcent-ikona); } .nav-i.on em { color: var(--papier); }
.nav-i .dot { margin: 0 6.5px 0 6.5px; }
.nav-h { margin: 18px 12px 6px; font-size: 12.5px; color: var(--mgla2); font-weight: 510; }
.side-foot { margin: 22px 12px 0; font-size: 12px; color: var(--mgla2); line-height: 1.5; }
.app.min .side { width: 72px; padding: 4px 8px; } .app.min .side .nav-i { padding: 0; justify-content: center; } .app.min .side .nav-i span, .app.min .side .nav-i em, .app.min .side .acc-t, .app.min .side .badge, .app.min .side .nav-h, .app.min .side .side-foot, .app.min .compose-btn span { display: none; }
.app.min .side .acc { justify-content: center; padding: 6px 0; } .app.min .compose-btn { padding: 0; } .app.min .brand { width: auto; }

/* ---------- lista ---------- */
.list-head { display: flex; align-items: baseline; gap: 10px; padding: 14px 20px 4px; }
.list-head h1 { margin: 0; font-size: 18px; font-weight: 590; letter-spacing: -.02em; color: var(--papier); }
.list-bar { display: flex; align-items: center; gap: 2px; padding: 4px 12px; min-height: 48px; border-bottom: 1px solid var(--obrys); }
.list-bar .spacer, .view-head .spacer { flex: 1; }
.count { font-size: 12.5px; color: var(--mgla); padding: 0 8px; white-space: nowrap; }
.chips { display: flex; gap: 6px; padding: 10px 20px; overflow-x: auto; border-bottom: 1px solid var(--obrys); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--obrys); color: var(--mgla); white-space: nowrap; font-weight: 510; font-size: 13px; }
.chip:hover { color: var(--papier); border-color: var(--obrys2); }
.chip.on { background: var(--papier); color: var(--tlo); border-color: var(--papier); }
:root[data-theme="light"] .chip.on { background: var(--papier); color: #fff; }
.cb { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--mgla2); display: inline-grid; place-items: center; color: transparent; transition: background .1s; }
.cb svg { width: 14px; height: 14px; stroke-width: 3; }
.on > .cb, .cb.on { background: var(--akcent); border-color: var(--akcent); color: #08090a; }
.cb.part { background: var(--akcent); border-color: var(--akcent); color: #08090a; }
.rows { flex: 1; overflow-y: auto; }
.empty { display: grid; place-items: center; text-align: center; padding: 64px 24px; color: var(--mgla); gap: 6px; }
.empty svg { width: 36px; height: 36px; color: var(--mgla2); margin: 0 auto 8px; stroke-width: 1.4; }
.empty b { color: var(--jasny); font-weight: 590; font-size: 15px; }

.row { display: grid; align-items: center; grid-template-columns: 40px 36px 188px minmax(0, 1fr) auto 64px; column-gap: 4px; min-height: 48px; padding: 0 12px 0 8px; border-bottom: 1px solid var(--obrys); position: relative; cursor: pointer; color: var(--mgla); }
.row:hover { background: var(--hover); }
.row.unread { color: var(--papier); }
.row.unread::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--akcent); }
.row.sel { background: var(--zaznaczone); } .row.cur { background: var(--panel2); box-shadow: inset 2px 0 0 var(--akcent); }
.r-chk { height: 100%; display: grid; place-items: center; }
.r-star { width: 32px; height: 32px; display: grid; place-items: center; color: var(--mgla2); border-radius: 6px; }
.r-star:hover { color: var(--papier); } .r-star.on { color: var(--akcent); } .r-star.on svg, .star-on svg { fill: var(--akcent); }
:root[data-theme="light"] .r-star.on, :root[data-theme="light"] .star-on { color: #8a9c10; } :root[data-theme="light"] .r-star.on svg, :root[data-theme="light"] .star-on svg { fill: var(--akcent); }
.r-av { display: none; }
.r-labels { display: contents; }
.r-from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; padding-right: 12px; } .unread .r-from { font-weight: 590; } .r-from small { color: var(--mgla); font-weight: 400; margin-left: 4px; }
.r-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.r-main .chip-l { margin-right: 6px; } .r-subj { color: var(--jasny); } .unread .r-subj { color: var(--papier); font-weight: 590; } .r-snip { color: var(--mgla); margin-left: 10px; }
.r-att { color: var(--mgla); display: grid; place-items: center; width: 24px; } .r-att svg { width: 16px; height: 16px; }
.r-date { text-align: right; font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; } .unread .r-date { font-weight: 590; }
.r-acts { display: none; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: inherit; align-items: center; padding-left: 8px; }
.row:hover .r-acts { background: var(--hover); } .row.sel:hover .r-acts { background: var(--zaznaczone); } .row.cur:hover .r-acts { background: var(--panel2); }
@media (hover: hover) { .row:hover .r-acts { display: flex; } .row:hover .r-date, .row:hover .r-att { visibility: hidden; } }
.rows.dense .row { min-height: 38px; } .rows.dense .r-star { height: 28px; }

@container lista (max-width: 700px) {
  .row { grid-template-columns: 44px minmax(0, 1fr) auto auto; grid-template-areas: "av from att date" "av main main star"; row-gap: 0; padding: 8px 12px 8px 12px; column-gap: 8px; align-items: start; }
  .rows.dense .row { min-height: 0; }
  .r-chk { display: none; } .r-av { display: inline-grid; grid-area: av; margin-top: 2px; }
  .r-from { grid-area: from; padding: 0; } .r-main { grid-area: main; white-space: normal; display: flex; flex-direction: column; gap: 1px; overflow: visible; }
  .r-subj, .r-snip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .r-main .r-labels { order: 3; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; } .r-main .chip-l { margin: 0; }
  .r-att { grid-area: att; width: 16px; height: 22px; } .r-date { grid-area: date; }
  .r-star { grid-area: star; align-self: end; margin: 0 -6px -4px 0; }
  .row.unread::before { top: 10px; bottom: 10px; }
  .r-snip { margin-left: 0; } .r-acts { display: none !important; } .row:hover .r-date, .row:hover .r-att { visibility: visible; }
  .r-av.sel-av { background: var(--akcent); color: #08090a; }
  .list-head { padding: 12px 16px 2px; } .chips { padding: 8px 16px; } .list-bar { padding: 2px 8px; }
}

/* ---------- widok wiadomosci ---------- */
.view-head { display: flex; align-items: center; gap: 2px; padding: 4px 12px; min-height: 48px; border-bottom: 1px solid var(--obrys); }
.view-head .sep { width: 1px; height: 20px; background: var(--obrys); margin: 0 6px; }
.view-scroll { flex: 1; overflow-y: auto; }
.thread { max-width: 880px; padding: 20px 24px 40px; margin: 0 auto; }
.t-subj { margin: 0 0 8px; font-size: 22px; font-weight: 510; line-height: 1.3; letter-spacing: -.02em; color: var(--papier); text-wrap: balance; }
.t-labels { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; min-height: 0; } .t-labels:empty { display: none; }
.msg { border: 1px solid var(--obrys); border-radius: 12px; margin-bottom: 10px; background: var(--panel); overflow: hidden; }
.msg.closed { background: transparent; } .msg.closed:hover { background: var(--hover); border-color: var(--obrys2); }
.msg-h { display: flex; align-items: center; gap: 12px; padding: 14px 14px 10px 16px; cursor: pointer; }
.msg.closed .msg-h { padding-bottom: 14px; }
.msg-who { flex: 1; min-width: 0; line-height: 1.35; } .msg-who b { color: var(--papier); font-weight: 590; } .msg-who .addr { color: var(--mgla); font-size: 12.5px; margin-left: 6px; }
.msg-to { font-size: 12.5px; color: var(--mgla); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-time { font-size: 12.5px; color: var(--mgla); white-space: nowrap; }
.msg-body { padding: 4px 20px 20px 64px; color: var(--jasny); font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.msg-body p { margin: 0 0 12px; } .msg-body ul, .msg-body ol { margin: 0 0 12px; padding-left: 22px; } .msg-body a { color: var(--akcent-ikona); text-decoration: underline; text-underline-offset: 2px; }
:root[data-theme="dark"] .msg-body a { color: var(--akcent); }
.msg-body .sig { margin-top: 16px; color: var(--mgla); font-size: 14px; }
.msg-body.live-text { white-space: pre-wrap; }
.msg-body .kv { border-collapse: collapse; margin: 0 0 12px; } .msg-body .kv td { padding: 6px 16px 6px 0; border-bottom: 1px solid var(--obrys); } .msg-body .kv td:first-child { color: var(--mgla); }
.atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 18px 64px; }
.att { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border: 1px solid var(--obrys2); border-radius: 10px; min-width: 200px; max-width: 100%; background: var(--panel2); }
.att:hover { border-color: var(--mgla2); }
.att .ext { width: 36px; height: 36px; border-radius: 8px; background: var(--tlo); border: 1px solid var(--obrys); display: grid; place-items: center; font-size: 10.5px; font-weight: 590; color: var(--jasny); }
.att span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; } .att b { font-weight: 510; color: var(--papier); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .att small { color: var(--mgla); font-size: 12px; }
.att > svg { color: var(--mgla); width: 18px; height: 18px; }
.reply-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 12px; }
.ai-result { white-space: pre-wrap; padding: 14px 16px; border: 1px solid var(--obrys); border-radius: 10px; background: var(--panel2); line-height: 1.5; margin-bottom: 16px; }
.quick { border: 1px solid var(--obrys2); border-radius: 12px; background: var(--panel); }
.quick:focus-within { border-color: var(--mgla2); }
.quick textarea { display: block; width: 100%; min-height: 84px; padding: 14px 16px; background: transparent; border: 0; resize: vertical; font-size: 15px; line-height: 1.55; color: var(--papier); }
.quick textarea:focus { outline: none; } .quick textarea::placeholder { color: var(--mgla2); }
.quick-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px 10px 16px; } .quick-bar .muted { flex: 1; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .thread { padding: 14px 12px 32px; } .msg-body { padding: 0 16px 16px 16px; } .atts { padding: 0 16px 16px; } .t-subj { font-size: 19px; } .att { min-width: 0; flex: 1 1 100%; } }
.view-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--mgla2); padding: 24px; } .view-empty svg { width: 44px; height: 44px; stroke-width: 1.2; margin: 0 auto 12px; } .view-empty p { margin: 0; color: var(--mgla); }

/* ---------- menu, okna, powiadomienia ---------- */
.menu { position: fixed; z-index: 90; min-width: 220px; max-width: min(340px, calc(100vw - 16px)); max-height: 70vh; overflow-y: auto; padding: 6px; background: var(--panel2); border: 1px solid var(--obrys2); border-radius: 12px; box-shadow: var(--cien); }
.menu button { display: flex; width: 100%; align-items: center; gap: 12px; height: 38px; padding: 0 10px; border-radius: 8px; text-align: left; color: var(--jasny); white-space: nowrap; }
.menu button:hover { background: var(--obrys); color: var(--papier); } .menu button svg { width: 18px; height: 18px; color: var(--mgla); } .menu button .chk { margin-left: auto; color: var(--akcent-ikona); }
.menu hr { border: 0; border-top: 1px solid var(--obrys); margin: 6px 0; } .menu .menu-t { padding: 8px 10px 4px; font-size: 12px; color: var(--mgla); }
.menu .who { padding: 10px; display: flex; gap: 10px; align-items: center; } .menu .who b { display: block; color: var(--papier); font-weight: 590; line-height: 1.2; } .menu .who small { color: var(--mgla); }
.toast-host { position: fixed; left: 20px; bottom: 20px; z-index: 120; display: grid; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 16px; min-height: 48px; padding: 8px 8px 8px 18px; background: #1b1d20; color: #f2f3f5; border: 1px solid #383b3f; border-radius: 10px; box-shadow: var(--cien); animation: toast-in .18s ease-out; max-width: min(440px, calc(100vw - 32px)); }
.toast button { color: var(--akcent); font-weight: 590; padding: 8px 10px; border-radius: 6px; } .toast button:hover { background: #2a2c30; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 540px; max-height: min(86vh, 760px); overflow-y: auto; background: var(--panel); border: 1px solid var(--obrys2); border-radius: 14px; box-shadow: var(--cien); }
.modal-h { display: flex; align-items: center; padding: 16px 12px 8px 24px; position: sticky; top: 0; background: var(--panel); z-index: 1; } .modal-h h2 { flex: 1; margin: 0; font-size: 18px; font-weight: 590; color: var(--papier); letter-spacing: -.02em; }
.modal-b { padding: 4px 24px 24px; } .set-row { padding: 14px 0; border-bottom: 1px solid var(--obrys); } .set-row:last-child { border-bottom: 0; }
.set-row > b { display: block; color: var(--papier); font-weight: 510; margin-bottom: 2px; } .set-row > small { display: block; color: var(--mgla); margin-bottom: 10px; }
.seg { display: inline-flex; border: 1px solid var(--obrys2); border-radius: 8px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button { height: 30px; padding: 0 12px; border-radius: 6px; color: var(--mgla); font-weight: 510; } .seg button:hover { color: var(--papier); } .seg button.on { background: var(--papier); color: var(--tlo); }
:root[data-theme="light"] .seg button.on { color: #fff; }
.set-row textarea { width: 100%; min-height: 76px; border-radius: 8px; border: 1px solid var(--obrys2); background: var(--tlo); padding: 10px 12px; resize: vertical; color: var(--papier); font-size: 14px; }
.set-row textarea:focus { outline: none; border-color: var(--mgla2); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; } .keys dt kbd, kbd { font: 12px ui-monospace, Menlo, Consolas, monospace; background: var(--panel2); border: 1px solid var(--obrys2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 7px; color: var(--papier); } .keys dd { margin: 0; color: var(--mgla); }

/* ---------- pisanie ---------- */
.compose { position: fixed; z-index: 70; right: 24px; bottom: 0; width: 580px; max-width: calc(100vw - 16px); height: min(580px, calc(100dvh - 80px)); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--obrys2); border-bottom: 0; border-radius: 12px 12px 0 0; box-shadow: var(--cien); animation: rise .18s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.compose.min { height: 44px; } .compose.min .c-body, .compose.min .c-foot { display: none; }
.compose.max { right: 50%; transform: translateX(50%); width: min(920px, calc(100vw - 32px)); height: calc(100dvh - 48px); animation: none; }
.c-head { display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 6px 0 16px; background: var(--panel2); border-radius: 12px 12px 0 0; border-bottom: 1px solid var(--obrys); cursor: pointer; flex: none; }
.c-head b { flex: 1; font-weight: 590; color: var(--papier); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-head .icon-btn { width: 32px; height: 32px; } .c-head .icon-btn svg { width: 17px; height: 17px; }
.c-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.c-row { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-bottom: 1px solid var(--obrys); }
.c-row label { color: var(--mgla); width: 56px; flex: none; font-size: 13.5px; }
.c-row input { flex: 1; min-width: 0; height: 42px; background: transparent; border: 0; color: var(--papier); font-size: 15px; } .c-row input:focus { outline: none; }
.c-row .lnk { color: var(--mgla); font-size: 13px; padding: 4px 6px; border-radius: 6px; } .c-row .lnk:hover { color: var(--papier); background: var(--obrys); }
.c-row select { background: transparent; border: 0; color: var(--papier); height: 42px; flex: 1; min-width: 0; font-size: 14.5px; } .c-row select option { background: var(--panel2); }
.c-edit { flex: 1; overflow-y: auto; padding: 14px 16px; font-size: 15px; line-height: 1.6; color: var(--papier); outline: none; min-height: 120px; overflow-wrap: anywhere; }
textarea.c-edit { width: 100%; border: 0; background: transparent; resize: none; font-family: inherit; }
.c-edit:empty::before { content: attr(data-ph); color: var(--mgla2); } .c-edit a { color: var(--akcent); } .c-edit .sig { color: var(--mgla); margin-top: 14px; }
.c-atts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px; } .c-atts:empty { display: none; }
.c-att { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 4px 0 10px; border: 1px solid var(--obrys2); border-radius: 8px; font-size: 13px; background: var(--panel2); } .c-att small { color: var(--mgla); } .c-att button { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; color: var(--mgla); } .c-att button:hover { background: var(--obrys); color: var(--papier); } .c-att svg { width: 14px; height: 14px; }
.c-foot { display: flex; align-items: center; gap: 2px; padding: 10px 10px 12px 12px; border-top: 1px solid var(--obrys); flex: none; flex-wrap: wrap; }
.c-foot .btn-accent { height: 40px; padding: 0 22px; margin-right: 8px; } .c-foot .icon-btn { width: 36px; height: 36px; } .c-foot .icon-btn svg { width: 18px; height: 18px; } .c-foot .spacer { flex: 1; }
.c-foot .tools { display: flex; gap: 0; flex-wrap: wrap; }

/* ---------- przycisk pisania na telefonie ---------- */
.fab { display: none; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); height: 56px; padding: 0 22px 0 18px; border-radius: 14px; background: var(--akcent); color: #08090a; font-weight: 590; font-size: 15px; align-items: center; gap: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.45); z-index: 40; }
.fab:active { background: var(--akcent-ciemny); }

/* ---------- widoki dla węższych ekranów ---------- */
.only-narrow-nav { display: none; }
@media (max-width: 1099px) {
  .only-narrow-nav { display: inline-grid; }
  .app.min .side { width: 272px; padding: 4px 12px 16px; } /* zwinięcie działa tylko na dużych ekranach */
  .side { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); background: var(--panel); border-right: 1px solid var(--obrys); padding-top: 12px; transform: translateX(-102%); transition: transform .2s ease; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .app.drawer .side { transform: none; box-shadow: var(--cien); }
  .side-brand { display: flex; }
  .app.drawer .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.55); animation: fade .2s; }
  .main { margin: 0 12px 12px; }
  .brand { width: auto; }
}
@media (max-width: 760px) {
  .app { grid-template-rows: 60px minmax(0, 1fr); }
  .top { padding: 0 8px; gap: 4px; } .brand { display: none; } .search { max-width: none; } .search input { height: 42px; }
  .hide-narrow { display: none; } .top-actions { margin-left: 0; }
  .main { margin: 0; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }
  .fab { display: inline-flex; } .app.reading .fab { display: none; }
  .compose, .compose.max { inset: 0; width: auto; max-width: none; height: auto; transform: none; border-radius: 0; border: 0; animation: rise .2s; }
  .compose.min { height: auto; } .c-head { border-radius: 0; height: 52px; }
  .c-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .c-foot .btn-accent { order: -1; }
  .toast-host { left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); } .app.reading ~ .toast-host { bottom: calc(16px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .modal-bg { align-items: end; padding: 0; } .modal { max-width: none; border-radius: 16px 16px 0 0; max-height: 90dvh; }
  .view-head { padding: 4px 4px; } .view-head .sep { margin: 0 2px; } .view-head .icon-btn { width: 42px; }
  .msg:not(.closed) .msg-h { flex-wrap: wrap; row-gap: 0; } .msg:not(.closed) .msg-time { order: 5; flex-basis: 100%; padding-left: 48px; margin-top: -2px; font-size: 12px; }
  .msg-who .addr { display: block; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu { max-width: calc(100vw - 16px); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

blockquote { margin: 8px 0; padding: 2px 0 2px 14px; border-left: 2px solid var(--obrys2); color: var(--mgla); }

/* ---------- asystent AI ---------- */
.btn-ai { color: var(--akcent-ikona); border-color: var(--akcent-obrys); background: var(--akcent-tlo); }
.btn-ai:hover { background: var(--akcent-tlo); border-color: var(--akcent); }
.btn-ai svg { width: 18px; height: 18px; }
.ai-card { border: 1px solid var(--akcent-obrys); background: var(--akcent-tlo); border-radius: 12px; padding: 12px 8px 12px 16px; margin-bottom: 12px; }
.ai-card.load { animation: pulse 1.2s ease-in-out infinite; } @keyframes pulse { 50% { opacity: .55; } }
.ai-h { display: flex; align-items: center; gap: 8px; color: var(--papier); min-height: 32px; } .ai-h svg { color: var(--akcent-ikona); width: 18px; height: 18px; } .ai-h b { flex: 1; font-weight: 590; }
.ai-b { padding: 4px 12px 0 26px; color: var(--jasny); } .ai-b p { margin: 0 0 6px; } .ai-b ul { margin: 0 0 6px; padding-left: 18px; } .ai-b li { margin-bottom: 4px; }
.ai-f { padding: 6px 12px 0 26px; font-size: 12px; color: var(--mgla); }
.ai-desc { width: 100%; border-radius: 8px; border: 1px solid var(--obrys2); background: var(--tlo); padding: 10px 12px; color: var(--papier); font-size: 16px; resize: vertical; }
.ai-desc:focus { outline: none; border-color: var(--akcent); }
.ai-act { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
