/* DigiPin: palette tokens, base and login card. Mirrors docs/design/workspace-mockup.html. */
:root {
  --c0: #06141B;
  --c1: #11212D;
  --c2: #253745;
  --c3: #4A5C6A;
  --c4: #9BA8AB;
  --c5: #CCD0CF;

  /* Digitalka brand green (logo, digitalka.cz): accent for primary actions. */
  --brand: #52BE8C;
  --brand-hi: #6ACB9D;

  --open: #6FA8E8;
  --waiting: #E3B35C;
  --fixed: #A592F0;
  --done: #52BE8C;
  --returned: #EB7F6E;
  --wontfix: #9BA8AB;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--c0);
  color: var(--c5);
  font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 20px; font-weight: 600; line-height: 1.25; }

a { color: inherit; }

button, input, select, textarea { font: inherit; color: inherit; }

/* Centred card used by the login pages */
.card {
  width: min(400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 32px 32px;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  background: var(--c1);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}

.card .logo {
  width: 28px;
  height: 28px;
  margin-bottom: 20px;
  border-radius: 8px;
  background: var(--brand);
  display: grid;
  place-items: center;
}

.card .logo i {
  width: 11px;
  height: 11px;
  background: var(--c0);
  border-radius: 50% 50% 50% 2px;
  transform: rotate(-45deg);
}

.card .lead { margin: 8px 0 22px; color: var(--c4); }

.card label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--c4);
}

.card input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: var(--c0);
  border: 0;
  border-radius: 10px;
  outline: 0;
}

.card input::placeholder { color: var(--c3); }
.card input:focus-visible { box-shadow: 0 0 0 2px var(--brand); }

.btn,
.card button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: var(--c0);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover,
.card button:hover { background: var(--brand-hi); }
.btn:focus-visible,
.card button:focus-visible { outline: 2px solid var(--brand-hi); outline-offset: 2px; }

.card .link { color: var(--c4); font-size: 13px; }
.card .link:hover { color: var(--c5); }

/* Logged-in shell */
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--c1); }
.topbar nav { display: flex; gap: 16px; flex: 1; }
.topbar a { text-decoration: none; color: var(--c4); }
.topbar a:hover { color: var(--c5); }
.topbar .who { color: var(--c4); }
.topbar button { background: none; border: 0; color: var(--c4); cursor: pointer; }
.topbar button:hover { color: var(--c5); }
.page { padding: 24px 20px; }

/* Screens: lists, forms, badges */
.page.narrow { max-width: 720px; margin: 0 auto; padding-top: 40px; padding-bottom: 80px; }
.page:not(.narrow) { max-width: 1100px; margin: 0 auto; padding-top: 40px; padding-bottom: 80px; }
.page h1 { margin-bottom: 8px; }
.page h2 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-head h1 { margin: 0; }
.muted, .hint, .crumb { color: var(--c4); }
.crumb { margin-bottom: 12px; font-size: 13px; }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--c5); }
.hint { font-size: 12px; margin: -8px 0 18px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

.btn-inline { display: inline-block; width: auto; padding: 9px 18px; }
.btn-quiet {
  padding: 6px 12px; border: 0; border-radius: 8px; background: var(--c2);
  color: var(--c5); cursor: pointer; font-size: 13px;
}
.btn-quiet:hover { background: var(--c3); }
.btn-quiet.danger { color: var(--returned); }
.btn-quiet:focus-visible { outline: 2px solid var(--c4); outline-offset: 2px; }

.tag {
  display: inline-block; padding: 1px 8px; border-radius: 99px;
  background: var(--c2); color: var(--c4); font-size: 11px; vertical-align: middle;
}


/* Project list */
.plist, .rows { list-style: none; display: grid; gap: 8px; }
.prow, .row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px; background: var(--c1); border-radius: 12px;
}
.prow:hover { background: #162838; }
.is-archived { opacity: .6; }
.prow-main { flex: 1; min-width: 0; display: grid; text-decoration: none; }
.prow-name { font-weight: 600; color: var(--c5); }
.prow-host, .row-sub { color: var(--c4); font-size: 12px; }
.prow-link { color: var(--c4); font-size: 13px; text-decoration: none; }
.prow-link:hover { color: var(--c5); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: 99px; background: var(--c0); font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--c4); }
.badge.zero { opacity: .45; }
.badge.open i { background: var(--open); }
.badge.waiting i { background: var(--waiting); }
.badge.fixed i { background: var(--fixed); }
.badge.done i { background: var(--done); }
.badge.returned i { background: var(--returned); }
.badge.wontfix i { background: var(--wontfix); }
.badge.open { color: var(--open); }
.badge.waiting { color: var(--waiting); }
.badge.fixed { color: var(--fixed); }
.badge.done { color: var(--done); }
.badge.returned { color: var(--returned); }
.badge.wontfix { color: var(--wontfix); }
.blabel { color: var(--c4); }

/* Rows (people, clients) */
.row-main { flex: 1; min-width: 0; display: grid; overflow-wrap: anywhere; }
.row-title { font-weight: 600; }
.row-main .tag { justify-self: start; margin-top: 4px; }

.group { margin-top: 40px; }

/* Forms */
.form { margin-top: 24px; display: grid; }
.form label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--c4); }
.form label.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 18px; font-size: 14px; color: var(--c5); }
.form input[type="text"], .form input[type="time"], .form input[type="number"],
.form input[type="email"], .form select, .form textarea {
  width: 100%; padding: 10px 12px; margin-bottom: 18px; background: var(--c1);
  border: 0; border-radius: 10px; outline: 0; color: var(--c5); font: inherit;
  color-scheme: dark; box-sizing: border-box;
}
.form input[type="time"], .form input[type="number"] { min-height: 40px; }
.form textarea { resize: vertical; }
.form input:disabled { color: var(--c4); }
.form input:focus-visible, .form select:focus-visible, .form textarea:focus-visible { box-shadow: 0 0 0 2px var(--brand); }
.form input[type="checkbox"] { accent-color: var(--brand); width: 16px; height: 16px; }
.form select { appearance: none; }
.form .actions { display: flex; align-items: center; gap: 18px; margin-top: 6px; }
.form .link { color: var(--c4); font-size: 13px; }
.form .link:hover { color: var(--c5); }
.rows form, .group form { display: inline; }
.group form.form { display: grid; }

