/* ==========================================================================
   IMS Bug Report
   Krój: Atkinson Hyperlegible Next (SIL OFL) – serwowany lokalnie.
   ========================================================================== */

@font-face {
  font-family: "Atkinson Next";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin-ext-400-normal.bcad3501e62c.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: "Atkinson Next";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin-400-normal.e8da57bc0c3d.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+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Next";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin-ext-600-normal.fab0ae8f79d9.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: "Atkinson Next";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin-600-normal.9204a77cef78.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+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Next";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin-ext-700-normal.521d9348d7ad.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: "Atkinson Next";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin-700-normal.617b4197a93a.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+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   Tokeny
   -------------------------------------------------------------------------- */
:root {
  --paper: #edf1ef;
  --panel: #ffffff;
  --panel-soft: #f6f8f7;
  --ink: #16222b;
  --ink-2: #4b5b66;
  --ink-3: #6f7f89;
  --rule: #d4ddd9;
  --rule-strong: #b6c3be;

  --teal: #0e6670;
  --teal-strong: #0a4f57;
  --teal-tint: #e0eeee;

  /* priorytety */
  --p-critical: #b8261e;
  --p-critical-tint: #fbe6e4;
  --p-high: #b85a07;
  --p-high-tint: #fcebd8;
  --p-medium: #866800;
  --p-medium-tint: #f5edc8;
  --p-low: #54677a;
  --p-low-tint: #e6ecf1;

  /* statusy */
  --s-new: #2457b5;
  --s-new-tint: #e3ebfa;
  --s-progress: #6343b0;
  --s-progress-tint: #ece6f9;
  --s-fixed: #8f5200;
  --s-fixed-tint: #fcecd0;
  --s-closed: #1f7047;
  --s-closed-tint: #ddf1e5;
  --s-reopened: #b3261e;
  --s-reopened-tint: #fbe4e2;

  /* pytania – niebieski z logo IMS */
  --q: #3557e6;
  --q-strong: #2442c0;
  --q-tint: #e7ecfd;
  --s-waiting: #8f5200;
  --s-waiting-tint: #fcecd0;

  --radius-s: 6px;
  --radius: 8px;
  --radius-l: 12px;
  --ring: 0 0 0 3px rgba(14, 102, 112, 0.28);
  --font: "Atkinson Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* --------------------------------------------------------------------------
   Podstawy
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
}

p {
  margin: 0;
}

a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--teal-strong);
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid rgba(14, 102, 112, 0.45);
  outline-offset: 2px;
}

kbd {
  font-family: inherit;
  font-size: 0.82em;
  font-weight: 600;
  padding: 0 5px;
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--panel);
}

.visually-hidden,
.file-input {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--ink-3);
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  vertical-align: -3px;
}

.icon-lg {
  width: 24px;
  height: 24px;
}

/* --------------------------------------------------------------------------
   Pasek górny
   -------------------------------------------------------------------------- */
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex: none;
}

.brand-name {
  white-space: nowrap;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-name span {
  font-weight: 400;
  color: var(--ink-2);
}

/* Przełącznik projektu */
.proj-code,
.proj-chip {
  display: inline-grid;
  place-items: center;
  background: #0e1116;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex: none;
}

.proj-code {
  min-width: 34px;
  height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 11.5px;
}

.projmenu > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius);
  max-width: 300px;
}

.projmenu > summary:hover,
.projmenu[open] > summary {
  background: var(--panel-soft);
}

.proj-name {
  font-weight: 700;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  width: 16px;
  height: 16px;
  color: var(--ink-3);
}

.dropdown-panel.projmenu-panel {
  left: 0;
  right: auto;
  min-width: 280px;
  max-height: 70vh;
  overflow-y: auto;
}

.projmenu-panel a.is-current {
  background: var(--panel-soft);
  font-weight: 700;
}

.projmenu-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mainnav {
  display: flex;
  align-items: stretch;
  gap: 4px;
  align-self: stretch;
  margin: -10px 0;
}

.mainnav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 3px solid transparent;
  border-top: 3px solid transparent;
  color: var(--ink-2);
  font-weight: 600;
  text-decoration: none;
}

