:root {
  color-scheme: light;
  --bg: #ffffff;
  --sidebar: #07131d;
  --sidebar-dark: #030a11;
  --sidebar-active: #27d9ff;
  --text: #202327;
  --title: #1c3353;
  --muted: #6f7780;
  --line: #cfd2d6;
  --line-soft: #e8eaed;
  --header: #d8d8dc;
  --field: #ffffff;
  --accent: #27d9ff;
  --accent-dark: #096986;
  --accent-alt: #ff8a00;
  --accent-violet: #c45cff;
  --danger: #b94030;
  --ok: #18724b;
  --warn: #9b5b00;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 72% 8%, rgba(39, 217, 255, 0.08) 0 12px, transparent 13px),
    radial-gradient(circle at 84% 32%, rgba(196, 92, 255, 0.05) 0 18px, transparent 19px),
    linear-gradient(90deg, transparent 0 72px, rgba(4, 24, 38, 0.035) 72px 73px, transparent 73px 145px),
    linear-gradient(0deg, transparent 0 72px, rgba(4, 24, 38, 0.03) 72px 73px, transparent 73px 145px),
    var(--bg);
  background-size: auto, auto, 145px 145px, 145px 145px, auto;
  color: var(--text);
}

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

button {
  min-height: 34px;
  border: 1px solid #aeb4ba;
  border-radius: 0;
  background: #f7f7f8;
  color: var(--text);
  padding: 0 12px;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.read-only-notice {
  margin: 0 0 12px;
  border-left: 4px solid var(--accent);
  background: #eef6fb;
  color: #28445e;
  padding: 10px 12px;
  font-weight: 700;
}

body.designer-readonly .style-builder-editor,
body.designer-readonly .brand-preview {
  opacity: 0.86;
}

button.primary {
  border-color: var(--accent-dark);
  background: var(--accent);
  color: #fff;
}

button.is-saving {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

button.is-saving::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: #ffffff;
  animation: profiletool-spin 0.75s linear infinite;
}

button.is-confirming {
  position: relative;
  border-color: var(--ok);
  background: #e8f6ef;
  color: var(--ok);
  animation: profiletool-confirm-pulse 0.42s ease-out;
}

button.is-confirming::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 7px;
  height: 13px;
  border: solid var(--ok);
  border-width: 0 2px 2px 0;
  transform: translateY(-58%) rotate(45deg);
}

@keyframes profiletool-confirm-pulse {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

.save-feedback {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 3000;
  display: inline-flex;
  min-width: 220px;
  align-items: center;
  gap: 10px;
  border: 1px solid #9fb7ca;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
  padding: 12px 14px;
  font-weight: 700;
}

.save-feedback[hidden] {
  display: none;
}

.save-feedback-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: profiletool-spin 0.75s linear infinite;
}

.save-feedback.done {
  border-color: rgba(24, 114, 75, 0.35);
}

.save-feedback.error {
  border-color: rgba(185, 64, 48, 0.35);
}

.save-feedback.done .save-feedback-spinner {
  border-color: var(--ok);
  animation: none;
}

.save-feedback.error .save-feedback-spinner {
  border-color: var(--danger);
  animation: none;
}

.save-feedback.done .save-feedback-spinner::after {
  content: "";
  display: block;
  width: 8px;
  height: 4px;
  margin: 4px 0 0 3px;
  border-left: 2px solid var(--ok);
  border-bottom: 2px solid var(--ok);
  transform: rotate(-45deg);
}

@keyframes profiletool-spin {
  to {
    transform: rotate(360deg);
  }
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #bfc4c9;
  border-radius: 0;
  background: var(--field);
  color: var(--text);
  padding: 8px 9px;
  outline: none;
}

input[type="color"] {
  min-height: 40px;
  padding: 3px;
  cursor: pointer;
  background:
    linear-gradient(135deg, transparent 0 12px, rgba(0, 0, 0, 0.06) 12px 13px, transparent 13px),
    var(--field);
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.24);
}

input[type="color"]::-moz-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.24);
}

.color-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.color-control input[type="color"] {
  min-width: 0;
}

.color-preview {
  display: grid;
  width: 42px;
  height: 40px;
  place-items: center;
  border: 1px solid #aeb4ba;
  background: var(--color-preview, #ffffff);
  color: #fff;
  font-size: 0;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72);
}

.color-preview::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 1px solid rgba(0, 0, 0, 0.32);
  background: var(--color-preview, #ffffff);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(45, 140, 203, 0.22);
}

label {
  display: grid;
  gap: 5px;
  color: #34383d;
  font-size: 0.9rem;
  font-weight: 600;
}

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

