[hidden] { display: none !important; }

/* ---------- tokeny ---------- */
:root {
  --canvas: #e6e4e0;
  --frame: #f3f2ef;
  --panel: #ffffff;
  --panel-2: #f5f5f3;
  --panel-3: #eeede9;
  --text: #15171b;
  --muted: #6b707a;
  --faint: #9aa0a9;
  --line: #e7e6e2;
  --line-2: #dcdad5;
  --accent: #1238ff;
  --accent-soft: #e9edff;
  --ok: #148a46;
  --ok-soft: #e5f5ec;
  --warn: #a96300;
  --warn-soft: #fdf2df;
  --err: #cc2f26;
  --err-soft: #fce8e6;
  --agent: #6a3fd6;
  --agent-soft: #f1ecfd;
  --spark: #ff4a1c;
  --shadow: 0 1px 2px rgba(20, 22, 28, .04), 0 2px 8px rgba(20, 22, 28, .04);
  --radius: 14px;
  --sans: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: var(--sans); /* nagłówki i duże liczby: Google Sans (wcześniej szeryfowy Newsreader) */
  --mono: "Google Sans Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  --hero-a: #cdd7dc;
  --hero-b: #e8e5dc;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0d0e11; --frame: #15171b; --panel: #1b1d22; --panel-2: #22252b; --panel-3: #2a2d34; --text: #eceef2; --muted: #9ba1ab; --faint: #6f757f;
    --line: #2b2e35; --line-2: #363a42; --accent: #7d98ff; --accent-soft: #222b4a; --ok: #52c98a; --ok-soft: #16301f; --warn: #f0b252; --warn-soft: #382a12;
    --err: #ff7d73; --err-soft: #3b1c1b; --agent: #b49cff; --agent-soft: #2a2342; --shadow: none; --hero-a: #161a20; --hero-b: #1d1c19; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #0d0e11; --frame: #15171b; --panel: #1b1d22; --panel-2: #22252b; --panel-3: #2a2d34; --text: #eceef2; --muted: #9ba1ab; --faint: #6f757f;
  --line: #2b2e35; --line-2: #363a42; --accent: #7d98ff; --accent-soft: #222b4a; --ok: #52c98a; --ok-soft: #16301f; --warn: #f0b252; --warn-soft: #382a12;
  --err: #ff7d73; --err-soft: #3b1c1b; --agent: #b49cff; --agent-soft: #2a2342; --shadow: none; --hero-a: #161a20; --hero-b: #1d1c19; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); color: var(--text); font: 14.5px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font: 500 30px/1.15 var(--serif); letter-spacing: -.02em; margin: 0 0 4px; }
h2 { font: 600 16px/1.3 var(--sans); margin: 0 0 10px; }
h3 { font: 600 14px/1.3 var(--sans); margin: 0 0 8px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pad { padding: 24px; }
.mono { font-family: var(--mono); font-size: 12px; }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------- powłoka aplikacji ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 10px; min-height: calc(100vh - 32px); margin: 16px; padding: 10px; background: var(--frame); border-radius: 26px; }
.side { display: flex; flex-direction: column; padding: 10px 8px 8px; min-width: 0; position: sticky; top: 26px; height: calc(100vh - 52px); overflow: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 14px; font-weight: 600; font-size: 17px; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: var(--text); font-size: 14.5px; }
.side-nav a .ico { color: var(--muted); }
.side-nav a:hover { background: var(--panel-3); text-decoration: none; }
.side-nav a.active { background: var(--panel-3); font-weight: 600; }
.side-nav a.active .ico { color: var(--text); }
.side-nav a .count { margin-left: auto; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.side-label { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); padding: 18px 10px 8px; }
.side-title { padding: 0 10px 6px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-bottom { margin-top: auto; padding-top: 16px; }
.side-card { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text); box-shadow: var(--shadow); }
.side-card:hover { text-decoration: none; border-color: var(--line-2); }
.side-card-logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(140deg, #2f5bff, #1238ff); color: #fff; flex: none; }
.side-card-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.side-card-txt b { font-size: 15px; }
.side-card .mode-chip { margin-left: auto; }

.work { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; min-width: 0; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.topbar { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 28px; border-bottom: 1px solid var(--line); }
.top-crumbs { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.top-crumbs a { color: var(--muted); }
.top-crumbs a:hover { color: var(--text); }
.top-crumbs b, .top-crumbs .cur { color: var(--text); font-weight: 600; }
main { padding: 26px 28px 40px; min-width: 0; }
.crumbs { display: none; }

.mode-chip { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.mode-chip.is-mock { background: var(--warn-soft); color: var(--warn); }
.mode-chip.is-live { background: var(--accent-soft); color: var(--accent); }
.icon-btn { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 10px; width: 36px; height: 36px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--panel-2); }
.icon-btn.menu-btn { display: none; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; margin: 0; padding: 0; border-radius: 0; min-height: 100vh; }
  .side { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 270px; height: 100vh; background: var(--frame); transform: translateX(-102%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .side.open { transform: none; }
  .work { border-radius: 0; border: none; }
  .icon-btn.menu-btn { display: grid; }
  .topbar { padding: 8px 16px; }
  main { padding: 18px 16px 32px; }
}

/* ---------- układ treści ---------- */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 240px; }
.page-head p.muted { font-size: 15px; margin-top: 4px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; overflow-x: auto; }
.card + .card { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.grid + .card, .card + .grid, .grid + .grid { margin-top: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
@media (max-width: 860px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

/* karta projektu i statystyki */
a.card { color: inherit; transition: border-color .15s, box-shadow .15s; }
a.card:hover { border-color: var(--line-2); box-shadow: 0 6px 24px rgba(20, 22, 28, .06); text-decoration: none; }
.stat { font: 500 34px/1.1 var(--serif); letter-spacing: -.03em; }

/* przyciski */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); padding: 7px 13px; border-radius: 10px; font: 500 13.5px/1.3 var(--sans); cursor: pointer; white-space: nowrap; box-shadow: 0 1px 1px rgba(20,22,28,.03); }
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.dark { background: var(--text); border-color: var(--text); color: var(--panel); }
.btn.danger { color: var(--err); }
.btn.big { padding: 11px 20px; font-size: 15px; border-radius: 12px; }
.btn.pill { border-radius: 999px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* formularze */
input, textarea, select { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 11px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 84px; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: 12px; min-height: 360px; }
label { display: block; font-size: 12.5px; color: var(--muted); margin: 0 0 5px; font-weight: 500; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 170px; }

/* zakładki projektu (na desktopie nawigacja jest w panelu bocznym) */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs a.active { color: var(--text); border-bottom-color: var(--text); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs .count { font: 11px var(--mono); color: var(--faint); margin-left: 5px; }
@media (min-width: 961px) { .tabs.project-tabs { display: none; } }

/* tabele */
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 500 11px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--panel-2); border-bottom: none; }
thead th:first-child { border-radius: 9px 0 0 9px; }
thead th:last-child { border-radius: 0 9px 9px 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: color-mix(in srgb, var(--panel-2) 55%, transparent); }

/* statusy: ramka + kropka */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 7px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); white-space: nowrap; }
.badge.ok, .badge.warn, .badge.err, .badge.acc { background: var(--panel); }
.badge.ok { color: var(--ok); }
.badge.warn { color: var(--warn); }
.badge.err { color: var(--err); }
.badge.acc { color: var(--accent); }
.badge.ok::before, .badge.warn::before, .badge.err::before, .badge.acc::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.progress { height: 6px; background: var(--panel-3); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width .4s; }

.drop { border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 30px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; background: radial-gradient(var(--line) 1px, transparent 1px) 0 0 / 14px 14px; }
.drop b { color: var(--text); }
.drop.over { border-color: var(--accent); background-color: var(--accent-soft); color: var(--accent); }

.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 7px 14px; }
.kv > div:nth-child(odd) { color: var(--muted); }
ul.clean { margin: 0; padding-left: 18px; }
ul.clean li { margin: 3px 0; }

.stage { border-left: 2px solid var(--accent); padding: 4px 0 4px 16px; margin-bottom: 18px; }
.stage h3 { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.cols-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 20px; }
.cols-lists h4 { margin: 8px 0 3px; font: 500 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .1em; }

.transcript { max-height: 520px; overflow: auto; }
.line { display: grid; grid-template-columns: 54px 1fr; gap: 8px; padding: 4px 0; }
.line .t { color: var(--faint); font: 12px var(--mono); }
.line.screen { color: var(--muted); font-style: italic; }

.frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.frame img { width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; }
.frame .cap { font-size: 12px; margin-top: 5px; }

/* ---------- trening ---------- */
.live { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, 1fr); gap: 14px; }
@media (max-width: 1100px) { .live { grid-template-columns: 1fr; } }
.stage-box { position: relative; background: #0e1014; border-radius: var(--radius); aspect-ratio: 16 / 9; overflow: hidden; display: grid; place-items: center; color: #9aa1ad; background-image: radial-gradient(#22262e 1px, transparent 1px); background-size: 16px 16px; }
.stage-box video { width: 100%; height: 100%; object-fit: contain; background: #0e1014; }
.persona-head { display: flex; gap: 12px; align-items: center; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line-2); color: var(--spark); display: grid; place-items: center; font: 600 16px var(--sans); flex: none; box-shadow: var(--shadow); }
.avatar.speaking { box-shadow: 0 0 0 4px var(--accent-soft), 0 0 0 6px var(--accent); }
.chat { height: 430px; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px; }
.msg { max-width: 85%; padding: 9px 13px; border-radius: 14px; border: 1px solid var(--line); }
.msg.user { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.msg.agent { align-self: flex-start; background: var(--panel-2); }
.msg.sys { align-self: center; font-size: 12.5px; color: var(--muted); background: var(--panel); max-width: 95%; border-style: dashed; }
.msg .who { font: 500 11px var(--mono); color: var(--faint); letter-spacing: .04em; }
.timer { font: 500 28px/1 var(--serif); font-variant-numeric: tabular-nums; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-right: 6px; }
.status-dot.on { background: var(--ok); }

.score-big { font: 500 48px/1 var(--serif); }
.score-ring { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c, var(--accent)) calc(var(--v, 0) * 1%), var(--panel-3) 0); flex: none; }
.score-ring > div { width: 92px; height: 92px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font: 500 32px var(--serif); }
blockquote { margin: 6px 0; padding: 6px 12px; border-left: 2px solid var(--line-2); color: var(--muted); font-style: italic; }

.toast { position: fixed; right: 20px; bottom: 20px; background: var(--text); color: var(--panel); padding: 11px 15px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); max-width: 420px; z-index: 50; }
.toast.err { background: var(--err); color: #fff; }
.cost-note { font-size: 12.5px; color: var(--muted); }
.cost-note b { color: var(--text); }
details summary { cursor: pointer; color: var(--muted); }
.notice { padding: 11px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); margin-bottom: 14px; }
.notice.info { background: var(--accent-soft); color: var(--accent); }
.notice.err { background: var(--err-soft); color: var(--err); }
.bar-row { display: grid; grid-template-columns: 220px 1fr 130px; gap: 10px; align-items: center; margin: 7px 0; }
.bar { height: 10px; border-radius: 3px; background: var(--accent); min-width: 2px; background-image: linear-gradient(90deg, var(--accent) 70%, transparent 70%); background-size: 6px 10px; }

