:root {
  --bg: #eef3f1;
  --bg-2: #f8faf9;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-solid: #ffffff;
  --surface-soft: #f5f8f7;
  --surface-tint: #eff8f4;
  --border: #dbe5e1;
  --border-strong: #c8d6d1;
  --text: #10201b;
  --muted: #607069;
  --weak: #8a9993;
  --primary: #0f6b55;
  --primary-2: #168069;
  --primary-dark: #0b473a;
  --primary-soft: #e4f4ee;
  --accent: #d49c2f;
  --warning: #ad641b;
  --danger: #b42318;
  --success: #087443;
  --shadow-sm: 0 8px 22px rgba(16, 32, 27, 0.06);
  --shadow-md: 0 18px 48px rgba(16, 32, 27, 0.11);
  --shadow-lg: 0 28px 90px rgba(16, 32, 27, 0.18);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at 12% -8%, rgba(15, 107, 85, 0.16), transparent 32rem),
    radial-gradient(circle at 94% 8%, rgba(212, 156, 47, 0.13), transparent 30rem),
    linear-gradient(180deg, #f7faf8 0%, var(--bg) 52%, #edf3f1 100%);
  font-size: 14px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(15, 107, 85, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 107, 85, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

.home {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

.home-card {
  position: relative;
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
  gap: 46px;
  padding: 52px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.84)),
    radial-gradient(circle at 100% 0%, rgba(15, 107, 85, 0.12), transparent 23rem);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.home-card::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 107, 85, 0.13), transparent 66%);
}

.eyebrow {
  width: fit-content;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 10px;
  border: 1px solid rgba(15, 107, 85, 0.14);
  border-radius: 999px;
  background: var(--primary-soft);
}

.home h1 {
  margin-top: 18px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.12;
  max-width: 760px;
}

.subtitle {
  margin-top: 18px;
  max-width: 720px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 10px 18px;
  color: var(--text);
  background: linear-gradient(180deg, #fff, #f8faf9);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 6px 16px rgba(16, 32, 27, 0.05);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 107, 85, 0.32);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 12px 26px rgba(16, 32, 27, 0.1);
}

.button:active {
  transform: translateY(0);
}

.button.primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 30px rgba(15, 107, 85, 0.26);
}

.button.primary:hover {
  box-shadow: 0 18px 36px rgba(15, 107, 85, 0.32);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.process {
  position: relative;
  z-index: 1;
  align-self: center;
  padding: 26px;
  border: 1px solid rgba(15, 107, 85, 0.14);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(245, 250, 248, 0.86));
  box-shadow: var(--shadow-sm);
}

.process-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding: 14px 0;
  color: var(--muted);
  font-weight: 650;
}

.process-row + .process-row {
  border-top: 1px solid var(--border);
}

.process-dot {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(15, 107, 85, 0.2);
}

.boundary {
  margin-top: 30px;
  padding: 16px 18px;
  border: 1px solid rgba(173, 100, 27, 0.18);
  border-left: 4px solid var(--accent);
  border-radius: 16px;
  background: #fff8e8;
  color: #6d4216;
  font-size: 13px;
  line-height: 1.75;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 72px 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(219, 229, 225, 0.82);
  background: rgba(248, 251, 249, 0.88);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(16, 32, 27, 0.05);
}

.topbar .actions {
  margin: 0;
}

.brand {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand strong {
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  width: min(1600px, 100%);
  display: grid;
  grid-template-columns: minmax(196px, 250px) minmax(0, 1fr) minmax(280px, 344px);
  gap: 22px;
  align-items: start;
  margin: 0 auto;
  padding: 24px;
}

.sidebar,
.summary,
.panel {
  border: 1px solid rgba(219, 229, 225, 0.9);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 12px;
}

.step {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  margin: 2px 0;
  padding: 12px 12px;
  border: 0;
  border-radius: 16px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 650;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.step:hover {
  color: var(--text);
  background: rgba(15, 107, 85, 0.06);
}

.step.active {
  color: var(--primary-dark);
  background: linear-gradient(135deg, var(--primary-soft), rgba(255, 255, 255, 0.9));
  box-shadow: 0 10px 22px rgba(15, 107, 85, 0.08);
}

.step.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: var(--primary);
}

.step-index {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--weak);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.step.active .step-index {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.content {
  min-width: 0;
}

.panel {
  position: relative;
  overflow: hidden;
  padding: 28px;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), rgba(15, 107, 85, 0.15), transparent);
}

.panel + .panel {
  margin-top: 18px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.panel-title h2 {
  font-size: 23px;
  line-height: 1.25;
}

.panel-title p {
  margin-top: 9px;
  max-width: 860px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.field label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  color: #31433c;
  font-size: 13px;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(15, 107, 85, 0.12);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 10px 13px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:hover,
select:hover {
  border-color: rgba(15, 107, 85, 0.32);
}

input:focus,
select:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(15, 107, 85, 0.12);
}

input:disabled {
  color: var(--muted);
  background: #f0f4f2;
}

input::placeholder {
  color: #a9a195;
  opacity: 1;
}

input:focus::placeholder {
  color: #b9b2a7;
}

input[type="file"] {
  padding: 8px 12px;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
}

.check-field input {
  width: auto;
  min-height: auto;
}

.confirmation-row,
.confirmation-row:last-child {
  min-height: 98px;
  border: 1px solid var(--border);
  border-radius: 18px;
}

.compact-after {
  margin-top: 18px;
}

.empty-state {
  margin-top: 16px;
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 18px;
  color: var(--muted);
  background: linear-gradient(135deg, #fff, var(--surface-soft));
  font-size: 13px;
  line-height: 1.75;
}

.action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 249, 0.92)),
    radial-gradient(circle at 0 0, rgba(15, 107, 85, 0.08), transparent 18rem);
  box-shadow: 0 12px 26px rgba(16, 32, 27, 0.05);
}

.action-card.primary-soft {
  border-color: rgba(15, 107, 85, 0.22);
  background:
    linear-gradient(135deg, rgba(236, 248, 242, 0.98), rgba(255, 255, 255, 0.96)),
    radial-gradient(circle at 0 0, rgba(15, 107, 85, 0.14), transparent 20rem);
}

.action-card h3 {
  font-size: 16px;
  line-height: 1.35;
}

.action-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.action-card-side {
  display: grid;
  justify-items: end;
  gap: 10px;
  flex: 0 0 auto;
}

.action-card-side span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.questionnaire-toolkit {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 16px;
  margin-bottom: 18px;
}

.questionnaire-toolkit .action-card {
  margin-top: 0;
}

.template-card,
.import-panel,
.form-card,
.decision-card,
.guide-intro,
.dimension-card,
.requirement-strip div,
.stage,
.metric {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(16, 32, 27, 0.04);
}

.template-card {
  display: grid;
  gap: 16px;
  align-content: space-between;
  padding: 20px;
  border-radius: 22px;
}

.template-card h3 {
  font-size: 16px;
}

.template-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(11, 31, 25, 0.46);
  backdrop-filter: blur(10px);
}

