@font-face {
  font-family: "Geist";
  src: url("../assets/geist-latin-ext.woff2") format("woff2");
  font-style: normal; font-weight: 100 900; font-display: swap;
  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: "Geist";
  src: url("../assets/geist-latin.woff2") format("woff2");
  font-style: normal; font-weight: 100 900; font-display: swap;
  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 {
  color-scheme: light;
  --paper: #EDE6D6;      /* tło pulpitu */
  --paper-dot: #CFC6B0;
  --card: #FAF7EF;       /* wnętrze okna */
  --card-2: #F0EADB;
  --ink: #15140F;
  --mute: #56524A;
  --sig: #FF5B1F;        /* jedyny kolor sygnałowy */
  --sage: #CFE0B8;
  --bar-h: 40px;
  --dock-h: 84px;
  --sans: "Geist", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --shadow: 6px 6px 0 var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 56px; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(var(--paper-dot) 1.2px, transparent 1.3px);
  background-size: 24px 24px;
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  overflow-x: hidden;
}
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.sprite { position: absolute; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px var(--card); }
.skip { position: absolute; left: 8px; top: -60px; z-index: 9999; background: var(--ink); color: var(--card); padding: 8px 12px; }
.skip:focus { top: 48px; }
html:not(.js) .js-only { display: none !important; }

/* ---------- Pasek systemu ---------- */
.sysbar {
  position: sticky; top: 0; z-index: 5000;
  display: flex; align-items: stretch; gap: 4px;
  height: var(--bar-h);
  background: var(--card);
  border-bottom: 2px solid var(--ink);
  padding: 0 10px 0 0;
  font-size: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding-right: 14px; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: var(--bar-h); height: 100%; background: var(--card); border-right: 2px solid var(--ink); }
.sysmenu { display: flex; align-items: stretch; min-width: 0; }
.sysmenu a { display: flex; align-items: center; padding: 0 12px; text-decoration: none; font-weight: 500; white-space: nowrap; }
.sysmenu a:hover { background: var(--ink); color: var(--card); }
.sysinfo { margin-left: auto; display: flex; align-items: center; gap: 14px; font: 500 12px/1 var(--mono); white-space: nowrap; }
.sys-status::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--sig); border: 1.5px solid var(--ink); margin-right: 7px; vertical-align: -1px; }
.sys-clock { padding: 5px 8px; border: 2px solid var(--ink); background: var(--paper); min-width: 9ch; text-align: center; }
.sys-clock:empty { display: none; }

/* ---------- Przyciski ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 8px 14px;
  background: var(--card); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 0;
  box-shadow: 3px 3px 0 var(--ink);
  font: 650 15px/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.btn-sig { background: var(--sig); }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.tag { font: 600 11px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--mute); }
.fine { font-size: 13px; line-height: 1.45; color: var(--mute); }
.proof { border-left: 4px solid var(--sig); padding-left: 12px; font-weight: 500; }

/* ---------- Okno: wspólny wygląd (bez JS to zwykła sekcja) ---------- */
.desk { position: relative; padding: 24px 16px 48px; }
.wall { max-width: 760px; margin: 8px auto 20px; }
.wall h1 { font-weight: 800; font-size: clamp(34px, 6vw, 64px); line-height: .98; letter-spacing: -0.035em; }
.wall-hint { margin-top: 12px; font: 500 12px/1.4 var(--mono); color: var(--mute); }
html:not(.js) .wall-hint { display: none; }
.hint-phone { display: none; }