.designer-shell {
  display: grid;
  grid-template-columns: 112px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  justify-items: center;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  background:
    radial-gradient(circle at 45% 8%, rgba(39, 217, 255, 0.24), transparent 34%),
    linear-gradient(180deg, #071927 0%, #04101a 45%, #02070d 100%);
  color: #fff;
  border-right: 1px solid rgba(39, 217, 255, 0.18);
  box-shadow: 14px 0 38px rgba(4, 18, 30, 0.18);
}

.brand {
  display: grid;
  place-items: center;
  min-height: 116px;
  padding: 12px 8px 4px;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 92px;
  height: 102px;
  place-items: center;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profiletool-home-link {
  position: relative;
  display: grid;
  width: 52px;
  height: 58px;
  place-items: center;
  margin: 0 auto 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  text-decoration: none;
}

.profiletool-home-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav {
  display: grid;
  width: 100%;
  gap: 2px;
  align-content: start;
  justify-items: center;
  padding-top: 2px;
}

.nav button {
  display: grid;
  width: 94px;
  min-height: 62px;
  justify-items: center;
  align-content: center;
  gap: 3px;
  border: 0;
  border-left: 0;
  background: transparent;
  color: rgba(236, 250, 255, 0.88);
  padding: 5px 4px 6px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 650;
}

.nav button:hover,
.nav button.active {
  color: #ffffff;
  background: rgba(39, 217, 255, 0.08);
}

.nav button.nav-action.active {
  background: transparent;
}

.nav-separator {
  width: 56px;
  height: 2px;
  margin: 7px 0 5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-alt), var(--accent-violet));
  box-shadow: 0 0 12px rgba(39, 217, 255, 0.58);
}

.nav-icon {
  position: relative;
  display: grid;
  width: 42px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: currentColor;
}

.nav button:hover .nav-icon,
.nav button.active .nav-icon,
.profiletool-home-link:hover {
  background: rgba(39, 217, 255, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(39, 217, 255, 0.38),
    0 0 18px rgba(39, 217, 255, 0.22);
}

.nav-icon svg,
.profiletool-home-link svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.portal-box {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 14px 4px 16px;
  align-self: end;
  border-bottom: 28px solid var(--sidebar-active);
  color: #fff;
  font-size: 0.72rem;
  text-align: center;
}

.portal-avatar {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 4px solid #fff;
  border-radius: 50%;
  font-weight: 800;
}

.workspace {
  min-width: 0;
  padding: 34px 38px 28px 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 26px;
  border-bottom: 1px solid rgba(9, 105, 134, 0.16);
  padding-bottom: 18px;
}

.topbar h1 {
  margin: 0 0 12px;
  color: #11243d;
  font-size: 2.15rem;
  font-weight: 650;
  line-height: 1.05;
}

.topbar p {
  margin: 0;
  color: #4e6175;
  font-size: 1.45rem;
  font-weight: 300;
}

.topbar-actions {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.play-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--accent-dark);
  background: var(--accent);
  color: #fff;
  padding: 0 13px 0 10px;
  font-weight: 700;
  white-space: nowrap;
}

.play-action:hover {
  border-color: #155b82;
  background: var(--accent-dark);
  color: #fff;
}

.play-action svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.secondary-play {
  border-color: #aeb4ba;
  background: #ffffff;
  color: var(--accent-dark);
}

.secondary-play:hover {
  border-color: var(--accent-dark);
  background: rgba(45, 140, 203, 0.08);
  color: var(--accent-dark);
}

.language-control {
  min-width: 132px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.language-control select {
  min-height: 34px;
  padding: 6px 8px;
}

.actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-select-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px 38px 38px 38px;
  gap: 8px;
  align-items: center;
}

.icon-action {
  width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1;
}

.icon-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.actions {
  justify-content: flex-end;
  padding-top: 8px;
}

.content {
  display: grid;
  grid-template-columns: minmax(380px, 560px) minmax(360px, 1fr);
  gap: 18px;
}

.content.hidden {
  display: none;
}

#configurations > .panel {
  grid-column: 1 / -1;
}

.data-layout {
  grid-template-columns: minmax(390px, 500px) minmax(480px, 1fr);
}

.data-layout .mapping-panel {
  grid-column: 1 / -1;
}

.data-model-panel {
  grid-column: 1 / -1;
  max-width: 760px;
}

.core-profile-section {
  grid-template-columns: 1fr;
}

.core-profile-prerequisite {
  max-width: 760px;
  border-left: 4px solid var(--warn);
}

.core-profile-prerequisite p {
  margin-bottom: 0;
  color: var(--muted);
}

.core-profile-workspace {
  display: grid;
  grid-template-columns: minmax(560px, 1.3fr) minmax(360px, 0.7fr);
  gap: 18px;
  min-width: 0;
}

.core-profile-workspace[hidden] {
  display: none;
}

.core-profile-style-toolbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(300px, 1fr);
  gap: 14px 18px;
  align-items: end;
}

