:root {
  --bg: #f6faff;
  --ink: #102a56;
  --muted: #63758e;
  --card: #ffffff;
  --line: #d8e8f7;
  --blue: #35a8ef;
  --blue-dark: #167fc4;
  --blue-pale: #eaf7ff;
  --orange: #ff6b00;
  --orange-dark: #e85b00;
  --orange-pale: #fff1e6;
  --navy: #12336b;
  --accent: var(--orange);
  --accent2: var(--orange-dark);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 9%, rgba(53, 168, 239, .1), transparent 24rem),
    radial-gradient(circle at 100% 4%, rgba(255, 107, 0, .045), transparent 16rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; margin: -1px; padding: 0; border: 0; clip: rect(0 0 0 0); white-space: nowrap; }

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 112px;
  padding: 0 5vw;
  border-bottom: 1px solid rgba(216, 232, 247, .9);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 8px 28px rgba(18, 51, 107, .05);
  backdrop-filter: blur(14px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--navy);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -.04em;
}
.brand > span { margin-left: -9px; color: var(--orange); }
.brand-mascot { width: 150px; height: 100px; object-fit: contain; }
nav { display: flex; gap: 30px; color: #425b7c; font-size: 14px; font-weight: 700; }
nav a { transition: color .18s ease; }
nav a:hover { color: var(--orange); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.language-picker select {
  min-width: 66px;
  padding: 9px 28px 9px 11px;
  border: 1px solid #bcdcf2;
  border-radius: 12px;
  outline: none;
  background: white;
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.language-picker select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(53, 168, 239, .12); }
.ghost {
  max-width: 210px;
  overflow: hidden;
  padding: 10px 17px;
  border: 1px solid #bcdcf2;
  border-radius: 12px;
  background: var(--blue-pale);
  color: var(--navy);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: .18s ease;
}
.ghost:hover { border-color: var(--blue); background: white; transform: translateY(-1px); }

.hero {
  max-width: 1180px;
  margin: auto;
  padding: 82px 22px 76px;
}
.hero-copy { max-width: 850px; margin: auto; text-align: center; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  border: 1px solid #c5e6fa;
  border-radius: 999px;
  background: var(--blue-pale);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.hero h1 {
  max-width: 850px;
  margin: 22px 0 24px;
  color: var(--navy);
  font-size: clamp(44px, 5.2vw, 68px);
  line-height: .98;
  letter-spacing: -.06em;
}
.hero h1 span { display: block; color: var(--orange); }
.hero p {
  max-width: 625px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}
.hero-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; color: #46617f; font-size: 13px; font-weight: 750; }
.hero-trust span { display: inline-flex; align-items: center; gap: 7px; }
.hero-trust span::before {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--orange-pale);
  color: var(--orange);
  font-size: 11px;
  content: "✓";
}
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--orange), #ff8a24);
  box-shadow: 0 10px 28px rgba(255, 107, 0, .24);
  color: white;
  font-weight: 850;
  cursor: pointer;
  transition: .18s ease;
}
.primary:hover { background: linear-gradient(135deg, var(--orange-dark), var(--orange)); box-shadow: 0 13px 30px rgba(255, 107, 0, .31); transform: translateY(-1px); }