.mainnav-link:hover {
  color: var(--ink);
}

.mainnav-link.is-active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.nav-badge {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--s-fixed-tint);
  color: var(--s-fixed);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  line-height: 1.5;
}

.nav-badge-q {
  background: var(--q-tint);
  color: var(--q-strong);
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.dropdown {
  position: relative;
}

.dropdown > summary {
  list-style: none;
  cursor: pointer;
}

.dropdown > summary::-webkit-details-marker {
  display: none;
}

.usermenu {
  position: relative;
}

.usermenu summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius);
}

.usermenu summary::-webkit-details-marker {
  display: none;
}

.usermenu summary:hover {
  background: var(--panel-soft);
}

.who {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.who-name {
  font-weight: 600;
  font-size: 14px;
}

.who-role {
  font-size: 12.5px;
  color: var(--ink-3);
}

.dropdown-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 210px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(22, 34, 43, 0.12);
  padding: 6px;
  z-index: 30;
}

.dropdown-sep {
  height: 1px;
  background: var(--rule);
  margin: 6px 4px;
}

.dropdown-panel a,
.dropdown-panel button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.dropdown-panel a:hover,
.dropdown-panel button:hover {
  background: var(--panel-soft);
  color: var(--ink);
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  flex: none;
  background: var(--teal-tint);
  color: var(--teal-strong);
}

.avatar.role-tester {
  background: var(--p-medium-tint);
  color: #6b5300;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 11.5px;
}

/* --------------------------------------------------------------------------
   Układ strony
   -------------------------------------------------------------------------- */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.narrow {
  max-width: 780px;
}

.page-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 4px 0 20px;
}

.backlink {
  display: inline-block;
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  margin-bottom: 8px;
}

.backlink::before {
  content: "←";
  margin-right: 6px;
}

.backlink:hover {
  color: var(--ink);
  text-decoration: underline;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-l);
  padding: 24px;
}

.stack > * + * {
  margin-top: 18px;
}

.stack > input[type="hidden"] + * {
  margin-top: 0;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.sub-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-2);
  margin: 22px 0 8px;
}

.prose {
  max-width: 72ch;
  overflow-wrap: anywhere;
}

.prose p + p {
  margin-top: 0.7em;
}

/* --------------------------------------------------------------------------
   Komunikaty
   -------------------------------------------------------------------------- */
.flash-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.flash {
  padding: 11px 16px;
  border-radius: var(--radius);
  border-left: 4px solid var(--teal);
  background: var(--teal-tint);
  color: var(--teal-strong);
  font-weight: 600;
}

.flash-error {
  border-left-color: var(--p-critical);
  background: var(--p-critical-tint);
  color: #8c1c16;
}

.form-alert {
  padding: 11px 14px;
  border-radius: var(--radius);
  background: var(--p-critical-tint);
  color: #8c1c16;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Przyciski
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s;
}

.btn:disabled {
  opacity: 0.65;
  cursor: progress;
}

.btn-lg {
  min-height: 46px;
  padding: 0 22px;
  font-size: 16px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-primary {
  background: var(--teal);
  color: #fff;
}

.btn-primary:hover {
  background: var(--teal-strong);
  color: #fff;
}

.btn-secondary {
  background: var(--panel);
  border-color: var(--rule-strong);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
}

.btn-ghost:hover {
  background: rgba(22, 34, 43, 0.06);
  color: var(--ink);
}

.btn-success {
  background: var(--s-closed);
  color: #fff;
}

.btn-success:hover {
  background: #185a39;
  color: #fff;
}

.btn-danger {
  background: var(--p-critical);
  color: #fff;
}

.btn-danger:hover {
  background: #951e17;
  color: #fff;
}

.btn-ghost-danger {
  background: transparent;
  border-color: #f0c4c0;
  color: var(--p-critical);
}

.btn-ghost-danger:hover {
  background: var(--p-critical-tint);
  color: #951e17;
}

/* --------------------------------------------------------------------------
   Formularze
   -------------------------------------------------------------------------- */
.field {
  border: 0;
  padding: 0;
  min-width: 0;
}

fieldset.field {
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
}

.field > label,
.field > legend,
.field > .label {
  display: block;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
  padding: 0;
}

.optional {
  font-weight: 400;
  color: var(--ink-3);
  font-size: 14px;
  margin-left: 4px;
}

input[type="text"],
input[type="password"],
input[type="search"],
input[type="email"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 9px 12px;
  min-height: 42px;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

select {
  width: auto;
  padding-right: 32px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: var(--ring);
}

::placeholder {
  color: #94a1a9;
}

.help {
  font-size: 14px;
  color: var(--ink-3);
  margin-top: 6px;
}

.error {
  font-size: 14px;
  color: var(--p-critical);
  font-weight: 600;
  margin-top: 6px;
}

.has-error input,
.has-error textarea,
.has-error select,
.has-error .dropzone,
.has-error .audio-bar {
  border-color: var(--p-critical);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-actions.wrap {
  flex-wrap: wrap;
}

.inline-field {
  display: flex;
  gap: 8px;
}

.inline-field select {
  flex: 1;
}

/* Wybór priorytetu */
.prio-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.prio-option {
  --c: var(--p-low);
  --t: var(--p-low-tint);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--panel);
  overflow: hidden;
}

.prio-option::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--c);
}

