/* AI CS · 创作工作台 — original, dependency-free workspace styling. */
:root {
  --bg: #f2eee5;
  --bg-deep: #ece6da;
  --paper: #fbf8f1;
  --paper-2: #f6f1e6;
  --ink: #1c1b17;
  --ink-2: #3b3830;
  --muted: #6f685b;
  --faint: #7d7466;
  --line: #ddd4c5;
  --line-strong: #c8bca8;
  --pine: #2c5b4c;
  --pine-deep: #234a3e;
  --pine-soft: #e4ece5;
  --amber: #a6651b;
  --amber-soft: #f7ecd9;
  --danger: #9a3a2d;
  --danger-soft: #f7e4df;
  --radius: 6px;
  --radius-sm: 4px;
  --sans: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --serif: "Iowan Old Style", "Songti SC", "Source Serif 4", Georgia, serif;
  --mono: "Cascadia Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html,
body,
.root {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: #cfdccf;
}

:focus-visible {
  outline: 2px solid rgba(44, 91, 76, 0.42);
  outline-offset: 1px;
}

/* scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: #c3b7a3 transparent;
}
*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
*::-webkit-scrollbar-thumb {
  background: #cfc4b1;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.boot,
.fatal {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.fatal-card {
  width: min(440px, 88vw);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.fatal-card h1 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
}

/* ---------- brand ---------- */
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.brand-mark {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}
.brand-name {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--pine);
  font-weight: 600;
}
.brand-sub {
  margin-left: 9px;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--muted);
}
.brand-lg .brand-mark,
.brand-lg .brand-name {
  font-size: 26px;
}

/* ---------- shell ---------- */
.shell {
  height: 100%;
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  background: var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 248, 241, 0.9);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 5;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.crumb-sep {
  color: var(--line-strong);
}
.crumb {
  color: var(--ink-2);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

.health {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper-2);
}
.health::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--faint);
  vertical-align: 1px;
}
.health.is-ok {
  color: var(--pine);
  border-color: #c6d4c6;
  background: var(--pine-soft);
}
.health.is-ok::before {
  background: var(--pine);
}
.health.is-warn {
  color: var(--amber);
  border-color: #e2ccab;
  background: var(--amber-soft);
}
.health.is-warn::before {
  background: var(--amber);
}

.user-chip {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: #f4efe4;
  font-family: var(--serif);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}
.user-name {
  font-size: 12px;
  color: var(--ink-2);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-body {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr) 342px;
  min-height: 0;
}

.rail {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #f8f4eb 0%, #f2ece0 100%);
  padding: 18px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  min-height: 0;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--faint);
  padding: 0 10px 7px;
  text-transform: uppercase;
}
.nav-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink-2);
  border: 1px solid transparent;
}
.nav-item:hover {
  background: rgba(255, 253, 248, 0.7);
  border-color: var(--line);
}
.nav-item.is-active {
  background: var(--paper);
  border-color: var(--line-strong);
  box-shadow: inset 2px 0 0 var(--pine);
}
.nav-label {
  font-size: 12.5px;
}
.nav-hint {
  font-size: 10px;
  color: var(--faint);
  text-align: right;
}
.nav-current .nav-hint {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 12px 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.6;
}

.main {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 24px 44px;
}

.inspector {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: #faf6ed;
  padding: 16px 14px 30px;
}

.inspector-empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.shell-studio .main {
  padding: 0;
  overflow: hidden;
}

/* ---------- page primitives ---------- */
.page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1180px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.page-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.page-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  max-width: 72ch;
  line-height: 1.65;
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.back {
  display: inline-block;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.back:hover {
  color: var(--pine);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 11px;
}
.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: -0.01em;
}
.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: #fffdf8;
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn:hover:not(:disabled) {
  background: #f4eee2;
  border-color: #b6a992;
}
.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--pine);
  border-color: var(--pine);
  color: #f8f4ea;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) {
  background: var(--pine-deep);
  border-color: var(--pine-deep);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
}
.btn-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-quiet:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.04);
  border-color: transparent;
  color: var(--ink);
}
.btn-danger {
  background: var(--danger-soft);
  border-color: #d8b2a8;
  color: var(--danger);
}
.btn-link {
  border: 0;
  background: none;
  padding: 0;
  height: auto;
  color: var(--pine);
}
.btn-sm {
  height: 25px;
  padding: 0 9px;
  font-size: 11px;
}
.btn-block {
  width: 100%;
}