.core-profile-style-library {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.core-profile-style-library label,
.core-profile-style-name,
.core-profile-row-form label {
  display: grid;
  gap: 6px;
}

.core-profile-style-library button {
  min-height: 42px;
}

.core-profile-style-association,
.core-profile-style-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.core-profile-style-actions {
  justify-content: flex-end;
}

#coreProfileStyleStatus {
  flex: 1 1 100%;
  min-height: 18px;
  text-align: right;
}

.core-profile-panel-heading,
.core-profile-selected-heading,
.core-profile-legend,
.core-profile-tabs,
.core-profile-parameter-row {
  display: flex;
  align-items: center;
}

.core-profile-panel-heading {
  justify-content: space-between;
  gap: 18px;
}

.core-profile-panel-heading h3,
.core-profile-selected-heading h3 {
  margin: 3px 0 0;
}

.core-profile-eyebrow {
  color: var(--accent-dark);
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.core-profile-count {
  flex: 0 0 auto;
  border: 1px solid rgba(39, 217, 255, 0.65);
  background: rgba(39, 217, 255, 0.1);
  color: var(--accent-dark);
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.core-profile-schematic {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  border: 1px solid #b9c7cc;
  background:
    linear-gradient(rgba(13, 91, 112, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 91, 112, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #f9fcfd 0%, #eef5f7 100%);
  background-size: 28px 28px, 28px 28px, auto;
}

.core-profile-schematic svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.core-profile-ground-fill { fill: url(#coreProfileGround); opacity: 0.72; }
.core-profile-ground-line { fill: none; stroke: #496b72; stroke-width: 5; }
.core-profile-manhole-shape { fill: rgba(255, 255, 255, 0.86); stroke: #233f48; stroke-width: 7; }
.core-profile-manhole-shape-secondary { opacity: 0.75; }
.core-profile-pipe-shadow { fill: none; stroke: #18343e; stroke-width: 28; stroke-linecap: round; }
.core-profile-pipe { fill: none; stroke: url(#coreProfilePipe); stroke-width: 17; stroke-linecap: round; }
.core-profile-flow { fill: none; stroke: #fff; stroke-width: 4; stroke-dasharray: 10 8; }
.core-profile-flow-head { fill: #fff; }
.core-profile-chainage { fill: none; stroke: #80979d; stroke-width: 2; stroke-dasharray: 7 6; }
.core-profile-chainage-tick { fill: none; stroke: #80979d; stroke-width: 3; }

.core-profile-hotspots {
  position: absolute;
  inset: 0;
}

.core-profile-hotspot {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 34px;
  height: 34px;
  translate: -50% -50%;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 9px rgba(7, 19, 29, 0.3);
  color: #fff;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 900;
}

.core-profile-hotspot:hover,
.core-profile-hotspot:focus-visible {
  z-index: 3;
  scale: 1.12;
}

.core-profile-hotspot.is-selected {
  outline: 3px solid var(--title);
  outline-offset: 3px;
}

.core-profile-hotspot.is-available,
.core-profile-legend i.is-available { background: #17875f; }
.core-profile-hotspot.is-partial,
.core-profile-legend i.is-partial { background: #c58a34; }
.core-profile-hotspot.is-unavailable,
.core-profile-legend i.is-unavailable { background: #7d8b90; }
.core-profile-hotspot.is-required-missing,
.core-profile-legend i.is-required-missing { background: #b93434; }

.core-profile-legend {
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.core-profile-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.core-profile-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.core-profile-rows-summary {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.core-profile-rows-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.core-profile-rows-heading h4 {
  margin: 3px 0 0;
  color: var(--title);
  font-size: 1rem;
}

.core-profile-rows-list {
  display: grid;
  border: 1px solid var(--line);
  border-bottom: 0;
}

.core-profile-rows-empty {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  padding: 16px;
  text-align: center;
}

.core-profile-row-item {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 8px;
}

.core-profile-row-item.is-selected {
  background: rgba(39, 217, 255, 0.08);
  box-shadow: inset 3px 0 0 var(--accent-dark);
}

.core-profile-row-item.is-disabled .core-profile-row-select {
  opacity: 0.5;
}

.core-profile-row-drag {
  color: var(--muted);
  cursor: grab;
  font-size: 1.15rem;
  line-height: 1;
}

.core-profile-row-toggle {
  width: 18px;
  height: 18px;
}

.core-profile-row-select {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--title);
  padding: 4px 2px;
  text-align: left;
}

.core-profile-row-select strong,
.core-profile-row-select small {
  display: block;
}

.core-profile-row-select small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
}

.core-profile-row-item-actions {
  display: flex;
  gap: 4px;
}

.core-profile-row-item-actions button {
  min-width: 30px;
  min-height: 30px;
  padding: 3px 7px;
}

.core-profile-inspector {
  align-self: start;
  min-width: 0;
}

.core-profile-selected-heading {
  align-items: flex-start;
  gap: 13px;
  margin: 10px 0 18px;
}

.core-profile-selected-heading p {
  margin: 7px 0 0;
  line-height: 1.45;
}

.core-profile-selected-number {
  display: grid;
  flex: 0 0 46px;
  height: 46px;
  place-items: center;
  background: var(--title);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 900;
}

.core-profile-tabs {
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.core-profile-tabs button {
  min-height: 40px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.core-profile-tabs button.active {
  border-bottom-color: var(--accent-dark);
  color: var(--title);
}

.core-profile-tab-panel {
  padding-top: 16px;
}

.core-profile-row-editor-empty {
  display: grid;
  gap: 12px;
  justify-items: start;
  border: 1px dashed #aab9be;
  background: #f7f9fa;
  padding: 18px;
}

.core-profile-row-editor-empty[hidden],
.core-profile-row-form[hidden] {
  display: none;
}

.core-profile-row-editor-empty p {
  margin: 0;
  color: var(--muted);
}

.core-profile-row-form {
  display: grid;
  gap: 13px;
}

.core-profile-row-form > label:not(.check),
.core-profile-row-grid label {
  color: var(--title);
  font-size: 0.8rem;
  font-weight: 700;
}

.core-profile-row-visible {
  border: 1px solid var(--line);
  background: #f7f9fa;
  padding: 10px;
}

.core-profile-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#coreProfileRowCoreStatus {
  justify-self: start;
}

.core-profile-row-actions {
  margin-top: 3px;
}

.core-profile-tab-panel h4 {
  margin: 0 0 9px;
  color: var(--title);
  font-size: 0.86rem;
}

.core-profile-tab-panel h4:not(:first-child) {
  margin-top: 20px;
}

.core-profile-parameter-list {
  display: grid;
  border: 1px solid var(--line);
  border-bottom: 0;
}

.core-profile-parameter-list.is-technical {
  background: #f7f7f8;
}

.core-profile-parameter-row {
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px;
}

.core-profile-parameter-row code {
  color: var(--accent-dark);
  overflow-wrap: anywhere;
  font-size: 0.77rem;
  font-weight: 700;
}

.core-profile-parameter-status {
  flex: 0 0 auto;
  border: 1px solid currentColor;
  padding: 3px 7px;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.core-profile-parameter-status.is-mapped { color: #17875f; background: #e7f6ef; }
.core-profile-parameter-status.is-calculated,
.core-profile-parameter-status.is-derived { color: #9a691d; background: #fff5e6; }
.core-profile-parameter-status.is-unavailable { color: #68777c; background: #eff2f3; }

.core-profile-graphics-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #f7fbfc, #eef5f7);
  padding: 13px;
}

.core-profile-graphics-preview-shape {
  display: block;
  flex: 0 0 84px;
  width: 84px;
  height: 34px;
  border: var(--core-preview-stroke, 3px) solid var(--core-preview-color, #14718a);
  border-radius: var(--core-preview-radius, 17px);
  background: var(--core-preview-fill, #38b8d4);
  opacity: var(--core-preview-opacity, 1);
}

.core-profile-graphics-preview.is-hidden .core-profile-graphics-preview-shape {
  opacity: 0.16;
  filter: grayscale(1);
}

.core-profile-graphics-preview strong,
.core-profile-graphics-preview small {
  display: block;
}

.core-profile-graphics-preview small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.core-profile-graphics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.core-profile-graphics-card {
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
}

.core-profile-graphics-card-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fa;
  padding: 10px 12px;
}

.core-profile-graphics-card-heading h4 {
  margin: 0;
}

.core-profile-graphics-dimension {
  border: 1px solid #14718a;
  background: #e8f7fa;
  color: #0d5b70;
  padding: 3px 7px;
  font-size: 0.7rem;
  font-weight: 900;
}

.core-profile-graphics-dimension.is-3d {
  border-color: #7a4fa3;
  background: #f2eafa;
  color: #643f88;
}

.core-profile-graphics-fields {
  display: grid;
  gap: 11px;
  padding: 12px;
}

.core-profile-graphics-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--title);
  font-size: 0.78rem;
  font-weight: 700;
}

.core-profile-graphics-field.is-check {
  grid-template-columns: auto 1fr;
  align-items: center;
  border: 1px solid var(--line);
  background: #f7f9fa;
  padding: 9px;
}

.core-profile-graphics-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.core-profile-graphics-binding-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.core-profile-graphics-warning {
  color: #8a641f;
  font-size: 0.68rem;
  font-weight: 700;
}

.core-profile-graphics-empty {
  border: 1px dashed #aab9be;
  background: #f7f9fa;
  color: var(--muted);
  padding: 18px;
}

.core-profile-placeholder,
.core-profile-placeholder-grid section {
  border: 1px dashed #aab9be;
  background: #f7f9fa;
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

.core-profile-placeholder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.core-profile-placeholder-grid p {
  margin: 8px 0 0;
}

@media (max-width: 1180px) {
  .core-profile-workspace {
    grid-template-columns: 1fr;
  }

  .core-profile-style-toolbar {
    grid-template-columns: 1fr;
  }

  .core-profile-style-actions {
    justify-content: flex-start;
  }

  #coreProfileStyleStatus {
    text-align: left;
  }
}

@media (max-width: 700px) {
  .core-profile-schematic {
    min-height: 360px;
  }

  .core-profile-placeholder-grid {
    grid-template-columns: 1fr;
  }

  .core-profile-graphics-grid {
    grid-template-columns: 1fr;
  }

  .core-profile-style-library,
  .core-profile-row-grid {
    grid-template-columns: 1fr;
  }

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

  .core-profile-row-item-actions {
    grid-column: 3;
    justify-content: flex-end;
  }
}

.data-model-details {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  background: #f7f7f8;
  padding: 14px;
}

.data-model-details dl,
.data-model-details p {
  margin: 0;
}

.data-model-details dl {
  display: grid;
  gap: 10px;
}

.data-model-details dl > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
}

.data-model-details dt {
  color: var(--muted);
  font-weight: 700;
}

.data-model-details dd {
  margin: 0;
}

.data-model-completeness {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.data-model-completeness-status,
.data-model-mapping-status,
.data-model-requirement {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  padding: 2px 8px;
  font-size: 0.76rem;
  font-weight: 800;
}

.data-model-completeness-status.is-complete,
.data-model-mapping-status.is-mapped {
  border-color: var(--ok);
  background: #e8f6ef;
  color: var(--ok);
}

.data-model-completeness-status.is-incomplete,
.data-model-mapping-status.is-unmapped {
  border-color: #c58a34;
  background: #fff5e6;
  color: var(--warn);
}

.data-model-mapping-group {
  display: grid;
  gap: 8px;
}

.data-model-mapping-group h4 {
  margin: 8px 0 0;
  color: var(--title);
  font-size: 1rem;
}

.data-model-mapping-rows {
  display: grid;
  border: 1px solid var(--line);
  border-bottom: 0;
}

.data-model-mapping-row {
  display: grid;
  grid-template-columns: minmax(230px, 0.9fr) minmax(230px, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 10px;
}

.data-model-mapping-row:nth-child(even) {
  background: #f7f7f8;
}

.data-model-field-identity,
.data-model-mapping-controls,
.data-model-mapping-control {
  display: grid;
  gap: 5px;
}

.data-model-mapping-controls {
  gap: 9px;
}

.data-model-field-identity code {
  color: var(--accent-dark);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.data-model-field-note {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.data-model-requirement {
  color: var(--muted);
}

.data-model-mapping-row.is-required .data-model-requirement {
  border-color: var(--accent-dark);
  background: rgba(39, 217, 255, 0.1);
  color: var(--accent-dark);
}

.data-model-mapping-control > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.data-model-mapping-control input,
.data-model-mapping-control select {
  width: 100%;
}

@media (max-width: 900px) {
  .data-model-mapping-row {
    grid-template-columns: 1fr;
  }
}

.mode-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: #f7f7f8;
  padding: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.mode-pill {
  display: inline-grid;
  min-width: 116px;
  min-height: 28px;
  place-items: center;
  border: 1px solid var(--accent-dark);
  background: rgba(45, 140, 203, 0.1);
  color: var(--accent-dark);
  font-weight: 800;
}

.panel {
  display: grid;
  gap: 13px;
  align-content: start;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
}

.panel h3 {
  margin: -14px -14px 2px;
  border-bottom: 1px solid #bfc2c6;
  background: var(--header);
  color: #15191d;
  padding: 12px 13px;
  font-size: 0.96rem;
  font-weight: 700;
}

.portal-login-dialog {
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 0;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.portal-login-dialog::backdrop {
  background: rgba(244, 246, 247, 0.88);
  backdrop-filter: blur(3px);
}

.portal-login-dialog form {
  display: grid;
  gap: 13px;
  padding: 16px;
}

.portal-login-dialog h2 {
  margin: -16px -16px 2px;
  border-bottom: 1px solid #bfc2c6;
  background: var(--header);
  color: #15191d;
  padding: 13px 16px;
  font-size: 1rem;
}

.portal-login-dialog footer {
  justify-content: flex-end;
}

.ai-style-action {
  color: #0b6374;
  border-color: #76dff1;
  background: #e8fbff;
}

.ai-style-dialog {
  width: min(980px, calc(100vw - 32px));
}

.ai-style-dialog form {
  max-height: min(760px, calc(100vh - 40px));
}

.ai-style-map {
  display: grid;
  gap: 6px;
  overflow: auto;
  max-height: 390px;
  padding-right: 2px;
}

.ai-style-section-title {
  margin: 16px 0 4px;
}

.ai-style-section-title + .muted {
  margin: 0 0 8px;
}

.ai-style-graphics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ai-style-graphic {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #d4d9de;
  border-left: 6px solid var(--graphic-color, #667780);
  background: #f8fafb;
  padding: 8px;
}

.ai-style-graphic.is-unused {
  color: rgb(70 70 70 / 50%);
}

.ai-style-graphic input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #0b6374;
}

.ai-style-graphic strong,
.ai-style-graphic small {
  display: block;
}

.ai-style-graphic code {
  font-size: 0.78rem;
}

@media (max-width: 760px) {
  .ai-style-graphics {
    grid-template-columns: 1fr;
  }
}

.ai-style-grid {
  display: grid;
  grid-template-columns: 42px minmax(210px, 1.35fr) minmax(82px, 0.42fr) minmax(110px, 0.5fr) minmax(210px, 1fr) minmax(86px, 0.38fr);
  gap: 8px;
  align-items: center;
  border: 1px solid #d4d9de;
  background: #f8fafb;
  padding: 8px;
}

.ai-style-grid[data-ai-row^="Pipe"],
.ai-style-grid[data-ai-row^="Crown"] {
  border-color: #9fbfd1;
  background: #c7dce8;
}

.ai-style-grid[data-ai-row^="Manhole"],
.ai-style-grid[data-ai-row^="Chamber"] {
  border-color: #e7aa98;
  background: #ffd4c7;
}

.ai-style-grid[data-ai-row^="Cover"],
.ai-style-grid[data-ai-row="RimLevel"] {
  border-color: #cbb4df;
  background: #eadcf8;
}

.ai-style-grid[data-ai-row="GroundLevel"],
.ai-style-grid[data-ai-row="Depth"] {
  border-color: #9bcfbe;
  background: #d5f1e8;
}

.ai-style-enabled {
  display: grid;
  place-items: center;
  margin: 0;
}

.ai-style-enabled input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #0b6374;
}

.ai-style-grid.is-unused strong,
.ai-style-grid.is-unused small,
.ai-style-grid.is-unused code,
.ai-style-grid.is-unused select,
.ai-style-grid.is-unused button {
  color: rgb(70 70 70 / 50%);
}

.ai-style-match-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 6px;
  min-width: 0;
}

.ai-formula-button {
  min-width: 36px;
  padding: 0 8px;
  font-weight: 900;
  letter-spacing: 1px;
}

.ai-style-grid-head {
  position: sticky;
  top: 0;
  z-index: 1;
  border-color: #bfc2c6;
  background: var(--header);
  color: #15191d;
  font-weight: 800;
}

.ai-style-grid strong {
  color: var(--text);
}

.ai-style-attribute {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ai-style-attribute code {
  color: #0b6374;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.ai-style-grid .ai-style-attribute small {
  font-weight: 500;
  line-height: 1.25;
}

.ai-style-grid small {
  color: var(--muted);
  font-weight: 700;
}

.ai-formula-dialog {
  width: min(820px, calc(100vw - 32px));
}

.ai-formula-dialog form {
  max-height: min(760px, calc(100vh - 40px));
}

.ai-formula-target {
  margin: 0 0 12px;
  color: #0b6374;
  font-weight: 800;
}

.ai-formula-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(320px, 1.2fr);
  gap: 16px;
  align-items: start;
}

.ai-formula-layout h3 {
  margin: 0 0 8px;
}

.ai-formula-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow: auto;
  max-height: 280px;
  padding: 8px;
  border: 1px solid #d4d9de;
  background: #f8fafb;
}

.ai-formula-fields button {
  padding: 6px 9px;
  border-color: #9fc9d1;
  background: #e8f7f9;
  color: #0b6374;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.8rem;
}

.ai-formula-expression,
#aiFormulaExpression {
  width: 100%;
  min-height: 150px;
  font-family: Consolas, "Courier New", monospace;
}

.ai-formula-operators {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ai-formula-operators button {
  min-width: 38px;
  font-weight: 900;
}

@media (max-width: 760px) {
  .ai-formula-layout {
    grid-template-columns: 1fr;
  }
}

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

.inspection-separate-source {
  display: grid;
  gap: 12px;
}

.inspection-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.inspection-required {
  color: #b3261e;
  font-weight: 800;
}

.inspection-mapping-panel select,
.inspection-mapping-panel input {
  width: 100%;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check input {
  width: auto;
}

.status-list {
  display: grid;
  gap: 8px;
}

.status-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  padding: 9px;
  background: #fff;
}

.status-row > span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  font-size: 0.74rem;
  font-weight: 800;
}

.status-row.ok > span {
  background: rgba(24, 114, 75, 0.12);
  color: var(--ok);
}

.status-row.warn > span {
  background: rgba(155, 91, 0, 0.12);
  color: var(--warn);
}

.status-row strong,
.status-row small {
  display: block;
}

.status-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.profile-preview canvas {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.brand-preview {
  display: flex;
  align-items: center;
  min-height: 170px;
  gap: 14px;
}

.brand-preview-logo {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 800;
  clip-path: polygon(50% 0, 93% 24%, 93% 76%, 50% 100%, 7% 76%, 7% 24%);
}

.brand-preview-logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.brand-preview h3 {
  margin: 0;
}

.brand-preview p {
  margin: 4px 0 0;
  color: var(--muted);
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 400;
}

.mapping-table {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-bottom: 0;
}

.mapping-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(240px, 1fr);
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 9px;
  background: #fff;
}

.mapping-row:nth-child(odd) {
  background: #f7f7f8;
}

.mapping-label {
  display: grid;
  gap: 3px;
}

.mapping-title {
  color: var(--text);
  font-weight: 700;
}

.mapping-meta {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.mapping-required {
  color: var(--danger);
  font-weight: 800;
}

.style-association-list {
  display: grid;
  gap: 8px;
  min-height: 48px;
  margin: 4px 0 12px;
}

.style-association-list .muted {
  margin: 0;
}

.style-association-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  border: 1px solid #cfd3d8;
  background: #f7f8f9;
  padding: 9px 10px;
}

.style-association-item strong {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
}

.style-association-item small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.style-association-order {
  display: flex;
  gap: 4px;
}

.style-association-order button {
  width: 28px;
  min-height: 28px;
  border: 1px solid #b8c0c8;
  background: #ffffff;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.style-association-order button:disabled {
  color: #a7afb7;
  background: #eef1f3;
  cursor: default;
}

.core-style-binding-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.core-style-binding-help {
  max-width: 920px;
}

.core-style-data-control {
  padding: 10px;
  border: 1px solid #a9d4c0;
  border-radius: 9px;
  background: #f1faf6;
}

.core-style-data-control select {
  width: 100%;
}

.core-style-bindings-summary {
  margin-top: 12px;
}

.core-style-bindings-summary dl {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
}

.core-style-bindings-summary dl div {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(220px, 1.3fr);
  gap: 10px;
  align-items: baseline;
}

.core-style-bindings-summary dt,
.core-style-bindings-summary dd {
  margin: 0;
}

.core-parameter-status {
  display: block;
  margin-top: 5px;
  color: #19734a;
  font-weight: 700;
}

.core-parameter-status.is-unavailable {
  color: #a33b32;
}

.core-style-binding-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.core-style-summary-filter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 52px;
  padding: 10px 12px;
  color: #41505c;
  text-align: left;
  background: #f4f7f8;
  border: 1px solid #d7e0e4;
  border-radius: 10px;
  opacity: .62;
}

.core-style-summary-filter.is-active {
  color: #18323d;
  background: #fff;
  box-shadow: 0 2px 8px rgba(24, 50, 61, .08);
  opacity: 1;
}

.core-style-summary-filter.is-converted.is-active { border-color: #8bc5a9; }
.core-style-summary-filter.is-ambiguous.is-active { border-color: #e2b95f; }
.core-style-summary-filter.is-unresolved.is-active { border-color: #d2a29d; }

.core-style-summary-filter strong {
  font-size: 1.15rem;
}

.core-style-binding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#saveCoreStyleBtn {
  margin-left: auto;
}

#coreStyleSaveStatus {
  flex-basis: 100%;
  min-height: 1.2em;
  color: #19734a;
  text-align: right;
}

.core-style-binding-group {
  overflow: hidden;
  border: 1px solid #d9e0e5;
  border-radius: 10px;
  background: #fff;
}

.core-style-binding-group > summary {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  font-weight: 700;
  cursor: pointer;
  background: #f5f8f9;
}

.core-style-binding-group.is-ambiguous > summary { color: #805500; background: #fff8e7; }
.core-style-binding-group.is-unresolved > summary { color: #803830; background: #fff5f3; }
.core-style-binding-group.is-converted > summary { color: #14603d; background: #f0faf5; }

.core-style-details-hide,
.core-style-binding-group[open] .core-style-details-show {
  display: none;
}

.core-style-binding-group[open] .core-style-details-hide {
  display: inline;
}

.core-style-details-show,
.core-style-details-hide {
  color: #315f72;
  font-size: .84rem;
  font-weight: 600;
}

.core-style-group-help {
  margin: 13px 15px 0;
}

.core-style-binding-cards {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.core-style-binding-card {
  padding: 12px;
  border: 1px solid #e0e6e9;
  border-radius: 9px;
  background: #fff;
}

.core-style-binding-card.is-compact {
  padding: 9px 12px;
  background: #fbfdfc;
}

.core-style-binding-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(230px, 1.5fr) minmax(145px, auto);
  gap: 14px;
  align-items: start;
}

.core-style-binding-cell {
  display: grid;
  min-width: 0;
  gap: 5px;
  margin: 0;
}

.core-style-binding-cell code,
.core-style-technical-details code {
  overflow-wrap: anywhere;
  white-space: normal;
}

.core-style-binding-label {
  color: #687984;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.core-style-binding-parameter select {
  width: 100%;
  min-width: 0;
}

.core-style-role-warning {
  width: max-content;
  max-width: 100%;
  padding: 2px 7px;
  color: #805500;
  font-size: .75rem;
  background: #fff4d6;
  border-radius: 999px;
}

.core-style-technical-details {
  margin-top: 9px;
  color: #687984;
  font-size: .78rem;
}

.core-style-technical-details summary {
  width: max-content;
  cursor: pointer;
}

.core-style-technical-details code {
  display: block;
  margin-top: 5px;
}

.core-style-binding-status {
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  font-weight: 700;
  line-height: 1.25;
  border-radius: 999px;
}

.core-style-binding-status.is-converted { color: #19734a; background: #eaf7f0; }
.core-style-binding-status.is-ambiguous,
.core-style-binding-status.is-unresolved { color: #8a5b00; background: #fff4d6; }
.core-style-binding-status.is-legacy { color: #53636d; background: #edf1f3; }
.core-style-binding-status.is-none { color: #53636d; background: #f3f5f6; }

@media (max-width: 1050px) {
  .core-style-binding-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .core-style-binding-summary,
  .core-style-binding-grid { grid-template-columns: 1fr; }
  #saveCoreStyleBtn { margin-left: 0; }
  #coreStyleSaveStatus { text-align: left; }
  .core-style-binding-group > summary { align-items: flex-start; }
}

.style-builder-panel {
  grid-column: 1 / -1;
}

.style-builder-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.style-builder-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.style-builder-toggle-icon {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 160ms ease;
}

.style-builder-collapsible:not(.is-collapsed) .style-builder-toggle-icon {
  transform: rotate(90deg);
}

.style-builder-collapsible.is-collapsed > :not(h3) {
  display: none;
}

.style-builder-empty {
  color: var(--muted);
  border: 1px dashed #c3c8ce;
  background: #f8f9fa;
  padding: 10px;
}

.style-builder-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #cfd3d8;
  background: #f7f8f9;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.style-builder-item.is-selected {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
  background: #eef6f5;
}

.style-builder-item strong {
  display: block;
  color: var(--text);
}

.style-builder-item small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.style-builder-pill {
  border: 1px solid #b8c1ca;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 7px;
}

.style-builder-editor {
  border-top: 1px solid #d7dade;
  padding-top: 14px;
}

.token-builder {
  display: grid;
  gap: 7px;
}

.token-builder-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.token-builder-actions button {
  min-height: 34px;
  padding: 7px 10px;
}

.token-builder textarea {
  min-height: 74px;
  resize: vertical;
}

.field-hint {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.35;
}

.unit-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 6px;
}

.unit-input select {
  padding-left: 8px;
  padding-right: 8px;
}

.style-field-hidden {
  display: none !important;
}

.data-preview {
  display: grid;
  gap: 8px;
}

.data-preview-summary {
  color: var(--muted);
  font-size: 0.82rem;
}

.data-preview-summary span {
  display: block;
  margin-top: 3px;
}

.data-preview-table-wrap {
  overflow: auto;
  border: 1px solid #c8cdd2;
  background: #ffffff;
  max-height: 260px;
}

.data-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.data-preview-table th,
.data-preview-table td {
  border-bottom: 1px solid #e1e4e7;
  border-right: 1px solid #e1e4e7;
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
}

.data-preview-table th {
  background: #f4f6f7;
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 1;
}

pre {
  min-height: 180px;
  margin: 0;
  overflow: auto;
  border: 1px solid #bfc4c9;
  background: #f7f7f8;
  color: #202327;
  padding: 10px;
  font-size: 0.82rem;
}

.preview pre {
  min-height: 560px;
}

@media (max-width: 980px) {
  .designer-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    grid-template-rows: auto auto auto;
    gap: 0;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .brand {
    min-height: 70px;
    padding: 8px 8px 2px;
  }

  .brand-mark {
    width: 74px;
    height: 82px;
  }

  .profiletool-home-link {
    height: 48px;
    margin: 4px auto 8px;
  }

  .nav {
    grid-template-columns: repeat(7, 1fr);
  }

  .nav button {
    min-height: 62px;
  }

  .portal-box {
    display: none;
  }

  .content {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .workspace {
    padding: 20px 14px;
  }

  .topbar h1 {
    font-size: 2rem;
  }

  .topbar p {
    font-size: 1.35rem;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .inspection-field-grid {
    grid-template-columns: 1fr;
  }

  .mapping-row {
    grid-template-columns: 1fr;
  }
}
