:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-2: #eef2ed;
  --text: #1f2a24;
  --muted: #647067;
  --line: #d9e0d7;
  --green: #1f8a5b;
  --blue: #2f6fbd;
  --amber: #d58a1f;
  --red: #c44e42;
  --shadow: 0 18px 45px rgba(33, 47, 39, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
  border: 0;
  cursor: pointer;
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  background: #17251f;
  color: #f4faf6;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: #e0f1df;
  color: #183d2b;
  border-radius: 8px;
  font-weight: 800;
}

.brand h1,
.brand p,
h2,
h3,
p {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
}

.brand p,
.eyebrow,
.panel-title,
small {
  color: var(--muted);
}

.sidebar .brand p,
.sidebar .panel-title {
  color: #aab9af;
}

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

.nav-heading {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: #f4faf6;
  font-weight: 700;
}

.nav-item {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  color: #dce9df;
  background: transparent;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  background: #284236;
}

.nav-primary {
  font-size: 16px;
}

.nav-subitem {
  min-height: 38px;
  margin-left: 16px;
  padding-left: 18px;
  color: #edf7ef;
  font-size: 15px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(31, 42, 36, 0.06);
}

.sidebar .panel {
  background: #20342b;
  border-color: #355446;
}

.compact {
  box-shadow: none;
}

.compact > strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.project-select {
  width: 100%;
  min-height: 36px;
  margin-top: 12px;
  border: 1px solid #456a58;
  border-radius: 8px;
  padding: 0 10px;
  background: #182820;
  color: #f4faf6;
  font: inherit;
}

.project-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.project-action-button {
  min-height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #f4faf6;
  font-size: 18px;
  font-weight: 800;
}

.project-action-button:hover,
.project-action-button:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

.project-action-button.danger {
  color: #ffd8d2;
}

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

.meta-list div {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px;
}

.meta-list dt {
  color: #aab9af;
  font-size: 12px;
}

.meta-list dd {
  margin: 4px 0 0;
  font-weight: 700;
}

.workspace {
  min-width: 0;
  padding: 24px;
  display: grid;
  gap: 18px;
}

.topbar,
.section-head,
.actions,
.legend,
.score-bars div {
  display: flex;
  align-items: center;
}

.topbar,
.section-head {
  justify-content: space-between;
  gap: 16px;
}

.eyebrow,
.panel-title {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
}

h2 {
  font-size: 28px;
}

h3 {
  font-size: 17px;
}

.actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-button,
.primary-button,
.ghost-button,
.support-action-button,
.segmented button,
.export-grid button {
  min-height: 38px;
  border-radius: 8px;
}