.mini-link {
  font-size: 11px;
  color: var(--pine);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.mini-link:hover {
  border-bottom-color: currentColor;
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 22px;
  height: 22px;
  border-radius: 3px;
  font-size: 16px;
  line-height: 1;
}
.icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink);
}

/* ---------- badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--muted);
  white-space: nowrap;
}
.badge-ink {
  background: #efeadf;
  border-color: #cfc4b1;
  color: var(--ink-2);
}
.badge-pine {
  background: var(--pine-soft);
  border-color: #c5d4c7;
  color: var(--pine);
}
.badge-ok {
  background: var(--pine-soft);
  border-color: #c5d4c7;
  color: var(--pine);
}
.badge-warn {
  background: var(--amber-soft);
  border-color: #e4cfae;
  color: var(--amber);
}
.badge-danger {
  background: var(--danger-soft);
  border-color: #dbb8ae;
  color: var(--danger);
}
.badge-busy {
  background: #eef1ec;
  border-color: #c9d2c7;
  color: var(--pine);
}
.badge-muted {
  background: #f1ece2;
  color: var(--muted);
}

/* ---------- fields ---------- */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: start;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.field-label {
  font-size: 10.5px;
  letter-spacing: 0.09em;
  color: var(--muted);
}
.field-hint {
  font-size: 10.5px;
  color: var(--faint);
  line-height: 1.5;
}
.input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fffdf8;
  font-size: 12.5px;
  color: var(--ink);
}
.input:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 2px rgba(44, 91, 76, 0.14);
}
.input:disabled {
  background: #f2ede3;
  color: #8d8474;
  cursor: not-allowed;
}
.textarea {
  height: auto;
  padding: 8px 9px;
  line-height: 1.65;
  resize: vertical;
}
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 26px;
}
.select-sm {
  height: 24px;
  font-size: 11px;
  padding: 0 20px 0 6px;
  background-position: calc(100% - 11px) 11px, calc(100% - 7px) 11px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ink-2);
}
.check input {
  accent-color: var(--pine);
  width: 14px;
  height: 14px;
}
.readonly-value {
  height: 32px;
  display: flex;
  align-items: center;
  padding: 0 9px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 12px;
}

/* ---------- panels ---------- */
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}
.panel-title {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.panel-sub {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.5;
}
.panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.panel-body {
  padding: 13px;
}
.panel-body-flush {
  padding: 0;
}

.rule-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.65;
}
.rule-list li {
  padding-left: 12px;
  position: relative;
}
.rule-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.66em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line-strong);
}

.kv {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line);
}
.kv > div {
  display: grid;
  grid-template-columns: minmax(84px, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.kv dt {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.kv dd {
  margin: 0;
  font-size: 11.5px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* ---------- alerts / empty / loading ---------- */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.6;
}
.alert-text {
  flex: 1;
  overflow-wrap: anywhere;
}
.alert-danger {
  background: var(--danger-soft);
  border-color: #ddbbb1;
  color: var(--danger);
}
.alert-ok {
  background: var(--pine-soft);
  border-color: #c7d6c9;
  color: var(--pine);
}
.alert-warn {
  background: var(--amber-soft);
  border-color: #e3cfae;
  color: var(--amber);
}

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 26px 20px;
  text-align: center;
  background: rgba(251, 248, 241, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.empty-title {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
}
.empty-body {
  font-size: 11.5px;
  color: var(--muted);
  max-width: 46ch;
  line-height: 1.7;
}

.loading {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  padding: 22px 4px;
}
.spinner {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  border-top-color: var(--pine);
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.notice-inline {
  background: var(--amber-soft);
  border: 1px solid #e4cfae;
  border-left: 3px solid var(--amber);
  color: #6d4a1c;
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 11.5px;
  line-height: 1.6;
}

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--line);
}
.tab {
  border: 0;
  background: transparent;
  padding: 7px 10px 8px;
  font-size: 11.5px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab:hover {
  color: var(--ink);
}
.tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--pine);
  font-weight: 600;
}
.tab-count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 5px;
  line-height: 15px;
}

/* ---------- tables ---------- */
.table-wrap {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.table th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--faint);
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  white-space: nowrap;
}
.table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table tr:hover td {
  background: rgba(246, 241, 230, 0.55);
}
.align-right {
  text-align: right;
}
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.cell-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.cell-strong {
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 46ch;
}
.cell-strong:hover {
  color: var(--pine);
}

