/* Radar – dark, black + green. Inter for prose, a monospace stack for data. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/inter-latin-ext.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: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/inter-latin.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+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;

  --bg: #070907;
  --surface: #0d110e;
  --surface-2: #121713;
  --surface-3: #18201a;
  --border: #1f2a22;
  --border-strong: #2b382f;
  --text: #e4ece5;
  --muted: #8b998e;

  --green: #3df58a;
  --green-dim: #1f9d57;
  --green-tint: rgba(61, 245, 138, 0.1);
  --green-line: rgba(31, 157, 87, 0.6);
  --red: #ff7b72;
  --red-tint: rgba(255, 123, 114, 0.12);
  --amber: #f5a524;
  --amber-tint: rgba(245, 165, 36, 0.12);
  --sand: #cfc68f;
  --sand-tint: rgba(207, 198, 143, 0.1);
  --neutral-tint: rgba(139, 153, 142, 0.12);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --radius: 6px;
  --radius-lg: 8px;
  --gutter: 24px;
  --topbar-h: 52px;
  --panel-w: 480px;
}

/* ---------- base ---------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

::selection {
  background: rgba(61, 245, 138, 0.28);
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 3px;
}

.mono {
  font-family: var(--mono);
  font-size: 0.93em;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  flex: none;
}

.link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.link:hover {
  color: var(--green);
  text-decoration-color: currentColor;
}

.link .icon {
  display: inline-block;
  margin-left: 4px;
  vertical-align: -1px;
  color: var(--muted);
}

.link--aside {
  margin-left: 6px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.link--quiet {
  color: var(--muted);
  text-decoration-color: transparent;
}

.noscript {
  padding: 48px 24px;
  text-align: center;
}

/* ---------- controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover {
  border-color: #3b4c40;
  background: var(--surface-3);
}

.btn:disabled,
.btn.is-disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.btn--primary {
  border-color: var(--green);
  background: var(--green);
  color: #04140a;
  font-weight: 600;
}

.btn--primary:hover {
  border-color: #6af8a6;
  background: #6af8a6;
}

.btn--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn--quiet:hover {
  border-color: transparent;
  background: var(--surface-2);
  color: var(--text);
}

.btn--small {
  height: 28px;
  padding: 0 10px;
  font-size: 12.5px;
}

.btn--danger {
  color: var(--red);
}

.btn--danger:hover {
  border-color: rgba(255, 123, 114, 0.5);
  background: var(--red-tint);
}

.btn--block {
  width: 100%;
  height: 38px;
  font-size: 14px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  color: var(--muted);
}

.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

.input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}

textarea.input {
  display: block;
  height: auto;
  min-height: 92px;
  padding: 8px 12px;
  line-height: 1.5;
  resize: vertical;
}

.input::placeholder,
.search-input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.input:focus-visible,
.search-input:focus-visible {
  outline: none;
  border-color: var(--green-dim);
  box-shadow: 0 0 0 3px var(--green-tint);
}

.input[aria-invalid="true"] {
  border-color: rgba(255, 123, 114, 0.6);
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
}

.form-message {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.form-message[data-kind="error"] {
  color: var(--red);
}

.form-message[data-kind="success"] {
  color: var(--green);
}

.note {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.note--warn {
  padding-left: 10px;
  border-left: 2px solid var(--amber);
  color: var(--amber);
}

/* Radio group drawn as one segmented control. */
.segmented {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
}

.segmented-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.segmented-option {
  padding: 4px 11px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
  cursor: pointer;
}

.segmented-option:hover {
  color: var(--text);
}

.segmented-input:checked + .segmented-option {
  background: var(--green-tint);
  box-shadow: inset 0 0 0 1px var(--green-line);
  color: var(--green);
}

