/* ==========================================================================
   琢 ZHUO · 产品 AI 工作台 — design system
   白纸 · 玄墨 · 一点朱砂. Tokens & rules: see DESIGN.md
   ========================================================================== */

:root {
  /* color */
  --bg: oklch(1 0 0);
  --surface: oklch(0.976 0.003 353);
  --layer: oklch(0.962 0.004 353);
  --ink: oklch(0.24 0.014 353);
  --muted: oklch(0.48 0.014 353);
  --faint: oklch(0.62 0.012 353);
  --line: oklch(0.905 0.005 353);
  --line-strong: oklch(0.84 0.008 353);

  --primary: oklch(0.55 0.155 353);
  --primary-deep: oklch(0.47 0.15 353);
  --primary-wash: oklch(0.965 0.02 353);
  --primary-ring: oklch(0.55 0.155 353 / 0.35);

  --jade: oklch(0.4 0.075 185);
  --jade-wash: oklch(0.962 0.025 185);

  --ok: oklch(0.55 0.115 155);
  --ok-wash: oklch(0.962 0.03 155);
  --warn: oklch(0.58 0.125 75);
  --warn-wash: oklch(0.968 0.035 85);
  --danger: oklch(0.53 0.185 25);
  --danger-wash: oklch(0.965 0.025 25);

  /* type */
  --font-ui: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --fs-12: 0.75rem;
  --fs-13: 0.8125rem;
  --fs-14: 0.875rem;
  --fs-17: 1.0625rem;
  --fs-20: 1.25rem;
  --fs-24: 1.5rem;
  --fs-29: 1.8125rem;

  /* shape & depth */
  --r-ctl: 8px;
  --r-box: 12px;
  --shadow-pop: 0 8px 24px oklch(0.24 0.014 353 / 0.1), 0 2px 6px oklch(0.24 0.014 353 / 0.06);

  /* motion */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --t-fast: 160ms var(--ease);
  --t-slow: 300ms var(--ease);

  /* z scale */
  --z-nav: 30;
  --z-drawer: 40;
  --z-menu: 50;
  --z-lightbox: 60;
  --z-toast: 70;
}

/* --- base ---------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-14);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--jade);
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover {
  color: var(--primary);
}

img {
  max-width: 100%;
  display: block;
}

[data-zoom][role="button"] { cursor:zoom-in; }

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

:focus-visible {
  outline: 2px solid var(--primary-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--primary-wash);
}

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

/* --- brand mark ----------------------------------------------------------- */

.seal,
.brand-toy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 26% 22%, rgba(255, 255, 255, 0.95) 0 12%, transparent 13%),
    linear-gradient(135deg, #ff8fc7 0%, #9f7cff 42%, #65c9ff 70%, #ffd56a 100%);
  color: transparent;
  box-shadow: 0 10px 24px rgba(115, 99, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  line-height: 1;
  flex: none;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.brand-toy::before,
.brand-toy::after,
.brand-toy > span {
  content: "";
  position: absolute;
  pointer-events: none;
}

.brand-toy::before {
  width: 19px;
  height: 17px;
  left: 8px;
  bottom: 6px;
  border-radius: 5px 5px 6px 6px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 -3px 0 rgba(255, 143, 199, 0.22);
}

.brand-toy::after {
  width: 14px;
  height: 5px;
  left: 10px;
  top: 8px;
  border-radius: 5px 5px 2px 2px;
  background: rgba(255, 255, 255, 0.96);
  transform: rotate(-8deg);
}

.brand-toy > span {
  width: 3px;
  height: 3px;
  left: 15px;
  top: 21px;
  border-radius: 999px;
  background: #7b57ff;
  box-shadow: 6px 0 0 #7b57ff, 3px 4px 0 -1px #ff8fc7;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.brand:hover { color: var(--ink); }

.brand-name {
  font-size: var(--fs-17);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-sub {
  display: block;
  font-size: var(--fs-12);
  color: var(--muted);
  font-weight: 400;
  margin-top: 1px;
}

/* --- auth ------------------------------------------------------------------ */

.auth-page {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--bg);
}

.auth-side {
  background: var(--layer);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  overflow: hidden;
  position: relative;
}

.auth-page-login .auth-side {
  background: #f5f7f6;
  isolation: isolate;
}

.auth-side-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}

.auth-spectral {
  position: absolute;
  z-index: 0;
  inset: -6%;
  overflow: hidden;
  pointer-events: none;
  opacity: 1;
  background:
    #f5f7f6
    url("/static/login-spectral-poster.webp?v=20260713-1")
    center / cover no-repeat;
}

.auth-spectral canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 260ms cubic-bezier(0.23, 1, 0.32, 1);
}

.auth-spectral.is-ready canvas {
  opacity: 1;
}

.auth-spectral.is-fallback canvas {
  display: none;
}

.auth-page-login .auth-side-content {
  text-shadow: 0 1px 0 rgb(255 255 255 / 0.35);
}

.auth-side-copy {
  max-width: 36em;
}

.auth-side-title {
  font-size: var(--fs-29);
  font-weight: 600;
  line-height: 1.35;
  max-width: 16em;
  text-wrap: balance;
  margin-top: 48px;
}

.auth-side-note {
  color: var(--muted);
  max-width: 34em;
  margin-top: 16px;
}

.auth-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
  color: var(--muted);
  font-size: var(--fs-13);
}

.auth-steps b {
  color: var(--ink);
  font-weight: 600;
  display: block;
  font-size: var(--fs-14);
}

.auth-steps li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;
  align-items: start;
}

.auth-step-no {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-12);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-card {
  width: min(360px, 100%);
}

.auth-card .brand {
  margin-bottom: 28px;
}

.auth-title {
  font-size: var(--fs-24);
  font-weight: 600;
  margin-bottom: 6px;
}

.auth-hint {
  color: var(--muted);
  margin-bottom: 24px;
}

.auth-card .btn-primary {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

.auth-card .field-row { grid-template-columns:1fr; gap:0; }
.auth-password-help { display:block; margin:-4px 0 16px; }
.auth-switch { margin-top:18px; color:var(--muted); text-align:center; font-size:var(--fs-13); }
.auth-switch a { color:var(--primary-deep); font-weight:650; }
.auth-switch a:hover { text-decoration:underline; }

@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-side {
    display: none;
  }
  .auth-page-login {
    grid-template-rows: clamp(148px, 24dvh, 202px) minmax(0, 1fr);
  }
  .auth-page-login .auth-side {
    display: block;
    min-height: 0;
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .auth-page-login .auth-side-content {
    display: none;
  }
  .auth-page-login .auth-spectral {
    inset: -18% -8%;
  }
  .auth-page-login .auth-main {
    align-items: flex-start;
    padding: 28px 20px 40px;
  }
}

@media (min-width: 901px) {
  /* the side panel already carries the brand */
  .auth-card > .brand {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-spectral canvas {
    transition-duration: 0ms;
  }
}

/* --- app shell --------------------------------------------------------------- */

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

.sidebar {
  background: var(--layer);
  border-right: 1px solid var(--line);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  z-index: var(--z-nav);
}

.sidebar .brand {
  padding: 0 8px;
}

.nav-group {
  display: grid;
  gap: 2px;
}

.nav-label {
  font-size: var(--fs-12);
  color: var(--faint);
  padding: 0 10px;
  margin: 4px 0;
  letter-spacing: 0.04em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-ctl);
  color: var(--muted);
  font-weight: 500;
  position: relative;
  transition: background var(--t-fast), color var(--t-fast);
}

.nav-item svg {
  flex: none;
  opacity: 0.85;
}

.nav-item:hover {
  background: oklch(0.94 0.005 353);
  color: var(--ink);
}

.nav-item[aria-current="page"] {
  background: var(--primary-wash);
  color: var(--primary-deep);
}

.nav-item[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: var(--primary);
}

.nav-count {
  margin-left: auto;
  font-size: var(--fs-12);
  font-family: var(--font-mono);
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 14px;
}

.account-switcher { position:relative; }
.side-user {
  width:100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-ctl);
  border:1px solid transparent;
  color:var(--ink);
  background:transparent;
  cursor:pointer;
  text-align:left;
}
.side-user:hover,.side-user[aria-expanded="true"] { border-color:var(--line); background:var(--surface); }
.side-user > svg { margin-left:auto; color:var(--faint); }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: var(--fs-13);
  font-weight: 600;
  flex: none;
  background: var(--jade);
}

