/* Visual hierarchy and layout corrections applied after the base theme. */
.hero {
  min-height: 270px;
  padding: 35px 0;
}

.hero h1 {
  font-size: clamp(46px, 4.6vw, 64px);
  line-height: 1.02;
}

.lede {
  max-width: 620px;
  margin-bottom: 0;
  font-size: 15px;
}

.hero-stat {
  padding-left: 34px;
}

.hero-stat strong {
  font-size: 38px;
}

.tabs {
  gap: 34px;
}

.tab {
  padding-top: 17px;
}

.view {
  padding-top: 28px;
}

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

.form-panel {
  padding: 32px;
}

.results-panel {
  position: sticky;
  top: 94px;
  min-height: 720px;
  padding: 40px;
}

.empty-state {
  min-height: 635px;
}

.empty-state h2 {
  font-size: 31px;
}

.empty-state small {
  max-width: 380px;
}

.empty-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 360px;
  margin-top: 28px;
}

.empty-features span {
  border: 1px solid var(--line);
  padding: 10px;
  background: #fafaf7;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
}

.panel-head {
  margin-bottom: 22px;
}

.panel-head h2 {
  font-size: 25px;
}

.upload {
  height: 185px;
}

label {
  font-size: 12px;
  letter-spacing: .04em;
}

input,
select,
textarea {
  min-height: 43px;
}

.inline-action {
  border: 0;
  border-bottom: 1px solid #aebbb2;
  padding: 5px 1px;
  margin: -5px 0 18px;
  background: transparent;
  color: var(--green);
}

.inline-action:hover {
  border-color: var(--forest);
  background: transparent;
}

.notice {
  margin-top: 8px;
}

.primary {
  padding: 17px 19px;
}

.xrf-box {
  margin-top: 3px;
}

.planning-result {
  position: sticky;
  top: 94px;
}

.export-button {
  border: 1px solid var(--line);
  padding: 9px 12px;
  display: block;
  float: none;
  width: max-content;
  margin: 0 0 18px auto;
  background: white;
}

.data-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 18px;
}

.data-actions .export-button {
  width: auto;
  margin: 0;
}

.import-button {
  border: 1px solid var(--line);
  padding: 9px 12px;
  margin: 0;
  background: white;
  color: var(--forest);
  font-size: 12px;
  cursor: pointer;
}

.import-button input {
  display: none;
}

.map-panel {
  margin-top: 20px;
  padding: 28px;
}

.sample-map {
  position: relative;
  height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, transparent 49.8%, #dde3dd 50%, transparent 50.2%),
    linear-gradient(transparent 49.8%, #dde3dd 50%, transparent 50.2%),
    repeating-linear-gradient(0deg, transparent 0 39px, #eef0ec 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, #eef0ec 40px);
}

.map-point {
  position: absolute;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border: 3px solid white;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.map-point:hover::after {
  content: attr(data-label);
  position: absolute;
  z-index: 2;
  left: 16px;
  top: -12px;
  width: max-content;
  max-width: 220px;
  padding: 7px 9px;
  background: var(--forest);
  color: white;
  font-size: 11px;
}

.review-box {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  margin: 18px 0;
  padding: 16px;
  background: #f5f6f1;
  border: 1px solid var(--line);
}

.review-box select,
.review-box input {
  margin: 0;
}

.danger {
  border-color: #b75332 !important;
  color: #963e25 !important;
}

.edit-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(19, 35, 28, .22);
}

.edit-dialog::backdrop {
  background: rgba(15, 34, 26, .54);
  backdrop-filter: blur(3px);
}

.edit-dialog form {
  padding: 30px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 22px;
}

.dialog-head h2 {
  margin: 0;
  font: 30px Georgia, serif;
}

.dialog-head button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 30px;
  cursor: pointer;
}

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

.dialog-actions .primary,
.dialog-actions .secondary {
  width: 100%;
  margin: 0;
}

.geology-box {
  border-left: 3px solid var(--green);
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  background: white;
}

.check-grid input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.anomaly-table {
  border: 1px solid var(--line);
}

.anomaly-row {
  display: grid;
  grid-template-columns: 1.2fr .8fr .8fr .8fr;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

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

.anomaly-row strong {
  color: var(--green);
}

.method-note {
  color: var(--muted);
  font-size: 11px !important;
}

.tool-matrix {
  margin-top: 30px;
}

.tool-row {
  display: grid;
  grid-template-columns: 220px 1fr 150px;
  gap: 20px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: white;
  font-size: 13px;
}

.tool-row:last-child {
  border-bottom: 1px solid var(--line);
}

.tool-row span {
  color: var(--muted);
}

.tool-row b {
  text-align: right;
}

.tool-row .ready {
  color: var(--green);
}

.tool-row .conditional {
  color: #9b6b26;
}

@media (max-width: 560px) {
  .check-grid {
    grid-template-columns: 1fr;
  }

  .anomaly-row {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }

  .tool-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .tool-row b {
    text-align: left;
  }
}

.geo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-action.secondary {
  background: transparent;
  color: var(--ink, #16352c);
}

.address-result {
  margin: 8px 0 14px;
  padding: 10px 12px;
  border-left: 3px solid #a6c85e;
  background: #f4f8ed;
  color: #42584f;
  font-size: 13px;
  line-height: 1.5;
}

.address-result small {
  display: block;
  margin-top: 3px;
  color: #718078;
}

.agent-card-entry {
  border-color: #a6c85e !important;
  background: linear-gradient(145deg, #f7faef, #fff) !important;
}

.agent-card-entry a {
  display: inline-block;
  margin-top: 10px;
  color: #245f4c;
  font-weight: 700;
  text-decoration: none;
}

.professional-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 22px;
}

#professionalView > .section-title {
  margin-bottom: 24px;
}

#professionalView > .section-title h2 {
  font-size: clamp(34px, 4vw, 52px);
}

.tool-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 32px;
  padding: 1px;
  border: 1px solid #d7ddd1;
  background: #d7ddd1;
}

