:root {
  color-scheme: light;
  --bg: #f4f6f4;
  --surface: #ffffff;
  --sidebar: #ffffff;
  --sidebar-ink: #242424;
  --sidebar-muted: #5f6368;
  --ink: #1d1f23;
  --muted: #667078;
  --line: #d9ded8;
  --accent: #e30613;
  --accent-strong: #bf0410;
  --blue: #009fe3;
  --warn: #9a3412;
  --project-list-width: clamp(240px, 18vw, 300px);
  --project-side-width: clamp(320px, 24vw, 420px);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f4f6f4 0%, #ffffff 55%, #eef5f8 100%);
}

.login-shell {
  width: min(100%, 440px);
}

.login-panel {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 55px rgba(32, 38, 45, .14);
}

.login-logo {
  width: min(320px, 100%);
  max-height: 72px;
  object-fit: contain;
  object-position: left center;
}

.login-heading {
  margin: 24px 0 18px;
}

.login-heading p {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-heading h1 {
  margin: 0;
  font-size: 30px;
}

.login-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fff1f2;
  color: #991b1b;
  font-weight: 700;
}

.login-success,
.login-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 700;
}

.login-success {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.login-note {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  overflow-wrap: anywhere;
}

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

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

.login-form span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-form input {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cbd5d1;
  border-radius: 6px;
  font: inherit;
}

.login-form button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.login-form button:hover {
  background: var(--accent-strong);
}

.login-alt-link {
  margin: 16px 0 0;
  text-align: center;
  font-weight: 800;
}

.login-alt-link a {
  color: var(--accent);
  text-decoration: none;
}

.app-shell {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  grid-template-rows: 78px minmax(0, 1fr);
  overflow-x: hidden;
}

.app-header {
  grid-column: 1 / -1;
  min-width: 0;
  min-height: 78px;
  padding: 0 18px 0 0;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.header-brand {
  position: relative;
  width: 92px;
  height: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  text-decoration: none;
}

.header-brand::after {
  content: "";
  position: absolute;
  top: 15px;
  right: 0;
  bottom: 15px;
  width: 1px;
  background: #cfd4d8;
}

.header-brand-crop {
  width: 70px;
  height: 34px;
  display: block;
  overflow: hidden;
}

.header-brand-crop img {
  display: block;
  width: 180px;
  max-width: none;
  height: auto;
}

.header-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.header-title p {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.header-title h1 {
  margin: 0;
  color: #112243;
  font-size: 24px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-title span {
  min-width: 0;
  color: #526071;
  font-size: 13px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.app-settings {
  position: relative;
  z-index: 30;
}

.app-settings > summary {
  list-style: none;
  cursor: pointer;
}

.app-settings > summary::-webkit-details-marker {
  display: none;
}

.settings-button {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #ffffff;
  color: #2b211f;
}

.app-settings[open] > .settings-button,
.settings-button:hover {
  border-color: var(--line);
  background: #f7f8f8;
}

.settings-button svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-icon-button {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #ffffff;
  color: #2b211f;
  text-decoration: none;
}

.header-icon-button:hover {
  border-color: var(--line);
  background: #f7f8f8;
}

.header-icon-button svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(380px, calc(100vw - 28px));
  max-height: min(560px, calc(100vh - 110px));
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(28, 31, 35, 0.18);
}

.settings-menu-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.settings-menu-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-menu-heading strong {
  font-size: 20px;
}

.settings-menu p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.settings-category-create {
  margin: 0 0 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.settings-category-create input {
  min-height: 38px;
}

.settings-category-create button {
  min-height: 38px;
  padding: 0 14px;
}

.settings-category-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.settings-category-row {
  min-height: 56px;
  padding: 10px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.settings-category-row > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.settings-category-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.settings-category-row small,
.settings-category-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.settings-category-row form {
  margin: 0;
}

.settings-category-row button {
  min-width: 82px;
  min-height: 34px;
  padding: 0 12px;
  border-color: #efb8b8;
  background: #ffffff;
  color: #b91c1c;
}

.settings-category-row button:hover {
  border-color: #dc2626;
  background: #fff1f2;
}

.auth-settings-heading {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.settings-user-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.settings-user-row {
  min-height: 54px;
  padding: 9px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #edf0ef;
}

.settings-user-row > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.settings-user-row strong,
.settings-user-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-user-row small,
.settings-user-row em {
  color: var(--muted);
  font-size: 12px;
}

.settings-user-row em {
  flex: 0 0 auto;
  font-style: normal;
  font-weight: 800;
}

.settings-logout-button {
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  color: #b91c1c;
  font-weight: 800;
  text-decoration: none;
}

.settings-logout-button:hover {
  border-color: #ef4444;
  background: #fee2e2;
}

.settings-empty {
  padding-top: 14px;
}

.sidebar {
  grid-column: 1;
  grid-row: 2;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  border-right: 1px solid var(--line);
  padding: 10px 7px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brand {
  display: block;
  margin: 0 -18px;
  min-height: 104px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 84px;
  object-fit: contain;
  object-position: left center;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav-item {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  align-items: center;
  gap: 5px;
  min-height: 76px;
  padding: 6px 4px;
  border-radius: 8px;
  color: var(--sidebar-muted);
  text-decoration: none;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.nav-item:hover,
.nav-item.active {
  background: #f8fafb;
  color: #242424;
  border-color: var(--line);
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-mark,
.module-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  border-radius: 6px;
  background: transparent;
  color: #242424;
  font-size: 12px;
  font-weight: 700;
}

.nav-mark {
  position: relative;
}

.nav-mark svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label {
  display: block;
  max-width: 76px;
  color: inherit;
  font-size: 10.5px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.nav-count {
  position: absolute;
  top: -5px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
}

.nav-item.active .nav-mark {
  color: var(--accent);
}

.sidebar-contact {
  display: none;
}

.sidebar-contact strong {
  color: #242424;
  font-size: 16px;
}

.workspace {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  background: #e1e5e7;
}

.workspace-actions {
  min-width: 0;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.workspace-actions:empty {
  display: none;
}

.topbar {
  min-width: 0;
  min-height: 72px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-title {
  min-width: 0;
}

.topbar-title h1 {
  overflow-wrap: anywhere;
}

.topbar-subtitle {
  margin: 6px 0 0;
  color: #526071;
  font-size: 14px;
  line-height: 1.35;
}

.topbar-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.user-chip {
  min-height: 34px;
  padding: 5px 8px 5px 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.user-chip a {
  padding: 6px 9px;
  border-radius: 999px;
  background: #f1f3f2;
  color: var(--ink);
  text-decoration: none;
}

.user-chip a:hover {
  background: #e5e9e7;
}

main {
  min-width: 0;
  max-width: none;
  width: 100%;
  overflow: hidden;
  padding: 18px 24px 42px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 20px;
}

.status,
.hint,
.module-state,
.empty-state p {
  color: var(--muted);
  font-size: 14px;
}

.hint {
  margin: 12px 0 0;
}

.panel,
.module-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(29, 31, 35, .06);
}

.panel {
  padding: 20px;
}

.overview-page {
  display: grid;
  gap: 18px;
}

.overview-intro {
  margin: 0;
  color: #4f5d69;
  font-size: 14px;
  line-height: 1.35;
}

#heat-pump-capture {
  scroll-margin-top: 88px;
}

.overview-heading {
  margin: -24px -28px 6px;
  padding: 26px 28px 20px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.overview-heading p:last-child {
  max-width: 720px;
  margin: 7px 0 0;
  color: #526071;
  font-size: 14px;
}

.overview-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(280px, 22vw, 360px);
  gap: 18px;
  align-items: start;
}

.overview-main,
.overview-side {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.overview-metrics {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.overview-metric,
.overview-card {
  min-width: 0;
  border: 1px solid #cfdceb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(29, 31, 35, .05);
}

.overview-metric {
  min-height: 188px;
  padding: 20px 18px;
  display: grid;
  align-content: start;
  gap: 10px;
  color: #102040;
  text-decoration: none;
}

.overview-metric:hover {
  border-color: #9fb8d8;
}

.overview-metric small,
.overview-section-head span {
  color: #3d4c62;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.overview-metric strong {
  margin-top: 10px;
  font-size: 38px;
  line-height: 1;
}

.overview-metric > span:last-child {
  color: #46566c;
  font-size: 14px;
  line-height: 1.35;
}

.overview-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.overview-icon svg,
.overview-project-icon svg,
.overview-quickstart svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.overview-metric-blue {
  background: #eaf4ff;
  border-color: #a9cef8;
}

.overview-metric-blue .overview-icon {
  background: #d8ecff;
  color: #1769aa;
}

.overview-metric-green {
  background: #ecf9ef;
  border-color: #b9e7c2;
}

.overview-metric-green .overview-icon {
  background: #d9f4df;
  color: #12854e;
}

.overview-metric-yellow {
  background: #fff3d7;
  border-color: #ffc96f;
}

.overview-metric-yellow .overview-icon {
  background: #ffe2a3;
  color: #a86407;
}

.overview-metric-gray {
  background: #f0f4f8;
  border-color: #cfd9e5;
}

.overview-metric-gray .overview-icon {
  background: #dfe8f1;
  color: #41566f;
}

.overview-card {
  padding: 20px;
}

.overview-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.overview-section-head h2 {
  margin-top: 6px;
  color: #112243;
}

.overview-pill {
  padding: 8px 12px;
  border: 1px solid #b7d1ee;
  border-radius: 8px;
  background: #eef7ff;
  color: #1769aa;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.overview-project-list {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.overview-project-row {
  min-width: 0;
  min-height: 76px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #d6e0ec;
  border-radius: 8px;
  background: #fbfdff;
  color: #102040;
  text-decoration: none;
}

.overview-project-row:hover {
  border-color: #a9cef8;
  background: #f4f9ff;
}

.overview-project-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #e7f7ef;
  color: #12854e;
}

.overview-project-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.overview-project-copy strong,
.overview-project-copy small,
.overview-project-time strong,
.overview-project-time small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-project-copy strong {
  font-size: 15px;
}

.overview-project-copy small,
.overview-project-time small,
.overview-mini p {
  color: #526071;
  font-size: 13px;
  line-height: 1.35;
}

.overview-project-time {
  display: grid;
  gap: 4px;
  text-align: right;
}

.overview-project-time strong {
  font-size: 13px;
}

.overview-empty {
  min-height: 110px;
  padding: 18px;
  display: grid;
  place-content: center;
  gap: 6px;
  border: 1px dashed #cfd9e5;
  border-radius: 8px;
  color: #526071;
  text-align: center;
}

.overview-empty strong {
  color: #112243;
}

.overview-quickstart {
  display: grid;
  gap: 10px;
}

.overview-quickstart h2 {
  margin-bottom: 4px;
  color: #3d4c62;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.overview-quickstart a {
  min-height: 46px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d0dbe8;
  border-radius: 8px;
  background: #ffffff;
  color: #253651;
  font-weight: 800;
  text-decoration: none;
}

.overview-quickstart a:hover {
  border-color: #a9cef8;
  background: #f4f9ff;
}

.overview-mini {
  display: grid;
  gap: 14px;
}

.overview-time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.overview-time-grid span {
  min-width: 0;
  padding: 10px;
  display: grid;
  gap: 5px;
  border-radius: 8px;
  background: #f5f8fb;
}

.overview-time-grid strong {
  color: #112243;
  font-size: 22px;
}

.overview-time-grid small {
  color: #526071;
  font-size: 12px;
  line-height: 1.25;
}

.contracts-panel {
  margin-top: 16px;
}

.offers-workspace {
  display: grid;
  gap: 16px;
}

.offer-functions-panel {
  display: grid;
  gap: 14px;
}

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

.offer-function-card {
  min-height: 112px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--ink);
  text-decoration: none;
}

.offer-function-shell {
  position: relative;
  padding: 0;
}

.offer-function-main {
  min-height: 110px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.offer-function-settings {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ffc5b2;
  border-radius: 8px;
  background: #ffffff;
  color: #411d12;
}

.offer-function-settings:hover,
.offer-function-settings.active {
  border-color: #ff5a1f;
  background: #fff1eb;
}

.offer-function-settings svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.offer-function-card span {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eef2f3;
  color: #3c4043;
  font-size: 12px;
  font-weight: 700;
}

.offer-function-card strong {
  font-size: 16px;
}

.offer-function-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  padding-right: 28px;
}

.offer-function-card.primary {
  background: #fff8f6;
  border-color: #ffc5b2;
}

.offer-function-card.primary span {
  background: #ff5a1f;
  color: #ffffff;
}

.offer-function-card.primary:hover,
.offer-function-card.primary.active {
  border-color: #ff5a1f;
  box-shadow: inset 0 0 0 1px #ff5a1f;
}

.offer-function-card.placeholder {
  opacity: .72;
  cursor: default;
}

.offers-table {
  min-width: 860px;
}

.offer-status {
  min-height: 24px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eef2f3;
  color: #3f474c;
  font-size: 12px;
  font-weight: 700;
}

.offer-empty-list {
  min-height: 150px;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #cbd5d1;
  border-radius: 8px;
  background: #fbfcfc;
}

.offer-empty-list strong {
  color: var(--ink);
}

.heat-pump-settings-note {
  min-height: 92px;
  padding: 16px;
}

.heat-pump-settings-picker {
  display: grid;
  gap: 6px;
  max-width: 420px;
}

.heat-pump-settings-picker span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.heat-pump-panel {
  display: grid;
  gap: 16px;
}

.heat-pump-form {
  display: grid;
  gap: 14px;
}

.heat-pump-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.heat-pump-form legend {
  padding: 0 6px;
  color: #2f3538;
  font-size: 14px;
  font-weight: 700;
}

.heat-pump-form label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.heat-pump-form label.wide {
  grid-column: 1 / -1;
}

.heat-pump-form .form-row {
  min-width: 0;
}

.heat-pump-form label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.heat-pump-recommendation small,
.location-field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.location-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.location-row button {
  min-height: 38px;
  padding: 0 14px;
}

.heat-pump-form input,
.heat-pump-form select,
.heat-pump-form textarea {
  width: 100%;
  min-height: 38px;
}

.heat-pump-form textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.form-actions button {
  min-height: 42px;
  padding: 0 18px;
}

.article-settings-list {
  display: grid;
  gap: 12px;
}

.heat-pump-settings-sections {
  display: grid;
  gap: 14px;
}

.heat-pump-settings-section {
  display: grid;
  gap: 14px;
}

.heat-pump-settings-section[hidden] {
  display: none;
}

.heat-pump-option-list {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: #ffffff;
}

.heat-pump-option-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.heat-pump-option-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, .7fr) auto auto;
  gap: 10px;
  align-items: end;
}

.heat-pump-option-create-form {
  margin: 12px;
  padding: 12px;
  border: 1px dashed #cbd5d1;
  border-radius: 8px;
  background: #fbfcfc;
}

.heat-pump-option-form label {
  display: grid;
  gap: 5px;
}

.heat-pump-option-form label span,
.option-no-article-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.option-checkbox {
  min-height: 38px;
  display: inline-flex !important;
  align-items: center;
  grid-template-columns: auto 1fr;
  gap: 7px !important;
}

.option-checkbox input {
  width: auto;
  min-height: auto;
}

.muted-input,
.locked-input,
.heat-pump-option-form input:disabled {
  border-color: #d1d5db;
  background: #edf0f2;
  color: #8b949e;
  cursor: not-allowed;
}

.heat-pump-option-form button:disabled,
.heat-pump-option-form button.is-disabled {
  background: #d5d9dd;
  border-color: #d5d9dd;
  color: #7a838c;
  cursor: not-allowed;
  box-shadow: none;
}

.option-no-article-note {
  margin: 0;
}

.article-settings-group summary {
  cursor: pointer;
}

.article-settings-rows {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #ffffff;
}

.article-settings-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.3fr) minmax(110px, .8fr) minmax(180px, 1.3fr) 70px 70px minmax(140px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.article-settings-row.linked-article-row,
.article-settings-row.article-create-row {
  grid-template-columns: minmax(120px, .9fr) minmax(180px, 1.4fr) 70px 70px minmax(140px, 1fr) auto;
}

.article-delete-row {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 6px;
}

.article-settings-row input,
.article-settings-row select {
  width: 100%;
  min-height: 34px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-heading span,
.empty-copy {
  color: var(--muted);
  font-size: 14px;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.contracts-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  font-size: 14px;
}

.customers-table {
  min-width: 760px;
}

.contracts-table th,
.contracts-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.contracts-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #fbfbf8;
}

.contracts-table tr:last-child td {
  border-bottom: 0;
}

.contracts-table a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.contracts-table form {
  margin: 0;
}

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

.archive-button,
.danger-button {
  min-height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid;
  border-radius: 6px;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.archive-button {
  border-color: #9fb8b3;
  background: #ffffff;
  color: #242424;
}

.archive-button:hover {
  background: #f2f7fb;
}

.danger-button {
  border-color: #dc2626;
  background: #ffffff;
  color: #b91c1c;
}

.danger-button:hover {
  background: #fff1f2;
}

.archive-list {
  display: grid;
  gap: 10px;
}

.archive-year {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.archive-year summary {
  min-height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 700;
}

.archive-year summary span:last-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.archive-year[open] summary {
  border-bottom: 1px solid var(--line);
  background: #fbfbf8;
}

.archive-year .table-wrap {
  padding: 0 10px;
}

.address-module {
  min-width: 0;
  display: grid;
  gap: 0;
  border: 1px solid #b8c4d6;
  background: #e8eef7;
  box-shadow: 0 1px 2px rgba(29, 31, 35, .06);
}

.address-header {
  min-height: 54px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  background: #eef3fb;
  border-bottom: 1px solid #b8c4d6;
}

.address-title {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}

.address-title h2 {
  color: #69707b;
  font-size: 28px;
}

.address-title span {
  color: #1d1f23;
  font-weight: 700;
}

.address-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 460px;
}

.address-search label,
.address-filters label {
  color: #1d1f23;
  font-size: 14px;
  font-weight: 700;
}

.address-search input[type=text] {
  max-width: 340px;
  min-height: 34px;
  background: #ffffff;
  border-color: #495aa2;
  border-radius: 0;
}

.address-search button,
.table-action {
  min-height: 30px;
  padding: 0 10px;
  border-color: #8d9bb4;
  background: #ffffff;
  color: #172554;
  font-size: 12px;
}

.address-search button:hover,
.table-action:hover {
  background: #eef3fb;
}

.address-tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid #b8c4d6;
  background: #dfe7f4;
}

.address-tabs a {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 8px 11px 0;
  border-right: 1px solid #aab6c8;
  border-left: 1px solid #f7fbff;
  color: #1f2f83;
  background: #e7edf8;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.address-tabs a.active {
  color: #d4113f;
  background: #ffffff;
}

.address-filters {
  min-height: 42px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #b8c4d6;
  background: #edf3fb;
}

.address-filters select {
  width: 260px;
  min-height: 32px;
  border-radius: 0;
  border-color: #8d9bb4;
}

.address-filters span {
  color: var(--muted);
  font-size: 13px;
}

.address-table-wrap {
  max-width: 100%;
  overflow: auto;
  background: #ffffff;
}

.address-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
  font-size: 14px;
}

.address-table th,
.address-table td {
  height: 28px;
  padding: 3px 6px;
  border-right: 1px solid #c5d1e2;
  border-bottom: 1px solid #c5d1e2;
  text-align: left;
  white-space: nowrap;
}

.address-table th {
  color: #1d1f23;
  background: linear-gradient(#f7f9fd, #cfd9e8);
  font-weight: 700;
}

.address-table tbody tr:nth-child(even) {
  background: #f2f6fc;
}

.address-table tbody tr:hover {
  background: #fff8d7;
}

.address-table form {
  margin: 0;
}

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

.project-board {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: calc(100vh - 140px);
  display: grid;
  grid-template-columns: var(--project-list-width) minmax(0, 1fr);
  gap: 14px;
}

.project-board.with-side-panel {
  grid-template-columns: minmax(220px, var(--project-list-width)) minmax(0, 1fr) minmax(280px, var(--project-side-width));
}

.project-board > * {
  min-width: 0;
}

.project-list,
.project-chat {
  min-height: calc(100vh - 140px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(29, 31, 35, .06);
}

.project-list {
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
}

.project-list-header {
  min-height: 58px;
  padding: 14px 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  background: #f7f8f8;
  border-bottom: 1px solid var(--line);
}

.project-list-header h2 {
  font-size: 20px;
}

.project-list-header span,
.category-empty,
.project-card-copy small,
.project-chat-header span,
.message-meta time,
.project-empty-chat p {
  color: var(--muted);
  font-size: 13px;
}

.compact-form,
.new-project-form,
.create-project-panel {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfbf8;
}

.create-project-panel {
  padding: 0;
}

.create-project-panel > summary {
  min-height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  color: #242424;
  font-size: 14px;
  font-weight: 700;
}

.create-project-panel > summary::-webkit-details-marker,
.app-settings > summary::-webkit-details-marker {
  display: none;
}

.create-project-panel[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #f7f8f8;
}

.create-project-panel > summary span:last-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 22px;
  font-weight: 400;
}

.create-project-panel[open] > summary span:last-child {
  transform: rotate(45deg);
}

.compact-form {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
}

.compact-form input,
.new-project-form input {
  min-height: 36px;
}

.compact-form button,
.file-button,
.new-project-form button {
  min-height: 36px;
  padding: 0 12px;
}

.new-project-form {
  display: grid;
  gap: 8px;
  border-bottom: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.address-create-row {
  grid-template-columns: minmax(72px, .72fr) minmax(0, 1.28fr);
}

.progress-inputs {
  grid-template-columns: 72px 14px 72px 1fr;
  align-items: center;
}

.progress-inputs span {
  color: var(--muted);
  text-align: center;
}

.category-stack {
  overflow: auto;
  background: #ffffff;
}

.project-category {
  border-bottom: 1px solid var(--line);
}

.project-category summary {
  min-height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 700;
  background: #f2f3f2;
}

.project-category summary,
.project-item {
  user-select: none;
}

.project-category summary::-webkit-details-marker {
  display: none;
}

.project-category summary span:last-child {
  color: #3b3b3b;
  font-size: 16px;
}

.category-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.project-items {
  display: grid;
}

.project-item {
  position: relative;
  min-height: 112px;
  padding: 14px 14px 14px 44px;
  display: block;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.project-item:hover,
.project-item.active {
  background: #e9f1fb;
}

.reorder-pending {
  outline: 2px solid rgba(227, 6, 19, 0.24);
  outline-offset: -2px;
}

.is-reorder-container {
  cursor: grabbing;
}

.is-reordering {
  border: 1px solid var(--line);
  box-shadow: 0 18px 38px rgba(28, 31, 35, 0.22);
  cursor: grabbing;
}

.project-category.is-reordering {
  overflow: hidden;
  background: #ffffff;
}

.reorder-placeholder {
  min-height: 48px;
  border: 2px dashed rgba(227, 6, 19, 0.36);
  background: #fff7f7;
}

.project-items .reorder-placeholder {
  min-height: 88px;
  margin: 4px 10px;
}

.reorder-save-error {
  box-shadow: inset 0 0 0 2px #dc2626;
}

body.reorder-active {
  cursor: grabbing;
}

.project-color {
  position: absolute;
  left: 18px;
  top: 16px;
  bottom: 16px;
  width: 7px;
  border-radius: 999px;
  background: var(--project-color, #73d216);
}

.project-card-copy {
  display: grid;
  gap: 7px;
}

.project-card-copy strong {
  padding-right: 22px;
  font-size: 16px;
  line-height: 1.2;
}

.project-meta {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 8px;
}

.project-meta b {
  font-size: 14px;
}

.project-meta i,
.project-progress span {
  position: relative;
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #ffd6cf;
}

.project-meta i::after,
.project-progress span::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress);
  background: #ff5a1f;
}

.project-meta em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.project-type {
  font-size: 14px;
  font-weight: 700;
}

.category-empty {
  margin: 0;
  padding: 14px;
}

.project-chat {
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.project-chat-header {
  min-height: 76px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.project-chat-header h2 {
  overflow-wrap: anywhere;
  font-size: 22px;
}

.project-header-copy {
  min-width: 0;
}

.project-header-category-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-header-category-row .eyebrow {
  margin-bottom: 4px;
}

.project-mobile-back {
  display: none;
}

.project-tools {
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.project-tools a {
  min-width: 86px;
  min-height: 58px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #4b2a22;
  background: #f7f8f8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.project-tools a span {
  color: inherit;
  font-size: 22px;
  font-weight: 700;
}

.project-tools a:hover,
.project-tools a.active {
  border-color: #242424;
  color: #ff4a1f;
  background: #fff5f2;
}

.project-header-tools a {
  min-width: 76px;
  min-height: 48px;
  padding: 6px 10px;
}

.project-header-tools a span {
  font-size: 20px;
}

.project-progress {
  min-width: 160px;
  display: grid;
  gap: 8px;
  text-align: right;
}

.message-stream {
  min-height: 0;
  padding: 22px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #ffffff;
}

.project-empty-chat {
  margin: auto;
  max-width: 560px;
  padding: 28px;
  text-align: center;
}

.project-empty-chat h2 {
  color: #ff4a1f;
  font-size: 20px;
  text-transform: uppercase;
}

.project-empty-chat.solo {
  align-self: center;
}

.message-bubble {
  align-self: flex-end;
  width: min(680px, 100%);
  display: grid;
  gap: 6px;
}

.message-meta {
  min-height: 22px;
  display: grid;
  grid-template-columns: auto 22px 22px;
  justify-content: end;
  align-items: center;
  column-gap: 4px;
  color: #5f6668;
  font-size: 12px;
  line-height: 1;
}

.message-meta time {
  height: 22px;
  display: inline-flex;
  align-items: center;
}

.message-reply-icon,
.message-actions summary {
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #5d4037;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.message-reply-icon:hover,
.message-actions summary:hover {
  background: #f1f3f3;
}

.message-actions {
  position: relative;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.message-actions summary {
  position: relative;
  list-style: none;
  font-size: 0;
}

.message-actions summary::-webkit-details-marker {
  display: none;
}

.message-actions summary::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.message-actions > div {
  position: absolute;
  top: 26px;
  right: 0;
  z-index: 20;
  min-width: 138px;
  padding: 6px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(29, 31, 35, .16);
}

.message-actions button {
  width: 100%;
  min-height: 34px;
  justify-content: flex-start;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.message-actions button:hover {
  background: #f3f5f5;
}

.message-actions form {
  margin: 0;
}

.message-color-menu {
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(6, 16px);
  gap: 4px;
}

.message-color-menu form {
  margin: 0;
}

.message-color-menu button {
  width: 16px;
  min-height: 16px;
  height: 16px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(29, 31, 35, .14);
}

.message-color-menu button:hover,
.message-color-menu button.active {
  border-color: #241f1d;
  background: var(--swatch);
}

.message-card {
  position: relative;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--message-color, #e5e7eb);
  color: #ffffff;
  box-shadow: 0 1px 1px rgba(29, 31, 35, .08);
}

.message-card.is-light {
  color: var(--ink);
}

.message-card p {
  margin: 0 0 10px;
  white-space: pre-wrap;
}

.message-card p:last-of-type {
  margin-bottom: 0;
}

.message-reply-preview,
.composer-reply {
  padding: 8px 10px;
  display: grid;
  gap: 4px;
  border-left: 3px solid #d8dcde;
  border-radius: 6px;
  background: #f2f3f3;
  color: #5f6668;
  text-decoration: none;
}

.message-reply-preview {
  margin-bottom: 10px;
}

.composer-reply[hidden] {
  display: none;
}

.message-reply-preview span,
.composer-reply span {
  font-size: 12px;
}

.message-reply-preview strong,
.composer-reply strong {
  overflow-wrap: anywhere;
  color: #6b6260;
  font-size: 14px;
  font-weight: 500;
}

.attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.attachment {
  min-height: 46px;
  padding: 8px;
  display: grid;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  background: #ffffff;
}

.attachment.image {
  padding: 0;
  overflow: hidden;
}

.attachment img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eef2f3;
}

.attachment strong {
  padding: 0 8px 8px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.attachment:not(.image) {
  grid-template-columns: 48px 1fr;
}

.attachment:not(.image) span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  border-radius: 6px;
  background: #eef2f3;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

body.has-lightbox {
  overflow: hidden;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  padding: 22px;
  display: grid;
  place-items: center;
  background: rgba(8, 11, 14, .82);
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox figure {
  width: min(100%, 1100px);
  max-height: 92vh;
  margin: 0;
  display: grid;
  gap: 10px;
}

.image-lightbox img {
  max-width: 100%;
  max-height: 86vh;
  justify-self: center;
  border-radius: 8px;
  object-fit: contain;
  background: #111827;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.image-lightbox figcaption {
  color: #ffffff;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.image-lightbox-close {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #111827;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.message-composer {
  min-height: 66px;
  padding: 12px;
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: #f7f8f8;
}

.composer-row > input {
  min-width: 0;
  width: 100%;
}

.message-composer.is-uploading {
  opacity: .9;
  pointer-events: none;
}

.composer-attachments-preview {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 4px;
}

.composer-attachments-preview[hidden] {
  display: none;
}

.composer-preview-card {
  position: relative;
  width: 94px;
  min-width: 94px;
  padding: 5px;
  display: grid;
  gap: 5px;
  border: 2px solid #d8e0dd;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(29, 31, 35, .08);
}

.composer-preview-card img,
.composer-preview-file {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
  background: #eef2f3;
}

.composer-preview-file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.composer-preview-card strong {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-preview-card.is-uploading::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, .62);
}

.composer-preview-more {
  width: 46px;
  min-width: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 800;
}

.composer-upload-state {
  min-height: 36px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
}

.composer-upload-state[hidden] {
  display: none;
}

.composer-upload-state span {
  width: 18px;
  height: 18px;
  border: 3px solid #bfdbfe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: upload-spin .8s linear infinite;
}

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

.composer-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
}

.composer-reply {
  position: relative;
  padding-right: 40px;
  background: #ffffff;
}

.composer-reply button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #eef1f1;
  color: #5f6668;
  font-size: 18px;
}

.project-side-panel {
  min-height: calc(100vh - 140px);
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(29, 31, 35, .06);
}

.project-details-form,
.files-placeholder {
  padding: 18px;
}

.side-panel-heading {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.side-panel-heading h2 {
  font-size: 20px;
}

.side-panel-heading button {
  min-height: 42px;
  padding: 0 18px;
}

.project-details-form {
  display: grid;
  gap: 14px;
}

.detail-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.detail-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.detail-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.detail-field input,
.detail-field select,
.detail-field textarea {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-bottom: 1px solid #edf0ee;
  border-radius: 0;
  padding: 8px 0;
  background: #ffffff;
  color: var(--ink);
  font: 15px/1.35 Arial, Helvetica, sans-serif;
}

.detail-field textarea {
  resize: vertical;
}

.detail-field input:focus,
.detail-field select:focus,
.detail-field textarea:focus {
  outline: 0;
  border-bottom-color: var(--accent);
}

.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
}

.color-picker label {
  position: relative;
  width: 36px;
  height: 36px;
  cursor: pointer;
}

.color-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.color-picker span {
  display: block;
  width: 36px;
  height: 36px;
  border: 3px solid transparent;
  border-radius: 999px;
  background: var(--swatch);
  box-shadow: 0 1px 3px rgba(29, 31, 35, .18);
}

.color-picker input:checked + span {
  border-color: #111827;
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px #111827;
}

.project-delete-form {
  margin: 0 18px 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.delete-project-button {
  width: 100%;
  min-height: 42px;
  border-color: #efb8b8;
  background: #fff7f7;
  color: #b91c1c;
}

.delete-project-button:hover {
  border-color: #dc2626;
  background: #fff1f2;
}

.files-placeholder p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.message-composer input[type=text] {
  min-height: 42px;
  border-radius: 6px;
  background: #ffffff;
}

.file-button {
  width: 44px;
  border: 1px solid #cbd5d1;
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent);
  font-size: 24px;
  font-weight: 400;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.module-card {
  min-height: 128px;
  padding: 16px;
  color: var(--ink);
  text-decoration: none;
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.module-card:hover {
  border-color: #9fb8b3;
}

.module-mark {
  width: 34px;
  height: 34px;
  background: #f2f7fb;
  color: #242424;
  border-left: 3px solid var(--accent);
}

.module-card strong {
  font-size: 15px;
}

.empty-state {
  max-width: 560px;
  display: grid;
  gap: 10px;
}

.empty-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e7f4f1;
  color: var(--accent-strong);
  font-weight: 700;
}

.upload {
  display: grid;
  gap: 16px;
  align-items: center;
  grid-template-columns: 1fr auto;
}

.import-block {
  display: grid;
  gap: 14px;
}

.rps-picker {
  display: grid;
  gap: 16px;
  align-items: center;
  grid-template-columns: 1fr auto;
}

.upload-divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line);
}

input[type=file] {
  width: 100%;
  border: 1px dashed #aeb8b2;
  border-radius: 8px;
  padding: 18px;
  background: #fbfbf8;
}

select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5d1;
  border-radius: 6px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--ink);
  font: 14px/1.35 Arial, Helvetica, sans-serif;
}

button,
.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font: 700 14px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

button:hover,
.button:hover {
  background: var(--accent-strong);
}

.button.secondary {
  background: white;
  color: var(--accent-strong);
}

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

.field {
  display: grid;
  gap: 6px;
}

.field.wide {
  grid-column: 1 / -1;
}

label {
  font-size: 13px;
  color: #374151;
  font-weight: 700;
}

input[type=text] {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cbd5d1;
  border-radius: 6px;
  padding: 8px 10px;
  font: 14px/1.35 Arial, Helvetica, sans-serif;
  color: var(--ink);
}

.actions,
.done {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.done {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.notice,
.error {
  margin: 0 0 16px;
  padding: 10px 12px;
  font-size: 14px;
}

.notice {
  border-left: 4px solid var(--accent);
  background: #eef7f4;
  color: #164e47;
}

.error {
  border-left: 4px solid var(--warn);
  background: #fff7ed;
  color: #7c2d12;
}

@media (min-width: 961px) and (max-width: 1180px) {
  .project-board.with-side-panel {
    grid-template-columns: var(--project-list-width) minmax(0, 1fr);
  }

  .project-side-panel {
    grid-column: 1 / -1;
    min-height: auto;
  }
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .app-header {
    grid-column: 1;
    grid-row: 1;
    min-height: 70px;
    padding: 0 10px 0 0;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .header-brand-crop {
    width: 70px;
    height: 34px;
  }

  .header-brand-crop img {
    width: 180px;
  }

  .header-title h1 {
    font-size: 22px;
  }

  .header-title span {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .settings-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .sidebar {
    grid-column: 1;
    grid-row: 2;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 6px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-header,
  .sidebar,
  .workspace {
    width: 100%;
    min-width: 0;
  }

  .brand {
    margin: 0 -12px;
    max-width: 320px;
    min-height: 0;
    padding: 10px 12px 8px;
  }

  .brand img {
    max-height: 62px;
  }

  .nav {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 2px;
  }

  .nav-item {
    flex: 0 0 78px;
    min-height: 62px;
  }

  .nav-mark {
    width: 28px;
    height: 24px;
  }

  .nav-mark svg {
    width: 23px;
    height: 23px;
  }

  .nav-label {
    max-width: 72px;
    font-size: 10px;
  }

  .workspace {
    grid-column: 1;
    grid-row: 3;
  }

  .workspace-actions {
    padding: 8px 16px;
  }

  .topbar {
    min-height: 68px;
    padding: 12px 16px;
  }

  main {
    padding: 18px 16px 36px;
  }

  .project-board {
    width: 100%;
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .project-board.with-side-panel {
    grid-template-columns: 1fr;
  }

  .project-list,
  .project-chat,
  .project-side-panel {
    min-height: auto;
  }

  .project-chat {
    min-height: 620px;
  }

  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-layout {
    grid-template-columns: 1fr;
  }

  .overview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .offer-function-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-settings-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .heat-pump-option-form {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 641px) and (max-width: 960px) {
  :root {
    --project-list-width: clamp(220px, 30vw, 260px);
  }

  .app-shell {
    grid-template-columns: 92px minmax(0, 1fr);
    grid-template-rows: 78px minmax(0, 1fr);
  }

  .app-header {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 78px;
    padding: 0 18px 0 0;
    grid-template-columns: 92px minmax(0, 1fr) auto;
  }

  .header-brand-crop {
    width: 70px;
    height: 34px;
  }

  .header-brand-crop img {
    width: 180px;
  }

  .settings-button {
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
  }

  .sidebar {
    grid-column: 1;
    grid-row: 2;
    position: static;
    padding: 10px 7px 14px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .nav {
    display: grid;
    gap: 4px;
    overflow: visible;
    padding-bottom: 0;
  }

  .nav-item {
    flex: initial;
    min-height: 76px;
  }

  .nav-mark {
    width: 34px;
    height: 30px;
  }

  .nav-mark svg {
    width: 26px;
    height: 26px;
  }

  .nav-label {
    max-width: 76px;
    font-size: 10.5px;
  }

  .workspace {
    grid-column: 2;
    grid-row: 2;
  }

  .project-board {
    width: 100%;
    grid-template-columns: var(--project-list-width) minmax(0, 1fr);
    align-items: start;
  }

  .project-board.with-side-panel {
    grid-template-columns: var(--project-list-width) minmax(0, 1fr);
  }

  .project-side-panel {
    grid-column: 1 / -1;
  }

  .project-list,
  .project-chat {
    min-height: calc(100vh - 142px);
  }
}

@media (max-width: 640px) {
  main {
    padding: 12px 10px 34px;
  }

  .app-header {
    min-height: 68px;
    grid-template-columns: 76px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .header-brand {
    width: 76px;
    height: 68px;
  }

  .header-brand-crop {
    width: 60px;
    height: 29px;
  }

  .header-brand-crop img {
    width: 155px;
  }

  .header-title p {
    display: none;
  }

  .header-title h1 {
    font-size: 20px;
  }

  .header-title span {
    font-size: 12px;
    line-height: 1.2;
  }

  .header-actions {
    gap: 4px;
  }

  .settings-button,
  .header-icon-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .settings-button svg,
  .header-icon-button svg {
    width: 24px;
    height: 24px;
  }

  .workspace-actions {
    padding: 8px 10px;
    justify-content: stretch;
  }

  .workspace-actions > * {
    width: 100%;
  }

  .project-board {
    gap: 10px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .workspace-actions,
  .topbar-actions {
    width: 100%;
  }

  h1 {
    font-size: 24px;
  }

  .overview-heading {
    margin: -14px -12px 4px;
    padding: 20px 12px 16px;
  }

  .overview-layout,
  .overview-main,
  .overview-side {
    gap: 12px;
  }

  .overview-metrics {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .overview-metric {
    min-height: 142px;
    padding: 16px;
  }

  .overview-metric strong {
    margin-top: 2px;
    font-size: 34px;
  }

  .overview-card {
    padding: 16px;
  }

  .overview-section-head {
    align-items: flex-start;
  }

  .overview-project-row {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
  }

  .overview-project-time {
    grid-column: 2;
    text-align: left;
  }

  .overview-time-grid {
    grid-template-columns: 1fr;
  }

  .upload,
  .rps-picker,
  .grid,
  .module-grid,
  .offer-function-grid,
  .heat-pump-form fieldset,
  .heat-pump-option-form,
  .article-settings-row,
  .article-settings-row.linked-article-row,
  .article-settings-row.article-create-row,
  .form-row {
    grid-template-columns: 1fr;
  }

  .progress-inputs {
    grid-template-columns: 1fr 14px 1fr;
  }

  .progress-inputs button {
    grid-column: 1 / -1;
  }

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

  .project-chat-header,
  .message-composer {
    grid-template-columns: 1fr;
  }

  .project-chat-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-header-copy {
    width: 100%;
  }

  .project-mobile-back {
    width: 34px;
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d2d7da;
    border-radius: 6px;
    background: #f5f7f8;
    color: #242424;
  }

  .project-mobile-back svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .project-tools {
    width: 100%;
  }

  .project-tools a {
    flex: 1 1 0;
    min-width: 0;
  }

  .detail-row,
  .postal-row {
    grid-template-columns: 1fr;
  }

  .composer-row {
    grid-template-columns: 44px 1fr;
  }

  .composer-row > button {
    grid-column: 1 / -1;
  }

  .actions {
    justify-content: stretch;
    flex-direction: column;
  }

  button,
  .button {
    width: 100%;
  }

  .form-actions {
    justify-content: stretch;
  }

  .message-reply-icon {
    width: 24px;
  }

  .composer-reply button {
    width: 26px;
  }
}
