:root {
  --ink: #17211f;
  --ink-2: #243330;
  --muted: #6c7974;
  --paper: #f8f6ef;
  --porcelain: #fffdf7;
  --line: rgba(37, 53, 48, 0.12);
  --deep: #0d1816;
  --pine: #123f37;
  --pine-2: #1f6a5c;
  --jade: #8fb8a4;
  --copper: #b7814d;
  --gold: #d2ad73;
  --cyan: #2e8793;
  --red: #b94c3f;
  --shadow: 0 24px 70px rgba(17, 28, 25, 0.13);
  --soft-shadow: 0 10px 28px rgba(17, 28, 25, 0.09);
  --radius: 8px;
  --font-title: "STSong", "Songti SC", "Noto Serif CJK SC", serif;
  --font-ui: "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-ui);
  letter-spacing: 0;
  background:
    linear-gradient(90deg, rgba(18, 63, 55, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(18, 63, 55, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(183, 129, 77, 0.12), transparent 28%),
    linear-gradient(135deg, #eff0e7 0%, #f8f6ef 48%, #e4ece6 100%);
  background-size: 34px 34px, 34px 34px, auto, auto;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  color: rgba(255, 253, 247, 0.92);
  background:
    linear-gradient(90deg, rgba(210, 173, 115, 0.11) 1px, transparent 1px),
    linear-gradient(180deg, #0d1816 0%, #142925 60%, #0b1413 100%);
  background-size: 26px 26px, auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 8px 22px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-family: var(--font-title);
  font-size: 24px;
  color: #17211f;
  background: linear-gradient(135deg, var(--gold), #f7e7bd);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.25);
}

.brand strong {
  display: block;
  font-size: 19px;
}

.brand span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 253, 247, 0.6);
  font-size: 12px;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px 8px 18px;
}

.role-pill,
.nav-item {
  width: 100%;
  border: 0;
  text-align: left;
  color: rgba(255, 253, 247, 0.72);
  background: transparent;
  border-radius: 8px;
  transition: 0.18s ease;
}

.role-pill {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.role-pill.active {
  color: var(--porcelain);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(210, 173, 115, 0.42);
}

.nav {
  display: none;
  padding: 6px 8px 20px;
}

.nav.active {
  display: block;
}

.is-hidden {
  display: none !important;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 5px;
  padding: 11px 12px;
  font-size: 14px;
}

.nav-item span {
  width: 28px;
  color: rgba(210, 173, 115, 0.9);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.nav-item:hover,
.nav-item.active {
  color: #fffdf7;
  background: linear-gradient(90deg, rgba(143, 184, 164, 0.16), rgba(255, 255, 255, 0.04));
}

.side-foot {
  margin: 18px 8px 0;
  padding: 14px;
  color: rgba(255, 253, 247, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.side-foot span,
.side-foot strong {
  display: block;
}

.side-foot strong {
  margin-top: 4px;
  color: var(--porcelain);
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding: 18px 20px;
  background: rgba(255, 253, 247, 0.74);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--copper);
  font-size: 12px;
  font-weight: 700;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-family: var(--font-title);
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 700;
}

h2 {
  font-family: var(--font-title);
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1.05;
}

h3 {
  font-size: 21px;
}

h4 {
  font-size: 17px;
}

p {
  color: var(--muted);
  line-height: 1.75;
}

.top-actions,
.hero-actions,
.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-btn,
.ghost-btn,
.line-btn,
.mini-btn {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.primary-btn {
  color: var(--porcelain);
  background: linear-gradient(135deg, var(--pine), #1f5b50);
  box-shadow: 0 12px 28px rgba(18, 63, 55, 0.24);
}

.primary-btn:hover {
  transform: translateY(-1px);
}

.ghost-btn,
.line-btn,
.mini-btn {
  color: var(--ink);
  background: rgba(255, 253, 247, 0.72);
  border-color: var(--line);
}

.mini-btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.full {
  width: 100%;
}

.page {
  display: none;
  animation: rise 0.28s ease both;
}

.page.active {
  display: block;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(420px, 1.14fr);
  gap: 24px;
  min-height: 570px;
  align-items: stretch;
}

.hero-copy {
  position: relative;
  padding: clamp(34px, 5vw, 64px);
  background: rgba(255, 253, 247, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-copy::after {
  content: "";
  position: absolute;
  inset: auto -70px -90px auto;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(18, 63, 55, 0.12);
  border-radius: 50%;
}

.hero-copy p {
  max-width: 620px;
  margin: 22px 0 28px;
  font-size: 17px;
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 26px;
  padding: 8px 11px;
  color: var(--pine);
  background: #edf4ee;
  border: 1px solid rgba(18, 63, 55, 0.12);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.status-line span {
  width: 8px;
  height: 8px;
  background: var(--pine-2);
  border-radius: 50%;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 44px;
}

.metric-row div,
.feature-card,
.template-card,
.compare-panel,
.main-panel,
.insight-panel,
.document-canvas,
.suggestion-panel,
.table-panel,
.export-card,
.stat-card,
.admin-card,
.case-grid article,
.login-panel,
.access-hero,
.risk-matrix article {
  background: rgba(255, 253, 247, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.metric-row div {
  padding: 16px;
}

.metric-row strong {
  display: block;
  color: var(--pine);
  font-size: 26px;
}

.metric-row span {
  color: var(--muted);
  font-size: 13px;
}

.route-board {
  position: relative;
  min-height: 570px;
  padding: 22px;
  color: var(--porcelain);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(135deg, #0d1816, #183d36 58%, #0f211e);
  background-size: 28px 28px, 28px 28px, auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.route-board::before {
  content: "";
  position: absolute;
  inset: 56px 18px 38px;
  border: 1px solid rgba(210, 173, 115, 0.18);
  border-radius: 8px;
}

.route-head {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.route-head span {
  font-family: var(--font-title);
  font-size: 24px;
}

.route-head strong {
  color: rgba(255, 253, 247, 0.68);
  font-size: 13px;
}

.map-layer {
  position: absolute;
  inset: 82px 22px 28px;
  overflow: hidden;
}

.map-layer::before {
  content: "";
  position: absolute;
  inset: 40px;
  opacity: 0.38;
  background:
    repeating-radial-gradient(ellipse at 45% 48%, transparent 0 17px, rgba(210, 173, 115, 0.2) 18px 19px),
    repeating-radial-gradient(ellipse at 65% 62%, transparent 0 26px, rgba(143, 184, 164, 0.16) 27px 28px);
}

.map-layer svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-layer path {
  fill: none;
  stroke: rgba(210, 173, 115, 0.86);
  stroke-width: 4;
  stroke-linecap: round;
}

.map-layer path + path {
  stroke: rgba(143, 184, 164, 0.5);
  stroke-width: 2;
}

.map-layer circle {
  fill: var(--gold);
  stroke: var(--porcelain);
  stroke-width: 3;
}

.pin {
  position: absolute;
  z-index: 3;
  padding: 7px 10px;
  color: var(--deep);
  background: var(--gold);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.26);
}

.pin-a {
  left: 6%;
  top: 68%;
}

.pin-b {
  left: 38%;
  top: 51%;
}

.pin-c {
  left: 61%;
  top: 18%;
}

.pin-d {
  right: 5%;
  top: 32%;
}

.floating-card {
  position: absolute;
  right: 34px;
  bottom: 34px;
  width: min(340px, calc(100% - 68px));
  padding: 18px;
  background: rgba(255, 253, 247, 0.92);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.26);
}

.floating-card span,
.floating-card small {
  display: block;
  color: var(--muted);
}

.floating-card strong {
  display: block;
  margin: 6px 0;
  color: var(--pine);
}

.section-head,
.panel-head,
.template-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-head {
  margin: 28px 0 14px;
}

.feature-grid,
.template-grid,
.export-grid,
.stat-grid,
.three-column,
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.feature-card,
.template-card,
.export-card,
.stat-card,
.admin-card,
.case-grid article {
  padding: 22px;
}

.feature-card span,
.export-card span,
.admin-card span,
.case-grid span,
.template-top span,
.stat-card span {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--copper);
  font-size: 12px;
  font-weight: 800;
}

.feature-card p,
.template-card p,
.export-card p,
.admin-card p,
.case-grid p {
  margin-top: 10px;
}

.dashboard-layout,
.config-layout,
.module-layout,
.access-layout,
.pricing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
}

.access-layout {
  grid-template-columns: minmax(0, 1fr) 420px;
}

.aesthetic-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(420px, 1.15fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 16px;
  padding: 28px;
  color: var(--porcelain);
  background:
    linear-gradient(90deg, rgba(210, 173, 115, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(210, 173, 115, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, #071f1b, #173e37 62%, #241b12);
  background-size: 28px 28px, 28px 28px, auto;
  border-radius: 8px;
  overflow: hidden;
}

.aesthetic-hero h2 {
  margin: 8px 0 12px;
  color: var(--porcelain);
  font-family: var(--font-title);
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.05;
}

.aesthetic-hero p {
  max-width: 620px;
  color: rgba(255, 253, 247, 0.78);
}

.flow-board.compact {
  align-self: center;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
}

.aesthetic-grid,
.aesthetic-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.aesthetic-card,
.aesthetic-lane {
  display: grid;
  gap: 12px;
  min-height: 230px;
  padding: 22px;
  background: rgba(255, 253, 247, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 45px rgba(12, 30, 26, 0.08);
}

.aesthetic-card span {
  color: var(--copper);
  font-size: 12px;
  font-weight: 800;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-list span {
  display: grid;
  gap: 3px;
  padding: 10px;
  background: #f3f2eb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compact-list small {
  color: var(--muted);
}

.access-hero {
  min-height: 650px;
  padding: clamp(34px, 6vw, 72px);
  color: var(--porcelain);
  background:
    linear-gradient(90deg, rgba(210, 173, 115, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(210, 173, 115, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, var(--deep), #163c35 62%, #0d1816);
  background-size: 30px 30px, 30px 30px, auto;
  overflow: hidden;
}

.access-hero h2 {
  max-width: 760px;
  margin-bottom: 18px;
}

.access-hero p {
  max-width: 680px;
  color: rgba(255, 253, 247, 0.72);
  font-size: 17px;
}

.access-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 54px;
}

.access-map div {
  min-height: 138px;
  padding: 20px;
  background: rgba(255, 253, 247, 0.08);
  border: 1px solid rgba(255, 253, 247, 0.14);
  border-radius: 8px;
}

.access-map strong,
.access-map span {
  display: block;
}

.access-map strong {
  margin-bottom: 10px;
  font-size: 22px;
}

.access-map span {
  color: rgba(255, 253, 247, 0.62);
  line-height: 1.65;
}

.login-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 26px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 5px;
  background: #eef2eb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-tabs button {
  min-height: 34px;
  border-radius: 7px;
  color: var(--muted);
}

.auth-tabs button.active {
  color: var(--porcelain);
  background: var(--pine);
}

.login-panel[data-mode="login"] .register-only,
.login-panel[data-mode="register"] .login-only,
.login-panel:not(.authenticated) [data-auth-logout],
.login-panel.authenticated .auth-tabs,
.login-panel.authenticated .login-only,
.login-panel.authenticated .register-only,
.login-panel.authenticated .role-cards,
.login-panel.authenticated [data-auth-submit],
.login-panel.authenticated [data-auth-switch] {
  display: none;
}

.role-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.role-cards button {
  min-height: 42px;
  color: var(--ink);
  background: #eef2eb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.role-cards button.active {
  color: var(--porcelain);
  background: var(--pine);
}

.main-panel,
.insight-panel,
.table-panel {
  padding: 22px;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0;
}

.chip,
.choice,
.seg button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.62);
}

.chip.active,
.choice.active,
.seg button.active {
  color: var(--porcelain);
  background: var(--pine);
  border-color: var(--pine);
}

.search-box,
.prompt-box {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  border: 1px dashed rgba(18, 63, 55, 0.24);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.6);
}

.search-box {
  flex: 1;
  min-width: 240px;
}

.search-box input {
  width: 100%;
  min-height: 34px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
}

.search-box input::placeholder {
  color: var(--muted);
}

.project-list {
  display: grid;
  gap: 12px;
}

.project-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
}

.project-row p {
  font-size: 13px;
}

.project-badge {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--porcelain);
  background: var(--pine);
  border-radius: 8px;
  font-family: var(--font-title);
  font-size: 20px;
}

.project-badge.cyan {
  background: var(--cyan);
}

.project-badge.red {
  background: var(--red);
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  color: var(--muted);
  background: #eef0ea;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.tag.good {
  color: #155345;
  background: #e6f2ec;
  border-color: rgba(31, 106, 92, 0.18);
}

.tag.warn {
  color: #8a342c;
  background: #f9e9e2;
  border-color: rgba(185, 76, 63, 0.18);
}

.big-number {
  margin: 18px 0 6px;
  color: var(--pine);
  font-family: var(--font-title);
  font-size: 86px;
  line-height: 0.94;
}

.mini-bars {
  height: 140px;
  display: flex;
  align-items: end;
  gap: 12px;
  margin-top: 26px;
  padding: 16px;
  background: #eef2eb;
  border-radius: 8px;
}

.mini-bars span {
  flex: 1;
  min-height: 20%;
  background: linear-gradient(180deg, var(--copper), var(--pine));
  border-radius: 999px 999px 4px 4px;
}

.wizard {
  padding: 26px;
  background: rgba(255, 253, 247, 0.84);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.stepper span {
  min-height: 42px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #eef0ea;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stepper .done,
.stepper .active {
  color: var(--porcelain);
  background: var(--pine);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.deliverable-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.deliverable-grid label {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: #eef2eb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.deliverable-grid input {
  width: 16px;
  height: 16px;
}

.wide-note {
  margin-top: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

input,
select {
  height: 43px;
}

textarea {
  min-height: 118px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.55;
  font: inherit;
}

.selection-band {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
  padding: 16px;
  background: #eef2eb;
  border-radius: 8px;
}

.rule-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  color: var(--pine);
  background: #e5f1eb;
  border: 1px solid rgba(31, 106, 92, 0.16);
  border-radius: 8px;
}

.rule-strip span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.wizard-actions.compact {
  margin-top: 18px;
}

.template-card {
  min-height: 280px;
  position: relative;
  overflow: hidden;
}

.template-card.active {
  border-color: rgba(183, 129, 77, 0.46);
  box-shadow: 0 28px 80px rgba(183, 129, 77, 0.17);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0;
}

.tags span {
  padding: 6px 9px;
  color: var(--pine);
  background: #eef4ee;
  border-radius: 999px;
  font-size: 12px;
}

.curve {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 70px;
  margin-top: 18px;
}

.curve i {
  flex: 1;
  background: linear-gradient(180deg, var(--gold), var(--pine));
  border-radius: 999px 999px 3px 3px;
}

.curve i:nth-child(1) { height: 28%; }
.curve i:nth-child(2) { height: 48%; }
.curve i:nth-child(3) { height: 68%; }
.curve i:nth-child(4) { height: 94%; }
.curve i:nth-child(5) { height: 58%; }
.curve.low i:nth-child(3) { height: 46%; }
.curve.mid i:nth-child(2) { height: 66%; }

.compare-panel {
  margin-top: 16px;
  padding: 22px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.timeline span {
  min-height: 58px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--pine);
  background: #eef2eb;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
}

.setting-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.setting-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 15px;
  background: #f3f2eb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.setting-row span {
  color: var(--muted);
}

.seg,
.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}

.check-row input {
  width: 16px;
  height: 16px;
}

.process-list {
  display: grid;
  gap: 11px;
  margin: 18px 0 26px;
  padding: 0;
  counter-reset: steps;
}

.process-list li {
  list-style: none;
  counter-increment: steps;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: #eef2eb;
  border-radius: 8px;
}

.process-list li::before {
  content: counter(steps);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--porcelain);
  background: var(--pine);
  border-radius: 50%;
  font-size: 12px;
}

.editor-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.doc-tree,
.suggestion-panel {
  position: sticky;
  top: 28px;
}

.doc-tree {
  display: grid;
  gap: 8px;
}

.doc-tree button,
.point-list button {
  min-height: 42px;
  padding: 0 13px;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.doc-tree button.active,
.point-list button.active {
  color: var(--porcelain);
  background: var(--pine);
}

.document-canvas {
  min-height: 690px;
  padding: 34px;
}

.doc-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.doc-header h2 {
  margin: 14px 0;
  font-size: clamp(28px, 4vw, 48px);
}

.content-block {
  margin-top: 22px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.content-block h3 {
  margin-bottom: 10px;
}

.document-canvas [data-edit-path],
.point-detail [data-edit-path] {
  cursor: text;
  border-radius: 7px;
  outline: 1px solid transparent;
  outline-offset: 3px;
  transition: background 0.18s ease, outline-color 0.18s ease, box-shadow 0.18s ease;
}

.document-canvas [data-edit-path]:hover,
.point-detail [data-edit-path]:hover {
  background: rgba(207, 169, 101, 0.12);
  outline-color: rgba(154, 104, 45, 0.28);
}

.document-canvas [data-edit-path].is-rewrite-target,
.point-detail [data-edit-path].is-rewrite-target {
  background: rgba(207, 169, 101, 0.2);
  outline-color: var(--copper);
  box-shadow: 0 0 0 4px rgba(207, 169, 101, 0.12);
}

.rewrite-hint {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  color: var(--pine);
  background: #eef4ee;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.content-block.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.doc-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.doc-chip-row span {
  padding: 8px 10px;
  color: var(--pine);
  background: #eef4ee;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.doc-flow {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.doc-flow article {
  display: grid;
  grid-template-columns: 78px minmax(120px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: #f3f2eb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.doc-flow span {
  color: var(--copper);
  font-weight: 800;
}

.doc-flow p {
  color: var(--muted);
}

.doc-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.doc-card-grid article {
  min-height: 170px;
  padding: 18px;
  background: #f3f2eb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.doc-card-grid span,
.doc-card-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.doc-card-grid h4 {
  margin: 9px 0;
}

.quote-total.in-doc {
  margin-top: 22px;
}

.inline-actions {
  margin-top: 24px;
}

.suggestion-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.alert-item {
  padding: 14px;
  background: #f2f4ee;
  border: 1px solid var(--line);
  border-left: 3px solid var(--pine-2);
  border-radius: 8px;
}

.alert-item.warn {
  border-left-color: var(--red);
  background: #f9eee8;
}

.alert-item.good {
  border-left-color: var(--pine-2);
}

.alert-item strong,
.alert-item span,
.alert-item button {
  display: block;
}

.alert-item span {
  margin: 6px 0 10px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.alert-item button {
  border: 0;
  color: var(--pine);
  background: transparent;
  padding: 0;
  font-weight: 700;
}

.prompt-box {
  min-height: 72px;
  align-items: start;
  padding-top: 14px;
}

.kanban {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 300px;
  gap: 16px;
}

.point-list {
  display: grid;
  gap: 8px;
}

.point-list button {
  display: flex;
  gap: 10px;
  align-items: center;
}

.point-list span {
  color: var(--copper);
  font-size: 12px;
  font-weight: 800;
}

.point-detail {
  padding: 24px;
  background: rgba(255, 253, 247, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.detail-grid div {
  padding: 14px;
  background: #f2f4ee;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-grid span,
.detail-grid strong {
  display: block;
}

.detail-grid span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.script-box {
  padding: 20px;
  color: var(--porcelain);
  background:
    linear-gradient(90deg, rgba(210, 173, 115, 0.12) 1px, transparent 1px),
    linear-gradient(135deg, var(--deep), #173b35);
  background-size: 22px 22px, auto;
  border-radius: 8px;
}

.script-box p {
  margin-top: 10px;
  color: rgba(255, 253, 247, 0.78);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
  overflow: hidden;
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: #edf1ea;
}

td {
  background: rgba(255, 255, 255, 0.36);
}

.schedule,
.rank {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.schedule span,
.rank span,
.rank b {
  padding: 12px;
  background: #eef2eb;
  border-radius: 8px;
}

.rank {
  grid-template-columns: 1fr auto;
}

.risk-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.risk-matrix article {
  min-height: 220px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 20px;
}

.risk-level {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--porcelain);
  border-radius: 8px;
  font-weight: 800;
}

.risk-level.low {
  background: var(--pine-2);
}

.risk-level.mid {
  background: var(--copper);
}

.risk-level.high {
  background: var(--red);
}

.quote-builder {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.quote-builder div {
  padding: 20px;
  background: #f3f2eb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quote-builder .quote-line label {
  margin: 10px 0;
}

.quote-builder .quote-line input {
  height: 52px;
  color: var(--pine);
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 800;
}

.quote-builder span,
.quote-builder strong,
.quote-builder small {
  display: block;
}

.quote-builder span {
  color: var(--muted);
  font-size: 13px;
}

.quote-builder strong {
  margin: 10px 0;
  color: var(--pine);
  font-family: var(--font-title);
  font-size: 38px;
}

.quote-builder small {
  color: var(--muted);
  line-height: 1.6;
}

.quote-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 22px;
  color: var(--porcelain);
  background: linear-gradient(135deg, var(--deep), var(--pine));
  border-radius: 8px;
}

.quote-total span,
.quote-total strong {
  display: block;
}

.quote-total span {
  color: rgba(255, 253, 247, 0.68);
}

.quote-total strong {
  margin-top: 4px;
  font-family: var(--font-title);
  font-size: 52px;
}

.price-slider {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 18px 0;
}

.price-slider i {
  position: relative;
  height: 8px;
  background: #e2e7df;
  border-radius: 999px;
}

.price-slider i::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pos);
  background: linear-gradient(90deg, var(--pine-2), var(--copper));
  border-radius: inherit;
}

.price-slider i::after {
  content: "";
  position: absolute;
  left: var(--pos);
  top: 50%;
  width: 18px;
  height: 18px;
  background: var(--porcelain);
  border: 4px solid var(--pine);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  color: var(--porcelain);
  background: var(--pine);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 22px 48px rgba(13, 24, 22, 0.26);
  opacity: 0;
  transform: translateY(12px);
  transition: 0.22s ease;
}

.toast.warn {
  background: var(--red);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 20, 18, 0.58);
  backdrop-filter: blur(12px);
}

.admin-modal-card {
  width: min(760px, 100%);
  max-height: min(86vh, 880px);
  overflow: auto;
  padding: 24px;
  background: var(--porcelain);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 34px 90px rgba(8, 20, 18, 0.34);
}

.admin-modal-card.wide {
  width: min(940px, 100%);
}

.admin-modal-card.compact {
  width: min(520px, 100%);
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.admin-form label:has(textarea),
.admin-form label:has(select[data-field="status"]),
.admin-form label:has([data-field="payloadText"]),
.admin-form label:has([data-field="conditionText"]),
.admin-form label:has([data-field="suggestion"]),
.admin-form label:has([data-field="description"]) {
  grid-column: 1 / -1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.modal-note {
  margin-top: 14px;
  color: var(--muted);
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.row-actions {
  min-width: 128px;
  white-space: nowrap;
}

.mini-btn.danger {
  color: #8a342c;
  border-color: rgba(185, 76, 63, 0.22);
  background: #f9e9e2;
}

.resource-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.resource-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.resource-list p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 20, 18, 0.52);
  backdrop-filter: blur(10px);
}

.progress-card {
  width: min(560px, 100%);
  padding: 28px;
  background: var(--porcelain);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 34px 90px rgba(8, 20, 18, 0.32);
}

.progress-card h3 {
  margin-bottom: 18px;
}

.progress-line {
  height: 8px;
  overflow: hidden;
  background: #e6e9e2;
  border-radius: 999px;
}

.progress-line i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--pine-2), var(--copper));
  transition: width 0.28s ease;
}

.progress-card ol {
  display: grid;
  gap: 9px;
  margin: 18px 0 0;
  padding: 0;
}

.progress-card li {
  list-style: none;
  padding: 11px 12px;
  color: var(--muted);
  background: #f0f2ec;
  border-radius: 8px;
  transition: 0.2s ease;
}

.progress-card li.done {
  color: var(--pine);
  background: #e2f0e8;
  font-weight: 700;
}

.locked {
  color: var(--porcelain) !important;
  background: var(--copper) !important;
}

[contenteditable="true"] {
  outline: 0;
}

[contenteditable="true"]:focus {
  box-shadow: inset 0 -2px 0 var(--copper);
}

.export-card {
  display: grid;
  gap: 12px;
  min-height: 220px;
}

.stat-card strong {
  display: block;
  min-height: 54px;
  color: var(--pine);
  font-family: var(--font-title);
  font-size: clamp(28px, 3vw, 46px);
  line-height: 1;
}

.stat-card p {
  margin-top: 10px;
  font-size: 13px;
}

.field-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.field-cloud span {
  padding: 9px 10px;
  color: var(--pine);
  background: #eef4ee;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}

.flow-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.flow-node {
  min-height: 130px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  font-weight: 800;
  position: relative;
}

.flow-node::after {
  content: "";
  position: absolute;
  right: -11px;
  top: 50%;
  width: 10px;
  height: 1px;
  background: rgba(18, 63, 55, 0.28);
}

.flow-node:last-child::after {
  display: none;
}

.flow-node.active {
  color: var(--porcelain);
  background: var(--pine);
}

.flow-node span {
  color: inherit;
  opacity: 0.72;
  font-size: 12px;
  font-weight: 500;
}

.prompt-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}

.code-like pre {
  margin: 24px 0 0;
  padding: 22px;
  white-space: pre-wrap;
  color: #e7f2ea;
  background: #101b19;
  border-radius: 8px;
  line-height: 1.8;
  font-family: "Cascadia Mono", "Consolas", monospace;
}

@media (max-width: 1280px) {
  .hero-grid,
  .dashboard-layout,
  .config-layout,
  .module-layout,
  .access-layout,
  .pricing-layout,
  .aesthetic-hero,
  .editor-layout,
  .kanban {
    grid-template-columns: 1fr;
  }

  .doc-tree,
  .suggestion-panel {
    position: static;
  }

  .doc-tree,
  .point-list {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .workspace {
    padding: 18px;
  }

  .topbar,
  .section-head,
  .panel-head,
  .rule-strip,
  .wizard-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .feature-grid,
  .template-grid,
  .export-grid,
  .stat-grid,
  .three-column,
  .case-grid,
  .form-grid,
  .access-map,
  .risk-matrix,
  .quote-builder,
  .timeline,
  .flow-board,
  .flow-board.compact,
  .aesthetic-grid,
  .aesthetic-lanes {
    grid-template-columns: 1fr;
  }

  .project-row,
  .setting-row,
  .resource-list article,
  .quote-total {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .content-block.split,
  .detail-grid,
  .doc-card-grid,
  .doc-flow,
  .deliverable-grid,
  .admin-form {
    grid-template-columns: 1fr;
  }
}
