/* 玖贰贰（922）独立工作台 — 严格复用 MAHORA tokens.css / themes.css 语义变量 */

.p922-body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  height: 100dvh;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* Gate screen */
.p922-gate {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.p922-gate-card {
  max-width: 440px;
  width: 100%;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-composer);
  padding: 28px;
}

.p922-gate-card h1 {
  margin: 14px 0 8px;
  font-size: var(--text-xl);
  font-weight: 600;
}

.p922-gate-card p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.p922-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Shell：顶栏（与主站同源 mode-seg）+ 下方三栏 */
.p922-shell {
  /* 922 不在 .app 里，栏头高度与主站 appbar / topbar 对齐 */
  --appbar-h: 48px;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100%;
  background: var(--bg);
}

.p922-appbar {
  flex: 0 0 auto;
  z-index: 20;
}

.p922-appbar .appbar-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.p922-body-row {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

/* Left sidebar — 宽与内边距跟主站 .sidebar 同一套 */
.p922-sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  display: flex;
  flex-direction: column;
  border-right: none;
  box-shadow: inset -1px 0 0 var(--rule-pane);
  background: var(--bg);
  min-width: 0;
}

.p922-sidebar.is-collapsed {
  display: none;
}

.p922-side-head {
  height: var(--appbar-h);
  flex: 0 0 var(--appbar-h);
  padding: 0 var(--space-4);
  box-shadow: inset 0 -1px 0 var(--rule-section);
  display: flex;
  align-items: center;
}

.p922-sidebar > .new-chat-btn {
  width: auto;
  flex-shrink: 0;
  margin: var(--space-4) var(--space-4) 0;
}

.p922-identity {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

.p922-identity-text {
  min-width: 0;
}

.p922-code-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-fg);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.p922-name {
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: var(--leading-tight);
}

.p922-sub {
  font-size: var(--text-2xs);
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p922-conv-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.p922-conv-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-frame);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.p922-conv-item:hover {
  background: var(--hover);
}

.p922-conv-item.is-active {
  background: var(--surface-elevated);
  box-shadow: var(--shadow-elev-1);
}

.p922-conv-item-main {
  min-width: 0;
  flex: 1;
}

.p922-conv-item-title {
  font-size: var(--text-sm);
  font-weight: 450;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: color-mix(in oklch, var(--fg) 88%, var(--muted));
}

.p922-conv-item.is-active .p922-conv-item-title {
  font-weight: 500;
  color: var(--fg);
}

.p922-conv-item-meta {
  font-size: var(--text-2xs);
  color: var(--muted);
}

.p922-conv-item-ops {
  display: flex;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.p922-conv-item:hover .p922-conv-item-ops,
.p922-conv-item.is-active .p922-conv-item-ops {
  opacity: 1;
}

.p922-side-foot {
  padding: var(--space-5) var(--space-4);
  box-shadow: inset 0 1px 0 var(--rule-section);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.p922-isolation-pill {
  font-size: var(--text-2xs);
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-frame);
  padding: 6px 8px;
  text-align: center;
}

.p922-back-link {
  font-size: var(--text-xs);
  color: var(--muted);
  text-decoration: none;
}

.p922-back-link:hover {
  color: var(--fg);
}

/* Center chat column */
.p922-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.p922-topbar {
  height: var(--appbar-h);
  flex: 0 0 var(--appbar-h);
  padding: 0 var(--space-8);
  border-bottom: none;
  box-shadow: inset 0 -1px 0 var(--rule-section);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.p922-topbar-left,
.p922-topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

.p922-topbar .p922-icon-btn {
  width: 36px;
  height: 36px;
  color: var(--muted);
}

.p922-conv-title {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p922-status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--muted);
}

.p922-status-dot.is-ready {
  background: var(--ok);
}

.p922-status-dot.is-warn {
  background: var(--err);
}

/* Message stream — 与主站对话同宽 */
.p922-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5) 0 var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.p922-empty {
  margin: auto;
  max-width: 560px;
  text-align: center;
  padding: var(--space-9) var(--space-6);
}

.p922-empty-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-ctrl);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-5);
}

.p922-empty h2 {
  margin: 0 0 var(--space-4);
  font-size: var(--text-xl);
  font-weight: 600;
}

.p922-empty-sub {
  margin: 0 0 var(--space-6);
  color: var(--muted);
  font-size: var(--text-sm);
}

.p922-starters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
}

.p922-msg {
  max-width: calc(var(--chat-max) + 2 * var(--chat-gutter));
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--chat-gutter);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.p922-msg-user {
  align-items: flex-end;
}

.p922-msg-assistant {
  align-items: flex-start;
}