.avatar.accent-ink { background: oklch(0.35 0.02 353); }
.avatar.accent-cyan { background: oklch(0.5 0.09 220); }
.avatar.accent-amber { background: oklch(0.55 0.11 75); }
.avatar.accent-violet { background: oklch(0.48 0.12 300); }
.avatar.accent-rose { background: var(--primary); }
.avatar.accent-moss { background: oklch(0.5 0.09 140); }

.side-user-name {
  flex:1 1 auto;
  font-weight: 500;
  font-size: var(--fs-13);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-menu { position:absolute; z-index:var(--z-menu); left:0; right:0; bottom:calc(100% + 8px); overflow:hidden; padding:8px; border:1px solid var(--line); border-radius:16px; background:var(--bg); box-shadow:0 16px 44px oklch(.25 .02 353 / .16); }
.account-menu[hidden] { display:none; }
.account-menu-head { display:flex; align-items:center; gap:10px; padding:8px 8px 12px; border-bottom:1px solid var(--line); }
.account-menu-head > span:last-child { min-width:0; display:grid; gap:2px; }
.account-menu-head b,.account-menu-head small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account-menu-head b { font-size:var(--fs-13); }
.account-menu-head small { color:var(--faint); font-size:10px; }
.account-menu-items { display:grid; gap:2px; padding:7px 0; border-bottom:1px solid var(--line); }
.account-menu-items a,.account-logout button { display:grid; grid-template-columns:20px 1fr 16px; align-items:center; gap:9px; width:100%; min-height:40px; padding:8px 9px; border:0; border-radius:9px; color:var(--ink); background:transparent; cursor:pointer; text-align:left; font-size:var(--fs-13); }
.account-menu-items a:hover,.account-logout button:hover { background:var(--surface); }
.account-menu-items a > svg:last-child { color:var(--faint); }
.account-logout { padding-top:7px; }
.account-logout button { grid-template-columns:20px 1fr; color:var(--danger); }


/* topbar (mobile) */

.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  align-items: center;
  gap: 12px;
}

.topbar .brand-name { font-size: var(--fs-14); }

.menu-btn {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--r-ctl);
  padding: 7px 9px;
  cursor: pointer;
  display: inline-flex;
}

.drawer-scrim {
  display: none;
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .topbar {
    display: flex;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    transform: translateX(-102%);
    transition: transform var(--t-slow);
    z-index: var(--z-drawer);
    box-shadow: none;
  }
  body.drawer-open .sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-pop);
  }
  body.drawer-open .drawer-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: oklch(0.24 0.014 353 / 0.32);
    z-index: calc(var(--z-drawer) - 1);
    border: 0;
    width: 100%;
    padding: 0;
  }
}

.content {
  padding: 32px clamp(16px, 4vw, 40px) 64px;
  width: 100%;
  min-width: 0;
  max-width: 1240px;
  /* Keep the workspace anchored to the sidebar when a window is maximized.
     Auto margins made the entire UI drift horizontally above 1472px. */
  margin: 0;
}

/* --- page header ------------------------------------------------------------ */

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

.page-title {
  font-size: var(--fs-24);
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}

.page-sub {
  color: var(--muted);
  margin-top: 4px;
}

.page-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.crumbs {
  font-size: var(--fs-13);
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs .sep { color: var(--line-strong); }

.section-title {
  font-size: var(--fs-17);
  font-weight: 600;
  margin: 32px 0 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-title .count {
  color: var(--faint);
  font-size: var(--fs-13);
  font-family: var(--font-mono);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(101, 201, 255, 0.18), transparent 34%),
    radial-gradient(circle at bottom left, rgba(255, 143, 199, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(250,250,252,0.98));
  box-shadow: 0 10px 28px rgba(120, 100, 255, 0.06);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(123, 87, 255, 0.18);
  color: var(--primary-deep);
  font-size: var(--fs-12);
  font-weight: 600;
}

.hero-title {
  margin-top: 12px;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.28;
  max-width: 18em;
}

.hero-copy {
  margin-top: 10px;
  color: var(--muted);
  max-width: 58em;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.pipeline-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  padding: 16px;
  min-height: 122px;
}

.pipeline-default { background: linear-gradient(180deg, #fff, #fcfcfe); }
.pipeline-queued { background: linear-gradient(180deg, #fff8ea, #fffdf8); }
.pipeline-running { background: linear-gradient(180deg, #f7f2ff, #fff); }
.pipeline-ok { background: linear-gradient(180deg, #eefbf5, #fff); }

.pipeline-step {
  color: var(--muted);
  font-size: var(--fs-13);
}

.pipeline-value {
  margin-top: 10px;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  line-height: 1;
}

.pipeline-desc {
  margin-top: 8px;
  color: var(--muted);
  font-size: var(--fs-13);
  line-height: 1.5;
}

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

.signal-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--bg);
}

.signal-list.compact {
  gap: 10px;
}

.signal-item.compact {
  padding: 12px;
}

.signal-title {
  font-size: var(--fs-14);
  font-weight: 600;
}

.signal-meta {
  margin-top: 4px;
  color: var(--faint);
  font-size: var(--fs-12);
}

.signal-copy {
  margin-top: 8px;
  color: var(--muted);
  font-size: var(--fs-13);
  line-height: 1.6;
}

.action-stack {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.row-item-stack .row-main {
  display: grid;
  gap: 6px;
}

.row-title-wrap {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

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

@media (max-width: 760px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }
  .hero-actions {
    justify-content: flex-start;
  }
  .pipeline-grid {
    grid-template-columns: 1fr;
  }
}

/* --- buttons ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--r-ctl);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: var(--fs-14);
  line-height: 1.4;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
  background: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-deep);
  color: #fff;
}

.btn-secondary {
  background: var(--bg);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--muted);
  background: var(--surface);
}

.btn-quiet {
  color: var(--muted);
  padding: 8px 10px;
}

.btn-quiet:hover {
  background: var(--surface);
  color: var(--ink);
}

.btn-danger {
  background: var(--bg);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 5px 10px;
  font-size: var(--fs-13);
}

.btn-lg {
  padding: 11px 20px;
  font-size: var(--fs-14);
}

.btn-block {
  width: 100%;
}

.btn .spin {
  display: none;
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.75;
}

.btn.is-loading .spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- forms ----------------------------------------------------------------------- */

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.field > label {
  font-weight: 500;
  font-size: var(--fs-13);
}

.field .req {
  color: var(--danger);
  margin-left: 2px;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  background: var(--bg);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.7;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--faint);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.field .help {
  color: var(--muted);
  font-size: var(--fs-12);
}

.field .error,
.form-error {
  color: var(--danger);
  font-size: var(--fs-13);
}

.form-error {
  background: var(--danger-wash);
  border: 1px solid oklch(0.53 0.185 25 / 0.25);
  border-radius: var(--r-ctl);
  padding: 10px 12px;
  margin-bottom: 18px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0 16px;
}

/* choice chips (radio/checkbox cards) */

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

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: var(--fs-13);
  color: var(--muted);
  background: var(--bg);
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}

.chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--muted);
  color: var(--ink);
}

.chip:has(input:checked) {
  background: var(--primary-wash);
  border-color: var(--primary);
  color: var(--primary-deep);
  font-weight: 500;
}

.chip:has(input:focus-visible) {
  box-shadow: 0 0 0 3px var(--primary-ring);
}

/* option cards (workflow picker) */

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.option-card {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-box);
  padding: 16px;
  cursor: pointer;
  background: var(--bg);
  transition: border-color var(--t-fast), background var(--t-fast);
  display: grid;
  gap: 4px;
}

.option-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.option-card:hover {
  border-color: var(--muted);
}

.option-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-wash);
}

.option-card:has(input:focus-visible) {
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.option-card b {
  font-weight: 600;
}

.option-card span {
  color: var(--muted);
  font-size: var(--fs-13);
}

/* --- badges & status --------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: var(--fs-12);
  font-weight: 500;
  white-space: nowrap;
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  flex: none;
}

.badge-queued { background: var(--surface); color: var(--muted); }
.badge-running { background: var(--primary-wash); color: var(--primary-deep); }
.badge-paused { background: var(--warn-wash); color: var(--warn); }
.badge-succeeded { background: var(--ok-wash); color: var(--ok); }
.badge-failed { background: var(--danger-wash); color: var(--danger); }
.badge-canceled { background: var(--surface); color: var(--faint); }
.badge-jade { background: var(--jade-wash); color: var(--jade); }
.badge-warning { background: var(--warn-wash); color: var(--warn); }
.badge-plain { background: var(--surface); color: var(--muted); }

.badge-running .dot {
  animation: pulse 1.4s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.tag {
  display: inline-flex;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: var(--fs-12);
  padding: 2px 10px;
}

/* --- progress ----------------------------------------------------------------------- */

.progress {
  height: 6px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
}

.progress > i {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  width: 0;
  transition: width var(--t-slow);
}

.progress.is-queued > i {
  width: 30% !important;
  animation: slide 1.6s var(--ease) infinite;
}

@keyframes slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(400%); }
}

/* --- skeleton ------------------------------------------------------------------------ */

.skeleton {
  background: linear-gradient(100deg, var(--surface) 40%, oklch(0.99 0.002 353) 50%, var(--surface) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--r-ctl);
  color: transparent !important;
  user-select: none;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* --- panels, cards, stats ------------------------------------------------------------- */

.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-box);
  background: var(--bg);
}

.panel-pad {
  padding: 20px;
}

.well {
  background: var(--surface);
  border-radius: var(--r-box);
  padding: 16px 18px;
}

.stat-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--r-box);
  overflow: hidden;
}

