@import url("https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600&family=Newsreader:opsz,wght@6..72,400;6..72,500&family=Noto+Sans+TC:wght@300;400;500;600&display=swap");

:root {
  color-scheme: light;
  --canvas: #f4f2ed;
  --surface: #fcfbf8;
  --surface-strong: #ffffff;
  --surface-muted: #efede7;
  --ink: #1b1d1f;
  --ink-soft: #454642;
  --muted: #62625d;
  --faint: #85837c;
  --hairline: rgba(27, 29, 31, 0.08);
  --hairline-strong: rgba(27, 29, 31, 0.13);
  --sidebar: #171816;
  --sidebar-soft: #242521;
  --sidebar-text: #f4f2ed;
  --success: #365f4c;
  --success-bg: #e8efe9;
  --review: #8b662b;
  --review-bg: #f5ecdc;
  --error: #8b4740;
  --error-bg: #f5e7e5;
  --info: #50647a;
  --info-bg: #e8edf1;
  --accent: #d8cfbe;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --sidebar-width: 248px;
  --content-max: 1440px;
  --motion: cubic-bezier(0.16, 1, 0.3, 1);
  --motion-soft: cubic-bezier(0.32, 0.72, 0, 1);
}

/* Workflow handoff, knowledge parity and API access surfaces */
.codex-brief-grid,
.import-status-grid,
.workflow-detail-top,
.api-access-layout {
  display: grid;
  gap: 18px;
}

.codex-brief-grid,
.import-status-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 28px 0;
}

.codex-brief-card,
.import-status-card {
  border: 1px solid rgba(20, 20, 18, 0.08);
  background: rgba(255, 255, 255, 0.7);
  padding: 22px;
}

.codex-brief-head,
.import-status-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.codex-brief-head strong,
.import-status-card strong {
  display: block;
  margin-top: 4px;
}

.codex-brief-card code {
  display: block;
  min-height: 88px;
  margin: 14px 0 18px;
  padding: 14px;
  background: #f5f3ee;
  color: #35332e;
  font-family: "Geist Mono", "SF Mono", monospace;
  font-size: 12px;
  line-height: 1.7;
  white-space: normal;
}

.brief-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: #615f58;
  font-size: 13px;
}

.brief-list li,
.api-response,
.import-status-card span:not(.status-icon) {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brief-list svg,
.api-response svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.import-status-card {
  align-items: center;
}

.import-status-card > div {
  min-width: 0;
}

.import-status-card > div > span {
  display: block;
  margin-top: 5px;
  color: #77746c;
  font-size: 12px;
}

.status-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #edf3ec;
  color: #346538;
}

.status-icon svg {
  width: 17px;
  height: 17px;
}

.workflow-detail-top {
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: start;
}

.workflow-detail-top .side-facts {
  display: grid;
  gap: 12px;
}

.workflow-flow-canvas {
  align-items: stretch;
}

.workflow-flow-canvas .flow-node {
  min-width: 160px;
}

.workflow-node-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 28px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(20, 20, 18, 0.08);
}

.workflow-node-detail h3 {
  margin: 5px 0 8px;
}

.workflow-node-detail p:not(.eyebrow) {
  max-width: 54ch;
  color: #6f6c64;
  line-height: 1.65;
}

.workflow-node-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.workflow-node-facts span {
  display: grid;
  gap: 7px;
  align-content: start;
  padding: 12px;
  border-left: 1px solid rgba(20, 20, 18, 0.1);
}

.workflow-node-facts small {
  color: #8a877e;
  font-size: 11px;
}

.workflow-node-facts strong {
  font-size: 13px;
}

.api-preview-shell .bezel-inner {
  padding: 26px;
}

.api-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.api-preview h3 {
  margin: 10px 0 5px;
}

.api-preview p {
  margin: 0;
  color: #6f6c64;
}

.api-access-layout {
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
}

.api-access-main,
.api-access-side {
  display: grid;
  gap: 18px;
}

.api-status-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.api-status-head h2 {
  margin: 5px 0 8px;
}

.api-status-head code {
  color: #67645c;
  font-family: "Geist Mono", "SF Mono", monospace;
  font-size: 12px;
}

.api-code-block {
  margin-top: 26px;
  border: 1px solid rgba(20, 20, 18, 0.08);
  background: #20211f;
  color: #f7f5f0;
}

.code-caption {
  display: flex;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #b7b4aa;
  font-size: 11px;
}

.api-code-block pre {
  overflow-x: auto;
  margin: 0;
  padding: 18px;
  white-space: pre-wrap;
}

.api-code-block code {
  color: #f7f5f0;
  font-family: "Geist Mono", "SF Mono", monospace;
  font-size: 12px;
  line-height: 1.7;
}

.api-response {
  margin-top: 18px;
  color: #6f6c64;
  font-size: 13px;
}

.button-stack {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.api-card .bezel-inner,
.api-side-card .bezel-inner {
  padding: 24px;
}

.api-side-card h3 {
  margin: 8px 0 6px;
  font-family: "Geist Mono", "SF Mono", monospace;
  font-size: 15px;
}

@media (max-width: 900px) {
  .workflow-detail-top,
  .api-access-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .workflow-detail-top .side-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .codex-brief-grid,
  .import-status-grid,
  .workflow-node-detail,
  .workflow-node-facts,
  .workflow-detail-top .side-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .api-preview,
  .api-status-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .api-preview .button,
  .api-access-side .button,
  .api-card .button {
    width: 100%;
  }

  .workflow-flow-canvas {
    align-items: stretch;
  }

  .workflow-flow-canvas .flow-node {
    min-width: 0;
    width: 100%;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Geist", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::after {
  position: fixed;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

::selection {
  background: #ddd5c6;
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 40;
  top: 12px;
  left: 12px;
  padding: 9px 14px;
  transform: translateY(-180%);
  border-radius: var(--radius-xs);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  transition: transform 300ms var(--motion);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100dvh;
}

.sidebar {
  position: fixed;
  z-index: 10;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 28px 20px 20px;
  background: var(--sidebar);
  color: rgba(244, 242, 237, 0.72);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: #eeece6;
  color: #1b1d1f;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  line-height: 1.12;
  letter-spacing: 0.015em;
}

.brand-copy strong {
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 550;
}

.brand-copy span {
  color: rgba(244, 242, 237, 0.5);
}

.nav-list {
  margin-top: 46px;
}

.nav-section-label {
  margin: 0 10px 10px;
  color: rgba(244, 242, 237, 0.34);
  font-family: "Geist", sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-section-label-spaced {
  margin-top: 30px;
}

.nav-item,
.help-link {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin: 3px 0;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(244, 242, 237, 0.62);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: color 420ms var(--motion), background-color 420ms var(--motion), transform 420ms var(--motion);
}

.nav-item:hover,
.help-link:hover {
  color: rgba(244, 242, 237, 0.9);
  transform: translateX(2px);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.075);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055);
}

.nav-icon {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
}

.nav-icon svg,
.icon-button svg,
.button-icon svg,
.inline-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
}

.nav-count {
  min-width: 20px;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ede5d5;
  color: #5f4d31;
  font-family: "Geist", sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}

.sidebar-foot {
  margin-top: auto;
}

.help-link {
  margin-bottom: 14px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055);
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  background: #d8cfbe;
  color: #2e2d29;
  font-family: "Newsreader", "Noto Serif TC", serif;
  font-size: 17px;
}