.segmented-input:focus-visible + .segmented-option {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.save-state {
  min-height: 18px;
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
}

.save-state[data-kind="saved"] {
  color: var(--green);
}

.save-state[data-kind="error"] {
  color: var(--red);
}

/* ---------- badges, chips, meters ---------- */

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.badge--red {
  background: var(--red-tint);
  color: var(--red);
}

.badge--amber {
  background: var(--amber-tint);
  color: var(--amber);
}

.badge--sand {
  background: var(--sand-tint);
  color: var(--sand);
}

.badge--green {
  background: var(--green-tint);
  color: var(--green);
}

.badge--neutral {
  background: var(--neutral-tint);
  color: var(--muted);
}

.chip {
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.chip--accent {
  border-color: var(--green-line);
  color: var(--green);
}

.chip--quiet {
  border-color: var(--border);
  color: var(--muted);
}

.meter {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: #1c261f;
  overflow: hidden;
}

.meter-fill {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--green);
}

.meter--red .meter-fill {
  background: var(--red);
}

.meter--amber .meter-fill {
  background: var(--amber);
}

.meter--sand .meter-fill {
  background: var(--sand);
}

/* ---------- radar sweep ---------- */

.sweep {
  display: block;
  overflow: visible;
}

.sweep-ring {
  stroke-opacity: 0.5;
}

.sweep-ring--inner {
  stroke-opacity: 0.28;
}

.sweep-trail {
  fill-opacity: 0.3;
}

.sweep-arm {
  transform-box: view-box;
  transform-origin: 50% 50%;
}

[data-state="scanning"] .sweep-arm {
  animation: sweep 2.6s linear infinite;
}

[data-state="paused"] .sweep-trail,
[data-state="offline"] .sweep-trail {
  fill-opacity: 0;
}

@keyframes sweep {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- boot + login ---------- */

.boot {
  display: grid;
  place-items: center;
  min-height: 100vh;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 32px 24px;
}

.auth-box {
  width: 100%;
  max-width: 340px;
}

.auth-title {
  margin-top: 28px;
  font-size: 24px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.auth-lead {
  margin-top: 8px;
  color: var(--muted);
}

.auth-lead + .btn {
  margin-top: 20px;
}

.auth-notice {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
}

.auth-form {
  display: grid;
  margin-top: 24px;
}

.auth-form .btn {
  margin-top: 16px;
}

/* The artwork sits on pure black, so its panel is pure black too. */
.auth-visual {
  position: relative;
  overflow: hidden;
  border-left: 1px solid var(--border);
  background: #000;
}

.auth-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--topbar-h);
  padding: 0 var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: inline-flex;
  color: var(--green);
}

.nav {
  display: flex;
  align-self: stretch;
  gap: 2px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--muted);
  font-weight: 500;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link[aria-current="page"] {
  color: var(--text);
}

.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  background: var(--green);
}

.nav-count {
  padding: 1px 6px;
  border-radius: 9px;
  background: var(--green-tint);
  color: var(--green);
  font-family: var(--mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 16px;
}

/* Something arrived since the user last looked at the screen. */
.nav-count.is-fresh {
  background: var(--green);
  color: #04140a;
  font-weight: 600;
  animation: fresh-pop 0.4s ease-out;
}

@keyframes fresh-pop {
  from {
    transform: scale(1.35);
  }
}

.topbar-actions {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.scan-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 30px;
  padding: 0 4px 0 10px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  white-space: nowrap;
}

.scan-pill[data-state="scanning"] {
  border-color: var(--green-line);
  color: var(--green);
}

.scan-pill[data-state="offline"] {
  border-color: rgba(255, 123, 114, 0.45);
  color: var(--red);
}

.scan-sweep {
  display: inline-flex;
  flex: none;
}

.scan-text {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
}

.scan-detail,
.scan-short {
  color: var(--muted);
}

.scan-short {
  display: none;
}

.scan-toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px 0 7px;
  border: 0;
  border-radius: 11px;
  background: var(--surface-3);
  color: var(--text);
  font: 500 12px/1 var(--font);
}

.scan-toggle:hover {
  background: #222c25;
}

.scan-toggle:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ---------- page frame ---------- */

.main {
  position: relative;
  padding: 0 var(--gutter) 72px;
}

/* Faint topographic backdrop behind the page heading. */
.main::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  z-index: -1;
  width: min(760px, 62%);
  height: 320px;
  background: url("/img/header-topo.webp") right top / cover no-repeat;
  mix-blend-mode: screen;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent);
  mask-image: linear-gradient(to bottom, #000 35%, transparent);
  pointer-events: none;
}