/* ---------- template library ---------- */
.create-bar {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 13px;
}
.create-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.create-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.members-create {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) 130px auto;
  align-items: flex-end;
  gap: 10px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 12px;
}

.tcard {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 168px;
  position: relative;
}
.tcard::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 1px;
  background: var(--line-strong);
}
.tcard:hover {
  border-color: var(--line-strong);
}
.tcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-right: 30px;
}
.tcard-kind {
  display: flex;
}
.tcard-version {
  font-size: 10px;
  color: var(--faint);
  letter-spacing: 0.06em;
}
.tcard-title {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.25;
}
.tcard-meta,
.tcard-time {
  font-size: 11px;
  color: var(--muted);
}
.tcard-time {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
}
.tcard-actions {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  gap: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 14px;
  align-items: start;
}
.tag-immutable {
  margin-left: 8px;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--amber);
  border: 1px solid #e2ccab;
  background: var(--amber-soft);
  border-radius: 3px;
  padding: 1px 5px;
  vertical-align: 1px;
}

/* ---------- studio ---------- */
.studio {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.studio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  flex-wrap: wrap;
}
.studio-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
}
.studio-title h1 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}
.studio-title .back {
  margin: 0;
}
.studio-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.studio-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.conversation {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background-image: linear-gradient(rgba(28, 27, 23, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 27, 23, 0.022) 1px, transparent 1px);
  background-size: 72px 72px;
}
.messages .empty {
  margin: auto;
  max-width: 420px;
}
.msg {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}
.msg-user {
  background: #edf2ec;
  border-color: #cfdbd0;
  border-left-color: var(--pine);
}
.msg-assistant {
  background: #fffdf8;
}
.msg-tool {
  background: #f4efe4;
  border-style: dashed;
  border-left-color: var(--amber);
}
.msg-system {
  background: #f1ece2;
  border-left-color: var(--faint);
}
.msg-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
}
.msg-role {
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.msg-time {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--faint);
}
.msg-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12.5px;
  line-height: 1.72;
  color: var(--ink-2);
}
.msg-user .msg-body {
  color: var(--ink);
}
.msg-assets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.msg-asset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: 3px;
  padding: 2px 7px;
  font-size: 10.5px;
  color: var(--ink-2);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-asset:hover {
  border-color: var(--line-strong);
}

.msg-run {
  padding: 2px 0;
}
.exec-log {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(251, 248, 241, 0.72);
  padding: 7px 10px;
}
.exec-head {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
  margin-bottom: 3px;
}
.exec-line {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  line-height: 1.7;
}
.failure-stack {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.job-fail {
  background: var(--paper);
  border: 1px solid #ddbbb1;
  border-radius: var(--radius-sm);
  padding: 8px;
}
.job-fail .alert {
  background: transparent;
  border: 0;
  padding: 0;
}
.config-hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.65;
}
.config-hint a {
  color: var(--danger);
  margin-left: 6px;
  font-weight: 600;
}

.job-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  padding: 6px 9px;
  font-size: 11px;
}
.job-strip.job-running,
.job-strip.job-queued {
  border-color: #c8d5c9;
  background: #edf2ec;
}
.job-strip.job-failed {
  border-color: #ddbbb1;
  background: var(--danger-soft);
}
.job-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}
.job-running .job-dot {
  background: var(--pine);
  animation: pulse 1.4s ease-in-out infinite;
}
.job-failed .job-dot {
  background: var(--danger);
}
@keyframes pulse {
  50% {
    opacity: 0.28;
  }
}
.job-label {
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.04em;
}
.job-event {
  color: var(--muted);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job-strip .btn {
  margin-left: auto;
}

.composer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 9px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.attachments {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.attach {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: 3px;
  padding: 3px 5px 3px 7px;
  max-width: 100%;
}
.attach-label {
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--pine);
  font-weight: 600;
  background: var(--pine-soft);
  border-radius: 2px;
  padding: 1px 4px;
  white-space: nowrap;
}
.attach-name {
  font-size: 10.5px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-size {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--faint);
}
.upload-state {
  font-size: 10.5px;
  color: var(--amber);
}
.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.composer-row .btn {
  height: 34px;
  flex: 0 0 auto;
}
.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  background: #fffdf8;
  height: 34px;
  flex: 0 0 auto;
}
.upload-btn:hover {
  border-color: var(--pine);
  color: var(--pine);
}
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.composer-input {
  flex: 1;
  min-width: 0;
  min-height: 54px;
  resize: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fffdf8;
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.65;
}
.composer-input:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 2px rgba(44, 91, 76, 0.13);
}
.composer-input:disabled {
  background: #f2ede3;
}
.composer-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 9.5px;
  color: var(--faint);
  line-height: 1.5;
}

