:root {
  color-scheme: light;
  --side-panel-width: 560px;
  --bg: #ffffff;
  --bg-deep: #fbf7f8;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --panel-soft: rgba(252, 247, 249, 0.92);
  --line: rgba(127, 53, 80, 0.12);
  --line-strong: rgba(127, 53, 80, 0.18);
  --text: #1f1720;
  --muted: #6f5b66;
  --accent: #c13f68;
  --accent-strong: #8f2148;
  --accent-soft: rgba(193, 63, 104, 0.1);
  --olive: #7f3550;
  --olive-soft: rgba(127, 53, 80, 0.08);
  --sky: #b85b78;
  --sky-soft: rgba(184, 91, 120, 0.1);
  --heading-font: "Segoe UI Variable Display", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --body-font: "Segoe UI Variable Text", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --shadow: 0 24px 56px rgba(99, 33, 56, 0.08);
  --shadow-soft: 0 12px 24px rgba(99, 33, 56, 0.05);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  font-family: var(--body-font);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(236, 169, 192, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(245, 205, 219, 0.14), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #fffdfd 48%, #fbf7f8 100%);
  overflow-x: hidden;
  overflow-y: hidden;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: hidden;
  letter-spacing: -0.01em;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  padding: 10px 12px 12px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 247, 248, 0.88));
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.app-shell::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 30px;
   border: 1px solid rgba(127, 53, 80, 0.08);
  pointer-events: none;
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  padding: 14px 18px;
  margin-bottom: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(236, 169, 192, 0.18), transparent 30%),
    radial-gradient(circle at bottom left, rgba(245, 205, 219, 0.14), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(252, 247, 249, 0.94));
  box-shadow: 0 18px 36px rgba(99, 33, 56, 0.08);
  overflow: hidden;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: linear-gradient(180deg, #d35a7d 0%, #8f2148 100%);
}

.topbar-copy {
  max-width: 840px;
  display: grid;
  gap: 4px;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-self: stretch;
}

.topbar-highlights {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.topbar-highlight {
  position: relative;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(252, 247, 249, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.topbar-highlight strong {
  display: block;
  margin-bottom: 3px;
  font-family: var(--heading-font);
  font-size: 0.84rem;
  line-height: 1.28;
}

.topbar-highlight p:last-child {
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.76rem;
}

.topbar-highlight-label {
  margin: 0 0 4px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.62rem;
  font-weight: 800;
}

.eyebrow,
.card-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.66rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.topbar-subtitle {
  margin-top: 0;
  color: var(--muted);
  line-height: 1.42;
  font-size: 0.86rem;
  max-width: 56rem;
}

h1 {
  font-family: var(--heading-font);
  font-size: clamp(1.55rem, 1.9vw, 2.25rem);
  letter-spacing: -0.04em;
  line-height: 1;
  font-weight: 800;
}

h2 {
  font-family: var(--heading-font);
  font-size: 1.06rem;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--olive);
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    0 8px 18px rgba(99, 33, 56, 0.06);
}

.status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #d35a7d 0%, #8f2148 100%);
  box-shadow: 0 0 0 4px rgba(193, 63, 104, 0.12);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-panel-width);
  gap: 14px;
  margin-bottom: 8px;
}

.toolbar.is-relocated {
  display: none;
}

.selection-summary-stack {
  display: grid;
  gap: 8px;
}

.selection-summary-header {
  display: grid;
  gap: 2px;
}

.search-form,
.selection-summary,
.card,
.search-results {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(252, 247, 249, 0.92));
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.search-form::before,
.selection-summary::before,
.card::before,
.search-results::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, rgba(193, 63, 104, 0.9), rgba(143, 33, 72, 0.78));
  opacity: 0.72;
}

.search-form,
.selection-summary,
.card {
  padding: 14px;
}

.search-form {
  display: grid;
  gap: 10px;
  align-content: start;
  background:
    radial-gradient(circle at top right, rgba(245, 205, 219, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(252, 247, 249, 0.94));
}

.search-label {
  display: block;
  margin-bottom: 0;
  font-weight: 700;
  font-size: 0.84rem;
}

.search-row {
  display: flex;
  gap: 8px;
}

.search-row input,
.model-form input,
.model-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54);
}

.search-row input:focus,
.model-form input:focus,
.model-form select:focus {
  outline: none;
  border-color: rgba(193, 63, 104, 0.4);
  box-shadow:
    0 0 0 4px rgba(193, 63, 104, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.54);
}

.search-row button,
.button-row button,
.link-button {
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    opacity 150ms ease,
    filter 150ms ease;
}

.search-row button:hover,
.button-row button:hover,
.link-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 24px rgba(99, 33, 56, 0.16);
  filter: saturate(1.03);
}