.icon-button {
  width: 38px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.upload-control {
  display: inline-grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.upload-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.primary-button {
  padding: 0 18px;
  background: var(--green);
  color: white;
  font-weight: 700;
}

.ghost-button {
  padding: 0 14px;
  background: var(--surface-2);
  color: var(--text);
}

.support-action-button {
  padding: 0 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.support-action-button:hover,
.support-action-button:focus-visible {
  background: #edf5ef;
  outline: none;
}

.ghost-button.small {
  min-height: 32px;
  font-size: 13px;
}

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

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

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

.kpi strong {
  display: block;
  font-size: 30px;
  margin: 8px 0 4px;
}

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

.map-surface {
  min-height: 560px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
}

.map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.map-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.segmented {
  display: inline-flex;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 8px;
  gap: 3px;
}

.segmented button {
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
}

.segmented .selected {
  background: white;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.map-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 4px;
  border-radius: 8px;
  background: var(--surface-2);
}

.map-icon-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: white;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.map-zoom-slider {
  width: clamp(96px, 12vw, 150px);
  accent-color: var(--green);
}

.map-zoom-value {
  min-width: 42px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.map-display-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
}

.map-toggle {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.map-toggle input {
  accent-color: var(--green);
}

.map-style-field {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.map-style-field input[type="range"] {
  width: 88px;
  accent-color: var(--green);
}

.map-style-field input[type="color"] {
  width: 34px;
  height: 28px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.district-map {
  position: relative;
  overflow: hidden;
  min-height: 440px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(47, 111, 189, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(47, 111, 189, 0.08) 1px, transparent 1px),
    #e7ece7;
  background-size: 44px 44px;
}

.empty-map {
  display: grid;
  place-items: center;
  background: #f7faf7;
  border: 1px dashed var(--line);
  text-align: center;
}

.empty-map > div {
  display: grid;
  justify-items: center;
  gap: 10px;
  max-width: 280px;
}

.empty-map strong {
  font-size: 18px;
}

.empty-map p,
.empty-state {
  color: var(--muted);
}

.empty-state {
  margin: 0;
  font-weight: 700;
}

.schematic-district-map,
.real-district-map {
  cursor: grab;
  touch-action: none;
}

.schematic-map-viewport {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  transition: transform 80ms ease-out;
}

.real-district-map {
  display: grid;
  background:
    linear-gradient(90deg, rgba(47, 111, 189, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(47, 111, 189, 0.08) 1px, transparent 1px),
    #e7ece7;
  background-size: 44px 44px;
}

.satellite-district-map {
  background: #18211d;
}

.real-map-canvas {
  position: absolute;
  inset: 0;
  min-height: 100%;
}

.real-map-canvas .ol-viewport {
  border-radius: 8px;
}

.map-provider {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  border-radius: 6px;
  background: rgba(14, 24, 20, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
}

.map-error {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(231, 236, 231, 0.88);
  color: #8d332c;
  font-weight: 800;
  padding: 24px;
  text-align: center;
}

.schematic-district-map.is-panning,
.real-district-map.is-panning {
  cursor: grabbing;
}

.real-map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.real-parcel {
  cursor: pointer;
  fill-rule: evenodd;
  fill-opacity: var(--real-fill-opacity, 0.82);
  stroke: var(--real-boundary-color, rgba(255, 255, 255, 0.92));
  stroke-opacity: var(--real-boundary-opacity, 1);
  stroke-width: 2.4;
  pointer-events: all;
  vector-effect: non-scaling-stroke;
  transition:
    fill-opacity 160ms ease,
    filter 160ms ease,
    stroke-width 160ms ease,
    stroke 160ms ease;
}

.real-parcel-outline {
  fill: transparent;
  pointer-events: none;
  stroke: var(--real-outer-border-color, #1f2a24);
  stroke-linejoin: round;
  stroke-opacity: 0.7;
  stroke-width: var(--real-outer-border-width, 3);
  vector-effect: non-scaling-stroke;
}

.real-parcel.high {
  fill: var(--green);
}

.real-parcel.mid-high {
  fill: var(--blue);
}

.real-parcel.mid {
  fill: var(--amber);
}

.real-parcel.low {
  fill: var(--red);
}

.real-parcel.pending {
  fill: #8a948e;
  stroke-dasharray: 6 5;
}

.real-parcel:hover,
.real-parcel:focus-visible {
  filter: brightness(1.08);
  outline: none;
}

.real-parcel.selected-parcel {
  stroke: #1f2a24;
  stroke-width: 5;
  filter: drop-shadow(0 8px 12px rgba(31, 42, 36, 0.26));
  z-index: 4;
}

.real-parcel-outline.selected-parcel {
  stroke: var(--real-outer-border-color, #1f2a24);
  stroke-opacity: 1;
}

.real-parcel-label {
  fill: #fff;
  font-size: 15px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(31, 42, 36, 0.58);
  stroke-width: 3px;
  vector-effect: non-scaling-stroke;
}

.real-score-label {
  font-size: 13px;
}

.road {
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(110, 121, 113, 0.12);
}

.road-a {
  width: 130%;
  height: 34px;
  left: -10%;
  top: 44%;
  transform: rotate(-9deg);
}

.road-b {
  width: 30px;
  height: 120%;
  left: 58%;
  top: -10%;
  transform: rotate(12deg);
}

.road-c {
  width: 120%;
  height: 22px;
  left: -5%;
  top: 70%;
  transform: rotate(4deg);
}

.parcel {
  position: absolute;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  overflow: hidden;
  border: 2px solid var(--schematic-boundary-color, rgba(255, 255, 255, 0.85));
  background: transparent;
  color: white;
  font-weight: 800;
  box-shadow:
    0 0 0 var(--schematic-outer-border-width, 0) var(--schematic-outer-border-color, transparent),
    0 10px 22px rgba(31, 42, 36, 0.18);
  transition:
    filter 160ms ease,
    outline-color 160ms ease,
    transform 160ms ease;
}

.parcel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--parcel-fill, var(--green));
  opacity: var(--schematic-fill-opacity, 0.82);
}

.parcel span,
.parcel small {
  position: relative;
  z-index: 1;
  line-height: 1.05;
}

.parcel small {
  font-size: 10px;
  font-weight: 900;
}

.parcel:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.selected-parcel {
  outline: 4px solid rgba(31, 42, 36, 0.42);
  outline-offset: 2px;
  z-index: 4;
}

.p1 {
  width: 21%;
  height: 24%;
  left: 8%;
  top: 12%;
  clip-path: polygon(0 12%, 84% 0, 100% 76%, 28% 100%);
}

.p2 {
  width: 22%;
  height: 22%;
  left: 34%;
  top: 12%;
  clip-path: polygon(6% 0, 100% 12%, 82% 100%, 0 88%);
}

.p3 {
  width: 24%;
  height: 25%;
  left: 65%;
  top: 11%;
  clip-path: polygon(0 8%, 86% 0, 100% 100%, 12% 82%);
}

.p4 {
  width: 24%;
  height: 24%;
  left: 12%;
  top: 48%;
  clip-path: polygon(0 8%, 90% 0, 100% 82%, 24% 100%);
}

.p5 {
  width: 19%;
  height: 22%;
  left: 42%;
  top: 50%;
  clip-path: polygon(12% 0, 100% 14%, 78% 100%, 0 86%);
}

.p6 {
  width: 24%;
  height: 28%;
  left: 67%;
  top: 48%;
  clip-path: polygon(0 0, 100% 18%, 80% 100%, 10% 78%);
}

.p7 {
  width: 24%;
  height: 15%;
  left: 26%;
  top: 80%;
  clip-path: polygon(0 14%, 100% 0, 90% 100%, 8% 86%);
}

.high,
.badge.high {
  background: var(--green);
}

.mid-high {
  background: var(--blue);
}

.mid {
  background: var(--amber);
}

.low {
  background: var(--red);
}

.pending,
.badge.pending {
  background: #7f8a84;
}

.schematic-district-map .parcel.high {
  --parcel-fill: var(--green);
  background: transparent;
}

.schematic-district-map .parcel.mid-high {
  --parcel-fill: var(--blue);
  background: transparent;
}

.schematic-district-map .parcel.mid {
  --parcel-fill: var(--amber);
  background: transparent;
}

.schematic-district-map .parcel.low {
  --parcel-fill: var(--red);
  background: transparent;
}

.schematic-district-map .parcel.pending {
  --parcel-fill: #7f8a84;
  background: transparent;
}

.map-scale {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: 86px;
  border-bottom: 4px solid #25342d;
  padding-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
}

.legend {
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}

.right-stack {
  display: grid;
  gap: 18px;
  align-content: start;
}

.right-stack .ai-list {
  max-height: clamp(260px, 42vh, 430px);
  overflow-y: auto;
  padding-right: 4px;
}

.right-stack .ai-list::-webkit-scrollbar {
  width: 8px;
}

.right-stack .ai-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c9d3cc;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: white;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.score-ring {
  width: 172px;
  height: 172px;
  margin: 18px auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--green) calc(var(--score) * 1%), #e5ebe5 0);
}

.score-ring.pending {
  background: conic-gradient(#7f8a84 calc(var(--score) * 1%), #e5ebe5 0);
}

.score-ring > div {
  width: 126px;
  height: 126px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  background: white;
}

.score-ring strong {
  font-size: 32px;
}

.score-ring.pending strong {
  font-size: 22px;
}

.score-ring span,
.score-bars span,
.ai-item p {
  color: var(--muted);
  font-size: 13px;
}

.score-bars {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.score-bars div {
  display: grid;
  grid-template-columns: 56px 1fr 44px;
  gap: 10px;
}

meter {
  width: 100%;
}

.ai-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.ai-item {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ai-item.confirmed {
  background: #eef7f1;
  border-color: #b9dac6;
}

.ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ai-actions button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.ai-actions button:first-child:not(:disabled) {
  background: var(--green);
  color: white;
}

.photo-swatch {
  width: 58px;
  height: 48px;
  border-radius: 8px;
  background-size: cover;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.facade {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.5) 23% 27%, transparent 27% 52%, rgba(255, 255, 255, 0.42) 52% 57%, transparent 57%),
    linear-gradient(180deg, #d7ddd8 0 18%, #7e8d87 18% 42%, #c1cac6 42% 63%, #687872 63% 100%);
}

.street {
  background:
    radial-gradient(circle at 20% 18%, #3d8a58 0 18%, transparent 19%),
    linear-gradient(140deg, #8cb69b 0 45%, #4e5961 46% 100%);
}

.height {
  background:
    linear-gradient(90deg, #65727c 0 17%, #a9b5bd 17% 26%, #65727c 26% 42%, #bac4c8 42% 53%, #65727c 53% 71%, #a9b5bd 71% 82%, #65727c 82%),
    linear-gradient(#ced6d8, #6c7880);
}

.policy {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.38) 0 22%, transparent 22%),
    linear-gradient(160deg, #244f88, #2f7d6d 58%, #e0a742);
}

.ai-score-grid {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.ai-score-row {
  display: grid;
  grid-template-columns: 54px minmax(90px, 1fr) 48px;
  gap: 8px;
  align-items: center;
}

.ai-score-row b,
.ai-score-row strong {
  font-size: 12px;
}

.ai-score-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.ai-score-row meter {
  height: 8px;
}

.ai-analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.ai-analysis-panel, .ai-recognition-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  box-shadow: none;
}

.ai-analysis-panel .section-head,
.ai-recognition-panel .section-head {
  min-width: 0;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf1ed;
}

.ai-analysis-panel h3,
.ai-recognition-panel h3 {
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.ai-insight-list,
.ai-profile-list,
.ai-missing-list {
  display: grid;
  gap: 10px;
}

.ai-scroll-region {
  max-height: clamp(320px, 46vh, 540px);
  min-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 6px 2px 0;
  scrollbar-gutter: stable;
}

.ai-analysis-panel .ai-scroll-region {
  max-height: clamp(280px, 38vh, 460px);
}

.ai-scroll-region::-webkit-scrollbar {
  width: 8px;
}

.ai-scroll-region::-webkit-scrollbar-track {
  background: #edf2ee;
  border-radius: 999px;
}

.ai-scroll-region::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #b9c7bf;
}

.ai-scroll-region::-webkit-scrollbar-thumb:hover {
  background: #9fb1a7;
}

.ai-scroll-region > .empty-state {
  align-self: center;
  justify-self: center;
  padding: 28px 12px;
  text-align: center;
}

.ai-insight,
.ai-profile,
.ai-missing {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e1e8df;
  border-radius: 8px;
  background: #fbfcfb;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.ai-insight:hover,
.ai-profile:hover,
.ai-missing:hover {
  border-color: #c7d8cd;
  background: #ffffff;
}

.ai-insight span,
.ai-profile span,
.ai-missing span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ai-insight p,
.ai-profile p,
.ai-missing p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}

.ai-profile > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ai-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ai-tags b {
  color: var(--muted);
  font-size: 12px;
}

.ai-tags span {
  padding: 4px 7px;
  border-radius: 8px;
  background: #eef4f7;
  color: #244f88;
  font-weight: 700;
}

.ai-evidence {
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #d8e4ef;
  border-radius: 8px;
  background: #f3f7fb;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ai-evidence b {
  margin-right: 8px;
  color: var(--blue);
}

.ai-missing.high {
  border-color: rgba(187, 79, 61, 0.34);
  background: #fff6f3;
}

.ai-missing.medium {
  border-color: rgba(224, 167, 66, 0.34);
  background: #fffaf0;
}

.ai-missing.low {
  border-color: rgba(47, 125, 109, 0.28);
  background: #f4fbf8;
}

.bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 18px;
}

.module-grid {
  display: grid;
  gap: 18px;
}

.overview-grid {
  grid-template-columns: minmax(520px, 1fr) 360px;
  align-items: start;
}

.two-col {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
}

.wide-left {
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, 0.6fr);
}

.upload-drop {
  display: grid;
  gap: 16px;
}

.drop-zone {
  min-height: 180px;
  border: 1px dashed #8fac9c;
  border-radius: 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  background: #f6faf7;
  cursor: pointer;
  text-align: center;
}

.drop-zone input {
  display: none;
}

.drop-zone strong {
  font-size: 18px;
}

.drop-zone span,
.file-row span,
.file-row b {
  color: var(--muted);
  font-size: 13px;
}

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

.form-grid.single {
  grid-template-columns: 1fr;
  margin-top: 16px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-grid input,
.form-grid select,
.weight-input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: white;
  color: var(--text);
  font: inherit;
}

.file-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 80px 90px 74px 32px;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.file-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row b {
  color: var(--green);
}

.file-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3a3;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.file-remove:hover {
  background: rgba(199, 74, 63, 0.12);
  color: #c74a3f;
  border-color: rgba(199, 74, 63, 0.3);
}

.file-remove:focus-visible {
  outline: 2px solid #2f6fbd;
  outline-offset: 2px;
}

.table-action {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: #f4e8e6;
  color: #9b332a;
  font-size: 12px;
  font-weight: 700;
}

.indicator-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.indicator-editor {
  display: grid;
  gap: 14px;
}

.batch-paste {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.batch-paste textarea {
  width: 100%;
  min-height: 142px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: white;
  color: var(--text);
  font: inherit;
  line-height: 1.5;
}

.indicator-select-cell {
  width: 42px;
  text-align: center;
}

.indicator-select-cell input {
  width: 16px;
  height: 16px;
}

.indicator-name-cell {
  display: grid;
  gap: 5px;
}

.source-chip {
  width: max-content;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef3f8;
  color: #244f88;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
}

.danger-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  background: #f4e8e6;
  color: #9b332a;
  font-weight: 700;
}

.warning-text {
  color: var(--red);
}

.ahp-page {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.ahp-side-rail {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.ahp-workspace {
  display: grid;
  gap: 18px;
}

.ahp-hierarchy-panel {
  padding: 14px;
}

.ahp-tree {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.ahp-goal {
  min-height: 50px;
  display: grid;
  align-content: center;
  gap: 4px;
  border-radius: 8px;
  padding: 10px 12px;
  background: #edf5f0;
  border: 1px solid #cfe1d5;
  color: #183d2b;
}

.ahp-goal span {
  color: #557066;
  font-size: 12px;
  font-weight: 700;
}

.ahp-goal strong {
  font-weight: 800;
}

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

.ahp-layer-card {
  min-width: 0;
  border: 1px solid #d7e2da;
  border-radius: 8px;
  padding: 0;
  background: #fbfcfb;
}

.ahp-layer-summary,
.ahp-layer-results article > div,
.ahp-layer-results p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ahp-layer-summary {
  align-items: flex-start;
  position: relative;
  padding: 9px 34px 9px 10px;
  list-style: none;
  cursor: pointer;
}

.ahp-layer-summary::-webkit-details-marker {
  display: none;
}

.ahp-layer-summary::after {
  content: "⌄";
  position: absolute;
  right: 10px;
  top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  transform-origin: center;
  transition: transform 160ms ease;
}

.ahp-layer-card[open] .ahp-layer-summary::after {
  transform: rotate(180deg);
}

.ahp-layer-summary > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ahp-layer-summary span,
.ahp-layer-results article > div span {
  color: var(--blue);
  font-weight: 800;
}

.ahp-layer-card ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0 10px 10px;
  list-style: none;
}

.ahp-layer-card li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  padding-top: 5px;
  border-top: 1px solid #edf1ed;
  color: var(--text);
}

.ahp-layer-card small {
  font-size: 12px;
  white-space: nowrap;
}

.ahp-matrix-scroll-region {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-height: min(760px, calc(100vh - 180px));
  min-height: 520px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  border: 1px solid #c7dfcd;
  border-radius: 8px;
  background: #eef8f1;
  scrollbar-gutter: stable;
}

.ahp-matrix-panel {
  min-width: 0;
  padding: 14px;
  background: #fbfffc;
  box-shadow: none;
}

.ahp-layer-card strong,
.ahp-layer-card b,
.ahp-layer-results p span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ahp-table-scroll table {
  min-width: var(--matrix-min-width, 560px);
}

.ahp-matrix th:first-child {
  min-width: 150px;
  max-width: 220px;
}

.ahp-matrix th:not(:first-child),
.ahp-matrix td {
  min-width: 84px;
  text-align: center;
  vertical-align: middle;
}

.table-scroll .ahp-matrix {
  min-width: var(--matrix-min-width, 560px);
}

.ahp-matrix th {
  white-space: normal;
  overflow-wrap: anywhere;
}

.ahp-matrix tbody th:first-child {
  color: var(--text);
  font-weight: 700;
}

.ahp-input {
  width: 74px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  color: var(--text);
  font: inherit;
  text-align: center;
}

.ahp-fixed-cell,
.ahp-reciprocal-cell {
  color: var(--muted);
  font-weight: 700;
}

.ahp-reciprocal-cell {
  background: #f7faf7;
}

.ahp-result-panel {
  align-self: start;
  display: grid;
  gap: 14px;
  padding: 16px;
}

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

.ahp-metrics article {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8faf8;
}

.ahp-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.ahp-metrics strong {
  font-size: 20px;
}

.ahp-layer-results {
  display: grid;
  gap: 10px;
  max-height: 300px;
  overflow: auto;
  padding-right: 4px;
}

.ahp-layer-results article {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.ahp-layer-results p {
  color: var(--muted);
  font-size: 13px;
}

.ahp-layer-results p b {
  color: var(--text);
}

.ahp-actions {
  display: grid;
  gap: 10px;
}

.check-row {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.ai-workbench {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #d4ded6;
  border-radius: 8px;
  background: #fbfcfb;
}

.ai-workbench-hero,
.ai-run-cluster,
.ai-flow-strip,
.ai-primary-grid {
  display: grid;
}

.ai-workbench-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
}

.ai-workbench-hero h3 {
  max-width: 760px;
  margin-top: 4px;
  color: #17251f;
  font-size: 22px;
  line-height: 1.35;
  text-wrap: balance;
}

.ai-run-cluster {
  justify-items: end;
  gap: 8px;
}

.ai-run-cluster span {
  color: #4e5c54;
  font-size: 13px;
  font-weight: 700;
}

.ai-flow-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.ai-flow-step {
  min-width: 0;
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid #dce5dd;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.ai-flow-step strong,
.ai-flow-step span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-flow-step strong {
  font-size: 13px;
}

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

.ai-flow-step.complete {
  border-color: #b9dac6;
  background: #f1f8f3;
}

.ai-flow-step.complete span {
  color: #1f6f4b;
}

.ai-flow-step.warning {
  border-color: rgba(213, 138, 31, 0.32);
  background: #fff8e8;
}

.ai-flow-step.warning span {
  color: #8b5a12;
}

.ai-primary-grid {
  grid-template-columns: minmax(460px, 0.92fr) minmax(0, 1.08fr);
  gap: 14px;
  align-items: stretch;
}

.ai-board {
  display: grid;
  gap: 10px;
}

.ai-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 112px;
  gap: 14px;
  align-items: start;
  padding: 12px;
  border: 1px solid #dce5dd;
  border-radius: 8px;
  background: #ffffff;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.ai-card:hover {
  border-color: #bad0c1;
  background: #fbfdfb;
  transform: translateY(-1px);
}

.ai-card.confirmed {
  background: #eef7f1;
  border-color: #b9dac6;
}

.ai-card strong {
  display: inline-block;
  line-height: 1.35;
}

.ai-card p {
  margin-top: 4px;
  color: #4e5c54;
  font-size: 13px;
  line-height: 1.5;
}

.ai-card span {
  display: inline-block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.ai-actions.vertical {
  flex-direction: column;
  align-items: stretch;
  margin-top: 0;
}

.ai-advisor-panel {
  align-self: start;
  display: grid;
  gap: 12px;
  box-shadow: none;
}

.ai-count-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #dce5dd;
  border-radius: 999px;
  background: #f8faf8;
  color: #4e5c54;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.ai-advisor-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4f7f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.ai-advisor-status.ready {
  border-color: #b9dac6;
  background: #eef7f1;
  color: #1f6f4b;
}

.ai-advisor-status.draft {
  border-color: rgba(213, 138, 31, 0.28);
  background: #fff8e8;
  color: #8b5a12;
}

.ai-chatbox {
  display: grid;
  gap: 10px;
  border: 1px solid #dce5dd;
  border-radius: 8px;
  background: #f6f9f7;
  padding: 10px;
}

.ai-chat-log {
  display: grid;
  gap: 10px;
  max-height: 248px;
  overflow-y: auto;
  padding-right: 2px;
}

.ai-chat-message {
  display: grid;
  gap: 5px;
  width: min(92%, 520px);
  padding: 10px 12px;
  border-radius: 8px;
  background: white;
  border: 1px solid #e1e8df;
}

.ai-chat-message.user {
  justify-self: end;
  background: #eef3f8;
  border-color: #d7e1ec;
}

.ai-chat-message span,
.ai-proposal-summary span,
.ai-proposal-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ai-chat-message p {
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ai-advisor-compose {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.ai-advisor-compose textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: white;
  color: var(--text);
  font: inherit;
  line-height: 1.5;
}

.ai-advisor-compose textarea:focus-visible {
  border-color: var(--green);
  outline: 2px solid rgba(31, 138, 91, 0.16);
}

.ai-compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-compose-actions small,
.ai-proposal-apply small {
  color: var(--muted);
  line-height: 1.5;
}

.ai-proposal {
  display: grid;
  gap: 12px;
}

.ai-proposal-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid #cfe2d5;
  border-radius: 8px;
  background: #edf6f0;
}

.ai-proposal-summary div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ai-proposal-summary strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ai-proposal-summary b {
  color: var(--green);
  white-space: nowrap;
}

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

.ai-proposal-review section {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #dce5dd;
  border-radius: 8px;
  background: #fbfffc;
}

.ai-proposal-review strong {
  font-size: 13px;
}

.ai-proposal-review ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.ai-proposal-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.ai-proposal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: 6px 12px;
  align-items: start;
  padding: 10px;
  border: 1px solid #dce5dd;
  border-radius: 8px;
  background: #fbfffc;
}

.ai-proposal-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ai-proposal-row strong,
.ai-proposal-row p {
  overflow-wrap: anywhere;
}

.ai-proposal-row b {
  text-align: right;
  color: var(--green);
}

.ai-proposal-row p {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ai-proposal-apply {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dce5dd;
  border-radius: 8px;
  background: #f7faf7;
}

.ai-review-check {
  min-height: 32px;
  border-bottom: 0;
  font-size: 13px;
  font-weight: 700;
}

.review-pass-button {
  width: fit-content;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #aebfb5;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

.review-pass-button.passed {
  border-color: #3c9167;
  background: #e7f4ec;
  color: #266545;
}

.formula-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.formula-strip span {
  min-height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef3f8;
  color: #244f88;
  font-weight: 700;
  text-align: center;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 14px;
}

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

.table-scroll table {
  min-width: 960px;
}

.scoring-results-scroll {
  max-height: clamp(220px, 32vh, 340px);
  margin-top: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  scrollbar-gutter: stable;
}

.scoring-results-scroll table {
  min-width: 620px;
  margin-top: 0;
}

.scoring-results-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line);
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-weight: 700;
}

.merged-cell {
  vertical-align: middle;
  font-weight: 700;
  color: var(--ink);
  background: #f7faf7;
}

.norm-cell {
  min-width: 90px;
  display: grid;
  grid-template-columns: 1fr 42px;
  align-items: center;
  gap: 8px;
}

.norm-cell span {
  display: block;
  height: 8px;
  max-width: 100%;
  border-radius: 999px;
  background: var(--green);
}

.norm-cell::before {
  content: "";
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
}

.norm-cell span {
  grid-column: 1;
  grid-row: 1;
  z-index: 1;
}

.norm-cell.pending span {
  background: #b7c0ba;
}

.norm-cell.pending b {
  color: var(--muted);
}

.norm-cell b {
  font-size: 13px;
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.export-grid button {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
}

.export-grid button:hover,
.ghost-button:hover,
.icon-button:hover {
  filter: brightness(0.97);
}

.full-width {
  width: 100%;
}

.download-log {
  margin-top: 14px;
  min-height: 36px;
  padding: 10px;
  border-radius: 8px;
  background: #f4f7f4;
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #17251f;
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.result-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(23, 37, 31, 0.45);
}

.result-dialog-backdrop.visible {
  display: grid;
}

.result-dialog {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 22px;
  box-shadow: var(--shadow);
}

.result-dialog h3 {
  margin-top: 4px;
  font-size: 22px;
}

.result-dialog p {
  color: var(--muted);
  line-height: 1.6;
  word-break: break-word;
}

.import-summary {
  display: grid;
  gap: 12px;
  max-height: min(48vh, 360px);
  overflow: auto;
  padding-right: 4px;
}

.import-summary section {
  display: grid;
  gap: 6px;
}

.import-summary strong {
  color: var(--text);
  font-size: 13px;
}

.import-summary ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.result-dialog-backdrop.success .result-dialog {
  border-top: 4px solid var(--green);
}

.result-dialog-backdrop.error .result-dialog {
  border-top: 4px solid var(--red);
}

.support-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 32;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(23, 37, 31, 0.42);
}

.support-dialog-backdrop.visible {
  display: flex;
}

.support-dialog {
  width: min(720px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow-y: auto;
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.usage-guide-dialog {
  width: min(980px, 100%);
}

.support-dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.support-close-button {
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 1;
}

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

.guide-steps article {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.guide-steps p,
.support-note {
  color: var(--muted);
  line-height: 1.6;
}

.guide-reference {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.guide-reference > div:first-child {
  display: grid;
  gap: 4px;
}

.guide-reference strong {
  font-size: 15px;
}

.guide-reference p {
  max-width: 72ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.guide-table-scroll {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  scrollbar-gutter: stable;
}

.guide-indicator-table {
  min-width: 760px;
  margin-top: 0;
  font-size: 13px;
}

.guide-indicator-table th,
.guide-indicator-table td {
  padding: 9px 10px;
}

.guide-indicator-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8faf8;
  box-shadow: 0 1px 0 var(--line);
}

.guide-indicator-table code {
  color: var(--blue);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-weight: 700;
}

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

.feedback-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  font: inherit;
}

.feedback-form input,
.feedback-form select {
  min-height: 38px;
  padding: 0 10px;
}

.feedback-form textarea {
  min-height: 132px;
  resize: vertical;
  padding: 10px;
  line-height: 1.5;
}

.full-span {
  grid-column: 1 / -1;
}

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

  .sidebar {
    display: none;
  }

  .main-grid,
  .bottom-grid,
  .overview-grid,
  .two-col,
  .wide-left,
  .ahp-page,
  .ai-primary-grid,
  .ai-analysis-grid {
    grid-template-columns: 1fr;
  }

  .ai-flow-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ahp-side-rail {
    grid-template-columns: minmax(280px, 0.55fr) minmax(320px, 0.45fr);
    align-items: start;
  }

  .ahp-matrix-scroll-region {
    max-height: 560px;
    min-height: 460px;
  }
}

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

  .topbar,
  .map-toolbar,
  .ai-workbench-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    width: 100%;
    justify-content: flex-start;
  }

  .ai-workbench {
    padding: 14px;
  }

  .ai-workbench-hero,
  .ai-flow-strip {
    grid-template-columns: 1fr;
  }

  .ai-workbench-hero h3 {
    font-size: 18px;
  }

  .ai-run-cluster {
    justify-items: stretch;
  }

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

  .form-grid,
  .formula-strip,
  .guide-steps,
  .feedback-form {
    grid-template-columns: 1fr;
  }

  .ahp-side-rail {
    grid-template-columns: 1fr;
  }

  .ahp-matrix-scroll-region {
    max-height: 520px;
    min-height: 320px;
    padding: 10px;
  }

  .file-row,
  .ai-card {
    grid-template-columns: 1fr;
  }

  .ai-card .photo-swatch {
    width: 100%;
    height: 52px;
  }

  .ai-proposal-summary,
  .ai-proposal-review {
    grid-template-columns: 1fr;
  }

  .ai-compose-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .right-stack .ai-list {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }

  .map-surface {
    min-height: 470px;
  }

  .district-map {
    min-height: 320px;
  }

  h2 {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-card {
    transition: none;
  }

  .ai-card:hover {
    transform: none;
  }
}