.user-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  font-size: 11px;
  line-height: 1.35;
}

.user-copy strong {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy span {
  color: rgba(255, 255, 255, 0.38);
}

.main-content {
  width: calc(100% - var(--sidebar-width));
  min-height: 100dvh;
  margin-left: var(--sidebar-width);
  padding: 54px clamp(30px, 4.5vw, 76px) 80px;
  overflow-x: clip;
}

.page {
  width: min(100%, var(--content-max));
  min-width: 0;
  margin: 0 auto;
  animation: page-enter 760ms var(--motion) both;
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 42px;
}

.page-header.align-start {
  align-items: flex-start;
}

.page-header-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: "Geist", sans-serif;
  font-size: 10px;
  font-weight: 550;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 12px;
  color: var(--ink);
  font-family: "Newsreader", "Noto Serif TC", "Songti TC", serif;
  font-size: clamp(40px, 5vw, 66px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

h2 {
  color: var(--ink);
  font-size: clamp(24px, 2.2vw, 34px);
  font-weight: 500;
  letter-spacing: -0.032em;
  line-height: 1.12;
}

h3 {
  color: var(--ink);
  font-size: 17px;
  font-weight: 550;
  letter-spacing: -0.018em;
  line-height: 1.25;
}

.page-description {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.72;
}

.mono {
  font-family: "Geist Mono", "SFMono-Regular", Consolas, monospace;
}

.header-actions,
.button-row,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 15px;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 520;
  letter-spacing: -0.005em;
  transition: transform 480ms var(--motion), background-color 480ms var(--motion), color 480ms var(--motion), box-shadow 480ms var(--motion);
}

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

.button:active {
  transform: scale(0.98);
}

.button-dark {
  background: var(--ink);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 24px rgba(22, 23, 21, 0.06);
}

.button-dark:hover {
  background: #32332f;
}

.button-quiet {
  background: rgba(255, 255, 255, 0.54);
  color: var(--ink-soft);
  box-shadow: inset 0 0 0 1px var(--hairline-strong);
}

.button-quiet:hover {
  background: #fff;
}

.button-danger {
  background: var(--error-bg);
  color: var(--error);
  box-shadow: inset 0 0 0 1px rgba(139, 71, 64, 0.13);
}

.button-icon {
  display: grid;
  width: 28px;
  height: 28px;
  margin: -3px -5px -3px 2px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  transition: transform 480ms var(--motion);
}

.button:hover .button-icon {
  transform: translate(2px, -1px) scale(1.04);
}

.full-width {
  width: 100%;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 350ms var(--motion), background-color 350ms var(--motion), transform 350ms var(--motion);
}

.icon-button:hover {
  background: rgba(27, 29, 31, 0.055);
  color: var(--ink);
  transform: scale(0.98);
}

.icon-button.compact {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  color: rgba(255, 255, 255, 0.36);
}

.icon-button.compact:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
}

.bezel {
  padding: 6px;
  border-radius: var(--radius-lg);
  background: rgba(27, 29, 31, 0.035);
  box-shadow: inset 0 0 0 1px rgba(27, 29, 31, 0.045);
}

.bezel-inner {
  height: 100%;
  border-radius: calc(var(--radius-lg) - 6px);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline), inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 20px 70px rgba(22, 23, 21, 0.025);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat-card .bezel-inner {
  min-height: 132px;
  padding: 22px;
}

.stat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.stat-number {
  margin: 21px 0 4px;
  color: var(--ink);
  font-family: "Newsreader", serif;
  font-size: 37px;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.9;
}

.stat-detail {
  color: var(--faint);
  font-size: 11px;
}

.trend {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.82fr);
  gap: 18px;
  align-items: start;
}

.panel .bezel-inner {
  padding: 26px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.panel-header h2,
.panel-header h3 {
  margin-bottom: 0;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  transition: color 350ms var(--motion), transform 350ms var(--motion);
}

.text-link:hover {
  color: var(--ink);
  transform: translateX(2px);
}

.text-link svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.3;
}

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

.workflow-card {
  position: relative;
  min-height: 184px;
  padding: 19px;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: inset 0 0 0 1px var(--hairline);
  transition: transform 600ms var(--motion), box-shadow 600ms var(--motion), background-color 600ms var(--motion);
}

.workflow-card:hover {
  transform: translateY(-3px);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--hairline-strong), 0 14px 40px rgba(22, 23, 21, 0.035);
}

.workflow-card::after {
  position: absolute;
  right: -22px;
  bottom: -26px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--card-accent, var(--surface-muted));
  content: "";
  opacity: 0.72;
  transform: scale(0.82);
  transition: transform 700ms var(--motion), opacity 700ms var(--motion);
}

.workflow-card:hover::after {
  opacity: 0.95;
  transform: scale(1);
}

.workflow-card-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 25px;
  place-items: center;
  border-radius: 10px;
  background: var(--card-accent, var(--surface-muted));
  color: var(--ink-soft);
}

.workflow-card-icon svg,
.feature-icon svg,
.node-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.3;
}

.workflow-card h3 {
  position: relative;
  z-index: 1;
  margin-bottom: 5px;
  font-size: 15px;
}

.workflow-card p {
  position: relative;
  z-index: 1;
  max-width: 270px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.workflow-card-meta {
  position: absolute;
  z-index: 1;
  right: 19px;
  bottom: 16px;
  left: 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--faint);
  font-size: 10px;
}

.status-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-weight: 550;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px var(--success-bg);
}

.review-list,
.run-list,
.version-list {
  display: grid;
  gap: 8px;
}

