:root {
  --ink: #16211f;
  --muted: #64726d;
  --paper: #f6f2e8;
  --panel: rgba(255, 252, 244, 0.86);
  --line: rgba(22, 33, 31, 0.13);
  --green: #1f6b4f;
  --green-deep: #0f3f32;
  --amber: #d7922f;
  --sky: #6aa7ba;
  --shadow: 0 24px 70px rgba(36, 47, 42, 0.16);
  --radius: 24px;
  font-family: "Avenir Next", "Hiragino Sans", "Yu Gothic", "Noto Sans CJK JP", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(106, 167, 186, 0.38), transparent 28rem),
    radial-gradient(circle at 86% 18%, rgba(215, 146, 47, 0.24), transparent 24rem),
    linear-gradient(135deg, #f8f0dc 0%, #eef5ee 52%, #eaf2f5 100%);
  min-height: 100vh;
}

button,
select,
input {
  font: inherit;
}

a {
  color: inherit;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    linear-gradient(120deg, rgba(255, 252, 244, 0.94), rgba(255, 252, 244, 0.64)),
    repeating-linear-gradient(135deg, rgba(31, 107, 79, 0.08) 0 1px, transparent 1px 18px);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -120px;
  width: 360px;
  height: 360px;
  border-radius: 48% 52% 44% 56%;
  background: rgba(31, 107, 79, 0.16);
  pointer-events: none;
}

.topbar,
.hero-grid,
.toolbar,
.workspace,
.metrics {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.brand,
.top-actions,
.hero-actions,
.detail-actions,
.frame-header,
.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.03em;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: conic-gradient(from 140deg, var(--green), var(--sky), var(--amber), var(--green));
  box-shadow: 0 0 0 6px rgba(31, 107, 79, 0.1);
}

.language-control,
.toolbar label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

select,
input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

select:focus,
input:focus {
  border-color: rgba(31, 107, 79, 0.55);
  box-shadow: 0 0 0 4px rgba(31, 107, 79, 0.12);
}

.button,
.text-button {
  cursor: pointer;
  border: 0;
  text-decoration: none;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.primary {
  background: var(--green);
  color: white;
  box-shadow: 0 14px 30px rgba(31, 107, 79, 0.24);
}

.ghost {
  border: 1px solid rgba(31, 107, 79, 0.24);
  color: var(--green-deep);
  background: rgba(255, 255, 255, 0.58);
}

.soft {
  color: var(--green-deep);
  background: rgba(31, 107, 79, 0.11);
}

.text-button {
  color: var(--green);
  background: transparent;
  font-weight: 800;
  padding: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  padding: 44px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 16px;
  font-size: clamp(2.2rem, 5vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero-copy {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.status-card {
  align-self: end;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(22, 33, 31, 0.88);
  color: white;
  padding: 24px;
  box-shadow: 0 20px 44px rgba(22, 33, 31, 0.2);
}

.status-label {
  color: rgba(255, 255, 255, 0.68);
  display: block;
  margin-bottom: 18px;
  font-weight: 800;
}

.status-card strong {
  display: block;
  margin-bottom: 18px;
  font-size: 2.2rem;
}

.status-card p {
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
}

.toolbar,
.metrics,
.workspace {
  margin-top: 18px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1.4fr;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--panel);
  backdrop-filter: blur(18px);
}

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

.metrics article,
.company-list,
.detail-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.metrics article {
  border-radius: 22px;
  padding: 18px;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.82rem;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.workspace {
  display: grid;
  grid-template-columns: 370px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.company-list,
.detail-panel {
  border-radius: var(--radius);
}

.company-list {
  position: sticky;
  top: 16px;
  padding: 18px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 900;
}

.company-card {
  width: 100%;
  margin-top: 10px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.company-card:hover,
.company-card.active {
  border-color: rgba(31, 107, 79, 0.34);
  background: rgba(255, 255, 255, 0.9);
}

.company-card strong {
  display: block;
  margin-bottom: 6px;
}

.company-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.detail-panel {
  padding: 24px;
}

.detail-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.pill,
.resource-type {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: rgba(215, 146, 47, 0.18);
  color: #805211;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 900;
}

#selectedName {
  margin: 12px 0 10px;
  font-size: clamp(1.7rem, 3vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

#selectedSummary {
  color: var(--muted);
  line-height: 1.75;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.resource-link {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  padding: 16px;
  text-decoration: none;
}

.resource-link:hover {
  border-color: rgba(31, 107, 79, 0.36);
}

.resource-link small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.notes-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

.notes-grid article {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  padding: 18px;
}

.notes-grid h3,
.map-frame-card h3 {
  margin-bottom: 8px;
}

.notes-grid ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.8;
}

#refreshLogText,
.frame-header p {
  color: var(--muted);
  line-height: 1.7;
}

.map-frame-card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.52);
}

.frame-header {
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

iframe {
  display: block;
  width: 100%;
  height: min(72vh, 760px);
  border: 0;
  background: white;
}

.is-hidden {
  display: none;
}

@media (max-width: 980px) {
  .topbar,
  .detail-header,
  .frame-header {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .hero-actions,
  .detail-actions {
    flex-wrap: wrap;
  }

  .hero-grid,
  .toolbar,
  .workspace,
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    padding: 28px;
  }

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

  .company-list {
    position: static;
    max-height: none;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 18px, 1440px);
    padding-top: 9px;
  }

  .hero,
  .toolbar,
  .company-list,
  .detail-panel {
    border-radius: 20px;
  }

  h1 {
    font-size: 2.25rem;
  }

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

  .button {
    width: 100%;
  }
}
