:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #66707a;
  --line: #dce4e8;
  --paper: #f8faf8;
  --panel: #ffffff;
  --green: #11785f;
  --teal: #0f6d7a;
  --amber: #b76b11;
  --red: #b73535;
  --blue: #245a9c;
  --shadow: 0 20px 60px rgba(18, 32, 38, 0.1);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(17, 120, 95, 0.08), transparent 340px),
    var(--paper);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: end;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: 0;
}

.trust-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  white-space: nowrap;
}

.trust-pill strong {
  font-size: 14px;
}

.trust-pill span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(17, 120, 95, 0.12);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy h2 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-copy p,
.panel-head p {
  color: var(--muted);
  line-height: 1.7;
}

.flow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #102026;
  color: #fff;
}

.flow div,
.flow strong {
  display: grid;
  place-items: center;
  min-height: 86px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.flow strong {
  min-height: 112px;
  background: #e6f4ef;
  color: var(--green);
  font-size: 44px;
  letter-spacing: 0;
}

.workspace {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
  background: #f3f6f4;
}

.tab {
  min-height: 50px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tab:last-child {
  border-right: 0;
}

.tab.active {
  background: var(--panel);
  color: var(--green);
  font-weight: 800;
}

.panel {
  display: none;
  padding: 26px;
}

.panel.active {
  display: block;
}

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

.panel-head h3 {
  margin-bottom: 6px;
  font-size: 24px;
  letter-spacing: 0;
}

.split {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

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

label {
  display: grid;
  gap: 8px;
  color: #334049;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid #cbd7dc;
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(17, 120, 95, 0.1);
}

.wide {
  grid-column: 1 / -1;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--green);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.lang-toggle {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--green);
}

.lang-toggle:hover {
  background: #eef7f3;
}

button:hover {
  background: #0d654f;
}

.grid-form button {
  justify-self: start;
}

.match-list {
  display: grid;
  gap: 14px;
}

.match-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfb;
}

.score {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #e6f4ef;
  color: var(--green);
  font-size: 28px;
  font-weight: 900;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.tag {
  border-radius: 999px;
  padding: 5px 9px;
  background: #edf3f5;
  color: #38505a;
  font-size: 13px;
}

.risk-low {
  color: var(--green);
}

.risk-medium {
  color: var(--amber);
}

.risk-high {
  color: var(--red);
}

.chat-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 240px;
  gap: 16px;
}

.chat-layout aside,
.chatbox {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 16px;
}

.messages {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 280px;
  max-height: 360px;
  overflow: auto;
}

.message {
  max-width: 80%;
  border-radius: 8px;
  padding: 10px 12px;
  background: #eef5f6;
  line-height: 1.5;
}

.message.self {
  justify-self: end;
  background: #e6f4ef;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
}

#risk-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 820px) {
  .topbar,
  .split {
    align-items: stretch;
    flex-direction: column;
  }

  .hero,
  .grid-form,
  .chat-layout {
    grid-template-columns: 1fr;
  }

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

  .match-card {
    grid-template-columns: 1fr;
  }

  .score {
    width: 74px;
    height: 74px;
    font-size: 22px;
  }
}