.review-item,
.run-item,
.version-item {
  display: block;
  width: 100%;
  padding: 16px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.54);
  color: inherit;
  cursor: pointer;
  text-align: left;
  box-shadow: inset 0 0 0 1px var(--hairline);
  transition: transform 450ms var(--motion), background-color 450ms var(--motion), box-shadow 450ms var(--motion);
}

.review-item:hover,
.run-item:hover,
.version-item:hover {
  transform: translateY(-2px);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--hairline-strong), 0 10px 28px rgba(22, 23, 21, 0.025);
}

.item-topline,
.item-footline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.item-topline strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 550;
}

.item-time,
.item-meta {
  color: var(--faint);
  font-size: 10px;
}

.item-description {
  margin: 6px 0 11px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.badge {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge-review {
  background: var(--review-bg);
  color: var(--review);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
}

.badge-error {
  background: var(--error-bg);
  color: var(--error);
}

.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.search-box {
  position: relative;
  flex: 1;
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--faint);
  stroke-linecap: round;
  stroke-width: 1.35;
}

.input,
.select,
.textarea,
.search-input {
  width: 100%;
  border: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--hairline-strong), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: background-color 350ms var(--motion), box-shadow 350ms var(--motion);
}

.input,
.select,
.search-input {
  min-height: 48px;
  padding: 11px 14px;
}

.search-input {
  padding-left: 44px;
}

.textarea {
  min-height: 112px;
  padding: 13px 14px;
  resize: vertical;
}

.input:hover,
.select:hover,
.textarea:hover,
.search-input:hover,
.input:focus,
.select:focus,
.textarea:focus,
.search-input:focus {
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(27, 29, 31, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  outline: 0;
}

.search-input::placeholder,
.input::placeholder,
.textarea::placeholder {
  color: #a6a39c;
}

.category-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  transition: color 350ms var(--motion), background-color 350ms var(--motion);
}

.category-tab.active {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

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

.catalog-card .bezel-inner {
  position: relative;
  min-height: 280px;
  padding: 24px;
  overflow: hidden;
}

.catalog-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.catalog-card h3 {
  margin: 31px 0 8px;
  font-size: 19px;
}

.catalog-card p {
  margin-bottom: 38px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.catalog-card-footer {
  position: absolute;
  right: 24px;
  bottom: 21px;
  left: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--faint);
  font-size: 10px;
}

.mini-avatar-group {
  display: flex;
}

.mini-avatar {
  display: grid;
  width: 24px;
  height: 24px;
  margin-left: -6px;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: #ded8cd;
  color: #4d4b45;
  font-size: 8px;
  font-weight: 600;
}

.mini-avatar:first-child {
  margin-left: 0;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.72fr);
  gap: 20px;
  align-items: start;
}

.detail-hero .bezel-inner {
  padding: clamp(28px, 4vw, 52px);
}

.detail-hero h1 {
  max-width: 700px;
  font-size: clamp(40px, 5vw, 62px);
}

.detail-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 36px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.side-facts {
  display: grid;
  gap: 12px;
}

.fact-card .bezel-inner {
  padding: 22px;
}

.fact-label {
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fact-value {
  color: var(--ink);
  font-size: 15px;
  font-weight: 520;
}

.fact-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.section-block {
  margin-top: 24px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading p {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.flow-shell .bezel-inner {
  padding: 24px;
}

.flow-canvas {
  position: relative;
  display: flex;
  min-height: 210px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  overflow: auto;
  border-radius: 13px;
  background-color: #f6f4ef;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='1' cy='1' r='.7' fill='%231b1d1f' fill-opacity='.1'/%3E%3C/svg%3E");
  background-size: 16px 16px;
}

.review-main .flow-node {
  min-width: 112px;
}

.review-main .flow-edge {
  width: 22px;
  flex-basis: 22px;
}

.flow-node {
  position: relative;
  display: flex;
  min-width: 130px;
  min-height: 74px;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: inset 0 0 0 1px var(--hairline-strong), 0 8px 24px rgba(22, 23, 21, 0.025);
  transition: transform 460ms var(--motion), box-shadow 460ms var(--motion);
}

.flow-node:hover,
.flow-node.selected {
  transform: translateY(-3px);
  box-shadow: inset 0 0 0 1px rgba(27, 29, 31, 0.28), 0 12px 28px rgba(22, 23, 21, 0.035);
}

.flow-node.added {
  background: #f3f7f3;
  box-shadow: inset 0 0 0 1px rgba(54, 95, 76, 0.23);
}

.flow-node.changed {
  background: #faf6ed;
  box-shadow: inset 0 0 0 1px rgba(139, 102, 43, 0.23);
}

.node-icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--ink-soft);
}

.flow-node.added .node-icon {
  background: var(--success-bg);
  color: var(--success);
}

.flow-node.changed .node-icon {
  background: var(--review-bg);
  color: var(--review);
}

.node-copy {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  line-height: 1.35;
}

.node-copy strong {
  font-size: 12px;
  font-weight: 550;
}

.node-copy span {
  color: var(--faint);
  font-size: 9px;
}

.flow-edge {
  position: relative;
  width: 34px;
  height: 1px;
  flex: 0 0 34px;
  background: rgba(27, 29, 31, 0.22);
}

.flow-edge::after {
  position: absolute;
  top: 50%;
  right: -1px;
  width: 6px;
  height: 6px;
  border-top: 1px solid rgba(27, 29, 31, 0.38);
  border-right: 1px solid rgba(27, 29, 31, 0.38);
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.feature-card .bezel-inner {
  padding: 22px;
}

.feature-icon {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 26px;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--ink-soft);
}

.feature-card h3 {
  margin-bottom: 7px;
  font-size: 15px;
}

.feature-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.62;
}

.journey-shell {
  max-width: 1040px;
  margin: 0 auto;
}

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

.stepper-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font-size: 11px;
}

.stepper-item:not(:last-child)::after {
  position: absolute;
  top: 14px;
  right: 18px;
  left: 50px;
  height: 1px;
  background: var(--hairline-strong);
  content: "";
}

.stepper-number {
  position: relative;
  z-index: 1;
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--canvas);
  box-shadow: inset 0 0 0 1px var(--hairline-strong);
  font-family: "Geist", sans-serif;
  font-size: 10px;
}

.stepper-item.active,
.stepper-item.complete {
  color: var(--ink);
}

.stepper-item.active .stepper-number,
.stepper-item.complete .stepper-number {
  background: var(--ink);
  color: #fff;
  box-shadow: none;
}

.form-shell .bezel-inner,
.confirm-shell .bezel-inner,
.result-shell .bezel-inner {
  padding: clamp(26px, 4vw, 48px);
}

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