.stage {
  flex: 0 0 auto;
  max-height: 40%;
  min-height: 0;
  background: #f6f1e7;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.stage.is-closed {
  max-height: none;
}
.stage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  flex: 0 0 auto;
}
.stage-head h2 {
  font-size: 12.5px;
  font-weight: 600;
}
.stage-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
}
.stage-toggle:hover {
  color: var(--pine);
}
.stage-caret {
  font-size: 10px;
  color: var(--muted);
  width: 9px;
}
.ref-bar {
  border-bottom: 1px solid var(--line);
  background: #f9f4e9;
  padding: 7px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
}
.ref-bar-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ref-counts {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--pine);
  background: var(--pine-soft);
  border: 1px solid #c7d6c9;
  border-radius: 3px;
  padding: 2px 7px;
  white-space: nowrap;
}
.ref-bar .check {
  font-size: 11px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.ref-error {
  color: var(--danger);
  font-size: 10.5px;
  line-height: 1.5;
}
.ref-hint {
  font-size: 10.5px;
  line-height: 1.5;
}
.ref-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 7px;
  padding: 6px 0 2px;
  max-height: 188px;
  overflow-y: auto;
}
.ref-tile {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  overflow: hidden;
}
.ref-tile.is-ref {
  border-color: var(--pine);
  box-shadow: 0 0 0 1px var(--pine) inset;
}
.ref-tile.is-mask {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber) inset;
}
.ref-tile img {
  width: 100%;
  height: 64px;
  object-fit: cover;
  display: block;
  background: #efe9dd;
}
.ref-tile-meta {
  padding: 3px 6px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}
.ref-tile-actions {
  display: flex;
  gap: 8px;
  padding: 2px 6px 5px;
}
.ref-tile-actions .check {
  font-size: 10px;
  gap: 4px;
}
.ref-tile-actions input {
  width: 12px;
  height: 12px;
}
.limit-strip {
  border: 1px solid #e2ccab;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  color: #6d4a1c;
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  font-size: 10.5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.55;
}
.limit-strip strong {
  font-size: 11px;
}
.job-attention-note {
  margin-top: 5px;
  font-size: 10px;
  line-height: 1.6;
  color: var(--amber);
}
.stage-body {
  flex: 1;
  min-height: 290px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(300px, 1.08fr) minmax(260px, 0.98fr) minmax(230px, 0.84fr);
  gap: 10px;
  overflow: auto;
  align-items: start;
}
.stage-col {
  min-width: 0;
  max-height: 100%;
  overflow-y: auto;
}
.stage-panel .panel-body {
  padding: 11px;
}
.stage-note {
  margin-top: 8px;
}
.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.inline-form .field {
  flex: 1;
  min-width: 110px;
}
.inline-form .field:first-child {
  flex: 0 0 92px;
}
.pack-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.sku-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}
.sku-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sku-card.is-selected {
  border-color: var(--pine);
  box-shadow: 0 0 0 1px var(--pine) inset;
}
.sku-media {
  aspect-ratio: 4 / 3;
  background: #efe9dd;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sku-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sku-placeholder {
  font-size: 10px;
  color: var(--faint);
}
.sku-meta {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sku-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
}
.sku-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.pack-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 2px;
}
.pack {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  padding: 8px;
}
.pack-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 11.5px;
}
.pack-head strong {
  margin-right: 6px;
}
.bulk {
  display: flex;
  align-items: center;
  gap: 5px;
}
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 7px;
}
.tile-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  margin: 10px 0;
}
.tile {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  overflow: hidden;
  position: relative;
}
.tile.is-selected {
  border-color: var(--pine);
  box-shadow: 0 0 0 1px var(--pine) inset;
}
.tile-check {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 1;
  background: rgba(251, 248, 241, 0.9);
  border-radius: 3px;
  padding: 1px 3px;
  display: flex;
}
.tile-check input {
  margin: 0;
  accent-color: var(--pine);
}
.tile-preview {
  border: 0;
  padding: 0;
  width: 100%;
  aspect-ratio: 1;
  background: #efe9dd;
  background-image: linear-gradient(45deg, rgba(0, 0, 0, 0.035) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.035) 75%),
    linear-gradient(45deg, rgba(0, 0, 0, 0.035) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.035) 75%);
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
  cursor: zoom-in;
  display: block;
}
.tile-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tile-meta {
  padding: 4px 6px 3px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.tile-name {
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile-sub {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--faint);
}
.tile-actions {
  padding: 0 6px 5px;
}

.asset-list {
  display: flex;
  flex-direction: column;
}
.asset-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.asset-row:last-child {
  border-bottom: 0;
}
.asset-name {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.asset-row .row-actions {
  margin-left: auto;
}

.job-list {
  display: flex;
  flex-direction: column;
}
.job-row {
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
}
.job-row:last-child {
  border-bottom: 0;
}
.job-fact-preflight {
  overflow-wrap: anywhere;
}
.job-row-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.job-row-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
}
.summary {
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-2);
  margin-bottom: 9px;
  overflow-wrap: anywhere;
}