.p922-bubble {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-composer);
  max-width: 100%;
  word-break: break-word;
  font-size: var(--text-md);
  line-height: var(--leading-prose);
  color: var(--fg);
  background-image: var(--glass-shine);
  backdrop-filter: blur(calc(var(--glass-blur) - 6px)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) - 6px)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
}

.p922-msg-user .p922-bubble {
  background-color: color-mix(in oklch, var(--bubble-user) 28%, var(--glass-fill-strong));
  white-space: pre-wrap;
  max-width: 85%;
  box-shadow:
    0 1px 1px color-mix(in oklch, var(--fg) 3%, transparent),
    0 10px 32px -14px color-mix(in oklch, var(--fg) 12%, transparent);
}

.p922-msg-assistant .p922-bubble {
  background-color: color-mix(in oklch, var(--bubble-assistant) 45%, var(--glass-fill-strong));
  width: 100%;
  box-shadow: var(--glass-shadow);
}

.p922-bubble p { margin: 0 0 1em; }
.p922-bubble p:last-child { margin-bottom: 0; }
.p922-bubble h1,
.p922-bubble h2,
.p922-bubble h3 {
  font-size: var(--text-md);
  font-weight: 600;
  line-height: var(--leading-tight);
  margin: var(--space-6) 0 var(--space-3);
}
.p922-bubble h1:first-child,
.p922-bubble h2:first-child,
.p922-bubble h3:first-child { margin-top: 0; }
.p922-bubble ul,
.p922-bubble ol {
  margin: 0 0 var(--space-4);
  padding-left: 1.25em;
}
.p922-bubble li + li { margin-top: var(--space-2); }
.p922-bubble pre {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-frame);
  padding: var(--space-4) var(--space-5);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.p922-bubble code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.p922-bubble img {
  display: block;
  max-width: min(360px, 100%);
  max-height: 480px;
  width: auto;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin: 8px 0;
  cursor: zoom-in;
  object-fit: contain;
}

.p922-tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.p922-tool-chip {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

.p922-msg-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.p922-msg-gate {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 780px;
  padding: 10px 12px;
  border-radius: var(--radius-ctrl);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, var(--fg) 12%);
  font-size: var(--text-xs);
}

.p922-msg-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

/* 输入区走主站 .composer / .composer-dock；这里只收状态行 */
.p922-main > .composer {
  flex: 0 0 auto;
}

.p922-main .status-inline {
  max-width: calc(var(--chat-max) + 2 * var(--chat-gutter));
}

/* Right drawer — 宽跟主站 --artifact-w，栏头与左/中同一条分割线 */
.p922-drawer {
  width: var(--artifact-w);
  flex: 0 0 var(--artifact-w);
  border-left: none;
  box-shadow: inset 1px 0 0 var(--rule-pane);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.p922-drawer.is-collapsed {
  display: none;
}

.p922-drawer-head {
  height: var(--appbar-h);
  flex: 0 0 var(--appbar-h);
  display: flex;
  align-items: center;
  padding: 0 var(--space-5);
  box-shadow: inset 0 -1px 0 var(--rule-section);
}

.p922-drawer-tabs {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: var(--space-1);
  border-radius: var(--radius-ctrl);
  background: color-mix(in oklch, var(--fg) 4%, var(--bg));
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-1);
}

.p922-tab {
  flex: 1 1 0;
  min-width: 0;
  border: none;
  border-radius: calc(var(--radius-ctrl) - 2px);
  background: transparent;
  color: var(--fg-nav);
  font-size: var(--text-xs);
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
}

.p922-tab:hover {
  color: var(--fg);
}

.p922-tab.is-on {
  background: var(--surface-elevated);
  color: var(--fg);
  font-weight: 550;
  box-shadow: 0 1px 2px color-mix(in oklch, var(--fg) 8%, transparent);
}

.p922-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5) var(--space-5) var(--space-6);
}

.p922-pane {
  display: none;
  flex-direction: column;
  gap: var(--space-5);
}

.p922-pane.is-on {
  display: flex;
}

.p922-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--action-h);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
}

.p922-block-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
}

.p922-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.p922-card-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--fg);
}

.p922-card-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.p922-muted-box {
  padding: var(--space-5);
  border-radius: var(--radius-ctrl);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--muted);
  text-align: center;
}

/* Memory meter */
.p922-mem-meter {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.p922-mem-meter-top {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--muted);
}

.p922-bar {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  overflow: hidden;
}

.p922-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.p922-mono {
  font-family: var(--font-mono);
}

.p922-pre {
  margin: var(--space-4) 0 0;
  padding: var(--space-4);
  border-radius: var(--radius-frame);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow-y: auto;
}

.p922-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
  padding: var(--space-4);
  background: var(--surface);
  font-size: var(--text-xs);
}

.p922-details summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
}

