:root,
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6f4;
  --bg-elev: #ffffff;
  --bg-soft: #eef2ef;
  --bg-hover: #e4ebe6;
  --ink: #17201c;
  --ink-muted: #5f6f67;
  --line: #d5ddd8;
  --line-strong: #b8c4bc;
  --accent: #1f7a55;
  --accent-2: #1a6b5c;
  --accent-soft: rgba(31, 122, 85, 0.1);
  --accent-ink: #145c3f;
  --prio-a: #1f7a55;
  --prio-b: #b8860b;
  --prio-c: #6d7a73;
  --type-job: #2b6ea8;
  --type-employer: #1f7a55;
  --type-restaurant: #b86a2d;
  --status-new: #6b7c93;
  --status-interesting: #2b6ea8;
  --status-applied: #1f7a55;
  --status-passed: #b44545;
  --rating-high: #1f7a55;
  --rating-mid: #c9a24a;
  --rating-low: #d07a2d;
  --rating-poor: #b44545;
  --rating-unknown: #9aa3a0;
  --home: #c99712;
  --danger: #b44545;
  --shadow: 0 8px 28px rgba(23, 32, 28, 0.08);
  --nav-bg: rgba(255, 255, 255, 0.92);
  --panel-bg: rgba(255, 255, 255, 0.96);
  --map-tile-filter: none;
  --page-glow-a: rgba(31, 122, 85, 0.1);
  --page-glow-b: rgba(43, 110, 168, 0.08);
  --page-base: linear-gradient(180deg, #f7faf8 0%, var(--bg) 42%, #eef3f0 100%);
  --radius: 10px;
  --font: "Figtree", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --nav-h: 58px;
  --nav-chrome: calc(var(--nav-h) + var(--safe-top));
  --nav-offset: var(--nav-chrome);
  --shell-pad: 12px;
  --filters-w: 304px;
  --filters-rail: 52px;
  --details-w: 408px;
  --focus: 0 0 0 2px rgba(31, 122, 85, 0.35);
  --map-h: min(34vh, 300px);
  --z-map: 1;
  --z-shell: 2;
  --z-nav: 1200;
  --z-filters-mobile: 1400;
  --z-backdrop: 1350;
  --z-modal: 10000;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1210;
  --bg-elev: #141b18;
  --bg-soft: #1a2320;
  --bg-hover: #222c28;
  --ink: #e6eee9;
  --ink-muted: #8fa399;
  --line: #24302b;
  --line-strong: #33433c;
  --accent: #3d9b6e;
  --accent-2: #2f7f72;
  --accent-soft: rgba(61, 155, 110, 0.14);
  --accent-ink: #b8e6cd;
  --prio-a: #3d9b6e;
  --prio-b: #c9a24a;
  --prio-c: #6d7a73;
  --type-job: #5b9fd4;
  --type-employer: #3d9b6e;
  --type-restaurant: #d08a4c;
  --status-new: #8fa3b0;
  --status-interesting: #5b9fd4;
  --status-applied: #3d9b6e;
  --status-passed: #c45c5c;
  --rating-high: #3d9b6e;
  --rating-mid: #c9a24a;
  --rating-low: #d08a4c;
  --rating-poor: #c45c5c;
  --rating-unknown: #6d7a73;
  --home: #f0c14a;
  --danger: #c45c5c;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  --nav-bg: rgba(13, 18, 16, 0.94);
  --panel-bg: rgba(20, 27, 24, 0.96);
  --map-tile-filter: none;
  --page-glow-a: rgba(47, 127, 114, 0.16);
  --page-glow-b: rgba(61, 155, 110, 0.1);
  --page-base: linear-gradient(180deg, #0f1613 0%, var(--bg) 40%, #0b100e 100%);
  --focus: 0 0 0 2px rgba(61, 155, 110, 0.45);
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 420px at 8% -8%, var(--page-glow-a), transparent 55%),
    radial-gradient(700px 360px at 92% 0%, var(--page-glow-b), transparent 50%),
    var(--page-base);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent-ink);
  text-underline-offset: 2px;
}

a:hover {
  filter: brightness(1.08);
}

.topnav {
  position: sticky;
  top: 0;
  left: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: var(--nav-chrome);
  margin: 0;
  padding: 8px 14px;
  padding-top: calc(8px + var(--safe-top));
  padding-right: calc(14px + var(--safe-right));
  padding-left: calc(14px + var(--safe-left));
  background-color: var(--bg-elev);
  background-image: linear-gradient(var(--nav-bg), var(--nav-bg));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  contain: layout style;
}

.topnav > .brand {
  flex-shrink: 0;
}

.topnav > .nav-primary {
  flex-shrink: 1;
  min-width: 0;
}

.topnav > .nav-actions {
  margin-left: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  border-radius: 8px;
}

a.brand:hover {
  filter: none;
  color: inherit;
}

.brand:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.brand-mark img {
  display: block;
  width: 34px;
  height: 34px;
}

.brand-text {
  min-width: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex-shrink: 0;
  margin-left: auto;
}

.nav-btn,
.btn,
.icon-btn,
.rail-btn {
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--ink);
  border-radius: 8px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  min-height: 36px;
  white-space: nowrap;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}

.nav-btn-icon {
  width: 36px;
  min-width: 36px;
  padding: 7px;
  justify-content: center;
}

.nav-btn-icon svg {
  display: block;
  flex-shrink: 0;
}

.nav-link {
  font: inherit;
}

.nav-btn:hover,
.btn:hover,
.icon-btn:hover,
.rail-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.btn {
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-small {
  padding: 5px 9px;
  font-size: 0.86rem;
  min-height: 32px;
}

.btn-primary {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent-ink);
}