.field {
  display: grid;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 520;
}

.field-label span {
  color: var(--faint);
  font-size: 10px;
  font-weight: 400;
}

.field-help {
  margin: 0;
  color: var(--faint);
  font-size: 10px;
}

.upload-zone {
  position: relative;
  display: flex;
  min-height: 146px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: inset 0 0 0 1px rgba(27, 29, 31, 0.11);
  transition: background-color 420ms var(--motion), box-shadow 420ms var(--motion), transform 420ms var(--motion);
}

.upload-zone.dragover {
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(27, 29, 31, 0.32);
  transform: translateY(-2px);
}

.upload-copy {
  display: flex;
  align-items: center;
  gap: 14px;
}

.upload-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--ink-soft);
}

.upload-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.3;
}

.upload-copy strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
  font-weight: 550;
}

.upload-copy span {
  color: var(--muted);
  font-size: 10px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: 10px;
}

.file-chip button {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 34px;
  padding-top: 22px;
  box-shadow: inset 0 1px 0 var(--hairline);
}

.form-actions-note {
  color: var(--faint);
  font-size: 10px;
}

.advanced-options {
  margin-top: 22px;
  padding-top: 18px;
  box-shadow: inset 0 1px 0 var(--hairline);
}

.advanced-options summary {
  width: fit-content;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}

.advanced-options[open] summary {
  margin-bottom: 16px;
}

.confirm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.7fr);
  gap: 20px;
}

.summary-list {
  display: grid;
  gap: 0;
}

.summary-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 16px 0;
  box-shadow: inset 0 -1px 0 var(--hairline);
}

.summary-row:last-child {
  box-shadow: none;
}

.summary-label {
  color: var(--faint);
  font-size: 11px;
}

.summary-value {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
}

.assurance-card {
  padding: 20px;
  border-radius: 14px;
  background: #f2f0ea;
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.assurance-card h3 {
  margin-bottom: 14px;
  font-size: 14px;
}

.assurance-list {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.assurance-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.assurance-list svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: var(--success);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.progress-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.35fr);
  gap: 20px;
  align-items: stretch;
}

.progress-visual .bezel-inner,
.progress-steps-card .bezel-inner {
  padding: clamp(26px, 4vw, 42px);
}

.progress-visual .bezel-inner {
  display: flex;
  min-height: 520px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.progress-ring {
  position: relative;
  display: grid;
  width: 172px;
  height: 172px;
  margin-bottom: 30px;
  place-items: center;
}

.progress-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring circle {
  fill: none;
  stroke-width: 4;
}

.progress-ring .track {
  stroke: rgba(27, 29, 31, 0.08);
}

.progress-ring .value {
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-dasharray: 477.5;
  stroke-dashoffset: 477.5;
  transition: stroke-dashoffset 800ms var(--motion);
}

.progress-value {
  font-family: "Newsreader", serif;
  font-size: 39px;
  letter-spacing: -0.04em;
}

.progress-value span {
  margin-left: 2px;
  color: var(--faint);
  font-family: "Geist", sans-serif;
  font-size: 12px;
}

.progress-visual h2 {
  max-width: 300px;
  margin-bottom: 8px;
  font-size: 25px;
}

.progress-visual p {
  max-width: 330px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 11px;
}

.leave-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--faint);
  font-size: 10px;
}

.progress-step-list {
  display: grid;
  gap: 4px;
}

.progress-step {
  display: grid;
  grid-template-columns: 35px 1fr auto;
  gap: 13px;
  align-items: center;
  min-height: 84px;
  padding: 13px 0;
  box-shadow: inset 0 -1px 0 var(--hairline);
}

.progress-step:last-child {
  box-shadow: none;
}

.step-state-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--faint);
}

.step-state-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.progress-step.complete .step-state-icon {
  background: var(--success-bg);
  color: var(--success);
}

.progress-step.active .step-state-icon {
  background: var(--ink);
  color: #fff;
}

.progress-step-copy strong {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 550;
}

.progress-step-copy span {
  color: var(--faint);
  font-size: 10px;
}

.progress-step-time {
  color: var(--faint);
  font-family: "Geist Mono", Consolas, monospace;
  font-size: 9px;
}

.result-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.result-banner h1 {
  max-width: 680px;
  font-size: clamp(38px, 4.5vw, 58px);
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.65fr);
  gap: 20px;
}

.document-preview {
  min-height: 550px;
  padding: clamp(30px, 5vw, 62px);
  border-radius: 15px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--hairline), 0 24px 60px rgba(22, 23, 21, 0.025);
}

.document-brand {
  margin-bottom: 52px;
  color: var(--faint);
  font-family: "Geist Mono", Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.document-preview h2 {
  max-width: 620px;
  margin-bottom: 18px;
  font-family: "Newsreader", "Noto Serif TC", serif;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 400;
}

.document-lead {
  max-width: 670px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}

.document-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.document-section {
  padding-top: 18px;
  box-shadow: inset 0 1px 0 var(--hairline);
}

.document-section h3 {
  margin-bottom: 9px;
  font-size: 13px;
}

.document-section p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}

.result-side {
  display: grid;
  align-content: start;
  gap: 12px;
}

.result-side-card .bezel-inner {
  padding: 22px;
}

.result-side-card h3 {
  margin-bottom: 15px;
  font-size: 14px;
}

.result-checks {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.result-checks li {
  display: flex;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
}

.result-checks svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: none;
  stroke: var(--success);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.72fr);
  gap: 20px;
  align-items: start;
}

.review-main,
.review-side {
  display: grid;
  gap: 16px;
}

.review-summary .bezel-inner,
.review-inspector .bezel-inner,
.review-evidence .bezel-inner {
  padding: 25px;
}

.change-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
}

.change-stat {
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.change-stat strong {
  display: block;
  margin-bottom: 3px;
  font-family: "Newsreader", serif;
  font-size: 27px;
  font-weight: 400;
}

.change-stat span {
  color: var(--muted);
  font-size: 9px;
}

.inspector-empty,
.empty-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 28px;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
}

.inspector-content h3 {
  margin-bottom: 8px;
}

.inspector-content > p {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 11px;
}

.inspector-facts {
  display: grid;
  gap: 10px;
}

.inspector-fact {
  padding-top: 10px;
  box-shadow: inset 0 1px 0 var(--hairline);
}

.inspector-fact span {
  display: block;
  color: var(--faint);
  font-size: 9px;
  text-transform: uppercase;
}

.inspector-fact strong {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
}