.secondary-button {
  background: var(--accent-soft) !important;
  color: var(--accent-strong) !important;
  border: 1px solid rgba(193, 63, 104, 0.16) !important;
  box-shadow: none !important;
}

.helper-text,
.action-description {
  margin-top: 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.82rem;
}

.selection-summary {
  display: grid;
  gap: 6px;
  font-weight: 600;
  line-height: 1.45;
  word-break: keep-all;
  min-height: 0;
  font-size: 0.92rem;
  background:
    radial-gradient(circle at top right, rgba(245, 205, 219, 0.16), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(252, 247, 249, 0.94));
}

.selection-summary-primary {
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.35;
}

.selection-summary-secondary {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.selection-summary-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.selection-summary-list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(127, 53, 80, 0.08);
}

.selection-summary-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 800;
}

.selection-history {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
}

.is-hidden {
  display: none !important;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  padding: 0;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-empty {
  color: var(--muted);
}

.history-item {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(127, 53, 80, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  padding: 12px;
}

.history-item span {
  color: var(--muted);
  font-size: 0.92rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-panel-width);
  gap: 16px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  align-items: stretch;
}

.workspace > * {
  min-width: 0;
  min-height: 0;
}

.map-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-height: 0;
  height: 100%;
  max-height: none;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-soft);
  background:
    radial-gradient(circle at top right, rgba(236, 169, 192, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(252, 247, 249, 0.94));
}

.map-panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 120px;
  background: linear-gradient(180deg, transparent, rgba(143, 33, 72, 0.06));
  pointer-events: none;
}

#map {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.search-results {
  position: static;
  width: 100%;
  max-height: 320px;
  overflow: auto;
  padding: 12px;
}

.search-selection-card .search-selection-note {
  margin-bottom: 12px;
}

.search-selection-card .search-selection-body {
  min-height: 0;
}

.search-selection-card .search-results {
  max-height: 360px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.parcel-group-card {
  order: 4;
  position: relative;
  z-index: 26;
}

.parcel-group-note {
  margin-bottom: 8px;
}

.parcel-group-list {
  display: grid;
  gap: 8px;
}

.parcel-group-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(252, 247, 249, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.parcel-group-item-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.parcel-group-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.parcel-group-name-input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.88);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54);
}

.parcel-group-name-input:focus {
  outline: none;
  border-color: rgba(193, 63, 104, 0.4);
  box-shadow:
    0 0 0 4px rgba(193, 63, 104, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.54);
}

.parcel-group-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  word-break: keep-all;
}

.parcel-group-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.parcel-group-action-button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.parcel-group-action-button:hover {
  transform: translateY(-1px);
  border-color: rgba(193, 63, 104, 0.24);
  box-shadow: 0 10px 20px rgba(99, 33, 56, 0.08);
}

.parcel-group-action-button:disabled {
  cursor: default;
  opacity: 0.42;
  transform: none;
  box-shadow: none;
}

.parcel-group-action-button.is-danger {
  background: rgba(193, 63, 104, 0.08);
  border-color: rgba(193, 63, 104, 0.18);
  color: var(--accent-strong);
}