.btn-ghost {
  background: transparent;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.btn-ghost:active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.btn-icon {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  justify-content: center;
  color: var(--ink-muted);
}

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

.btn-icon:active {
  color: var(--accent-ink);
}

.btn-icon svg {
  display: block;
  flex-shrink: 0;
}

.icon-btn,
.rail-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
}

.icon-btn:active,
.rail-btn:active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent-ink);
}

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  padding: 2px;
  gap: 2px;
  background: var(--bg-elev);
}

.lang-toggle button,
.lang-toggle .lang-flag {
  border: 0;
  background: transparent;
  padding: 4px;
  min-height: 34px;
  min-width: 34px;
  cursor: pointer;
  color: var(--ink-muted);
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  opacity: 0.72;
  transition:
    opacity 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.lang-toggle button:hover,
.lang-toggle .lang-flag:hover {
  opacity: 1;
  background: var(--bg-soft);
}

.lang-toggle button.active,
.lang-toggle .lang-flag.active,
html:not([data-lang="zh"]) .lang-toggle .lang-flag[data-lang="de"],
html[data-lang="zh"] .lang-toggle .lang-flag[data-lang="zh"] {
  background: var(--accent-soft);
  opacity: 1;
  box-shadow: inset 0 0 0 1.5px
    color-mix(in srgb, var(--accent) 55%, transparent);
}

html:not([data-lang="zh"]) .lang-toggle .lang-flag[data-lang="zh"],
html[data-lang="zh"] .lang-toggle .lang-flag[data-lang="de"] {
  background: transparent;
  opacity: 0.72;
  box-shadow: none;
}

.lang-zh {
  display: none;
}

html[data-lang="zh"] .lang-de {
  display: none;
}

html[data-lang="zh"] .lang-zh {
  display: inline;
}

@supports (view-transition-name: none) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.16s;
    animation-timing-function: ease;
  }

  .topnav {
    view-transition-name: site-topnav;
  }

  ::view-transition-old(site-topnav),
  ::view-transition-new(site-topnav) {
    animation: none;
    mix-blend-mode: normal;
    height: 100%;
    overflow: clip;
  }
}

.lang-toggle .flag-svg {
  display: block;
  border-radius: 50%;
  width: 20px;
  height: 20px;
}

html[data-theme="light"] .icon-sun {
  display: none;
}
html[data-theme="dark"] .icon-moon {
  display: none;
}

.mobile-only {
  display: none;
}

.desktop-only {
  display: inline-flex;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, var(--filters-w)) minmax(0, 1fr) var(
      --details-w
    );
  gap: 0;
  width: 100%;
  max-width: 100%;
  min-height: calc(100vh - var(--nav-offset));
  min-height: calc(100dvh - var(--nav-offset));
  align-items: start;
  position: relative;
  z-index: var(--z-shell);
  overflow-x: clip;
  background-color: var(--bg);
}

.app-shell.filters-collapsed {
  grid-template-columns: var(--filters-rail) minmax(0, 1fr) var(--details-w);
}

.app-shell.filters-collapsed .filters-col {
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
}

body.resizing-details {
  cursor: col-resize;
  user-select: none;
}

body.resizing-details iframe,
body.resizing-details #map {
  pointer-events: none;
}

.filters-col {
  position: sticky;
  top: var(--nav-offset);
  height: calc(100vh - var(--nav-offset));
  height: calc(100dvh - var(--nav-offset));
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: var(--panel-bg);
  z-index: 5;
  display: flex;
  overflow: hidden;
  overflow-x: hidden;
}

.filters-rail {
  display: none;
  width: var(--filters-rail);
  flex: 0 0 var(--filters-rail);
  flex-direction: column;
  align-items: center;
  padding: var(--shell-pad) 0;
  gap: 8px;
  border-right: 0;
  background: var(--bg-elev);
}

.app-shell.filters-collapsed .filters-rail {
  display: flex;
  background: var(--bg-elev);
}

.app-shell.filters-collapsed .filters-body {
  display: none;
  width: 0;
  padding: 0;
  overflow: hidden;
}

.filters-body {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: var(--shell-pad);
  overscroll-behavior: contain;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  min-width: 0;
}

.sidebar-head h2,
.map-toolbar h2,
.detail-title,
.modal-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
}

.sidebar-head h2 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.field label,
.inline-label,
.check-label {
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 550;
}

.filter-group {
  margin-bottom: 12px;
  padding-bottom: 4px;
}

.filter-group-label {
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 550;
  margin-bottom: 6px;
}

.filter-group .check-field {
  margin-bottom: 6px;
}

.check-field {
  margin-bottom: 10px;
  display: flex;
  justify-content: flex-start;
  max-width: 100%;
  min-width: 0;
}

.check-label {
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.84rem;
  line-height: 1.3;
}

.check-label span {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.field input[type="checkbox"],
.check-label input[type="checkbox"],
.col-menu input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  align-self: flex-start;
}

.field input,
.field select,
.inline-control,
#promptText,
.user-box textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  border-radius: 7px;
  padding: 8px 9px;
  outline: none;
}

.inline-label select,
.sort-select {
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  border-radius: 7px;
  padding: 8px 28px 8px 9px;
  outline: none;
}

.field input[type="number"],
.field input[type="search"],
.field input[type="text"] {
  width: 100%;
  max-width: 100%;
}

.field input:focus,
.field select:focus,
.inline-label select:focus,
.inline-control:focus,
#promptText:focus,
.user-box textarea:focus {
  box-shadow: var(--focus);
  border-color: var(--accent);
}

.salary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.sidebar-meta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.sidebar-backdrop {
  display: none;
  grid-column: 1 / -1;
  pointer-events: none;
}