.evidence-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.evidence-item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 13px 0;
  box-shadow: inset 0 -1px 0 var(--hairline);
}

.evidence-item:last-child {
  box-shadow: none;
}

.evidence-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  background: var(--success-bg);
  color: var(--success);
}

.evidence-icon svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.evidence-copy strong {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 520;
}

.evidence-copy span,
.evidence-value {
  color: var(--faint);
  font-size: 9px;
}

.decision-bar {
  position: sticky;
  bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(252, 251, 248, 0.92);
  box-shadow: inset 0 0 0 1px var(--hairline-strong), 0 18px 60px rgba(22, 23, 21, 0.07);
  backdrop-filter: blur(16px);
}

.decision-note {
  padding-left: 5px;
  color: var(--muted);
  font-size: 10px;
}

.table-shell {
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 15px 17px;
  box-shadow: inset 0 -1px 0 var(--hairline);
  font-size: 11px;
  text-align: left;
}

.data-table th {
  color: var(--faint);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table td {
  color: var(--muted);
}

.data-table tr:last-child td {
  box-shadow: none;
}

.data-table td strong {
  color: var(--ink-soft);
  font-weight: 520;
}

.modal {
  width: min(92vw, 580px);
  max-height: min(86dvh, 760px);
  padding: 6px;
  overflow: visible;
  border: 0;
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 36px 100px rgba(22, 23, 21, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.modal::backdrop {
  background: rgba(20, 21, 19, 0.56);
  backdrop-filter: blur(12px);
}

.modal[open] {
  animation: modal-enter 650ms var(--motion) both;
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-shell {
  max-height: calc(86dvh - 12px);
  padding: 30px;
  overflow-y: auto;
  border-radius: 19px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.modal-head h2 {
  max-width: 420px;
  margin-bottom: 0;
  font-family: "Newsreader", "Noto Serif TC", serif;
  font-weight: 400;
}

.help-steps {
  display: grid;
  gap: 0;
  margin: 0 0 25px;
  padding: 0;
  list-style: none;
}

.help-steps li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  padding: 15px 0;
  box-shadow: inset 0 -1px 0 var(--hairline);
}

.help-steps li > span {
  color: var(--faint);
  font-family: "Geist Mono", Consolas, monospace;
  font-size: 9px;
}

.help-steps strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 550;
}

.help-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.modal-description {
  margin: -8px 0 22px;
  color: var(--muted);
  font-size: 12px;
}

.decision-shell .field-label {
  margin-bottom: 8px;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 22px;
}

.toast-region {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  display: grid;
  width: min(360px, calc(100vw - 48px));
  gap: 8px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px;
  border-radius: 13px;
  background: rgba(27, 29, 31, 0.94);
  color: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 50px rgba(22, 23, 21, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  animation: toast-enter 560ms var(--motion) both;
}

.toast svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.toast strong {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 550;
}

.toast span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mobile-header,
.mobile-nav {
  display: none;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 760ms var(--motion), transform 760ms var(--motion);
  transition-delay: calc(var(--reveal-index, 0) * 65ms);
}

@media (max-width: 1180px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-layout,
  .review-layout,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .side-facts,
  .result-side {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .review-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .decision-bar {
    grid-column: 1 / -1;
  }
}

@media (max-width: 960px) {
  :root {
    --sidebar-width: 214px;
  }

  .sidebar {
    padding-right: 15px;
    padding-left: 15px;
  }

  .dashboard-grid,
  .progress-layout,
  .confirm-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .side-facts,
  .result-side,
  .review-side {
    grid-template-columns: 1fr;
  }

  .progress-visual .bezel-inner {
    min-height: 430px;
  }
}

@media (max-width: 767px) {
  body {
    font-size: 14px;
  }

  .sidebar {
    display: none;
  }

  .mobile-header {
    position: sticky;
    z-index: 8;
    top: 0;
    display: flex;
    height: 70px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(244, 242, 237, 0.9);
    box-shadow: inset 0 -1px 0 var(--hairline);
    backdrop-filter: blur(14px);
  }

  .compact-brand .brand-mark {
    width: 32px;
    height: 32px;
  }

  .compact-brand .brand-copy strong {
    color: var(--ink);
  }

  .compact-brand .brand-copy span {
    color: var(--faint);
  }

  .main-content {
    width: 100%;
    max-width: 100vw;
    margin-left: 0;
    padding: 30px 16px 108px;
  }

  .page,
  .page-header,
  .page-header-copy,
  .stats-grid,
  .dashboard-grid,
  .panel,
  .bezel,
  .bezel-inner {
    min-width: 0;
    max-width: 100%;
  }

  .page-header,
  .result-banner {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 30px;
  }

  .page-header .header-actions,
  .result-banner .header-actions {
    width: auto;
    align-self: stretch;
  }

  .page-header .header-actions .button,
  .result-banner .header-actions .button {
    flex: 1;
  }

  h1 {
    font-size: clamp(38px, 12vw, 52px);
    overflow-wrap: anywhere;
  }

  .dashboard-page h1 {
    font-size: clamp(38px, 11vw, 46px);
  }

  .dashboard-page .display-name {
    display: block;
  }

  h2 {
    font-size: 25px;
  }

  .stats-grid,
  .workflow-grid,
  .catalog-grid,
  .form-grid,
  .document-columns,
  .change-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-card,
  .workflow-card,
  .catalog-card {
    min-width: 0;
  }

  .field.full {
    grid-column: auto;
  }

  .search-row {
    align-items: stretch;
    flex-direction: column;
  }

  .category-tabs {
    margin: 0 -2px;
  }

  .catalog-card .bezel-inner {
    min-height: 248px;
  }

  .detail-actions,
  .button-row,
  .form-actions,
  .decision-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-actions .button,
  .button-row .button,
  .form-actions .button,
  .decision-bar .button {
    width: 100%;
  }

  .stepper-item span:last-child {
    display: none;
  }

  .stepper-item:not(:last-child)::after {
    right: 12px;
    left: 38px;
  }

  .flow-canvas {
    justify-content: flex-start;
    padding: 22px;
  }

  .flow-node {
    min-width: 122px;
  }

  .summary-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .upload-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-zone .button {
    width: 100%;
  }

  .document-preview {
    min-height: 0;
  }

  .review-layout {
    gap: 14px;
  }

  .data-table {
    min-width: 660px;
  }

  .table-shell {
    overflow-x: auto;
  }

  .decision-bar {
    position: static;
    padding: 12px;
    backdrop-filter: none;
  }

  .decision-note {
    padding: 0 2px;
    text-align: center;
  }

  .mobile-nav {
    position: fixed;
    z-index: 9;
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 6px;
    border-radius: 16px;
    background: rgba(23, 24, 22, 0.94);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 50px rgba(22, 23, 21, 0.16);
    backdrop-filter: blur(16px);
  }

  .mobile-nav-item {
    position: relative;
    display: grid;
    min-height: 44px;
    place-items: center;
    border-radius: 11px;
    color: rgba(255, 255, 255, 0.47);
    font-size: 10px;
    transition: color 350ms var(--motion), background-color 350ms var(--motion);
  }

  .mobile-nav-item.active {
    background: rgba(255, 255, 255, 0.085);
    color: #fff;
  }

  .mobile-dot {
    position: absolute;
    top: 9px;
    right: calc(50% - 22px);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #d8b980;
  }

  .toast-region {
    right: 16px;
    bottom: 82px;
    left: 16px;
    width: auto;
  }

  .modal-shell {
    padding: 24px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Creation centre and read-only knowledge library */
.create-page,
.knowledge-page,
.knowledge-detail-page {
  --content-narrow: 1120px;
}

.create-role-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.create-role-note svg {
  width: 15px;
  height: 15px;
}

.create-stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  max-width: 920px;
  margin: 0 auto 28px;
}

.create-step {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: var(--faint);
  font-size: 11px;
}

.create-step:not(:last-child)::after {
  position: absolute;
  top: 15px;
  right: 18px;
  left: 38px;
  height: 1px;
  background: var(--hairline-strong);
  content: "";
}

.create-step > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  background: var(--canvas);
  color: var(--faint);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
}

.create-step strong {
  position: relative;
  z-index: 1;
  padding-right: 8px;
  background: var(--canvas);
  font-weight: 500;
  white-space: nowrap;
}

.create-step.active,
.create-step.complete {
  color: var(--ink);
}

.create-step.active > span,
.create-step.complete > span {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.create-step.complete > span svg {
  width: 15px;
  height: 15px;
}

.create-shell {
  max-width: var(--content-narrow);
  margin: 0 auto;
}

.create-shell .bezel-inner {
  min-height: 520px;
  padding: clamp(25px, 4vw, 48px);
}

.create-form,
.create-stage {
  min-height: 430px;
}

.create-form-intro {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 34px;
}

.create-form-intro > div {
  min-width: 0;
  flex: 1;
}

.create-form-intro h2 {
  margin-bottom: 8px;
}

.create-form-intro p:not(.eyebrow) {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.stage-number {
  color: var(--faint);
  font-family: "Newsreader", serif;
  font-size: 42px;
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.create-form-intro > .badge {
  margin-left: auto;
}

.create-goal {
  min-height: 138px;
}

.create-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 24px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  background: rgba(245, 243, 238, 0.72);
  color: var(--muted);
  font-size: 12px;
}

.create-note svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: var(--info);
}

.create-form .form-actions,
.create-stage .form-actions {
  margin-top: 32px;
}

.create-input-grid {
  margin-bottom: 32px;
}

.selection-heading,
.graph-caption,
.test-room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.selection-heading {
  margin-bottom: 14px;
}

.selection-heading h3 {
  margin: 0;
}

.selection-count,
.graph-caption,
.test-room-head {
  color: var(--faint);
  font-size: 11px;
}

.knowledge-select-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.knowledge-select {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 440ms var(--motion), background-color 440ms var(--motion), transform 440ms var(--motion);
}

.knowledge-select:hover {
  border-color: var(--hairline-strong);
  background: #fff;
  transform: translateY(-2px);
}

.knowledge-select.selected {
  border-color: rgba(54, 95, 76, 0.38);
  background: #f4f8f4;
}

.knowledge-select.disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.knowledge-select.disabled:hover {
  transform: none;
}

.knowledge-select-icon,
.knowledge-card-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 10px;
  background: var(--card-accent, var(--surface-muted));
  color: var(--ink-soft);
}

.knowledge-select-icon svg,
.knowledge-card-icon svg {
  width: 19px;
  height: 19px;
}

.knowledge-select-copy,
.knowledge-card p {
  min-width: 0;
}

.knowledge-select-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.knowledge-select-copy strong {
  font-size: 13px;
  font-weight: 550;
}

.knowledge-select-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-select-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--faint);
  font-size: 10px;
  white-space: nowrap;
}

.knowledge-select-state svg {
  width: 14px;
  height: 14px;
}

.knowledge-select.selected .knowledge-select-state {
  color: var(--success);
}

.create-graph-shell {
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: #f7f5f0;
}

.graph-caption {
  padding: 2px 5px 14px;
}

.create-flow-canvas {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr);
  min-height: 176px;
  gap: 10px;
  padding: 22px;
  overflow: hidden;
}

.create-flow-canvas .flow-node {
  min-width: 0;
  width: 100%;
}

.create-flow-canvas .flow-edge {
  width: 100%;
  flex: 0 0 auto;
}

.create-graph-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.create-graph-footer > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.create-graph-footer svg {
  width: 16px;
  height: 16px;
  color: var(--info);
}

.test-room {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.test-input,
.test-result {
  display: flex;
  min-height: 235px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid var(--hairline);
  background: rgba(248, 246, 241, 0.72);
}

.test-result {
  background: #fbfaf7;
}

.test-result.ready {
  border-color: rgba(54, 95, 76, 0.26);
  background: #f7faf7;
}

.test-room-head {
  margin-bottom: 20px;
}

.test-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.test-file-card > svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.test-file-card > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.test-file-card strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.test-file-card div span,
.test-result > p {
  color: var(--muted);
  font-size: 11px;
}

.test-result h3 {
  margin: auto 0 7px;
  font-size: 18px;
}

.test-result > p {
  margin-bottom: 16px;
  line-height: 1.65;
}

.test-empty {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--faint);
  text-align: center;
}

.test-empty p {
  max-width: 230px;
  margin: 0;
  font-size: 12px;
}

.empty-ring,
.complete-mark {
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.empty-ring {
  width: 48px;
  height: 48px;
  border: 1px solid var(--hairline-strong);
  background: #fff;
}

.empty-ring svg {
  width: 20px;
  height: 20px;
}

.citation-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  color: var(--success);
  font-size: 10px;
}

.citation-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.citation-row svg {
  width: 14px;
  height: 14px;
}

.create-complete {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 34px 0 6px;
  text-align: center;
}

.create-complete h2 {
  max-width: 600px;
  margin-bottom: 8px;
}

.create-complete > p:not(.eyebrow) {
  max-width: 570px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.complete-mark {
  width: 58px;
  height: 58px;
  margin-bottom: 22px;
  background: var(--success-bg);
  color: var(--success);
}

.complete-mark svg {
  width: 26px;
  height: 26px;
}

.publish-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  max-width: 760px;
  gap: 14px;
  margin: 38px 0 10px;
  text-align: left;
}

.publish-timeline > div:not(.publish-line) {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  padding-top: 18px;
}

.publish-timeline strong {
  font-size: 12px;
  font-weight: 550;
}

.publish-timeline > div > span:last-child {
  color: var(--faint);
  font-size: 10px;
}

.publish-line {
  position: absolute;
  top: 16px;
  right: 12%;
  left: 12%;
  height: 1px;
  background: var(--hairline-strong);
}

.publish-line.complete {
  background: rgba(54, 95, 76, 0.38);
}

.timeline-dot {
  position: relative;
  z-index: 1;
  display: grid;
  width: 32px;
  height: 32px;
  margin-bottom: 5px;
  place-items: center;
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--faint);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
}

.timeline-dot.complete,
.timeline-dot.active {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success);
}

