:root {
  --bg: #f7f6ff;
  --paper: #ffffff;
  --ink: #102a3a;
  --muted: #667783;
  --line: #dbe6ee;
  --green: #21b99a;
  --green-dark: #087866;
  --blue: #3a86ff;
  --blue-dark: #245fc8;
  --coral: #ff7a6b;
  --amber: #ffc15a;
  --violet: #7c6df2;
  --warn: #df615c;
  --soft: #e9fbf6;
  --radius: 8px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 9% 4%, rgba(124, 109, 242, .16), transparent 30%),
    radial-gradient(circle at 88% 8%, rgba(33, 185, 154, .18), transparent 28%),
    radial-gradient(circle at 52% 0%, rgba(255, 193, 90, .12), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 48%, #f4fbf9 100%);
  color: var(--ink);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 32px;
  justify-content: space-between;
  width: min(1500px, calc(100% - 56px));
  margin: 12px auto 0;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 54px rgba(31, 45, 71, .1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 58px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--violet), var(--blue) 50%, var(--green));
  color: white;
  font-size: 14px;
  font-weight: 800;
}

.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 12px; margin-top: 2px; }
nav { display: flex; gap: 28px; }
nav a { color: var(--muted); text-decoration: none; font-weight: 700; }
nav a:hover { color: var(--blue-dark); }
.status {
  padding: 10px 22px;
  border-radius: 999px;
  background: #e5fff7;
  color: var(--green-dark);
  font-weight: 800;
}

main {
  width: min(1500px, calc(100% - 56px));
  margin: 28px auto 80px;
}

.is-hidden {
  display: none !important;
}

.notice {
  padding: 22px 26px;
  border: 1px solid #ffd8c7;
  border-radius: 24px;
  background: linear-gradient(135deg, #fff4ec, #fffaf1);
  color: #744331;
  line-height: 1.7;
  font-weight: 600;
  box-shadow: 0 18px 50px rgba(255, 122, 107, .12);
}

.hero {
  padding: 58px 0 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 34px;
  align-items: center;
}

.landing-hero {
  position: relative;
  margin-top: 20px;
  padding: 64px 40px;
  border: 1px solid rgba(216, 225, 255, .82);
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 18%, rgba(124, 109, 242, .22), transparent 28%),
    radial-gradient(circle at 82% 16%, rgba(33, 185, 154, .2), transparent 26%),
    radial-gradient(circle at 65% 78%, rgba(255, 122, 107, .14), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(244,248,255,.88));
  box-shadow: 0 32px 110px rgba(31, 45, 71, .12);
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: 16px;
  pointer-events: none;
  border-radius: 26px;
  background:
    linear-gradient(90deg, transparent, rgba(124, 109, 242, .3), transparent) top left / 100% 1px no-repeat,
    linear-gradient(180deg, transparent, rgba(33, 185, 154, .26), transparent) top right / 1px 100% no-repeat,
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.8), transparent 4px);
  opacity: .8;
}

.hero-copy {
  max-width: 980px;
}

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

h1 {
  margin: 0;
  font-size: clamp(40px, 4.8vw, 72px);
  line-height: 1.02;
  letter-spacing: 0;
  color: #0d2534;
}

.hero-copy p:not(.eyebrow) {
  margin: 22px 0 0;
  color: var(--muted);
  max-width: 760px;
  font-size: 19px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero-actions span {
  padding: 11px 15px;
  border: 1px solid #d7e3ff;
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  color: #23425b;
  font-weight: 800;
  box-shadow: 0 12px 34px rgba(58, 134, 255, .1);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border: 1px solid #d8e1ff;
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(241, 247, 255, .9)),
    linear-gradient(135deg, rgba(124, 109, 242, .14), rgba(33, 185, 154, .12));
  box-shadow: 0 26px 80px rgba(36, 95, 200, .14);
}

.led-card {
  border-color: rgba(255,255,255,.7);
  background:
    linear-gradient(145deg, rgba(255,255,255,.78), rgba(245,249,255,.72)),
    radial-gradient(circle at 20% 0%, rgba(124,109,242,.18), transparent 34%),
    radial-gradient(circle at 100% 20%, rgba(33,185,154,.16), transparent 30%);
  backdrop-filter: blur(18px);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: -90px -80px auto auto;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(124, 109, 242, .18), rgba(33, 185, 154, .16));
}

.hero-card-top {
  position: relative;
  display: grid;
  gap: 6px;
  margin-bottom: 20px;
}

