:root {
  --ink: #10243c;
  --muted: #68798c;
  --line: #dce4eb;
  --soft: #f4f7f9;
  --white: #ffffff;
  --brand: #2052a1;
  --brand-dark: #16385e;
  --navy: #16385e;
  --teal: #2f74bb;
  --gold: #efaa2e;
  --blue: #3d78bd;
  --shadow: 0 24px 65px rgba(19, 45, 72, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #f4f6f9;
  font-family: Arial, Helvetica, "Noto Sans SC", sans-serif;
  position: relative;
  overflow-x: hidden;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(3px);
  pointer-events: none;
  z-index: -1;
}

.ambient-one {
  width: 430px;
  height: 430px;
  right: -180px;
  top: 110px;
  background: radial-gradient(circle, rgba(32, 82, 161, .12), rgba(32, 82, 161, 0) 68%);
}

.ambient-two {
  width: 500px;
  height: 500px;
  left: -280px;
  top: 460px;
  background: radial-gradient(circle, rgba(26, 151, 140, .08), rgba(26, 151, 140, 0) 70%);
}

.site-header {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header::before { content: ""; position: absolute; left: 50%; top: 0; width: 100vw; height: 86px; transform: translateX(-50%); background: var(--brand); z-index: -1; }
.site-header { position: relative; }
.brand { display: flex; align-items: center; gap: 18px; color: white; text-decoration: none; }
.brand-mark {
  width: 178px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: auto; display: block; }

.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-copy strong { font-size: 15px; letter-spacing: -.01em; }
.brand-copy strong { color: white; }
.brand-copy small { color: rgba(255,255,255,.72); font-size: 11px; }

.language-switcher { display: flex; gap: 2px; padding: 3px; border: 1px solid rgba(255,255,255,.28); border-radius: 4px; background: rgba(0,0,0,.08); }
.language-button { min-width: 42px; padding: 8px 10px; border: 0; border-radius: 2px; color: rgba(255,255,255,.72); background: transparent; font-size: 12px; font-weight: 700; }
.language-button.active { color: var(--brand); background: white; box-shadow: none; }

main { width: min(1180px, calc(100% - 44px)); margin: 0 auto; }

.hero { text-align: left; padding: 66px 20px 58px; position: relative; overflow: hidden; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--brand); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow > span:first-child { width: 18px; height: 3px; border-radius: 0; background: var(--brand); box-shadow: none; }
.hero h1 { max-width: 820px; margin: 18px 0 14px; font-size: clamp(38px, 5.2vw, 64px); line-height: 1.04; letter-spacing: -.045em; font-weight: 700; }
.hero p { max-width: 680px; margin: 0 auto; color: var(--muted); font-size: 17px; line-height: 1.65; }
.hero p { margin-left: 0; }
.source-badge { display: inline-flex; align-items: center; gap: 8px; margin-top: 24px; padding: 8px 12px; border: 1px solid #cfd9e6; border-radius: 3px; background: white; color: #557087; font-size: 11px; font-weight: 650; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px rgba(32,82,161,.12); }
.hero-lines { position: absolute; right: 20px; top: 68px; width: 300px; height: 160px; opacity: .14; transform: skewX(-22deg); }
.hero-lines span { position: absolute; right: 0; height: 3px; background: var(--brand); }
.hero-lines span:nth-child(1) { top: 20px; width: 155px; }
.hero-lines span:nth-child(2) { top: 64px; width: 230px; }
.hero-lines span:nth-child(3) { top: 108px; width: 300px; }

.workspace-card { overflow: hidden; border: 1px solid rgba(198,210,224,.95); border-radius: 5px; background: rgba(255,255,255,.98); box-shadow: 0 18px 52px rgba(22,56,94,.12); }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; background: #f2f5f7; border-bottom: 1px solid var(--line); }
.mode-tab { display: flex; justify-content: center; align-items: center; gap: 12px; min-height: 80px; border: 0; color: var(--muted); background: transparent; position: relative; text-align: left; }
.mode-tab:first-child { border-right: 1px solid var(--line); }
.mode-tab::after { content: ""; position: absolute; left: 50%; right: 50%; bottom: -1px; height: 4px; background: var(--brand); transition: left .2s, right .2s; }
.mode-tab.active { color: var(--ink); background: white; }
.mode-tab.active::after { left: 0; right: 0; }
.mode-tab strong, .mode-tab small { display: block; }
.mode-tab strong { font-size: 14px; }
.mode-tab small { margin-top: 3px; color: #8a98a6; font-size: 11px; }
.tab-icon { font-size: 24px; color: var(--brand); font-weight: 400; }

.workspace-body { display: grid; grid-template-columns: 255px minmax(0,1fr); min-height: 550px; }
.family-panel { padding: 30px 22px; background: #f8fafb; border-right: 1px solid var(--line); }
.field-kicker { margin: 0 0 10px; color: #7f8d9b; font-size: 10px; font-weight: 800; letter-spacing: .105em; text-transform: uppercase; }
.family-option { width: 100%; min-height: 78px; margin-bottom: 10px; padding: 14px; display: grid; grid-template-columns: 37px 1fr 14px; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 4px; background: white; color: var(--ink); text-align: left; transition: border .2s, box-shadow .2s, transform .2s; }
.family-option:hover { transform: translateY(-1px); border-color: #becbd6; }
.family-option.active { border-color: rgba(32,82,161,.7); box-shadow: 0 7px 18px rgba(32,82,161,.08); }
.family-option strong, .family-option small { display: block; }
.family-option strong { margin-bottom: 4px; font-size: 13px; }
.family-option small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.radio-dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid #c5d0d9; position: relative; }
.family-option.active .radio-dot { border-color: var(--brand); }
.family-option.active .radio-dot::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: var(--brand); }
.family-icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: #edf2f5; position: relative; }
.family-option.active .family-icon { background: #edf3fb; }
.monitor-icon i { display: block; width: 21px; height: 14px; border: 2px solid currentColor; border-radius: 2px; color: #65798c; position: relative; }
.monitor-icon i::after { content: ""; position: absolute; left: 7px; top: 13px; width: 7px; height: 4px; border-bottom: 2px solid currentColor; }
.aio-icon i { display: block; width: 20px; height: 17px; border: 2px solid #65798c; border-radius: 3px; box-shadow: inset 0 -4px #d2dbe2; }
.family-option.active .family-icon i { color: var(--brand); border-color: var(--brand); }
.family-note { margin-top: 22px; display: flex; gap: 9px; padding: 14px; border: 1px solid #e0e7ec; border-radius: 10px; background: white; }
.family-note > span { flex: 0 0 17px; width: 17px; height: 17px; border-radius: 50%; color: white; background: #94a4b3; display: grid; place-items: center; font-family: Georgia, serif; font-size: 11px; font-weight: 700; }
.family-note p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }

.main-panel { padding: 34px 38px 38px; min-width: 0; }
.mode-panel { display: none; }
.mode-panel.active { display: block; animation: fade .24s ease; }
@keyframes fade { from { opacity: .2; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.panel-heading h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.text-button { padding: 6px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
.text-button:hover { color: var(--brand-dark); }

.code-input-wrap { padding: 7px; display: grid; grid-template-columns: minmax(0,1fr) auto; border: 1px solid #cad5de; border-radius: 12px; background: white; box-shadow: 0 2px 10px rgba(26,48,70,.05); }
.code-input-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(32,82,161,.09); }
#code-input { min-width: 0; padding: 13px 14px; border: 0; outline: 0; color: var(--navy); background: transparent; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: clamp(13px, 1.55vw, 18px); font-weight: 750; letter-spacing: .01em; text-transform: uppercase; }
.primary-button { padding: 13px 18px; display: flex; align-items: center; gap: 17px; border: 0; border-radius: 3px; background: var(--brand); color: white; font-size: 12px; font-weight: 750; box-shadow: 0 7px 18px rgba(32,82,161,.2); }
.primary-button:hover { background: var(--brand-dark); }
.primary-button b { font-size: 16px; font-weight: 500; }
.examples { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 13px; color: #8b98a4; font-size: 10px; }
.examples button { padding: 5px 8px; border: 1px solid #e1e7ec; border-radius: 6px; color: #607286; background: #f8fafb; font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; }
.examples button:hover { border-color: #c7d2db; color: var(--ink); }
.message { margin-top: 18px; padding: 13px 15px; border-radius: 9px; font-size: 12px; line-height: 1.5; }
.message.error { color: #87301d; background: #fff0ec; border: 1px solid #ffd1c6; }
.message.info { color: #355c75; background: #eff7fb; border: 1px solid #cfe4ef; }

.results { margin-top: 34px; padding-top: 27px; border-top: 1px solid var(--line); }
.result-topline { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.result-topline h2 { margin: 0; font-size: 19px; }
.validation-badge { padding: 7px 10px; border-radius: 999px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.validation-badge.valid { color: #26734e; background: #e7f7ee; }
.validation-badge.warning { color: #8b6518; background: #fff5d9; }
.code-visual { display: flex; align-items: stretch; flex-wrap: wrap; gap: 5px; padding: 16px; border-radius: 10px; background: var(--navy); overflow-x: auto; }
.code-segment { min-width: 31px; padding: 8px 7px; border: 1px solid rgba(255,255,255,.15); border-radius: 5px; color: white; text-align: center; font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; font-weight: 800; position: relative; }
.code-segment small { display: block; margin-top: 3px; color: rgba(255,255,255,.55); font-family: Inter, sans-serif; font-size: 7px; font-weight: 600; }
.code-segment:nth-child(4n+1) { background: rgba(255,91,53,.22); }
.code-segment:nth-child(4n+2) { background: rgba(26,151,140,.2); }
.code-segment:nth-child(4n+3) { background: rgba(239,170,46,.18); }
.code-segment:nth-child(4n+4) { background: rgba(61,120,189,.22); }
.code-divider { display: grid; place-items: center; color: rgba(255,255,255,.55); font-weight: 800; }
.result-groups { margin-top: 18px; display: grid; gap: 14px; }
.result-group { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.result-group h3 { margin: 0; padding: 10px 14px; background: #f5f7f9; color: #66788a; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.result-item { min-width: 0; padding: 12px 14px; display: grid; grid-template-columns: 28px 1fr; gap: 9px; border-top: 1px solid #edf1f4; }
.result-item:nth-child(odd) { border-right: 1px solid #edf1f4; }
.result-code { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 3px; color: var(--brand); background: #edf3fb; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; font-weight: 850; }
.result-item strong, .result-item small { display: block; overflow-wrap: anywhere; }
.result-item strong { margin-bottom: 3px; font-size: 11px; }
.result-item small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.result-item.unknown .result-code { color: #88630f; background: #fff5d9; }

.configure-heading { margin-bottom: 6px; }
.config-group { padding: 24px 0 6px; border-top: 1px solid var(--line); }
.config-group:first-child { border-top: 0; }
.config-group-title { margin: 0 0 14px; display: flex; align-items: center; gap: 10px; font-size: 12px; }
.config-group-title span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: var(--navy); color: white; font-size: 9px; }
.config-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.config-field label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; color: #566a7d; font-size: 10px; font-weight: 700; }
.config-field label code { color: #9aa7b2; font-size: 9px; }
.config-field select { width: 100%; min-height: 41px; padding: 0 34px 0 11px; border: 1px solid #d6e0e7; border-radius: 8px; outline: 0; background: white; color: var(--ink); font-size: 11px; }
.config-field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(32,82,161,.08); }
.generated-code-card { position: sticky; bottom: 14px; z-index: 3; margin-top: 24px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-radius: 11px; color: white; background: var(--navy); box-shadow: 0 12px 30px rgba(13,41,70,.22); }
.generated-code-card .field-kicker { color: #8ea3b8; margin-bottom: 5px; }
#generated-code { color: white; font-family: "SFMono-Regular", Consolas, monospace; font-size: clamp(13px, 1.65vw, 18px); font-weight: 800; }
.copy-button { flex: 0 0 auto; padding: 9px 13px; border: 1px solid rgba(255,255,255,.25); border-radius: 7px; color: white; background: rgba(255,255,255,.08); font-size: 10px; font-weight: 750; }
.copy-button:hover { background: rgba(255,255,255,.15); }

.trust-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; padding: 38px 20px 44px; }
.trust-row > div { display: flex; align-items: center; justify-content: center; gap: 12px; }
.trust-row > div > span { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 50%; color: #637688; background: #edf2f5; font-size: 12px; font-weight: 800; }
.trust-row p { margin: 0; }
.trust-row strong, .trust-row small { display: block; }
.trust-row strong { margin-bottom: 3px; font-size: 11px; }
.trust-row small { color: var(--muted); font-size: 9px; line-height: 1.4; }

footer { width: min(1180px, calc(100% - 44px)); margin: 0 auto; padding: 20px 0 34px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: #8a98a5; font-size: 9px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; padding: 11px 15px; border-radius: 8px; color: white; background: var(--navy); font-size: 11px; box-shadow: 0 10px 28px rgba(13,41,70,.22); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 820px) {
  .workspace-body { grid-template-columns: 1fr; }
  .family-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .family-panel > .field-kicker, .family-note { grid-column: 1 / -1; }
  .family-option { margin: 0; }
  .main-panel { padding: 28px 24px 30px; }
  .trust-row { grid-template-columns: 1fr; align-items: start; }
  .trust-row > div { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .site-header, main, footer { width: min(100% - 24px, 1180px); }
  .brand-copy small { display: none; }
  .brand-mark { width: 124px; height: 42px; }
  .brand-copy { display: none; }
  .hero { padding: 42px 6px 40px; text-align: center; }
  .hero h1 { font-size: 39px; }
  .hero p { font-size: 14px; }
  .hero p { margin-left: auto; }
  .hero-lines { display: none; }
  .eyebrow > span:first-child { width: 12px; }
  .source-badge { line-height: 1.35; }
  .mode-tab { min-height: 72px; gap: 7px; padding: 8px; }
  .mode-tab small { display: none; }
  .tab-icon { font-size: 19px; }
  .family-panel { grid-template-columns: 1fr; padding: 15px; }
  .family-panel > .field-kicker, .family-note { grid-column: auto; }
  .family-note { display: none; }
  .main-panel { padding: 24px 15px; }
  .code-input-wrap { grid-template-columns: 1fr; }
  #code-input { padding: 14px 10px; font-size: 13px; }
  .primary-button { justify-content: center; }
  .examples button { display: none; }
  .result-grid, .config-grid { grid-template-columns: 1fr; }
  .result-item:nth-child(odd) { border-right: 0; }
  .generated-code-card { align-items: flex-end; }
  #generated-code { overflow-wrap: anywhere; }
  footer { gap: 10px; }
  footer span:last-child { text-align: right; }
}
