@font-face {
  font-family: Atelier;
  src: url("../assets/fonts/outfit-variable-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  font-family: var(--dia-ui-font-family);
  color: #283a32;
  background: #f3f5f3;
  font-synthesis: none;
  --ink: #283a32;
  --muted: #5e695f;
  --line: #d9dfd8;
  --accent: #294f3d;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: #fff;
  border: 1px solid #bac6bc;
  border-radius: 5px;
  padding: 10px 13px;
  font-size: 12px;
  min-height: 40px;
}
button:hover {
  background: #edf2ec;
  border-color: #718577;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
.primary {
  background: #294f3d;
  border-color: #294f3d;
  color: #fff;
}
.primary:hover {
  background: #1d3d2c;
  color: #fff;
}
a {
  color: var(--accent);
  text-underline-offset: 4px;
  font-size: 12px;
}
:focus-visible {
  outline: 3px solid #957134;
  outline-offset: 3px;
}
::selection {
  background: #c9dfd0;
  color: #183c27;
}
input {
  accent-color: var(--accent);
  caret-color: var(--accent);
}
input:not([type="checkbox"]):not([type="range"]):not([type="color"]),
select {
  width: 100%;
  min-height: 41px;
  padding: 9px 10px;
  border: 1px solid #bac6bc;
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
}
input:invalid {
  border-color: #ad493b;
}
input[type="range"] {
  width: 100%;
  margin: 12px 0 24px;
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}
input[type="color"] {
  height: 37px;
  width: 46px;
  padding: 2px;
  background: #fff;
  border: 1px solid #bac6bc;
  border-radius: 4px;
  cursor: pointer;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 7px;
}
output {
  float: right;
  color: var(--muted);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.topbar {
  height: 77px;
  padding: 0 25px;
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.brand {
  font-size: 29px;
  letter-spacing: -0.035em;
  font-weight: 750;
  text-decoration: none;
  color: var(--ink);
}
.brand span {
  color: #9b895e;
}
h1 {
  font-size: 17px;
  font-weight: 550;
  letter-spacing: -0.02em;
  margin: 0;
}
.top-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.workspace {
  display: grid;
  grid-template-columns: 355px minmax(0, 1fr);
  height: calc(100dvh - 77px);
  min-height: 550px;
}
.sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--line);
}
.model {
  padding: 23px 23px 15px;
}
.model p,
.help {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
}
.model p {
  margin: 8px 0 0;
}
.tabs {
  display: flex;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  gap: 0;
}
.tabs button {
  padding: 12px 9px;
  border: 0;
  background: transparent;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-size: 12px;
  min-height: 47px;
}
.tabs button[aria-current="page"] {
  color: #294f3d;
  border-bottom-color: #294f3d;
  font-weight: 700;
}
.settings {
  padding: 24px 23px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #adbaad #f3f5f3;
}
section[hidden],
[hidden] {
  display: none !important;
}
h2 {
  font-size: 17px;
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin: 0 0 8px;
  font-weight: 600;
}
h3 {
  font-size: 13px;
  margin: 0 0 13px;
}
.help {
  margin: 0 0 20px;
}
.color-row {
  display: grid;
  grid-template-columns: 1fr 45px 85px;
  gap: 9px;
  align-items: center;
  padding: 9px 0;
}
.color-row label {
  margin: 0;
  font-weight: 450;
}
.color-row input.hex {
  font-size: 12px !important;
  padding: 8px !important;
  text-transform: uppercase;
  min-height: 37px !important;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 450;
  line-height: 1.5;
  margin: 15px 0;
}
.separated {
  border-top: 1px solid var(--line);
  margin-top: 23px;
  padding-top: 19px;
}
.text-button {
  border: 0;
  background: transparent;
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  color: var(--accent);
  font-size: 12px;
}
.text-button:hover {
  background: transparent;
}
.danger {
  color: #984132;
}
.preview {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 22px 0;
}
.preview-toolbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.preview-toolbar strong {
  font-size: 14px;
  display: block;
  font-weight: 600;
}
.preview-toolbar span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.preview-actions {
  display: flex;
  gap: 6px;
}
.preview-actions button {
  padding: 7px 10px;
  min-height: 35px;
}
.map-wrap {
  position: relative;
  flex: 1;
  min-height: 330px;
  background: #e6e6e6;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.map-comparison {
  display: flex;
  flex: 1;
  min-height: 330px;
  gap: 12px;
}
.map-comparison.is-comparing > * {
  flex: 1 1 0;
  min-width: 0;
}
.comparison-source {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.comparison-source[hidden] {
  display: none;
}
.comparison-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px;
  font-size: 12px;
}
#google-comparison-map {
  position: relative;
  flex: 1;
  min-height: 330px;
}
.google-map-surface {
  position: absolute;
  inset: 0;
}
.comparison-source > .help {
  margin: 0;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.map-panel-label {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  pointer-events: none;
}
@media (max-width: 1100px) {
  .map-comparison.is-comparing {
    flex-direction: column;
  }
  .map-comparison.is-comparing > * {
    flex-basis: 420px;
    min-height: 420px;
  }
  .workspace:has(.is-comparing) {
    height: auto;
    min-height: calc(100dvh - 77px);
  }
}
#map {
  position: absolute;
  inset: 0;
}
#map-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #edf1eb;
  color: var(--muted);
  font-size: 13px;
}
#map-message {
  position: absolute;
  bottom: 42px;
  left: 15px;
  right: 15px;
  background: #fff;
  padding: 15px;
  border: 1px solid #9f6958;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1.6;
}
.preview-footer {
  min-height: 55px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.preview-footer span:last-child {
  text-align: right;
}
.marker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 18px 0 12px;
}
.marker-list button {
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.marker-list img {
  width: 22px;
  height: 30px;
  object-fit: contain;
}
.marker-list button[aria-pressed="true"] {
  border-color: var(--accent);
  background: #edf2ec;
  font-weight: 600;
}
.wide {
  width: 100%;
  margin-top: 9px;
}
.coordinate-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}
.button-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.button-row button {
  flex: 1;
  font-size: 12px;
  padding: 7px;
}
.notice {
  font-size: 12px;
  line-height: 1.7;
  background: #edf1eb;
  padding: 14px;
  margin: 22px 0;
}
.editor-marker {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: grab;
  min-height: 0;
}
.editor-marker:hover {
  background: transparent;
}
.editor-marker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 2px #0003);
}
.editor-marker.is-selected img {
  filter: drop-shadow(0 2px 3px #0005);
}
.editor-marker.no-shadow img {
  filter: none;
}
.editor-marker:focus-visible {
  outline-offset: 5px;
}
.maplibregl-popup-content {
  font-family: var(--dia-ui-font-family);
  padding: 14px 24px 14px 14px;
}
.maplibregl-ctrl-attrib a {
  font-size: 12px;
}
.placing .maplibregl-canvas-container {
  cursor: crosshair;
}
@media (max-width: 1000px) {
  .topbar {
    gap: 18px;
    padding: 0 18px;
  }
  .top-actions button {
    font-size: 12px;
    padding: 8px;
  }
  .workspace {
    grid-template-columns: 325px minmax(0, 1fr);
  }
  .preview {
    padding: 0 14px;
  }
  .preview-actions {
    gap: 3px;
  }
  .preview-actions button {
    font-size: 12px;
    padding: 6px;
  }
  .preview-footer span:last-child {
    display: none;
  }
  .model,
  .settings {
    padding-left: 18px;
    padding-right: 18px;
  }
}
@media (max-width: 720px) {
  .topbar {
    height: auto;
    min-height: 94px;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 12px 16px;
  }
  .brand {
    font-size: 24px;
  }
  h1 {
    font-size: 15px;
  }
  .top-actions {
    width: 100%;
    margin: 0;
    gap: 6px;
  }
  .top-actions button {
    flex: 1;
  }
  .workspace {
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .preview {
    order: -1;
    padding: 0 12px;
  }
  .preview-toolbar {
    height: 65px;
  }
  .preview-toolbar strong {
    max-width: 160px;
    font-size: 12px;
  }
  .preview-actions button {
    font-size: 12px;
    min-height: 34px;
  }
  .map-wrap {
    height: 44dvh;
    min-height: 300px;
    flex: none;
  }
  .preview-footer {
    min-height: 37px;
  }
  .sidebar {
    border-right: 0;
    border-top: 1px solid var(--line);
  }
  .model {
    padding: 16px 20px;
  }
  .tabs {
    justify-content: space-between;
    padding: 0 12px;
  }
  .tabs button {
    font-size: 12px;
    padding: 12px;
  }
  .settings {
    overflow: visible;
    padding: 22px 20px;
  }
  .sidebar-foot {
    padding: 14px 20px;
  }
  .color-row {
    grid-template-columns: 1fr 46px 100px;
  }
  .maplibregl-ctrl-attrib {
    max-width: 90%;
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
.maplibregl-user-location-dot::before {
  animation: none !important;
}
.preview-toolbar > div:first-child {
  min-width: 0;
  flex: 1;
}
.preview-actions {
  flex-shrink: 0;
}
.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 0 14px;
}
.tabs button {
  min-height: 37px;
  padding: 8px 5px;
}
.illustration-example {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: #edf2ec;
}
.illustration-example img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}
.illustration-example span {
  line-height: 1.5;
}
.count-picker {
  margin: 20px 0;
}
.count-picker > div {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
}
.count-picker button {
  font-size: 20px;
  font-weight: 500;
}
.count-picker input {
  text-align: center;
  font-size: 20px !important;
  font-variant-numeric: tabular-nums;
}
.count-picker .help {
  margin-top: 8px;
}
.herd-handle {
  background: #fff;
  color: #294f3d;
  border: 1px solid #798f72;
  border-radius: 4px;
  padding: 6px 9px;
  font: 12px var(--dia-ui-font-family);
  min-height: 32px;
  cursor: grab;
  box-shadow: 0 2px 5px #0002;
  white-space: nowrap;
}
.herd-handle:active {
  cursor: grabbing;
}
.field-animal:hover {
  background: transparent !important;
}
.field-animal:focus-visible {
  outline: 2px solid #294f3d;
  outline-offset: 2px;
}
.illustration-credit a {
  font-size: 10px;
  color: #344739;
}
.map-drawing-tools {
  position: absolute;
  z-index: 3;
  left: 12px;
  top: 12px;
  max-width: calc(100% - 70px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  background: #fff;
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 2px 6px #0002;
}
.map-drawing-tools span {
  font-size: 12px;
  line-height: 1.5;
  flex-basis: 100%;
}
.map-drawing-tools button {
  font-size: 12px;
  padding: 7px;
  min-height: 36px;
}
#illustration-fields > input:not([type="range"]) {
  margin-bottom: 18px;
}
#illustration-fields.separated {
  margin-top: 12px;
  padding-top: 0;
  border: 0;
}
.count-picker {
  margin-top: 12px;
}
@media (max-width: 720px) {
  .herd-handle {
    min-height: 44px;
  }
}
.text-halo-settings .color-row {
  margin: 10px 0 18px;
}
.text-halo-preview {
  padding: 18px 10px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin: 0 0 12px;
}
.text-halo-preview span {
  font-size: 26px;
  font-weight: 550;
  line-height: 1.4;
}
.text-halo-settings .help {
  margin-bottom: 5px;
}
.text-halo-settings + .check {
  margin-top: 25px;
}
@media (max-width: 720px) {
  .preview-toolbar {
    height: auto;
    min-height: 83px;
    flex-wrap: wrap;
    padding: 12px 0;
  }
  .preview-toolbar > div:first-child {
    flex-basis: 100%;
  }
  .preview-toolbar strong {
    max-width: none;
  }
  .preview-toolbar > div:first-child {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
  }
  .preview-toolbar span {
    margin-top: 0;
  }
  .preview-actions {
    margin-left: auto;
  }
  .top-actions button {
    min-width: 0;
  }
}

:root {
  --ink: var(--dia-ui-neutral-900);
  --muted: var(--dia-ui-neutral-600);
  --line: var(--dia-ui-neutral-200);
  --accent: var(--dia-ui-iable-blue);
  background: var(--dia-ui-neutral-50);
  color: var(--ink);
}
body {
  font-family: var(--dia-ui-font-family);
  font-size: 14px;
}
button {
  border: 0;
  border-radius: 8px;
  background: var(--dia-ui-neutral-100);
  font-size: 13px;
  min-height: 42px;
  color: var(--dia-ui-neutral-700);
  transition:
    background 0.15s,
    color 0.15s;
}
button:hover {
  background: var(--dia-ui-neutral-200);
}
button.primary {
  background: var(--accent);
  color: white;
}
button.primary:hover {
  background: #174bd1;
}
button:disabled {
  opacity: 0.5;
}
a {
  font-size: 13px;
}
input:not([type="checkbox"]):not([type="range"]):not([type="color"]),
select {
  border-color: var(--dia-ui-neutral-300);
  border-radius: 8px;
  min-height: 44px;
  font-size: 14px;
}
input[type="color"] {
  border-color: var(--dia-ui-neutral-300);
  border-radius: 8px;
}
input[type="range"] {
  accent-color: var(--accent);
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
::selection {
  background: #dbe6ff;
  color: #091b32;
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--dia-ui-neutral-300) var(--dia-ui-neutral-50);
}
.app-nav {
  position: fixed;
  inset: 0 auto 0 0;
  width: 196px;
  background: var(--dia-ui-iable-sidebar-bg);
  color: white;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  z-index: 5;
}
.wordmark {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: white;
  text-decoration: none;
  padding: 0 12px 38px;
}
.wordmark span {
  display: block;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: #b7c7dd;
  margin-top: 5px;
}
.app-nav nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.app-nav nav button,
.app-nav nav a {
  width: 100%;
  color: #d0daea;
  background: transparent;
  text-align: left;
  text-decoration: none;
  padding: 12px 16px;
  font-size: 14px;
  border-radius: 8px;
  min-height: 44px;
}
.app-nav nav .nav-active {
  background: var(--accent);
  color: white;
}
.app-nav nav a:hover {
  background: #18304e;
}
.app-nav nav button:not(.nav-active):hover {
  background: #18304e;
}
.library-row-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.library-row-actions button,
.library-row-actions a {
  white-space: nowrap;
}
.library table {
  min-width: 900px;
}
.library .site-domain {
  overflow-wrap: anywhere;
}
.published-library .library-filters {
  grid-template-columns: minmax(0, 1fr);
}
.nav-foot {
  margin: auto 12px 0;
  font-size: 12px;
  line-height: 1.8;
  color: #b7c7dd;
}
.app-content {
  margin-left: 196px;
  min-width: 0;
}
.app-header {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: white;
  gap: 12px;
}
.app-title {
  font-weight: 500;
  color: var(--muted);
}
.page-header {
  min-height: 76px;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 18px;
  font-weight: 600;
}
h3 {
  font-size: 14px;
}
.top-actions {
  margin-left: 0;
  flex-shrink: 0;
  align-items: center;
}
.workspace {
  height: calc(100dvh - 148px);
  min-height: 500px;
  grid-template-columns: 340px minmax(0, 1fr);
  margin: 0 24px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}
.sidebar {
  border-color: var(--line);
}
.model {
  padding: 20px;
}
.model p {
  font-size: 12px;
}
.tabs {
  padding: 0 12px;
  background: var(--dia-ui-neutral-50);
  border: 0;
  gap: 4px;
  padding-bottom: 8px;
}
.tabs button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  min-height: 38px;
  color: var(--muted);
}
.tabs button[aria-current="page"] {
  background: #e9efff;
  color: #174bd1;
  border: 0;
}
.settings {
  padding: 22px 20px;
  background: white;
  scrollbar-color: var(--dia-ui-neutral-300) white;
}
.help {
  color: var(--muted);
}
.preview {
  padding: 0 16px;
  background: var(--dia-ui-neutral-50);
}
.preview-toolbar {
  height: 68px;
}
.preview-toolbar strong {
  font-size: 15px;
}
.preview-actions button {
  font-size: 12px;
  padding: 8px;
}
.map-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
}
.preview-footer {
  font-size: 12px;
}
.color-row {
  grid-template-columns: minmax(0, 1fr) 44px 86px;
  gap: 8px;
}
.color-row label {
  font-size: 13px;
}
.check {
  font-size: 13px;
}
.text-button {
  background: transparent;
  border: 0;
  color: var(--accent);
}
.text-button:hover {
  background: var(--dia-ui-neutral-50);
}
.danger {
  color: #b42318;
}
.illustration-example {
  background: #eff4ff;
}
.herd-handle {
  color: var(--ink);
  border-color: var(--line);
  font-family: var(--dia-ui-font-family);
}
.editor-marker {
  border: 0 !important;
  background: none !important;
}
.text-halo-preview {
  border-radius: 8px;
}
.notice {
  border: 0;
  border-radius: 8px;
  background: #fff6e6;
  color: #805a16;
  padding: 12px;
  line-height: 1.6;
}
.notice.error {
  background: #fff0ee;
  color: #b42318;
}
.library {
  padding: 0 28px 48px;
  max-width: 1450px;
}
.intro {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 28px;
  line-height: 1.6;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 0 0 24px;
  overflow: hidden;
}
.panel-heading {
  padding: 22px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-heading h2,
.panel-heading .help {
  margin: 0;
}
.panel-note {
  padding: 0 24px 20px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
  margin: 0;
}
.panel > .panel-note:last-child {
  padding-top: 16px;
}
.empty-state {
  text-align: center;
  padding: 24px;
  color: var(--muted);
}
.empty-state h3 {
  font-size: 17px;
  color: var(--ink);
  margin: 0 0 8px;
}
.empty-state p {
  margin: 0;
  font-size: 14px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}
th {
  background: var(--dia-ui-neutral-50);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  padding: 12px 24px;
  white-space: nowrap;
}
td {
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  line-height: 1.5;
}
tr:last-child td {
  border-bottom: 0;
}
td:last-child {
  text-align: right;
}
tr:hover td {
  background: #f7f9ff;
}
.workflow-note {
  max-width: 75ch;
  margin: 36px 0 0;
  color: var(--muted);
  line-height: 1.7;
}
.workflow-note h2 {
  color: var(--ink);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
#bulk-dialog {
  width: min(1200px, calc(100% - 32px));
}
#bulk-dialog[open] {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: min(780px, calc(100dvh - 40px));
  overflow: hidden;
}
#bulk-dialog .dialog-heading {
  margin: 0;
  flex-shrink: 0;
}
.bulk-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.bulk-tabs button {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 12px 0;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.bulk-tabs button[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--dia-ui-primary, #2563ff);
  font-weight: 600;
}
.bulk-panel {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 16px;
}
.bulk-panel[hidden] {
  display: none;
}
.bulk-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.65fr) minmax(
      170px,
      0.65fr
    );
  gap: 16px;
}
.bulk-filters label {
  display: block;
  margin-bottom: 6px;
}
.bulk-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.bulk-selection p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.bulk-history-results {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}
.bulk-history-results[hidden] {
  display: none;
}
.bulk-tracker {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  width: min(390px, calc(100vw - 32px));
  padding: 18px;
  background: #fff;
  box-shadow: 0 8px 32px #00000026;
  border-radius: 12px;
}
.bulk-tracker[hidden],
.auth-locked #bulk-tracker {
  display: none;
}
.bulk-tracker-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.bulk-tracker h2 {
  font-size: 16px;
  line-height: 1.4;
  margin: 0 0 4px;
}
.bulk-tracker-heading p {
  margin: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.bulk-tracker-heading button {
  padding: 6px 10px;
  font-size: 12px;
}
.bulk-tracker #bulk-tracker-detail {
  font-size: 13px;
  line-height: 1.6;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.bulk-tracker .top-actions {
  flex-wrap: wrap;
  gap: 8px;
}
.bulk-tracker .top-actions button {
  font-size: 13px;
  padding: 8px 10px;
}
.bulk-tracker progress {
  width: 100%;
  height: 6px;
  margin-top: 14px;
  accent-color: var(--dia-ui-primary, #2563ff);
}
.bulk-sites-wrap {
  flex: 1;
  min-height: 120px;
  overflow: auto;
}
.bulk-results-wrap {
  flex: 1;
  min-height: 100px;
  overflow: auto;
}
#bulk-dialog th {
  position: sticky;
  top: 0;
  background: var(--surface, #fff);
}
#bulk-dialog td {
  vertical-align: top;
  white-space: normal;
}
#bulk-dialog td:last-child button,
#bulk-dialog td:last-child a {
  display: block;
  margin-bottom: 8px;
}
#bulk-dialog input[type="checkbox"] {
  width: 18px;
  height: 18px;
}
.bulk-footer {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.bulk-footer .help {
  flex: 1;
  min-width: 220px;
  margin: 0;
}
@media (max-width: 720px) {
  #bulk-dialog[open] {
    padding: 18px;
    gap: 12px;
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
  }
  #bulk-dialog .dialog-heading h2 {
    font-size: 19px;
  }
  .bulk-tabs {
    gap: 16px;
  }
  .bulk-tabs button {
    font-size: 13px;
  }
  .bulk-filters {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .bulk-filters > div:first-child {
    grid-column: 1/-1;
  }
  .bulk-filters label {
    font-size: 12px;
  }
  .bulk-selection .top-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  .bulk-selection button {
    font-size: 12px;
    padding: 8px;
  }
  .bulk-footer {
    gap: 10px;
  }
  .bulk-footer button {
    width: 100%;
  }
  .bulk-tracker {
    right: 16px;
    bottom: 16px;
    padding: 16px;
  }
}
dialog {
  width: min(640px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  border: 0;
  border-radius: 16px;
  padding: 28px;
  color: var(--ink);
  box-shadow: 0 24px 64px #00000030;
  overflow: auto;
}
dialog::backdrop {
  background: #091b3266;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}
.dialog-heading h2 {
  font-size: 23px;
  margin: 0;
}
dialog input,
dialog select {
  margin-bottom: 18px;
}
.coordinate-fields {
  gap: 12px;
}
details summary {
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 14px;
}
#create-project {
  margin-top: 4px;
}
#map-loading {
  color: var(--ink);
  background: #f9fafbea;
}
#map-message {
  font-size: 13px;
}
@media (max-width: 1200px) {
  .app-nav {
    width: 160px;
  }
  .app-content {
    margin-left: 160px;
  }
  .workspace {
    grid-template-columns: 310px minmax(0, 1fr);
    margin-left: 16px;
    margin-right: 16px;
  }
  .app-header,
  .page-header {
    padding-left: 20px;
    padding-right: 20px;
  }
  .preview-actions {
    gap: 3px;
  }
  .preview-actions button {
    padding: 6px;
    font-size: 12px;
  }
  .preview-toolbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 85px;
    padding: 10px 0;
  }
  .preview-toolbar > div:first-child {
    flex-basis: 100%;
  }
  .preview-actions {
    margin-left: auto;
  }
}
@media (max-width: 900px) {
  #nav-new-project {
    display: none;
  }
  .app-nav nav button {
    white-space: nowrap;
    padding: 10px 12px;
  }
  .app-nav {
    position: static;
    width: 100%;
    padding: 12px 18px;
    flex-direction: row;
    align-items: center;
    gap: 20px;
  }
  .wordmark {
    padding: 0;
    font-size: 19px;
  }
  .wordmark span,
  .nav-foot {
    display: none;
  }
  .app-nav nav {
    flex-direction: row;
    margin-left: auto;
  }
  .app-nav nav a {
    display: none;
  }
  .app-content {
    margin: 0;
  }
  .app-header {
    height: auto;
    min-height: 68px;
    flex-wrap: wrap;
    padding: 14px 18px;
  }
  .app-title {
    display: none;
  }
  .app-header .top-actions {
    margin-left: auto;
  }
  .page-header {
    padding: 16px 18px;
    flex-wrap: wrap;
  }
  h1 {
    font-size: 23px;
  }
  .workspace {
    height: calc(100dvh - 220px);
    margin: 0 12px 16px;
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .library {
    padding: 0 18px 40px;
  }
  .top-actions button {
    font-size: 12px;
  }
  .panel-heading {
    padding: 18px;
  }
  .panel-heading h2 {
    font-size: 16px;
  }
  .panel-note {
    padding-left: 18px;
    padding-right: 18px;
  }
  .panel-heading .help {
    font-size: 12px;
  }
  .library th,
  .library td {
    padding: 12px 16px;
  }
}
@media (max-width: 720px) {
  .workspace {
    height: auto;
    display: flex;
    min-height: 0;
  }
  .preview {
    padding: 0 12px;
    order: -1;
  }
  .map-wrap {
    height: 45dvh;
    min-height: 300px;
  }
  .sidebar {
    border-right: 0;
  }
  .preview-toolbar {
    min-height: 86px;
  }
  .settings {
    overflow: visible;
  }
  .preview-footer {
    line-height: 1.5;
    padding: 12px 0;
  }
  .page-header .top-actions {
    width: 100%;
    display: flex;
  }
  .page-header .top-actions button {
    flex: 1;
  }
  .app-header .top-actions {
    width: 100%;
    display: flex;
  }
  .app-header .top-actions button {
    flex: 1;
  }
  .library th:nth-child(3),
  .library td:nth-child(3) {
    display: none;
  }
  .library td:last-child {
    display: table-cell;
  }
  .library th:last-child {
    display: table-cell;
  }
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .coordinate-fields {
    grid-template-columns: 1fr 1fr;
  }
  dialog {
    padding: 20px;
  }
  .dialog-heading h2 {
    font-size: 21px;
  }
  .intro {
    font-size: 14px;
  }
  #marker-list button {
    min-width: 0;
  }
  .color-row {
    grid-template-columns: minmax(0, 1fr) 44px 90px;
  }
}