.hero-card-top span {
  color: var(--violet);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero-card-top strong {
  font-size: 26px;
  line-height: 1.15;
}

.flow-list {
  position: relative;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-list li {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 10px 14px;
  padding: 16px;
  border: 1px solid #dfe7fb;
  border-radius: 20px;
  background: rgba(255, 255, 255, .86);
}

.flow-list li span {
  grid-row: span 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  color: white;
  font-size: 13px;
  font-weight: 900;
}

.flow-list strong {
  align-self: end;
  color: var(--ink);
}

.flow-list small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.audience-actions {
  position: relative;
  display: grid;
  gap: 14px;
}

.audience-card {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 20px;
  border: 1px solid #dfe7fb;
  border-radius: 20px;
  background: rgba(255, 255, 255, .86);
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 18px 42px rgba(31, 45, 71, .06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.audience-card span {
  color: var(--ink);
  font: inherit;
  font-size: 20px;
  font-weight: 900;
}

.audience-card small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.audience-card:hover,
.audience-card.is-selected {
  transform: translateY(-2px);
  border-color: #9fb2ff;
  box-shadow: 0 24px 58px rgba(124, 109, 242, .14);
}

.experience-section {
  margin-top: 28px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.info-grid article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 18px 52px rgba(31, 45, 71, .07);
  transition: transform .18s ease, box-shadow .18s ease;
}

.info-grid article:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 66px rgba(58, 134, 255, .12);
}

.info-grid strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
  margin-bottom: 8px;
}

.info-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 650;
}

.workspace, .results {
  display: grid;
  grid-template-columns: minmax(360px, .88fr) minmax(520px, 1.12fr);
  gap: 24px;
  align-items: start;
}

.public-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: 30px;
  border: 1px solid #d8e1ff;
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(241,247,255,.9)),
    linear-gradient(90deg, rgba(33,185,154,.12), rgba(124,109,242,.12));
  box-shadow: 0 22px 70px rgba(31, 45, 71, .08);
}

.public-intro h2 {
  font-size: clamp(30px, 3.4vw, 52px);
  line-height: 1.02;
}

.public-intro p {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.65;
}

.public-intro > strong {
  max-width: 340px;
  padding: 16px 18px;
  border: 1px solid #ffd8c7;
  border-radius: 18px;
  background: #fff4ec;
  color: #744331;
  line-height: 1.55;
}

.public-workspace {
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(520px, 1.1fr);
  gap: 24px;
  align-items: start;
}

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

.results { margin-top: 24px; }

.panel {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 22px 70px rgba(31, 45, 71, .09);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--violet), var(--coral));
  opacity: .85;
}

.image-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(245, 248, 255, .98));
}

.panel-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.step {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8fff8, #eef1ff);
  color: var(--violet);
  font-weight: 800;
}

h2 { margin: 0; font-size: 24px; }
h3 { margin: 0 0 14px; font-size: 19px; }
.panel p { color: var(--muted); line-height: 1.65; }

.dropzone {
  display: grid;
  position: relative;
  min-height: 390px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #9edbd1;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(244, 255, 251, .92), rgba(240, 244, 255, .96)),
    repeating-linear-gradient(45deg, rgba(58, 134, 255, .05) 0, rgba(58, 134, 255, .05) 8px, transparent 8px, transparent 18px);
  cursor: pointer;
}

.dropzone input { display: none; }
.dropzone img {
  display: none;
  width: 100%;
  height: 390px;
  object-fit: cover;
  filter: blur(10px);
  transform: scale(1.02);
}
.dropzone.has-image img { display: block; }
.dropzone span {
  position: absolute;
  left: 20px;
  bottom: 20px;
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(23, 45, 54, .82);
  color: white;
  font-weight: 800;
}

.field, label {
  display: grid;
  gap: 8px;
  color: #4d5f64;
  font-weight: 800;
}

.field { margin-top: 18px; }

input, select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfefe;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  padding: 0 14px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input:focus, select:focus {
  border-color: #8da7ff;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(124, 109, 242, .12);
}

.subtle { font-size: 13px; }
.subtle {
  padding: 13px 14px;
  border: 1px solid #e1e8f3;
  border-radius: 16px;
  background: #fbfdff;
  font-weight: 650;
}