main { max-width: 1180px; margin: auto; padding: 60px 22px 100px; }
.section-title { display: flex; align-items: end; justify-content: space-between; margin-bottom: 28px; }
.section-title h2 { margin: 0 0 6px; color: var(--navy); font-size: 36px; letter-spacing: -.035em; }
.section-title p { margin: 0; color: var(--muted); }
.section-title input {
  width: 275px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  background: white;
  box-shadow: 0 7px 22px rgba(18, 51, 107, .05);
  color: var(--ink);
  transition: .18s ease;
}
.section-title input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(53, 168, 239, .13); }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 17px; }
.card {
  position: relative;
  min-height: 158px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 5px 18px rgba(18, 51, 107, .045);
  cursor: pointer;
  transition: .2s ease;
}
.card::after { position: absolute; top: -24px; right: -24px; width: 70px; height: 70px; border-radius: 50%; background: var(--blue-pale); content: ""; transition: .2s ease; }
.card:nth-child(3n + 2)::after { background: var(--orange-pale); }
.card:hover { border-color: #9ed6f7; box-shadow: 0 17px 38px rgba(18, 51, 107, .12); transform: translateY(-5px); }
.card:nth-child(3n + 2):hover { border-color: #ffc18e; }
.icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 15px;
  border-radius: 13px;
  background: var(--blue-pale);
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 950;
}
.card:nth-child(3n + 2) .icon { background: var(--orange-pale); color: var(--orange-dark); }
.card h3 { margin: 0 0 7px; color: var(--navy); font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.pro-card { border-color: #ffc18e; background: linear-gradient(145deg, #fff 62%, var(--orange-pale)); }
.pro-card .icon { background: linear-gradient(145deg, var(--orange), #ff9138); color: white; }
.pro-badge { position: absolute; z-index: 2; top: 15px; right: 15px; padding: 5px 9px; border-radius: 999px; background: var(--navy); color: white; font-size: 11px; font-weight: 900; letter-spacing: .04em; }

.modal { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(10, 33, 72, .66); backdrop-filter: blur(5px); }
.hidden { display: none; }
.dialog {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  overflow: auto;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 24px;
  background: white;
  box-shadow: 0 28px 80px rgba(4, 24, 58, .25);
}
.close { position: absolute; top: 14px; right: 18px; border: 0; background: transparent; color: #6b7e99; font-size: 30px; cursor: pointer; }
.tool-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; background: linear-gradient(145deg, var(--blue-pale), #d8f0ff); color: var(--blue-dark); font-size: 11px; font-weight: 950; }
.dialog h2 { margin: 14px 0 5px; color: var(--navy); }
.dialog > p { margin-top: 0; color: var(--muted); }
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin: 20px 0;
  min-height: 218px;
  overflow: hidden;
  padding: 42px 32px;
  border: 2px dashed #acd8f2;
  border-radius: 18px;
  background: linear-gradient(145deg, #f9fdff, var(--blue-pale));
  text-align: center;
  cursor: pointer;
  transition: .18s ease;
}
.drop-mascot {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: min(48%, 225px);
  height: auto;
  opacity: .105;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity .18s ease, transform .18s ease;
}
.drop-copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; text-shadow: 0 1px 10px rgba(255, 255, 255, .95); }
.drop:hover, .drop.drag { border-color: var(--orange); background: var(--orange-pale); }
.drop:hover .drop-mascot, .drop.drag .drop-mascot { opacity: .16; transform: translate(-50%, -50%) scale(1.035); }
.drop span, .drop small { color: var(--muted); }
.field { display: grid; gap: 7px; margin: 12px 0; }
.field label { color: var(--navy); font-size: 13px; font-weight: 800; }
.field input, .field select, .field textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 11px; outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(53, 168, 239, .12); }
.full { width: 100%; margin-top: 15px; }
.mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.mode input { margin-right: 6px; }
#status { margin-top: 12px; color: var(--muted); font-size: 13px; word-break: break-word; }
.ai-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ai-privacy { margin: 13px 0 2px; padding: 12px 14px; border: 1px solid #cbe8f9; border-radius: 13px; background: var(--blue-pale); color: #49657f; font-size: 12px; line-height: 1.55; }
.ai-upgrade { display: grid; justify-items: center; padding: 14px 8px 4px; text-align: center; }
.ai-upgrade img { width: 150px; height: 120px; object-fit: contain; }
.ai-upgrade strong { color: var(--navy); font-size: 20px; }
.ai-upgrade p { max-width: 440px; margin: 9px auto 4px; color: var(--muted); line-height: 1.55; }
.ai-workspace { display: grid; gap: 13px; margin-top: 16px; }
.ai-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--navy); font-size: 15px; }
.ai-result-heading small { color: var(--muted); font-size: 12px; }
.ai-conversation { display: grid; gap: 11px; max-height: 340px; overflow: auto; padding: 4px; }
.ai-message { max-width: 92%; padding: 13px 15px; border-radius: 16px; line-height: 1.55; word-break: normal; }
.ai-message.octo { justify-self: start; border: 1px solid #cbe8f9; border-bottom-left-radius: 5px; background: var(--blue-pale); color: #294a6d; }
.ai-message.user { justify-self: end; border-bottom-right-radius: 5px; background: var(--navy); color: white; }
.ai-message strong { display: block; margin-bottom: 5px; font-size: 12px; }
.ai-message-copy { white-space: pre-wrap; }
.ai-message small { display: block; margin-top: 7px; color: var(--blue-dark); font-size: 11px; }
.ai-question-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.ai-question-form textarea { min-height: 58px; resize: vertical; padding: 12px; border: 1px solid var(--line); border-radius: 13px; outline: none; }
.ai-question-form textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(53, 168, 239, .12); }
.ai-question-form .primary { align-self: stretch; min-width: 92px; padding: 11px 17px; }
.ai-question-form .primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.ai-remaining { grid-column: 1 / -1; color: var(--muted); text-align: right; }

.privacy {
  position: relative;
  max-width: 1050px;
  overflow: hidden;
  margin: 0 auto 76px;
  padding: 43px 46px;
  border-radius: 28px;
  background: linear-gradient(125deg, #102c60, #126ca5);
  box-shadow: 0 24px 58px rgba(18, 51, 107, .2);
  color: white;
}
.privacy::after { position: absolute; top: -75px; right: -45px; width: 190px; height: 190px; border: 26px solid rgba(255, 107, 0, .8); border-radius: 50%; content: ""; }
.privacy h2 { position: relative; z-index: 1; margin-top: 0; font-size: 30px; }
.privacy p { position: relative; z-index: 1; max-width: 730px; margin-bottom: 0; color: #dceeff; line-height: 1.7; }
footer { display: flex; justify-content: space-between; padding: 29px 5vw; border-top: 1px solid var(--line); background: white; color: #63758e; font-size: 13px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a:hover { color: var(--orange); }

.legal-page { min-height: 100vh; }
.legal-topbar { position: static; }
.legal-shell { max-width: 920px; margin: 0 auto; padding: 64px 22px 90px; }
.legal-hero { margin-bottom: 28px; padding: 38px; border: 1px solid var(--line); border-radius: 26px; background: linear-gradient(145deg, #fff 50%, var(--blue-pale)); box-shadow: 0 16px 42px rgba(18, 51, 107, .08); }
.legal-hero h1 { margin: 14px 0 12px; color: var(--navy); font-size: clamp(36px, 6vw, 54px); letter-spacing: -.045em; }
.legal-hero p { max-width: 720px; margin: 0; color: var(--muted); line-height: 1.7; }
.legal-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0 0; }
.legal-summary div { padding: 15px; border: 1px solid #cbe8f9; border-radius: 14px; background: rgba(255, 255, 255, .8); }
.legal-summary strong { display: block; margin-bottom: 4px; color: var(--navy); font-size: 13px; }
.legal-summary span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.legal-notice { margin: 0 0 22px; padding: 17px 20px; border: 1px solid #ffd0aa; border-radius: 16px; background: var(--orange-pale); color: #8a3d08; font-size: 14px; line-height: 1.55; }
.legal-content { padding: 38px; border: 1px solid var(--line); border-radius: 26px; background: white; box-shadow: 0 16px 42px rgba(18, 51, 107, .07); }
.legal-content section + section { padding-top: 12px; }
.legal-content h2 { margin: 28px 0 10px; color: var(--navy); font-size: 23px; letter-spacing: -.02em; }
.legal-content h3 { margin: 22px 0 8px; color: var(--navy); font-size: 17px; }
.legal-content p, .legal-content li { color: #506782; font-size: 14px; line-height: 1.72; }
.legal-content ul, .legal-content ol { padding-left: 22px; }
.legal-content a { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 2px; }
.legal-content .important { padding: 18px 20px; border-left: 4px solid var(--orange); border-radius: 0 14px 14px 0; background: #fff8f2; color: #74401e; }
.legal-content .operator-placeholder { padding: 18px 20px; border: 1px dashed var(--orange); border-radius: 14px; background: #fffaf6; }
.withdrawal-template { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #f9fcff; }

@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
  nav { display: none; }
  .hero { padding-top: 58px; text-align: center; }
  .hero-copy { display: grid; justify-items: center; }
  .hero-trust { justify-content: center; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .topbar { height: 92px; padding: 0 17px; }
  .brand { gap: 6px; font-size: 19px; }
  .brand-mascot { width: 58px; height: 58px; }
  .top-actions { gap: 6px; }
  .language-picker select { min-width: 58px; padding: 8px 24px 8px 8px; }
  .ghost { padding: 9px 10px; font-size: 12px; }
  .top-actions .ghost { max-width: 86px; padding-inline: 8px; }
  .hero { min-height: auto; padding: 48px 18px 45px; }
  .hero h1 { font-size: 45px; }
  .hero p { font-size: 16px; }
  .hero-trust { display: grid; justify-content: start; width: 100%; text-align: left; }
  main { padding: 46px 17px 76px; }
  .section-title { flex-direction: column; align-items: stretch; gap: 17px; }
  .section-title h2 { font-size: 31px; }
  .section-title input { width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .dialog { padding: 24px 18px; }
  .ai-settings { grid-template-columns: 1fr; gap: 0; }
  .ai-result-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .ai-question-form { grid-template-columns: 1fr; }
  .ai-question-form .primary { min-height: 48px; }
  .ai-remaining { text-align: left; }
  .drop { min-height: 190px; padding: 36px 18px; }
  .drop-mascot { width: min(58%, 190px); }
  .privacy { margin: 0 17px 54px; padding: 34px 27px; border-radius: 23px; }
  .privacy::after { opacity: .45; }
  footer { flex-direction: column; gap: 8px; }
  .legal-shell { padding: 34px 16px 64px; }
  .legal-hero, .legal-content { padding: 24px 20px; border-radius: 20px; }
  .legal-summary { grid-template-columns: 1fr; }
}