.win {
  position: relative;
  display: flex; flex-direction: column;
  max-width: 760px; margin: 0 auto 28px;
  background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  outline: none;
}
.win:focus-visible { box-shadow: var(--shadow); }
.win-bar {
  display: flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 0 6px 0 10px;
  background: var(--sig);
  border-bottom: 2px solid var(--ink);
  flex: none;
}
.win-ico { width: 20px; height: 20px; flex: none; --card: #FAF7EF; }
.win-ico svg { width: 100%; height: 100%; display: block; }
.win-title { font: 700 14px/1 var(--sans); letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-title .ext { font-family: var(--mono); font-weight: 500; font-size: 12px; }
.win-grip { flex: 1; align-self: stretch; margin: 9px 4px; min-width: 12px;
  background: repeating-linear-gradient(135deg, var(--ink) 0 2px, transparent 2px 7px); opacity: .85; }
.win-ctl { display: flex; gap: 6px; flex: none; }
.ctl { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; background: var(--card); border: 2px solid var(--ink); border-radius: 0; cursor: pointer; }
.ctl svg { width: 12px; height: 12px; display: block; }
.ctl:hover { background: var(--ink); color: var(--card); }
.ctl-label { display: none; }
.win-body { padding: 20px; overflow: auto; overscroll-behavior: contain; min-height: 0; }

/* ---------- Ikony (bez JS: spis treści) ---------- */
.icons { max-width: 760px; margin: 0 auto 28px; }
.icons ul { display: flex; flex-wrap: wrap; gap: 10px 6px; }
.icons a { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 96px; padding: 6px 2px; text-decoration: none; text-align: center; }
.ico { display: grid; place-items: center; width: 56px; height: 56px; background: var(--card); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.ico svg { width: 36px; height: 36px; display: block; }
.ico-l { font: 600 12px/1.2 var(--sans); padding: 2px 5px; background: var(--paper); }
.icons a:hover .ico { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); background: var(--sig); --card: #FAF7EF; }
.icons a:hover .ico-l, .icons a:focus-visible .ico-l { background: var(--ink); color: var(--card); }
.icons a:focus-visible { box-shadow: none; }
.dock { display: none; }

/* ---------- Notatka ---------- */
.win-note .win-body { padding: 26px 28px 28px;
  background-image: linear-gradient(var(--card-2) 1px, transparent 1px); background-size: 100% 28px; background-position: 0 -1px; background-attachment: local; }
.note-kicker { font: 600 11px/28px var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--mute); }
.note-h { font-weight: 800; font-size: clamp(26px, 3.1vw, 34px); line-height: 1.06; letter-spacing: -0.03em; margin: 4px 0 14px; text-wrap: balance; }
.note-lead { font-size: 16px; line-height: 28px; max-width: 54ch; }
.svc { counter-reset: svc; margin-top: 28px; border-top: 2px solid var(--ink); }
.svc li { counter-increment: svc; position: relative; padding: 13px 0 13px 44px; border-bottom: 2px solid var(--ink); background: var(--card); }
.svc li::before { content: "0" counter(svc); position: absolute; left: 0; top: 14px; font: 600 12px/1 var(--mono); background: var(--ink); color: var(--card); padding: 4px 5px; }
.svc h3 { font-weight: 700; font-size: 17px; line-height: 1.25; letter-spacing: -0.01em; }
.svc p { font-size: 15px; line-height: 1.45; margin-top: 3px; color: #2B2923; }
.svc b { font-weight: 650; }
.jump { display: inline-block; margin-top: 6px; font: 600 12px/1.3 var(--mono); text-decoration: none; border-bottom: 2px solid var(--sig); padding-bottom: 1px; }
.jump::after { content: " >"; }
.jump:hover { background: var(--sig); }
.note-cta { margin-top: 22px; }

/* ---------- Przeglądarka ---------- */
.win-web .win-body, .win-term .win-body, .win-portal .win-body { padding: 0; }
.web-bar { display: flex; align-items: center; gap: 8px; padding: 7px 8px; background: var(--card-2); border-bottom: 2px solid var(--ink); position: sticky; top: 0; z-index: 1; }
.web-nav { display: flex; gap: 4px; flex: none; }
.web-nav i { width: 22px; height: 22px; border: 2px solid var(--ink); background: var(--card); position: relative; }
.web-nav i::after { content: ""; position: absolute; left: 7px; top: 5px; width: 7px; height: 7px; border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }
.web-nav i + i::after { left: 3px; transform: rotate(-135deg); opacity: .35; }
.web-url { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 9px; background: var(--card); border: 2px solid var(--ink); font: 500 12px/1 var(--mono); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.web-url:hover { background: #fff; }
.web-lock { width: 8px; height: 8px; background: var(--sage); border: 1.5px solid var(--ink); flex: none; }
.web-go { flex: none; height: 28px; display: inline-flex; align-items: center; padding: 0 10px; background: var(--ink); color: var(--card); font: 650 12px/1 var(--sans); text-decoration: none; border: 2px solid var(--ink); }
.web-go:hover { background: var(--sig); color: var(--ink); }
.web-shot { border-bottom: 2px solid var(--ink); background: #fff; position: relative; }
.web-shot img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; object-position: 50% 0; }
.web-shot figcaption { position: absolute; right: 0; bottom: 0; background: var(--card); border: 2px solid var(--ink); border-right: 0; border-bottom: 0; padding: 3px 7px; font: 500 10.5px/1.3 var(--mono); }
.web-txt, .portal-main { padding: 16px 20px 20px; display: grid; gap: 10px; }
.web-txt p, .portal-main p { font-size: 15px; line-height: 1.5; }
.web-txt .tag, .portal-main .tag { font-size: 11px; line-height: 1.3; }
.web-txt .web-h, .portal-main .web-h { font-weight: 750; font-size: 21px; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }

/* ---------- Terminal ---------- */
.win-term .win-body { background: var(--ink); color: #EDE6D6; }
.log { font: 500 12.5px/1.45 var(--mono); padding: 14px 16px 12px; }
.log li { display: flex; gap: 10px; align-items: baseline; min-height: 22px; padding: 1.5px 0; }
.log .cmd { color: #fff; font-weight: 700; }
.log .cmd:not(:first-child) { margin-top: 10px; }
.log .pr { color: var(--sig); }
.log .st { color: #A9A290; flex: none; min-width: 3.5ch; }
.log .ln { flex: 1; min-width: 0; }
.log .ok { color: var(--ink); background: var(--sage); padding: 0 6px; flex: none; }
.log .rem { color: #C9C2AE; }
.log .rem::before { content: "#"; color: #8C8674; flex: none; }
.term-note { background: var(--card); color: var(--ink); border-top: 2px solid var(--ink); padding: 12px 16px 14px; display: grid; gap: 6px; font-size: 14px; line-height: 1.4; }
.log.is-anim li { opacity: 0; }
.log.is-anim li.on { opacity: 1; }
.log.is-anim li .ok { visibility: hidden; }
.log.is-anim li.done .ok { visibility: visible; }
.log.is-anim li.on:not(.done):not(.rem) .ln::after,
.log.is-anim li.cmd.on:not(.done)::after { content: ""; display: inline-block; width: 8px; height: 14px; margin-left: 6px; background: var(--sig); vertical-align: -2px; animation: blink .8s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Portal ---------- */
.portal { display: grid; grid-template-columns: 132px 1fr; }
.portal-side { background: var(--card-2); border-right: 2px solid var(--ink); padding: 14px 0; font: 500 12px/1 var(--mono); }
.portal-side li { padding: 9px 14px; color: var(--mute); }
.portal-side .on { background: var(--ink); color: var(--card); }
.flow { margin: 4px 0; }
.flow-top { background: var(--ink); color: var(--card); padding: 8px 12px; font: 600 12px/1.3 var(--mono); text-align: center; }
.flow-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 16px; position: relative; }
.flow-row::before { content: ""; position: absolute; top: 7px; left: 16.6%; right: 16.6%; border-top: 2px solid var(--ink); }
.flow-row li { position: relative; border: 2px solid var(--ink); background: #fff; padding: 12px 10px 10px; display: grid; gap: 4px; align-content: start; font-size: 12.5px; line-height: 1.35; }
.flow-row li::before { content: ""; position: absolute; left: 50%; top: -11px; height: 9px; border-left: 2px solid var(--ink); }
.flow-row b { font-size: 14px; font-weight: 700; line-height: 1.2; }
.flow-n { position: absolute; top: -2px; right: -2px; width: 20px; height: 20px; display: grid; place-items: center; background: var(--sig); border: 2px solid var(--ink); font: 700 11px/1 var(--mono); }
.flow figcaption { margin-top: 8px; font: 500 11px/1.4 var(--mono); color: var(--mute); }

/* ---------- Karta warsztatu ---------- */
.ticket { border: 2px solid var(--ink); background: #fff; }
.ticket-head { padding: 14px 16px 16px; background: var(--sage); border-bottom: 2px dashed var(--ink); display: grid; gap: 8px; }
.ticket-head .tag { color: #2E3A20; }
.ticket-h { font-weight: 750; font-size: 21px; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
.ticket-steps { counter-reset: t; }
.ticket-steps li { counter-increment: t; display: grid; grid-template-columns: 28px 100px 1fr; gap: 6px; padding: 10px 16px; border-bottom: 1.5px solid var(--card-2); font-size: 14px; line-height: 1.4; align-items: baseline; }
.ticket-steps li::before { content: counter(t); font: 700 12px/1 var(--mono); }
.ticket-steps b { font-weight: 700; }
.ticket-meta { display: grid; grid-template-columns: 1fr 1fr; border-top: 2px solid var(--ink); }
.ticket-meta div { padding: 10px 16px; }
.ticket-meta div + div { border-left: 2px solid var(--ink); }
.ticket-meta dt, .mail-head dt, .spec dt { font: 600 11px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--mute); }
.ticket-meta dd { font-size: 14px; line-height: 1.35; font-weight: 500; margin-top: 2px; }
.card-foot { margin-top: 18px; }

/* ---------- Nowe zlecenie ---------- */
.win-mail .win-body { padding: 0 20px 20px; }
.mail-head { margin: 0 -20px 16px; border-bottom: 2px solid var(--ink); background: var(--card-2); }
.mail-head div { display: flex; gap: 12px; align-items: baseline; padding: 6px 20px; }
.mail-head div + div { border-top: 1.5px solid #D9D0BB; }
.mail-head dt { width: 64px; flex: none; }
.mail-head dd { font-size: 14px; font-weight: 500; }
.mail-form { display: grid; gap: 14px; margin-bottom: 16px; }
.mail-form legend, .mail-label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 7px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chips span { display: block; padding: 7px 11px; border: 2px solid var(--ink); background: var(--card); font-size: 14px; font-weight: 500; line-height: 1.2; }
.chips label:hover span { background: var(--card-2); }
.chips input:checked + span { background: var(--ink); color: var(--card); box-shadow: inset 5px 0 0 var(--sig); padding-left: 16px; padding-right: 6px; }
.chips input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.mail-text { display: block; width: 100%; min-height: 132px; resize: vertical; padding: 12px; border: 2px solid var(--ink); border-radius: 0; background: #fff; color: var(--ink); font: 400 15px/1.5 var(--sans); }
.mail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 14px 0 12px; }
.mail-status { font: 600 12px/1.3 var(--mono); }

/* ---------- O studiu ---------- */
.win-about .about-h { font-weight: 800; font-size: 28px; line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 10px; }
.win-about p { font-size: 15px; }
.spec { margin-top: 16px; border: 2px solid var(--ink); background: #fff; }
.spec div { display: flex; gap: 12px; padding: 7px 12px; align-items: baseline; }
.spec div + div { border-top: 1.5px solid var(--card-2); }
.spec dt { width: 128px; flex: none; }
.spec dd { font-size: 14px; font-weight: 600; }

/* ---------- Kosz ---------- */
.files { border: 2px solid var(--ink); background: #fff; font: 500 13px/1.3 var(--mono); }
.files li { display: flex; gap: 10px; align-items: center; padding: 9px 10px; overflow-wrap: anywhere; }
.files li + li { border-top: 1.5px solid var(--card-2); }
.f-ext { flex: none; width: 40px; text-align: center; padding: 3px 0; border: 1.5px solid var(--ink); background: var(--card-2); font-size: 10px; text-transform: uppercase; }
.trash-empty { border: 2px dashed var(--ink); padding: 22px 16px; text-align: center; font-weight: 600; }
.trash-foot { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; font-size: 14px; color: var(--mute); }
.trash-foot span { flex: 1 1 180px; }

/* =====================================================================
   TRYB PULPITU (JS, szeroki ekran)
   ===================================================================== */
@media (min-width: 821px) {
  html.js, html.js body { height: 100%; overflow: hidden; }
  html.js body { display: flex; flex-direction: column; }
  html.js .sysbar { position: relative; flex: none; }
  html.js .desk { flex: 1; min-height: 0; padding: 0; overflow: hidden; }

  html.js .wall { position: absolute; left: 16px; bottom: calc(var(--dock-h) + 22px); margin: 0; width: 198px; padding: 14px;
    background: var(--ink); color: var(--card); box-shadow: 5px 5px 0 var(--sig); }
  html.js .wall h1 { font-size: 23px; line-height: 1.08; letter-spacing: -0.025em; }
  html.js .wall-hint { color: #C9C2AE; font-size: 11px; margin-top: 10px; }

  html.js .icons { position: absolute; left: 14px; top: 14px; bottom: calc(var(--dock-h) + 190px); margin: 0; max-width: none; }
  html.js .icons ul { flex-direction: column; height: 100%; align-content: flex-start; gap: 4px 4px; }

  html.js .win { position: absolute; left: 0; top: 0; margin: 0; max-width: none;
    width: min(var(--w, 560px), calc(100vw - 24px));
    max-height: calc(100vh - var(--bar-h) - var(--dock-h) - 20px); max-height: calc(100dvh - var(--bar-h) - var(--dock-h) - 20px);
    box-shadow: 4px 4px 0 var(--ink); }
  html.js .win[data-state="closed"], html.js .win[data-state="min"] { display: none; }
  html.js .win .win-bar { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; background: var(--card-2); }
  html.js .win .win-grip { opacity: .28; }
  html.js .win.is-active { box-shadow: 8px 8px 0 var(--ink); }
  html.js .win.is-active .win-bar { background: var(--sig); }
  html.js .win.is-active .win-grip { opacity: .85; }
  html.js .win.is-drag { box-shadow: 12px 12px 0 var(--ink); }
  html.js .win.is-drag .win-bar { cursor: grabbing; }
  html.js .win.is-opening { animation: win-in .34s cubic-bezier(.2, .9, .25, 1.15) both; }
  html.js .win.is-closing { animation: win-out .16s ease-in both; pointer-events: none; }
  html.js .win-note { max-height: min(660px, calc(100dvh - var(--bar-h) - var(--dock-h) - 20px)); }

  /* Dok */
  html.js .dock { display: flex; position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 4000;
    gap: 6px; padding: 6px; background: var(--card); border: 2px solid var(--ink); box-shadow: var(--shadow); }
  .dock-btn { position: relative; display: grid; place-items: center; width: 52px; height: 52px; padding: 0; background: var(--paper); border: 2px solid var(--ink); border-radius: 0; cursor: pointer; transition: transform .1s; }
  .dock-btn svg { width: 34px; height: 34px; display: block; }
  .dock-btn:hover, .dock-btn:focus-visible { transform: translateY(-4px); background: var(--card); }
  .dock-btn[data-state="open"] { background: var(--sig); --card: #FAF7EF; }
  .dock-btn[data-state="min"]::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 3px; height: 4px; background: var(--ink); }
  .dock-tip { position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); padding: 4px 8px; background: var(--ink); color: var(--card); font: 600 12px/1.2 var(--sans); white-space: nowrap; opacity: 0; pointer-events: none; }
  .dock-btn:hover .dock-tip, .dock-btn:focus-visible .dock-tip { opacity: 1; }
  .dock-sep { width: 2px; background: var(--ink); margin: 4px 2px; }
}
@keyframes win-in { from { opacity: 0; transform: translateY(60px) scale(.72); } to { opacity: 1; transform: none; } }
@keyframes win-out { to { opacity: 0; transform: translateY(80px) scale(.6); } }

@media (min-width: 821px) and (max-width: 1100px) {
  html.js .sys-status { display: none; }
}
@media (min-width: 821px) and (max-height: 760px), (min-width: 821px) and (max-width: 1100px) {
  html.js .wall { display: none; }
  html.js .icons { bottom: calc(var(--dock-h) + 6px); }
}

/* =====================================================================
   TRYB TELEFONU (JS, wąski ekran): ekran startowy i aplikacje
   ===================================================================== */
@media (max-width: 820px) {
  .sysmenu { display: none; }
  .sys-status { display: none; }
  .sysbar { padding-right: 8px; }
  .win-body { padding: 16px; }
  .portal { grid-template-columns: 1fr; }
  .portal-side { display: none; }
  .flow-row { grid-template-columns: 1fr; gap: 8px; padding-top: 10px; padding-left: 18px; }
  .flow-row::before { top: 0; bottom: 30px; left: 6px; right: auto; border-top: 0; border-left: 2px solid var(--ink); }
  .flow-row li::before { left: -14px; top: 18px; height: 0; width: 12px; border-left: 0; border-top: 2px solid var(--ink); }
  .ticket-steps li { grid-template-columns: 20px 1fr; }
  .ticket-steps li span { grid-column: 2; }
  .ticket-meta { grid-template-columns: 1fr; }
  .ticket-meta div + div { border-left: 0; border-top: 2px solid var(--ink); }
  .win-note .win-body { padding: 20px 18px 24px; }
  .spec dt { width: 104px; }

  html.js, html.js body { height: 100%; overflow: hidden; }
  html.js body { display: flex; flex-direction: column; }
  html.js .sysbar { position: relative; flex: none; z-index: 6000; }
  html.js .desk { flex: 1; min-height: 0; overflow: auto; padding: 22px 16px calc(var(--dock-h) + 28px); display: flex; flex-direction: column; }

  html.js .wall { margin: 0 0 22px; padding: 16px; background: var(--ink); color: var(--card); border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--sig); }
  html.js .wall h1 { font-size: clamp(28px, 8.4vw, 40px); }
  html.js .wall-hint { color: #C9C2AE; }
  html.js .hint-desk { display: none; }
  html.js .hint-phone { display: inline; }

  html.js .icons { margin: 0; max-width: none; }
  html.js .icons ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 6px; }
  html.js .icons a { width: auto; }
  html.js .ico { width: 64px; height: 64px; }
  html.js .ico svg { width: 42px; height: 42px; }

  html.js .win { position: fixed; z-index: 5500; left: 0; right: 0; top: var(--bar-h); bottom: 0; margin: 0; max-width: none; border: 0; box-shadow: none; }
  html.js .win[data-state="closed"], html.js .win[data-state="min"] { display: none; }
  html.js .win.is-opening { animation: app-in .26s cubic-bezier(.2, .8, .3, 1) both; }
  html.js .win.is-closing { animation: app-out .16s ease-in both; }
  html.js .win-bar { min-height: 48px; padding: 0 12px 0 6px; }
  html.js .win-ico, html.js .win-grip, html.js .ctl-min { display: none; }
  html.js .win-ctl { order: -1; }
  html.js .win-title { flex: 1; text-align: right; font-size: 15px; }
  html.js .ctl-close { width: auto; height: 36px; padding: 0 12px 0 8px; display: inline-flex; gap: 6px; align-items: center; font-weight: 700; font-size: 14px; }
  html.js .ctl-close .x { display: none; }
  html.js .ctl-close .back, html.js .ctl-label { display: block; }
  html.js .win-body { flex: 1; padding-bottom: 32px; }
  html.js .win-web .win-body, html.js .win-term .win-body, html.js .win-portal .win-body { padding-bottom: 0; }
  html.js .term-note { flex: 1; }
  html.js .win-term .win-body { display: flex; flex-direction: column; }

  html.js .dock { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 4000;
    justify-content: space-around; gap: 6px; padding: 8px; background: var(--card); border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); }
  .dock-btn { position: relative; display: grid; place-items: center; width: 56px; height: 56px; padding: 0; background: var(--paper); border: 2px solid var(--ink); border-radius: 0; }
  .dock-btn svg { width: 38px; height: 38px; display: block; }
  .dock-btn:not([data-dock="main"]), .dock-sep, .dock-tip { display: none; }
  .dock-btn[data-app="nowe"] { background: var(--sig); --card: #FAF7EF; }
  html.js.app-open .dock { display: none; }
}
@keyframes app-in { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }
@keyframes app-out { to { opacity: 0; transform: scale(.9); } }
.ctl .back { display: none; }

@media (max-width: 400px) {
  .brand-name { font-size: 13px; }
  .log { font-size: 12px; padding: 14px 12px 10px; }
  .log li { gap: 7px; }
}

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