@media (max-width: 480px) {
  dialog .coordinate-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #editor-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .app-header .top-actions {
    flex-wrap: wrap;
  }
  .app-header .top-actions button {
    min-width: 0;
    flex: 1 1 120px;
  }
  .panel-heading .top-actions {
    display: flex;
    flex-wrap: wrap;
  }
}
#auth-heading {
  margin-bottom: 16px;
}
body.auth-locked {
  background: var(--dia-ui-color-gray-50, #f9fafb);
}
.auth-locked > .app-nav,
.auth-locked > .app-content {
  display: none;
}
.auth-locked #auth-dialog::backdrop {
  background: var(--dia-ui-color-gray-50, #f9fafb);
}
#auth-startup {
  margin: 20dvh auto;
  padding: 24px;
  max-width: 640px;
  text-align: center;
}
#auth-dialog input {
  margin-bottom: 18px;
}
#history-list {
  line-height: 2;
}
.address-search {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.address-search input {
  min-width: 0;
  flex: 1;
  margin-bottom: 0;
}
.address-results {
  list-style: none;
  padding: 0;
  margin: 12px 0 20px;
  display: grid;
  gap: 6px;
}
.address-results[hidden] {
  display: none;
}
.address-results button {
  width: 100%;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
.manual-location {
  margin: 16px 0;
}
#address-status:empty {
  display: none;
}
#zone-preparing {
  margin: 16px 0;
}
#zone-preparing progress {
  width: 100%;
  accent-color: var(--accent);
}
.library-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 230px);
  gap: 20px;
  padding: 0 24px 20px;
}
.library-filters label {
  display: block;
  margin-bottom: 8px;
}
.site-domain {
  display: block;
  margin-top: 6px;
  color: var(--text-secondary, #475467);
  overflow-wrap: anywhere;
}
.publication-link {
  display: block;
  margin-top: 6px;
}
#publication-settings {
  padding-bottom: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border, #d0d5dd);
}