.map-legend {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: min(420px, calc(100% - 36px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 28px rgba(99, 33, 56, 0.08);
  backdrop-filter: blur(12px);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.legend-swatch {
  width: 18px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.legend-swatch-clip {
  background: rgba(193, 63, 104, 0.18);
  border: 2px dashed #c13f68;
}

.legend-swatch-parcel {
  background: rgba(143, 33, 72, 0.12);
  border: 2px solid #8f2148;
}

.legend-swatch-parcel-context {
  background: rgba(184, 91, 120, 0.12);
  border: 2px solid #b85b78;
}

.legend-swatch-contour {
  background: rgba(109, 106, 118, 0.2);
  border: 2px solid #6d6a76;
}

.legend-swatch-building {
  background: rgba(135, 167, 207, 0.24);
  border: 2px solid #4e6d93;
}

.legend-swatch-road {
  background: rgba(77, 162, 255, 0.28);
  border: 2px solid #1677ff;
}

.search-results-empty {
  color: var(--muted);
  padding: 10px;
}

.search-form > .search-results-empty {
  display: none;
}

.result-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
  padding: 14px;
  margin-bottom: 10px;
}

.result-item.is-active {
  border-color: rgba(193, 63, 104, 0.42);
  box-shadow: 0 0 0 2px rgba(193, 63, 104, 0.12);
}

.result-item:last-child {
  margin-bottom: 0;
}

.result-title {
  font-weight: 700;
}

.result-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.result-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(127, 53, 80, 0.07);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.result-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.result-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.result-action-button {
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  font-weight: 700;
}

.map-mode-control {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 800;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 26px rgba(99, 33, 56, 0.08);
  backdrop-filter: blur(12px);
  width: fit-content;
  max-width: calc(100% - 36px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.map-mode-control::-webkit-scrollbar {
  display: none;
}

.map-mode-button {
  border: 1px solid var(--line);
  border-radius: 14px;
  flex: 0 0 auto;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.map-mode-button.is-active {
  border-color: rgba(193, 63, 104, 0.4);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
}

.side-panel {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.side-panel-scroll {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 8px;
  padding-bottom: 6px;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: auto;
  scrollbar-color: rgba(127, 53, 80, 0.42) rgba(255, 255, 255, 0.62);
}

.side-panel-scroll > * {
  flex: 0 0 auto;
  min-height: fit-content;
}

.side-panel-scroll::-webkit-scrollbar {
  width: 12px;
}

.side-panel-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.46);
  border-radius: 999px;
}

.side-panel-scroll::-webkit-scrollbar-thumb {
  background: rgba(127, 53, 80, 0.42);
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.62);
}

.side-panel-top-stack {
  display: grid;
  gap: 10px;
  order: -30;
  flex: 0 0 auto;
}

.search-selection-card {
  order: 0;
  position: relative;
  z-index: 30;
}

.model-card {
  order: -10;
  position: static;
  z-index: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.card-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-header > div:first-child h2 {
  margin-right: 6px;
}

.selection-card,
.context-card,
.land-card,
.building-card,
.model-card-featured,
.search-selection-card,
.parcel-group-card {
  border-color: var(--line-strong);
}

.selection-card::before,
.context-card::before,
.search-selection-card::before,
.parcel-group-card::before {
  background: linear-gradient(90deg, rgba(193, 63, 104, 0.9), rgba(143, 33, 72, 0.78));
}

.land-card::before {
  background: linear-gradient(90deg, rgba(193, 63, 104, 0.9), rgba(143, 33, 72, 0.78));
}

.building-card::before {
  background: linear-gradient(90deg, rgba(193, 63, 104, 0.9), rgba(143, 33, 72, 0.78));
}

.model-card-featured::before {
  background: linear-gradient(90deg, rgba(193, 63, 104, 0.9), rgba(143, 33, 72, 0.78));
}

.data-status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(127, 53, 80, 0.07);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  transition:
    background-color 140ms ease,
    color 140ms ease,
    border-color 140ms ease;
}

.data-status-chip[data-state="loading"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.data-status-chip[data-state="slow"] {
  background: rgba(193, 63, 104, 0.14);
  color: var(--accent-strong);
}

.data-status-chip[data-state="delayed"] {
  background: rgba(193, 63, 104, 0.12);
  color: #8f2148;
}

.data-status-chip[data-state="success"] {
  background: rgba(127, 53, 80, 0.07);
  color: var(--accent-strong);
}

.data-status-chip[data-state="disabled"] {
  background: rgba(127, 53, 80, 0.06);
  color: var(--muted);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.meta-grid div {
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(252, 247, 249, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.meta-grid dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.meta-grid dd {
  margin: 0;
  font-weight: 600;
  line-height: 1.35;
  font-size: 0.9rem;
  word-break: break-word;
}

.action-stack {
  display: grid;
  gap: 18px;
}

.action-group {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.action-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.keyword-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.keyword-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 600;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.compact-row {
  margin-top: 0;
}

.card:not(.model-card) .compact-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.card:not(.model-card) .compact-row .secondary-button {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

.land-info-section {
  margin-top: 12px;
}

.info-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.info-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(252, 247, 249, 0.9));
}

.info-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.info-item p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.84rem;
}

.info-item-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid rgba(193, 63, 104, 0.14);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.building-register-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.building-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(252, 247, 249, 0.9));
}

.building-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.building-item-header span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.building-item p {
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.84rem;
}

.building-item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.building-item-grid div {
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.94);
}

.building-item-grid dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.building-item-grid dd {
  margin: 0;
  font-weight: 700;
}

.model-form {
  display: grid;
  gap: 10px;
}

.model-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.model-form label.is-disabled {
  opacity: 0.5;
}

.model-card {
  padding: 14px;
  background:
    radial-gradient(circle at top right, rgba(236, 169, 192, 0.16), transparent 28%),
    radial-gradient(circle at bottom left, rgba(245, 205, 219, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(252, 247, 249, 0.94));
}

.model-card .card-header {
  margin-bottom: 8px;
}

.model-card .model-form {
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
}

.model-card .model-form label {
  gap: 6px;
}

.model-card .form-section,
.model-card .model-progress,
.model-card .button-row {
  grid-column: 1 / -1;
}

.form-section {
  display: grid;
  gap: 8px;
}

.range-action-grid,
.download-action-grid {
  display: grid;
  gap: 8px;
  align-items: end;
}

.range-action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.preview-button-wrap {
  grid-column: 1 / -1;
}

.download-action-grid {
  grid-template-columns: 1fr;
}

.form-section-title {
  margin: 2px 0 0;
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.output-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.output-grid label {
  margin: 0;
  min-height: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(252, 247, 249, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.model-card .toggle-grid {
  gap: 8px;
}

.model-card .checkbox {
  min-height: 44px;
  padding: 10px 12px;
}

.model-card .button-row {
  gap: 8px;
  margin-top: 8px;
}

.button-slot {
  display: grid;
  align-self: stretch;
}

.button-slot button {
  width: 100%;
  height: 100%;
  min-height: 44px;
}

.primary-action-button {
  width: 100%;
  border-radius: 14px;
  padding: 10px 14px;
  min-height: 44px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 16px 24px rgba(99, 33, 56, 0.16);
}

.model-progress {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(252, 247, 249, 0.9));
}

.export-progress {
  margin-top: 0;
}

.model-progress-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(127, 53, 80, 0.12);
  overflow: hidden;
}

.model-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c13f68 0%, #8f2148 100%);
  transition: width 220ms ease;
}

.model-progress-label {
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.8rem;
}

.model-progress[data-state="done"] .model-progress-fill {
  background: linear-gradient(90deg, #9b3656 0%, #c85a7d 100%);
}

.model-progress[data-state="error"] .model-progress-fill {
  background: linear-gradient(90deg, #a14a58 0%, #d47b86 100%);
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.checkbox {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(252, 247, 249, 0.9));
  line-height: 1.4;
}

.checkbox input {
  width: auto;
  margin: 0;
  margin-top: 2px;
  flex: 0 0 auto;
}

.checkbox-label {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.checkbox-copy,
.model-option-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.checkbox-title,
.model-option-title {
  font-weight: 700;
  color: var(--text);
}

.checkbox-description,
.model-option-description {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.checkbox-featured {
  align-items: center;
  padding: 12px 14px;
  background:
    radial-gradient(circle at top right, rgba(236, 169, 192, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(252, 247, 249, 0.9));
  border-color: rgba(193, 63, 104, 0.18);
  box-shadow: 0 16px 26px rgba(99, 33, 56, 0.08);
}

.checkbox-featured input {
  margin-top: 0;
}

.model-select-card select {
  background: rgba(255, 255, 255, 0.86);
}

.spec-preview,
.export-status {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(252, 247, 249, 0.9));
  color: var(--text);
  min-height: 0;
  overflow: hidden;
  line-height: 1.4;
  font-size: 0.84rem;
  border: 1px solid var(--line);
}

@keyframes studio-rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .topbar,
  .search-form,
  .selection-summary,
  .card {
    animation: studio-rise-in 480ms ease both;
  }

  .topbar {
    animation-delay: 20ms;
  }

  .search-form {
    animation-delay: 60ms;
  }

  .selection-summary {
    animation-delay: 100ms;
  }

  .card {
    animation-delay: 140ms;
  }
}

.visually-hidden {
  display: none !important;
}

#download3dmButton {
  display: none !important;
}

.leaflet-popup-content-wrapper {
  border-radius: 16px;
}

@media (max-width: 1024px) {
  html,
  body {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .workspace,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .app-shell {
    height: auto;
    overflow: visible;
  }

  .topbar-highlights {
    grid-template-columns: 1fr;
  }

  .map-panel,
  #map {
    min-height: 560px;
  }

  .map-panel {
    position: relative;
    height: 560px;
    max-height: none;
  }

  .side-panel {
    position: static;
    height: auto;
    overflow: visible;
    max-height: none;
  }

  .side-panel-scroll {
    flex: 0 0 auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
    padding-bottom: 0;
  }

  .model-card {
    position: static;
    order: 0;
  }

  .range-action-grid,
  .download-action-grid,
  .output-grid,
  .card:not(.model-card) .compact-row {
    grid-template-columns: 1fr;
  }

  .map-legend {
    left: 18px;
    right: 18px;
    max-width: none;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: 100vw;
    min-height: 100vh;
    height: auto;
    margin: 0;
    padding: 10px;
    border-radius: 0;
  }

  .topbar,
  .card-header,
  .search-row,
  .meta-grid,
  .output-grid,
  .toggle-grid,
  .parcel-group-item-header,
  .building-item-grid,
  .info-item-header,
  .history-header,
  .result-title-row {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .topbar,
  .card-header {
    align-items: stretch;
  }

  .topbar {
    grid-template-columns: 1fr;
    padding: 12px 14px;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .topbar-highlight {
    padding: 9px 10px;
  }

  .meta-grid {
    display: grid;
  }

  .model-card .model-form {
    grid-template-columns: 1fr;
  }

  .parcel-group-order {
    width: max-content;
  }

  .parcel-group-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