.center-col {
  min-width: 0;
  padding: var(--shell-pad) 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-x: clip;
}

.center-toolbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-bg);
}

.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
  width: 100%;
}

.toolbar-right .result-count {
  margin-left: auto;
}

.inline-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.inline-label select,
.sort-select {
  width: auto;
  width: max-content;
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
}

@supports (field-sizing: content) {
  .inline-label select,
  .sort-select {
    field-sizing: content;
  }
}

.sort-label {
  flex: 0 1 auto;
}

.result-count {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-ink);
  white-space: nowrap;
}

.col-menu-wrap {
  position: relative;
}

.col-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  width: min(260px, 70vw);
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
}

.col-menu label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 5px 4px;
  font-size: 0.84rem;
  cursor: pointer;
}

.col-menu label:hover {
  background: var(--bg-hover);
  border-radius: 6px;
}

.col-menu-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.col-menu-note-legacy {
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--ink-muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

.view-toggle {
  display: none;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
  flex-shrink: 0;
}

.view-toggle-btn {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  padding: 8px 12px;
  min-height: 44px;
  min-width: 64px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
}

.view-toggle-btn + .view-toggle-btn {
  border-left: 1px solid var(--line);
}

.view-toggle-btn.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.map-panel,
.list-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-bg);
  overflow: hidden;
}

.map-panel {
  position: relative;
  z-index: var(--z-map);
  isolation: isolate;
}

.map-toolbar,
.detail-head,
.modal-head,
.modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  color: var(--ink-muted);
  font-size: 0.72rem;
  justify-content: flex-end;
  max-width: min(100%, 720px);
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot.status-new {
  background: var(--status-new);
}
.dot.status-interesting {
  background: var(--status-interesting);
}
.dot.status-applied {
  background: var(--status-applied);
}
.dot.status-passed {
  background: var(--status-passed);
}
.dot.home {
  width: 11px;
  height: 11px;
  background: var(--home);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--home) 30%, transparent);
}

.map-host {
  position: relative;
  z-index: 0;
  isolation: isolate;
  height: var(--map-h);
  overflow: hidden;
}

#map {
  height: 100%;
  width: 100%;
  background: var(--bg-soft);
  z-index: 0 !important;
}

.leaflet-container {
  background: var(--bg-soft);
  font: inherit;
  z-index: 0 !important;
}

.custom-pin,
.home-pin,
.route-label-icon {
  background: transparent;
  border: 0;
  overflow: visible;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-shadow-pane {
  z-index: 500;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

.route-label {
  display: inline-block;
  transform: translate(-50%, -50%);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, rgba(0, 0, 0, 0.2));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  color: var(--accent-ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.route-label-icon.is-air .route-label {
  border-color: var(--line-strong);
  color: var(--ink-muted);
}

.pin {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--bg-elev) 85%, var(--ink));
  background: var(--status-new);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 16%, transparent);
  box-sizing: border-box;
}

.pin.status-new {
  background: var(--status-new);
}
.pin.status-interesting {
  background: var(--status-interesting);
}
.pin.status-applied {
  background: var(--status-applied);
}
.pin.status-passed {
  background: var(--status-passed);
}

.pin-x {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--status-passed);
  filter: drop-shadow(
      0 0 1px color-mix(in srgb, var(--bg-elev) 85%, transparent)
    )
    drop-shadow(0 0 2px color-mix(in srgb, var(--bg-elev) 70%, transparent));
}

.pin-x svg {
  width: 100%;
  height: 100%;
}

.pin-x.active {
  color: var(--danger);
  transform: scale(1.15);
}

.dot.dot-x {
  position: relative;
  background: transparent;
  border-radius: 0;
}

.dot.dot-x::before,
.dot.dot-x::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  height: 2px;
  background: var(--status-passed);
  border-radius: 2px;
}

.dot.dot-x::before {
  transform: translateY(-50%) rotate(45deg);
}

.dot.dot-x::after {
  transform: translateY(-50%) rotate(-45deg);
}

.pin.active {
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent),
    0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent);
}

.home-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ffe08a, #d4a017 70%);
  border: 2px solid var(--bg-elev);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--home) 35%, transparent),
    0 2px 8px rgba(0, 0, 0, 0.25);
  display: grid;
  place-items: center;
  color: #1a1404;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: min(48vh, 480px);
  overscroll-behavior-x: none;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.data {
  width: 100%;
  border-collapse: collapse;
  /* Auto layout so the narrow badge/number columns shrink to their content and
     the text columns absorb whatever is left, whichever columns are visible. */
  table-layout: auto;
}

.data th,
.data td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data th {
  position: sticky;
  top: 0;
  background: var(--bg-soft);
  color: var(--ink-muted);
  font-size: 0.74rem;
  font-weight: 600;
  z-index: 2;
}

.data tr.row {
  cursor: pointer;
}

.data tr.row:hover {
  background: var(--bg-hover);
}

.data tr.row.active {
  background: var(--accent-soft);
}