.modal {
  width: min(1240px, 100%);
  max-height: min(780px, calc(100vh - 56px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 28px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-lg);
}

.modal-header,
.modal-footer {
  padding: 20px 24px;
  background: #fff;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 22px;
}

.modal-header p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.modal-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 22px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: #fff;
}

.modal-body {
  overflow: auto;
  padding: 20px 24px;
  background: var(--bg-2);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}

.modal-list {
  display: grid;
  gap: 12px;
}

.modal-group {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
}

.modal-group + .modal-group {
  margin-top: 14px;
}

.modal-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  background: linear-gradient(180deg, #fff, var(--surface-soft));
  border-bottom: 1px solid var(--border);
}

.modal-group-head strong {
  font-size: 15px;
}

.modal-group-head span,
.modal-group > p {
  color: var(--muted);
  font-size: 12px;
}

.modal-group > p {
  margin: 0;
  padding: 0 18px 15px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  line-height: 1.65;
}

.governance-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
}

.form-card,
.decision-card {
  border-radius: 22px;
  padding: 20px;
}

.form-card h3,
.decision-card h3 {
  font-size: 17px;
}

.form-card p,
.decision-card p,
.decision-card li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.form-card p,
.decision-card p {
  margin: 8px 0 16px;
}

.decision-card ul {
  margin: 0;
  padding-left: 18px;
}

.decision-card li + li {
  margin-top: 6px;
}

.readiness-summary {
  display: grid;
  gap: 13px;
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(15, 107, 85, 0.16);
  border-radius: 22px;
  background: linear-gradient(135deg, #fff, var(--surface-tint));
}

.readiness-summary div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.readiness-summary strong {
  font-size: 15px;
}

.readiness-summary span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3ebe7;
  box-shadow: inset 0 1px 2px rgba(16, 32, 27, 0.08);
}

.progress-track div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

.readiness-sections {
  display: grid;
  gap: 14px;
}

.readiness-options {
  display: grid;
}

.readiness-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 184px;
  gap: 13px;
  align-items: start;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: background 150ms ease;
}

.readiness-row:hover {
  background: #fbfdfc;
}

.readiness-row:last-child {
  border-bottom: 0;
}

.readiness-row input {
  display: none;
}

.readiness-check {
  width: 24px;
  height: 24px;
  margin-top: 2px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  transition: background 150ms ease, border-color 150ms ease;
}

.readiness-check::after {
  content: "";
  width: 10px;
  height: 6px;
  transform: rotate(-45deg) translate(1px, -1px);
  border-left: 2px solid transparent;
  border-bottom: 2px solid transparent;
}

.readiness-row.is-on {
  background: #f5fbf8;
}

.readiness-row.is-on .readiness-check {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.readiness-row.is-on .readiness-check::after {
  border-left-color: #fff;
  border-bottom-color: #fff;
}

.readiness-main,
.readiness-title {
  display: grid;
  gap: 5px;
}

.readiness-title {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.readiness-title strong {
  font-size: 14px;
}

.readiness-title em {
  color: var(--warning);
  font-style: normal;
  font-size: 12px;
  font-weight: 750;
}

.readiness-row.is-on .readiness-title em {
  color: var(--success);
}

.readiness-main span:last-child,
.readiness-impact {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.readiness-impact {
  color: var(--weak);
  text-align: right;
}

.summary {
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 20px;
}

.summary h3 {
  margin-bottom: 16px;
  font-size: 17px;
}

.summary-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.summary-line span:first-child {
  color: var(--muted);
}

.summary-line strong {
  max-width: 180px;
  text-align: right;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.notice {
  margin-top: 15px;
  padding: 14px 15px;
  border: 1px solid rgba(173, 100, 27, 0.18);
  border-left: 4px solid var(--warning);
  border-radius: 16px;
  color: #6d4216;
  background: #fff8e8;
  font-size: 13px;
  line-height: 1.7;
}

.notice.danger {
  border-color: rgba(180, 35, 24, 0.16);
  border-left-color: var(--danger);
  background: #fff4f2;
  color: #7a1f18;
}

.notice.success {
  border-color: rgba(8, 116, 67, 0.16);
  border-left-color: var(--success);
  background: #effaf4;
  color: #075634;
}

.notice-rich {
  display: grid;
  gap: 6px;
}

.notice-rich strong {
  color: inherit;
  font-size: 13px;
  line-height: 1.35;
}

.notice-rich span {
  display: block;
}

.notice-rich em {
  display: block;
  color: inherit;
  opacity: 0.82;
  font-style: normal;
  font-size: 12px;
  line-height: 1.65;
}

.calculation-basis {
  margin-top: 16px;
  padding: 14px 14px 13px;
  border: 1px solid #ddd8cd;
  border-radius: 16px;
  background: #faf8f2;
}

.calculation-basis p,
.calculation-basis li {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.calculation-basis p + p {
  margin-top: 6px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.metric {
  min-width: 0;
  min-height: 132px;
  display: grid;
  align-content: space-between;
  border-radius: 22px;
  padding: 18px;
  background:
    linear-gradient(180deg, #fff, #f7fbf9),
    radial-gradient(circle at 100% 0, rgba(15, 107, 85, 0.1), transparent 10rem);
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.metric strong {
  display: block;
  margin-top: 10px;
  color: var(--primary-dark);
  font-size: clamp(21px, 1.7vw, 28px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.metric em {
  display: block;
  margin-top: 10px;
  color: var(--weak);
  font-style: normal;
  font-size: 12px;
}

.table {
  width: 100%;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  font-size: 13px;
}

.table th,
.table td {
  padding: 13px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.table tr:last-child td {
  border-bottom: 0;
}

.table th {
  color: #324640;
  font-weight: 800;
  background: var(--surface-soft);
}

.table td.num,
.table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bars {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 140px;
  gap: 14px;
  align-items: center;
  color: var(--muted);
}

.bar-row strong {
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3ebe7;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

.result-accordion-list {
  display: grid;
  gap: 14px;
}

.result-accordion {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #fffdf9;
  box-shadow: 0 8px 20px rgba(16, 32, 27, 0.04);
}

.result-accordion-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 0;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 248, 0.9)),
    radial-gradient(circle at 0 0, rgba(15, 107, 85, 0.08), transparent 18rem);
  text-align: left;
}

.result-accordion-head span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.result-accordion-head strong {
  font-size: 16px;
  font-weight: 850;
}

.result-accordion-head em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.65;
}

.result-accordion-head b {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid rgba(15, 107, 85, 0.16);
  border-radius: 999px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 12px;
}

.result-accordion.is-open .result-accordion-head {
  border-bottom: 1px solid var(--border);
}

.result-accordion-body {
  padding: 18px;
}

.perception-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(360px, 1.22fr);
  align-items: stretch;
  gap: 18px;
}

.perception-card {
  position: relative;
  min-width: 0;
  height: 100%;
  container-type: inline-size;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 24px;
  border: 1px solid #e3ded2;
  border-radius: 24px;
  background: #fffdf9;
  box-shadow: 0 12px 30px rgba(31, 37, 34, 0.055);
}

.perception-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), rgba(184, 138, 61, 0.72));
}

.perception-heading {
  display: grid;
  gap: 7px;
}

.perception-heading strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 850;
}

.perception-heading span,
.perception-note,
.simulator-field > span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.perception-note {
  padding: 12px 14px;
  border: 1px solid #ebe6db;
  border-radius: 16px;
  background: #faf8f2;
}

.perception-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.perception-card:first-child .perception-grid {
  grid-template-columns: 1fr;
}

.carbon-visual {
  position: relative;
  overflow: hidden;
  margin: 0;
  border: 1px solid #e1ded5;
  border-radius: 20px;
  background: #f5f8f4;
  box-shadow: 0 12px 28px rgba(31, 37, 34, 0.07);
}

.carbon-visual img,
.carbon-visual svg {
  display: block;
  width: 100%;
  height: auto;
}

.perception-card:last-child .compact-after {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.perception-card:last-child .compact-after .perception-metric {
  gap: 5px 10px;
  padding: 14px 15px;
}

.perception-card:last-child .compact-after .perception-metric strong {
  font-size: clamp(20px, 1.65vw, 26px);
  letter-spacing: -0.03em;
}

.perception-card:last-child .compact-after .perception-metric span {
  white-space: nowrap;
  font-size: 12px;
}

.perception-metric {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 8px;
  overflow: hidden;
  min-height: 120px;
  padding: 18px;
  border: 1px solid #e6e0d5;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffefa, #faf7ef);
}

.perception-metric.has-image {
  min-height: 204px;
  padding-bottom: 104px;
}

.perception-metric.has-image::before {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  height: 82px;
  border-radius: 14px;
  background: var(--metric-image) center / cover no-repeat;
  pointer-events: none;
}

.perception-metric span {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

.perception-metric strong {
  position: relative;
  z-index: 1;
  color: var(--primary-dark);
  font-size: clamp(24px, 2.7vw, 34px);
  line-height: 1;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: -0.045em;
}

.perception-metric em {
  position: relative;
  z-index: 1;
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid #d8d2c4;
  border-radius: 999px;
  color: #4f5d56;
  background: rgba(255, 253, 249, 0.9);
  font-style: normal;
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.45;
}

@container (max-width: 430px) {
  .perception-card:first-child .perception-grid {
    gap: 10px;
  }

  .perception-card:first-child .perception-metric {
    min-height: 174px;
    padding: 14px;
    gap: 7px;
  }

  .perception-card:first-child .perception-metric.has-image {
    padding-bottom: 86px;
  }

  .perception-card:first-child .perception-metric.has-image::before {
    right: 8px;
    bottom: 8px;
    left: 8px;
    height: 70px;
  }

  .perception-card:first-child .perception-metric span {
    font-size: 12px;
  }

  .perception-card:first-child .perception-metric strong {
    font-size: clamp(22px, 16cqi, 30px);
    line-height: 1.05;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .perception-card:first-child .perception-metric em {
    max-width: 100%;
    white-space: normal;
  }
}

.simulator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.simulator-grid .simulator-field,
.simulator-grid .simulator-toggle {
  grid-column: auto;
}

.simulator-grid .simulator-field:first-child {
  grid-column: 1 / -1;
}

.simulator-grid .simulator-toggle {
  grid-column: 1 / -1;
}

.simulator-field label {
  min-height: 24px;
  flex-wrap: nowrap;
  gap: 6px;
  white-space: nowrap;
}

.simulator-field label .source-badge {
  flex: 0 0 auto;
  margin-left: 6px;
}

.simulator-grid .simulator-field:nth-child(2),
.simulator-grid .simulator-field:nth-child(3) {
  grid-row: 2;
}

.simulator-grid .simulator-field:nth-child(2) {
  grid-column: 1;
}

.simulator-grid .simulator-field:nth-child(3) {
  grid-column: 2;
}

.simulator-help,
.simulator-empty {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid #dce7e1;
  border-radius: 18px;
  background: #f3f7f4;
}

.simulator-help strong,
.simulator-empty strong {
  color: var(--primary-dark);
  font-size: 15px;
  font-weight: 850;
}

.simulator-help span,
.simulator-empty span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.simulator-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.simulator-actions span {
  color: var(--muted);
  font-size: 13px;
}

.simulator-toggle {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-soft);
}

.simulator-toggle input {
  width: auto;
  min-height: auto;
}

.simulator-toggle span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.simulator-toggle strong {
  color: var(--text);
  font-size: 14px;
}

.simulator-toggle em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
  line-height: 1.6;
}

.monthly-card {
  display: grid;
  gap: 14px;
}

.monthly-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 248, 0.92)),
    radial-gradient(circle at 0 0, rgba(15, 107, 85, 0.08), transparent 16rem);
}

.monthly-head div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.monthly-head strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 850;
}