.timeline-dot svg {
  width: 15px;
  height: 15px;
}

.knowledge-overview-shell .bezel-inner {
  padding: 28px 32px;
}

.knowledge-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
}

.knowledge-overview h2 {
  margin-bottom: 8px;
}

.knowledge-overview p:not(.eyebrow) {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.knowledge-overview-metrics {
  display: flex;
  flex: 0 0 auto;
  gap: 28px;
}

.knowledge-overview-metrics > div {
  display: flex;
  min-width: 65px;
  flex-direction: column;
  gap: 3px;
}

.knowledge-overview-metrics strong {
  color: var(--ink);
  font-family: "Newsreader", serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.04em;
}

.knowledge-overview-metrics span {
  color: var(--faint);
  font-size: 10px;
  white-space: nowrap;
}

.knowledge-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 48px 0 18px;
}

.knowledge-section-heading h2 {
  margin-bottom: 0;
}

.knowledge-section-heading > span {
  color: var(--faint);
  font-size: 11px;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.knowledge-card {
  display: flex;
  min-width: 0;
  min-height: 255px;
  align-items: stretch;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: transform 480ms var(--motion), border-color 480ms var(--motion), background-color 480ms var(--motion);
}

.knowledge-card:hover {
  border-color: var(--hairline-strong);
  background: #fff;
  transform: translateY(-3px);
}

.knowledge-card.locked {
  background: rgba(239, 237, 231, 0.7);
}

.knowledge-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 27px;
}