.stat {
  padding: 16px 20px;
  border-left: 1px solid var(--line);
  min-width: 0;
}

.stat:first-child { border-left: 0; }

.stat .k {
  font-size: var(--fs-12);
  color: var(--muted);
}

.stat .v {
  font-size: var(--fs-24);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  margin-top: 2px;
}

.stat .d {
  font-size: var(--fs-12);
  color: var(--faint);
  margin-top: 2px;
}

@media (max-width: 720px) {
  .stat-band { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

/* --- lists & tables --------------------------------------------------------------------- */

.rows {
  display: grid;
}

.row-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 4px;
  border-top: 1px solid var(--line);
  color: inherit;
  min-width: 0;
}

.rows > .row-item:first-child {
  border-top: 0;
}

a.row-item {
  transition: background var(--t-fast);
  border-radius: 6px;
}

a.row-item:hover {
  background: var(--surface);
  color: inherit;
}

.row-main {
  min-width: 0;
  flex: 1;
}

.row-title {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-meta {
  color: var(--muted);
  font-size: var(--fs-13);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-side {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  color: var(--muted);
  font-size: var(--fs-13);
}

.kind-glyph {
  width: 34px;
  height: 34px;
  border-radius: var(--r-ctl);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-size: var(--fs-13);
  font-weight: 600;
}

.kind-report { background: var(--jade-wash); color: var(--jade); }
.kind-concepts { background: var(--primary-wash); color: var(--primary-deep); }
.kind-merch { background: var(--warn-wash); color: var(--warn); }

/* --- project grid --------------------------------------------------------------------------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: var(--r-box);
  overflow: hidden;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: border-color var(--t-fast), transform var(--t-fast);
  background: var(--bg);
}

.project-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  color: inherit;
}

.project-cover {
  height: 92px;
  position: relative;
  background: var(--surface);
}

.project-cover svg {
  width: 100%;
  height: 100%;
  display: block;
}

.project-body {
  padding: 14px 16px 16px;
  display: grid;
  gap: 8px;
}

.project-name {
  font-weight: 600;
  font-size: var(--fs-14);
}

.project-summary {
  color: var(--muted);
  font-size: var(--fs-13);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.project-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--faint);
  font-size: var(--fs-12);
}

/* --- toolbars / filters ------------------------------------------------------------------------ */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.toolbar .input {
  max-width: 280px;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  overflow: hidden;
}

.seg a {
  padding: 6px 12px;
  font-size: var(--fs-13);
  color: var(--muted);
  border-left: 1px solid var(--line);
  transition: background var(--t-fast), color var(--t-fast);
}

.seg a:first-child { border-left: 0; }

.seg a:hover { background: var(--surface); color: var(--ink); }

.seg a[aria-current="true"] {
  background: var(--primary-wash);
  color: var(--primary-deep);
  font-weight: 500;
}

/* --- run detail -------------------------------------------------------------------------------- */

.run-head {
  border: 1px solid var(--line);
  border-radius: var(--r-box);
  padding: 18px 20px;
  display: grid;
  gap: 14px;
}

.run-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.run-phase {
  color: var(--muted);
  font-size: var(--fs-13);
  min-height: 1.4em;
}

.run-stats {
  display: flex;
  gap: 18px;
  color: var(--faint);
  font-size: var(--fs-12);
  flex-wrap: wrap;
}

.run-stats b {
  color: var(--muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.stream {
  background: var(--surface);
  border-radius: var(--r-box);
  padding: 18px 20px;
  font-size: var(--fs-13);
  line-height: 1.75;
  max-height: 430px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
}

.stream:empty::before {
  content: "等待输出……";
  color: var(--faint);
}

.stream.is-live::after {
  content: "▌";
  color: var(--primary);
  animation: caret 1s steps(2) infinite;
}

@keyframes caret {
  50% { opacity: 0; }
}

/* --- artifact / image tiles --------------------------------------------------------------------------- */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.tile {
  border: 1px solid var(--line);
  border-radius: var(--r-box);
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.tile-img {
  aspect-ratio: 1;
  position: relative;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform var(--t-slow);
}

.tile-img img:hover {
  transform: scale(1.03);
}

.tile-img .ph {
  color: var(--faint);
  font-size: var(--fs-13);
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 12px;
  text-align: center;
}

.tile-img .ph .spin {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: spin 0.9s linear infinite;
}

.tile-img.is-pending { background: repeating-linear-gradient(0deg, var(--surface), var(--surface)); }

.tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  font-size: var(--fs-13);
}

.tile-foot .t {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.tile-actions {
  display: flex;
  gap: 2px;
  flex: none;
}
.tile-action { display:inline-flex; align-items:center; gap:4px; min-height:32px; padding:5px 7px; border:0; border-radius:6px; color:var(--muted); background:transparent; cursor:pointer; font-size:11px; }
.tile-action:hover { color:var(--ink); background:var(--surface); }
.tile-action svg { flex:none; }

.icon-btn {
  border: 0;
  background: none;
  border-radius: 6px;
  padding: 4px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  transition: background var(--t-fast), color var(--t-fast);
}

.icon-btn:hover {
  background: var(--surface);
  color: var(--ink);
}

/* lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox);
  background: oklch(0.18 0.01 353 / 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: min(1100px, 92vw);
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--r-box);
  box-shadow: var(--shadow-pop);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: none;
  border: 0;
  color: #fff;
  display:inline-flex;
  align-items:center;
  gap:7px;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
  padding: 8px;
}
.lightbox-close span:first-child { font-size:20px; line-height:1; }

.lightbox-cap {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: oklch(0.9 0.005 353);
  font-size: var(--fs-13);
  background: oklch(0.24 0.014 353 / 0.6);
  padding: 6px 14px;
  border-radius: 999px;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- report reader ------------------------------------------------------------------------------------ */

.doc {
  max-width: 72ch;
  font-size: 0.9375rem;
  line-height: 1.85;
}

.doc h1 {
  font-size: var(--fs-24);
  line-height: 1.4;
  margin: 0 0 20px;
  text-wrap: balance;
}

.doc h2 {
  font-size: var(--fs-17);
  margin: 32px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.doc h3 {
  font-size: var(--fs-14);
  margin: 20px 0 8px;
}

.doc p {
  margin: 0 0 12px;
}

.doc ul, .doc ol {
  margin: 0 0 12px;
  padding-left: 1.4em;
}

.doc li { margin-bottom: 4px; }

.doc table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0 18px;
  font-size: var(--fs-13);
}

.doc th, .doc td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
}

.doc th {
  background: var(--surface);
  font-weight: 600;
}

.doc code {
  font-family: var(--font-mono);
  background: var(--surface);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.85em;
}

.doc blockquote {
  margin: 0 0 12px;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--line-strong);
  color: var(--muted);
}

/* --- activity feed -------------------------------------------------------------------------------------- */

.feed {
  display: grid;
}

.feed-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
  padding: 10px 0;
  position: relative;
}

.feed-item::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 26px;
  bottom: -4px;
  width: 1px;
  background: var(--line);
}

.feed-item:last-child::before {
  display: none;
}

.feed-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 2px solid var(--line-strong);
  background: var(--bg);
  margin-top: 6px;
}

.feed-dot.ok { border-color: var(--ok); }
.feed-dot.bad { border-color: var(--danger); }
.feed-dot.hot { border-color: var(--primary); }

.feed-text {
  font-size: var(--fs-13);
  color: var(--ink);
}

.feed-text a { color: inherit; font-weight: 500; }
.feed-text a:hover { color: var(--primary); }

.feed-when {
  color: var(--faint);
  font-size: var(--fs-12);
  margin-top: 1px;
}

/* --- empty state ------------------------------------------------------------------------------------------ */

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-box);
  padding: 44px 24px;
  text-align: center;
  display: grid;
  gap: 6px;
  justify-items: center;
}