@media (max-width: 640px) {
  .prow { flex-wrap: wrap; }
  .blabel { display: none; }
  .row { flex-wrap: wrap; }
}

/* Review screen and job polling */
.job { margin: 16px 0; padding: 10px 14px; border-radius: 10px; background: var(--c1); color: var(--c4); }
.job.running, .job.pending { color: var(--waiting); }
.job.done { color: var(--done); }
.job.failed { color: var(--returned); }
.pick { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.pick input[type="checkbox"] { accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.row-title, .row-main .muted { overflow-wrap: anywhere; }
.tag.warn { color: var(--waiting); }
.review .actions { margin-top: 24px; }

/* Fix flow: place the after-pin on the new version */
.fix-box > .job + form { display: inline-block; margin-top: 8px; }
.fix-place { margin: 16px 0; }
.fix-place-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.fix-hint { margin: 0; color: var(--c5); }
.fix-target { display: block; width: 100%; height: auto; cursor: crosshair; border-radius: 10px; background: var(--c1); user-select: none; -webkit-user-drag: none; }
.fix-stage { position: relative; }

/* Helpers */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.js .js-hide { display: none; }

/* ---------- Workspace: full window, mirrors docs/design/workspace-mockup.html ---------- */
.ws, .cmp {
  position: fixed; inset: 0; display: grid; grid-template-rows: 56px minmax(0, 1fr);
  background: var(--c1);
}
.ws textarea, .cmp textarea, .phone-list textarea {
  display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; outline: 0;
  background: var(--c1); color: var(--c5); font: inherit; font-size: 13px; resize: vertical;
}
.ws textarea::placeholder, .phone-list textarea::placeholder { color: var(--c3); }
.ws textarea:focus-visible, .phone-list textarea:focus-visible { box-shadow: 0 0 0 2px var(--brand); }

/* top bar */
.ws-top {
  display: flex; align-items: center; gap: 16px; min-width: 0; height: 56px; padding: 0 20px;
  border-bottom: 1px solid rgba(155, 168, 171, .08); background: var(--c1);
}
.ws-top .logo { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; }
.ws-top .logo i { width: 10px; height: 10px; background: var(--c0); border-radius: 50% 50% 50% 2px; transform: rotate(-45deg); }
.proj { min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj small { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--c4); font-size: 12px; font-weight: 400; line-height: 1.2; }
.sp { flex: 1; }
.seg { flex: none; display: flex; padding: 3px; border-radius: 10px; background: var(--c0); }
.seg a, .seg button {
  padding: 5px 14px; border: 0; border-radius: 8px; background: none; color: var(--c4);
  font-size: 13px; line-height: 1.5; text-decoration: none; cursor: pointer;
}
.seg a:hover, .seg button:hover { color: var(--c5); }
.seg .on, .seg .on:hover { background: var(--c2); color: var(--c5); }
.seg.sm a, .seg.sm button { padding: 3px 10px; font-size: 12px; }
.icon-btn { flex: none; padding: 6px 10px; border-radius: 8px; color: var(--c4); font-size: 13px; text-decoration: none; white-space: nowrap; }
.icon-btn:hover { background: var(--c2); color: var(--c5); }
.avatar {
  flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--c3); color: var(--c5);
  display: grid; place-items: center; font-size: 12px; font-weight: 600; line-height: 1;
}
.avatar.sm { width: 20px; height: 20px; font-size: 9px; }

/* menus are <details>: no script needed */
.menu { position: relative; flex: none; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:focus-visible { outline: 2px solid var(--c4); outline-offset: 2px; }
.ver > summary { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; color: var(--c4); font-size: 13px; white-space: nowrap; }
.ver > summary b { color: var(--c5); font-weight: 500; }
.ver > summary:hover, .ver[open] > summary { background: var(--c2); }
.caret { font-size: 10px; }
.menu-body {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 260px; max-height: 70vh;
  overflow: auto; padding: 6px; border-radius: 12px; background: var(--c2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}
.menu-body.right { left: auto; right: 0; min-width: 200px; }
.menu-body form { display: block; }
.menu-item {
  display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 7px 10px; border: 0;
  border-radius: 8px; background: none; color: var(--c5); font-size: 13px; text-align: left;
  text-decoration: none; cursor: pointer;
}
.menu-item:hover { background: rgba(155, 168, 171, .1); }
.menu-item.on { background: rgba(6, 20, 27, .35); }
.menu-item b { min-width: 26px; font-weight: 600; }
.menu-item span { color: var(--c4); font-size: 12px; }
.menu-sep { height: 1px; margin: 6px 4px; background: rgba(155, 168, 171, .12); }
.menu-who { padding: 6px 10px 8px; color: var(--c4); font-size: 12px; overflow-wrap: anywhere; }

/* three columns, each scrolls on its own */
.ws-main { display: grid; grid-template-columns: 230px minmax(0, 1fr) 380px; min-height: 0; }
.ws.no-left .ws-main { grid-template-columns: 0 minmax(0, 1fr) 380px; }
.ws.no-right .ws-main { grid-template-columns: 230px minmax(0, 1fr) 0; }
.ws.no-left.no-right .ws-main { grid-template-columns: 0 minmax(0, 1fr) 0; }
.ws.no-left .ws-pages, .ws.no-right .side { visibility: hidden; padding: 0; border: 0; }

/* pages */
.ws-pages { min-width: 0; overflow: auto; padding: 18px 12px; }
.lbl { padding: 0 10px 8px; color: var(--c3); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.pg { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--c4); text-decoration: none; }
.pg:hover { background: rgba(37, 55, 69, .5); }
.pg.on { background: var(--c2); color: var(--c5); }
.pg .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg .miss { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--returned); font-size: 11px; line-height: 1.3; }
.pg .cnt { color: var(--c5); font-size: 12px; font-variant-numeric: tabular-nums; }
.pg .chg { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--fixed); }
.gap { height: 18px; }

/* canvas */
.canvas { position: relative; min-width: 0; overflow: auto; padding: 18px 32px 48px; background: var(--c0); }
.cv-head { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.cv-title { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: center; justify-content: safe center; gap: 12px; white-space: nowrap; overflow: hidden; }
/* The page title keeps its full width (up to the whole header): only the version line and
   the click hint shrink, and the title ends in an ellipsis only when it alone is too long. */
.cv-title b { flex: none; max-width: 100%; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.cv-title > span { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--c3); font-size: 12px; }
.tgl { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--c3); cursor: pointer; }
.tgl:hover { background: var(--c1); color: var(--c5); }
.tgl:focus-visible { outline: 2px solid var(--c4); outline-offset: 1px; }
.empty { max-width: 420px; margin: 80px auto; color: var(--c4); text-align: center; }
.empty p, .empty .job { margin: 0 0 14px; }
.empty .btn-inline { margin: 0 auto; }
.empty .btn-quiet { display: inline-block; text-decoration: none; }
.truncated { margin-top: 12px; color: var(--c4); font-size: 12px; text-align: center; }

.shot {
  position: relative; max-width: 100%; margin: 0 auto; border-radius: 10px; background: #f6f4f0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
.ws.zoom-full .shot { max-width: none; }
.shot img { display: block; width: 100%; height: auto; border-radius: 10px; user-select: none; -webkit-user-drag: none; }
@media (min-width: 900px) {
  .shot[data-can-pin] img { cursor: crosshair; }
}
.pins, .regions { position: absolute; inset: 0; pointer-events: none; }

/* pin: rounded with one sharp corner (bottom left) that marks the spot */
.pin {
  position: absolute; width: 28px; height: 28px; margin-top: -28px; padding: 0; border: 0;
  border-radius: 50% 50% 50% 4px; display: grid; place-items: center;
  font: 700 12px Inter, system-ui, sans-serif; color: var(--c0); pointer-events: auto; cursor: pointer;
  box-shadow: 0 0 0 3px rgba(6, 20, 27, .85), 0 6px 16px rgba(0, 0, 0, .35);
  transform-origin: 0 100%; transition: transform .15s, opacity .15s;
}
.pin:hover, .pin.hl { transform: scale(1.1); }
.pin.sel { transform: scale(1.12); box-shadow: 0 0 0 3px var(--c5), 0 0 0 6px rgba(6, 20, 27, .6), 0 6px 16px rgba(0, 0, 0, .35); z-index: 2; }
.pin:focus-visible { outline: 2px solid var(--c5); outline-offset: 3px; }
.pin.old { opacity: .5; }
.pin.old:hover, .pin.old.sel, .pin.old.hl { opacity: .9; }
.pin-from {
  position: absolute; left: 34px; top: 50%; transform: translateY(-50%); padding: 1px 6px;
  border-radius: 6px; background: rgba(6, 20, 27, .85); color: var(--c5);
  font: 500 10px Inter, system-ui, sans-serif; white-space: nowrap;
}
.pin.ghost { background: var(--c5); pointer-events: none; z-index: 3; }
.s-open { background: var(--open); }
.s-waiting { background: var(--waiting); }
.s-fixed { background: var(--fixed); }
.s-done { background: var(--done); }
.s-returned { background: var(--returned); }
.s-wontfix { background: var(--wontfix); }

/* marked areas: status-coloured outline, very light fill; the pin sits on the top-left
   corner. Faint and dashed on a newer version than their own, like the pin. */
.area {
  --sc: var(--brand);
  position: absolute; border: 2px solid var(--sc); border-radius: 4px; pointer-events: none;
  background: color-mix(in srgb, var(--sc) 8%, transparent);
  transition: background-color .15s, box-shadow .15s, opacity .15s;
}
.area[data-s="open"] { --sc: var(--open); }
.area[data-s="waiting"] { --sc: var(--waiting); }
.area[data-s="fixed"] { --sc: var(--fixed); }
.area[data-s="done"] { --sc: var(--done); }
.area[data-s="returned"] { --sc: var(--returned); }
.area[data-s="wontfix"] { --sc: var(--wontfix); }
.area.hl, .area.sel {
  background: color-mix(in srgb, var(--sc) 18%, transparent);
  box-shadow: 0 0 0 1px rgba(6, 20, 27, .55), 0 0 0 4px color-mix(in srgb, var(--sc) 35%, transparent);
}
.area.sel { z-index: 1; }
.area.old { border-style: dashed; opacity: .45; background: none; }
.area.old.hl, .area.old.sel { opacity: .9; }
/* the area being drawn, and the new pin's area while its popover is open */
.area.draft { background: color-mix(in srgb, var(--brand) 16%, transparent); z-index: 3; }
.ws.banding, .ws.banding * { cursor: crosshair; user-select: none; }

/* new-pin popover */
.pop {
  position: absolute; z-index: 20; width: 300px; padding: 12px; border-radius: 14px;
  background: var(--c2); color: var(--c5); box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.pop[hidden] { display: none; }
.pop-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ignore regions (team) */
.drawbar {
  display: flex; align-items: center; gap: 10px; max-width: 780px; margin: 0 auto 12px; padding: 8px 8px 8px 14px;
  border-radius: 12px; background: var(--c1); color: var(--c4); font-size: 13px;
}
.drawbar[hidden] { display: none; }
.drawbar-hint { flex: 1; }
.drawbar-msg { color: var(--returned); }
.ws .drawbar .btn { flex: none; width: auto; padding: 7px 14px; }
.ws.drawing .regions { pointer-events: auto; cursor: crosshair; touch-action: none; }
.ws.drawing .pins { display: none; }
.region {
  position: absolute; border-radius: 4px; box-shadow: inset 0 0 0 2px var(--waiting);
  background: repeating-linear-gradient(45deg, rgba(227, 179, 92, .3) 0 6px, rgba(227, 179, 92, .12) 6px 12px);
}
.region button {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 6px;
  background: var(--c0); color: var(--c5); font-size: 13px; line-height: 1; cursor: pointer;
}
.region.draft button { display: none; }

/* buttons as in the mockup */
.ws .btn, .cmp .btn, .phone-list .btn {
  display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; font-size: 13px;
  font-weight: 600; text-align: center; cursor: pointer; list-style: none;
}
.ws summary.btn::-webkit-details-marker, .phone-list summary.btn::-webkit-details-marker { display: none; }
.ws .btn.ok, .phone-list .btn.ok { background: var(--done); color: var(--c0); }
.ws .btn.ok:hover, .phone-list .btn.ok:hover { background: var(--brand-hi); }
.ws .btn.fix, .phone-list .btn.fix { background: var(--fixed); color: var(--c0); }
.ws .btn.fix:hover, .phone-list .btn.fix:hover { background: #b5a6f4; }
.ws .btn.back, .phone-list .btn.back { background: transparent; color: var(--c5); box-shadow: inset 0 0 0 1px var(--c3); font-weight: 500; }
.ws .btn.back:hover, .phone-list .btn.back:hover { background: rgba(155, 168, 171, .08); }
.linkish { padding: 0; border: 0; background: none; color: var(--c5); font: inherit; font-size: 12px; opacity: .85; cursor: pointer; }
.linkish:hover { opacity: 1; text-decoration: underline; }
.linkish.danger { color: var(--returned); }

/* comment panel */
.side { min-width: 0; overflow: auto; padding-bottom: 24px; border-left: 1px solid rgba(155, 168, 171, .08); }
.tech-new { margin: 14px 14px 0; }
.tech-new > summary { display: inline-block; list-style: none; color: var(--c4); font-size: 12.5px; cursor: pointer; }
.tech-new > summary::-webkit-details-marker { display: none; }
.tech-new > summary:hover { color: var(--c5); }
.tech-new form { display: grid; gap: 8px; margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--c2); }
.tech-new textarea { background: var(--c1); }
.radio { display: flex; align-items: center; gap: 8px; color: var(--c4); font-size: 12.5px; }
.radio input { accent-color: var(--brand); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 14px 14px 10px; }
.tab { padding: 4px 10px; border-radius: 999px; color: var(--c4); font-size: 12.5px; text-decoration: none; cursor: pointer; }
.tab b { margin-left: 5px; color: var(--c3); font-weight: 500; font-variant-numeric: tabular-nums; }
.tab:hover { color: var(--c5); }
.tab.on, .tab.on:hover { background: var(--brand); color: var(--c0); }
.list { padding: 0 8px; }
.list-empty { padding: 6px 22px; color: var(--c4); font-size: 13px; }
.item { display: flex; align-items: flex-start; gap: 12px; padding: 10px; border-radius: 10px; color: inherit; text-decoration: none; cursor: pointer; }
.item:hover, .item.hl { background: rgba(37, 55, 69, .5); }
.item:focus-visible { outline: 2px solid var(--c4); outline-offset: -2px; }
.num {
  flex: none; width: 22px; height: 22px; border-radius: 50% 50% 50% 3px; display: grid; place-items: center;
  color: var(--c0); font-size: 11px; font-weight: 700;
}
.num.tech { border-radius: 6px; }
.item .tx { flex: 1; min-width: 0; }
.item .tt { display: block; color: var(--c5); overflow-wrap: anywhere; }
.item .mt { display: block; margin-top: 1px; color: var(--c3); font-size: 12px; }

/* status badge with a dot */
.sbadge {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px;
  border-radius: 999px; background: none; font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.sbadge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sbadge.s-open { color: var(--open); background: rgba(111, 168, 232, .12); }
.sbadge.s-waiting { color: var(--waiting); background: rgba(227, 179, 92, .12); }
.sbadge.s-fixed { color: var(--fixed); background: rgba(165, 146, 240, .14); }
.sbadge.s-done { color: var(--done); background: rgba(95, 194, 142, .12); }
.sbadge.s-returned { color: var(--returned); background: rgba(235, 127, 110, .12); }
.sbadge.s-wontfix { color: var(--wontfix); background: rgba(155, 168, 171, .12); }

/* thread card */
.thread { margin: 6px 8px 8px; padding: 14px 14px 12px; border-radius: 14px; background: var(--c2); box-shadow: 0 0 0 1px rgba(155, 168, 171, .06); }
.list .thread { margin: 6px 0 8px; }
.th-top { display: flex; align-items: flex-start; gap: 10px; }
.th-top .num { margin-top: -1px; }
.th-top .ttl {
  flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; line-height: 20px; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.th-top .sbadge { margin-top: 0; }
.th-close {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin: -3px -4px 0 -2px;
  border-radius: 8px; color: var(--c4); text-decoration: none;
}
.th-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.th-close:hover { background: rgba(6, 20, 27, .35); color: var(--c5); }
.th-close:focus-visible { outline: 2px solid var(--c4); outline-offset: 1px; }
.th-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px 32px; color: var(--c4); font-size: 12px; }
.th-who { display: inline-flex; align-items: center; gap: 6px; }
.th-assign {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; height: 26px; padding: 0 4px 0 3px;
  border-radius: 999px; background: rgba(6, 20, 27, .28); transition: background .15s;
}
.th-assign:hover, .th-assign:focus-within { background: rgba(6, 20, 27, .45); }
.th-assign .avatar.sm { width: 20px; height: 20px; }
.avatar.none { background: transparent; box-shadow: inset 0 0 0 1px var(--c3); color: var(--c4); }
.th-assign select {
  max-width: 210px; padding: 2px 18px 2px 0; border: 0; background: none; color: var(--c5); font: inherit;
  font-size: 12px; cursor: pointer; appearance: none; outline: 0;
  background-image: linear-gradient(45deg, transparent 50%, var(--c4) 50%), linear-gradient(135deg, var(--c4) 50%, transparent 50%);
  background-position: right 7px center, right 3px center; background-size: 4px 4px; background-repeat: no-repeat;
}
.th-assign select:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.th-assign select option { background: var(--c1); color: var(--c5); }
.th-take { margin-left: auto; }
.th-take .linkish { color: var(--c4); }
.th-take .linkish:hover { color: var(--c5); }

/* before / after: two equal tiles, one full-width when alone */
.ba { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.ba.single { grid-template-columns: minmax(0, 1fr); }
.ba-tile { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 10px; background: rgba(6, 20, 27, .3); }
.ba figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 9px; color: var(--c4); font-size: 11px; line-height: 1.3; }
.ba figcaption span:first-child { font-weight: 600; letter-spacing: .02em; text-transform: uppercase; font-size: 10.5px; }
.ba figcaption a { color: var(--c4); text-decoration: none; font-variant-numeric: tabular-nums; }
.ba figcaption a:hover { color: var(--c5); text-decoration: underline; }
.ba-zoom { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 10; background: #ebe5db; cursor: zoom-in; }
.ba.single .ba-zoom { aspect-ratio: 2 / 1; }
.ba-zoom.whole { background: var(--c1); }
.ba-zoom:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.ba-zoom::after {
  content: ""; position: absolute; right: 6px; bottom: 6px; width: 22px; height: 22px; border-radius: 7px;
  background: rgba(6, 20, 27, .7) center / 13px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23CCD0CF' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M14 4h6v6M10 20H4v-6M20 4l-7 7M4 20l7-7'/%3E%3C/svg%3E");
  opacity: 0; transition: opacity .15s;
}
.ba-zoom:hover::after, .ba-zoom:focus-visible::after { opacity: 1; }
@media (hover: none) { .ba-zoom::after { opacity: .85; } }
/* a point: cover, centred on the pin; an area (any aspect): shown whole, outline included */
.crop { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.crop.whole { object-fit: contain; }

.after-text { margin-bottom: 14px; padding: 10px 12px; border-radius: 10px; background: var(--c1); }
.after-text .cap { margin-bottom: 4px; color: var(--c4); font-size: 10.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.after-text p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }

/* messages */
.msgs { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.msg { position: relative; }
.msg .m { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; margin-bottom: 3px; padding-right: 28px; color: var(--c4); font-size: 12px; line-height: 18px; }
.msg .m-who { color: var(--c5); font-weight: 600; }
.m-when { color: var(--c3); font-variant-numeric: tabular-nums; }
.role-tag {
  display: inline-flex; align-items: center; height: 17px; padding: 0 7px; border-radius: 999px;
  background: rgba(155, 168, 171, .12); color: var(--c4); font-size: 10.5px; font-weight: 500; letter-spacing: .01em;
}
.role-tag.client { background: rgba(111, 168, 232, .14); color: var(--open); }
.role-tag.internal { background: rgba(227, 179, 92, .16); color: var(--waiting); }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.msg .body a { color: var(--open); }
.msg.internal { margin: 0 -8px; padding: 8px; border-radius: 10px; background: rgba(227, 179, 92, .07); box-shadow: inset 2px 0 0 rgba(227, 179, 92, .5); }
.edit > summary {
  position: absolute; top: -3px; right: -4px; display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: 7px; color: var(--c4); list-style: none; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s;
}
.msg.internal .edit > summary { top: 5px; right: 4px; }
.edit > summary::-webkit-details-marker { display: none; }
.edit > summary svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.msg:hover .edit > summary, .edit > summary:focus-visible, .edit[open] > summary { opacity: 1; }
.edit > summary:hover, .edit[open] > summary { background: rgba(6, 20, 27, .35); color: var(--c5); }
.edit > summary:focus-visible { outline: 2px solid var(--c4); outline-offset: 0; }
@media (hover: none) { .edit > summary { opacity: .8; } }
.edit form { margin-top: 8px; }
/* system rows: small, centred, a dot in the status colour */
.sys { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 12px; color: var(--c4); font-size: 11.5px; text-align: center; }
.sys p { display: inline-flex; align-items: center; gap: 6px; }
.sys-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--c4); }
.sys.s-open .sys-dot { background: var(--open); }
.sys.s-waiting .sys-dot { background: var(--waiting); }
.sys.s-fixed .sys-dot { background: var(--fixed); }
.sys.s-done .sys-dot { background: var(--done); }
.sys.s-returned .sys-dot { background: var(--returned); }
.sys.s-wontfix .sys-dot { background: var(--wontfix); }
.sys.s-open, .sys.s-waiting, .sys.s-fixed, .sys.s-done, .sys.s-returned, .sys.s-wontfix, .sys.s-assign { background: none; }
.sys q { max-width: 100%; padding: 4px 10px; border-radius: 8px; background: rgba(6, 20, 27, .25); color: var(--c5); font-size: 12px; quotes: "„" "“"; overflow-wrap: anywhere; }

/* actions: the main decision as big buttons, the rest as compact ghost buttons in a row */
.actions { display: grid; gap: 8px; margin: 2px 0 12px; }
.act-main { display: flex; flex-wrap: wrap; gap: 8px; }
.act-main > .act { flex: 1 1 0; min-width: 120px; }
.act-main > details.act[open] { flex-basis: 100%; }
.act-more { display: flex; flex-wrap: wrap; gap: 6px; }
.act-more > details.act[open] { flex-basis: 100%; }
.actions .act form { display: block; }
.btn-sm {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--c5); box-shadow: inset 0 0 0 1px rgba(155, 168, 171, .25);
  font: inherit; font-size: 12px; font-weight: 500; white-space: nowrap; list-style: none; cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.btn-sm::-webkit-details-marker { display: none; }
.btn-sm:hover, details[open] > .btn-sm { background: rgba(155, 168, 171, .1); box-shadow: inset 0 0 0 1px rgba(155, 168, 171, .4); }
.btn-sm:focus-visible { outline: 2px solid var(--c4); outline-offset: 1px; }
.btn-sm .dot { width: 6px; height: 6px; border-radius: 50%; }
.prompt form { display: grid; gap: 8px; margin-top: 8px; }
.thread .fix-box .job { margin: 0; padding: 9px 12px; background: var(--c1); font-size: 13px; }
.ws .btn:disabled, .phone-list .btn:disabled { opacity: .5; cursor: default; }

/* composer: reply, edit, reasons; the toolbar sits inside the field */
.composer {
  position: relative; display: flex; flex-direction: column; border-radius: 12px; background: var(--c1);
  box-shadow: inset 0 0 0 1px rgba(155, 168, 171, .08); transition: box-shadow .15s;
}
.composer:focus-within { box-shadow: inset 0 0 0 1px var(--brand), 0 0 0 3px rgba(82, 190, 140, .14); }
.composer[aria-invalid="true"], .composer:has(textarea[aria-invalid="true"]) { box-shadow: inset 0 0 0 1.5px var(--returned); }
.ws .composer textarea, .phone-list .composer textarea, .composer textarea {
  display: block; width: 100%; min-height: 36px; max-height: 220px; padding: 9px 12px 4px; border: 0; border-radius: 12px 12px 0 0;
  background: none; color: var(--c5); font: inherit; font-size: 13px; line-height: 1.5; resize: none; outline: 0;
  field-sizing: content; box-shadow: none !important;
}
.composer textarea::placeholder { color: var(--c3); }
.composer-bar { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 2px 4px 4px 6px; }
.composer-tools { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.composer-send {
  flex: none; height: 28px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--c3); color: var(--c5);
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .15s, opacity .15s;
}
.composer-send.primary { background: var(--brand); color: var(--c0); }
.composer-send.ghost { background: none; color: var(--c4); font-weight: 500; }
.composer-send.ghost:hover { background: rgba(155, 168, 171, .1); color: var(--c5); }
.pop .composer { background: var(--c1); }
.tech-new .composer { background: var(--c1); }
.composer-send:hover { background: #5a6d7c; }
.composer-send.primary:hover { background: var(--brand-hi); }
.composer-send:disabled, .composer-send:disabled:hover { background: rgba(155, 168, 171, .14); color: var(--c3); cursor: default; }
.composer-send:focus-visible { outline: 2px solid var(--brand-hi); outline-offset: 1px; }
.reply { margin-top: 2px; }
/* the "internal" switch */
.switch { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: var(--c4); font-size: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; flex: none; width: 26px; height: 15px; border-radius: 99px; background: var(--c3); transition: background .15s; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--c5); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--waiting); }
.switch input:checked + .switch-track::after { transform: translateX(11px); background: var(--c0); }
.switch input:checked ~ .switch-label { color: var(--waiting); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--waiting); outline-offset: 2px; }
.switch-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-foot { margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(155, 168, 171, .1); text-align: right; }
.th-foot .linkish { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; opacity: .8; }
.th-foot .linkish:hover { opacity: 1; }
.th-foot .linkish svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* the fix flow's place screen opens over the whole window */
.fix-box:has(.fix-place) { position: fixed; inset: 0; z-index: 50; overflow: auto; padding: 24px; background: rgba(6, 20, 27, .96); }
.fix-box:has(.fix-place) .fix-place { max-width: 1440px; margin: 0 auto; }
.fix-box:has(.fix-place) .fix-stage { width: fit-content; max-width: 100%; margin: 0 auto; }
.fix-box:has(.fix-place) .fix-target { width: auto; max-width: 100%; margin: 0 auto; }

/* below 900 px the workspace gives way to the phone list (both are in the same response) */
.phone-list { display: none; }
@media (max-width: 899px) {
  .ws { display: none; }
  .phone-list { display: block; min-height: 100vh; padding-bottom: 32px; background: var(--c1); }
}
.ph-top { display: flex; align-items: center; gap: 12px; min-width: 0; height: 56px; padding: 0 16px; border-bottom: 1px solid rgba(155, 168, 171, .08); }
.ph-top .logo { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--c5); display: grid; place-items: center; }
.ph-top .logo i { width: 10px; height: 10px; background: var(--c0); border-radius: 50% 50% 50% 2px; transform: rotate(-45deg); }
.ph-pages { margin: 4px 16px 0; }
.ph-pages select {
  width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--c2); color: var(--c5);
  font: inherit; font-size: 14px;
}
.ph-tabs { padding: 12px 12px 8px; }
.phone-list .thread { margin: 6px 12px 10px; }
.notes { display: grid; gap: 10px; padding: 4px 12px 0; }
.note { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: var(--c2); color: inherit; text-decoration: none; }
.note:active { background: #2d4252; }
.note-top { display: flex; align-items: center; gap: 8px; }
.note-tt { color: var(--c5); overflow-wrap: anywhere; }
.note-mt { color: var(--c4); font-size: 12px; }
.note .ba { margin-bottom: 0; }
.note .after-text { margin-bottom: 0; }

/* the nav's count of notes waiting for me */
.nav-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--returned); color: var(--c0); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }

/* Moje poznámky */
.mine-group { margin-top: 28px; }
.mine-group h2 { display: flex; align-items: center; gap: 8px; }
.mine-group h2 .n { color: var(--c3); font-weight: 500; font-variant-numeric: tabular-nums; }
.mine-group .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c4); }
.mine-group .dot.s-open { background: var(--open); }
.mine-group .dot.s-waiting { background: var(--waiting); }
.mine-group .dot.s-fixed { background: var(--fixed); }
.mine-group .dot.s-returned { background: var(--returned); }
.mine-list { display: grid; gap: 2px; }

/* ---------- Version compare ---------- */
.cmp { background: var(--c0); }
.cmp .ws-top { background: var(--c1); }
.cmp-body { overflow: auto; padding: 20px 32px 48px; }
.cmp-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; max-width: 1480px; margin: 0 auto 16px; }
.cmp-pick { display: flex; align-items: center; gap: 10px; }
.cmp-pick select { padding: 6px 10px; border: 0; border-radius: 8px; background: var(--c1); color: var(--c5); font: inherit; font-size: 13px; }
.cmp-view { max-width: 1480px; margin: 0 auto; }
.cmp-view.mode-side .cmp-overlay, .cmp-view.mode-overlay .cmp-side { display: none; }
.cmp-side { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.cmp figcaption { margin-bottom: 6px; color: var(--c4); font-size: 12px; }
.cmp figcaption b { color: var(--c5); }
.cmp-side img, .cmp-base { display: block; width: 100%; height: auto; border-radius: 10px; background: #f6f4f0; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.cmp-overlay { max-width: 1100px; margin: 0 auto; }
.cmp-labels { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; color: var(--c4); font-size: 12px; }
.cmp-labels input[type="range"] { flex: 1; accent-color: var(--brand); }
.cmp-stage { position: relative; overflow: hidden; border-radius: 10px; cursor: ew-resize; touch-action: none; }
.cmp-top { position: absolute; top: 0; left: 0; width: 50%; overflow: hidden; }
.cmp-top img { display: block; max-width: none; height: auto; user-select: none; }
.cmp-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--c5); box-shadow: 0 0 0 1px rgba(6, 20, 27, .5); pointer-events: none; }
.cmp .empty { margin: 80px auto; }
@media (max-width: 899px) {
  .cmp { position: static; display: block; }
  .cmp-body { padding: 16px; }
  .cmp-side { grid-template-columns: 1fr; }
}
.ws .btn.btn-inline { display: inline-block; width: auto; }