/* Pending memory item & skills */
.p922-pending-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-xs);
}

.p922-pending-readable {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.p922-pending-op {
  padding: var(--space-4);
  border-radius: var(--radius-frame);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.p922-pending-op-title {
  font-size: var(--text-2xs);
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.p922-pending-op-body {
  font-size: var(--text-xs);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.p922-pending-diff + .p922-pending-diff {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.p922-pending-diff-lab {
  font-size: var(--text-2xs);
  color: var(--muted);
  margin-bottom: 4px;
}

.p922-pending-diff-old {
  opacity: 0.78;
}

.p922-pending-raw {
  margin-top: var(--space-3);
  font-size: var(--text-2xs);
  color: var(--muted);
}

.p922-pending-raw summary {
  cursor: pointer;
}

.p922-pending-raw .p922-pre {
  margin-top: 6px;
  max-height: 180px;
}

.p922-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-size: var(--text-2xs);
  font-family: var(--font-mono);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--muted);
}

.p922-tag-lock {
  background: var(--err-soft);
  color: var(--err);
  border-color: transparent;
}

.p922-tag-ok {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: transparent;
}

.p922-tag-warn {
  background: color-mix(in oklch, var(--warn) 12%, transparent);
  color: var(--warn);
  border-color: transparent;
}

.p922-asset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.p922-pill {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--text-xs);
  cursor: pointer;
}

.p922-pill.is-on {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--fg);
}

.p922-meta-line {
  font-size: var(--text-2xs);
  color: var(--muted);
  font-family: var(--font-mono);
}

.p922-md-viewer {
  margin-top: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-ctrl);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  font-size: var(--text-xs);
  line-height: 1.65;
  max-height: 360px;
  overflow-y: auto;
  word-break: break-word;
}

.p922-md-viewer h1,
.p922-md-viewer h2,
.p922-md-viewer h3 {
  font-size: var(--text-sm);
  margin: var(--space-4) 0 var(--space-2);
}

.p922-md-viewer table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-2xs);
}

.p922-md-viewer th,
.p922-md-viewer td {
  border: 1px solid var(--border);
  padding: 4px 6px;
  text-align: left;
}

/* Forms & buttons */
.p922-field {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-frame);
  background: var(--bg);
  color: var(--fg);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-xs);
}

.p922-field:focus {
  outline: none;
  border-color: var(--accent);
}

.p922-textarea {
  resize: vertical;
  line-height: 1.5;
}

.p922-title-input {
  resize: vertical;
  line-height: 1.45;
  min-height: 52px;
}

.p922-field-hint {
  margin: 4px 0 8px;
  font-size: var(--text-2xs);
  color: var(--muted);
  line-height: 1.45;
}

.p922-field-hint.is-over,
#p922PostTitleCount.is-over {
  color: var(--err);
}

.p922-emoji-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 8px;
}

.p922-emoji-btn {
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  border-radius: var(--radius-frame);
  padding: 1px 6px;
  font-size: 16px;
  line-height: 1.4;
  cursor: pointer;
}

.p922-emoji-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.p922-inline-row {
  display: flex;
  gap: 6px;
}

.p922-select {
  width: 108px;
  flex: 0 0 108px;
}

.p922-check-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--muted);
}

.p922-row-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.p922-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius-ctrl);
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-3) var(--space-5);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease, opacity 0.12s ease;
}

.p922-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.p922-btn-full { width: 100%; }
.p922-btn-sm { font-size: var(--text-xs); padding: var(--space-2) var(--space-4); }
.p922-btn-xs { font-size: var(--text-2xs); padding: var(--space-1) var(--space-3); border-radius: var(--radius-frame); }

.p922-btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.p922-btn-soft {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--fg);
}

.p922-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.p922-btn-ghost:hover {
  background: var(--hover);
  color: var(--fg);
}

.p922-btn-danger {
  background: var(--err-soft);
  border-color: transparent;
  color: var(--err);
}

.p922-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-frame);
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.p922-icon-btn:hover {
  background: var(--hover);
}

.p922-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--err);
  color: #fff;
  font-size: var(--text-2xs);
  font-family: var(--font-mono);
}

.p922-meta-text {
  font-size: var(--text-xs);
  color: var(--muted);
}

/* Gate results */
.p922-gate-res {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
}