.empty b {
  font-size: var(--fs-14);
  font-weight: 600;
}

.empty p {
  color: var(--muted);
  font-size: var(--fs-13);
  max-width: 36em;
}

.empty .btn {
  margin-top: 10px;
}

/* --- messages / toasts --------------------------------------------------------------------------------------- */

.toasts {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: var(--z-toast);
  display: grid;
  gap: 8px;
  max-width: min(360px, calc(100vw - 36px));
}

.toast {
  background: var(--ink);
  color: oklch(0.97 0.003 353);
  border-radius: var(--r-ctl);
  padding: 10px 14px;
  font-size: var(--fs-13);
  box-shadow: var(--shadow-pop);
  display: flex;
  gap: 10px;
  align-items: start;
  animation: toast-in var(--t-slow) backwards;
}

.toast.success { background: var(--ok); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
}

/* --- misc ----------------------------------------------------------------------------------------------------- */

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

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

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.mt-0 { margin-top: 0; }
.mb-24 { margin-bottom: 24px; }
.hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tabs a {
  padding: 9px 14px;
  color: var(--muted);
  font-weight: 500;
  font-size: var(--fs-14);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
}

.tabs a:hover { color: var(--ink); }

.tabs a[aria-current="true"] {
  color: var(--primary-deep);
  border-bottom-color: var(--primary);
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 64px;
}

.bar-chart i {
  flex: 1;
  background: var(--jade-wash);
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  position: relative;
  transition: background var(--t-fast);
}

.bar-chart i.hot { background: var(--jade); }

.bar-chart i:hover { background: var(--jade); }

.bar-legend {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-size: var(--fs-12);
  margin-top: 6px;
}

/* generation wizard: config section follows the checked workflow */

.wiz-cfg {
  display: none;
}

.wiz:has(input[name="kind"][value="report"]:checked) [data-cfg="report"],
.wiz:has(input[name="kind"][value="concepts"]:checked) [data-cfg="concepts"],
.wiz:has(input[name="kind"][value="merch"]:checked) [data-cfg="merch"] {
  display: block;
}

.wiz:has(input[name="kind"]:checked) .wiz-launch {
  display: flex;
}

.wiz-launch {
  display: none;
  gap: 10px;
  align-items: center;
  margin-top: 24px;
}

/* provider list */

.provider-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 4px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.provider-row:first-child { border-top: 0; }

.provider-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--r-ctl);
  background: var(--jade-wash);
  color: var(--jade);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex: none;
}

.provider-mark.sandbox {
  background: var(--surface);
  color: var(--muted);
}

@media (max-width: 720px) {
  .provider-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
  }
  .provider-row .page-actions {
    grid-column: 1 / -1;
    margin-left: 0 !important;
  }
}

/* --- reduced motion --------------------------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .badge-running .dot,
  .stream.is-live::after,
  .skeleton,
  .progress.is-queued > i {
    animation: none !important;
  }
}

/* print: report reader */

