:root {
  /* Identyfikacja ShopDepot: Kreda, Atrament, Ultramaryna, Mgła; Onest + IBM Plex Mono */
  --ink: #0f1216; --muted: #4a4f57; --line: #e2e4e8; --bg: #f1f2ef; --card: #fff;
  --accent: #2a3bd4; --accent-bg: #d9deff; --accent-ink: #1e2ba6; --warn: #8a4b00; --warn-bg: #fdf0e1;
  --ok: #1f7a45; --ok-bg: #e5f4ea; --bad: #b42318; --bad-bg: #fef3f2; --grey: #eceeea;
  --font: Onest, system-ui, sans-serif; --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 14px/1.5 var(--font); }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
h1, h2, h3 { margin: 0; }
h1 { font-family: var(--font); font-size: 28px; font-weight: 800; letter-spacing: -.035em; }
h2 { font-size: 16px; font-weight: 600; }
code, .mono { font-family: var(--mono); font-size: 13px; }

.layout { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar { flex: 1 1 220px; max-width: 260px; min-width: 200px; background: var(--card); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; }
#project-board { display: flex; flex-direction: column; gap: 28px; }
.brand { display: flex; align-items: center; justify-content: flex-start; gap: 10px; align-self: stretch; min-height: 44px; font-family: var(--font); font-weight: 700; font-size: 17px; letter-spacing: -.01em; padding: 0 8px; color: var(--ink); text-decoration: none; }
.brand img { display: block; flex: none; max-width: 100%; height: auto; }
.brand:hover { color: var(--ink); }
.login-brand { display: flex; align-items: center; justify-content: center; margin: 0 0 8px; }
.login-brand img { max-width: 100%; height: auto; }
.ws-switcher { border: 1px solid var(--line); border-radius: 10px; }
.ws-switcher summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; min-height: 44px; position: relative; }
.ws-switcher summary::-webkit-details-marker { display: none; }
.ws-switcher summary::after { content: '▾'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.ws-switcher[open] summary::after { content: '▴'; }
.ws-switcher summary small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.ws-switcher summary strong { padding-right: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-menu { display: flex; flex-direction: column; gap: 2px; padding: 0 6px 8px; border-top: 1px solid var(--line); padding-top: 6px; }
.ws-menu a:not(.btn) { display: flex; align-items: center; min-height: 36px; padding: 0 8px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.ws-menu a:not(.btn).active, .ws-menu a:not(.btn):hover { background: var(--grey); color: var(--ink); }
.ws-menu a.active { font-weight: 600; }
.ws-manage { margin-top: 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--grey); color: var(--ink); }
.nav a.active { background: var(--accent-bg); color: var(--accent-ink); }
.nav a.active { font-weight: 600; }
.nav-item { position: relative; display: flex; }
.nav-item > a:first-child { flex: 1; }
.nav .nav-add { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 0; width: 28px; height: 28px; padding: 0; justify-content: center; font-size: 20px; line-height: 1; background: var(--card); border: 1px solid var(--line); color: var(--ink); opacity: 0; transition: opacity .15s; }
.nav-item:hover .nav-add, .nav-item:focus-within .nav-add, .nav .nav-add.active { opacity: 1; }
.nav .nav-add:hover { background: var(--grey); }
@media (hover: none) { .nav .nav-add { opacity: 1; } }
.nav-project { padding-top: 16px; border-top: 1px solid var(--line); }
.nav-project .nav-back { font-size: 13px; min-height: 32px; }
.nav .nav-project-name { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 8px 12px; overflow-wrap: anywhere; }
.nav-project-name small { color: var(--muted); font-size: 12px; }
.nav-project-name strong { font-family: var(--font); font-size: 15px; color: var(--ink); }
.whoami { margin-top: auto; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; position: relative; }
.whoami summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 44px; position: relative; }
.whoami summary::-webkit-details-marker { display: none; }
.whoami summary::after { content: '▴'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.whoami[open] summary::after { content: '▾'; }
.whoami-name { display: flex; flex-direction: column; min-width: 0; padding-right: 16px; }
.whoami-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whoami-name small { color: var(--muted); font-size: 12px; }
/* Menu konta rozwija się w górę, nad przyciskiem z nazwiskiem. */
.whoami-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 10; display: flex; flex-direction: column; gap: 2px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(22, 24, 29, .08); }
.whoami-menu a { display: flex; align-items: center; min-height: 36px; padding: 0 8px; border-radius: 6px; color: var(--muted); text-decoration: none; font-weight: 500; }
.whoami-menu a.active, .whoami-menu a:hover { background: var(--grey); color: var(--ink); }
.whoami-menu a.active { font-weight: 600; }
.avatar { flex: none; border-radius: 50%; object-fit: cover; background: var(--accent-bg); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 72px; height: 72px; font-size: 24px; }
.project-icon { flex: none; border-radius: 8px; object-fit: contain; background: var(--accent-bg); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.project-icon-sm { width: 28px; height: 28px; font-size: 11px; }
.project-icon-lg { width: 56px; height: 56px; font-size: 20px; border-radius: 12px; }
.tile-title, .page-head-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.page-head-title { gap: 14px; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.profile-head strong { font-size: 16px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.totp-setup { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.totp-qr { width: 200px; height: 200px; flex: none; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.totp-qr svg { display: block; width: 100%; height: 100%; }
.totp-secret { letter-spacing: .05em; overflow-wrap: anywhere; user-select: all; }
.otp-input { max-width: 180px; font-family: var(--mono) !important; font-size: 20px !important; letter-spacing: .2em; }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 24px; }
.topbar { display: none; }
@media (max-width: 760px) {
  .topbar { display: flex; align-items: center; justify-content: space-between; flex: 0 0 100%; position: sticky; top: 0; z-index: 30; padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
  .topbar-brand img { display: block; height: 36px; width: auto; }
  .nav-toggle { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; }
  .nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
  .sidebar { display: none; flex: 0 0 100%; max-width: none; min-width: 0; position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  body.nav-open .sidebar { display: flex; }
  .sidebar .brand { display: none; }
  .main { padding: 20px 16px 40px; }
  input, select, textarea { font-size: 16px !important; }
}

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumbs { font-size: 13px; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row > * { flex: 1 1 320px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 8px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 10px; font: 700 14px var(--font); border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; cursor: pointer; }
.btn:hover { color: var(--ink); background: #f2f2f4; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.btn-danger { color: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.inline { display: inline; margin: 0; }

/* Metka zamiast pigułki (identyfikacja ShopDepot): szpic z lewej, prawe narożniki zaokrąglone */
.pill, .tag { display: inline-flex; align-items: center; padding: 3px 10px 3px 16px; clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%); border-radius: 0 7px 7px 0; font: 600 11px/1.6 var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; background: var(--grey); color: var(--muted); }
.pill-accent { background: var(--accent-bg); color: var(--accent-ink); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-media { background: #f1eafa; color: #6b3fa0; }

.repo-box { display: flex; flex-direction: column; gap: 14px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); background: var(--card); }
.list-item:hover { color: var(--ink); border-color: #c9cbd2; }
.list-item .grow { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-item small { color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tiles > .empty { grid-column: 1 / -1; }
@media (max-width: 900px) { .tiles { grid-template-columns: minmax(0, 1fr); } }
.verified { vertical-align: -3px; margin-left: 6px; flex: none; }
.tile { position: relative; display: flex; flex-direction: row; align-items: stretch; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); background: var(--card); }
.tile:hover { color: var(--ink); border-color: #c9cbd2; }
.tile-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tile-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.tile-name { overflow-wrap: anywhere; }
.project-icon-fill { width: 96px; align-self: stretch; border-radius: 0; font-size: 24px; padding: 8px; box-sizing: border-box; background: #fff; border-right: 1px solid var(--line); }
.tile-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tile[draggable="true"] { cursor: grab; }
.tile.dragging { opacity: .4; }
[data-droppable].drop-over { outline: 2px dashed var(--accent, #4f46e5); outline-offset: 2px; }
.board-error { color: #b42318; margin: 0 0 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th { text-align: left; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.is-blocked td { color: var(--muted); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
.prompt { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 0; font: 14px/1.6 var(--font); }

.flash { padding: 12px 16px; border-radius: 10px; font-weight: 500; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--bad-bg); color: var(--bad); }

.toasts { position: fixed; top: 16px; right: 16px; z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(340px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 8px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 10px; box-shadow: 0 6px 20px rgba(22, 24, 29, .15); padding: 10px 12px; }
.toast[hidden] { display: none; }
.toast-link { flex: 1; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); min-width: 0; }
.toast-link small { color: var(--warn); font-weight: 600; }
.toast-link strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-close { border: 0; background: none; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }

.form { display: flex; flex-direction: column; gap: 16px; max-width: 720px; }
.form > div, .form-row { display: flex; flex-direction: column; gap: 6px; }
.form > div.actions { flex-direction: row; }
label, legend { font-weight: 600; font-size: 13px; }
fieldset { border: 0; padding: 0; margin: 0; }
input[type=text], input:not([type]), input[type=url], input[type=search], input[type=email], input[type=password], select, textarea {
  min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: 14px var(--font); color: var(--ink); background: var(--card); width: 100%;
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: 0 8px 0 0; vertical-align: middle; }
#project_form_type, #project_members_form_members { display: flex; flex-wrap: wrap; align-items: center; row-gap: 4px; }
#project_form_type input, #project_members_form_members input { margin: 0 8px 0 0; }
#project_form_type label, #project_members_form_members label { font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; min-height: 40px; margin-right: 24px; }
#project_members_form_members { display: grid; grid-template-columns: 26px 1fr; align-items: center; }
#project_members_form_members label { margin-right: 0; }
.help-text, .form small { color: var(--muted); font-size: 12px; font-weight: 400; }
.form ul { margin: 0; padding: 0; list-style: none; color: var(--bad); font-size: 13px; }

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login .card { width: 100%; max-width: 400px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--ink); font-weight: 700; border-bottom: 3px solid var(--accent); }
[id$="_workspaces"] { display: grid; grid-template-columns: 26px 1fr; align-items: center; }
[id$="_workspaces"] input { margin: 0; }
[id$="_workspaces"] label { font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; min-height: 40px; }

.thread-card { gap: 12px; }
.thread { display: flex; flex-direction: column; gap: 18px; max-height: 64vh; overflow-y: auto; padding: 8px 4px 8px 0; scroll-behavior: smooth; }
.thread-wrap { position: relative; display: flex; flex-direction: column; min-height: 0; }
.new-msgs { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); border: 1px solid var(--line); background: #fff; color: inherit; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; box-shadow: 0 2px 8px rgba(20,20,20,.14); }
.new-msgs[hidden] { display: none; }
.composer-error { margin: 0; font-size: 12.5px; color: var(--ink); }
.composer-error[hidden] { display: none; }
[data-task-panel], [data-task-side] { display: contents; }
.msg { max-width: 860px; }

/* Operator: dymek po prawej */
.msg-user { align-self: flex-end; max-width: min(78%, 680px); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.msg-bubble { background: #efeee9; color: var(--ink); border-radius: 18px 18px 4px 18px; padding: 10px 16px; white-space: pre-wrap; line-height: 1.55; overflow-wrap: anywhere; }
.msg-user footer { font-size: 11.5px; color: var(--muted); padding-right: 6px; }

/* Claude: awatar i tekst po lewej, bez ramki */
.msg-assistant { align-self: stretch; display: flex; gap: 12px; align-items: flex-start; }
.msg-avatar { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; background: #d97757; color: #fff; display: flex; align-items: center; justify-content: center; font: 700 14px var(--font); margin-top: 2px; }
.msg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.msg-main header { font-size: 13px; font-weight: 600; }
.msg-main header span { font-weight: 400; color: var(--muted); margin-left: 6px; font-size: 12px; }
.msg-md { line-height: 1.65; overflow-wrap: anywhere; }
.msg-md > :first-child { margin-top: 0; }
.msg-md > :last-child { margin-bottom: 0; }
.msg-md p { margin: 0 0 10px; }
.msg-md ul, .msg-md ol { margin: 0 0 10px; padding-left: 22px; }
.msg-md li { margin: 3px 0; }
.msg-md h1, .msg-md h2, .msg-md h3 { font: 600 15px var(--font); margin: 14px 0 6px; }
.msg-md code { background: #f0f0ee; border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; font-size: 12.5px; }
.msg-md pre { background: #1e1f24; color: #e8e8ea; border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin: 0 0 10px; }
.code-block { position: relative; margin: 0 0 10px; }
.code-block pre { margin: 0; padding-right: 84px; }
.code-copy { position: absolute; top: 8px; right: 8px; font: 500 12px var(--font); color: #e8e8ea; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 6px; padding: 3px 9px; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s; }
.code-block:hover .code-copy, .code-copy:focus-visible { opacity: 1; }
.code-copy:hover { background: rgba(255, 255, 255, .22); }
@media (hover: none) { .code-copy { opacity: 1; } }
.msg-md pre code { background: none; border: 0; padding: 0; color: inherit; font-size: 12.5px; line-height: 1.55; }
.msg-md blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }
.msg-md table { min-width: 0; width: auto; margin: 0 0 10px; font-size: 13px; }
.msg-md th, .msg-md td { border: 1px solid var(--line); padding: 6px 10px; }
.msg-md a { overflow-wrap: anywhere; }
.msg-actions { display: flex; gap: 6px; }
.msg-action { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; border: 1px solid transparent; }
.msg-action:hover { color: var(--ink); background: #f2f2f0; border-color: var(--line); }

/* Zdarzenia sesji: zwarte linie pod awatarem */
.msg-event { display: flex; align-items: center; gap: 8px; margin: -10px 0 -10px 42px; font-size: 12px; color: var(--muted); }
.msg-event code { font-family: var(--mono); font-size: 11.5px; background: none; overflow-wrap: anywhere; }
.msg-event time { margin-left: auto; font-size: 11px; }
.event-group { display: flex; flex-direction: column; gap: 6px; margin: -10px 0 -10px 42px; }
.event-group .msg-event { margin: 0; }
.event-older { display: flex; flex-direction: column; gap: 6px; padding-left: 10px; border-left: 2px solid var(--line); }
.event-older[hidden] { display: none; }
.event-toggle { align-self: flex-start; border: 0; background: none; padding: 2px 0; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; }
.event-toggle:hover { color: var(--ink); text-decoration: underline; }
.msg-event .dot { width: 6px; height: 6px; border-radius: 50%; background: #c9cbd2; flex: 0 0 6px; }

/* Komunikaty systemu: wyśrodkowana etykieta */
.msg-system { align-self: center; text-align: center; }
.msg-system span { display: inline-block; font-size: 12px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }

.msg-pending .msg-main { flex-direction: row; align-items: center; gap: 10px; min-height: 30px; font-size: 13px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #d97757; opacity: .35; animation: typing 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; opacity: .7; } }

/* Pole wiadomości */
.composer { max-width: none; border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; gap: 8px; box-shadow: 0 1px 2px rgba(20,20,20,.04); }
.composer:focus-within { border-color: #b9bcc6; }
.composer label { font-size: 12px; color: var(--muted); font-weight: 500; }
.composer textarea { border: 0; padding: 4px 2px; min-height: 52px; resize: none; }
.composer textarea:focus-visible { outline: none; }
.composer .actions { justify-content: flex-end; }
.composer-hint { font-size: 11.5px; color: var(--muted); margin-right: auto; }
table.compact { min-width: 0; font-size: 13px; }
table.compact td, table.compact th { padding: 8px 6px; }

/* Raport zużycia (/admin/zuzycie) */
.usage-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.usage-filter .tabs { border-bottom: 0; flex: 1 1 auto; }
.usage-filter label { display: flex; flex-direction: column; gap: 4px; }
.usage-filter input[type=date] { min-height: 34px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; font: 13px var(--font); color: var(--ink); background: var(--card); }
.usage-totals { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.usage-totals > div { flex: 1 1 180px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 2px; }
.usage-totals dt { color: var(--muted); font-size: 12px; }
.usage-totals dd { margin: 0; font: 700 22px var(--font); }
.usage-totals small { color: var(--muted); font-size: 12px; }
.usage-table { font-size: 13px; }
.usage-table td, .usage-table th { padding: 10px 8px; }
.usage-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.usage-table tr.is-busiest td { background: var(--warn-bg); }
.bar-cell { display: flex; flex-direction: column; gap: 4px; min-width: 140px; font-variant-numeric: tabular-nums; }
.bar { display: block; height: 8px; border-radius: 999px; background: var(--grey); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.bar-warn > span { background: var(--warn); }
.worker-node { padding: 12px 0; border-top: 1px solid var(--line); }
.worker-node:first-of-type { border-top: 0; }
.worker-node-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.worker-node-pause { margin-left: auto; }
.worker-node input[type=number], .worker-defaults input[type=number] { width: 72px; min-height: 30px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 8px; font: 13px var(--font); color: var(--ink); background: var(--card); }
.worker-defaults { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.usage-split { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }

/* Załączniki czatu */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.thread-card { position: relative; }
.drop-hint { display: none; position: absolute; inset: 0; z-index: 5; border: 2px dashed var(--accent); border-radius: 14px; background: rgba(234, 240, 253, .88); align-items: center; justify-content: center; pointer-events: none; }
.drop-hint span { background: var(--card); color: var(--accent); font-weight: 600; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--accent); }
[data-attach-zone] { position: relative; }
[data-attach-zone].is-dragover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
[data-attach-zone].is-dragover .drop-hint { display: flex; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.btn-icon:hover { background: var(--grey); color: var(--ink); }
.btn-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.attach-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.attach-list[hidden] { display: none; }
.attach-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 36px; padding: 4px 6px 4px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 13px; }
.attach-chip img { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; margin-left: -4px; }
.attach-chip .attach-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.attach-chip small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.attach-chip progress { width: 70px; height: 6px; accent-color: var(--accent); }
.attach-chip.is-done { background: var(--card); }
.attach-remove { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.attach-remove:hover { background: var(--grey); color: var(--ink); }
.attach-remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.msg-files { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.msg-thumb img { display: block; max-width: 220px; max-height: 160px; border-radius: 12px; border: 1px solid var(--line); object-fit: cover; }
.msg-file { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); text-decoration: none; font-size: 13px; }
.msg-file:hover { background: var(--bg); }
.msg-file small { color: var(--muted); }

/* Ustawienia: zakładki i tokeny GitLaba */
.settings-tabs { margin-bottom: 16px; }
.gitlab-tokens td { vertical-align: top; }
.gitlab-tokens small { display: block; margin-top: 4px; }
.gitlab-tokens .actions { margin-top: 8px; }
.token-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.token-form input { flex: 1 1 160px; min-width: 0; }

/* Wdrożenia: tokeny agenta, log */
.card-highlight { border-color: var(--accent); }
.copy-block { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
.copy-block pre { flex: 1 1 auto; margin: 0; padding: 10px 12px; background: var(--grey); border-radius: 8px; white-space: pre-wrap; word-break: break-all; font-size: 12px; }

.target-edit { margin-top: 8px; }
.target-edit summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.target-edit .form { margin-top: 8px; gap: 8px; }

/* Skille projektu */
.skill-warning { margin: 0 0 12px; padding: 10px 12px; border: 1px solid #e0b34a; border-radius: 10px; background: #fff7e0; color: #5c4400; font-size: 13.5px; }
.skill-drop { padding: 16px; border: 2px dashed var(--line); border-radius: 12px; }
.skill-drop.is-dragover { border-color: var(--accent); background: rgba(234, 240, 253, .6); }
.skill-content { margin: 0; padding: 12px; max-height: 60vh; overflow: auto; background: var(--bg); border-radius: 8px; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.skill-chip { display: inline-block; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font-size: 12px; }
.msg-skills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.skill-fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; }
.skill-fieldset legend { padding: 0 6px; font-weight: 600; }
.skill-option { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; cursor: pointer; }
.skill-option span { display: flex; flex-direction: column; }
.skill-option small { color: var(--muted); font-size: 12px; }
.skill-picker { position: relative; }
.skill-picker summary { list-style: none; cursor: pointer; }
.skill-picker summary::-webkit-details-marker { display: none; }
.skill-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; text-align: center; }
.skill-menu { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 20; width: min(360px, 80vw); max-height: 50vh; overflow: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }

/* Logo ShopDepot Studio */
.logo { display: inline-flex; align-items: center; gap: 9px; }
.logo-mark { display: block; flex: none; }
.logo-word { font: 800 20px/1 var(--font); letter-spacing: -.045em; color: var(--ink); }
.logo-tag { background: var(--accent-bg); color: var(--accent-ink); font-size: 10px; padding: 3px 8px 3px 14px; }
.login-brand .logo-word { font-size: 26px; }
/* Perforacja: oddziela dane od akcji */
.perforation { border: 0; border-top: 2px dashed #cfd2d7; margin: 4px 0; }
.sidebar .logo { gap: 7px; }
.sidebar .logo-word { font-size: 17px; }
.sidebar .brand { padding: 0 4px; }
.btn-shopdepot { width: 100%; }
.login-local { margin-top: 6px; border-top: 2px dashed #cfd2d7; padding-top: 12px; }
.login-local summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.login-local .form { margin-top: 12px; }
.small { font-size: 12.5px; }

/* Pliki motywu */
.files-layout { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 16px; align-items: start; }
.files-tree { padding: 12px; max-height: calc(100vh - 160px); overflow: auto; position: sticky; top: 16px; }
.files-main { display: grid; gap: 16px; min-width: 0; }
.file-tree { list-style: none; margin: 0; padding: 0 0 0 12px; font: 13px/1.7 var(--mono); }
.files-tree > .file-tree { padding-left: 0; }
.file-tree summary { cursor: pointer; color: var(--ink, inherit); font-weight: 600; }
.file-tree .ft-file a { color: inherit; text-decoration: none; display: block; padding: 0 6px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-tree .ft-file a:hover { background: var(--grey); }
.file-tree .ft-file.active a { background: var(--mist, #D9DEFF); color: var(--accent, #2A3BD4); }
.code-area { width: 100%; min-height: 320px; tab-size: 4; white-space: pre; overflow: auto; }
.asset-preview { max-width: 100%; max-height: 480px; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0/16px 16px; border-radius: 8px; }
@media (max-width: 900px) { .files-layout { grid-template-columns: 1fr; } .files-tree { position: static; max-height: 40vh; } }
