:root {
  color-scheme: light;
  --ink: #15211d;
  --muted: #62706b;
  --line: #d9e0dc;
  --paper: #f7f4ed;
  --panel: #ffffff;
  --deep: #183c33;
  --accent: #c9542f;
  --accent-2: #237b8f;
  --gold: #b98d34;
  --soft: #e8eee9;
  --shadow: 0 20px 60px rgba(24, 60, 51, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(35, 123, 143, 0.14), transparent 34%),
    linear-gradient(300deg, rgba(201, 84, 47, 0.12), transparent 40%),
    var(--paper);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

.sidebar {
  background: rgba(255, 255, 255, 0.74);
  border-right: 1px solid var(--line);
  padding: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 26px;
}

.brand-mark {
  width: 46px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--deep);
  color: #fff;
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0;
}

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

.brand h1 {
  font-size: 20px;
  line-height: 1.1;
}

.brand p,
.eyebrow,
.panel-heading output,
.range-labels,
.field span {
  color: var(--muted);
}

.brand p {
  font-size: 13px;
  margin-top: 4px;
}

.panel {
  border-top: 1px solid var(--line);
  padding: 22px 0;
}

.panel-heading,
.section-head,
.toolbar,
.prompt-box .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h2,
.section-head h3 {
  font-size: 15px;
}

.segment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--soft);
  padding: 4px;
  border-radius: 8px;
  margin-top: 14px;
  gap: 4px;
}

.segment-button {
  background: transparent;
  color: var(--muted);
  min-height: 40px;
  border-radius: 6px;
  font-weight: 700;
}

.segment-button.active {
  background: var(--panel);
  color: var(--deep);
  box-shadow: 0 6px 18px rgba(21, 33, 29, 0.08);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  margin-top: 16px;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.field span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.field select,
.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--panel);
  color: var(--ink);
}

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

.workspace {
  padding: 30px;
  display: grid;
  gap: 22px;
  align-content: start;
}

.toolbar {
  min-height: 74px;
}

.toolbar h2 {
  font-size: clamp(25px, 4vw, 46px);
  line-height: 1.02;
  max-width: 780px;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.primary-action {
  background: var(--accent);
  color: #fff;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 900;
  white-space: nowrap;
}

.search-card,
.country-area,
.result-area {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(217, 224, 220, 0.92);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-card {
  min-height: 170px;
  padding: 26px;
  display: grid;
  gap: 18px;
  background:
    linear-gradient(90deg, rgba(24, 60, 51, 0.88), rgba(24, 60, 51, 0.56)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='260' viewBox='0 0 900 260'%3E%3Crect width='900' height='260' fill='%23d7d1c4'/%3E%3Cpath d='M0 190C105 150 174 168 261 133c93-37 145-87 270-66 110 18 141 77 246 59 50-9 88-29 123-57v191H0z' fill='%23aebfb8'/%3E%3Cpath d='M0 214c95-20 196-22 302-7 117 17 211 3 321-26 103-27 188-23 277 9v70H0z' fill='%23efe8d7'/%3E%3Ccircle cx='706' cy='73' r='38' fill='%23f3d38a'/%3E%3C/svg%3E");
  background-size: cover;
  color: #fff;
}

.search-card p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 17px;
}

.search-card h3 {
  font-size: 28px;
}

.search-card .eyebrow {
  color: rgba(255, 255, 255, 0.7);
}

.deal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.deal-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 700;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
  gap: 22px;
  align-items: start;
}

.country-area,
.result-area {
  padding: 22px;
}

.quick-actions {
  display: flex;
  gap: 8px;
}

.quick-actions button,
.prompt-box button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--deep);
  font-weight: 800;
}

.country-groups {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.country-group {
  display: grid;
  gap: 10px;
}

.country-group h4 {
  margin: 0;
  color: var(--deep);
}

.country-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.country-option {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.country-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-2);
}

.country-option strong {
  display: block;
  font-size: 14px;
}

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

.pipeline {
  list-style: none;
  padding: 0;
  margin: 18px 0 22px;
  display: grid;
  gap: 14px;
}

.pipeline li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
}

.pipeline li > span {
  display: grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #e5f0f2;
  color: var(--accent-2);
  font-weight: 900;
  font-size: 12px;
}

.pipeline strong {
  display: block;
  margin-bottom: 3px;
}

.pipeline p {
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.prompt-box {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #111c19;
  color: #eef7f3;
  border-radius: 8px;
  padding: 16px;
  min-height: 220px;
  line-height: 1.5;
  font-size: 13px;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .date-grid,
  .country-list {
    grid-template-columns: 1fr;
  }

  .search-card h3 {
    font-size: 22px;
  }

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