.prio-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.prio-option-name {
  font-weight: 700;
  color: var(--c);
}

.prio-option-hint {
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-2);
}

.prio-option:hover {
  border-color: var(--c);
}

.prio-option:has(input:checked) {
  border-color: var(--c);
  background: var(--t);
  box-shadow: inset 0 0 0 1px var(--c);
}

.prio-option:has(input:focus-visible) {
  outline: 3px solid rgba(14, 102, 112, 0.45);
  outline-offset: 2px;
}

.prio-option.p-critical { --c: var(--p-critical); --t: var(--p-critical-tint); }
.prio-option.p-high { --c: var(--p-high); --t: var(--p-high-tint); }
.prio-option.p-medium { --c: var(--p-medium); --t: var(--p-medium-tint); }
.prio-option.p-low { --c: var(--p-low); --t: var(--p-low-tint); }

/* Załączniki */
.uploader {
  display: grid;
  gap: 10px;
}

.dropzone,
.audio-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px dashed var(--rule-strong);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--ink-2);
}

.dropzone.is-dragover,
.audio-bar.is-dragover {
  border-color: var(--teal);
  background: var(--teal-tint);
}

.dropzone-text {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.45;
  flex: 1;
  min-width: 0;
}

.dropzone-text strong {
  color: var(--ink);
  font-size: 15px;
}

.linklike {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.btn-rec {
  min-height: 38px;
}

.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--p-critical);
}

.btn-rec.is-recording {
  background: var(--p-critical);
  border-color: var(--p-critical);
  color: #fff;
}

.btn-rec.is-recording .rec-dot {
  background: #fff;
  border-radius: 2px;
}

.rec-status {
  font-size: 14px;
  color: var(--p-critical);
  font-weight: 600;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.file-list:empty {
  display: none;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--panel);
}

.file-item img {
  width: 64px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--rule);
}

.file-item audio {
  height: 36px;
  max-width: 260px;
}

.file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.35;
}

.file-info span:first-child {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-info span + span {
  color: var(--ink-3);
}

.file-remove {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--ink-3);
  cursor: pointer;
}

.file-remove:hover {
  background: var(--p-critical-tint);
  color: var(--p-critical);
}

/* --------------------------------------------------------------------------
   Etykiety: priorytet i status
   -------------------------------------------------------------------------- */
.prio-tag {
  --c: var(--p-low);
  --t: var(--p-low-tint);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--t);
  color: var(--c);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.prio-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: currentColor;
}