.monthly-head span,
.monthly-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.monthly-chart-shell {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #fffdf9;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.monthly-chart {
  display: block;
  width: 100%;
  height: auto;
}

.monthly-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.monthly-stat-grid div {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fffdf9;
}

.monthly-stat-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.monthly-stat-grid strong {
  color: var(--primary-dark);
  font-size: 15px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.monthly-table-wrap {
  overflow-x: auto;
}

.monthly-table {
  min-width: 560px;
}

.monthly-factor-strip {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 253, 249, 0.82);
}

.monthly-factor-strip > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.monthly-factor-strip strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.monthly-factor-strip span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.monthly-factor-pills {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.monthly-factor-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e1ded5;
  border-radius: 12px;
  background: #fff;
  color: var(--primary-dark);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.monthly-factor-pill b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.monthly-empty {
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px dashed rgba(15, 107, 85, 0.28);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 253, 249, 0.98), rgba(244, 249, 246, 0.94)),
    radial-gradient(circle at 0 0, rgba(15, 107, 85, 0.08), transparent 18rem);
}

.monthly-empty strong {
  color: var(--text);
  font-size: 17px;
  font-weight: 850;
}

.monthly-empty p,
.monthly-empty li,
.monthly-empty span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.monthly-empty ol {
  margin: 0;
  padding-left: 20px;
}

.monthly-factor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.scheme-diagram-wrap {
  display: grid;
  gap: 14px;
}

.scheme-board {
  overflow: hidden;
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid #e1ded5;
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 0%, rgba(15, 107, 85, 0.08), transparent 26rem),
    linear-gradient(135deg, #fcfaf5, #eef4f0);
  box-shadow: 0 14px 34px rgba(31, 37, 34, 0.08);
}