.employer-cell,
.title-cell {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* width: 1% + nowrap makes a column collapse to its content in auto layout. */
.data th.col-select,
.data td.col-select,
.data th.col-type,
.data td.col-type,
.data th.col-status,
.data td.col-status,
.data th.col-sentiment,
.data td.col-sentiment,
.data th.col-salary,
.data td.col-salary,
.data th.col-drive,
.data td.col-drive,
.data th.col-dist,
.data td.col-dist,
.data th.col-fit,
.data td.col-fit,
.data th.col-deadline,
.data td.col-deadline,
.data th.col-verified,
.data td.col-verified,
.data th.col-employment,
.data td.col-employment {
  width: 1%;
  white-space: nowrap;
}

/* Text columns share the remaining width. */
.data th.col-employer,
.data td.col-employer,
.data th.col-title,
.data td.col-title,
.data th.col-city,
.data td.col-city,
.data th.col-category,
.data td.col-category,
.data th.col-phone,
.data td.col-phone,
.data th.col-email,
.data td.col-email {
  width: auto;
  max-width: 0;
}

.mark {
  background: color-mix(in srgb, var(--home) 30%, transparent);
  color: inherit;
  border-radius: 2px;
  padding: 0 2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}

.badge.badge-walk-in {
  color: var(--accent-ink);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.badge.type-job {
  color: var(--type-job);
  border-color: color-mix(in srgb, var(--type-job) 40%, transparent);
}
.badge.type-employer {
  color: var(--type-employer);
  border-color: color-mix(in srgb, var(--type-employer) 40%, transparent);
}
.badge.type-restaurant {
  color: var(--type-restaurant);
  border-color: color-mix(in srgb, var(--type-restaurant) 40%, transparent);
}
.badge.badge-too-far {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}

.badge.status-new,
.badge.status-interesting,
.badge.status-applied,
.badge.status-passed {
  gap: 5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge .status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}

.badge.status-new {
  color: var(--status-new);
  border-color: color-mix(in srgb, var(--status-new) 40%, transparent);
  background: color-mix(in srgb, var(--status-new) 10%, var(--bg-elev));
}

.badge.status-interesting {
  color: var(--status-interesting);
  border-color: color-mix(in srgb, var(--status-interesting) 40%, transparent);
  background: color-mix(in srgb, var(--status-interesting) 10%, var(--bg-elev));
}

.badge.status-applied {
  color: var(--status-applied);
  border-color: color-mix(in srgb, var(--status-applied) 45%, transparent);
  background: color-mix(in srgb, var(--status-applied) 12%, var(--bg-elev));
}

html[data-theme="dark"] .badge.status-passed {
  color: var(--status-passed);
  border-color: color-mix(in srgb, var(--status-passed) 40%, transparent);
  background: color-mix(in srgb, var(--status-passed) 8%, var(--bg-elev));
  opacity: 0.85;
}

.dist-air {
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.data td {
  font-variant-numeric: tabular-nums;
}

.loading,
.empty,
.error {
  padding: 28px 16px;
  text-align: center;
  color: var(--ink-muted);
}

.error {
  color: var(--danger);
}

.details-col {
  position: sticky;
  top: var(--nav-offset);
  height: calc(100vh - var(--nav-offset));
  height: calc(100dvh - var(--nav-offset));
  width: 100%;
  min-width: 0;
  border-left: 1px solid var(--line);
  background: var(--panel-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 4;
  align-items: stretch;
}

.detail-resize {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 8;
  touch-action: none;
  background: transparent;
}

.detail-resize::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: transparent;
  transition: background 0.15s ease;
}

.detail-resize:hover::after,
.detail-resize:focus-visible::after,
body.resizing-details .detail-resize::after {
  background: color-mix(in srgb, var(--accent) 65%, transparent);
}

.detail-resize:focus-visible {
  outline: none;
}

.details-inner {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  align-items: stretch;
  justify-content: flex-start;
}

#detailEmpty {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#detailEmpty[hidden],
#detailContent[hidden] {
  display: none !important;
  flex: 0 0 0;
  height: 0;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0;
}

.empty-detail {
  padding: var(--shell-pad) 10px 28px 14px;
  color: var(--ink);
  box-sizing: border-box;
  max-width: 100%;
}

.howto-md {
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--ink);
  max-width: min(62ch, 100%);
}

.empty-detail .howto-md.prompt-md {
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.howto-md h1 {
  margin: 0 0 0.55em;
  font-size: 1.28rem;
  color: var(--ink);
}

.howto-md h2 {
  margin: 1.15em 0 0.4em;
  font-size: 1.05rem;
  color: var(--ink);
}

.howto-md p,
.howto-md ul,
.howto-md ol {
  margin: 0.5em 0;
  color: var(--ink);
}

.howto-md li {
  margin: 0.28em 0;
  color: var(--ink);
}

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

.howto-md .howto-callout {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 0 0 1em;
  padding: 0.7rem 0.8rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  max-width: none;
}

.howto-md .howto-callout.howto-lang-tip {
  margin-bottom: 0.65em;
  padding: 0.55rem 0.75rem;
}

.howto-md .howto-callout.howto-lang-tip .howto-callout-body p {
  margin: 0;
}

.howto-md .howto-callout-icon {
  flex-shrink: 0;
  margin-top: 0.12rem;
  color: var(--accent-ink);
}

.howto-md .howto-callout-body {
  min-width: 0;
  flex: 1;
}

.howto-md .howto-callout-body > :first-child {
  margin-top: 0;
}

.howto-md .howto-callout-body > :last-child {
  margin-bottom: 0;
}

.howto-md .howto-callout p {
  margin: 0 0 0.35em;
  font-size: 0.95em;
  line-height: 1.45;
}

.howto-md .howto-callout ul {
  margin: 0;
  padding-left: 1.1em;
}

.howto-md .howto-callout li {
  margin: 0.2em 0;
  font-size: 0.9em;
  line-height: 1.4;
  color: var(--ink);
}

.detail-head {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: var(--shell-pad) 10px 8px 14px;
  flex-shrink: 0;
  gap: 6px;
}

.detail-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.detail-head-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  min-width: 0;
  flex: 1;
}

.detail-head-meta .badge-row {
  margin-bottom: 0;
}

.detail-head-text {
  min-width: 0;
  width: 100%;
  flex: none;
  padding-right: 0;
}

.detail-nav {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.detail-nav-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}

.detail-nav-btn:hover:not(:disabled) {
  color: var(--ink);
  background: var(--bg-hover);
}

.detail-nav-btn:active:not(:disabled) {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.detail-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.detail-nav-btn svg {
  display: block;
}

.rating-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  padding: 1px 6px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--home);
  background: color-mix(in srgb, var(--home) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--home) 40%, transparent);
}

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