.prio-tag.p-critical { --c: #fff; --t: var(--p-critical); }
.prio-tag.p-high { --c: var(--p-high); --t: var(--p-high-tint); }
.prio-tag.p-medium { --c: var(--p-medium); --t: var(--p-medium-tint); }
.prio-tag.p-low { --c: var(--p-low); --t: var(--p-low-tint); }

.prio-tag-lg {
  font-size: 14px;
  padding: 3px 10px;
}

.status-pill {
  --c: var(--s-new);
  --t: var(--s-new-tint);
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--t);
  color: var(--c);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill-lg {
  font-size: 14px;
  padding: 4px 12px;
}

.status-pill.s-new { --c: var(--s-new); --t: var(--s-new-tint); }
.status-pill.s-progress { --c: var(--s-progress); --t: var(--s-progress-tint); }
.status-pill.s-fixed { --c: var(--s-fixed); --t: var(--s-fixed-tint); }
.status-pill.s-closed { --c: var(--s-closed); --t: var(--s-closed-tint); }
.status-pill.s-reopened { --c: var(--s-reopened); --t: var(--s-reopened-tint); }
.status-pill.s-waiting { --c: var(--s-waiting); --t: var(--s-waiting-tint); }
.status-pill.s-answered { --c: var(--q-strong); --t: var(--q-tint); }
.status-pill.s-clarified { --c: var(--s-closed); --t: var(--s-closed-tint); }

/* --------------------------------------------------------------------------
   Lista zgłoszeń
   -------------------------------------------------------------------------- */
.list-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 18px;
  overflow-x: auto;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: -1px;
  border-bottom: 3px solid transparent;
  color: var(--ink-2);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.tab:hover {
  color: var(--ink);
  border-bottom-color: var(--rule-strong);
}

.tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--teal);
}

.tab-count {
  min-width: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(22, 34, 43, 0.07);
  font-size: 13px;
  text-align: center;
}

.tab.has-attention .tab-count {
  background: var(--s-fixed-tint);
  color: var(--s-fixed);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.search {
  position: relative;
  flex: 1 1 280px;
}

.search .icon {
  position: absolute;
  left: 12px;
  top: 12px;
  color: var(--ink-3);
}

.search input {
  padding-left: 38px;
}

.bug-list {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-l);
  overflow: hidden;
}

.bug-row {
  --c: var(--p-low);
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto 64px 128px;
  grid-template-areas: "key main status seal date";
  align-items: center;
  gap: 16px;
  padding: 14px 18px 14px 22px;
  color: inherit;
  text-decoration: none;
}

.bug-row + .bug-row {
  border-top: 1px solid var(--rule);
}

.bug-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--c);
}

.bug-row:hover {
  background: var(--panel-soft);
  color: inherit;
}