.scheme-titlebar {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.scheme-titlebar div {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.scheme-titlebar strong {
  color: var(--text);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 850;
  line-height: 1.25;
}

.scheme-titlebar span,
.scheme-card-heading span,
.scene-caption span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.scheme-titlebar em {
  flex: 0 0 auto;
  border: 1px solid #c9ded5;
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--primary-dark);
  background: #e8f3ee;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.scheme-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.9fr);
  gap: 16px;
}

.scheme-scene-card,
.scheme-data-card {
  min-width: 0;
  border: 1px solid #dedbd2;
  border-radius: 24px;
  background: rgba(255, 253, 249, 0.92);
  box-shadow: 0 10px 22px rgba(31, 37, 34, 0.045);
}

.scheme-scene-card {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 18px;
}

.scheme-card-heading {
  min-width: 0;
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
}

.scheme-card-heading strong {
  color: var(--text);
  font-size: 17px;
  font-weight: 850;
}

.roof-scene,
.facade-scene {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.roof-surface {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  min-height: 300px;
  border: 2px solid #bfb5a7;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,253,249,0.08), rgba(16,32,27,0.08)),
    url("./assets/roof-texture.png") center / 100% 100% no-repeat,
    linear-gradient(135deg, #f5efe4, #e4dccd);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.24);
}

.roof-usable {
  position: absolute;
  left: 8.4%;
  top: 24.2%;
  height: 47.8%;
  max-width: 62%;
  border-radius: 18px;
  border: 1px solid rgba(15, 107, 85, 0.18);
  background: rgba(218, 239, 230, 0.13);
  box-shadow: inset 0 0 0 999px rgba(218, 239, 230, 0.025);
}

.roof-equipment {
  position: absolute;
  right: 15%;
  top: 8.2%;
  z-index: 4;
  width: auto;
  height: auto;
  padding: 6px 10px;
  border: 1px solid rgba(184, 173, 158, 0.62);
  border-radius: 999px;
  color: #6b6258;
  background: rgba(255, 253, 249, 0.78);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(31, 37, 34, 0.08);
}

.roof-shadow {
  position: absolute;
  right: -18px;
  top: 118px;
  z-index: 2;
  width: 230px;
  height: 120px;
  background: rgba(59, 54, 48, 0.14);
  clip-path: polygon(20% 5%, 100% 28%, 100% 94%, 0 58%);
}

.roof-shadow.is-hidden {
  display: none;
}

.roof-shadow-badge {
  position: absolute;
  right: 7.5%;
  top: 34%;
  z-index: 5;
  padding: 7px 10px;
  border: 1px solid rgba(97, 86, 72, 0.18);
  border-radius: 999px;
  color: #6b6258;
  background: rgba(255, 253, 249, 0.86);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(31, 37, 34, 0.08);
}

.roof-walkway {
  position: absolute;
  left: 8.2%;
  right: 7.2%;
  bottom: 12.8%;
  z-index: 5;
  border-top: 10px solid rgba(247, 250, 248, 0.96);
  outline: 1px dashed rgba(69, 94, 86, 0.72);
  outline-offset: -5px;
  box-shadow: 0 2px 8px rgba(16, 32, 27, 0.12);
}

.roof-walkway span {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 999px;
  color: #fff;
  background: rgba(16, 32, 27, 0.74);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(16, 32, 27, 0.18);
}

.roof-array {
  position: absolute;
  left: 9.7%;
  top: 30.8%;
  z-index: 3;
  width: 60.2%;
  height: 38.2%;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: clamp(3px, 0.52vw, 7px);
}

.pv-tile,
.facade-module {
  min-height: 0;
  border-radius: 5px;
  background: url("./assets/pv-module-texture.png") center / 100% 100% no-repeat;
  box-shadow: 0 8px 15px rgba(14, 74, 60, 0.16), inset 0 1px 0 rgba(255,255,255,0.35);
}

.pv-tile.is-active,
.facade-module.is-active {
  border: 1px solid rgba(7, 77, 62, 0.86);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(15,107,85,0.05)),
    url("./assets/pv-module-texture.png") center / 100% 100% no-repeat;
  opacity: 0.98;
}

.pv-tile.is-muted,
.facade-module.is-muted {
  border: 1px dashed rgba(15, 107, 85, 0.32);
  background: url("./assets/pv-module-texture.png") center / 100% 100% no-repeat;
  opacity: 0.24;
  filter: grayscale(0.2) saturate(0.75);
}

.facade-map-legend {
  min-width: 0;
  display: block;
}

.facade-map-legend span {
  display: block;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #e1ded5;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 253, 249, 0.82);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

.facade-map-legend i {
  display: none;
}

.facade-building {
  position: relative;
  overflow: hidden;
  width: min(100%, 560px);
  aspect-ratio: 3 / 2;
  height: auto;
  margin: 0 auto;
  border: 2px solid #bfb5a7;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,253,249,0.05), rgba(16,32,27,0.12)),
    url("./assets/facade-texture.png") center / 100% 100% no-repeat,
    linear-gradient(180deg, #f6efe4, #ddd2c2 58%, #cfc1ae);
  box-shadow: inset 0 -18px 30px rgba(84, 73, 58, 0.16);
}

.facade-building::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(255,253,249,0.2), transparent 28%, transparent 72%, rgba(16,32,27,0.08));
  pointer-events: none;
}

.facade-building::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: 72px;
  background: linear-gradient(180deg, transparent, rgba(16, 32, 27, 0.18));
  pointer-events: none;
}

.facade-window-grid {
  display: none;
  position: absolute;
  top: 42px;
  right: 32px;
  bottom: 74px;
  z-index: 3;
  width: 150px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px 11px;
  opacity: 0.92;
}

.facade-window-grid span {
  display: block;
  border: 1px solid #cfc6b8;
  border-radius: 3px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.88), rgba(225, 238, 235, 0.72)),
    #f9fbfa;
  box-shadow: inset 0 -5px 0 rgba(177, 167, 153, 0.12);
}

.facade-module-grid {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.facade-install-band {
  position: absolute;
  top: 13.6%;
  bottom: 12.4%;
  display: grid;
  grid-template-rows: repeat(7, minmax(0, 1fr));
  gap: 1.35%;
}

.facade-install-band.band-left {
  left: 25.7%;
  width: 8.1%;
}

.facade-install-band.band-right {
  left: 62.9%;
  width: 8.7%;
}

.facade-module {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 3px;
  background-size: cover;
  box-shadow: 0 7px 12px rgba(14, 74, 60, 0.12), inset 0 1px 0 rgba(255,255,255,0.24);
}

.facade-module.is-planned {
  border: 1px dashed rgba(15, 107, 85, 0.42);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.22), rgba(232,243,238,0.18)),
    url("./assets/pv-module-texture.png") center / 100% 100% no-repeat;
  opacity: 0.36;
  filter: grayscale(0.12) saturate(0.85);
}

.facade-status-chip {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 18px;
  z-index: 6;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(15, 107, 85, 0.18);
  border-radius: 999px;
  color: var(--primary-dark);
  background: rgba(232, 243, 238, 0.92);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(31, 37, 34, 0.08);
}

.facade-building.needs-capacity .facade-status-chip {
  border-color: rgba(163, 115, 38, 0.2);
  color: #7b5415;
  background: rgba(255, 247, 226, 0.94);
}

.facade-building.is-disabled .facade-status-chip {
  border-color: rgba(125, 118, 107, 0.2);
  color: #7d766b;
  background: rgba(243, 239, 232, 0.94);
}

.scene-caption {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.scene-caption strong {
  color: var(--primary-dark);
  font-size: 15px;
}

.scheme-data-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.scheme-data-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 104px;
  padding: 16px;
}