.p922-vio-list {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* XHS / Worker panel */
.p922-worker-health {
  font-size: var(--text-sm);
  color: var(--fg);
  line-height: 1.5;
  margin-bottom: 8px;
}

.p922-worker-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.p922-worker-controls .p922-btn.is-pending-ingest {
  border-color: var(--accent, #c9a227);
  color: var(--fg);
}

.p922-worker-token-status {
  font-size: var(--text-xs);
  color: var(--fg);
  line-height: 1.45;
}

.p922-token-reveal {
  margin-top: 4px;
  padding: 10px;
  border-radius: var(--radius-ctrl);
  border: 1px dashed var(--accent-line);
  background: var(--accent-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.p922-token-plain {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-frame);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  word-break: break-all;
  user-select: all;
}

.p922-pane-head-jobs {
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
}

.p922-job-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.p922-job-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.p922-job-note-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--fg);
  line-height: 1.35;
}

.p922-job-head-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.p922-job-fan {
  font-size: var(--text-2xs);
  color: var(--muted);
}

.p922-job-comment {
  font-size: var(--text-xs);
  color: var(--fg);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  padding: var(--space-4);
  border-radius: var(--radius-frame);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.p922-job-draft-ta {
  min-height: 72px;
  font-size: var(--text-xs);
}

.p922-job-gate {
  font-size: var(--text-2xs);
}

.p922-feed-card .p922-feed-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--text-2xs);
  color: var(--muted);
}

.p922-feed-comment {
  font-size: var(--text-xs);
  color: var(--fg);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.p922-feed-reply-form {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.p922-job-reply-preview {
  font-size: var(--text-xs);
  color: var(--fg);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.p922-post-queue-imgs {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.p922-post-queue-imgs img {
  width: 36px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-frame);
  border: 1px solid var(--border);
}

.p922-job-err {
  font-size: var(--text-2xs);
  color: var(--err);
  margin-top: 4px;
}

.p922-tag-status-pending {
  background: color-mix(in oklch, var(--warn) 12%, transparent);
  color: var(--warn);
  border-color: transparent;
}

.p922-tag-status-approved,
.p922-tag-status-done {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: transparent;
}

.p922-tag-status-running {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-line);
}

.p922-tag-status-failed {
  background: var(--err-soft);
  color: var(--err);
  border-color: transparent;
}

.p922-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--fg);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  z-index: 9999;
}

.p922-worker-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: var(--text-xs);
  cursor: pointer;
}

.p922-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.38);
}

.p922-modal.hidden {
  display: none;
}

.p922-modal-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-composer);
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
}

.p922-modal-card-sm {
  width: min(420px, 96vw);
  padding: 16px;
}

.p922-modal-card-wide {
  width: min(1080px, 96vw);
  padding: 16px;
}

.p922-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.p922-post-modal-body {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 16px;
}

.p922-post-preview {
  background: var(--surface-2);
  border-radius: var(--radius-ctrl);
  padding: 10px;
}

.p922-post-preview-slide {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-ctrl);
  overflow: hidden;
  background: #f2f1ed;
}

.p922-post-preview-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.p922-post-ai-badge {
  position: absolute;
  right: 8px;
  top: 8px;
  font-size: var(--text-2xs);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: rgba(20, 20, 20, 0.72);
  color: #fff;
}

.p922-post-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.p922-post-img-chip {
  position: relative;
  width: 72px;
  border-radius: var(--radius-frame);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  cursor: grab;
}

.p922-post-img-chip.is-dragging {
  opacity: 0.45;
}

.p922-post-img-chip.is-drop {
  outline: 2px solid var(--accent);
}

.p922-post-img-chip img {
  width: 72px;
  height: 96px;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.p922-post-img-tools {
  display: flex;
  justify-content: space-between;
  gap: 0;
}

.p922-post-img-tools .p922-btn {
  flex: 1;
  padding: 1px 0;
}

.p922-pane-section {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--rule-section);
}

.p922-topic-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
  padding: var(--space-5);
  background: var(--surface-elevated);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.p922-topic-card.is-proposed {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.p922-topic-title {
  font-weight: 600;
  font-size: var(--text-sm);
}

.p922-topic-angle {
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.5;
}

.p922-topic-rationale {
  font-size: var(--text-xs);
  line-height: 1.55;
}

.p922-topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.p922-topic-visual {
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.p922-topic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.p922-observe-stack .p922-card {
  padding: 10px 12px;
}

.p922-observe-meta {
  font-size: var(--text-xs);
  color: var(--muted);
}

@media (max-width: 900px) {
  .p922-post-modal-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .p922-appbar .appbar-meta {
    gap: var(--space-3);
  }
  .p922-sidebar {
    position: fixed;
    left: 0;
    top: var(--appbar-h);
    bottom: 0;
    z-index: 40;
    box-shadow: var(--shadow-elev-2);
  }
  .p922-drawer {
    position: fixed;
    right: 0;
    top: var(--appbar-h);
    bottom: 0;
    z-index: 40;
    width: min(92vw, var(--artifact-w));
    flex-basis: auto;
    box-shadow: var(--shadow-elev-2);
  }
}