/* Keep the options column dedicated to editing; map context belongs to the preview. */
.sidebar > .tabs {
  flex: 0 0 auto;
  padding: 8px 12px;
}
.sidebar > .settings {
  min-height: 0;
  padding: 16px 20px;
}
.model.map-context {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 0 0 12px;
}
.model-field {
  flex: 0 1 260px;
  min-width: min(220px, 100%);
}
.model-field select {
  width: 100%;
  margin: 0;
}
.model-meta {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  min-width: 180px;
}
.model-meta p {
  margin: 0;
  line-height: 1.4;
}
.save-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.save-state {
  max-width: 150px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.page-header:has(#editor-actions:not([hidden])) {
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .map-comparison > .map-wrap {
    width: 100%;
  }
  .preview-actions {
    width: 100%;
    min-width: 0;
    margin-left: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .preview-actions button {
    min-height: 44px;
  }
  .model.map-context {
    align-items: stretch;
    flex-direction: column;
  }
  .model-field {
    flex-basis: auto;
    min-width: 0;
  }
  .model-meta {
    min-width: 0;
  }
  #editor-actions .save-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .save-actions #save-project {
    flex: 1;
  }
}
#projects-no-results {
  padding: 0 24px;
}
@media (max-width: 480px) {
  .library-filters {
    grid-template-columns: 1fr;
  }
  .address-search {
    flex-direction: column;
  }
}