.scheme-data-card span,
.scheme-data-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.scheme-data-card strong {
  min-width: 0;
  color: var(--primary-dark);
  font-size: clamp(15px, 1.7vw, 22px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.scheme-share-bar {
  overflow: hidden;
  display: flex;
  height: 12px;
  border-radius: 999px;
  background: #e2ded4;
}

.scheme-share-bar i,
.scheme-share-bar b,
.legend-card i,
.legend-card b {
  display: block;
  height: 100%;
}

.scheme-share-bar i,
.legend-card i {
  background: #0f6b55;
}

.scheme-share-bar b {
  background: #168069;
}

.legend-card {
  gap: 7px;
}

.legend-card em {
  display: flex;
  gap: 8px;
  align-items: center;
}

.legend-card i,
.legend-card b {
  width: 16px;
  height: 10px;
  border-radius: 2px;
}

.legend-card b {
  background: #d8d4ca;
}

.scheme-diagram-note {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid #e1ded5;
  border-radius: 18px;
  background: #fffdf9;
}

.scheme-diagram-note strong {
  color: var(--text);
  font-size: 14px;
}

.scheme-diagram-note span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.timeline {
  display: grid;
  gap: 15px;
}

.stage {
  position: relative;
  border-radius: 22px;
  padding: 20px 20px 20px 22px;
}

.stage::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20px;
  bottom: 20px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), rgba(15, 107, 85, 0.18));
}

.stage h3 {
  font-size: 17px;
}

.stage p,
.stage li {
  color: var(--muted);
  line-height: 1.7;
}

.stage p {
  margin-top: 9px;
}

.stage ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.stage li + li {
  margin-top: 4px;
}

.export-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.questionnaire-guide {
  display: grid;
  gap: 16px;
  padding: 0 4px 4px;
}

.guide-intro {
  border-radius: 22px;
  padding: 20px;
  background: linear-gradient(135deg, #fff, var(--surface-tint));
}

.guide-intro h3 {
  margin-top: 12px;
  font-size: 19px;
  line-height: 1.35;
}

.guide-intro p {
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.75;
}

.dimension-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.dimension-card {
  border-radius: 20px;
  padding: 16px;
  background: #fff;
}

.dimension-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dimension-head span {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-size: 12px;
  font-weight: 800;
}

.dimension-card em {
  display: block;
  margin-top: 11px;
  color: var(--text);
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
}

.dimension-card p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.requirement-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.requirement-strip div {
  border-radius: 18px;
  padding: 15px;
  background: var(--surface-soft);
}

.requirement-strip strong,
.requirement-strip span {
  display: block;
}

.requirement-strip strong {
  font-size: 13px;
}

.requirement-strip span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.import-panel {
  border-radius: 22px;
  padding: 20px;
}

.import-copy {
  margin-bottom: 16px;
}

.import-copy h3 {
  font-size: 17px;
}

.import-copy p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.75;
}

.footer-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

/* Refined visual pass: calmer, less "AI dashboard", more consulting-workbench. */
:root {
  --bg: #f1f0ec;
  --bg-2: #f7f6f2;
  --surface: #fffdf9;
  --surface-solid: #fffdf9;
  --surface-soft: #f6f4ef;
  --surface-tint: #f2f6f1;
  --border: #dedbd2;
  --border-strong: #cbc7bc;
  --text: #16221d;
  --muted: #66706a;
  --weak: #969d98;
  --primary: #174f43;
  --primary-2: #1d6655;
  --primary-dark: #102f28;
  --primary-soft: #e8f0ec;
  --accent: #b88a3d;
  --shadow-sm: 0 10px 28px rgba(31, 37, 34, 0.055);
  --shadow-md: 0 18px 44px rgba(31, 37, 34, 0.09);
  --shadow-lg: 0 26px 70px rgba(31, 37, 34, 0.13);
}

body {
  background:
    linear-gradient(180deg, #f8f7f3 0%, #f1f0ec 48%, #eeeee9 100%);
  letter-spacing: 0;
}

body::before {
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(22, 34, 29, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 34, 29, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 62%);
}

h1,
h2,
h3 {
  letter-spacing: -0.015em;
}

.home-card {
  border-color: #e4e0d6;
  border-radius: 28px;
  background: #fffdf9;
  box-shadow: var(--shadow-lg);
  backdrop-filter: none;
}

.home-card::after {
  right: 34px;
  bottom: 34px;
  width: 84px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.62;
}

.eyebrow {
  color: var(--primary-dark);
  text-transform: none;
  letter-spacing: 0.06em;
  border-color: #d8d4ca;
  background: #f7f4ed;
}

.home h1 {
  font-size: clamp(34px, 4vw, 46px);
  font-weight: 820;
}

.button {
  border-radius: 12px;
  background: #fffdf9;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset, 0 4px 12px rgba(31, 37, 34, 0.04);
}

.button:hover {
  border-color: #b8b2a5;
  box-shadow: 0 10px 22px rgba(31, 37, 34, 0.08);
}

.button.primary {
  background: var(--primary);
  box-shadow: 0 12px 26px rgba(23, 79, 67, 0.18);
}

.button.primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 14px 30px rgba(23, 79, 67, 0.22);
}

.process {
  border-color: #e0ddd4;
  background: #faf8f2;
  box-shadow: none;
}

.process-dot {
  color: var(--primary-dark);
  background: #e5ece8;
  box-shadow: none;
}

.boundary {
  border-color: #e2d5bb;
  background: #fff9ea;
}

.topbar {
  background: #f8f7f3;
  backdrop-filter: none;
  box-shadow: 0 8px 24px rgba(31, 37, 34, 0.045);
}

.sidebar,
.summary,
.panel {
  border-color: #e1ded5;
  background: #fffdf9;
  backdrop-filter: none;
}

.step {
  border-radius: 12px;
}

.step:hover {
  background: #f3f1eb;
}

.step.active {
  color: var(--primary-dark);
  background: #edf3ef;
  box-shadow: none;
}

.step.active::before {
  background: var(--primary);
}

.step-index,
.step.active .step-index {
  box-shadow: none;
}

.step.active .step-index {
  background: var(--primary);
}

.panel::before {
  height: 3px;
  background: var(--primary);
  opacity: 0.86;
}

.badge {
  color: #53635c;
  border-color: #dcd8ce;
  background: #f6f4ef;
  font-weight: 700;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  min-height: 22px;
  border: 1px solid #ddd9ce;
  border-radius: 999px;
  padding: 2px 8px;
  color: #5f6963;
  background: #f8f6f0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.field label .source-badge {
  margin-left: auto;
  flex: 0 0 auto;
}

.source-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.72;
}

.source-manual {
  color: #4e5f58;
  background: #f7f6f1;
  border-color: #ded9cf;
}

.source-verified {
  color: #654615;
  background: #fbf4df;
  border-color: #ead8a8;
}

.source-technical {
  color: #43516b;
  background: #f1f3f7;
  border-color: #d9dde8;
}

.source-default {
  color: #665f70;
  background: #f5f2f7;
  border-color: #ddd7e4;
}

.source-optional {
  color: #6a6458;
  background: #f7f3e9;
  border-color: #e5dcc6;
}

.source-file,
.source-auto {
  color: #385f5b;
  background: #edf4f2;
  border-color: #cfddd9;
}

input,
select {
  border-color: #d5d1c7;
  background: #fffefa;
  box-shadow: none;
}

input:hover,
select:hover {
  border-color: #bdb7aa;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 79, 67, 0.11);
}