/* Slack: channel picker and setup note */
a.btn-quiet { display: inline-block; text-decoration: none; }
.channel-list { display: grid; gap: 8px; max-height: 360px; overflow: auto; margin-bottom: 18px; }
.slack-setup .row-sub { overflow-wrap: anywhere; margin-top: 4px; }

/* People: team and clients grouped by project */
.pgroup { margin-top: 28px; }
.pgroup-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.pgroup-head h3 { font-size: 14px; font-weight: 600; margin: 0; }
.pgroup-head .host { color: var(--c4); font-weight: 400; margin-left: 8px; font-size: 12px; }
.pgroup-head a { color: var(--c4); font-size: 12px; text-decoration: none; }
.pgroup-head a:hover { color: var(--c5); }
.group form.add-inline, .add-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.add-inline input[type="text"], .add-inline input[type="email"] {
  flex: 1 1 180px; min-width: 0; padding: 8px 12px; background: var(--c1); border: 0;
  border-radius: 10px; outline: 0; color: var(--c5); font: inherit; font-size: 13px;
}
.add-inline input::placeholder { color: var(--c3); }
.add-inline input:focus-visible { box-shadow: 0 0 0 2px var(--brand); }
.archived-groups { margin-top: 36px; }
.archived-groups > summary { cursor: pointer; color: var(--c4); font-size: 13px; }
.archived-groups > summary:hover { color: var(--c5); }
.sub-h { margin-top: 28px; }