.col-sentiment {
  text-align: center;
}

.detail-title {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: normal;
}

.detail-sub {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 0.84rem;
  overflow-wrap: break-word;
  word-break: normal;
}

.detail-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.detail-copy-md {
  width: 32px;
  height: 32px;
}

.detail-copy-md.copied {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.detail-short-id {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 6px 6px;
  margin-right: 0;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}

.detail-short-id:hover {
  color: var(--ink);
  background: var(--bg-hover);
}

.detail-short-id:active,
.detail-short-id.copied {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.detail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  overscroll-behavior: contain;
}

.detail-section {
  margin-bottom: 14px;
}

.detail-section h3 {
  margin: 0 0 6px;
  font-size: 0.82rem;
  color: var(--accent-ink);
}

.detail-section p {
  margin: 0;
  white-space: pre-wrap;
}

.kv {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 5px 8px;
  margin: 0;
}

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

.kv dd {
  margin: 0;
  word-break: break-word;
}

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

.user-box {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  margin-bottom: 12px;
  display: grid;
  gap: 8px;
}

.user-box .field {
  margin-bottom: 0;
}

.user-box .field-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.user-box textarea {
  min-height: 72px;
  resize: vertical;
}

.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.bulk-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
}

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

.bulk-bar .status-filter-chip[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.bulk-bar #bulkExit {
  margin-left: auto;
}

th.col-select,
td.col-select {
  width: 34px;
  text-align: center;
}

td.col-select input,
th.col-select input {
  width: auto;
  margin: 0;
}

tr.row.is-picked {
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elev));
}

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 12000;
  max-width: min(92vw, 480px);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: 0 10px 30px rgb(0 0 0 / 18%);
  font-size: 0.88rem;
  line-height: 1.35;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
  pointer-events: none;
}

.toast-host.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-host.toast-error {
  border-color: color-mix(in srgb, var(--danger) 55%, transparent);
  background: color-mix(in srgb, var(--danger) 12%, var(--bg-elev));
  color: var(--danger);
}

.dd-editable {
  cursor: text;
  border-radius: 5px;
  border-bottom: 1px dashed color-mix(in srgb, var(--ink) 26%, transparent);
}

.dd-editable:hover {
  background: var(--bg-hover);
  border-bottom-color: var(--accent);
}

.cf-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  justify-content: space-between;
}

.cf-remove {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.cf-remove:hover {
  border-color: color-mix(in srgb, var(--danger) 55%, transparent);
  color: var(--danger);
}

.detail-danger {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.btn-danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}

.btn-danger:hover {
  background: color-mix(in srgb, var(--danger) 10%, var(--bg-elev));
  border-color: var(--danger);
}

.dd-editable:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-bottom-color: var(--accent);
}

.notes-save-hint.is-saving {
  color: var(--ink-muted);
}

.notes-save-hint.is-saved {
  color: var(--status-applied);
}

.notes-save-hint.is-error {
  color: var(--danger);
  font-weight: 600;
}

.quick-contact a {
  color: var(--accent-ink);
}

/* Full labels by default; the short variant only kicks in when space runs out. */
.status-text-short {
  display: none;
}

#detailPanel.is-narrow .status-text-full {
  display: none;
}

#detailPanel.is-narrow .status-text-short {
  display: inline;
}

.status-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.status-filter-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status-filter-chip .status-dot {
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.status-filter-chip.status-new {
  color: var(--status-new);
}
.status-filter-chip.status-interesting {
  color: var(--status-interesting);
}
.status-filter-chip.status-applied {
  color: var(--status-applied);
}
.status-filter-chip.status-passed {
  color: var(--status-passed);
}

.status-filter-chip:hover {
  background: var(--bg-hover);
}

.status-filter-chip:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.status-filter-chip.is-active {
  border-color: currentColor;
  border-width: 2px;
  padding: 0 7px;
  background: color-mix(in srgb, currentColor 14%, var(--bg-elev));
}

.status-filter-chip.is-active::after {
  content: "";
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
}

.status-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  min-width: 0;
}

.status-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 36px;
  padding: 0 4px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

.status-chip:hover {
  background: var(--bg-hover);
  color: var(--ink);
}

