:root {
  color-scheme: light;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  --ink: #18212f;
  --muted: #647085;
  --line: #d8dee8;
  --panel: #ffffff;
  --bg: #eef2f6;
  --accent: #0f766e;
}

* {
  box-sizing: border-box;
}

.server-required-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef2f5;
}

.server-required-message {
  width: min(560px, 100%);
  padding: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
}

.server-required-message h1 {
  margin: 0 0 10px;
  font-size: 24px;
}

.server-required-message p {
  margin: 0;
  color: #475569;
  line-height: 1.55;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  display: grid;
  grid-template-columns: 360px 1fr;
}

.sidebar {
  height: 100vh;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #f8fafc;
  padding: 18px;
}

.brand {
  display: grid;
  gap: 3px;
  margin-bottom: 18px;
}

.brand span {
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0;
}

.brand strong {
  font-size: 26px;
  line-height: 1.1;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}

.panel-title {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
}

.compact {
  padding: 10px;
}

.mode-toggle {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 9px;
  align-items: start;
  margin: 2px 0 12px;
  color: var(--ink);
}

.mode-toggle input {
  width: auto;
  min-height: auto;
  margin-top: 3px;
}

.mode-toggle strong {
  display: block;
  font-size: 13px;
}

.mode-toggle small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 6px;
}

input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.progress-block {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

progress {
  width: 100%;
  height: 12px;
  accent-color: var(--accent);
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 58px;
  gap: 8px;
  margin-bottom: 10px;
}

.layers {
  display: grid;
  gap: 10px;
}

.group {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.group-title {
  padding: 9px 10px;
  background: #edf6f5;
  font-size: 13px;
  font-weight: 800;
}

.layer-row {
  display: grid;
  grid-template-columns: 22px 12px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.layer-row input {
  min-height: auto;
}

.layer-row.scale-hidden {
  background: #fff7ed;
}

.layer-row.scale-hidden::after {
  content: "zoom in";
  color: #9a3412;
  font-size: 11px;
  font-weight: 800;
  min-width: 42px;
  white-space: nowrap;
}

.count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--accent);
}

.workspace {
  min-width: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.map-shell {
  position: relative;
  min-height: 0;
}

#map {
  height: 100%;
  min-height: 0;
}

.map-loading {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 900;
  width: min(420px, calc(100% - 28px));
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  padding: 10px 12px;
}

.map-loading[hidden] {
  display: none;
}

.map-layer-notice {
  position: absolute;
  top: 86px;
  left: 50%;
  z-index: 899;
  width: min(520px, calc(100% - 28px));
  transform: translateX(-50%);
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: rgba(255, 247, 237, 0.96);
  color: #7c2d12;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
}

.map-layer-notice[hidden] {
  display: none;
}

.map-loading-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

.map-loading-header strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.details {
  height: 210px;
  border-top: 1px solid var(--line);
  background: white;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
}

.details[hidden] {
  display: none;
}

.feature-heading {
  min-width: 0;
}

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

h1 {
  margin: 7px 0 0;
  font-size: 20px;
  line-height: 1.2;
}

.attribute-table {
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 14px;
  font-size: 14px;
}

.attribute-row {
  display: grid;
  grid-template-columns: minmax(170px, 280px) minmax(0, 1fr);
  gap: 18px;
  padding: 8px 0;
  border-bottom: 1px solid #e5eaf1;
}

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

.attribute-label {
  color: #8a8f98;
}

.attribute-value {
  color: #3f4652;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: left;
}

.feature-nav {
  display: inline-grid;
  grid-template-columns: 34px auto 34px;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.feature-nav button {
  min-height: 32px;
  padding: 4px 8px;
}

.empty {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 860px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    max-height: 48vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    height: 52vh;
  }

  .details {
    height: 170px;
    grid-template-columns: 1fr;
  }
}

.connect-header {
  position: sticky;
  top: 0;
  z-index: 1100;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 247, 243, 0.9);
  backdrop-filter: blur(16px);
}

body {
  display: block;
  min-height: 100vh;
}

.connect-header-inner,
.connect-footer-inner {
  width: min(1152px, calc(100% - 40px));
  margin: 0 auto;
}

.connect-header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.connect-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-family: Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
}

.connect-brand > span:last-child > span {
  color: var(--accent);
}

.connect-logo {
  display: block;
  width: 36px;
  height: 36px;
  overflow: hidden;
}

.connect-logo img {
  width: 36px;
  height: 46px;
  object-fit: cover;
  object-position: top;
  filter: brightness(0);
}

.connect-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.connect-nav a,
.connect-feedback {
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.connect-nav a:hover {
  color: var(--ink);
}

.utility-shell {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
}

.utility-shell .sidebar {
  height: calc(100vh - 64px);
}

.utility-shell .workspace {
  height: calc(100vh - 64px);
}

.connect-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0;
  background: #f8f7f3;
}

.connect-footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 32px;
}

.connect-footer-label {
  margin: 0;
  color: var(--accent);
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.connect-footer-copy {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.connect-feedback {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 0 16px;
  border-radius: 4px;
  background: var(--accent);
  color: #fffefa;
}

.connect-feedback:hover {
  background: #9d650c;
  color: #fffefa;
}

@media (max-width: 860px) {
  .connect-header-inner,
  .connect-footer-inner {
    width: min(100% - 32px, 720px);
  }

  .connect-header-inner {
    height: 58px;
  }

  .connect-nav {
    gap: 12px;
  }

  .connect-nav a {
    font-size: 10px;
  }

  .utility-shell {
    min-height: 0;
    display: block;
  }

  .utility-shell .sidebar,
  .utility-shell .workspace {
    height: auto;
  }

  .utility-shell .workspace {
    min-height: 70vh;
  }

  .connect-footer-inner {
    grid-template-columns: 1fr;
  }
}

/* Connect MEP utility-map treatment: quiet surfaces, amber actions, dense scanning. */
:root {
  --ink: #1c1c1a;
  --muted: #6d6b66;
  --line: #d9d6ce;
  --panel: #f8f7f3;
  --bg: #eeece7;
  --accent: #bd7c12;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
}

.sidebar {
  background: #f5f4f0;
  padding: 24px 20px;
}

.brand {
  gap: 5px;
  margin-bottom: 20px;
}

.brand-back {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 13px;
}

.brand span {
  color: var(--accent);
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  letter-spacing: 0;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.panel {
  border-color: var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(30, 28, 22, 0.05);
}

.mode-toggle strong,
.group-title,
button {
  font-family: Consolas, monospace;
}

button {
  border-radius: 4px;
  background: var(--accent);
}

button:hover {
  background: #9d650c;
}

input {
  border-radius: 4px;
  background: #fffefa;
}

.group {
  border-radius: 5px;
  background: #fffefa;
}

.group-title {
  background: #ebe8df;
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.layer-row {
  border-top-color: #e5e1d8;
}

.map-loading,
.map-layer-notice {
  border-radius: 5px;
  box-shadow: 0 10px 28px rgba(30, 28, 22, 0.14);
}

.map-loading {
  background: rgba(255, 254, 250, 0.96);
}

.details {
  background: #f8f7f3;
}

.attribute-table {
  border-radius: 5px;
  background: #fffefa;
}

@media (max-width: 860px) {
  .sidebar {
    padding: 18px;
  }

  .brand strong {
    font-size: 26px;
  }
}