.knowledge-card > .eyebrow {
  margin-bottom: 6px;
}

.knowledge-card h3 {
  margin-bottom: 7px;
}

.knowledge-card > p:not(.eyebrow) {
  flex: 1;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.knowledge-card-meta,
.knowledge-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--faint);
  font-size: 10px;
}

.knowledge-card-meta {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
  font-family: "Geist Mono", monospace;
}

.knowledge-card-foot {
  padding-top: 11px;
}

.badge-private {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ebe7e0;
  color: var(--ink-soft);
}

.badge-private svg {
  width: 13px;
  height: 13px;
}

.knowledge-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.78fr);
  gap: 18px;
  align-items: start;
}

.knowledge-detail-card .bezel-inner {
  padding: 28px;
}

.knowledge-detail-status {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.knowledge-detail-status h2 {
  margin-bottom: 8px;
}

.knowledge-detail-status p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.knowledge-detail-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
}

.knowledge-detail-facts > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.knowledge-detail-facts span {
  color: var(--faint);
  font-size: 10px;
}

.knowledge-detail-facts strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-flow-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}

.knowledge-flow-mini > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 5px;
}

.knowledge-flow-mini > div > span {
  color: var(--faint);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
}

.knowledge-flow-mini strong {
  font-size: 12px;
  font-weight: 550;
}

.knowledge-flow-mini .flow-edge {
  width: 24px;
  flex: 0 0 24px;
}

.knowledge-rules {
  display: flex;
  margin: 0 0 26px;
  padding: 0;
  flex-direction: column;
  gap: 13px;
  list-style: none;
}

.knowledge-rules li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.knowledge-rules svg {
  width: 16px;
  height: 16px;
  color: var(--success);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

@media (max-width: 960px) {
  .knowledge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .knowledge-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .create-role-note {
    white-space: normal;
  }

  .create-stepper {
    margin-bottom: 22px;
  }

  .create-step {
    justify-content: center;
  }

  .create-step strong {
    display: none;
  }

  .create-step:not(:last-child)::after {
    right: 8px;
    left: calc(50% + 16px);
  }

  .create-shell .bezel-inner,
  .knowledge-overview-shell .bezel-inner,
  .knowledge-detail-card .bezel-inner {
    padding: 23px 18px;
  }

  .create-form-intro {
    gap: 13px;
    margin-bottom: 25px;
  }

  .stage-number {
    font-size: 32px;
  }

  .create-form-intro > .badge {
    display: none;
  }

  .create-form-intro h2 {
    font-size: 22px;
  }

  .knowledge-select-grid,
  .knowledge-grid,
  .test-room,
  .knowledge-detail-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .knowledge-select {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .knowledge-select-state {
    grid-column: 2;
  }

  .create-flow-canvas {
    display: flex;
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
  }

  .create-flow-canvas .flow-node {
    min-height: 66px;
  }

  .create-flow-canvas .flow-edge {
    width: 1px;
    height: 18px;
    flex: 0 0 18px;
    align-self: center;
  }

  .create-flow-canvas .flow-edge::after {
    top: auto;
    right: auto;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%) rotate(135deg);
  }

  .create-graph-footer,
  .knowledge-overview,
  .knowledge-section-heading,
  .create-graph-footer > span {
    align-items: flex-start;
    flex-direction: column;
  }

  .knowledge-overview {
    gap: 24px;
  }

  .knowledge-overview-metrics {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .knowledge-overview-metrics > div {
    min-width: 0;
  }

  .knowledge-overview-metrics span {
    white-space: normal;
  }

  .knowledge-card {
    min-height: 225px;
  }

  .knowledge-flow-mini {
    align-items: stretch;
    flex-direction: column;
  }

  .knowledge-flow-mini .flow-edge {
    width: 1px;
    height: 18px;
    flex: 0 0 18px;
    align-self: flex-start;
    margin-left: 6px;
  }

  .publish-timeline {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 28px;
  }

  .publish-line {
    top: 16px;
    right: auto;
    bottom: 16px;
    left: 16px;
    width: 1px;
    height: auto;
  }

  .publish-timeline > div:not(.publish-line) {
    min-height: 57px;
    padding-top: 0;
    padding-left: 45px;
  }

  .timeline-dot {
    position: absolute;
    top: 0;
    left: 0;
  }

  .mobile-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Knowledge detail: denser workflow inspection and read-only Obsidian diagnostics */
.knowledge-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 34px;
  margin-bottom: 28px;
}

.knowledge-heading-group {
  min-width: 0;
  flex: 1;
}

.knowledge-heading-group > .text-link {
  margin-bottom: 20px;
}

.knowledge-heading-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.knowledge-heading-meta .eyebrow {
  margin-bottom: 0;
}

.knowledge-heading-group h1 {
  margin: 15px 0 8px;
  font-size: clamp(46px, 5.2vw, 68px);
}

.knowledge-header-actions {
  display: flex;
  min-width: 220px;
  align-items: flex-end;
  flex-direction: column;
  gap: 12px;
  padding-top: 34px;
}

.knowledge-header-actions .button {
  white-space: nowrap;
}

.permission-caption {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 10px;
}

.permission-caption svg {
  width: 14px;
  height: 14px;
}

.knowledge-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(310px, 0.78fr);
  gap: 16px;
  align-items: start;
}

.knowledge-detail-main,
.knowledge-detail-side {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.knowledge-detail-card .bezel-inner,
.knowledge-permission-card .bezel-inner,
.retrieval-card .bezel-inner {
  padding: 24px;
}

.knowledge-status-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.knowledge-status-row .knowledge-detail-status {
  flex: 1;
}

.knowledge-status-mark {
  display: flex;
  min-width: 86px;
  align-items: center;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0 0;
  color: var(--success);
  text-align: center;
}

.knowledge-status-mark > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--success-bg);
}