.action-card,
.action-card.primary-soft {
  border-color: #dedbd2;
  background: #fffdf9;
  box-shadow: 0 8px 22px rgba(31, 37, 34, 0.045);
}

.action-card.primary-soft {
  border-left: 4px solid var(--primary);
}

.template-card,
.import-panel,
.form-card,
.decision-card,
.guide-intro,
.dimension-card,
.requirement-strip div,
.stage,
.metric {
  border-color: #e1ded5;
  background: #fffdf9;
  box-shadow: 0 8px 20px rgba(31, 37, 34, 0.04);
}

.modal-backdrop {
  background: rgba(22, 34, 29, 0.44);
  backdrop-filter: none;
}

.modal {
  border-color: #e2ded4;
  border-radius: 24px;
  background: #fffdf9;
}

.modal-header,
.modal-footer {
  background: #fffdf9;
}

.modal-body {
  background: #f6f4ef;
}

.modal-close {
  background: #f6f4ef;
}

.modal-group-head,
.modal-group > p {
  background: #f6f4ef;
}

.readiness-summary {
  border-color: #d9d6cc;
  background: #faf8f2;
}

.progress-track,
.bar-track {
  background: #e7e3d8;
  box-shadow: none;
}

.progress-track div,
.bar-fill {
  background: var(--primary);
}

.readiness-row.is-on {
  background: #f3f8f5;
}

.readiness-row.is-on .readiness-check,
.dimension-head span {
  background: var(--primary);
}

.notice {
  border-color: #e4d5bb;
  background: #fff9ea;
}

.metric {
  background: #fffdf9;
}

.metric strong {
  color: var(--primary-dark);
}

.table {
  border-color: #dedbd2;
  background: #fffdf9;
}

.table th {
  background: #f4f2ec;
}

.stage::before {
  background: var(--primary);
}

.guide-intro {
  background: #faf8f2;
}