/* ---------- ekrany "hero": PIN i pokój rozmów (bez panelu) ---------- */
body.bare .side, body.bare .topbar { display: none; }
body.bare .shell { display: block; margin: 0; padding: 0; border-radius: 0; background: transparent; min-height: 100vh; }
body.bare .work { border: none; border-radius: 0; box-shadow: none; min-height: 100vh; background: linear-gradient(180deg, var(--hero-a), var(--hero-b)); }
body.bare main { padding: 0; }
.hero { position: relative; min-height: 100vh; padding: 28px 24px 60px; overflow: hidden; }
.hero::before, .hero::after { content: ""; position: absolute; top: 0; bottom: 0; width: 260px; background-image: radial-gradient(color-mix(in srgb, var(--text) 14%, transparent) 1.2px, transparent 1.2px); background-size: 12px 12px; mask-image: linear-gradient(180deg, transparent 20%, #000 60%, transparent); pointer-events: none; }
.hero::before { left: 0; }
.hero::after { right: 0; }
.hero-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; max-width: 1180px; margin: 0 auto; }
.hero-top .brand { padding: 0; }
.hero-tag { font: 500 12.5px var(--mono); letter-spacing: .14em; color: color-mix(in srgb, var(--text) 45%, transparent); text-transform: uppercase; }
.hero-body { position: relative; z-index: 1; max-width: 860px; margin: 9vh auto 0; text-align: center; }
.hero-body h1 { font: 500 clamp(40px, 6vw, 74px)/1.05 var(--serif); letter-spacing: -.035em; margin: 0 0 18px; }
.hero-body h1 em { font-style: normal; color: var(--accent); }
.hero-body .lead { font-size: clamp(16px, 1.6vw, 20px); color: color-mix(in srgb, var(--text) 72%, transparent); max-width: 640px; margin: 0 auto 26px; }
.hero-form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; max-width: 520px; margin: 0 auto; }
.hero-form input { flex: 1; min-width: 200px; border-radius: 999px; padding: 13px 20px; font-size: 16px; background: var(--panel); border-color: transparent; box-shadow: var(--shadow); }
.hero-form .btn { border-radius: 999px; padding: 13px 26px; font-size: 15.5px; }
.hero-card { position: relative; z-index: 1; max-width: 760px; margin: 34px auto 0; background: var(--panel); border-radius: 22px; padding: 22px; box-shadow: 0 20px 60px rgba(20, 22, 28, .1); text-align: left; }
.hero-err { color: var(--err); font-size: 13.5px; margin-top: 12px; min-height: 20px; }
@media (max-width: 700px) { .hero::before, .hero::after { width: 70px; } .hero-tag { display: none; } }
.room-page { min-height: 100vh; padding: 28px 24px 48px; }
.room-page .hero-top { max-width: 1240px; }
.room-page #roomPage { max-width: 1240px; margin: 0 auto; background: var(--panel); border-radius: 22px; padding: 24px; box-shadow: 0 20px 60px rgba(20, 22, 28, .08); }
@media (max-width: 700px) { .room-page { padding: 12px; } .room-page #roomPage { padding: 14px; } }
.grid > .card + .card, .grid > .card { margin-top: 0; }
.side-card-txt { flex: 1; }
.side-card-txt b { white-space: nowrap; }
.side-card-txt .small { white-space: nowrap; }
.side-card-txt { min-width: 0; overflow: hidden; }
.side-card .mode-chip { flex: none; }
.side-card { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; }
.side-card-txt { overflow: visible; }
.side-card .mode-chip { margin-left: 0; align-self: center; }