.bug-row:hover .bug-title {
  color: var(--teal-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bug-row.p-critical { --c: var(--p-critical); }
.bug-row.p-high { --c: var(--p-high); }
.bug-row.p-medium { --c: #c9a400; }
.bug-row.p-low { --c: #a5b4c1; }

.bug-row.is-question {
  grid-template-columns: 84px minmax(0, 1fr) auto 128px;
  grid-template-areas: "key main status date";
}

.bug-row.is-question.s-waiting { --c: #e09a2b; }
.bug-row.is-question.s-answered { --c: var(--q); }
.bug-row.is-question.s-clarified { --c: #b7c9bf; }

.list-lead {
  color: var(--ink-2);
  margin: -12px 0 20px;
  max-width: 70ch;
}

.bug-key {
  grid-area: key;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-3);
}

.bug-main {
  grid-area: main;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bug-title {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.bug-meta,
.bug-head-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: 13.5px;
  color: var(--ink-3);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.meta-item .icon {
  width: 15px;
  height: 15px;
}

.bug-row .status-pill {
  grid-area: status;
  justify-self: start;
}

.signoff-mini {
  grid-area: seal;
  display: inline-flex;
  gap: 4px;
}

.seal-mini {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px dashed var(--rule-strong);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
}

.seal-mini.is-done {
  border: 2px solid var(--s-closed);
  background: var(--s-closed-tint);
  color: var(--s-closed);
}

.seal-mini.is-done:first-child {
  border-color: var(--teal);
  background: var(--teal-tint);
  color: var(--teal);
}

.bug-date {
  grid-area: date;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--ink-3);
  text-align: right;
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  color: var(--ink-2);
  font-size: 14px;
}

.empty {
  background: var(--panel);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-l);
  padding: 48px 24px;
  text-align: center;
}

.empty h1,
.empty h2 {
  font-size: 21px;
  margin-bottom: 8px;
}

.empty p {
  color: var(--ink-2);
  max-width: 52ch;
  margin: 0 auto 18px;
}

.empty-page {
  margin-top: 40px;
}

/* --------------------------------------------------------------------------
   Wybór projektu
   -------------------------------------------------------------------------- */
.projects-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.projects-head .page-title {
  margin: 0;
}

.project-list {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-l);
  overflow: hidden;
}

.project-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto 150px 120px;
  grid-template-areas: "chip main stats todo date";
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  color: inherit;
  text-decoration: none;
}

.project-row + .project-row {
  border-top: 1px solid var(--rule);
}

.project-row:hover {
  background: var(--panel-soft);
  color: inherit;
}

.project-row:hover .project-name {
  color: var(--teal-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.proj-chip {
  grid-area: chip;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.project-main {
  grid-area: main;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.project-name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.project-last {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  vertical-align: 2px;
  text-decoration: none;
}

.project-desc {
  color: var(--ink-2);
  font-size: 14px;
}

.project-stats {
  grid-area: stats;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 14px;
  color: var(--ink-2);
}

.stat strong {
  color: var(--ink);
}

.stat-verify,
.stat-verify strong {
  color: var(--s-fixed);
}

.project-todo {
  grid-area: todo;
  justify-self: end;
}

.todo-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--s-fixed-tint);
  color: var(--s-fixed);
  font-size: 13.5px;
  white-space: nowrap;
}

.project-date {
  grid-area: date;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.35;
  text-align: right;
}

.project-date time {
  color: var(--ink-2);
}

.projects-foot {
  margin-top: 16px;
  font-size: 14px;
}

.archived-note {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px dashed var(--rule-strong);
  color: var(--ink-2);
  font-size: 14px;
}

/* Formularz projektu */
.code-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.code-row input {
  max-width: 160px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.code-row input:disabled {
  background: var(--panel-soft);
  color: var(--ink-2);
}

.code-preview {
  color: var(--ink-3);
  font-size: 14px;
}

.code-preview strong {
  color: var(--ink);
}

.member-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}

.member-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 400;
}

.member-option:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-tint);
}

.member-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.archive-panel {
  margin-top: 20px;
}

.archive-panel p {
  color: var(--ink-2);
  margin-bottom: 14px;
  max-width: 70ch;
}

/* --------------------------------------------------------------------------
   Szczegóły zgłoszenia
   -------------------------------------------------------------------------- */
.bug-head {
  margin: 6px 0 24px;
}

.bug-head-key {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-3);
}

.bug-head-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 2px 0 12px;
  max-width: 36ch;
  overflow-wrap: anywhere;
}

.bug-head-meta {
  font-size: 14.5px;
  color: var(--ink-2);
}

.bug-head-meta strong {
  color: var(--ink);
  font-weight: 600;
  margin-left: 3px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  align-items: start;
}

.detail-main {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.detail-side {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 80px;
}

.steps {
  background: var(--panel-soft);
  border-radius: var(--radius);
  padding: 12px 16px;
}

/* Załączniki w zgłoszeniu */
.attachments {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.att-image {
  width: 180px;
}

.att-image a {
  display: block;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel-soft);
  aspect-ratio: 16 / 10;
}

.att-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.att-image a:hover {
  border-color: var(--teal);
}

.att-name {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.att-audio {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.att-audio audio {
  width: 320px;
  max-width: 100%;
  height: 40px;
}

.att-audio .att-name {
  margin: 0;
  white-space: normal;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.att-size {
  color: var(--ink-3);
}

/* Oś czasu */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--rule);
}

.tl-item {
  --c: var(--ink-3);
  position: relative;
  padding-left: 40px;
}

.tl-item + .tl-item {
  margin-top: 12px;
}

.tl-dot {
  position: absolute;
  left: 7px;
  top: 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--c);
}

.tl-item.a-created { --c: var(--s-new); }
.tl-item.a-started { --c: var(--s-progress); }
.tl-item.a-fixed { --c: var(--teal); }
.tl-item.a-unfixed { --c: var(--ink-3); }
.tl-item.a-confirmed { --c: var(--s-closed); }
.tl-item.a-reopened { --c: var(--s-reopened); }
.tl-item.a-priority { --c: var(--p-high); }
.tl-item.a-comment { --c: var(--rule-strong); }
.tl-item.a-answer { --c: var(--q); }
.tl-item.a-followup { --c: var(--s-waiting); }
.tl-item.a-clarified { --c: var(--s-closed); }

.tl-card {
  padding: 8px 0;
}

.tl-item.is-comment .tl-card,
.tl-item .tl-card:has(.tl-text),
.tl-item .tl-card:has(.attachments) {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-l);
  padding: 12px 16px 14px;
}