@media print {
  .sidebar, .topbar, .page-actions, .toasts { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  .content { max-width: none; padding: 0; }
}

/* Product project information architecture */
.project-index { overflow: hidden; }
.project-index-head,
.project-index-row,
.project-task-heading,
.task-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.project-index-head { padding: 18px 22px 12px; border-bottom: 1px solid var(--line); }
.project-index-head .section-title { margin-bottom: 0; }
.project-index-row { padding: 20px 22px; border-top: 1px solid var(--line); }
.project-index-row:first-child { border-top: 0; }
.project-index-row:hover { background: color-mix(in oklab, var(--primary) 3%, var(--surface)); }
.project-index-main { min-width: 0; flex: 1; }
.project-index-title-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.project-index-title { color: var(--ink); font-size: var(--fs-16); font-weight: 750; text-decoration: none; }
.project-index-title:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 4px; }
.project-index-brief { margin: 7px 0; color: var(--muted); font-size: var(--fs-13); line-height: 1.6; }
.project-index-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--faint); font-size: var(--fs-12); }
.project-index-enter { flex: none; color: var(--primary); font-size: var(--fs-13); font-weight: 700; text-decoration: none; }
.project-section-nav { position: sticky; top: 0; z-index: 4; display: flex; gap: 6px; overflow-x: auto; margin: -4px 0 20px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in oklab, var(--surface) 92%, transparent); backdrop-filter: blur(14px); }
.project-section-nav a { flex: none; padding: 7px 11px; border-radius: 9px; color: var(--muted); font-size: var(--fs-13); font-weight: 650; text-decoration: none; }
.project-section-nav a:hover { color: var(--primary); background: var(--primary-wash); }
.project-requirement-text { color: var(--ink); font-size: var(--fs-14); line-height: 1.75; white-space: pre-wrap; }
.inline-link { color: var(--primary); font-weight: 650; text-decoration: none; }
.project-task-heading { align-items: flex-end; margin-bottom: 12px; }
.project-task-heading .section-title { margin-bottom: 0; }
.eyebrow { margin: 0 0 4px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.task-result-group { margin-bottom: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.task-result-head { justify-content: flex-start; }
.task-result-number { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; color: var(--primary); background: var(--primary-wash); font-size: var(--fs-13); font-weight: 800; }
.task-result-title { min-width: 0; flex: 1; }
.task-result-title h3 { margin: 0; color: var(--ink); font-size: var(--fs-15); }
.task-result-title p { margin: 3px 0 0; color: var(--faint); font-size: var(--fs-12); }
.task-result-brief { margin: 14px 0; padding: 12px 14px; border-left: 3px solid var(--primary); background: var(--surface-subtle, var(--bg)); }
.task-result-brief b { font-size: var(--fs-12); }
.task-result-brief p { margin: 5px 0 0; color: var(--muted); font-size: var(--fs-12); line-height: 1.65; white-space: pre-wrap; }
.task-result-images { margin-top: 14px; }
@media (max-width: 720px) {
  .project-index-row { align-items: flex-start; padding: 16px; }
  .project-index-enter { padding-top: 2px; }
  .project-task-heading { align-items: flex-start; }
  .task-result-group { padding: 14px; }
}

/* GPT-style specialized agents */
.agent-hub-head { align-items:flex-end; margin-bottom:28px; }
.agent-hub-head > div { max-width:760px; }
.agent-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.agent-card { position:relative; display:grid; grid-template-columns:62px 1fr auto; gap:18px; align-items:start; min-height:260px; padding:26px; border:1px solid var(--line); border-top:3px solid var(--primary); border-radius:16px; background:var(--bg); }
.agent-card-ip_merch_artist { border-top-color:var(--warn); }
.agent-card-mark,.agent-avatar { display:grid; place-items:center; width:48px; height:48px; flex:none; border-radius:12px; color:white; background:var(--primary); font-weight:800; box-shadow:none; }
.agent-card-mark { width:62px; height:62px; border-radius:20px; font-size:20px; }
.agent-card-ip_merch_artist .agent-card-mark,.agent-card-ip_merch_artist .agent-avatar { background:var(--warn); }
.agent-card-copy { min-width:0; }
.agent-kicker { color:var(--primary); font-size:11px; font-weight:800; letter-spacing:.08em; }
.agent-card h2 { margin:3px 0 8px; font-size:var(--fs-20); }
.agent-card-copy > p { color:var(--muted); line-height:1.7; }
.agent-capabilities { display:flex; flex-wrap:wrap; gap:7px; margin-top:16px; }
.agent-capabilities span { padding:5px 9px; border:1px solid var(--line); border-radius:999px; color:var(--muted); background:var(--bg); font-size:11px; }
.nav-item-sub { margin-left:26px; font-size:12px; }

.agent-history-page-head { align-items:flex-end; }
.agent-history-toolbar { display:grid; grid-template-columns:minmax(260px,1fr) auto auto; align-items:center; gap:12px; margin-bottom:18px; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.agent-history-search { display:flex; align-items:center; gap:9px; min-width:0; height:44px; padding:0 12px; border:1px solid var(--line-strong); border-radius:9px; color:var(--faint); background:var(--bg); }
.agent-history-search:focus-within { border-color:var(--primary); outline:3px solid var(--primary-ring); }
.agent-history-search input { min-width:0; width:100%; border:0; outline:0; color:var(--ink); background:transparent; }
.agent-history-filters { display:flex; gap:4px; }
.agent-history-filters a { min-height:40px; padding:10px 12px; border-radius:8px; color:var(--muted); font-size:12px; white-space:nowrap; }
.agent-history-filters a:hover,.agent-history-filters a[aria-current="page"] { color:var(--ink); background:var(--layer); }
.agent-history-page-list { display:grid; gap:7px; }
.agent-history-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; border-bottom:1px solid var(--line); }
.agent-history-row-main { display:flex; align-items:center; gap:13px; min-width:0; min-height:72px; padding:11px 10px; color:var(--ink); }
.agent-history-row:hover { background:var(--surface); }
.agent-history-row-icon { display:grid; place-items:center; flex:0 0 40px; width:40px; height:40px; border:1px solid var(--line); border-radius:10px; color:var(--primary); background:var(--primary-wash); }
.agent-history-row-copy { display:grid; gap:5px; min-width:0; }
.agent-history-row-copy strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.agent-history-row-copy small { color:var(--faint); font-size:11px; }
.agent-history-row-copy time { white-space:nowrap; }
.agent-history-row-open { display:flex; align-items:center; justify-content:center; gap:5px; min-height:40px; margin-left:auto; padding:0 9px; border-radius:8px; color:var(--muted); font-size:11px; white-space:nowrap; }
.agent-history-row-main:hover .agent-history-row-open { color:var(--primary); background:var(--primary-wash); }
.agent-history-row form { padding:0 10px; }
.agent-history-empty { min-height:320px; }

.content:has(.agent-workspace) { max-width:none; padding:0; height:100vh; overflow:hidden; }
.agent-workspace { display:grid; grid-template-columns:235px minmax(0,1fr); height:100vh; background:var(--bg); }
.agent-history { padding:18px 12px; border-right:1px solid var(--line); background:var(--surface); overflow-y:auto; }
.agent-history-head { display:flex; align-items:center; justify-content:space-between; margin-top:16px; padding:2px 4px 9px; border-bottom:1px solid var(--line); }
.agent-history-head strong { font-size:13px; }
.agent-history-head a { color:var(--primary); font-size:10px; }
.agent-history .btn { width:100%; }
.agent-history-list { display:grid; gap:4px; margin-top:8px; }
.agent-history-delete { display:none; margin-top:20px; padding-top:14px; border-top:1px solid var(--line); }
.agent-history-scrim { display:none; position:fixed; z-index:calc(var(--z-menu) - 1); inset:56px 0 0; border:0; background:oklch(.18 .01 350/.34); }
.agent-history-list a { display:flex; flex-direction:column; padding:9px 10px; border-radius:9px; color:var(--muted); }
.agent-history-list a:hover,.agent-history-list a[aria-current="page"] { color:var(--ink); background:var(--layer); }
.agent-history-list span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.agent-history-list small { color:var(--faint); font-size:10px; }
.agent-chat-shell { display:grid; grid-template-rows:auto minmax(0,1fr) auto; min-width:0; height:100vh; }
.agent-chat-head { display:grid; grid-template-columns:120px 1fr 120px; align-items:center; min-height:76px; padding:10px 24px; border-bottom:1px solid var(--line); background:color-mix(in oklab,var(--bg) 92%,transparent); }
.agent-back { color:var(--muted); font-size:12px; }
.agent-identity { display:flex; align-items:center; justify-content:center; gap:11px; }
.agent-identity h1 { font-size:15px; }
.agent-identity p { color:var(--faint); font-size:11px; }
.agent-chat-head form { justify-self:end; }
.agent-head-actions { display:flex; justify-self:end; align-items:center; gap:4px; }
.agent-head-actions form { display:flex; }
.agent-history-toggle { display:none; }
.agent-thread { overflow-y:auto; scroll-behavior:smooth; padding:28px max(24px,calc((100% - 820px)/2)) 170px; }
.agent-welcome { max-width:620px; margin:11vh auto 40px; text-align:center; }
.agent-avatar-lg { width:64px; height:64px; margin:0 auto 18px; border-radius:20px; font-size:20px; }
.agent-welcome h2 { margin-bottom:8px; font-size:var(--fs-24); }
.agent-welcome > p { color:var(--muted); }
.agent-starter { margin:22px auto 0; padding:14px 16px; border:1px solid var(--line); border-radius:14px; color:var(--muted); background:var(--surface); text-align:left; font-size:12px; }
.chat-message { position:relative; display:grid; grid-template-columns:92px minmax(0,1fr); gap:18px; padding:20px 0 34px; border-bottom:1px solid color-mix(in oklab,var(--line) 72%,transparent); }
.chat-role { padding-top:3px; color:var(--faint); font-size:11px; font-weight:750; }
.chat-bubble { min-width:0; }
.chat-copy { color:var(--ink); line-height:1.78; overflow-wrap:anywhere; }
.chat-copy p,.chat-copy ul,.chat-copy ol,.chat-copy pre { margin:0 0 13px; }
.chat-copy pre { position:relative; overflow:auto; padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--surface); white-space:pre-wrap; }
.chat-copy code { font-family:var(--font-mono); font-size:12px; }
.agent-copy-list { display:grid; gap:10px; }
.requirement-set { display:grid; gap:10px; min-width:0; }
.requirement-set-head { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:34px; padding:0 2px; color:var(--muted); font-size:11px; }
.requirement-head-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; }
.requirement-set-head button,.requirement-tools button { border:0; color:var(--muted); background:transparent; cursor:pointer; font-size:11px; }
.requirement-head-actions [data-selection-import] { min-height:30px; padding:0 12px; border-radius:999px; color:#fff; background:var(--ink); }
.requirement-head-actions button:disabled { opacity:.35; cursor:not-allowed; }
.requirement-set-head button:hover,.requirement-tools button:hover { color:var(--ink); }
.requirement-items { display:grid; gap:10px; min-width:0; }
.requirement-item { position:relative; display:block; min-width:0; padding:18px 116px 18px 18px; border:1px solid var(--line); border-radius:16px; background:var(--surface); }
.requirement-text { min-width:0; white-space:pre-wrap; overflow-wrap:anywhere; color:var(--ink); font-size:12px; line-height:1.75; }
.requirement-tools { position:absolute; top:13px; right:13px; display:flex; gap:10px; }
.requirement-check { display:none; position:absolute; top:19px; left:15px; cursor:pointer; }
.requirement-check input { position:absolute; opacity:0; }
.requirement-check span { display:block; width:16px; height:16px; border:1px solid var(--line-strong); border-radius:5px; }
.requirement-check input:checked + span { border-color:var(--primary); background:var(--primary); box-shadow:inset 0 0 0 3px #fff; }
.requirement-set.is-selecting .requirement-item { padding-left:46px; }
.requirement-set.is-selecting .requirement-check { display:flex; }
.requirement-set.is-selecting .requirement-tools { display:none; }
.handoff-dialog { width:min(440px,calc(100vw - 32px)); padding:0; border:0; border-radius:20px; color:var(--ink); background:var(--surface); box-shadow:0 24px 80px rgba(20,24,22,.22); }
.handoff-dialog::backdrop { background:rgba(18,22,20,.36); backdrop-filter:blur(3px); }
.handoff-dialog-card { display:grid; gap:18px; padding:24px; }
.handoff-dialog-card small { color:var(--muted); }.handoff-dialog-card h3 { margin:4px 0 6px;font-size:18px; }.handoff-dialog-card p { margin:0;color:var(--muted); }
.handoff-dialog-note { padding:13px 14px; border-radius:12px; background:var(--layer); color:var(--muted); font-size:11px; line-height:1.6; }
.handoff-dialog-actions { display:flex; justify-content:flex-end; gap:8px; }.handoff-dialog-actions button { min-height:38px;padding:0 17px;border:0;border-radius:999px;cursor:pointer; }.handoff-dialog-actions [data-handoff-confirm] { color:#fff;background:var(--ink); }
.agent-handoff-banner { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:16px; padding:10px 14px; border:1px solid var(--line); border-radius:12px; color:var(--muted); background:var(--layer); font-size:11px; }
.agent-handoff-banner a { color:var(--primary); font-weight:650; }
.agent-quick-replies { display:flex; flex-wrap:wrap; gap:8px; width:min(760px,calc(100% - 28px)); margin:0 auto 9px; }
.agent-quick-replies:empty,.agent-quick-replies[hidden] { display:none; }
.agent-quick-replies button { min-height:34px; padding:7px 13px; border:1px solid var(--line); border-radius:999px; color:var(--ink); background:var(--surface); cursor:pointer; font:inherit; font-size:11px; line-height:1.25; }
.agent-quick-replies button:hover,.agent-quick-replies button.is-selected { border-color:var(--primary); color:var(--primary); background:color-mix(in srgb,var(--primary) 7%,var(--surface)); }
.agent-quick-replies .quick-reply-confirm { color:#fff; border-color:var(--ink); background:var(--ink); }
.agent-quick-replies button:disabled { opacity:.35; cursor:not-allowed; }
@media(max-width:640px){.requirement-set-head{align-items:flex-start;flex-direction:column}.requirement-head-actions{width:100%;justify-content:flex-start;flex-wrap:wrap}.requirement-item{padding:48px 15px 16px}.requirement-tools{left:15px;right:auto}.requirement-set.is-selecting .requirement-item{padding:18px 15px 18px 46px}}
.chat-message-actions { position:absolute; right:0; bottom:4px; display:flex; gap:2px; opacity:0; transform:translateY(-2px); transition:opacity var(--t-fast),transform var(--t-fast); }
.chat-message:hover .chat-message-actions,.chat-message:focus-within .chat-message-actions { opacity:1; transform:none; }
.chat-message-actions button { gap:5px; min-height:28px; padding:0 8px; border-radius:7px; font-size:10px; }
.chat-message.is-editing .chat-message-actions { display:none; }
.chat-inline-editor { display:grid; gap:10px; }
.chat-inline-editor textarea { display:block; width:100%; min-height:96px; max-height:300px; resize:vertical; border:0; outline:0; padding:0; color:var(--ink); background:transparent; font:inherit; line-height:1.7; }
.chat-inline-editor-actions { display:flex; justify-content:flex-end; gap:8px; }
.chat-inline-editor-actions button { min-height:34px; padding:0 14px; border:0; border-radius:999px; cursor:pointer; font-size:11px; }
.chat-inline-edit-cancel { color:var(--ink); background:var(--surface); box-shadow:inset 0 0 0 1px var(--line); }
.chat-inline-edit-submit { color:#fff; background:var(--ink); }
.chat-inline-edit-submit:disabled { opacity:.45; cursor:wait; }
.chat-inline-edit-error { color:var(--danger); font-size:10px; text-align:right; }
.chat-message-user .chat-bubble { padding:12px 15px; border-radius:15px 15px 4px 15px; background:var(--surface); }
.agent-thinking { display:flex; align-items:center; gap:5px; color:var(--muted); }
.agent-thinking i { width:6px; height:6px; border-radius:50%; background:var(--primary); animation:agent-dot 1.1s infinite ease-in-out; }
.agent-thinking i:nth-child(2) { animation-delay:.15s; }.agent-thinking i:nth-child(3){animation-delay:.3s}.agent-thinking span{margin-left:7px;font-size:12px}
@keyframes agent-dot { 0%,60%,100%{opacity:.25;transform:translateY(0)} 30%{opacity:1;transform:translateY(-4px)} }
.agent-image-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:18px; }
.agent-image-grid figure { margin:0; overflow:hidden; border:1px solid var(--line); border-radius:15px; background:var(--surface); }
.agent-image-grid img { width:100%; aspect-ratio:2/3; object-fit:cover; cursor:zoom-in; }
.agent-image-grid figcaption { padding:9px 11px; color:var(--muted); font-size:11px; }
.agent-attachment-grid { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:10px; }
.agent-attachment-grid figure { width:min(180px,45vw); margin:0; overflow:hidden; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.agent-attachment-grid img { display:block; width:100%; aspect-ratio:1; object-fit:cover; cursor:zoom-in; }
.agent-attachment-grid figcaption { padding:6px 8px; overflow:hidden; color:var(--faint); text-overflow:ellipsis; white-space:nowrap; font-size:9px; }
.agent-sources { display:flex; flex-wrap:wrap; gap:6px; margin-top:14px; padding-top:12px; border-top:1px solid var(--line); }
.agent-sources b { width:100%; color:var(--faint); font-size:10px; }
.agent-sources a { max-width:100%; padding:4px 8px; overflow:hidden; border-radius:6px; background:var(--surface); text-overflow:ellipsis; white-space:nowrap; font-size:10px; }
.agent-composer { position:relative; box-sizing:border-box; width:min(820px,calc(100% - 48px)); min-height:50px; margin:0 auto 18px; overflow:visible; border:1px solid var(--line); border-radius:26px; background:var(--bg); box-shadow:0 2px 12px oklch(.25 .02 353 / .07); transition:border-color var(--t-fast),box-shadow var(--t-fast); }
.agent-composer:focus-within { border-color:color-mix(in oklab,var(--ink) 32%,var(--line)); box-shadow:0 3px 16px oklch(.25 .02 353 / .09); }
.agent-composer textarea { display:block; box-sizing:border-box; width:100%; min-width:0; min-height:48px; max-height:160px; margin:0; padding:12px 56px 12px 52px; overflow-x:hidden; resize:none; border:0; outline:0; color:var(--ink); background:transparent; font:inherit; line-height:24px; overflow-wrap:anywhere; white-space:pre-wrap; }
.agent-composer textarea::placeholder { color:var(--faint); opacity:1; }
.agent-composer-actions { position:absolute; inset:0; display:flex; box-sizing:border-box; align-items:center; min-height:48px; padding:7px 8px; pointer-events:none; }
.agent-composer-actions > * { pointer-events:auto; }
.agent-composer.is-expanded textarea { padding:16px 18px 4px; }
.agent-composer.is-expanded .agent-composer-actions { position:static; min-height:52px; padding:6px 10px 10px; }
.agent-send-button { display:inline-grid; place-items:center; flex:0 0 34px; width:34px; height:34px; padding:0; border:0; border-radius:50%; color:white; background:var(--ink); cursor:pointer; }
.agent-send-button { margin-left:auto; }
.agent-send-button svg { width:15px; height:15px; }
.agent-send-button:hover { background:var(--primary-deep); }
.agent-send-button.is-stop { background:var(--danger); }
.agent-send-button.is-stop:hover { background:color-mix(in oklab,var(--danger) 82%,black); }
.agent-stop-icon { display:block; width:10px; height:10px; border-radius:2px; background:currentColor; }
.agent-composer.is-processing textarea { color:var(--faint); }
.agent-composer.is-processing .agent-upload-button { opacity:.42; cursor:not-allowed; }
.agent-composer button:disabled { opacity:.45; }
.agent-upload-button { position:relative; display:inline-grid; place-items:center; flex:0 0 34px; width:34px; height:34px; border:0; border-radius:50%; color:var(--ink); background:transparent; cursor:pointer; line-height:1; }
.agent-upload-button svg { width:17px; height:17px; }
.agent-upload-button:hover { background:var(--surface); }
.agent-upload-button:has(input:focus-visible) { outline:3px solid var(--primary-ring); outline-offset:2px; border-color:var(--primary); }
.agent-upload-button em { position:absolute; right:-5px; top:-6px; display:none; min-width:17px; height:17px; padding:0 4px; border:2px solid var(--surface); border-radius:999px; color:white; background:var(--primary); font-style:normal; font-size:9px; line-height:13px; text-align:center; }
.agent-upload-button em:not(:empty) { display:block; }
.agent-upload-button input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.agent-upload-help { position:absolute; left:18px; bottom:calc(100% + 6px); display:none; max-width:calc(100% - 36px); padding:7px 10px; border:1px solid var(--line); border-radius:8px; color:var(--faint); background:var(--bg); box-shadow:var(--shadow-pop); font-size:10px; }
.agent-upload-help:not(:empty) { display:block; }
.agent-upload-help.is-error { color:var(--danger); }
.agent-upload-preview { display:flex; gap:8px; padding:12px 14px 0; overflow-x:auto; scrollbar-width:thin; }
.agent-upload-preview[hidden] { display:none; }
.agent-upload-preview > div { position:relative; flex:0 0 78px; height:78px; }
.agent-upload-preview img { width:100%; height:100%; object-fit:cover; border:1px solid var(--line); border-radius:10px; }
.agent-upload-preview button { position:absolute; right:4px; bottom:4px; min-width:44px; min-height:32px; padding:5px 8px; border:0; border-radius:6px; color:white; background:oklch(.25 .02 353/.84); cursor:pointer; font-size:10px; }
@media(max-width:900px){.agent-card-grid{grid-template-columns:1fr}.agent-workspace{grid-template-columns:1fr;height:calc(100dvh - 56px)}.agent-history{position:fixed; z-index:var(--z-menu); top:56px; bottom:0; left:0; display:block; width:min(340px,88vw); transform:translateX(-102%); transition:transform var(--t-slow); box-shadow:var(--shadow-pop)}body.agent-history-open .agent-history{transform:translateX(0)}body.agent-history-open .agent-history-scrim{display:block}.agent-history-delete{display:block}.content:has(.agent-workspace){height:calc(100dvh - 56px)}.agent-chat-shell{height:calc(100dvh - 56px)}.agent-chat-head{grid-template-columns:82px 1fr auto;padding:8px 12px}.agent-identity p{display:none}.agent-history-toggle{display:inline-flex}.agent-thread{padding:18px 16px 180px}.chat-message{grid-template-columns:1fr;gap:6px}.chat-role{padding:0}.agent-image-grid{grid-template-columns:1fr}.agent-composer{width:calc(100% - 24px);margin-bottom:max(10px,env(safe-area-inset-bottom));border-radius:24px}.agent-composer textarea{padding:14px 15px 3px}}
@media(hover:none){.chat-message-actions{opacity:1;transform:none}}
@media(max-width:620px){.agent-card{grid-template-columns:52px 1fr;padding:18px}.agent-card-mark{width:52px;height:52px}.agent-card>form{grid-column:1/-1}.agent-recents{grid-column:1/-1}}
@media(max-width:620px){.agent-back{font-size:0}.agent-back::after{content:"返回";font-size:12px}.agent-identity .agent-avatar{display:none}.agent-head-actions form{display:none}}
@media(max-width:760px){.agent-hub-head,.agent-history-page-head{align-items:flex-start}.agent-history-toolbar{grid-template-columns:1fr}.agent-history-filters{overflow-x:auto;scrollbar-width:none}.agent-history-filters a{min-height:44px}.agent-history-row-open{min-width:44px;min-height:44px;padding:0}.agent-history-row-open span{display:none}.agent-history-row form{padding-right:4px}.agent-history-row .btn{min-width:52px;min-height:44px}.agent-history-row-copy small{white-space:nowrap;overflow:hidden}.agent-history-agent-name{display:none}.agent-history-page-head .btn,.agent-hub-head .btn{min-height:44px}}

/* IP library: quiet directory first, assets only after selection. */
.ip-index-layout { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:24px; align-items:start; }
.ip-index-layout-single { grid-template-columns:minmax(0,760px); }
.ip-index-panel { overflow:hidden; }
.ip-index-item { display:flex; align-items:center; min-height:58px; padding:0 20px; border-bottom:1px solid var(--line); color:var(--text); font-size:var(--fs-15); font-weight:650; transition:background .16s ease; }
.ip-index-item:last-child { border-bottom:0; }
.ip-index-item:hover { background:var(--surface); }
.ip-index-arrow { margin-left:auto; color:var(--faint); font-size:24px; font-weight:400; }
.ip-index-empty { border:0; }
.ip-create-note { margin:-4px 0 20px; font-size:var(--fs-13); }
.ip-detail-back { display:inline-flex; margin-bottom:10px; color:var(--muted); font-size:var(--fs-13); }
.ip-detail-back:hover { color:var(--primary); }
.ip-detail-layout { max-width:980px; }
.ip-detail-summary { display:flex; gap:8px; color:var(--faint); font-size:var(--fs-12); }
.ip-detail-summary span + span::before { content:"·"; margin-right:8px; }
.ip-assets { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:12px; margin-top:12px; }
.ip-asset { overflow:hidden; border:1px solid var(--line); border-radius:10px; background:var(--surface); }
.ip-asset img { display:block; width:100%; height:126px; object-fit:cover; }
.ip-asset form { display:grid; gap:7px; padding:10px; }
.ip-asset .input,.ip-asset .select { height:34px; font-size:var(--fs-12); }
.role-row { padding:9px 0; border-top:1px solid var(--line); }
.ip-edit-form { display:grid; grid-template-columns:180px minmax(220px,1fr) auto; gap:8px; margin-top:10px; }
.ip-upload-form { display:grid; grid-template-columns:minmax(200px,1fr) 180px auto; gap:8px; align-items:end; }
@media(max-width:900px){.ip-index-layout{grid-template-columns:1fr}.ip-create-panel{order:-1}}
@media(max-width:620px){.ip-edit-form,.ip-upload-form{grid-template-columns:1fr}.ip-edit-form .btn,.ip-upload-form .btn{width:100%}}
.agent-generation-copy{display:grid;gap:3px;color:var(--muted);font-size:12px}.agent-generation-copy small{color:var(--faint);font-size:10px}.agent-generation-stage{position:relative;width:min(420px,100%);aspect-ratio:1;margin-top:14px;overflow:hidden;border-radius:22px;background:linear-gradient(135deg,#f8f7f5,#eeece9)}.agent-generation-stage:before{content:"";position:absolute;inset:18%;border-radius:50%;background:radial-gradient(circle,#9d9992 0 1.5px,transparent 2px);background-size:18px 18px;mask-image:radial-gradient(circle,#000,transparent 68%);animation:generation-breathe 2.4s ease-in-out infinite}.agent-generation-stage i{position:absolute;left:50%;top:50%;width:6px;height:6px;border-radius:50%;background:#aaa49c;animation:generation-orbit 2.8s ease-in-out infinite}.agent-generation-stage i:nth-child(2){animation-delay:-.7s}.agent-generation-stage i:nth-child(3){animation-delay:-1.4s}.agent-generation-stage i:nth-child(4){animation-delay:-2.1s}@keyframes generation-breathe{50%{transform:scale(.72);opacity:.45}}@keyframes generation-orbit{0%,100%{transform:translate(-120px,-20px);opacity:0}50%{transform:translate(90px,25px);opacity:.75}}
.agent-gallery{display:grid;grid-template-columns:minmax(0,420px) 54px;gap:10px;align-items:start;margin-top:16px}.agent-gallery-main{position:relative;display:grid;place-items:center;min-height:280px;max-height:min(68vh,720px);overflow:hidden;border-radius:22px;background:#efeeec}.agent-gallery-main img{display:block;width:auto;max-width:100%;height:auto;max-height:min(68vh,720px);object-fit:contain;cursor:zoom-in}.agent-gallery-main a{position:absolute;right:10px;bottom:10px;padding:7px 10px;border-radius:999px;color:#fff;background:rgb(25 24 23/.72);backdrop-filter:blur(8px);font-size:10px;text-decoration:none}.agent-gallery-rail{display:grid;gap:8px;max-height:min(68vh,720px);overflow-y:auto}.agent-gallery-rail button{width:50px;height:50px;padding:0;overflow:hidden;border:2px solid transparent;border-radius:10px;background:#f5f4f2;cursor:pointer}.agent-gallery-rail button.is-active{border-color:var(--ink)}.agent-gallery-rail img{width:100%;height:100%;object-fit:contain;background:#f5f4f2}@media(max-width:900px){.agent-gallery{grid-template-columns:minmax(0,1fr) 46px}.agent-gallery-rail button{width:42px;height:42px}}
.agent-gallery-downloads{position:absolute;right:10px;bottom:10px;display:flex;gap:7px}.agent-gallery-main .agent-gallery-downloads a{position:static}.agent-gallery-downloads a:last-child{background:rgb(255 255 255/.88);color:#252220}

/* Agent chat: one calm, ChatGPT-style navigation column. */
body:has(.agent-workspace) .shell > .sidebar { display:none; }
body:has(.agent-workspace) .shell { grid-template-columns:minmax(0,1fr); }
body:has(.agent-workspace) .shell > .content { max-width:none; margin:0; }
.agent-workspace { grid-template-columns:248px minmax(0,1fr); }
.agent-history { padding:14px 10px; }
.agent-history-head { margin-top:12px; }
.agent-history-list a { padding:8px 9px; }

/* Give generated-image thumbnails enough visual weight to scan. */
.agent-gallery { grid-template-columns:minmax(0,560px) 98px; gap:14px; }
.agent-gallery-rail { gap:10px; width:98px; padding-right:4px; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:none; }
.agent-gallery-rail::-webkit-scrollbar { display:none; }
.agent-gallery-rail button { box-sizing:border-box; width:90px; height:90px; border-radius:14px; }
@media(max-width:900px){
  .agent-workspace { grid-template-columns:minmax(0,1fr); }
  .agent-gallery { grid-template-columns:minmax(0,1fr) 72px; gap:8px; }
  .agent-gallery-rail { width:72px; }
  .agent-gallery-rail button { width:66px; height:66px; }
}

/* Classic UI legibility and interaction targets. */
body { overflow-x:hidden; }
.menu-btn,
.lightbox-close { min-width:44px; min-height:44px; align-items:center; justify-content:center; }
.agent-kicker,
.agent-capabilities span,
.agent-history-row-copy small,
.agent-history-row-open,
.agent-history-head a,
.agent-history-list small,
.agent-identity p,
.chat-role,
.requirement-set-head,
.requirement-set-head button,
.requirement-tools button,
.handoff-dialog-note,
.agent-handoff-banner,
.agent-quick-replies button,
.chat-inline-editor-actions button,
.agent-image-grid figcaption,
.agent-attachment-grid figcaption,
.agent-sources b,
.agent-sources a,
.agent-upload-help,
.agent-generation-copy small,
.agent-gallery-main a { font-size:var(--fs-12); }
.requirement-head-actions [data-selection-import],
.agent-quick-replies button,
.chat-inline-editor-actions button,
.handoff-dialog-actions button { min-height:40px; }
.chat-message-actions button { min-width:40px; min-height:36px; padding:0 10px; font-size:var(--fs-12); }
.agent-send-button,
.agent-upload-button { flex-basis:40px; width:40px; height:40px; }
.agent-composer-actions { padding:4px 6px; }
.agent-upload-button em { font-size:var(--fs-12); }
.agent-gallery-downloads a { min-height:40px; display:inline-flex; align-items:center; }
.ip-asset .input,
.ip-asset .select { min-height:40px; }
@media(max-width:900px) {
  .chat-message-actions button,
  .agent-quick-replies button,
  .handoff-dialog-actions button { min-height:44px; }
  .agent-chat-head { grid-template-columns:64px minmax(0,1fr) auto; }
}