.status-chip:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.status-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.status-chip.status-passed.is-active {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.section-title-row,
.field-label-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.detail-section > .section-title-row {
  display: flex;
  margin: 0 0 6px;
}

.detail-section > .section-title-row span {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

.hint-q {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
  vertical-align: middle;
}

.hint-q:hover,
.hint-q:focus-visible {
  color: var(--accent-ink);
  border-color: var(--accent);
  outline: none;
  box-shadow: var(--focus);
}

.user-box .field > label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.leaflet-tooltip.map-entry-tip {
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  line-height: 1.25;
  white-space: nowrap;
}

.leaflet-tooltip.map-entry-tip .map-tip-line {
  display: block;
}

.leaflet-tooltip.map-entry-tip .map-tip-meta {
  color: var(--ink-muted);
  font-size: 0.74rem;
}

.stars {
  display: flex;
  gap: 4px;
}

.star-btn {
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
}

.star-btn.on {
  color: var(--home);
  border-color: color-mix(in srgb, var(--home) 55%, transparent);
  background: color-mix(in srgb, var(--home) 14%, transparent);
}

.save-hint {
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 12, 0.48);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  height: 100%;
  background: var(--bg-elev);
  border-left: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.modal-wide {
  width: min(720px, 100%);
}

.modal-layer:has(.login-panel) {
  align-items: safe center;
  justify-content: safe center;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: max(16px, var(--safe-top)) max(16px, var(--safe-right))
    max(16px, var(--safe-bottom)) max(16px, var(--safe-left));
}

.login-panel {
  width: min(400px, 100%);
  height: auto;
  max-height: min(90vh, 520px);
  max-height: min(90dvh, 520px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overscroll-behavior: contain;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form .field {
  display: grid;
  gap: 6px;
}

.login-form input[type="password"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.login-error {
  margin: 0;
  color: #b42318;
  font-size: 0.88rem;
}

.login-gate {
  min-height: calc(100vh - var(--nav-offset));
  min-height: calc(100dvh - var(--nav-offset));
  display: grid;
  place-items: center;
  padding: 24px 16px 48px;
  padding-top: max(24px, calc(16px + var(--safe-top)));
  padding-right: max(16px, var(--safe-right));
  padding-bottom: max(48px, calc(24px + var(--safe-bottom)));
  padding-left: max(16px, var(--safe-left));
  background:
    radial-gradient(
      1200px 480px at 20% -10%,
      color-mix(in srgb, var(--accent) 16%, transparent),
      transparent 60%
    ),
    var(--bg);
}

.login-gate[hidden] {
  display: none !important;
}

.login-card {
  width: min(400px, 100%);
  display: grid;
  gap: 12px;
  padding: 1.25rem 1.35rem 1.4rem;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin: 0;
  font-size: 1.35rem;
}

.login-lead {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.login-card .field {
  display: grid;
  gap: 6px;
}

.login-card input[type="password"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.login-form .btn,
.login-card .btn {
  min-height: 44px;
  width: 100%;
}

.app-shell[hidden] {
  display: none !important;
}

.mobile-preview-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  padding-top: calc(8px + var(--safe-top));
  padding-right: calc(12px + var(--safe-right));
  padding-left: calc(12px + var(--safe-left));
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-elev));
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.35;
  position: relative;
  z-index: calc(var(--z-nav) + 1);
}

body:has(.mobile-preview-banner:not([hidden])) .topnav {
  padding-top: 8px;
  min-height: var(--nav-h);
}

body.sheet-open {
  overflow: hidden;
  touch-action: none;
}

.mobile-preview-banner-text {
  margin: 0;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
}

.mobile-preview-banner .hint-q {
  border-color: color-mix(in srgb, currentColor 35%, transparent);
  background: transparent;
  color: inherit;
}

.mobile-preview-banner-dismiss {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.edit-hint {
  margin: 0;
  font-size: 0.75rem;
}

.editable-value {
  min-height: 34px;
  padding: 6px 8px;
  border: 1px dashed transparent;
  border-radius: 8px;
  cursor: default;
}

.editable-value:hover {
  border-color: var(--line-strong);
  background: var(--bg-soft);
}

.editable-notes {
  white-space: pre-wrap;
  min-height: 56px;
}

.notes-input {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.notes-save-hint {
  margin-left: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-muted);
  opacity: 0.9;
}

.activity-section .activity-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.activity-section textarea {
  width: 100%;
  resize: vertical;
  min-height: 56px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px;
  background: var(--bg);
}

.activity-empty {
  margin: 0;
  font-size: 0.85rem;
}

.chrono-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chrono-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.chrono-action {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.75rem;
  min-height: 36px;
  min-width: 44px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.chrono-action:hover,
.chrono-action:focus-visible {
  color: var(--ink);
  background: var(--bg-soft);
  outline: none;
}

.chrono-action-primary {
  color: var(--accent);
  font-weight: 600;
}

.chrono-action-danger:hover,
.chrono-action-danger:focus-visible {
  color: var(--danger);
}

.chrono-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.chrono-edit-input {
  width: 100%;
  resize: vertical;
  min-height: 64px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px;
  background: var(--bg);
  font: inherit;
}

.chrono-edit-input:focus {
  outline: none;
  box-shadow: var(--focus);
  border-color: var(--accent);
}

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

.chrono-list {
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.chrono-list li {
  display: grid;
  gap: 0.15rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.88rem;
}

.chrono-list time {
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.chrono-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
}

.modal-body {
  padding: 12px 14px 20px;
  overflow: auto;
  flex: 1;
}

.prompt-body {
  padding-top: 0;
}

.prompt-md,
#promptText {
  min-height: calc(100vh - 150px);
  font-size: 0.95rem;
  line-height: 1.65;
}

#promptText {
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.55;
}

.prompt-md {
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  border-radius: 7px;
  padding: 14px 16px 20px;
  overflow: auto;
  color: var(--ink);
}

.prompt-md > :first-child {
  margin-top: 0;
}

.prompt-md > :last-child {
  margin-bottom: 0;
}

.prompt-md h1,
.prompt-md h2,
.prompt-md h3 {
  margin: 1.1em 0 0.45em;
  line-height: 1.3;
  font-weight: 650;
}

.prompt-md h1 {
  font-size: 1.25rem;
}
.prompt-md h2 {
  font-size: 1.12rem;
}
.prompt-md h3 {
  font-size: 1.02rem;
}

.prompt-md p,
.prompt-md ul,
.prompt-md ol {
  margin: 0.55em 0;
}

.prompt-md ul,
.prompt-md ol {
  padding-left: 1.35em;
}

.prompt-md li {
  margin: 0.2em 0;
}

.prompt-md strong {
  font-weight: 650;
}

.prompt-md code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--bg-soft);
}

.prompt-md .prompt-fallback {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.55;
}

.modal-toolbar .btn-icon {
  padding: 6px 8px;
}

.prompt-editing #editPrompt {
  display: none;
}

.prompt-editing #donePrompt {
  display: inline-flex;
}

#donePrompt[hidden] {
  display: none !important;
}

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

  .mobile-only {
    display: inline-flex;
  }

  .view-toggle.mobile-only {
    display: inline-flex;
  }

  .desktop-only {
    display: none !important;
  }

  .app-shell,
  .app-shell.filters-collapsed {
    grid-template-columns: 1fr;
  }

  .filters-col {
    position: fixed;
    left: 0;
    top: var(--nav-offset);
    width: min(320px, 92vw);
    height: calc(100vh - var(--nav-offset));
    height: calc(100dvh - var(--nav-offset));
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
    z-index: var(--z-filters-mobile);
    background: var(--bg-elev);
    padding-bottom: var(--safe-bottom);
  }

  .filters-col.mobile-open {
    transform: translateX(0);
  }

  .filters-rail {
    display: none !important;
  }

  .app-shell.filters-collapsed .filters-body {
    display: block;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: var(--nav-offset) 0 0 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: var(--z-backdrop);
  }

  .sidebar-backdrop[hidden] {
    display: none;
  }

  .details-col {
    position: fixed;
    inset: var(--nav-offset) 0 0 0;
    height: auto;
    width: 100%;
    max-width: none;
    border-left: 0;
    transform: translateY(105%);
    transition: transform 0.22s ease;
    z-index: var(--z-filters-mobile);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.18);
    background: var(--bg-elev);
  }

  .details-col.mobile-open {
    transform: translateY(0);
    padding-bottom: var(--safe-bottom);
  }

  .filters-body .check-label {
    min-height: 44px;
    align-items: center;
  }

  .filters-body .field input,
  .filters-body .field select {
    min-height: 44px;
  }

  .nav-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 8px;
    justify-content: center;
  }

  .nav-btn span:not(.sr-only),
  .theme-label {
    display: none;
  }

  .nav-primary {
    overflow-x: auto;
    max-width: min(100%, 52vw);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-primary::-webkit-scrollbar {
    display: none;
  }

  .nav-primary .nav-link {
    min-width: 0;
    min-height: 40px;
    justify-content: center;
    padding: 6px 7px;
    font-size: 0.74rem;
  }

  .nav-icon-btn {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .lang-toggle button,
  .lang-toggle .lang-flag {
    min-height: 40px;
    min-width: 40px;
  }

  .center-col {
    padding: 10px 10px 16px;
    gap: 10px;
  }

  .center-toolbar {
    padding: 8px 10px;
    gap: 6px;
  }

  .toolbar-right {
    gap: 6px 8px;
  }

  .toolbar-right .result-count {
    margin-left: 0;
    width: 100%;
    order: 5;
  }

  .inline-label,
  .sort-label {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
  }

  .inline-label select,
  .sort-select {
    flex: 0 1 auto;
    width: auto;
    width: max-content;
    min-width: 6.5rem;
    max-width: min(12rem, 100%);
    min-height: 44px;
    padding-inline: 10px 28px;
    font-size: 16px;
  }

  .filters-body .field input,
  .filters-body .field select,
  .login-card input,
  .user-box textarea,
  #notesInput,
  #activityInput,
  .chrono-edit-input {
    font-size: 16px;
  }

  .status-chip {
    min-height: 38px;
    padding: 0 2px;
    font-size: 0.7rem;
  }

  .status-chips {
    gap: 3px;
    padding: 3px;
  }

  .user-box {
    gap: 6px;
    padding: 8px;
  }

  .editable-value.editable-notes,
  .notes-input {
    min-height: 72px;
  }

  .chrono-action {
    min-height: 44px;
  }

  .map-toolbar h2 {
    display: none;
  }

  body.is-columns-mobile .data th.col-drive,
  body.is-columns-mobile .data td.col-drive {
    width: 3.6rem;
    white-space: nowrap;
  }

  .btn-small {
    min-height: 44px;
    padding: 8px 12px;
  }

  .col-menu label {
    min-height: 44px;
    padding: 8px 6px;
  }

  .icon-btn {
    width: 44px;
    height: 44px;
  }

  .detail-nav-btn {
    width: 44px;
    height: 44px;
  }

  .map-toolbar {
    padding: 6px 10px;
  }

  .map-legend {
    gap: 6px 8px;
    font-size: 0.72rem;
  }

  :root {
    --map-h: min(28vh, 220px);
    --nav-h: 52px;
  }

  body.view-list .map-panel {
    display: none;
  }

  body.view-map .list-panel {
    display: none;
  }

  body.view-map {
    --map-h: min(58vh, 460px);
  }

  body.view-list .table-wrap {
    max-height: min(72vh, 720px);
    max-height: min(72dvh, 720px);
  }

  .data th,
  .data td {
    padding: 11px 8px;
  }

  .data tr.row {
    min-height: 44px;
  }
}

@media (max-width: 768px) {
  body.is-columns-mobile .data th,
  body.is-columns-mobile .data td {
    padding: 5px 6px;
  }

  body.is-columns-mobile .badge.type-job,
  body.is-columns-mobile .badge.type-employer,
  body.is-columns-mobile .badge.type-restaurant,
  body.is-columns-mobile .badge.status-new,
  body.is-columns-mobile .badge.status-interesting,
  body.is-columns-mobile .badge.status-applied,
  body.is-columns-mobile .badge.status-passed {
    padding: 2px 5px;
    font-size: 0.66rem;
  }

  body.is-columns-mobile .badge .status-text-full {
    display: none;
  }

  body.is-columns-mobile .badge .status-text-short {
    display: inline;
  }

  .title-cell {
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  .brand-text p {
    display: none;
  }

  .topnav {
    padding: 6px 8px;
    padding-top: calc(6px + var(--safe-top));
    padding-right: calc(8px + var(--safe-right));
    padding-left: calc(8px + var(--safe-left));
    gap: 8px;
  }

  .brand-text h1 {
    font-size: 0.95rem;
  }

  .center-col {
    padding: 8px;
    padding-bottom: max(8px, var(--safe-bottom));
  }

  .map-legend span span {
    display: none;
  }

  .map-legend span {
    gap: 0;
  }

  .modal-panel,
  .modal-wide {
    width: 100%;
  }

  .modal-layer:has(.login-panel) {
    align-items: flex-end;
    justify-content: stretch;
    padding: 0;
    padding-top: var(--safe-top);
  }

  .login-panel {
    width: 100%;
    max-height: min(92dvh, 100%);
    border-radius: 16px 16px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding-bottom: var(--safe-bottom);
  }

  .kv {
    grid-template-columns: minmax(72px, 30%) 1fr;
  }

  .kv dt,
  .kv dd {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  :root {
    --map-h: min(26vh, 200px);
  }

  body.view-map {
    --map-h: min(55vh, 420px);
  }
}

@media (max-width: 360px) {
  .brand-text {
    display: none;
  }

  .brand {
    flex-shrink: 0;
  }

  .topnav {
    gap: 6px;
    padding: 6px 8px;
    padding-top: calc(6px + var(--safe-top));
    padding-right: calc(8px + var(--safe-right));
    padding-left: calc(8px + var(--safe-left));
  }

  .nav-actions {
    gap: 4px;
  }

  .lang-toggle button,
  .lang-toggle .lang-flag {
    min-height: 40px;
    min-width: 40px;
    padding: 3px;
  }

  .view-toggle-btn {
    min-width: 52px;
    padding: 8px 10px;
  }
}

.nav-primary {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 1;
  min-width: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 550;
  white-space: nowrap;
  background: transparent;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.nav-link:hover {
  filter: none;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.nav-link.active {
  color: var(--accent-ink);
  background: var(--accent-soft);
  font-weight: 650;
}

/* Wide screens keep the links inline; the menu button only appears once they
   would start colliding with the utility buttons. */
.nav-actions .nav-menu-toggle {
  display: none;
}

@media (max-width: 1080px) {
  .nav-actions .nav-menu-toggle {
    display: inline-grid;
  }

  .topnav > .nav-primary {
    position: absolute;
    top: calc(100% - 4px);
    right: 10px;
    z-index: var(--z-nav);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    min-width: 190px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--bg-elev);
    box-shadow: 0 12px 30px rgb(0 0 0 / 16%);
  }

  .topnav > .nav-primary.is-open {
    display: flex;
  }

  .topnav > .nav-primary .nav-link {
    justify-content: flex-start;
    min-height: 40px;
    padding: 8px 10px;
  }
}

.nav-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--ink);
  border-radius: 8px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.nav-icon-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.nav-icon-btn.nav-icon-ok {
  color: var(--accent-ink);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--accent-soft);
}

.nav-icon-btn .theme-label,
.nav-btn.nav-icon-only .theme-label {
  display: none;
}

.lang-toggle.lang-text button {
  min-width: 36px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  opacity: 0.7;
}

.lang-toggle.lang-text button.active {
  opacity: 1;
}

body.saas-page {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image: var(--page-base);
}

.saas-shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.saas-shell-wide {
  width: min(1100px, calc(100% - 32px));
}

.saas-head {
  margin-bottom: 18px;
}

.saas-kicker {
  margin: 0 0 6px;
  color: var(--accent-ink);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.saas-head h1 {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.saas-lead {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.saas-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.saas-toolbar .save-hint {
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.prompt-page-body {
  display: grid;
  gap: 0;
}

.prompt-page-body .prompt-md,
.prompt-page-body #promptText {
  min-height: calc(100dvh - 220px);
}

.design-grid {
  display: grid;
  gap: 22px;
}

.design-section {
  padding: 18px 0 4px;
  border-top: 1px solid var(--line);
}

.design-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.design-section h2 {
  margin: 0 0 10px;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.design-subhead {
  margin: 16px 0 8px;
  font-size: 0.92rem;
  font-weight: 650;
}

.design-section p {
  margin: 0 0 12px;
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.design-kv {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 6px 16px;
  margin: 0;
}

.design-kv dt {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.84rem;
}

.design-kv dd {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink);
}

.design-tree {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
}

.design-tree ul {
  list-style: none;
  margin: 4px 0 8px;
  padding-left: 18px;
  border-left: 1px solid color-mix(in srgb, var(--line-strong) 70%, transparent);
}

.design-tree li {
  margin: 2px 0;
  color: var(--ink);
}

.design-tree .tree-key {
  color: var(--accent-ink);
  font-weight: 550;
}

.design-tree .tree-type {
  color: var(--ink-muted);
}

.design-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.design-chips li {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elev) 80%, transparent);
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-family: var(--mono);
}

.design-fields {
  display: grid;
  gap: 8px;
}

.design-field {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr auto;
  gap: 8px 14px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.design-field:last-child {
  border-bottom: 0;
}

.design-field-key {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent-ink);
}

.design-field-meta {
  color: var(--ink-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.design-field-badge {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.design-field-badge.is-required {
  color: var(--accent-ink);
}

.qa-empty {
  margin-top: 28px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .nav-link {
    padding: 7px 8px;
    font-size: 0.86rem;
  }

  .brand-text p {
    display: none;
  }
}

@media (max-width: 720px) {
  .saas-shell,
  .saas-shell-wide {
    width: calc(100% - 24px);
    padding-top: 20px;
  }

  .design-kv,
  .design-field {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .design-field-badge {
    justify-self: start;
  }
}