.tool-switcher button {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 18px;
  border: 0;
  background: #fff;
  color: #53635c;
  text-align: left;
  cursor: pointer;
}

.tool-switcher button > b {
  color: #a3ada8;
  font-family: Georgia, serif;
  font-size: 20px;
}

.tool-switcher button > span {
  display: grid;
  gap: 3px;
  font-weight: 800;
}

.tool-switcher small {
  color: #849089;
  font-size: 12px;
  font-weight: 400;
}

.tool-switcher button.active {
  position: relative;
  background: #174c3d;
  color: #fff;
}

.tool-switcher button.active::after {
  position: absolute;
  bottom: -7px;
  left: 50%;
  width: 12px;
  height: 12px;
  background: #174c3d;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.tool-switcher button.active > b,
.tool-switcher button.active small {
  color: #d9e7b7;
}

.tool-panel {
  display: none;
}

.tool-panel.active {
  display: block;
}

.group-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 18px;
}

.group-heading > span {
  color: #a3ada8;
  font-family: Georgia, serif;
  font-size: 36px;
}

.group-heading p {
  margin: 0 0 3px;
  color: #176b53;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
}

.group-heading h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
}

.professional-card,
.agent-demo {
  padding: 24px;
}

.agent-demo {
  max-width: 900px;
  margin: 0 auto;
}

.tool-help {
  min-height: 44px;
  color: #65756e;
}

.tool-result {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #dfe7d6;
  border-radius: 10px;
  background: #f8faf5;
  color: #45574f;
  line-height: 1.6;
}

.tool-result small {
  display: block;
  margin-top: 12px;
  color: #7b5a38;
}

.tool-score {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.tool-score strong {
  color: #215f4b;
  font-size: 26px;
}

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

.index-grid span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: white;
  border-radius: 7px;
}

.agent-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin: 12px 0 18px;
}

.agent-flow span {
  padding: 9px 14px;
  border-radius: 999px;
  background: #eaf2dc;
  color: #245f4c;
  font-weight: 700;
}

.advanced-title {
  margin: 0 0 22px;
}

.resource-scenario-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 3px solid #a9863d;
  background: #faf7ed;
  color: #5e5238;
  font-size: 12px;
  line-height: 1.55;
}

.resource-scenario-notice[hidden] {
  display: none;
}

.resource-scenario-notice button {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #b9aa83;
  border-radius: 3px;
  background: #fff;
  color: #315b4b;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.valuation-prerequisites {
  width: 100%;
  max-width: 820px;
  margin-top: 14px;
  border: 1px solid #dfe4dc;
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.valuation-prerequisites summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 62px;
  padding: 11px 16px;
  color: #31483f;
  cursor: pointer;
  list-style: none;
}

.valuation-prerequisites summary::-webkit-details-marker {
  display: none;
}