.terms {
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(135deg, #f4fffb, #f4f6ff);
}

summary { cursor: pointer; font-weight: 900; color: #40565d; }
.term-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.term-grid div {
  padding: 14px;
  border: 1px solid #e0e8f1;
  border-radius: 16px;
  background: white;
  box-shadow: 0 10px 30px rgba(23, 45, 54, .04);
}
.term-grid strong, .term-grid span { display: block; }
.term-grid strong { color: var(--blue-dark); margin-bottom: 6px; }
.term-grid span { color: var(--muted); line-height: 1.5; font-weight: 600; }

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

.primary {
  width: 100%;
  min-height: 54px;
  margin-top: 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--blue) 55%, var(--violet));
  color: white;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 16px 38px rgba(58, 134, 255, .22);
  transition: transform .18s ease, box-shadow .18s ease;
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 44px rgba(58, 134, 255, .28);
}

.secondary {
  width: 100%;
  min-height: 50px;
  margin-top: 16px;
  border: 1px solid #cbd9ff;
  border-radius: 999px;
  background: linear-gradient(90deg, #e8fff8, #eef2ff);
  color: var(--blue-dark);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(58, 134, 255, .12);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.secondary:hover {
  transform: translateY(-1px);
  border-color: #9fb2ff;
  box-shadow: 0 16px 34px rgba(124, 109, 242, .14);
}

.secondary:disabled {
  cursor: wait;
  opacity: .72;
}

.model-result {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 15px 16px;
  border: 1px solid #d9e9ff;
  border-radius: 18px;
  background: linear-gradient(135deg, #f2fffb, #f6f8ff);
  color: var(--muted);
  line-height: 1.45;
}

#planCard, #guideCard {
  min-height: 220px;
}

.model-result strong {
  color: var(--ink);
}

.model-result span {
  font-weight: 650;
}

.model-result.error {
  border-color: #ffc6bd;
  background: #fff2ef;
  color: #9a3d36;
}

.empty {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.risk-high { color: var(--warn); font-weight: 900; }
.note-list { margin: 10px 0 0; padding-left: 18px; color: #41535a; line-height: 1.8; }

.sources { margin-top: 24px; }
.source-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.source-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--muted);
  line-height: 1.6;
}
.source-item strong {
  display: block;
  color: var(--ink);
  margin-bottom: 6px;
}

.chat {
  margin-top: 24px;
}
.chat-log {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}
.bubble {
  max-width: 840px;
  padding: 16px 18px;
  border-radius: 18px;
  line-height: 1.65;
  font-weight: 650;
}
.bubble.user {
  justify-self: end;
  background: #e8fff8;
}
.bubble.assistant {
  justify-self: start;
  background: #f0f3ff;
}
.bubble.error {
  background: #fde8e6;
  color: #8d3e38;
}
.chat-row {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 12px;
}
.chat-row button {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ink), var(--blue-dark));
  color: white;
  font: inherit;
  font-weight: 900;
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding: 24px 28px;
  border: 1px solid #d8e1ff;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(241, 247, 255, .92)),
    linear-gradient(90deg, rgba(33, 185, 154, .12), rgba(124, 109, 242, .12));
  box-shadow: 0 22px 70px rgba(31, 45, 71, .08);
}

.contact-card span {
  display: block;
  color: var(--violet);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.contact-card strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.3;
}

.contact-card a {
  flex: 0 0 auto;
  padding: 13px 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--coral), var(--violet), var(--blue));
  color: white;
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 16px 36px rgba(124, 109, 242, .22);
  transition: transform .18s ease, box-shadow .18s ease;
}

.contact-card a:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 44px rgba(124, 109, 242, .3);
}

@media (max-width: 980px) {
  .topbar, main { width: min(100% - 28px, 1500px); }
  nav { display: none; }
  .hero, .workspace, .results, .form-grid, .term-grid, .info-grid, .public-workspace, .public-form { grid-template-columns: 1fr; }
  h1 { font-size: 42px; }
  .hero { padding: 46px 0 34px; }
  .landing-hero { padding: 36px 22px; }
  .hero-card { padding: 22px; }
  .public-intro {
    align-items: flex-start;
    flex-direction: column;
  }
  .dropzone, .dropzone img { min-height: 310px; height: 310px; }
  .contact-card {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    border-radius: 24px;
  }
  .landing-hero { border-radius: 24px; }
  .panel, .notice, .hero-card, .info-grid article { border-radius: 20px; }
  .flow-list li { grid-template-columns: 42px 1fr; }
}