/* ---------- devices ---------- */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 12px;
  align-items: start;
}
.pairing {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0 4px;
  flex-wrap: wrap;
}
.pairing-code {
  font-family: var(--mono);
  font-size: 26px;
  letter-spacing: 0.28em;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 5px 12px 5px 16px;
}
.companion {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.device-list {
  display: flex;
  flex-direction: column;
}
.device {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.device:last-child {
  border-bottom: 0;
}
.device-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.device-head strong {
  font-size: 12.5px;
}
.folder-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.folder-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper-2);
  padding: 6px 8px;
  font-size: 11px;
}
.folder-label {
  font-weight: 600;
}
.folder-list .row-actions {
  margin-left: auto;
}

/* ---------- settings ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
  align-items: start;
}
.settings-foot {
  font-size: 10.5px;
  color: var(--faint);
}
.test-msg {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--muted);
}
.test-msg.tone-ok {
  color: var(--pine);
  border-color: #c7d6c9;
  background: var(--pine-soft);
}
.test-msg.tone-danger {
  color: var(--danger);
  border-color: #ddbbb1;
  background: var(--danger-soft);
}

/* ---------- auth ---------- */
.auth {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  background: var(--bg);
}
.auth-intro {
  background: #1d1c18;
  color: #efe9dd;
  padding: clamp(32px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.auth-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(239, 233, 221, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239, 233, 221, 0.045) 1px, transparent 1px);
  background-size: 84px 84px;
  pointer-events: none;
}
.auth-intro::after {
  content: "AI CS / 01";
  position: absolute;
  right: 26px;
  bottom: 22px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: #6d675b;
}
.auth-intro > * {
  position: relative;
}
.auth-intro .brand-name {
  color: #dfe9dc;
}
.auth-intro .brand-sub {
  color: #8c8576;
}
.auth-title {
  font-family: var(--serif);
  font-size: clamp(27px, 2.7vw, 36px);
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-top: 6px;
  color: #f3eee2;
}
.auth-lede {
  max-width: 46ch;
  font-size: 12.5px;
  line-height: 1.8;
  color: #c6bfb0;
}
.auth-facts {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 8px;
  border-top: 1px solid #38362f;
  padding-top: 15px;
  max-width: 460px;
}
.auth-facts > div {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 12px;
  align-items: baseline;
}
.auth-facts dt {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #8a8374;
}
.auth-facts dd {
  font-size: 12px;
  color: #ddd6c8;
  line-height: 1.65;
}
.auth-foot {
  margin-top: 10px;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: #a39b8a;
}
.auth-card {
  width: 100%;
  max-width: 430px;
  margin: auto;
  padding: clamp(28px, 6vw, 56px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-card-title {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
}
.auth-card-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 6px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.auth-note {
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--faint);
  line-height: 1.65;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* ---------- overlays ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(23, 22, 19, 0.78);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px;
}
.lightbox-body {
  max-width: min(880px, 92vw);
  max-height: 90vh;
  background: var(--paper);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #4a463d;
}
.lightbox-img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  background: #e9e3d7;
  display: block;
}
.lightbox-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  font-size: 11.5px;
  border-top: 1px solid var(--line);
}
.lightbox-actions {
  display: flex;
  gap: 8px;
}
.lightbox-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.2);
  color: #f2ede1;
  font-size: 19px;
  line-height: 1;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 50;
  background: #24221d;
  color: #f4efe3;
  border-radius: 5px;
  padding: 8px 10px 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  max-width: min(560px, 90vw);
  box-shadow: 0 8px 26px rgba(28, 27, 23, 0.22);
}
.toast .icon-btn {
  color: #b9b2a4;
}
.toast .icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.toast-danger {
  background: #5d231c;
}
.toast-warn {
  background: #4f3a18;
}