.knowledge-status-mark svg {
  width: 16px;
  height: 16px;
}

.knowledge-status-mark strong {
  margin-top: 5px;
  color: var(--ink);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  font-weight: 500;
}

.knowledge-status-mark small {
  color: var(--faint);
  font-size: 9px;
  white-space: nowrap;
}

.knowledge-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.knowledge-section-title h2,
.knowledge-section-title h3 {
  margin-bottom: 7px;
}

.knowledge-section-title p:not(.eyebrow) {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.knowledge-node-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.knowledge-node-card {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: transform 420ms var(--motion), border-color 420ms var(--motion), background-color 420ms var(--motion);
}

.knowledge-node-card:hover,
.knowledge-node-card.selected {
  border-color: rgba(27, 29, 31, 0.25);
  background: #faf9f6;
  transform: translateY(-2px);
}

.knowledge-node-card.selected {
  box-shadow: inset 0 0 0 1px rgba(27, 29, 31, 0.08);
}

.knowledge-node-index {
  align-self: start;
  color: var(--faint);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
}

.knowledge-node-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--ink-soft);
}

.knowledge-node-icon svg {
  width: 17px;
  height: 17px;
}

.knowledge-node-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.knowledge-node-copy strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-node-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-node-state {
  grid-column: 2 / -1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--faint);
  font-size: 9px;
}

.knowledge-node-state i {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
}

.knowledge-node-inspector-content {
  min-width: 0;
}

.inspector-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.inspector-title-row h3 {
  margin-bottom: 0;
}

.knowledge-node-action {
  max-width: 780px;
  margin: 12px 0 19px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.68;
}

.knowledge-node-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  padding-top: 17px;
  border-top: 1px solid var(--hairline);
}

.knowledge-node-facts > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.knowledge-node-facts span,
.diagnostic-label {
  color: var(--faint);
  font-size: 10px;
}

.knowledge-node-facts strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 550;
  line-height: 1.45;
  text-overflow: ellipsis;
}

.diagnostic-heading {
  margin-bottom: 18px;
}

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

.diagnostic-item {
  display: flex;
  min-width: 0;
  min-height: 106px;
  flex-direction: column;
  justify-content: space-between;
  padding: 13px;
  border: 1px solid var(--hairline);
  background: rgba(248, 246, 241, 0.72);
}

.diagnostic-item strong {
  color: var(--ink);
  font-family: "Newsreader", serif;
  font-size: 25px;
  font-weight: 400;
  letter-spacing: -0.04em;
}

.diagnostic-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--success);
  font-size: 10px;
}

.diagnostic-state svg {
  width: 14px;
  height: 14px;
}

.diagnostic-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 17px;
  color: var(--faint);
  font-size: 10px;
}

.diagnostic-actions > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.diagnostic-actions svg {
  width: 14px;
  height: 14px;
}

.knowledge-permission-card h3 {
  margin-bottom: 12px;
}

.side-permission-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 22px 0 19px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.side-permission-note svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--info);
}

.retrieval-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 14px;
}

.retrieval-form .input {
  min-width: 0;
  min-height: 42px;
}

.retrieval-form .button {
  min-height: 42px;
}

.retrieval-result {
  padding: 15px;
  border: 1px solid rgba(54, 95, 76, 0.18);
  background: #f6faf6;
}

.retrieval-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--success);
  font-size: 10px;
}

.retrieval-result-head span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.retrieval-result-head svg {
  width: 14px;
  height: 14px;
}

.retrieval-result h4 {
  margin: 21px 0 7px;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.5;
}

.retrieval-result p {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

@media (max-width: 1180px) {
  .knowledge-detail-layout {
    grid-template-columns: 1fr;
  }

  .knowledge-detail-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .knowledge-detail-header {
    gap: 20px;
    margin-bottom: 24px;
    flex-direction: column;
  }

  .knowledge-heading-group h1 {
    font-size: clamp(41px, 12vw, 55px);
  }

  .knowledge-header-actions {
    width: 100%;
    min-width: 0;
    align-items: stretch;
    padding-top: 0;
  }

  .knowledge-header-actions .button {
    width: 100%;
  }

  .knowledge-status-row,
  .knowledge-section-title,
  .diagnostic-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .knowledge-status-mark {
    align-items: flex-start;
    flex-direction: row;
    gap: 8px;
    padding-top: 0;
    text-align: left;
  }

  .knowledge-status-mark strong {
    margin-top: 7px;
  }

  .knowledge-status-mark small {
    margin-top: 7px;
  }

  .knowledge-node-grid,
  .diagnostic-grid,
  .knowledge-detail-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .knowledge-node-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .knowledge-node-card {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .retrieval-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .retrieval-form .button {
    width: 100%;
  }
}
