:root {
  --bg: #0e141b;
  --bg2: #121a23;
  --panel: #ffffff;
  --panel2: #f4f7fb;
  --ink: #111827;
  --muted: #657386;
  --line: #d9e3ee;
  --blue: #2368ff;
  --teal: #0c8f7b;
  --amber: #c27606;
  --red: #c84646;
  --green: #15845a;
  --violet: #7357d8;
  --shadow: 0 18px 54px rgba(11, 22, 36, .16);
  --radius: 8px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(14,20,27,.97), rgba(18,26,35,.95)),
    radial-gradient(circle at 20% 10%, rgba(35,104,255,.25), transparent 28rem),
    radial-gradient(circle at 90% 15%, rgba(12,143,123,.22), transparent 22rem);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 18px;
  color: #e8eef7;
  border-right: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(180deg, rgba(12,18,26,.96), rgba(18,26,35,.92));
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: var(--radius); color: #fff; font-weight: 900; background: conic-gradient(from 210deg, var(--blue), var(--teal), #f1a93b, var(--blue)); box-shadow: 0 12px 28px rgba(35,104,255,.28); }
.brand strong, .brand span { display: block; }
.brand span { color: #9eb0c5; font-size: .86rem; margin-top: 2px; }
.module-nav { display: grid; align-content: start; gap: 7px; overflow: auto; padding-right: 2px; }
.module-nav button { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 10px; min-height: 48px; width: 100%; border: 1px solid transparent; border-radius: var(--radius); padding: 8px 10px; text-align: left; color: #aebdcd; background: transparent; }
.module-nav button:hover, .module-nav button.active { color: #fff; border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.08); }
.ico { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius); color: #fff; background: var(--blue); font-size: .72rem; font-weight: 900; letter-spacing: 0; }
.module-nav button:nth-child(3n) .ico { background: var(--teal); }
.module-nav button:nth-child(4n) .ico { background: var(--amber); }
.module-nav button:nth-child(5n) .ico { background: var(--violet); }
.module-nav small { display: block; margin-top: 2px; color: #8fa1b5; font-size: .74rem; }
.rail-foot { display: grid; gap: 8px; font-size: .84rem; color: #aebdcd; }
.rail-foot span { padding: 9px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); background: rgba(255,255,255,.06); overflow-wrap: anywhere; }
.main { min-width: 0; padding: 22px; background: linear-gradient(135deg, #f6f9fc 0%, #eef3f7 62%, #eaf6f2 100%); }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.eyebrow { margin: 0 0 5px; color: var(--teal); font-weight: 900; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
h1 { margin: 0; font-size: clamp(1.65rem, 1.1rem + 1.8vw, 3rem); line-height: 1.05; letter-spacing: 0; }
h2, h3, h4, p { letter-spacing: 0; }
.top-actions, .actions { display: flex; flex-wrap: wrap; gap: 8px; }
button, .btn { min-height: 40px; border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 12px; color: var(--ink); background: #fff; text-decoration: none; }
button.primary, .btn.primary { color: #fff; border-color: var(--blue); background: var(--blue); }
button.warn { color: #fff; border-color: var(--amber); background: var(--amber); }
button.danger { color: #fff; border-color: var(--red); background: var(--red); }
.view { display: grid; gap: 16px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 16px; }
.panel, .card, .tool-card, .output-card { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.panel { padding: 18px; }
.hero-main { min-height: 268px; padding: 26px; overflow: hidden; background:
  linear-gradient(90deg, rgba(255,255,255,.96), rgba(255,255,255,.83)),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='360' viewBox='0 0 1200 360'%3E%3Crect width='1200' height='360' fill='%23edf4fa'/%3E%3Cg fill='none' stroke='%232368ff' stroke-width='2' opacity='.34'%3E%3Cpath d='M30 292h160l78-126h190l82 78h170l92-152h350'/%3E%3Cpath d='M78 92h150l88 90h150l76-54h190l92 112h260'/%3E%3Cpath d='M0 214h260l70 64h190l110-178h160l72 78h320'/%3E%3C/g%3E%3Cg fill='%23ffffff' stroke='%23111827' stroke-opacity='.16'%3E%3Ccircle cx='190' cy='292' r='14'/%3E%3Ccircle cx='268' cy='166' r='14'/%3E%3Ccircle cx='540' cy='244' r='14'/%3E%3Ccircle cx='802' cy='92' r='14'/%3E%3Ccircle cx='990' cy='240' r='14'/%3E%3C/g%3E%3C/svg%3E"); background-size: cover; background-position: center; }
.hero-main h2 { max-width: 820px; margin: 0; font-size: clamp(2rem, 1.25rem + 2.4vw, 3.6rem); line-height: 1.02; }
.hero-main p { max-width: 760px; color: #3f4f61; line-height: 1.58; font-size: 1.05rem; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.badge { display: inline-flex; align-items: center; min-height: 30px; padding: 6px 9px; border-radius: 999px; background: #eef4fa; color: #506176; font-size: .83rem; }
.assistant { display: grid; grid-template-rows: auto 1fr auto; min-height: 268px; padding: 16px; }
.assistant-log { min-height: 150px; max-height: 310px; overflow: auto; display: grid; align-content: start; gap: 10px; }
.msg { padding: 11px 12px; border-radius: var(--radius); line-height: 1.45; white-space: pre-wrap; background: #f4f7fb; }
.msg.user { background: #eaf2ff; border-left: 4px solid var(--blue); }
.msg.ai { background: #ecf8f4; border-left: 4px solid var(--teal); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card, .tool-card, .output-card { padding: 16px; min-width: 0; }
.card h3, .tool-card h3, .output-card h3, .panel h3 { margin: 0 0 6px; font-size: 1.04rem; }
.card p, .tool-card p, .output-card p, .panel p { color: var(--muted); line-height: 1.45; margin: 0 0 12px; }
.kpi { display: grid; gap: 4px; min-height: 92px; }
.kpi strong { font-size: 1.7rem; line-height: 1; }
.kpi span { color: var(--muted); font-size: .86rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: grid; gap: 7px; color: #344253; font-size: .84rem; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: #fff; outline: none; }
input, select { min-height: 40px; padding: 9px 10px; }
textarea { min-height: 112px; resize: vertical; padding: 10px; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: rgba(35,104,255,.72); box-shadow: 0 0 0 3px rgba(35,104,255,.12); }
pre, .result { min-height: 52px; max-height: 520px; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #f9fbfd; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; line-height: 1.5; }
.good { border-color: rgba(21,132,90,.35); background: rgba(21,132,90,.08); }
.warnbox { border-color: rgba(194,118,6,.38); background: rgba(255,177,59,.1); }
.errbox { border-color: rgba(200,70,70,.34); background: rgba(200,70,70,.08); }
.checklist, .picker { display: grid; gap: 8px; }
.checkline { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.checkline input { width: 16px; height: 16px; min-height: 0; margin-top: 2px; }
.checkline small { display: block; margin-top: 2px; color: var(--muted); font-size: .75rem; }
.app-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-height: 560px; overflow: auto; padding-right: 4px; }
.app-group { display: grid; gap: 7px; align-content: start; }
.app-group h4 { margin: 0; color: var(--teal); font-size: .78rem; letter-spacing: .08em; }
.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
@media (max-width: 1180px) { .hero, .grid, .grid.two, .grid.four { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .app-shell { grid-template-columns: 1fr; } .rail { position: static; height: auto; } .module-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } .main { padding: 14px; } .topline { align-items: flex-start; flex-direction: column; } .form-grid, .form-grid.three { grid-template-columns: 1fr; } .app-picker { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .module-nav { grid-template-columns: 1fr; } .main { padding: 10px; } .hero-main { padding: 16px; } .hero-main h2 { font-size: 1.28rem; line-height: 1.16; max-width: 300px; } .hero-main p { font-size: .94rem; max-width: 300px; } .top-actions { width: 100%; display: grid; grid-template-columns: 1fr; } .top-actions button { width: 100%; } }

/* Compatibility for expanded module renderers */
.hero-panel { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 16px; align-items: stretch; }
.hero-copy { min-height: 268px; padding: 26px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(90deg, rgba(255,255,255,.96), rgba(255,255,255,.83)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='360' viewBox='0 0 1200 360'%3E%3Crect width='1200' height='360' fill='%23edf4fa'/%3E%3Cg fill='none' stroke='%232368ff' stroke-width='2' opacity='.34'%3E%3Cpath d='M30 292h160l78-126h190l82 78h170l92-152h350'/%3E%3Cpath d='M78 92h150l88 90h150l76-54h190l92 112h260'/%3E%3C/g%3E%3C/svg%3E"); background-size: cover; background-position: center; box-shadow: var(--shadow); }
.hero-copy h2 { max-width: 820px; margin: 0; font-size: clamp(2rem, 1.25rem + 2.4vw, 3.6rem); line-height: 1.02; }
.hero-copy p { max-width: 760px; color: #3f4f61; line-height: 1.58; font-size: 1.05rem; }
.assistant-box { display: grid; grid-template-rows: auto 1fr auto; min-height: 268px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.assistant-input { display: grid; gap: 8px; margin-top: 12px; }
@media (max-width: 1180px) { .hero-panel { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .hero-copy { padding: 16px; } .hero-copy h2 { font-size: 1.28rem !important; line-height: 1.16 !important; max-width: 300px; } .hero-copy p { font-size: .94rem; max-width: 300px; } }