/* ---------- responsive ---------- */
@media (max-width: 1440px) {
  .shell-body {
    grid-template-columns: 220px minmax(0, 1fr) 318px;
  }
  .main {
    padding: 18px 20px 40px;
  }
  .studio-body {
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  }
  .stage-body {
    grid-template-columns: minmax(220px, 1.08fr) minmax(190px, 0.98fr) minmax(168px, 0.84fr);
  }
  .asset-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 1220px) {
  .shell-body {
    grid-template-columns: 200px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .rail {
    grid-row: 1 / span 2;
  }
  .inspector {
    grid-column: 2;
    grid-row: 2;
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: 300px;
  }
  .stage {
    max-height: 56%;
  }
  .stage-body {
    grid-template-columns: minmax(280px, 1fr) minmax(250px, 1fr);
  }
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-intro {
    display: none;
  }
  .shell-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .rail {
    grid-row: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    padding: 8px 10px;
  }
  .nav-title,
  .rail-foot,
  .nav-hint {
    display: none;
  }
  .nav-group {
    flex-direction: row;
  }
  .inspector {
    display: none;
  }
  .stage {
    max-height: 48%;
  }
  .stage-body {
    grid-auto-flow: column;
    grid-auto-columns: 84%;
    grid-template-columns: none;
    overflow-x: auto;
  }
  .members-create,
  .create-fields {
    grid-template-columns: 1fr;
  }
  .studio-title .mono {
    display: none;
  }
}

/* Template asset picker + bundle manifest editor */
.asset-picker {
  display: grid;
  gap: 10px;
}
.asset-picker-counts {
  font-size: 12px;
  color: var(--ink-3, #6b7280);
}
.asset-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 8px;
}
.asset-pick {
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface, #fff);
}
.asset-pick img {
  width: 100%;
  height: 84px;
  object-fit: cover;
  display: block;
}
.asset-pick-meta {
  display: grid;
  gap: 2px;
  padding: 6px 8px 2px;
  font-size: 12px;
}
.asset-pick-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-pick-actions {
  display: flex;
  gap: 10px;
  padding: 4px 8px 8px;
  font-size: 12px;
}
.upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.manifest-editor {
  border: 1px dashed var(--line, #d1d5db);
  border-radius: 10px;
  padding: 10px;
  margin: 10px 0;
  display: grid;
  gap: 8px;
}
.manifest-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.manifest-title {
  margin: 0 0 2px;
  font-size: 14px;
}
.manifest-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.manifest-list {
  display: grid;
  gap: 6px;
}
.manifest-row {
  display: grid;
  grid-template-columns: 1.1fr 1.6fr 72px 1fr auto;
  gap: 6px;
  align-items: end;
}
.manifest-row .field-label {
  font-size: 11px;
}
.manifest-note {
  margin: 0;
}
.msg-local {
  margin-left: auto;
  font-size: 11px;
  color: #92400e;
  background: #fef3c7;
  border-radius: 999px;
  padding: 2px 8px;
}
.pack-manifest {
  margin: 4px 0 0;
}
@media (max-width: 720px) {
  .manifest-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* AI work center + unknown-route page (main shell, distinct from /ops) */
.ai-center-page .ai-state {
  display: grid;
  gap: 10px;
}
.ai-state-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.ai-cap-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 4px 18px;
  color: var(--ink-2);
}
.ai-panel-host-wrap {
  display: grid;
  gap: 8px;
}
.ai-panel-host {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-2);
  padding: 18px;
  min-height: 96px;
}
.ai-panel-host p {
  margin: 0;
}
.not-found-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