/* ---------- Alerts: one component for flashes, notices, toasts and form errors ---------- */
.alert {
  --ac: var(--open);
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--ac) 11%, var(--c1));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ac) 26%, transparent);
  color: var(--c5); font-size: 13.5px; line-height: 1.45; text-align: left;
}
.alert-success { --ac: var(--brand); }
.alert-info { --ac: var(--open); }
.alert-warning { --ac: var(--waiting); }
.alert-error { --ac: var(--returned); }
.alert-ico {
  flex: none; width: 18px; height: 18px; margin-top: 1px;
  fill: none; stroke: var(--ac); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.alert-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.alert-text b, .alert-text strong { font-weight: 600; }
.alert-text a { color: var(--c5); text-decoration: underline; text-underline-offset: 2px; }
.alert-x {
  flex: none; width: 22px; height: 22px; margin: -2px -4px -2px 0; padding: 0; border: 0; border-radius: 6px;
  background: none; color: var(--c4); font-size: 16px; line-height: 1; cursor: pointer;
}
.alert-x:hover { background: rgba(155, 168, 171, .12); color: var(--c5); }
.alert-x:focus-visible { outline: 2px solid var(--ac); outline-offset: 1px; }
/* in the page flow */
.page .alert, .alert.block { margin: 16px 0; }
.canvas > .alert { max-width: 780px; margin: 0 auto 12px; }
.phone-list > .alert { margin: 12px 16px; }
.form > .alert:first-of-type { margin-top: 0; }
/* compact, inside the thread card and the pin popover */
.alert.sm { gap: 8px; padding: 7px 10px; border-radius: 10px; font-size: 12.5px; }
.alert.sm .alert-ico { width: 15px; height: 15px; }
.thread .alert.sm, .pop .alert.sm, .tech-new .alert.sm { margin: 0 0 8px; }

/* toasts: top right under the bar, at the bottom on a phone */
.toasts {
  position: fixed; z-index: 70; top: 72px; right: 20px; display: grid; gap: 8px;
  width: min(380px, calc(100vw - 32px)); pointer-events: none;
}
.toasts .alert {
  pointer-events: auto; background: color-mix(in srgb, var(--ac) 14%, var(--c2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ac) 30%, transparent), 0 16px 40px rgba(0, 0, 0, .45);
  animation: toast-in .22s cubic-bezier(.2, .8, .2, 1);
}
.alert.leaving { opacity: 0; transform: translateY(-6px); transition: opacity .2s ease, transform .2s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .toasts { top: auto; bottom: 16px; left: 16px; right: 16px; width: auto; }
}

/* field errors (server and static/validate.js use the same markup) */
.field-error {
  display: flex; align-items: flex-start; gap: 6px; margin: -12px 0 16px;
  color: var(--returned); font-size: 12.5px; line-height: 1.4;
}
.field-error::before {
  content: "!"; flex: none; display: grid; place-items: center; width: 15px; height: 15px; margin-top: 1px;
  border-radius: 50%; background: var(--returned); color: var(--c0); font-size: 10px; font-weight: 800;
}
.card .field-error { margin: -8px 0 14px; }
.add-inline .field-error, .thread .field-error, .pop .field-error, .tech-new .field-error, .reply .field-error,
.fix-box .field-error { flex-basis: 100%; margin: 4px 0 2px; }
[aria-invalid="true"], .form [aria-invalid="true"], .card [aria-invalid="true"] {
  box-shadow: 0 0 0 1.5px var(--returned) !important;
}
.char-count { margin: 4px 2px 0; color: var(--c4); font-size: 11.5px; text-align: right; font-variant-numeric: tabular-nums; }
.char-count.over { color: var(--returned); font-weight: 600; }
.char-count[hidden] { display: none; }

/* ---------- Buttons shared outside the workspace ---------- */
.btn-ghost, .btn.btn-ghost {
  background: transparent; color: var(--c5); box-shadow: inset 0 0 0 1px var(--c3); font-weight: 500;
}
.btn-ghost:hover, .btn.btn-ghost:hover { background: rgba(155, 168, 171, .08); }
.btn.btn-danger { background: var(--returned); color: var(--c0); }
.btn.btn-danger:hover { background: #f19787; }

/* ---------- Confirm dialog (static/app.js, for form[data-confirm]) ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px;
  background: rgba(6, 20, 27, .72);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: fade-in .15s ease;
}
.modal {
  width: min(420px, 100%); padding: 22px 22px 18px; border-radius: 16px; background: var(--c2);
  box-shadow: 0 0 0 1px rgba(155, 168, 171, .1), 0 24px 60px rgba(0, 0, 0, .55);
  animation: modal-in .18s cubic-bezier(.2, .8, .2, 1);
}
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.modal-ico {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: rgba(235, 127, 110, .14);
}
.modal-ico .alert-ico { --ac: var(--returned); width: 18px; height: 18px; margin: 0; }
.modal.primary .modal-ico { background: rgba(82, 190, 140, .14); }
.modal.primary .modal-ico .alert-ico { --ac: var(--brand); }
.modal h2 { font-size: 16px; font-weight: 600; line-height: 1.3; }
.modal p { color: var(--c4); font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.modal-actions .btn { display: inline-block; width: auto; padding: 8px 16px; font-size: 13.5px; }
.modal-open { overflow: hidden; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Error page (src/error.rs) ---------- */
.err-body { background: radial-gradient(1200px 600px at 50% -10%, rgba(82, 190, 140, .08), transparent 60%), var(--c0); }
.err-card { text-align: center; padding: 34px 32px 30px; }
.err-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 26px; color: var(--c5); text-decoration: none; }
.err-brand .logo { margin: 0; box-shadow: 0 4px 14px rgba(82, 190, 140, .35); }
.err-word { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.err-word b { color: var(--brand); font-weight: 700; }
.err-code {
  margin-bottom: 6px; color: var(--c3); font-size: 44px; font-weight: 700; line-height: 1;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.err-card h1 { font-size: 21px; }
.err-card .lead { margin: 10px 0 26px; overflow-wrap: anywhere; }
.err-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.err-actions .btn { min-width: 120px; }
@media (prefers-reduced-motion: reduce) {
  .toasts .alert, .modal, .modal-bg { animation: none; }
  .alert.leaving { transition: none; }
}

/* ---------- Lightbox (static/lightbox.js) ---------- */
.lb {
  position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 56px 72px;
  background: rgba(4, 12, 17, .92); animation: fade-in .15s ease;
}
.lb-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; max-height: 100%; margin: 0; }
.lb-img {
  display: block; max-width: min(100%, 92vw); max-height: calc(100vh - 150px); width: auto; height: auto;
  border-radius: 10px; background: #ebe5db; box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  transition: opacity .15s;
}
.lb-img.loading { opacity: .4; }
.lb-cap { color: var(--c5); font-size: 13px; font-weight: 500; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.lb-btn {
  position: absolute; display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0;
  border-radius: 12px; background: rgba(37, 55, 69, .75); color: var(--c5); cursor: pointer; transition: background .15s, opacity .15s;
}
.lb-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-btn:hover { background: var(--c3); }
.lb-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.lb-btn:disabled { opacity: .3; cursor: default; }
.lb-btn[hidden] { display: none; }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-open { overflow: hidden; }
@media (max-width: 640px) {
  .lb { padding: 60px 12px 76px; }
  .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
  .lb-prev { left: calc(50% - 52px); }
  .lb-next { right: calc(50% - 52px); }
  .lb-img { max-height: calc(100vh - 170px); }
}
@media (prefers-reduced-motion: reduce) { .lb { animation: none; } }

/* ---------- Emoji picker (static/emoji.js) ---------- */
.emo-toggle {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px;
  background: none; color: var(--c4); cursor: pointer; transition: background .15s, color .15s;
}
.emo-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.emo-toggle:hover, .emo-toggle.on { background: rgba(155, 168, 171, .12); color: var(--c5); }
.emo-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.emo-wrap { position: relative; }
.emo-wrap textarea { padding-right: 38px; }
.emo-toggle.floating { position: absolute; right: 5px; bottom: 5px; }
.emo-panel {
  position: fixed; z-index: 85; width: 300px; max-height: min(340px, calc(100vh - 16px)); overflow: auto;
  padding: 8px 8px 10px; border-radius: 14px; background: var(--c2);
  box-shadow: 0 0 0 1px rgba(155, 168, 171, .12), 0 18px 44px rgba(0, 0, 0, .5);
  animation: modal-in .14s cubic-bezier(.2, .8, .2, 1);
}
.emo-head { padding: 6px 6px 4px; color: var(--c4); font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.emo-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emo {
  display: grid; place-items: center; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none;
  font-size: 19px; line-height: 1; cursor: pointer; transition: background .1s, transform .1s;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.emo:hover, .emo:focus-visible { background: rgba(155, 168, 171, .16); outline: 0; transform: scale(1.12); }
.emo:focus-visible { box-shadow: inset 0 0 0 2px var(--brand); }
@media (prefers-reduced-motion: reduce) { .emo-panel { animation: none; } .emo:hover, .emo:focus-visible { transform: none; } }