@media (max-width: 1320px) {
  .workspace {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  }

  .summary {
    grid-column: 1 / -1;
    position: static;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .scheme-data-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .perception-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1040px) {
  .home-card,
  .workspace,
  .grid,
  .governance-layout,
  .questionnaire-toolkit,
  .dimension-grid,
  .requirement-strip {
    grid-template-columns: 1fr;
  }

  .panel-header {
    display: grid;
  }

  .home-card {
    padding: 34px;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .summary {
    position: static;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scheme-layout {
    grid-template-columns: 1fr;
  }

  .perception-layout {
    grid-template-columns: 1fr;
  }

  .monthly-factor-grid,
  .monthly-stat-grid,
  .monthly-factor-pills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scheme-data-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .readiness-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .readiness-impact {
    grid-column: 2;
    text-align: left;
  }

  .action-card {
    display: grid;
  }

  .action-card-side {
    justify-items: start;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 13px;
  }

  .topbar {
    position: static;
    display: grid;
    height: auto;
    padding: 16px;
  }

  .workspace,
  .home {
    padding: 14px;
  }

  .home-card,
  .panel,
  .summary,
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 18px;
  }

  .home-card,
  .panel,
  .summary,
  .sidebar {
    border-radius: 22px;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .bar-row,
  .scheme-data-grid,
  .monthly-stat-grid,
  .monthly-factor-grid,
  .monthly-factor-pills,
  .perception-grid,
  .simulator-grid {
    grid-template-columns: 1fr;
  }

  .scheme-board {
    padding: 12px;
    border-radius: 22px;
  }

  .scheme-titlebar,
  .scene-caption,
  .monthly-head,
  .result-accordion-head,
  .monthly-factor-strip > div:first-child {
    display: grid;
  }

  .scheme-scene-card {
    padding: 14px;
    border-radius: 20px;
  }

  .roof-array {
    left: 9.6%;
    top: 31%;
    width: 60.4%;
    height: 38%;
    grid-template-columns: repeat(9, minmax(0, 1fr));
  }

  .facade-building {
    width: 100%;
    aspect-ratio: 3 / 2;
  }

  .facade-install-band {
    top: 13.8%;
    bottom: 12.6%;
  }

  .facade-install-band.band-left {
    width: 8.1%;
  }

  .facade-install-band.band-right {
    width: 8.7%;
  }

  .bar-row strong {
    text-align: left;
  }

  .readiness-summary div:first-child,
  .readiness-title {
    display: grid;
  }

  .modal-backdrop {
    padding: 12px;
  }
}

/* Mobile-only adaptation. Keeps desktop/tablet styles untouched. */
@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .shell {
    display: block;
    min-width: 0;
  }

  .topbar {
    gap: 12px;
  }

  .topbar .actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .topbar .button,
  .actions .button {
    width: 100%;
    min-width: 0;
    padding-inline: 12px;
  }

  .workspace {
    width: 100%;
    max-width: 100%;
    gap: 14px;
  }

  .panel,
  .summary,
  .sidebar,
  .perception-card,
  .result-accordion,
  .scheme-board,
  .form-card,
  .decision-card,
  .template-card,
  .import-panel,
  .guide-intro,
  .dimension-card,
  .stage {
    max-width: 100%;
  }

  .panel-header,
  .action-card,
  .readiness-summary div:first-child,
  .scheme-titlebar,
  .monthly-head,
  .result-accordion-head {
    gap: 10px;
  }

  .panel-title h2 {
    font-size: 20px;
  }

  .panel-title p,
  .subtitle,
  .perception-heading span,
  .perception-note,
  .simulator-field > span,
  .action-card p,
  .stage p,
  .stage li {
    font-size: 12.5px;
    line-height: 1.7;
  }

  .sidebar .step {
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 10px;
  }

  .step-index {
    width: 28px;
    height: 28px;
  }

  .grid,
  .governance-layout,
  .questionnaire-toolkit,
  .dimension-grid,
  .requirement-strip,
  .metric-grid,
  .monthly-stat-grid,
  .monthly-factor-grid,
  .scheme-data-grid,
  .perception-layout,
  .perception-grid,
  .simulator-grid {
    min-width: 0;
  }

  .field,
  .simulator-field,
  .simulator-toggle,
  .monthly-stat-grid div,
  .scheme-data-card,
  .metric,
  .perception-metric {
    min-width: 0;
  }

  .field label,
  .simulator-field label,
  .readiness-title,
  .monthly-factor-strip > div:first-child {
    min-width: 0;
    flex-wrap: wrap;
    white-space: normal;
  }

  .field label .source-badge,
  .simulator-field label .source-badge {
    margin-left: 0;
  }

  input,
  select {
    min-width: 0;
    font-size: 16px;
  }

  .metric strong,
  .scheme-data-card strong,
  .summary-line strong,
  .monthly-stat-grid strong,
  .perception-metric strong {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
  }

  .perception-card {
    height: auto;
    padding: 18px;
  }

  .perception-metric.has-image {
    min-height: 190px;
    padding-bottom: 96px;
  }

  .perception-metric.has-image::before {
    height: 76px;
  }

  .perception-card:last-child .compact-after {
    grid-template-columns: 1fr;
  }

  .perception-card:last-child .compact-after .perception-metric span {
    white-space: normal;
  }

  .simulator-grid .simulator-field:first-child,
  .simulator-grid .simulator-toggle,
  .simulator-grid .simulator-field:nth-child(2),
  .simulator-grid .simulator-field:nth-child(3) {
    grid-column: 1;
    grid-row: auto;
  }

  .simulator-toggle {
    align-items: flex-start;
  }

  .simulator-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .simulator-actions .button {
    justify-self: stretch;
  }

  .summary-line {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .summary-line strong {
    text-align: left;
  }

  .readiness-row {
    padding: 13px 14px;
  }

  .readiness-impact {
    grid-column: 1 / -1;
  }

  .bar-row {
    gap: 7px;
  }

  .table,
  .monthly-table {
    min-width: 620px;
  }

  .monthly-table-wrap,
  .table-wrap,
  .result-accordion-body {
    max-width: 100%;
  }

  .monthly-table-wrap,
  .modal-body,
  .result-accordion-body {
    overflow-x: auto;
  }

  .scheme-board {
    overflow: hidden;
  }

  .scheme-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .scheme-titlebar em {
    width: fit-content;
  }

  .roof-surface {
    min-height: 220px;
  }

  .roof-equipment,
  .roof-shadow-badge,
  .roof-walkway span,
  .facade-status-chip,
  .scheme-titlebar em {
    font-size: 10.5px;
  }

  .modal {
    width: 100%;
    max-height: calc(100vh - 24px);
    border-radius: 20px;
  }

  .modal-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .modal-header h2 {
    font-size: 19px;
  }

  .modal-group-head {
    display: grid;
  }
}

@media (max-width: 420px) {
  .workspace,
  .home {
    padding: 10px;
  }

  .panel,
  .summary,
  .modal-header,
  .modal-body,
  .modal-footer,
  .perception-card {
    padding: 14px;
  }

  .topbar {
    padding: 12px;
  }

  .topbar .actions {
    grid-template-columns: 1fr;
  }

  .home-card {
    padding: 22px;
  }

  .home h1 {
    font-size: 28px;
  }

  .metric-grid,
  .monthly-stat-grid,
  .monthly-factor-grid,
  .monthly-factor-pills,
  .scheme-data-grid {
    grid-template-columns: 1fr;
  }

  .perception-metric strong {
    font-size: 28px;
  }

  .roof-surface {
    min-height: 190px;
  }
}

/* Workbench-style homepage: closer to a web app portal than a presentation cover. */
.home.workbench-home {
  display: block;
  min-height: 100vh;
  padding: 18px 20px 44px;
}

.home-topbar,
.home-workbench,
.home-modules {
  width: min(1180px, 100%);
  margin-inline: auto;
}

.home-topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 14px;
  border: 1px solid #dfdbd2;
  border-radius: 18px;
  background: #fffdf9;
  box-shadow: 0 6px 18px rgba(31, 37, 34, 0.04);
}

.home-product {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-product-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: #fffdf9;
  background: var(--primary);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.home-product strong,
.home-product em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-product strong {
  font-size: 15px;
  line-height: 1.25;
}

.home-product em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.home-top-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.home-top-tags span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #e2ded4;
  border-radius: 999px;
  padding: 5px 10px;
  color: #5d6862;
  background: #f8f6f0;
  font-size: 12px;
  font-weight: 700;
}

.home-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
  gap: 16px;
  margin-top: 16px;
}

.home-start-card,
.home-side-card,
.home-module-card {
  border: 1px solid #dfdbd2;
  border-radius: 20px;
  background: #fffdf9;
  box-shadow: 0 8px 22px rgba(31, 37, 34, 0.045);
}

.home-start-card {
  min-width: 0;
  padding: 28px;
}

.home-section-label {
  width: fit-content;
  border: 1px solid #dcd8ce;
  border-radius: 999px;
  padding: 5px 10px;
  color: #53635c;
  background: #f6f4ef;
  font-size: 12px;
  font-weight: 760;
}

.home-start-card h1 {
  max-width: 720px;
  margin-top: 18px;
  font-size: clamp(26px, 3.5vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.home-start-card .subtitle {
  max-width: 760px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.home-entry-actions {
  margin-top: 24px;
}

.home-entry-actions .button {
  min-height: 44px;
  border-radius: 12px;
  font-weight: 760;
}

.home-safe-note {
  margin-top: 22px;
  padding: 13px 14px;
  border: 1px solid #e4d5bb;
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  color: #6d4216;
  background: #fff9ea;
  font-size: 12.5px;
  line-height: 1.7;
}

.home-side {
  min-width: 0;
  display: grid;
  gap: 12px;
  align-content: start;
}

.home-side-card {
  padding: 16px;
}

.home-side-card.compact {
  padding-bottom: 14px;
}

.home-side-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px solid #ebe6dc;
}

.home-side-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.home-side-head strong {
  color: var(--primary-dark);
  font-size: 14px;
}

.home-flow-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.home-flow-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 8px;
  border: 1px solid #ebe6dc;
  border-radius: 12px;
  background: #faf8f2;
}

.home-flow-item span {
  color: var(--weak);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.home-flow-item strong {
  color: var(--text);
  font-size: 13px;
}

.home-output-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.home-output-list span {
  border: 1px solid #dfdbd2;
  border-radius: 999px;
  padding: 6px 9px;
  color: #5d6862;
  background: #faf8f2;
  font-size: 12px;
  font-weight: 700;
}

.home-modules {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.home-module-card {
  min-width: 0;
  padding: 16px;
}

.home-module-card > span {
  display: block;
  color: var(--weak);
  font-size: 12px;
  font-weight: 850;
}

.home-module-card strong {
  display: block;
  margin-top: 10px;
  color: var(--primary-dark);
  font-size: 15px;
}

.home-module-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

@media (max-width: 1040px) {
  .home-workbench {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .home.workbench-home {
    padding: 10px 10px 28px;
  }

  .home-topbar {
    display: grid;
    gap: 10px;
    padding: 10px;
    border-radius: 16px;
  }

  .home-top-tags {
    justify-content: flex-start;
  }

  .home-start-card,
  .home-side-card,
  .home-module-card {
    border-radius: 16px;
  }

  .home-start-card {
    padding: 18px;
  }

  .home-start-card h1 {
    font-size: 26px;
  }

  .home-start-card .subtitle {
    font-size: 13px;
    line-height: 1.75;
  }

  .home-entry-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .home-entry-actions .button {
    width: 100%;
    min-height: 48px;
  }

  .home-modules {
    grid-template-columns: 1fr;
  }

  .workspace .sidebar {
    position: sticky;
    top: 0;
    z-index: 9;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px;
    border-radius: 16px;
    scroll-snap-type: x proximity;
  }

  .workspace .sidebar::-webkit-scrollbar {
    display: none;
  }

  .workspace .sidebar .step {
    flex: 0 0 auto;
    width: auto;
    min-width: 138px;
    grid-template-columns: 28px max-content;
    scroll-snap-align: start;
  }

  .workspace .sidebar .step span:last-child {
    white-space: nowrap;
  }
}

@media (max-width: 420px) {
  .home-product strong {
    font-size: 14px;
  }

  .home-product em {
    white-space: normal;
  }

  .home-start-card {
    padding: 16px;
  }

  .home-start-card h1 {
    font-size: 24px;
  }

  .home-side-head {
    display: grid;
    gap: 2px;
  }

  .workspace .sidebar .step {
    min-width: 126px;
  }
}

/* Mobile workbench overhaul: replace desktop side rails with phone-first controls. */
.mobile-workspace-bar,
.mobile-summary-card,
.mobile-step-footer {
  display: none;
}

@media (max-width: 720px) {
  .shell {
    display: block;
    padding-bottom: 76px;
  }

  .shell .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    min-height: 56px;
    gap: 10px;
    padding: 9px 10px;
    border-bottom: 1px solid #e2ded4;
    background: rgba(255, 253, 249, 0.96);
    box-shadow: 0 8px 18px rgba(31, 37, 34, 0.055);
  }

  .shell .brand {
    flex: 1 1 auto;
  }

  .shell .brand strong {
    font-size: 14px;
  }

  .shell .brand span {
    max-width: 54vw;
  }

  .shell .topbar .actions {
    width: auto;
    display: flex;
    flex: 0 0 auto;
  }

  .shell .topbar .button {
    width: auto;
    min-height: 36px;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 12px;
  }

  .workspace {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 10px;
  }

  .desktop-sidebar,
  .desktop-summary {
    display: none !important;
  }

  .mobile-workspace-bar {
    position: sticky;
    top: 56px;
    z-index: 35;
    display: block;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #dfdbd2;
    border-radius: 16px;
    background: rgba(255, 253, 249, 0.96);
    box-shadow: 0 8px 18px rgba(31, 37, 34, 0.045);
  }

  .mobile-step-head {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 10px;
    align-items: center;
  }

  .mobile-step-head span,
  .mobile-summary-head span,
  .mobile-summary-grid span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
  }

  .mobile-step-head strong {
    display: block;
    margin-top: 2px;
    color: var(--primary-dark);
    font-size: 13px;
  }

  .mobile-step-select {
    min-height: 42px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 760;
  }

  .mobile-step-progress {
    height: 5px;
    overflow: hidden;
    margin-top: 9px;
    border-radius: 999px;
    background: #e7e3d8;
  }

  .mobile-step-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
  }

  .mobile-summary-card {
    display: block;
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid #dfdbd2;
    border-radius: 16px;
    background: #fffdf9;
    box-shadow: 0 8px 18px rgba(31, 37, 34, 0.04);
  }

  .mobile-summary-card.has-risk {
    border-color: #e1c7c2;
    background: #fff8f6;
  }

  .mobile-summary-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
  }

  .mobile-summary-head strong {
    color: var(--primary-dark);
    font-size: 12px;
  }

  .mobile-summary-card.has-risk .mobile-summary-head strong {
    color: var(--danger);
  }

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

  .mobile-summary-grid div {
    min-width: 0;
    padding: 9px;
    border: 1px solid #ebe6dc;
    border-radius: 12px;
    background: #faf8f2;
  }

  .mobile-summary-grid strong,
  .mobile-summary-grid em {
    display: block;
  }

  .mobile-summary-grid strong {
    margin-top: 3px;
    color: var(--primary-dark);
    font-size: 15px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .mobile-summary-grid em {
    margin-top: 2px;
    color: var(--weak);
    font-size: 10px;
    font-style: normal;
  }

  .mobile-summary-error {
    margin-top: 10px;
    color: var(--danger);
    font-size: 12px;
    line-height: 1.6;
  }

  .content {
    width: 100%;
  }

  .panel {
    padding: 16px;
    border-radius: 18px;
    box-shadow: 0 6px 16px rgba(31, 37, 34, 0.04);
  }

  .panel + .panel {
    margin-top: 10px;
  }

  .panel::before {
    height: 2px;
  }

  .panel-header {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
  }

  .panel-title h2 {
    font-size: 20px;
    line-height: 1.28;
  }

  .panel-title p {
    margin-top: 7px;
    font-size: 12.5px;
    line-height: 1.7;
  }

  .grid,
  .governance-layout,
  .questionnaire-toolkit,
  .dimension-grid,
  .requirement-strip,
  .metric-grid,
  .monthly-stat-grid,
  .monthly-factor-grid,
  .monthly-factor-pills,
  .scheme-data-grid,
  .perception-layout,
  .perception-grid,
  .simulator-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .field {
    gap: 7px;
  }

  .field label {
    align-items: flex-start;
    min-height: 0;
    font-size: 12.5px;
    line-height: 1.45;
  }

  .field label .source-badge {
    margin-left: 0;
  }

  input,
  select {
    min-height: 48px;
    border-radius: 12px;
    font-size: 16px;
  }

  input[type="checkbox"] {
    min-height: auto;
  }

  input[type="file"] {
    min-height: 48px;
    font-size: 13px;
  }

  .action-card,
  .action-card.primary-soft,
  .template-card,
  .import-panel,
  .form-card,
  .decision-card,
  .guide-intro,
  .dimension-card,
  .stage,
  .metric {
    padding: 15px;
    border-radius: 16px;
  }

  .action-card {
    display: grid;
    gap: 12px;
  }

  .action-card-side {
    width: 100%;
    justify-items: stretch;
  }

  .action-card-side .button,
  .export-actions .button {
    width: 100%;
  }

  .export-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .readiness-row,
  .confirmation-row {
    grid-template-columns: 26px minmax(0, 1fr) !important;
    min-height: auto;
    padding: 13px;
    border-radius: 14px;
  }

  .readiness-impact {
    grid-column: 1 / -1;
    text-align: left;
  }

  .readiness-title {
    grid-template-columns: 1fr;
  }

  .summary-line {
    grid-template-columns: 1fr;
  }

  .summary-line strong {
    text-align: left;
  }

  .table,
  .monthly-table {
    min-width: 640px;
  }

  .table-wrap,
  .monthly-table-wrap,
  .result-accordion-body,
  .modal-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 14px;
  }

  .modal-header h2 {
    font-size: 18px;
  }

  .modal-footer {
    position: sticky;
    bottom: 0;
  }

  .modal-footer .button {
    width: 100%;
  }

  .mobile-step-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
    border-top: 1px solid #dfdbd2;
    background: rgba(255, 253, 249, 0.97);
    box-shadow: 0 -10px 24px rgba(31, 37, 34, 0.1);
  }

  .mobile-step-footer .button {
    min-width: 0;
    min-height: 44px;
    padding: 9px 8px;
    border-radius: 12px;
    overflow: hidden;
    font-size: 12px;
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 420px) {
  .mobile-summary-grid {
    gap: 6px;
  }

  .mobile-summary-grid div {
    padding: 8px 6px;
  }

  .mobile-summary-grid strong {
    font-size: 13px;
  }

  .mobile-step-head {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 14px;
  }
}

/* Dialog stability on mobile: lock the page behind the modal and stop scroll chaining. */
body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.modal-backdrop {
  overscroll-behavior: contain;
  touch-action: none;
}

.modal {
  overscroll-behavior: contain;
  touch-action: auto;
}

.modal-body {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.resident-simulator-result {
  scroll-margin: 140px;
  outline: 0;
}
