/* Copyright (c) 2026 K.N.Narin (github.com/narin-kura). All rights reserved.
   Non-commercial use only. See LICENSE. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0d1224;
  color: #e2e8f0;
  min-height: 100vh;
}

/* NAV */
nav {
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: rgba(13,18,36,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #1e2d4a;
  z-index: 100;
}
.nav-logo { font-size: 22px; font-weight: 900; letter-spacing: -1px; }
.nav-logo .arch { color: #818cf8; }
.nav-logo .lens { color: #a78bfa; }
.nav-cta {
  padding: 9px 22px;
  background: linear-gradient(135deg, #3730a3, #5b21b6);
  color: #c7d2fe;
  border: none;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(55,48,163,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(55,48,163,0.5); }

/* HERO */
.hero-wrap {
  background: linear-gradient(135deg, #1e1b4b 0%, #2e1065 40%, #1a0533 100%);
  padding: 80px 24px 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero { max-width: 780px; margin: 0 auto; position: relative; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 16px;
  border-radius: 99px;
  margin-bottom: 24px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.3);
}
.hero h1 {
  font-size: clamp(32px, 6vw, 58px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: #fff;
  margin-bottom: 20px;
}
.hero h1 em { font-style: normal; color: #c4b5fd; }
.hero p {
  font-size: 18px;
  color: rgba(255,255,255,0.85);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto 36px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-white {
  padding: 13px 28px;
  background: #ede9fe;
  color: #3730a3;
  border: none;
  border-radius: 99px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}
.btn-white:hover { transform: translateY(-2px); }
.btn-outline-white {
  padding: 13px 28px;
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 99px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.btn-outline-white:hover { background: rgba(255,255,255,0.1); border-color: #fff; }

/* PREVIEW CARD */
.preview-wrap {
  max-width: 780px;
  margin: -50px auto 60px;
  padding: 0 24px;
}
.preview-box {
  background: #131d35;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(99,102,241,0.2), 0 4px 20px rgba(0,0,0,0.3);
  padding: 24px 28px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.9;
  border: 1px solid #1e2d4a;
}
.preview-header {
  font-family: -apple-system, sans-serif;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: #ef4444; } .dot-y { background: #f59e0b; } .dot-g { background: #22c55e; }
.preview-box .crit { color: #ef4444; font-weight: 700; }
.preview-box .high { color: #f97316; font-weight: 700; }
.preview-box .med  { color: #eab308; font-weight: 700; }
.preview-box .sav  { color: #10b981; font-weight: 700; }
.preview-box .fix  { color: #94a3b8; padding-left: 20px; font-size: 12px; display: block; margin-bottom: 6px; }

/* STATS */
.stats-wrap {
  max-width: 780px;
  margin: 0 auto 70px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.stat-card {
  background: #131d35;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  border: 1px solid #1e2d4a;
}
.stat-num { font-size: 32px; font-weight: 900; letter-spacing: -1px; }
.stat-num.purple { color: #a5b4fc; }
.stat-num.orange { color: #fbbf24; }
.stat-num.green  { color: #6ee7b7; }
.stat-label { font-size: 13px; color: #94a3b8; margin-top: 4px; }

/* FEATURES */
.section { max-width: 900px; margin: 0 auto 70px; padding: 0 24px; }
.section-label { text-align: center; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; margin-bottom: 10px; }
.section-title { text-align: center; font-size: clamp(22px, 4vw, 34px); font-weight: 900; letter-spacing: -0.5px; color: #e2e8f0; margin-bottom: 40px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.feature-card {
  border-radius: 16px;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
}
.feature-card.purple { background: linear-gradient(135deg, #1e1b4b, #2e1065); border: 1px solid #3730a3; color: #c4b5fd; }
.feature-card.orange { background: linear-gradient(135deg, #1c1007, #2d1a00); border: 1px solid #78350f; color: #fcd34d; }
.feature-card.teal   { background: linear-gradient(135deg, #0c1a2e, #0d2137); border: 1px solid #0e4d6e; color: #7dd3fc; }
.feature-card.green  { background: linear-gradient(135deg, #052e16, #0a2e1f); border: 1px solid #065f46; color: #6ee7b7; }
.feature-card.pink   { background: linear-gradient(135deg, #1f0a2e, #2d0f40); border: 1px solid #6b21a8; color: #d8b4fe; }
.feature-card.dark   { background: linear-gradient(135deg, #0f172a, #1e293b); border: 1px solid #334155; color: #94a3b8; }
.feature-icon { font-size: 28px; margin-bottom: 14px; }
.feature-card h3 { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.feature-card p { font-size: 13px; opacity: 0.88; line-height: 1.6; }

/* HOW IT WORKS */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.step {
  background: #131d35;
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  border: 1px solid #1e2d4a;
}
.step-num {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 900;
  margin: 0 auto 16px;
}
.step-num.s1 { background: #1e1b4b; color: #a5b4fc; }
.step-num.s2 { background: #1c1007; color: #fbbf24; }
.step-num.s3 { background: #052e16; color: #6ee7b7; }
.step h3 { font-size: 15px; font-weight: 800; margin-bottom: 8px; color: #e2e8f0; }
.step p { font-size: 13px; color: #94a3b8; line-height: 1.5; }

/* INPUT CHIPS */
.chip-wrap { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }
.chip {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border-radius: 99px;
  font-size: 13px; font-weight: 600;
  border: 2px solid;
}
.chip.c1 { background: #1e1b4b; color: #a5b4fc; border-color: #3730a3; }
.chip.c2 { background: #1c1007; color: #fbbf24; border-color: #78350f; }
.chip.c3 { background: #052e16; color: #6ee7b7; border-color: #065f46; }
.chip.c4 { background: #0c1a2e; color: #7dd3fc; border-color: #0e4d6e; }
.chip.c5 { background: #1f0a2e; color: #d8b4fe; border-color: #6b21a8; }
.chip.c6 { background: #0a2e1f; color: #86efac; border-color: #166534; }

/* DIVIDER */
hr { border: none; border-top: 2px dashed #1e2d4a; max-width: 860px; margin: 0 auto 60px; }

/* ANALYZER GUIDE */
.analyzer-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 720px) { .analyzer-guide { grid-template-columns: 1fr; } }
.ag-item {
  display: flex; gap: 11px; align-items: flex-start; text-align: left;
  background: #0a1322; border: 1.5px solid #1e2d4a; border-radius: 12px;
  padding: 14px 16px; font-family: inherit; font-size: 12.5px; color: #94a3b8;
  line-height: 1.5; cursor: pointer; transition: border-color 0.15s, transform 0.15s;
}
.ag-item:hover { border-color: #4c1d95; transform: translateY(-2px); }
.ag-emo { font-size: 20px; line-height: 1.2; }
.ag-item strong { display: block; color: #dde8ff; font-size: 13.5px; margin-bottom: 3px; }
.ag-foot { font-size: 12.5px; color: #4a6080; text-align: center; margin-bottom: 22px; line-height: 1.5; }

/* ANALYZER */
.analyzer-section { max-width: 860px; margin: 0 auto; padding: 0 24px 80px; }
.analyzer-section .section-title { text-align: left; margin-bottom: 24px; }

.input-panel {
  background: #131d35;
  border: 2px solid #1e2d4a;
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  padding: 9px 20px; border-radius: 99px;
  font-size: 13px; font-weight: 700;
  cursor: pointer; border: 2px solid #1e2d4a;
  background: transparent; color: #64748b;
  transition: all 0.15s;
}
.tab.active { background: #2e1065; color: #c4b5fd; border-color: #4c1d95; }
.tab:hover:not(.active) { border-color: #4c1d95; color: #a5b4fc; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.drop-zone {
  border: 2px dashed #2d3f6b;
  border-radius: 12px; padding: 40px;
  text-align: center; cursor: pointer;
  background: #0d1a30;
  transition: all 0.2s;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: #6366f1; background: #131d3d; }
.drop-zone input[type="file"] { display: none; }
.drop-zone .icon { font-size: 32px; margin-bottom: 10px; }
.drop-zone p { font-size: 14px; color: #818cf8; }
.drop-zone p strong { font-weight: 700; color: #a5b4fc; }
.drop-zone .file-name { margin-top: 10px; font-size: 13px; color: #818cf8; font-weight: 700; }

textarea {
  width: 100%; height: 160px;
  background: #0d1a30; border: 2px solid #1e2d4a;
  border-radius: 10px; color: #e2e8f0;
  font-size: 14px; padding: 14px; resize: vertical;
  font-family: inherit; line-height: 1.6; outline: none;
  transition: border-color 0.2s;
}
textarea:focus { border-color: #6366f1; }
textarea::placeholder { color: #3d5080; }

.analyze-btn {
  margin-top: 16px; width: 100%; padding: 14px;
  background: linear-gradient(135deg, #2e1065, #1e1b4b);
  color: #c4b5fd; border: 1px solid #4c1d95; border-radius: 10px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 20px rgba(46,16,101,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
}
.analyze-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(46,16,101,0.7); color: #ddd6fe; }
.analyze-btn:disabled { background: #1e2533; color: #4a5568; cursor: not-allowed; box-shadow: none; border-color: #1e2533; }

.loader { display: none; text-align: center; padding: 40px; }
.spinner {
  width: 38px; height: 38px;
  border: 4px solid #1e2d4a; border-top-color: #a5b4fc;
  border-radius: 50%; animation: spin 0.7s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader p { color: #64748b; font-size: 14px; font-weight: 500; }

.error-box {
  display: none; background: #450a0a; border: 1px solid #991b1b;
  border-radius: 12px; padding: 16px 20px; color: #fca5a5;
  font-size: 14px; font-weight: 500; margin-bottom: 24px;
}

/* RESULTS */
.results { display: none; }
.summary-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 28px; }
.summary-card {
  border-radius: 14px; padding: 20px 22px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
.summary-card.arch   { background: linear-gradient(135deg, #1e1b4b, #2e1065); border: 1px solid #4c1d95; color: #c4b5fd; }
.summary-card.sec    { background: linear-gradient(135deg, #450a0a, #7f1d1d); border: 1px solid #991b1b; color: #fca5a5; }
.summary-card.cost   { background: linear-gradient(135deg, #052e16, #0a2e1f); border: 1px solid #065f46; color: #6ee7b7; }
.summary-card .label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.8; margin-bottom: 6px; }
.summary-card .value { font-size: 28px; font-weight: 900; }
.summary-card .card-sub { font-size: 12px; margin-top: 5px; opacity: 0.75; }
.sev-pills { display: flex; gap: 5px; margin-top: 9px; flex-wrap: wrap; }
.sev-pill { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.sev-pill.critical { background: #7f1d1d; color: #fca5a5; border: 1px solid #ef4444; }
.sev-pill.high     { background: #431407; color: #fdba74; border: 1px solid #f97316; }
.sev-pill.medium   { background: #422006; color: #fde68a; border: 1px solid #f59e0b; }
.sev-pill.low      { background: #1c1917; color: #d6d3d1; border: 1px solid #78716c; }
.sev-pill.info     { background: #0c1a2e; color: #93c5fd; border: 1px solid #3b82f6; }
.card-tags { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.card-tag  { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 8px; background: #312e81; color: #a5b4fc; border: 1px solid #4338ca; }

.export-bar {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-bottom: 24px;
}
.export-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 99px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  border: 2px solid; text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.export-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.export-btn.json  { background: #1a1f40; color: #818cf8; border-color: #3730a3; }
.export-btn.md    { background: #0d2a1f; color: #34d399; border-color: #065f46; }

.findings-section { margin-bottom: 28px; }
.section-hdr {
  font-size: 13px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.5px; color: #64748b;
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.section-hdr .count {
  background: #1e2d4a; color: #94a3b8;
  font-size: 11px; padding: 2px 8px; border-radius: 99px;
}

.finding-card {
  background: #131d35; border: 2px solid #1e2d4a;
  border-left: 4px solid; border-radius: 12px;
  padding: 16px 18px; margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.finding-card.critical { border-left-color: #ef4444; }
.finding-card.high     { border-left-color: #f97316; }
.finding-card.medium   { border-left-color: #eab308; }
.finding-card.low      { border-left-color: #3b82f6; }
.finding-card.info     { border-left-color: #94a3b8; }

.finding-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.severity-pill {
  font-size: 10px; font-weight: 800; padding: 3px 10px;
  border-radius: 99px; text-transform: uppercase; white-space: nowrap; flex-shrink: 0;
}
.severity-pill.critical { background: #450a0a; color: #fca5a5; }
.severity-pill.high     { background: #431407; color: #fdba74; }
.severity-pill.medium   { background: #422006; color: #fcd34d; }
.severity-pill.low      { background: #0c1a2e; color: #93c5fd; }
.severity-pill.info     { background: #1e2533; color: #94a3b8; }

.finding-title { font-size: 14px; font-weight: 700; color: #e2e8f0; }
.finding-component { font-size: 12px; color: #64748b; margin-bottom: 6px; }
.finding-desc { font-size: 13px; color: #94a3b8; margin-bottom: 8px; line-height: 1.5; }
.finding-rec {
  font-size: 13px; color: #a5b4fc; background: #1a1f40;
  border-radius: 8px; padding: 8px 12px; line-height: 1.5;
}
.finding-rec::before { content: 'Fix: '; font-weight: 700; }
.finding-refs { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.finding-ref-link {
  font-size: 11px; font-weight: 700; color: #93c5fd; background: #0c1a2e;
  border: 1px solid #1e3050; border-radius: 99px; padding: 3px 10px;
  text-decoration: none; white-space: nowrap;
}
.finding-ref-link:hover { background: #142338; border-color: #2d4a73; }
.savings-badge {
  margin-left: auto; font-size: 12px; font-weight: 800;
  color: #6ee7b7; background: #052e16;
  padding: 3px 10px; border-radius: 99px; white-space: nowrap;
  border: 1px solid #065f46;
}

/* BUILDER TAB */
.analyzer-section.builder-wide { max-width: 1100px; }

.builder-intro { display:flex; align-items:center; gap:14px; background:#0a1628; border:1.5px solid #1e3050; border-radius:12px; padding:16px 20px; margin-bottom:20px; }
.builder-intro-icon { font-size:28px; flex-shrink:0; }
.builder-intro-title { font-size:15px; font-weight:800; color:#dde8ff; margin-bottom:3px; }
.builder-intro-sub { font-size:13px; color:#6b85a8; line-height:1.5; }

.builder-layout { display:flex; gap:14px; align-items:flex-start; }
.builder-main { flex:1; min-width:0; }
.builder-sidebar { width:250px; flex-shrink:0; display:flex; flex-direction:column; gap:14px; position:sticky; top:80px; }

/* ---- palette ---- */
.palette { width:212px; flex-shrink:0; display:flex; flex-direction:column; gap:8px; }
.palette-search, .palette-cat { width:100%; padding:8px 11px; background:#0d1a30; border:1.5px solid #1e2d4a; border-radius:9px; color:#e2e8f0; font-size:12.5px; outline:none; font-family:inherit; }
.palette-search:focus, .palette-cat:focus { border-color:#6366f1; }
.palette-search::placeholder { color:#4a6090; }
.palette-cat { cursor:pointer; }
.palette-list { height:532px; overflow-y:auto; display:flex; flex-direction:column; gap:3px; padding-right:4px; scrollbar-width:thin; scrollbar-color:#1e2d4a transparent; }
.palette-item { display:flex; align-items:center; gap:8px; padding:6px 8px; background:#101e36; border:1.5px solid #1b2b47; border-radius:8px; cursor:grab; user-select:none; }
.palette-item:hover { border-color:#5b4fcf; background:#16254a; }
.palette-item:active { cursor:grabbing; }
.palette-item.legacy { opacity:0.72; }
.palette-icon { font-family:monospace; font-size:10.5px; font-weight:900; color:#c4b5fd; min-width:34px; text-align:center; letter-spacing:-0.5px; }
.palette-name { font-size:12px; font-weight:650; color:#dde8ff; line-height:1.25; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.palette-legacy { font-size:8px; font-weight:800; color:#b45309; margin-left:auto; }
.palette-group-head { font-size:9.5px; font-weight:800; color:#5b74a0; text-transform:uppercase; letter-spacing:0.6px; padding:8px 2px 3px; }
.palette-hint { font-size:10.5px; color:#4a6080; text-align:center; }

/* ---- canvas ---- */
.canvas-col { flex:1; min-width:0; display:flex; flex-direction:column; gap:8px; }
.canvas-toolbar { display:flex; align-items:center; gap:7px; }
.canvas-counts { font-size:11.5px; color:#5b74a0; font-weight:600; }
.canvas-spacer { flex:1; }
.canvas-btn { padding:6px 12px; border-radius:8px; font-size:11.5px; font-weight:700; cursor:pointer; border:1.5px solid #1e2d4a; background:transparent; color:#8ba6c9; font-family:inherit; }
.canvas-btn:hover:not(:disabled) { border-color:#4c1d95; color:#c4b5fd; }
.canvas-btn:disabled { opacity:0.4; cursor:default; }
.canvas-btn.danger:hover { border-color:#7f1d1d; color:#fca5a5; }
.canvas { position:relative; height:560px; overflow:auto; background:#0a1424;
  background-image:radial-gradient(#17263f 1px, transparent 1px); background-size:22px 22px;
  border:1.5px solid #1e3050; border-radius:12px; outline:none; }
.canvas.drop-active { border-color:#6366f1; background-color:#0c1a30; }
.canvas-inner { position:relative; width:1700px; height:1100px; }
.canvas-edges { position:absolute; inset:0; width:1700px; height:1100px; pointer-events:none; overflow:visible; }
.canvas-edges path.edge { stroke:#5b6bb5; stroke-width:2; fill:none; pointer-events:stroke; cursor:pointer; }
.canvas-edges path.edge:hover { stroke:#818cf8; stroke-width:3; }
.canvas-edges path.edge.selected { stroke:#a5b4fc; stroke-width:3; }
.canvas-edges path.edge-hit { stroke:transparent; stroke-width:14; fill:none; pointer-events:stroke; cursor:pointer; }
.canvas-edges text.edge-label { fill:#8ba6c9; font-size:10.5px; font-weight:700; pointer-events:none; }
.canvas-edges path.rubber { stroke:#818cf8; stroke-width:2; stroke-dasharray:5 4; fill:none; }

.node { position:absolute; width:132px; box-sizing:border-box; padding:9px 8px 8px; background:#101e36;
  border:1.5px solid #27406b; border-radius:10px; text-align:center; cursor:grab; user-select:none;
  box-shadow:0 2px 10px rgba(0,0,0,0.28); }
.node:hover { border-color:#5b4fcf; }
.node.selected { border-color:#818cf8; box-shadow:0 0 0 2px rgba(129,140,248,0.28), 0 2px 10px rgba(0,0,0,0.3); }
.node.dragging { cursor:grabbing; z-index:50; }
.node.link-target { border-color:#34d399; box-shadow:0 0 0 2px rgba(52,211,153,0.3); }
.node-prov { font-size:8.5px; font-weight:800; text-transform:uppercase; padding:2px 6px; border-radius:99px; display:inline-block; letter-spacing:0.3px; }
.node-icon { font-size:15px; font-weight:900; color:#c4b5fd; font-family:monospace; margin:4px 0 2px; letter-spacing:-0.5px; }
.node-name { font-size:11.5px; font-weight:700; color:#dde8ff; line-height:1.25; word-break:break-word; }
.node-handle { position:absolute; right:-7px; top:50%; transform:translateY(-50%); width:14px; height:14px;
  border-radius:50%; background:#1e1b4b; border:2px solid #6366f1; cursor:crosshair; }
.node-handle:hover { background:#6366f1; }
.node-del { position:absolute; top:-7px; right:-7px; width:16px; height:16px; border-radius:50%;
  background:#2a1015; border:1.5px solid #7f1d1d; color:#fca5a5; font-size:10px; line-height:13px;
  text-align:center; cursor:pointer; display:none; font-weight:900; }
.node.selected .node-del { display:block; }

.canvas-empty { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); text-align:center;
  color:#3d5070; font-size:12.5px; line-height:1.7; pointer-events:none; }
.canvas-empty-icon { font-size:30px; margin-bottom:6px; color:#1e3050; }
.canvas-empty-sub { font-size:11.5px; color:#35496b; margin-top:4px; }

.stack-empty { font-size:13px; color:#3d5070; font-style:italic; }
.analyze-note { font-size:12px; color:#4a6080; text-align:center; line-height:1.4; }

.picker-controls { display:flex; flex-direction:column; gap:12px; margin-bottom:16px; }
.service-search { width:100%; padding:11px 16px; background:#0d1a30; border:1.5px solid #1e2d4a; border-radius:10px; color:#e2e8f0; font-size:14px; outline:none; }
.service-search:focus { border-color:#6366f1; }
.service-search::placeholder { color:#4a6090; }
.cat-tabs { display:flex; flex-wrap:wrap; gap:7px; }
.cat-tab { padding:7px 16px; border-radius:99px; font-size:13px; font-weight:700; cursor:pointer; border:1.5px solid #1e2d4a; background:transparent; color:#64748b; transition:all 0.15s; }
.cat-tab.active { background:#1e1b4b; color:#c4b5fd; border-color:#3730a3; }
.cat-tab:hover:not(.active) { border-color:#4c1d95; color:#a5b4fc; }

.group-tabs { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0 4px; }
.group-tabs:empty { display:none; }
.group-tab { padding:5px 12px; border-radius:99px; font-size:11.5px; font-weight:700; cursor:pointer; border:1px solid #16243c; background:transparent; color:#55708f; transition:all 0.15s; }
.group-tab.active { background:#0f1f3d; color:#93c5fd; border-color:#1d4ed8; }
.group-tab:hover:not(.active) { border-color:#334f7a; color:#8ba6c9; }
.group-count { font-size:10px; opacity:0.65; margin-left:4px; }
.grid-group-head { grid-column:1/-1; font-size:11px; font-weight:800; color:#5b74a0; text-transform:uppercase; letter-spacing:0.6px; padding:10px 2px 2px; border-bottom:1px solid #16243c; }
.svc-legacy { position:absolute; top:6px; left:7px; font-size:8.5px; font-weight:800; color:#b45309; background:#2a1a06; border-radius:99px; padding:2px 5px; letter-spacing:0.3px; }
.service-card.legacy .svc-icon { color:#8d7fb8; }

.service-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:10px; max-height:320px; overflow-y:auto; padding-right:6px; margin-bottom:18px; scrollbar-width:thin; scrollbar-color:#1e2d4a transparent; }
.service-card { background:#101e36; border:1.5px solid #1e3050; border-radius:12px; padding:14px 10px; cursor:pointer; text-align:center; transition:all 0.15s; user-select:none; position:relative; }
.service-card:hover { border-color:#5b4fcf; background:#16254a; transform:translateY(-2px); box-shadow:0 4px 14px rgba(0,0,0,0.3); }
.service-card.selected { border-color:#818cf8; background:#1e1d4a; box-shadow:0 0 0 2px rgba(129,140,248,0.2); }
.service-card.selected::after { content:'✓'; position:absolute; top:6px; right:9px; font-size:11px; color:#a5b4fc; font-weight:900; }
.svc-prov { font-size:10px; font-weight:800; text-transform:uppercase; padding:3px 7px; border-radius:99px; display:inline-block; margin-bottom:7px; letter-spacing:0.3px; }
.prov-aws     { background:#2a1a06; color:#fbbf24; }
.prov-gcp     { background:#062a14; color:#6ee7b7; }
.prov-azure   { background:#091f3a; color:#7dd3fc; }
.prov-generic { background:#1a1d30; color:#a3b4cc; }
.prov-nvidia  { background:#1a2906; color:#76b900; }
.svc-icon { font-size:20px; font-weight:900; color:#c4b5fd; margin:4px 0 6px; font-family:monospace; letter-spacing:-1px; }
.svc-name { font-size:13px; font-weight:700; color:#dde8ff; line-height:1.3; }

.stack-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; border-top:1px solid #1e2d4a; padding-top:16px; margin-bottom:14px; }
.stack-label { font-size:12px; font-weight:800; color:#64748b; text-transform:uppercase; white-space:nowrap; letter-spacing:0.3px; }
.stack-chips { display:flex; flex-wrap:wrap; gap:6px; flex:1; min-height:28px; }
.stack-chip { display:flex; align-items:center; gap:5px; padding:5px 12px; border-radius:99px; font-size:12px; font-weight:700; background:#1e1b4b; color:#c4b5fd; border:1.5px solid #3730a3; cursor:pointer; }
.stack-chip:hover { background:#2d1d6b; }
.stack-chip-x { font-size:10px; color:#818cf8; }
.continue-btn { padding:11px 24px; border-radius:99px; font-size:14px; font-weight:800; cursor:pointer; background:linear-gradient(135deg,#3730a3,#4c1d95); color:#ddd6fe; border:none; transition:transform 0.15s,opacity 0.15s,box-shadow 0.15s; white-space:nowrap; box-shadow:0 4px 16px rgba(55,48,163,0.4); }
.continue-btn:hover:not(:disabled) { transform:translateY(-2px); box-shadow:0 6px 22px rgba(55,48,163,0.6); }
.continue-btn:disabled { opacity:0.3; cursor:not-allowed; box-shadow:none; }

.sugg-panel { background:#0a1322; border:1.5px solid #1e2d4a; border-radius:12px; padding:16px 18px; }
.sugg-title { font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:0.5px; color:#64748b; margin-bottom:12px; }
.sugg-item { display:flex; align-items:flex-start; gap:9px; font-size:13px; color:#94a3b8; margin-bottom:9px; line-height:1.5; }
.sugg-item.warn { color:#fdba74; }
.sugg-item.good { color:#6ee7b7; }
.sugg-item.crit { color:#fca5a5; }
.sugg-item.info { color:#93c5fd; }
.sugg-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; margin-top:4px; }
.sugg-dot.warn { background:#f97316; }
.sugg-dot.good { background:#34d399; }
.sugg-dot.crit { background:#ef4444; }
.sugg-dot.info { background:#60a5fa; }

/* CANVAS (step 2) */
.canvas-header { display:flex; align-items:center; gap:9px; margin-bottom:12px; flex-wrap:wrap; }
.mode-btn { padding:9px 18px; border-radius:99px; font-size:13px; font-weight:700; cursor:pointer; border:1.5px solid #1e2d4a; background:transparent; color:#64748b; transition:all 0.15s; }
.mode-btn.active { background:#1e1b4b; color:#c4b5fd; border-color:#3730a3; }
.mode-btn.danger { color:#f87171; border-color:#991b1b; }
.mode-btn.danger:hover { background:#450a0a; color:#fca5a5; }
.mode-btn:hover:not(.active):not(.danger) { border-color:#4c1d95; color:#a5b4fc; }
.mode-hint { font-size:13px; color:#4a6080; margin-left:auto; font-style:italic; }

.canvas-wrap { display:flex; gap:14px; align-items:flex-start; }
.diagram-canvas {
  flex:1; position:relative; height:520px; min-width:0;
  background:#07101e;
  background-image:
    linear-gradient(rgba(99,102,241,0.06) 1px,transparent 1px),
    linear-gradient(90deg,rgba(99,102,241,0.06) 1px,transparent 1px);
  background-size:32px 32px;
  border:1.5px solid #1e2d4a; border-radius:14px; overflow:hidden;
}
.edge-layer { position:absolute; top:0; left:0; width:100%; height:100%; pointer-events:none; overflow:visible; }
.diagram-node { position:absolute; min-width:130px; background:#131d35; border:2px solid #253554; border-radius:10px; padding:10px 14px; user-select:none; z-index:10; transition:border-color 0.12s,box-shadow 0.12s; box-shadow:0 2px 8px rgba(0,0,0,0.4); }
.diagram-node.connect-mode:hover { border-color:#6366f1; box-shadow:0 0 0 2px rgba(99,102,241,0.2); }
.diagram-node.connect-source { border-color:#818cf8; box-shadow:0 0 0 4px rgba(129,140,248,0.3); }
.node-badge { font-size:10px; font-weight:800; text-transform:uppercase; padding:3px 8px; border-radius:99px; display:inline-block; margin-bottom:5px; letter-spacing:0.3px; }
.node-name { font-size:14px; font-weight:700; color:#e2e8f0; line-height:1.3; }
.node-prov { font-size:11px; color:#64748b; margin-top:2px; text-transform:uppercase; letter-spacing:0.3px; }
.nt-COMPUTE    { background:#1e1b4b; color:#a5b4fc; }
.nt-DATABASE   { background:#0e4d6e; color:#7dd3fc; }
.nt-STORAGE    { background:#2a1800; color:#fbbf24; }
.nt-SERVERLESS { background:#2d0a4e; color:#d8b4fe; }
.nt-CONTAINER  { background:#0a2e1f; color:#6ee7b7; }
.nt-NETWORK    { background:#0c2a1a; color:#86efac; }
.nt-IAM        { background:#3d1a00; color:#fdba74; }
.nt-MONITORING { background:#221f00; color:#fde047; }
.nt-QUEUE      { background:#1a0a2e; color:#c4b5fd; }
.nt-CACHE      { background:#2a0808; color:#fca5a5; }
.nt-CDN        { background:#002828; color:#5eead4; }
.nt-GATEWAY    { background:#221800; color:#fcd34d; }
.nt-OTHER      { background:#1a1e28; color:#94a3b8; }

.canvas-sugg { width:240px; flex-shrink:0; background:#0a1322; border:1.5px solid #1e2d4a; border-radius:14px; padding:16px 18px; max-height:520px; overflow-y:auto; scrollbar-width:thin; scrollbar-color:#1e2d4a transparent; }
.canvas-footer { display:flex; justify-content:space-between; align-items:center; margin-top:16px; }
.back-btn { padding:10px 22px; border-radius:99px; font-size:13px; font-weight:700; cursor:pointer; border:1.5px solid #1e2d4a; background:transparent; color:#64748b; transition:all 0.15s; }
.back-btn:hover { border-color:#4c1d95; color:#a5b4fc; }
.builder-analyze-btn { padding:13px 32px; border-radius:99px; font-size:14px; font-weight:800; cursor:pointer; background:linear-gradient(135deg,#2e1065,#1e1b4b); color:#ddd6fe; border:1px solid #4c1d95; box-shadow:0 4px 20px rgba(46,16,101,0.5); transition:transform 0.15s,box-shadow 0.15s; }
.builder-analyze-btn:hover:not(:disabled) { transform:translateY(-2px); box-shadow:0 6px 28px rgba(46,16,101,0.7); }
.builder-analyze-btn:disabled { opacity:0.35; cursor:not-allowed; box-shadow:none; }

/* RECOMMEND TAB */
.rec-form { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; margin-bottom:18px; }
.rec-field { display:flex; flex-direction:column; gap:6px; }
.rec-field label { font-size:12px; font-weight:800; color:#64748b; text-transform:uppercase; letter-spacing:0.3px; }
.rec-select, .rec-multiselect { width:100%; padding:10px 14px; background:#0d1a30; border:1.5px solid #1e2d4a; border-radius:10px; color:#e2e8f0; font-size:14px; outline:none; font-family:inherit; }
.rec-select:focus, .rec-multiselect:focus { border-color:#6366f1; }
.rec-multiselect { height:150px; }
.rec-multiselect optgroup { color:#64748b; font-weight:800; font-style:normal; }
.rec-multiselect option { color:#dde8ff; padding:3px 0; }
.rec-field-wide { grid-column:1/-1; }
.rec-checkbox-row { display:flex; align-items:center; gap:8px; grid-column:1/-1; }
.rec-checkbox-row input { width:16px; height:16px; accent-color:#6366f1; }
.rec-checkbox-row label { font-size:13px; color:#94a3b8; font-weight:600; text-transform:none; letter-spacing:normal; }
.rec-submit-btn { padding:13px 32px; border-radius:99px; font-size:14px; font-weight:800; cursor:pointer; background:linear-gradient(135deg,#3730a3,#4c1d95); color:#ddd6fe; border:none; box-shadow:0 4px 16px rgba(55,48,163,0.4); transition:transform 0.15s,box-shadow 0.15s; }
.rec-submit-btn:hover:not(:disabled) { transform:translateY(-2px); box-shadow:0 6px 22px rgba(55,48,163,0.6); }
.rec-submit-btn:disabled { opacity:0.4; cursor:not-allowed; }

.rec-result { margin-top:22px; border-top:1px solid #1e2d4a; padding-top:18px; }
.rec-summary { background:#0a1628; border:1.5px solid #1e3050; border-radius:12px; padding:14px 18px; font-size:13px; color:#cbd5e1; line-height:1.6; margin-bottom:16px; }
.rec-list-title, .rec-tips-title { font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:0.5px; color:#64748b; margin:16px 0 10px; }
.rec-item { display:flex; gap:12px; align-items:flex-start; padding:10px 0; border-bottom:1px solid #16213b; }
.rec-item:last-child { border-bottom:none; }
.rec-item-name { display:flex; flex-direction:column; gap:3px; min-width:180px; flex-shrink:0; font-size:13px; font-weight:700; color:#dde8ff; }
.rec-item-why { font-size:13px; color:#94a3b8; line-height:1.5; padding-top:1px; }
.rec-role { font-size:10px; font-weight:800; color:#64748b; text-transform:uppercase; letter-spacing:0.3px; }
.rec-tips { font-size:13px; color:#94a3b8; line-height:1.6; padding-left:18px; margin:0; }
.rec-tips li { margin-bottom:6px; }
.rec-use-btn { margin-top:18px; }

.warn-banner { background:#422006; border:1px solid #92400e; border-radius:10px; padding:12px 16px; color:#fcd34d; font-size:13px; font-weight:600; margin-bottom:20px; }
.text-hint { font-size:12px; margin-top:8px; min-height:18px; font-weight:600; }
.text-hint.bad  { color:#f87171; }
.text-hint.good { color:#34d399; }

/* FOOTER */
footer {
  background: #1e293b; color: #94a3b8;
  padding: 28px 40px; text-align: center; font-size: 13px;
}
footer a { color: #818cf8; text-decoration: none; font-weight: 600; }
footer a:hover { color: #a5b4fc; }

/* MOBILE */
@media (max-width: 860px) {
  .builder-layout { flex-direction: column; }
  .builder-sidebar { width: 100%; position: static; top: auto; }
  /* Palette collapses to a short strip above the canvas; the canvas
     keeps its full drawing area and scrolls. */
  .palette { width: 100%; }
  .palette-list { height: 190px; }
  .canvas-col { width: 100%; }
  .canvas { height: 440px; }
}
@media (max-width: 640px) {
  nav { padding: 14px 18px; }
  .nav-logo { font-size: 19px; }
  .nav-cta { padding: 8px 16px; font-size: 13px; }
  footer { padding: 24px 18px; }

  .stats-wrap { gap: 8px; padding: 0 16px; }
  .stat-card { padding: 14px 6px; }
  .stat-num { font-size: 22px; }
  .stat-label { font-size: 10.5px; }

  .tab { padding: 8px 14px; font-size: 12px; }

  .summary-bar { grid-template-columns: 1fr; }
  .summary-card .value { font-size: 22px; word-break: break-word; }
}

/* ===== multi-page navigation ===== */
.nav-links { display:flex; gap:4px; margin-left:26px; flex:1; }
.nav-link { padding:7px 13px; border-radius:8px; font-size:13.5px; font-weight:650; color:#8ba6c9;
  text-decoration:none; transition:all .15s; }
.nav-link:hover { color:#c4b5fd; background:#141f3a; }
.nav-link.active { color:#c4b5fd; background:#1e1b4b; }
a.nav-logo { text-decoration:none; }

.page-section { max-width:1180px; margin:0 auto; padding:46px 24px 60px; }
.page-lede { color:#7e95b8; font-size:14.5px; line-height:1.75; max-width:760px; margin:-6px 0 26px; }
.page-lede a { color:#818cf8; }

@media (max-width: 760px) {
  .nav-links { margin-left:10px; gap:0; flex-wrap:wrap; }
  .nav-link { padding:6px 9px; font-size:12.5px; }
  .page-section { padding:30px 16px 44px; }
}