.tl-item.a-answer .tl-card {
  border-color: #c9d4fa;
  box-shadow: inset 3px 0 0 var(--q);
}

.tl-badge {
  display: inline-flex;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--q-tint);
  color: var(--q-strong);
  font-size: 13px;
  font-weight: 700;
}

.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 14.5px;
}

.tl-author {
  font-weight: 700;
}

.tl-event {
  color: var(--c);
  font-weight: 600;
}

.tl-item.a-comment .tl-event,
.tl-item.a-unfixed .tl-event {
  color: var(--ink-2);
}

.tl-time {
  margin-left: auto;
  font-size: 13px;
  color: var(--ink-3);
}

.tl-text {
  margin-top: 8px;
}

/* Podpisy zamknięcia – pieczątki */
.signoff-lead {
  font-size: 14px;
  color: var(--ink-2);
  margin: -6px 0 16px;
}

.seals {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.seal-slot {
  --c: var(--teal);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.seal-slot:nth-child(2) {
  --c: var(--s-closed);
}

.seal {
  width: 112px;
  height: 112px;
}

.seal-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  color: var(--c);
}

.seal-empty {
  fill: none;
  stroke: var(--rule-strong);
  stroke-width: 2;
  stroke-dasharray: 6 5;
}

.seal-num {
  fill: var(--rule-strong);
  font-size: 34px;
  font-weight: 700;
}

.seal-outer {
  fill: color-mix(in srgb, currentColor 6%, transparent);
  stroke: currentColor;
  stroke-width: 3.5;
}

.seal-inner {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.seal-text {
  fill: currentColor;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
}

.seal-date {
  fill: currentColor;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

.seal-dot {
  fill: currentColor;
}

.seal-tick {
  fill: none;
  stroke: currentColor;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.seal-slot.is-done .seal-svg {
  transform: rotate(-8deg);
}

.seal-slot.is-done:nth-child(2) .seal-svg {
  transform: rotate(6deg);
}

.seal-caption {
  display: flex;
  flex-direction: column;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink-2);
}

.seal-caption strong {
  color: var(--ink);
  font-size: 14px;
}

.seal-caption time {
  color: var(--ink-3);
  font-size: 13px;
}

.signoff-note {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--panel-soft);
  font-size: 14px;
  color: var(--ink-2);
}

.signoff-note.is-waiting {
  background: var(--s-fixed-tint);
  color: #6e3f00;
  font-weight: 600;
}

.signoff-note.is-answered {
  background: var(--q-tint);
  color: var(--q-strong);
  font-weight: 600;
}

.signoff-note.is-closed {
  background: var(--s-closed-tint);
  color: #17583a;
  font-weight: 600;
}

.signoff-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.signoff > .btn-ghost-danger {
  margin-top: 16px;
}

.signoff-actions + .btn-ghost-danger {
  margin-top: 8px;
}

.question-where {
  margin-bottom: 10px;
  color: var(--ink);
}

.question-where span {
  color: var(--ink-3);
  margin-right: 4px;
}

.q-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.q-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.4;
}

.q-step div {
  display: flex;
  flex-direction: column;
}

.q-step span:not(.q-step-mark) {
  color: var(--ink-2);
}

.q-step-mark {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px dashed var(--rule-strong);
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 700;
}

.q-step-mark svg {
  width: 16px;
  height: 16px;
}

.q-step.is-current .q-step-mark {
  border: 2px solid var(--q);
  color: var(--q);
}

.q-step.is-done .q-step-mark {
  border: 0;
  background: var(--q);
  color: #fff;
}

.q-state .signoff-note + .btn,
.q-state .signoff-actions + .btn {
  margin-top: 8px;
}

.facts-top {
  margin-top: 0;
}

.prio-change label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  margin: 18px 0 0;
  font-size: 14px;
}