.valuation-prerequisites summary span {
  display: grid;
  gap: 4px;
}

.valuation-prerequisites summary b {
  font-size: 14px;
}

.valuation-prerequisites summary small {
  color: #7a8781;
  font-size: 10px;
}

.valuation-prerequisites summary i {
  color: #376958;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.valuation-prerequisites summary i::after {
  margin-left: 8px;
  content: "＋";
}

.valuation-prerequisites[open] summary {
  border-bottom: 1px solid #e3e7e0;
  background: #f8faf6;
}

.valuation-prerequisites[open] summary i::after {
  content: "－";
}

.valuation-prerequisites-body {
  padding: 16px 18px 18px;
  background: #fff;
}

.valuation-prerequisites-body p {
  margin: 0 0 12px;
  color: #53655d;
  font-size: 12px;
}

.valuation-prerequisites-body ol {
  margin: 0;
  padding-left: 22px;
}

.valuation-prerequisites-body li {
  margin-bottom: 8px;
  color: #53655d;
  font-size: 12px;
  line-height: 1.6;
}

.idw-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid), 1fr);
  gap: 2px;
  width: min(100%, 330px);
  aspect-ratio: 1;
  margin: 16px auto 4px;
  padding: 3px;
  background: #fff;
  border: 1px solid #dfe7d6;
}

.idw-grid i {
  min-width: 0;
  border-radius: 2px;
}

.history-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e2e6de;
}

.history-card-actions span {
  color: #78847e;
  font-size: 11px;
}

.history-edit {
  padding: 8px 13px;
  border: 1px solid #235e4c;
  border-radius: 4px;
  background: #fff;
  color: #235e4c;
  font-weight: 800;
  cursor: pointer;
}

.history-card-actions > div {
  display: flex;
  gap: 8px;
}

.history-delete {
  padding: 8px 13px;
  border: 1px solid #b85a45;
  border-radius: 4px;
  background: #fff;
  color: #9c4634;
  font-weight: 800;
  cursor: pointer;
}

.history-delete:hover {
  background: #9c4634;
  color: #fff;
}

.history-delete:disabled {
  cursor: wait;
  opacity: .6;
}

.history-edit:hover {
  background: #235e4c;
  color: #fff;
}

.history-edit:disabled {
  cursor: wait;
  opacity: .6;
}

@media (max-width: 560px) {
  .history-card-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 900px) {
  .professional-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  #professionalView > .section-title h2 {
    font-size: 34px;
    line-height: 1.15;
  }

  .tool-switcher {
    grid-template-columns: 1fr;
    gap: 1px;
  }

  .tool-switcher button {
    min-height: 62px;
  }

  .tool-switcher button.active::after {
    display: none;
  }

  .tool-switcher small {
    display: block;
  }

  .group-heading {
    align-items: flex-start;
  }

  .professional-card,
  .agent-demo {
    padding: 20px;
  }

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

.subview .hero {
  display: none;
}

.subview .tabs {
  margin-top: 18px;
}

.planning-form {
  align-self: start;
}

.plan-empty {
  align-content: center;
  justify-items: center;
  gap: 12px;
}

.plan-empty strong {
  color: var(--ink);
  font: 25px Georgia, serif;
}

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

.ghost-grid {
  display: grid;
  grid-template-columns: repeat(3, 28px);
  gap: 25px;
  padding: 28px;
  background:
    linear-gradient(var(--line), var(--line)) center / 65% 1px no-repeat,
    linear-gradient(90deg, var(--line), var(--line)) center / 1px 65% no-repeat;
}

.ghost-grid i {
  width: 12px;
  height: 12px;
  border: 2px solid var(--green);
  border-radius: 50%;
  background: white;
}

@media (max-width: 900px) {
  .hero {
    min-height: 240px;
  }

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

  .results-panel,
  .planning-result {
    position: static;
    min-height: 560px;
  }

  .empty-state {
    min-height: 480px;
  }
}

@media (max-width: 560px) {
  .hero {
    min-height: 230px;
    padding: 25px 0;
  }

  .hero h1 {
    font-size: 40px;
  }

  .lede {
    font-size: 14px;
  }

  .tabs {
    gap: 20px;
    overflow-x: auto;
  }

  .tab {
    white-space: nowrap;
  }

  .form-panel,
  .results-panel {
    padding: 20px;
  }

  .empty-features {
    width: 100%;
  }
}