.view {
  max-width: 1180px;
  margin: 0 auto;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 28px 0 16px;
}

.page-title {
  font-size: 22px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.page-count {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.page-note {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- toolbar ---------- */

.toolbar {
  display: grid;
  gap: 10px;
  padding-bottom: 14px;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.toolbar-spacer {
  flex: 1;
}

.toolbar-reset {
  margin-left: 4px;
  font-size: 13px;
  color: var(--muted);
}

.tabs {
  display: inline-flex;
  max-width: 100%;
  padding: 2px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  scrollbar-width: none;
}

.tab {
  padding: 4px 12px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab[aria-current="true"] {
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  color: var(--text);
}

.tab:focus-visible {
  outline-offset: -2px;
}

.search {
  position: relative;
  display: flex;
  flex: 0 1 280px;
  align-items: center;
  min-width: 180px;
  margin-left: auto;
}

.search .icon {
  position: absolute;
  left: 10px;
  color: var(--muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 32px;
  padding: 0 10px 0 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
}

.filter {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  height: 32px;
  padding-left: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.filter:hover {
  border-color: var(--border-strong);
}

.filter:focus-within {
  border-color: var(--green-dim);
  box-shadow: 0 0 0 3px var(--green-tint);
}

.filter.is-active {
  border-color: var(--green-line);
}

.filter-label {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.filter-select {
  min-width: 0;
  max-width: 190px;
  height: 100%;
  padding: 0 26px 0 8px;
  border: 0;
  outline: none;
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%238b998e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E")
    no-repeat right 8px center;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.filter.is-active .filter-select {
  color: var(--green);
}

.filter-select option {
  background: var(--surface-2);
  color: var(--text);
}

/* A filter that is on or off („K připomenutí“) – a link drawn like the selects next to it. */
.filter-toggle {
  gap: 6px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.filter-toggle:hover {
  color: var(--text);
}

.filter-toggle.is-active {
  background: var(--green-tint);
  color: var(--green);
}

.filter-toggle-count {
  padding: 0 5px;
  border-radius: 8px;
  background: var(--amber-tint);
  color: var(--amber);
  font-size: 11.5px;
  line-height: 16px;
}

.filter-toggle.is-active .filter-toggle-count {
  background: rgba(61, 245, 138, 0.18);
  color: var(--green);
}

.toolbar-filters .btn {
  height: 32px;
}

/* On/off switch („Upozorňovat v prohlížeči“). */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  flex: none;
  width: 30px;
  height: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface-2);
  transition: background 0.15s, border-color 0.15s;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s, background 0.15s;
}

.switch-input:checked + .switch-track {
  border-color: var(--green-dim);
  background: var(--green-tint);
}

.switch-input:checked + .switch-track::after {
  transform: translateX(12px);
  background: var(--green);
}

.switch-input:focus-visible + .switch-track {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.switch-input:disabled ~ * {
  opacity: 0.5;
}

.switch-label {
  font-size: 13px;
  color: var(--muted);
}

.switch:hover .switch-label,
.switch-input:checked ~ .switch-label {
  color: var(--text);
}

.page-tools {
  display: grid;
  gap: 4px;
  margin-left: auto;
}

.page-tools .form-message {
  margin-top: 0;
  max-width: 46ch;
}

/* ---------- lists (shared) ---------- */

.leads,
.demands {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.leads {
  container: leads / inline-size;
}

.demands {
  container: demands / inline-size;
}

.is-stale > ul {
  opacity: 0.45;
  transition: opacity 0.15s 0.12s;
}

/* Corner brackets around the selected lead / the open demand. */
.lead-row.is-selected::before,
.demand.is-open::before {
  --bracket: var(--green);
  content: "";
  position: absolute;
  inset: 3px;
  background:
    linear-gradient(var(--bracket), var(--bracket)) left top / 10px 1.5px,
    linear-gradient(var(--bracket), var(--bracket)) left top / 1.5px 10px,
    linear-gradient(var(--bracket), var(--bracket)) right top / 10px 1.5px,
    linear-gradient(var(--bracket), var(--bracket)) right top / 1.5px 10px,
    linear-gradient(var(--bracket), var(--bracket)) left bottom / 10px 1.5px,
    linear-gradient(var(--bracket), var(--bracket)) left bottom / 1.5px 10px,
    linear-gradient(var(--bracket), var(--bracket)) right bottom / 10px 1.5px,
    linear-gradient(var(--bracket), var(--bracket)) right bottom / 1.5px 10px;
  background-repeat: no-repeat;
  pointer-events: none;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px 0;
}

.pagination-range {
  color: var(--muted);
  font-size: 12.5px;
}

.pagination-buttons {
  display: flex;
  gap: 8px;
}

.skeleton-row {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) 132px minmax(0, 1.4fr) 96px;
  align-items: center;
  gap: 16px;
  min-height: 61px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}

.skeleton-row:last-child {
  border-bottom: 0;
}

.skeleton {
  display: block;
  height: 10px;
  border-radius: 3px;
  background: var(--surface-3);
  animation: pulse 1.4s ease-in-out infinite;
}

.skeleton--title {
  width: 55%;
  height: 12px;
}

.skeleton--badge {
  width: 84px;
  height: 20px;
}

.skeleton--text {
  width: 70%;
}

.skeleton--num {
  justify-self: end;
  width: 40px;
}

.skeleton--line {
  height: 12px;
  margin: 16px 0;
}

.skeleton--short {
  width: 60%;
}

@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

/* Empty and error states: a faint dot grid fills the otherwise blank area. */
.empty {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 56px 24px 64px;
  text-align: center;
}

.empty::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(139, 153, 142, 0.24) 1px, transparent 1.5px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 62% 72% at 50% 45%, #000 15%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 72% at 50% 45%, #000 15%, transparent 100%);
  pointer-events: none;
}

.empty > * {
  position: relative;
}

/* The wireframes are drawn on pure black; "screen" lets the panel colour show through instead. */
.empty-img {
  width: 180px;
  height: 180px;
  margin-bottom: 4px;
  mix-blend-mode: screen;
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.empty-text {
  max-width: 46ch;
  color: var(--muted);
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

/* ---------- leads ---------- */

.lead-header,
.lead-row {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) 132px minmax(0, 1.4fr) minmax(0, 1.6fr) 96px;
  align-items: center;
  column-gap: 16px;
  padding-inline: 16px;
}

.lead-header {
  height: 34px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.lead-header-score {
  text-align: right;
}

.lead-row {
  position: relative;
  min-height: 61px;
  padding-block: 10px;
  border-bottom: 1px solid var(--border);
}

.lead-row:last-child {
  border-bottom: 0;
}

.lead-row:hover,
.lead-row.is-selected {
  background: var(--surface-2);
}

.lead-main {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.lead-link {
  overflow: hidden;
  font-weight: 600;
  letter-spacing: -0.012em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The name link covers the whole row; the contact links sit above it. */
.lead-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.lead-link:focus-visible {
  outline: none;
}

.lead-link:focus-visible::after {
  border-radius: 4px;
  outline: 2px solid var(--green);
  outline-offset: -3px;
}

.lead-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-rating {
  color: var(--muted);
}

/* Reminder marker under the name: „čas se ozvat“ / „připomenout 12. 10.“ */
.lead-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 3px;
}

.flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.flag--due {
  color: var(--amber);
  font-weight: 500;
}

.lead-row.is-due {
  box-shadow: inset 2px 0 0 var(--amber);
}

/* Passive security check: a small shield next to the web-state badge. */
.lead-state {
  display: flex;
  align-items: center;
  gap: 6px;
}

.risk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.risk--sand {
  background: var(--sand-tint);
  color: var(--sand);
}

.risk--amber {
  background: var(--amber-tint);
  color: var(--amber);
}

.risk--red {
  background: var(--red-tint);
  color: var(--red);
}

.lead-tags {
  display: contents;
}

.lead-opps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.lead-contact {
  display: grid;
  justify-items: start;
  gap: 1px;
  min-width: 0;
  font-size: 13px;
}

.lead-contact > * {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-link {
  position: relative;
  z-index: 1;
}

.contact-link:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lead-score {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.lead-score-num {
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.lead-score .meter {
  width: 64px;
}

@container leads (max-width: 860px) {
  .lead-header,
  .lead-row {
    grid-template-columns: minmax(0, 2fr) 132px minmax(0, 1.3fr) 76px;
  }

  .lead-contact,
  .lead-header-contact {
    display: none;
  }
}

@container leads (max-width: 600px) {
  .lead-header {
    display: none;
  }

  .lead-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main score"
      "tags tags"
      "contact contact";
    align-items: start;
    row-gap: 8px;
    padding-block: 13px;
  }

  .lead-main {
    grid-area: main;
  }

  .lead-link {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .lead-score {
    grid-area: score;
  }

  .lead-tags {
    display: flex;
    flex-wrap: wrap;
    grid-area: tags;
    align-items: center;
    gap: 4px 6px;
  }

  .lead-contact {
    display: flex;
    flex-wrap: wrap;
    grid-area: contact;
    gap: 2px 16px;
  }

  .skeleton-row {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .skeleton--badge,
  .skeleton--text {
    display: none;
  }
}

/* ---------- lead detail ---------- */

.detail {
  position: fixed;
  top: var(--topbar-h);
  right: 0;
  bottom: 0;
  z-index: 20;
  width: var(--panel-w);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-left: 1px solid var(--border);
  background: var(--surface);
  scrollbar-width: thin;
  animation: detail-in 0.16s ease-out;
}

@keyframes detail-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
}

.detail-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.detail-title {
  font-size: 18px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.detail-title:focus {
  outline: none;
}

.detail-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.detail-status {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  align-items: center;
  gap: 6px 12px;
}

.detail-body {
  padding: 0 20px;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
  padding-top: 18px;
}

.metric-sub {
  color: var(--muted);
  font-size: 12px;
}

.metric {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}

.detail-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.detail-section--note {
  margin: 0 20px;
}

.section-title {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.012em;
}

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

.facts {
  display: grid;
  gap: 8px;
}

.fact {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
}

.fact-label {
  color: var(--muted);
  font-size: 13px;
}

.fact-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.facts--compact {
  margin-top: 14px;
  font-size: 13px;
}

.detail-links {
  margin-top: 12px;
  font-size: 13px;
}

.web-score {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.web-score .meter {
  flex: 1;
  min-width: 40px;
}

.metric-badge {
  display: flex;
}

.findings {
  display: grid;
  gap: 8px;
}

.finding {
  position: relative;
  padding-left: 18px;
}

.finding::before {
  content: "";
  position: absolute;
  top: 0.5em;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.finding--high::before {
  background: var(--red);
}

.finding--medium::before {
  background: var(--amber);
}

.opp {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.opp + .opp {
  margin-top: 10px;
}

.opp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.opp-fit {
  color: var(--muted);
  font-size: 12px;
}

.opp-title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.opp-pitch {
  margin-top: 4px;
}

.opp-evidence {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.opp-evidence li {
  position: relative;
  padding-left: 14px;
}

.opp-evidence li::before {
  content: "–";
  position: absolute;
  left: 0;
}

.expiry--amber {
  color: var(--amber);
}

.expiry--red {
  color: var(--red);
}

/* Bezpečnost */
.risk-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 12px;
  font-size: 13px;
}

/* Důvody ozvat se – events timeline */
.timeline {
  display: grid;
  gap: 8px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  padding-left: 16px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 0.55em;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.timeline-item--red::before {
  background: var(--red);
}

.timeline-item--amber::before {
  background: var(--amber);
}

.timeline-item--green::before {
  background: var(--green);
}

.timeline-date {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.timeline-text {
  overflow-wrap: anywhere;
}

/* Náhled webu – screenshot thumbnails */
.shots {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.shot {
  display: grid;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.shot:hover {
  color: var(--text);
}

.shot:hover .shot-frame {
  border-color: var(--green-line);
}

.shot-frame {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #000;
}

.shot-img {
  width: 100%;
  height: auto;
}

.shot-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
}

/* Larger view of a screenshot. */
.lightbox {
  width: min(1320px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
}

.lightbox[data-kind="mobile"] {
  width: min(460px, calc(100vw - 32px));
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  border-bottom: 1px solid var(--border);
}

.lightbox-title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.lightbox-body {
  max-height: calc(100vh - 32px - 51px);
  overflow: auto;
  background: #000;
  scrollbar-width: thin;
}

.lightbox-img {
  width: 100%;
  height: auto;
}

/* Oslovení – e-mail and call-script drafts */
.draft {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.draft + .draft {
  margin-top: 10px;
}

.draft-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 600;
  letter-spacing: -0.012em;
  list-style: none;
  cursor: pointer;
}

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

.draft-summary .icon {
  color: var(--muted);
  transform: rotate(-90deg);
  transition: transform 0.15s;
}

.draft[open] > .draft-summary .icon {
  transform: none;
}

.draft-summary:focus-visible {
  outline-offset: -3px;
}

.draft-body {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.draft-label {
  color: var(--muted);
}

.draft-subject {
  overflow-wrap: anywhere;
}

.draft-text {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn--copy[data-state="done"] {
  border-color: var(--green-line);
  color: var(--green);
}

.btn--copy[data-state="done"].btn--primary {
  color: #04140a;
}

.btn--copy[data-state="failed"] {
  border-color: rgba(255, 123, 114, 0.5);
  color: var(--red);
}

/* Připomenout */
.followup {
  margin-bottom: 16px;
}

.followup-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.input--date {
  width: auto;
  min-width: 150px;
  height: 32px;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.input--date::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

.followup-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.followup-state {
  min-height: 18px;
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 18px;
  color: var(--muted);
}

.followup-state[data-kind="saved"] {
  color: var(--green);
}

.followup-state[data-kind="error"] {
  color: var(--red);
}

.followup-due {
  color: var(--amber);
  font-weight: 500;
}

.detail-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px 28px;
}

.detail-foot-state {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* ---------- demands ---------- */

.demand {
  position: relative;
  border-bottom: 1px solid var(--border);
}

.demand:last-child {
  border-bottom: 0;
}

.demand.is-open {
  background: var(--surface-2);
}

/* Arrived since the user last opened Poptávky. */
.demand.is-fresh {
  box-shadow: inset 2px 0 0 var(--green);
}

.demand.is-fresh .demand-title {
  color: var(--green);
}

.demand-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 76px 14px;
  align-items: center;
  column-gap: 16px;
  width: 100%;
  min-height: 61px;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  text-align: left;
}

.demand-head:hover {
  background: var(--surface-2);
}

.demand-head:focus-visible {
  outline-offset: -3px;
}

.demand-main {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.demand-title {
  font-weight: 600;
  letter-spacing: -0.012em;
  overflow-wrap: anywhere;
}

.demand-meta {
  color: var(--muted);
  font-size: 12.5px;
}

.demand-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.demand-rel {
  display: grid;
  justify-items: end;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.demand-rel .meter {
  width: 64px;
}

.demand-chevron {
  display: inline-flex;
  color: var(--muted);
  transition: transform 0.15s;
}

.demand.is-open .demand-chevron {
  transform: rotate(180deg);
}

.demand-body {
  display: grid;
  gap: 14px;
  max-width: 760px;
  padding: 4px 16px 20px;
}

.demand-body .facts--compact {
  margin-top: 0;
}

.demand-desc {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.demand-user {
  display: grid;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.demand-user-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

@container demands (max-width: 600px) {
  .demand-head {
    grid-template-columns: minmax(0, 1fr) auto 14px;
    grid-template-areas:
      "main rel chevron"
      "tags tags tags";
    align-items: start;
    row-gap: 8px;
    padding-block: 13px;
  }

  .demand-main {
    grid-area: main;
  }

  .demand-rel {
    grid-area: rel;
  }

  .demand-chevron {
    grid-area: chevron;
  }

  .demand-tags {
    grid-area: tags;
    justify-content: flex-start;
  }
}

/* ---------- cities ---------- */

.panel {
  margin-bottom: 20px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.panel--flush {
  padding: 0;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.panel-lead {
  max-width: 62ch;
  margin: 4px 0 16px;
  color: var(--muted);
}

.section-count {
  color: var(--muted);
  font-size: 12.5px;
}

.city-search {
  max-width: 460px;
}

.input-row {
  display: flex;
  gap: 8px;
}

.input-row .btn {
  height: 36px;
}

.city-pick {
  display: grid;
  gap: 14px;
  max-width: 640px;
  margin-top: 16px;
}

.candidates {
  display: grid;
  gap: 6px;
}

.candidate {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
}

.candidate:hover {
  border-color: var(--border-strong);
}

.candidate:has(.candidate-input:checked) {
  border-color: var(--green-line);
}

.candidate.is-tracked {
  opacity: 0.55;
  cursor: default;
}

.candidate-input {
  margin: 3px 0 0;
  accent-color: var(--green);
}

.candidate-body {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.candidate-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  font-weight: 600;
}

.candidate-kind {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.candidate-desc {
  color: var(--muted);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.city-pick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

.city-pick-row .btn {
  height: 34px;
}

.city-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px 28px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.city-row:last-child {
  border-bottom: 0;
}

.city-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.city-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
}

.city-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.city-row.is-paused .city-name {
  color: var(--muted);
}

.city-radius {
  color: var(--muted);
  font-size: 12px;
}

.city-desc {
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-state {
  color: var(--muted);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.city-state[data-tone="active"] {
  color: var(--green);
}

.city-state[data-tone="error"] {
  color: var(--red);
}

/* Fixed tracks keep the numbers of all rows in one column. */
.city-stats {
  display: grid;
  grid-template-columns: 76px 104px 64px;
  gap: 20px;
}

.city-stat {
  display: grid;
  justify-items: end;
  gap: 1px;
}

.city-stat-label {
  color: var(--muted);
  font-size: 12px;
}

.city-stat-num {
  font-size: 15px;
  font-weight: 600;
}

.city-actions,
.city-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.city-actions .btn:first-child {
  min-width: 92px;
}

.city-actions.is-concealed {
  visibility: hidden;
}

.city-confirm {
  grid-column: 1 / -1;
}

.city-confirm-text {
  margin-right: 4px;
  font-size: 13px;
}

.activity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
}

.terminal {
  height: 340px;
  padding: 14px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #050705;
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.7;
  letter-spacing: 0;
  scrollbar-width: thin;
}

.terminal:focus-visible {
  outline-offset: -2px;
}

.term-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
}

.term-ts {
  color: var(--muted);
}

.term-msg {
  overflow-wrap: anywhere;
}

.term-line--warn .term-msg {
  color: var(--amber);
}

.term-line--error .term-msg {
  color: var(--red);
}

.term-line--muted {
  display: block;
  color: var(--muted);
}

.term-live {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
}

.term-live::before {
  content: ">";
  color: var(--green-dim);
}

.terminal[data-state="scanning"] .term-live {
  color: var(--green);
}

.terminal[data-state="offline"] .term-live {
  color: var(--red);
}

.term-live-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.term-cursor {
  flex: none;
  width: 7px;
  height: 14px;
  background: currentColor;
  opacity: 0.35;
  transform: translateY(2px);
}

.terminal[data-state="scanning"] .term-cursor {
  opacity: 1;
  animation: blink 1.1s steps(1, end) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.scan-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 16px;
  border-left: 1px solid var(--border);
}

.scan-now {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scan-dial {
  display: inline-flex;
  flex: none;
  color: var(--muted);
}

.scan-panel[data-state="scanning"] .scan-dial {
  color: var(--green);
}

.scan-panel[data-state="offline"] .scan-dial {
  color: var(--red);
}

.scan-now-text {
  min-width: 0;
}

.scan-title {
  font-weight: 600;
}

.scan-sub {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.scan-stats {
  display: grid;
  gap: 7px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.scan-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.scan-stat-label {
  color: var(--muted);
}

/* ---------- integrations (Napojení) ---------- */

.integration {
  display: grid;
  grid-template-columns: 136px auto minmax(0, 1fr);
  align-items: baseline;
  gap: 6px 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.integration-name {
  font-weight: 600;
  letter-spacing: -0.012em;
}

.integration.is-on .integration-name {
  color: var(--text);
}

.integration-state {
  align-self: center;
}

.integration-hint {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* Variable names read as code. */
.integration-hint,
.integrations-notes {
  font-variant-ligatures: none;
}

.integrations-foot {
  display: grid;
  gap: 14px;
  padding: 14px 16px 16px;
}

.integrations-test {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.integrations-test .form-message {
  margin-top: 0;
}

.integrations-notes {
  display: grid;
  gap: 4px;
  max-width: 80ch;
  color: var(--muted);
  font-size: 12.5px;
}

.integrations-notes li {
  position: relative;
  padding-left: 12px;
}

.integrations-notes li::before {
  content: "–";
  position: absolute;
  left: 0;
}

/* ---------- toasts ---------- */

.toasts {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 50;
  display: grid;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
}

.toast {
  display: block;
  padding: 10px 14px;
  border: 1px solid rgba(255, 123, 114, 0.45);
  border-radius: var(--radius);
  background: #190f0f;
  font-size: 13px;
  overflow-wrap: anywhere;
  animation: toast-in 0.18s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* News, not a problem: a new demand. Clicking it opens Poptávky. */
.toast--info {
  border-color: var(--green-line);
  background: #0b150f;
  color: var(--text);
}

a.toast--info:hover {
  border-color: var(--green);
}

/* ---------- responsive ---------- */

@media (min-width: 1100px) {
  /* The list makes room for the detail panel instead of hiding under it. */
  body.has-detail .main {
    margin-right: var(--panel-w);
  }
}

@media (max-width: 1099px) {
  .detail {
    left: 0;
    width: auto;
    border-left: 0;
  }

  body.has-detail {
    overflow: hidden;
  }
}

@media (max-width: 1000px) {
  .scan-toggle {
    padding: 0 7px;
  }

  .scan-toggle-label {
    display: none;
  }
}

@media (max-width: 900px) {
  .main::before {
    display: none;
  }

  .activity {
    grid-template-columns: minmax(0, 1fr);
  }

  .scan-panel {
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .city-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .city-main {
    grid-column: 1 / -1;
  }

  .city-stat {
    justify-items: start;
  }
}

@media (max-width: 860px) {
  .auth {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-visual {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --gutter: 16px;
    --topbar-h: 92px;
  }

  .topbar-inner {
    flex-wrap: wrap;
    gap: 0 12px;
    height: auto;
  }

  .brand,
  .topbar-actions {
    height: 48px;
  }

  .nav {
    flex: 0 0 100%;
    order: 3;
    height: 44px;
    margin: 0 -10px;
  }

  .page-head {
    padding-top: 20px;
  }

  .page-title {
    font-size: 20px;
  }

  .search {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .tab {
    padding: 4px 9px;
  }

  .toolbar-spacer {
    display: none;
  }

  .filter {
    flex: 1 1 calc(50% - 4px);
  }

  .filter-select {
    flex: 1;
    max-width: none;
  }

  /* 16px keeps iOS from zooming into a focused field. */
  .input,
  .search-input {
    font-size: 16px;
  }

  .panel {
    padding: 16px;
  }

  .panel--flush {
    padding: 0;
  }

  .city-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .city-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .city-actions,
  .city-confirm {
    justify-content: flex-start;
  }

  .city-actions.is-concealed {
    display: none;
  }

  .term-line {
    gap: 10px;
  }

  .fact {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .toolbar-filters .btn {
    flex: 1 1 calc(50% - 4px);
  }

  .page-tools {
    flex-basis: 100%;
    margin-left: 0;
  }

  .integration {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .integration-hint {
    grid-column: 1 / -1;
  }

  .timeline-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .input--date {
    font-size: 16px;
  }
}

@media (max-width: 620px) {
  .scan-detail {
    display: none;
  }

  .scan-short {
    display: inline;
  }

  .segmented-option {
    padding-inline: 9px;
  }
}

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