.facts dt {
  color: var(--ink-3);
}

.facts dd {
  margin: 0;
  text-align: right;
}

/* Podgląd zrzutu */
.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 96vw;
  max-height: 96vh;
  overflow: visible;
}

.lightbox::backdrop {
  background: rgba(12, 20, 26, 0.82);
}

.lightbox img {
  display: block;
  max-width: 94vw;
  max-height: 84vh;
  border-radius: var(--radius);
  background: #fff;
}

.lightbox-close {
  position: absolute;
  right: -6px;
  top: -46px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-open {
  display: inline-block;
  margin-top: 10px;
  color: #fff;
  font-size: 14px;
}

.lightbox-open:hover {
  color: #fff;
}

/* --------------------------------------------------------------------------
   Logowanie
   -------------------------------------------------------------------------- */
.auth-page {
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(14, 102, 112, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 102, 112, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
}

.auth-wrap {
  min-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 12px 32px rgba(22, 34, 43, 0.08);
}

.auth-card > * + * {
  margin-top: 18px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.auth-mark {
  width: 46px;
  height: 46px;
  flex: none;
}

.auth-brand h1 {
  font-size: 22px;
  letter-spacing: -0.01em;
}

.auth-brand p {
  color: var(--ink-3);
  font-size: 14px;
}

.auth-foot {
  max-width: 400px;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}

/* --------------------------------------------------------------------------
   Responsywność
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-main {
    order: 0;
  }

  .detail-side {
    display: contents;
  }

  .signoff {
    order: -1;
  }

  .side-facts {
    order: 5;
  }

  .seals {
    max-width: 380px;
    margin: 0 auto;
  }
}

@media (max-width: 900px) {
  .brand-name span {
    display: none;
  }
}

@media (max-width: 980px) {
  .project-row {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    grid-template-areas:
      "chip main date"
      "chip stats todo";
    gap: 8px 16px;
  }

  .project-todo {
    justify-self: end;
  }

  .projmenu > summary {
    max-width: 200px;
  }
}

@media (max-width: 820px) {
  .bug-row {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "key date date"
      "main main main"
      "status status seal";
    gap: 8px 12px;
    padding: 14px 16px 14px 20px;
  }

  .bug-date {
    flex-direction: row;
    gap: 6px;
    justify-self: end;
  }

  .who {
    display: none;
  }

  .prio-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .page {
    padding: 20px 14px 56px;
  }

  .topbar-inner {
    padding: 8px 14px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .mainnav {
    margin: 0;
  }

  .proj-name {
    display: none;
  }

  .dropdown-panel.projmenu-panel {
    left: -48px;
  }

  .project-row {
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas:
      "chip main"
      "chip stats"
      "chip todo"
      "chip date";
    padding: 16px;
  }

  .proj-chip {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    font-size: 12px;
    align-self: start;
  }

  .project-todo,
  .project-date {
    justify-self: start;
    align-items: flex-start;
    text-align: left;
  }

  .project-date {
    flex-direction: row;
    gap: 6px;
  }

  .projects-head .btn {
    padding: 0 12px;
  }

  .mainnav-link {
    padding: 6px 8px;
  }

  .topbar-actions {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .topbar-actions > .btn {
    flex: 1;
    padding: 0 10px;
  }

  .usermenu {
    position: absolute;
    right: 10px;
    top: 8px;
  }

  .topbar-inner {
    position: relative;
  }

  .page-title,
  .bug-head-title {
    font-size: 25px;
  }

  .panel {
    padding: 18px;
  }

  .filters select {
    flex: 1;
  }

  .att-image {
    width: calc(50% - 6px);
  }

  .dropzone,
  .audio-bar {
    flex-wrap: wrap;
  }

  .tl-time {
    margin-left: 0;
    width: 100%;
  }

  .form-actions {
    flex-wrap: wrap;
  }

  .form-actions .btn {
    flex: 1 1 auto;
  }
}

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