:root {
  --ink: #1e293b;
  --slate: #334155;
  --canvas: #f6f4ed;
  --panel: #fffdf7;
  --line: #d9ded3;
  --green: #2f6c4f;
  --green-soft: #dfeade;
  --clay: #bc6b2f;
  --clay-soft: #f3dfcc;
  --blue: #2f5f8f;
  --red: #9a3d32;
  --muted: #647064;
  --shadow: none;
  --shadow-popover: 0 12px 34px rgba(30, 41, 59, .14);
  --radius-xl: 6px;
  --radius-lg: 6px;
  --radius-md: 4px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(47, 108, 79, .12), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(188, 107, 47, .14), transparent 26rem),
    linear-gradient(180deg, #fbfaf4 0%, var(--canvas) 48%, #ecefe5 100%);
  font-family: "Fira Sans", sans-serif;
  font-size: 17px;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .34;
  background-image: linear-gradient(135deg, rgba(30,41,59,.035) 25%, transparent 25%), linear-gradient(225deg, rgba(30,41,59,.03) 25%, transparent 25%);
  background-size: 18px 18px;
  z-index: -1;
}

h1, h2, h3, h4, .brand strong { font-family: "Fira Sans", sans-serif; letter-spacing: -.035em; }
h1 { margin: 0; font-size: clamp(2.5rem, 5.8vw, 5.4rem); line-height: .96; max-width: 980px; }
h2 { margin: .25rem 0 .75rem; font-size: clamp(1.85rem, 3.2vw, 3rem); line-height: 1.04; }
h3 { margin: 0; font-size: 1.5rem; }
h4 { margin: 0; font-size: 1.1rem; }
p { line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, select { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 14px 24px;
  margin: 14px auto 0;
  width: min(1500px, calc(100% - 28px));
  border: 1px solid rgba(217, 222, 211, .86);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 247, .96);
  backdrop-filter: blur(8px);
  box-shadow: none;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 255px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  color: #fff;
  background: linear-gradient(135deg, var(--ink), var(--green));
  font: 800 14px "Fira Sans", sans-serif;
}
.brand small { display: block; color: var(--muted); font-size: .78rem; margin-top: -2px; }
.topnav { display: flex; justify-content: center; flex: 1; gap: 8px; }
.topnav a { padding: 9px 12px; border-radius: var(--radius-md); color: var(--slate); font-weight: 500; font-size: .93rem; }
.topnav a:hover { background: var(--green-soft); color: var(--green); }
.review-chip { padding: 10px 16px; border-radius: var(--radius-md); background: var(--ink); color: #fff; font-weight: 500; }

.section-wrap { width: min(1460px, calc(100% - 36px)); margin: 34px auto; }
.hero {
  min-height: 760px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
  gap: 28px;
  align-items: stretch;
  padding-top: 50px;
}
.hero-copy, .hero-panel, .screen-card, .app-frame, .editor-frame, .approval {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 247, .92);
  box-shadow: none;
}
.hero-copy { padding: clamp(34px, 6vw, 76px); display: flex; flex-direction: column; justify-content: center; }
.eyebrow { margin: 0 0 14px; color: var(--green); text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; font-weight: 600; }
.hero-text { max-width: 780px; color: var(--slate); font-size: 1.25rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-weight: 500;
  cursor: pointer;
}
.button.primary { background: var(--green); color: #fff; box-shadow: none; }
.button.secondary { background: var(--panel); color: var(--ink); border-color: var(--line); }
.button.small { min-height: 38px; padding: 0 14px; font-size: .92rem; }
.hero-panel { position: relative; padding: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; overflow: hidden; }
.hero-panel:before { content: ""; position: absolute; width: 380px; height: 380px; right: -130px; bottom: -120px; background: rgba(47,108,79,.08); }
.theme-card { position: relative; min-height: 190px; border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid rgba(30,41,59,.12); }
.theme-card span { font-weight: 600; opacity: .8; }
.theme-card strong { font: 800 1.55rem "Fira Sans", sans-serif; }
.theme-card.navy { background: var(--ink); color: #fff; }
.theme-card.canvas { background: var(--canvas); }
.theme-card.green { background: var(--green); color: #fff; }
.floating-note { grid-column: 1 / -1; border-radius: var(--radius-lg); padding: 22px; background: var(--clay-soft); border: 1px solid rgba(188,107,47,.24); position: relative; }
.floating-note p { margin-bottom: 0; color: #6d4a2d; }

.two-col { display: grid; grid-template-columns: .8fr 1.2fr; gap: 28px; align-items: center; }
.muted { color: var(--muted); font-size: 1.15rem; }
.token-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.token { min-height: 130px; border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); box-shadow: none; }
.token b { font-family: "Fira Sans", sans-serif; }
.token.ink, .token.slate, .token.sage, .token.blue, .token.red { color: #fff; }
.token.ink { background: var(--ink); } .token.slate { background: var(--slate); } .token.paper { background: var(--canvas); } .token.panel { background: var(--panel); }
.token.sage { background: var(--green); } .token.clay { background: var(--clay-soft); } .token.blue { background: var(--blue); } .token.red { background: var(--red); }

.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.status-pill { display: inline-flex; padding: 10px 14px; border-radius: var(--radius-md); background: var(--green-soft); color: var(--green); font-weight: 600; }
.status-pill.amber { background: var(--clay-soft); color: #7b431b; }

.app-frame { display: grid; grid-template-columns: 270px 1fr; min-height: 690px; overflow: hidden; }
.sidebar { background: var(--ink); color: rgba(255,255,255,.76); padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.sidebar-title { color: #fff; font: 800 1.15rem "Fira Sans", sans-serif; margin-bottom: 18px; }
.sidebar a { padding: 12px 14px; border-radius: var(--radius-md); font-weight: 500; }
.sidebar a.active, .sidebar a:hover { background: rgba(255,255,255,.11); color: #fff; }
.sidebar-footer { margin-top: auto; padding: 14px; border-radius: var(--radius-md); background: rgba(255,255,255,.1); font-size: .9rem; }
.workspace { padding: 28px; }
.workspace-top { display: flex; justify-content: space-between; align-items: start; gap: 18px; }
.workspace-top p { color: var(--muted); margin-top: 6px; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 22px 0; }
.metric-card, .panel-card, .widget-card, .mini-window, .chart-card, .market-card, .settings-list, .desktop-site, .mobile-site {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: none;
}
.metric-card { padding: 20px; }
.metric-card span, .metric-card small { color: var(--muted); display: block; }
.metric-card strong { display: block; font: 800 2.5rem "Fira Sans", sans-serif; margin: 8px 0; }
.dashboard-grid { display: grid; grid-template-columns: 1.4fr .6fr; gap: 14px; }
.panel-card { padding: 20px; min-height: 260px; }
.card-head { display: flex; justify-content: space-between; align-items: center; }
.card-head span, .badge { padding: 5px 9px; border-radius: var(--radius-md); background: var(--clay-soft); color: #7b431b; font-weight: 600; font-size: .82rem; }
.card-head span.ok, .badge.ok { background: var(--green-soft); color: var(--green); }
.timeline { margin-top: 24px; display: grid; gap: 14px; }
.timeline p { margin: 0; padding: 14px; border-radius: var(--radius-md); background: var(--canvas); }
.health-ring { width: 170px; height: 170px; margin: 42px auto 0; border-radius: 999px; display: grid; place-items: center; font: 800 2.2rem "Fira Sans", sans-serif; color: var(--green); background: conic-gradient(var(--green) 94%, #e6e3da 0); box-shadow: inset 0 0 0 18px var(--panel); }

.editor-frame { display: grid; grid-template-columns: 245px 1fr 320px; min-height: 720px; overflow: hidden; }
.page-tree, .inspector { padding: 20px; background: rgba(255,253,247,.78); border-right: 1px solid var(--line); }
.inspector { border-right: 0; border-left: 1px solid var(--line); }
.tree-item { display: block; width: 100%; border: 0; background: transparent; padding: 11px 12px; margin: 6px 0; text-align: left; border-radius: var(--radius-md); color: var(--slate); cursor: pointer; }
.tree-item.active, .tree-item:hover { background: var(--green-soft); color: var(--green); font-weight: 500; }
.canvas { padding: 24px; background: #eef0e8; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.device-toggle { display: inline-flex; gap: 4px; padding: 5px; border-radius: var(--radius-md); background: var(--panel); border: 1px solid var(--line); margin-bottom: 18px; }
.device-toggle span { padding: 7px 12px; border-radius: var(--radius-md); font-weight: 500; color: var(--muted); }
.device-toggle span.active { background: var(--ink); color: #fff; }
.site-preview { min-height: 570px; background: var(--panel); border: 1px solid var(--line); border-radius: 0; padding: 18px; box-shadow: none; }
.preview-hero { border-radius: var(--radius-md); padding: 28px; color: #fff; background: linear-gradient(135deg, var(--ink), var(--blue)); }
.preview-hero p { margin-top: 0; color: rgba(255,255,255,.72); }
.preview-hero h3 { max-width: 640px; font-size: 2rem; }
.preview-hero button, .market-card button, .mini-window button, .desktop-site button, .mobile-site button { border: 0; border-radius: var(--radius-md); padding: 10px 13px; background: var(--green); color: #fff; font-weight: 500; margin-top: 18px; cursor: pointer; }
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.widget-card { min-height: 135px; padding: 18px; }
.widget-card.selected { outline: 3px solid rgba(47,108,79,.22); border-color: var(--green); }
.widget-card span { color: var(--muted); display: block; margin-bottom: 20px; }
.inspector-tabs { display: flex; gap: 6px; padding: 5px; background: var(--canvas); border-radius: var(--radius-md); margin-bottom: 18px; }
.inspector-tabs span { flex: 1; text-align: center; padding: 7px 0; border-radius: var(--radius-md); font-weight: 500; color: var(--muted); }
.inspector-tabs .active { background: var(--panel); color: var(--ink); }
.inspector label { display: block; margin: 14px 0; color: var(--muted); font-weight: 600; }
.inspector select {
  width: 100%;
  display: block;
  margin-top: 6px;
  min-height: 38px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background-color: var(--panel);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 400;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
.inspector select:hover { border-color: #c6cec0; }
.inspector select:focus {
  outline: 2px solid rgba(47, 108, 79, .22);
  outline-offset: 2px;
  border-color: var(--green);
}
.ai-box { margin-top: 22px; padding: 16px; border-radius: var(--radius-md); background: var(--clay-soft); border: 1px solid rgba(188,107,47,.22); }

.split-screens { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.screen-card { padding: 28px; min-height: 520px; }
.mini-window { margin-top: 22px; overflow: hidden; }
.toolbar { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: .9rem; }
th { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.badge.review { background: var(--clay-soft); color: #7b431b; } .badge.draft { background: #e8e4dc; color: var(--muted); }
.chart-card { margin-top: 22px; min-height: 230px; padding: 20px; display: flex; align-items: end; gap: 14px; }
.bar { flex: 1; border-radius: 14px 14px 0 0; background: var(--green); min-height: 50px; }
.bar.one { height: 70px; } .bar.two { height: 145px; background: var(--blue); } .bar.three { height: 100px; background: var(--clay); } .bar.four { height: 190px; } .bar.five { height: 125px; background: var(--slate); }
.insight-list p, .settings-list p { margin: 12px 0; padding: 13px; border-radius: var(--radius-md); background: var(--canvas); }
.market-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.market-card { padding: 18px; min-height: 180px; display: flex; flex-direction: column; }
.market-card span { color: var(--muted); margin-top: 8px; }
.market-card button { margin-top: auto; }
.settings-list { margin-top: 22px; padding: 14px; }

.responsive-showcase { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: end; }
.desktop-site { overflow: hidden; min-height: 520px; }
.desktop-site nav { display: flex; gap: 18px; padding: 18px 24px; border-bottom: 1px solid var(--line); align-items: center; }
.desktop-site nav b { margin-right: auto; font-family: "Fira Sans", sans-serif; }
.desktop-site section { margin: 24px; padding: 36px; border-radius: var(--radius-md); color: #fff; background: linear-gradient(135deg, var(--green), var(--ink)); }
.desktop-site section h3 { font-size: 2.3rem; max-width: 720px; }
.desktop-site section p { max-width: 720px; color: rgba(255,255,255,.8); }
.portal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 0 24px 24px; }
.portal-grid div { padding: 22px; border-radius: var(--radius-md); background: var(--canvas); font-weight: 600; }
.mobile-site { width: 320px; min-height: 520px; border-radius: 18px; padding: 24px; border: 6px solid var(--ink); background: var(--panel); }
.mobile-site h3 { margin-top: 80px; font-size: 2.4rem; }
.mobile-site p { color: var(--muted); }

.approval { padding: 34px; }
.approval-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 24px; }
.approval-grid div { padding: 18px; border-radius: var(--radius-md); background: var(--canvas); border: 1px solid var(--line); }
.approval-grid p { color: var(--muted); margin-bottom: 0; }

@media (max-width: 1100px) {
  .topnav { display: none; }
  .hero, .two-col, .split-screens, .responsive-showcase { grid-template-columns: 1fr; }
  .app-frame, .editor-frame { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: repeat(4, 1fr); }
  .sidebar-title, .sidebar-footer { grid-column: 1 / -1; }
  .page-tree, .inspector { border: 0; border-bottom: 1px solid var(--line); }
  .metric-row, .dashboard-grid, .preview-grid, .approval-grid, .token-grid, .market-grid, .portal-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .topbar { border-radius: var(--radius-lg); align-items: flex-start; }
  .review-chip { display: none; }
  .brand { min-width: 0; }
  .hero { min-height: auto; padding-top: 18px; }
  .hero-copy, .screen-card, .approval { padding: 24px; }
  .hero-panel, .metric-row, .dashboard-grid, .preview-grid, .approval-grid, .token-grid, .market-grid, .portal-grid { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: 1fr 1fr; }
  .workspace-top, .section-head { align-items: start; flex-direction: column; }
  .desktop-site section h3 { font-size: 2.1rem; }
  .mobile-site { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *:before, *:after { transition: none !important; animation: none !important; }
}


/* shadcn-oriented editor responsiveness contract preview */
.pane-contract {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 18px;
}
.pane-contract span {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: var(--radius-md);
  padding: 7px 9px;
  font-size: .78rem;
  font-weight: 500;
}
@media (max-width: 1440px) {
  .inspector .ai-box { border-left: 3px solid var(--clay); }
  .inspector .ai-box:before { content: "<1440px: AI becomes drawer"; display: block; color: #7b431b; font-weight: 600; font-size: .76rem; margin-bottom: 6px; }
}
@media (max-width: 1280px) {
  .page-tree:before { content: "<1280px: page tree collapses to drawer/icon rail"; display: block; margin-bottom: 10px; padding: 8px; border: 1px dashed var(--line); border-radius: var(--radius-md); color: var(--muted); font-size: .82rem; font-weight: 500; }
}
