/* Prometheus Mobile — isolated mobile shell + pages.
 * Only activates when <body> has class "pm-mobile-active".
 * Desktop UI is untouched otherwise.
 */

:root {
  --pm-bg:            #f7f1e6;
  --pm-bg-soft:       #f3ead9;
  --pm-surface:       #fffaf1;
  --pm-surface-strong:#ffffff;
  --pm-border:        rgba(60, 40, 20, 0.10);
  --pm-border-strong: rgba(60, 40, 20, 0.18);
  --pm-text:          #221a14;
  --pm-text-soft:     #4a3f33;
  --pm-muted:         #8a7d6c;
  --pm-orange:        #ea6a1f;
  --pm-orange-soft:   #fff1e3;
  --pm-orange-dark:   #c0541a;
  --pm-green:         #2fae66;
  --pm-blue:          #4a82d1;
  --pm-purple:        #7d6bd6;
  --pm-red:           #d8473a;
  --pm-shadow-sm:     0 1px 2px rgba(70, 50, 30, .06), 0 1px 1px rgba(70, 50, 30, .04);
  --pm-shadow-md:     0 6px 18px rgba(70, 50, 30, .08), 0 2px 6px rgba(70, 50, 30, .05);
  --pm-shadow-lg:     0 16px 40px rgba(70, 50, 30, .12), 0 4px 10px rgba(70, 50, 30, .06);
  --pm-radius-sm:     10px;
  --pm-radius-md:     16px;
  --pm-radius-lg:     22px;
  --pm-radius-pill:   999px;
  --pm-font:          'Manrope', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  --pm-header-h:      56px;
  --pm-tabbar-h:      68px;
}

:root[data-theme="dark"] {
  --pm-bg:            #101112;
  --pm-bg-soft:       #17191c;
  --pm-surface:       #1d2024;
  --pm-surface-strong:#252931;
  --pm-border:        rgba(255, 255, 255, 0.10);
  --pm-border-strong: rgba(255, 255, 255, 0.16);
  --pm-text:          #f2eee7;
  --pm-text-soft:     #d0c5b8;
  --pm-muted:         #9b948c;
  --pm-orange-soft:   rgba(234, 106, 31, 0.14);
  --pm-shadow-sm:     0 1px 2px rgba(0, 0, 0, .28), 0 1px 1px rgba(0, 0, 0, .18);
  --pm-shadow-md:     0 8px 22px rgba(0, 0, 0, .28);
  --pm-shadow-lg:     0 18px 48px rgba(0, 0, 0, .42);
}

/* ---------- mode toggling ---------- */
body.pm-mobile-active > .app { display: none !important; }
body.pm-mobile-active #prometheus-auth-gate { display: none !important; }
body.pm-mobile-active { background: var(--pm-bg); }
body.pm-mobile-active.auth-pending #mobile-root { visibility: visible; }

#mobile-root[hidden] { display: none !important; }
#mobile-root {
  font-family: var(--pm-font);
  color: var(--pm-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.pm-mobile-boot-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  background: var(--pm-bg);
  color: var(--pm-text);
  text-align: center;
  font: 700 15px/1.4 var(--pm-font);
}

.pm-mobile-boot-mark {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--pm-orange);
  color: #fffaf1;
  box-shadow: var(--pm-shadow-md);
  font-size: 24px;
}

/* Lock desktop scroll behind mobile */
body.pm-mobile-active { overflow: hidden; }

/* ---------- app shell ---------- */
.pm-app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--pm-bg);
  color: var(--pm-text);
  overflow: hidden;
  isolation: isolate;
}

/* Smoky / ember background texture */
.pm-app::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 40% at 80% 12%, rgba(234, 106, 31, .12), transparent 70%),
    radial-gradient(50% 35% at 10% 90%, rgba(234, 106, 31, .08), transparent 75%),
    radial-gradient(40% 30% at 50% 50%, rgba(255, 220, 180, .12), transparent 80%),
    conic-gradient(from 210deg at 50% 0%, rgba(234,106,31,.04), transparent 25%, rgba(234,106,31,.04) 50%, transparent 80%);
}
.pm-app::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(110deg, rgba(80,60,40,.014) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(70deg, rgba(80,60,40,.012) 0 2px, transparent 2px 18px);
  mix-blend-mode: multiply;
  opacity: .8;
}
.pm-app > * { position: relative; z-index: 1; }
:root[data-theme="dark"] .pm-app::before {
  background:
    radial-gradient(60% 40% at 80% 12%, rgba(234, 106, 31, .16), transparent 70%),
    radial-gradient(50% 35% at 10% 90%, rgba(74, 130, 209, .10), transparent 75%),
    radial-gradient(42% 34% at 50% 48%, rgba(255, 180, 120, .06), transparent 80%);
}
:root[data-theme="dark"] .pm-app::after {
  opacity: .22;
  mix-blend-mode: screen;
}

/* ---------- header ---------- */
.pm-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: max(env(safe-area-inset-top), 12px) 14px 6px;
  background: linear-gradient(180deg, rgba(247,241,230,.92), rgba(247,241,230,.6));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
:root[data-theme="dark"] .pm-header {
  background: linear-gradient(180deg, rgba(16,17,18,.94), rgba(16,17,18,.64));
}
.pm-header .pm-icon-btn { color: var(--pm-text); }
.pm-header > .pm-icon-btn:first-child {
  position: relative;
  z-index: 2;
  flex: 0 0 44px;
}
.pm-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
  z-index: 2;
}
.pm-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .2px;
}
.pm-header-hide-brand .pm-brand { display: none; }
.pm-brand-flame {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0;
  color: transparent;
  background: url('/assets/Prometheus.png') center / contain no-repeat;
  filter: drop-shadow(0 1px 2px rgba(234,106,31,.28));
}
.pm-brand-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.pm-title-row {
  padding: 6px 18px 10px;
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.pm-title-row.pm-title-row-compact {
  padding-top: 0;
  padding-bottom: 6px;
  justify-content: center;
}
.pm-title { font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -.5px; margin: 0; }
.pm-title-row .pm-online {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--pm-text-soft); font-weight: 600;
}
.pm-title-row .pm-online::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--pm-green); box-shadow: 0 0 0 3px rgba(47,174,102,.18);
}
.pm-title-row .pm-online.offline { color: var(--pm-red); }
.pm-title-row .pm-online.offline::before {
  background: var(--pm-red);
  box-shadow: 0 0 0 3px rgba(216,71,58,.16);
}
.pm-title-row .pm-count-pill {
  font-size: 12px; font-weight: 700; color: var(--pm-blue);
  background: rgba(74,130,209,.12); padding: 4px 10px;
  border-radius: var(--pm-radius-pill);
}
.pm-title-row .pm-spacer { flex: 1; }
.pm-title-row .pm-cta {
  background: var(--pm-orange);
  color: #fff; border: none;
  padding: 10px 16px;
  border-radius: var(--pm-radius-pill);
  font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: 0 6px 18px rgba(234,106,31,.32);
}
.pm-title-row .pm-cta:active { transform: translateY(1px); }

.pm-icon-btn {
  appearance: none;
  border: none;
  background: transparent;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--pm-radius-sm);
  cursor: pointer;
  color: var(--pm-text);
}
.pm-icon-btn:active { background: rgba(0,0,0,.05); }
.pm-icon-btn.listening {
  color: #fff;
  background: #d8473a;
  box-shadow: 0 0 0 4px rgba(216,71,58,.16);
  animation: pmMicPulse 1.1s ease-in-out infinite;
}
.pm-icon-btn svg { width: 22px; height: 22px; }
@keyframes pmMicPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* ---------- body ---------- */
.pm-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 14px calc(var(--pm-tabbar-h) + env(safe-area-inset-bottom) + 24px);
  scroll-behavior: smooth;
}
.pm-body.pm-no-pad-top { padding-top: 0; }

/* ---------- bottom tab nav ---------- */
.pm-tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--pm-tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(247,241,230,.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--pm-border);
  z-index: 5;
}
:root[data-theme="dark"] .pm-tabbar {
  background: rgba(16,17,18,.96);
}
.pm-tab {
  appearance: none; background: transparent; border: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  color: var(--pm-muted);
  font-size: 11px; font-weight: 600;
  cursor: pointer;
  padding: 8px 4px;
}
.pm-tab svg { width: 22px; height: 22px; }
.pm-tab.active { color: var(--pm-orange); }
.pm-tab:active { transform: scale(.95); }

/* ---------- drawer ---------- */
.pm-drawer-scrim {
  position: absolute; inset: 0;
  background: rgba(20,15,10,.32);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease;
  z-index: 20;
}
.pm-drawer-scrim.open { opacity: 1; pointer-events: auto; }
.pm-drawer {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: min(78vw, 320px);
  background: var(--pm-bg);
  border-right: 1px solid var(--pm-border);
  transform: translateX(-100%);
  transition: transform .25s cubic-bezier(.2,.7,.2,1);
  z-index: 21;
  display: flex; flex-direction: column;
  padding: max(env(safe-area-inset-top), 18px) 18px 22px;
  box-shadow: var(--pm-shadow-lg);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.pm-drawer::-webkit-scrollbar { width: 5px; }
.pm-drawer::-webkit-scrollbar-thumb { background: rgba(234,106,31,.34); border-radius: 999px; }
.pm-drawer [hidden] { display: none !important; }
.pm-drawer.open { transform: translateX(0); }
.pm-drawer-brand {
  display: flex; align-items: center; gap: 10px;
  margin: 8px 52px 22px 0;
  font-size: 18px; font-weight: 800; letter-spacing: 0;
}
.pm-drawer-brand .pm-brand-flame { font-size: 22px; width: 26px; height: 26px; }
.pm-theme-toggle {
  appearance: none;
  position: absolute;
  top: max(env(safe-area-inset-top), 18px);
  right: 18px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--pm-border);
  border-radius: 12px;
  background: var(--pm-surface);
  color: var(--pm-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--pm-shadow-sm);
}
.pm-theme-toggle svg { width: 19px; height: 19px; }
.pm-theme-toggle:active { transform: scale(.96); }
.pm-drawer-search {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 12px;
  margin: -8px 0 14px;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-md);
  background: var(--pm-surface);
  color: var(--pm-muted);
  box-shadow: var(--pm-shadow-sm);
}
.pm-drawer-search svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.pm-drawer-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--pm-text);
  font: 700 15px/1.2 inherit;
}
.pm-drawer-search input::placeholder { color: var(--pm-muted); font-weight: 600; }
.pm-drawer-list { display: flex; flex-direction: column; gap: 7px; }
.pm-drawer-item {
  display: flex; align-items: center; gap: 14px;
  min-height: 46px;
  padding: 10px 12px;
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-md);
  font-size: 14px; font-weight: 700;
  color: var(--pm-text);
  cursor: pointer;
  box-shadow: var(--pm-shadow-sm);
  text-align: left;
}
.pm-drawer-item .pm-icon {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: var(--pm-orange-soft);
  color: var(--pm-orange);
}
.pm-drawer-item .pm-icon svg { width: 16px; height: 16px; }
.pm-drawer-item .pm-flex { flex: 1; }
.pm-drawer-item .pm-chev { color: var(--pm-muted); }
.pm-drawer-item:active { transform: scale(.98); }

.pm-drawer-sessions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: auto;
}
.pm-drawer-search-results {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pm-drawer-divider {
  height: 1px;
  background: var(--pm-border-strong);
  margin: 6px 0 2px;
}
.pm-drawer-section-title {
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--pm-muted);
  font-weight: 800;
  padding: 4px 2px;
}
.pm-drawer-session-head,
.pm-drawer-session-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pm-session-row {
  appearance: none;
  border: 1px solid var(--pm-border);
  background: rgba(255,250,241,.76);
  color: var(--pm-text);
  border-radius: var(--pm-radius-sm);
  padding: 10px 11px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  min-width: 0;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
:root[data-theme="dark"] .pm-session-row,
:root[data-theme="dark"] .pm-drawer-back,
:root[data-theme="dark"] .pm-channel-card {
  background: rgba(255, 255, 255, .055);
}
.pm-session-row.is-working::before,
.pm-session-row.is-unread::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
}
.pm-session-row.is-working::before {
  background:
    conic-gradient(
      from var(--pm-angle, 0deg),
      rgba(255,255,255,0.24),
      color-mix(in srgb, var(--pm-orange), transparent 30%),
      rgba(255,255,255,0.06),
      color-mix(in srgb, var(--pm-gold), transparent 54%),
      color-mix(in srgb, var(--pm-ember), transparent 44%),
      rgba(255,255,255,0.20)
    );
  opacity: .86;
  animation: prometheus-liquid-spin 13s linear infinite;
}
.pm-session-row.is-working::after {
  content: "";
  position: absolute;
  inset: -18px;
  z-index: -2;
  pointer-events: none;
  background:
    conic-gradient(
      from var(--pm-angle, 0deg),
      transparent 0deg,
      color-mix(in srgb, var(--pm-orange), transparent 84%) 58deg,
      color-mix(in srgb, var(--pm-gold), transparent 90%) 118deg,
      transparent 190deg,
      color-mix(in srgb, var(--pm-ember), transparent 86%) 310deg,
      transparent 360deg
    );
  filter: blur(18px);
  opacity: .58;
  animation: prometheus-liquid-spin 16s linear infinite;
}
.pm-session-row.is-unread {
  border-color: color-mix(in srgb, var(--pm-orange), transparent 42%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--pm-orange), transparent 78%),
    0 0 24px color-mix(in srgb, var(--pm-orange), transparent 72%),
    inset 0 1px 0 rgba(255,255,255,.10);
}
.pm-session-row.is-unread::before {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--pm-orange), transparent 38%),
    color-mix(in srgb, var(--pm-gold), transparent 70%),
    color-mix(in srgb, var(--pm-orange), transparent 50%)
  );
  opacity: .72;
}
.pm-session-row.is-unread::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(70% 130% at 100% 0%, color-mix(in srgb, var(--pm-orange), transparent 78%), transparent 64%);
  opacity: .78;
}
.pm-session-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.pm-session-row-top .pm-session-title { flex: 1; }
.pm-session-state {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .45px;
  text-transform: uppercase;
  color: var(--pm-orange);
  background: color-mix(in srgb, var(--pm-orange), transparent 88%);
  border: 1px solid color-mix(in srgb, var(--pm-orange), transparent 72%);
}
.pm-session-row.is-working .pm-session-state {
  color: #fff7ed;
  background: color-mix(in srgb, var(--pm-orange), transparent 34%);
  border-color: color-mix(in srgb, var(--pm-gold), transparent 42%);
  box-shadow: 0 0 14px color-mix(in srgb, var(--pm-orange), transparent 62%);
}
:root[data-theme="dark"] .pm-session-row.is-working,
:root[data-theme="dark"] .pm-session-row.is-unread {
  background: rgba(255,255,255,.066);
}

.pm-session-row.pm-session-new {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  background: var(--pm-orange-soft);
  border-color: rgba(234,106,31,.22);
}
.pm-session-row.pm-channel-entry {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}
.pm-session-row.pm-channel-entry .pm-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(74,130,209,.12);
  color: var(--pm-blue);
}
.pm-session-row.pm-channel-entry .pm-chev {
  margin-left: auto;
  color: var(--pm-muted);
}
.pm-session-row.pm-session-new .pm-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pm-orange);
  color: #fff;
}
.pm-session-row.pm-session-new svg { width: 16px; height: 16px; }
.pm-session-title {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.pm-session-preview {
  font-size: 11px;
  color: var(--pm-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.pm-search-result-row {
  gap: 5px;
}
.pm-search-result-row .pm-session-preview {
  white-space: normal;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.pm-search-result-row mark {
  color: var(--pm-text);
  background: rgba(234,106,31,.22);
  border-radius: 4px;
  padding: 0 2px;
}
.pm-search-meta {
  width: max-content;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--pm-orange-soft);
  color: var(--pm-orange);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-session-empty {
  font-size: 12px;
  color: var(--pm-muted);
  padding: 8px 4px;
}
.pm-drawer-back,
.pm-channel-card {
  appearance: none;
  border: 1px solid var(--pm-border);
  background: rgba(255,250,241,.76);
  color: var(--pm-text);
  border-radius: var(--pm-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  text-align: left;
}
.pm-drawer-back {
  align-self: flex-start;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--pm-orange);
}
.pm-drawer-back svg { width: 15px; height: 15px; }
.pm-channel-card .pm-flex {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pm-channel-card strong {
  font-size: 14px;
  font-weight: 800;
}
.pm-channel-card em {
  font-size: 11px;
  color: var(--pm-muted);
  font-style: normal;
}
.pm-channel-card .pm-chev {
  margin-left: auto;
  color: var(--pm-muted);
}
.pm-channel-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pm-orange);
}
.pm-channel-icon svg { width: 17px; height: 17px; }
.pm-chat-loading {
  margin: 24px auto;
  color: var(--pm-muted);
  font-size: 13px;
  font-weight: 700;
}
.pm-chat-loading.error { color: var(--pm-red); }

/* ---------- generic card ---------- */
.pm-card {
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-lg);
  padding: 16px 18px;
  margin: 12px 0;
  box-shadow: var(--pm-shadow-sm);
}
.pm-card.pm-card-strong {
  background: var(--pm-surface-strong);
  box-shadow: var(--pm-shadow-md);
}
.pm-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.pm-card p { margin: 0; color: var(--pm-text-soft); font-size: 14px; line-height: 1.45; }

/* ---------- more / hub / audit / memory ---------- */
.pm-more-page { display: flex; flex-direction: column; gap: 14px; }
.pm-more-card {
  width: 100%; display: flex; flex-direction: column; gap: 12px; text-align: left;
  color: var(--pm-text); background: rgba(255,250,241,.84);
  border: 1px solid var(--pm-border); border-radius: var(--pm-radius-lg);
  padding: 14px; box-shadow: var(--pm-shadow-sm); appearance: none;
}
.pm-more-card:active { transform: scale(.99); }
:root[data-theme="dark"] .pm-more-card {
  background: linear-gradient(180deg, rgba(37,41,49,.94), rgba(29,32,36,.92));
  border-color: rgba(255,255,255,.13);
  box-shadow: var(--pm-shadow-md);
}
.pm-select {
  min-height: 36px;
  max-width: 124px;
  border: 1px solid var(--pm-border);
  border-radius: 12px;
  background-color: rgba(255,250,241,.96);
  color: var(--pm-text);
  padding: 0 10px;
  font: 800 12px var(--pm-font);
  color-scheme: light;
}
:root[data-theme="dark"] .pm-select {
  background-color: #1c1f24;
  border-color: rgba(255,255,255,.18);
  color: #f4efe7;
  color-scheme: dark;
}
.pm-select option {
  background: var(--pm-surface);
  color: var(--pm-text);
}
:root[data-theme="dark"] .pm-select option {
  background: #1c1f24;
  color: #f4efe7;
}
.pm-more-card-top, .pm-audit-run-top { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; }
.pm-more-card-top strong, .pm-audit-run-top strong { display: block; font-size: 17px; line-height: 1.15; }
.pm-more-card-top em, .pm-audit-run-top em {
  display: block; margin-top: 3px; color: var(--pm-muted); font-size: 12px; font-style: normal; font-weight: 650;
}
.pm-more-icon {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--pm-orange); background: var(--pm-orange-soft);
  border: 1px solid rgba(234,106,31,.24); border-radius: 12px;
}
.pm-more-icon svg { width: 19px; height: 19px; }
.pm-more-stats, .pm-more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.pm-more-stats span, .pm-more-grid span {
  min-width: 0; background: rgba(255,255,255,.58); border: 1px solid var(--pm-border); border-radius: 12px; padding: 10px 12px;
}
:root[data-theme="dark"] .pm-more-stats span,
:root[data-theme="dark"] .pm-more-grid span {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
}
.pm-more-stats b, .pm-more-grid b, .pm-more-detail-hero strong {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.05;
}
.pm-more-stats b, .pm-more-grid b { font-size: 22px; }
.pm-more-stats em, .pm-more-grid em, .pm-more-list em, .pm-memory-mini-list em {
  display: block; margin-top: 4px; color: var(--pm-muted); font-size: 11px; font-style: normal; font-weight: 750; text-transform: uppercase;
}
.pm-more-preview-box {
  border: 1px solid var(--pm-border); border-radius: 12px; padding: 11px 12px; background: rgba(255,255,255,.48);
}
:root[data-theme="dark"] .pm-more-preview-box {
  background: rgba(8,10,14,.42);
  border-color: rgba(255,255,255,.12);
}
.pm-mini-label {
  display: block; color: var(--pm-muted); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px;
}
.pm-more-preview-box strong, .pm-more-preview-box p {
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
}
.pm-more-preview-box strong { -webkit-line-clamp: 2; font-size: 14px; line-height: 1.25; }
.pm-more-preview-box p { -webkit-line-clamp: 2; margin-top: 6px; font-size: 12px; }
.pm-run-mini-list, .pm-more-list, .pm-memory-mini-list, .pm-audit-run-list {
  display: flex; flex-direction: column; gap: 8px;
}
.pm-run-mini-list > span, .pm-more-list > span, .pm-memory-mini-list > span {
  min-width: 0; display: block; border: 1px solid var(--pm-border); border-radius: 12px; background: rgba(255,255,255,.52); padding: 9px 10px;
}
:root[data-theme="dark"] .pm-run-mini-list > span,
:root[data-theme="dark"] .pm-more-list > span,
:root[data-theme="dark"] .pm-memory-mini-list > span {
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.12);
}
.pm-run-mini-list b, .pm-more-list b, .pm-memory-mini-list b {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px;
}
.pm-run-mini-list .pm-pill { margin-top: 7px; }
.pm-memory-mini { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: stretch; }
.pm-memory-orbit {
  position: relative; min-height: 112px; border-radius: 18px; overflow: hidden;
  background: radial-gradient(circle at center, #174a83 0, #071321 32%, #030912 100%);
  border: 1px solid rgba(255,255,255,.14);
}
.pm-memory-orbit i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 8px currentColor;
}
.pm-memory-core {
  position: absolute; inset: 39%; border-radius: 50%; background: #9fd3ff; box-shadow: 0 0 36px 18px rgba(91,178,255,.62);
}
.pm-more-detail-hero, .pm-memory-graph-panel {
  border: 1px solid var(--pm-border); border-radius: 20px; padding: 14px; box-shadow: var(--pm-shadow-sm);
}
.pm-more-detail-hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,.68), rgba(255,241,227,.7));
}
:root[data-theme="dark"] .pm-more-detail-hero {
  background:
    radial-gradient(circle at 92% 10%, rgba(234,106,31,.20), transparent 42%),
    linear-gradient(135deg, rgba(37,41,49,.96), rgba(21,23,27,.94));
  border-color: rgba(255,255,255,.13);
}
.pm-more-detail-hero strong { font-size: 24px; }
.pm-more-detail-hero .pm-more-bars { grid-column: 1 / -1; }
.pm-more-bars { height: 64px; display: flex; align-items: end; gap: 5px; padding-top: 8px; }
.pm-more-bars span {
  flex: 1; min-width: 6px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #ff8a2a, var(--pm-orange));
}
.pm-more-section { padding: 14px; }
.pm-card-head {
  color: var(--pm-orange); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px;
}
.pm-more-meta-row {
  display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; color: var(--pm-muted); font-size: 11px; font-weight: 700;
}
.pm-more-list small { display: block; margin-top: 6px; color: var(--pm-text-soft); font-size: 12px; line-height: 1.35; }
.pm-audit-run-list { gap: 12px; }
.pm-audit-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 9px;
}
.pm-audit-filter-row label,
.pm-audit-filter-row button {
  min-height: 44px;
  border: 1px solid var(--pm-border);
  border-radius: 14px;
  background: rgba(255,255,255,.58);
}
:root[data-theme="dark"] .pm-audit-filter-row label,
:root[data-theme="dark"] .pm-audit-filter-row button {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.13);
}
.pm-audit-filter-row label {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  align-items: center;
  padding: 0 12px;
  color: var(--pm-muted);
}
.pm-audit-filter-row svg { width: 17px; height: 17px; }
.pm-audit-filter-row input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--pm-text);
  font: 700 13px var(--pm-font);
}
.pm-audit-filter-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pm-text);
}
.pm-audit-filter-row button svg { width: 19px; height: 19px; }
.pm-audit-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(72px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.pm-audit-stat-grid span {
  border: 1px solid var(--pm-border);
  border-radius: 12px;
  background: rgba(255,255,255,.55);
  padding: 10px 8px;
  text-align: center;
}
:root[data-theme="dark"] .pm-audit-stat-grid span {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
}
.pm-audit-stat-grid b {
  display: block;
  font-size: 20px;
  line-height: 1;
}
.pm-audit-stat-grid em {
  display: block;
  margin-top: 6px;
  color: var(--pm-muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
}
.pm-audit-stat-grid .read b,
.pm-audit-tool-stream span { color: var(--pm-green); }
.pm-audit-stat-grid .edit b,
.pm-audit-stat-grid .proposal b,
.pm-audit-stat-grid .pending b { color: var(--pm-orange); }
.pm-audit-stat-grid .delete b,
.pm-audit-stat-grid .rejected b { color: var(--pm-red); }
.pm-audit-stat-grid .type b,
.pm-audit-stat-grid .click b,
.pm-audit-stat-grid .cmd b { color: var(--pm-blue); }
.pm-audit-run-top { grid-template-columns: 88px 1fr auto; }
.pm-audit-run-card { padding: 13px; cursor: pointer; }
.pm-audit-run-card p { margin-top: 9px; font-size: 12px; }
.pm-audit-tool-stream {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--pm-border); display: flex; flex-direction: column; gap: 7px;
}
.pm-audit-tool-stream div { border: 1px solid var(--pm-border); border-radius: 10px; background: rgba(255,255,255,.55); padding: 8px 9px; }
:root[data-theme="dark"] .pm-audit-tool-stream div {
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.12);
}
.pm-audit-tool-stream b, .pm-audit-tool-stream em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-audit-tool-stream b { font-size: 12px; }
.pm-audit-tool-stream em { margin-top: 3px; color: var(--pm-muted); font-size: 10px; font-style: normal; font-weight: 750; }
.pm-audit-tool-stream span {
  display: inline-flex;
  margin-top: 6px;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 900;
}
.pm-memory-graph-panel { background: #071321; color: #fff; padding: 12px; }
.pm-memory-graph-panel .pm-memory-orbit { min-height: 420px; border-radius: 18px; border-color: rgba(255,255,255,.08); }
.pm-memory-search {
  display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: center; margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(255,255,255,.12);
  padding: 9px 12px; color: rgba(255,255,255,.76); font-size: 12px;
}
.pm-memory-search svg { width: 16px; height: 16px; }
.pm-memory-search b { color: #fff; font-size: 11px; }
.pm-mobile-memory-body {
  flex: 1;
  min-height: 0;
  padding: 0 0 calc(var(--pm-tabbar-h) + env(safe-area-inset-bottom));
  overflow: hidden;
}
.pm-mobile-memory-shell {
  height: 100%;
  min-height: 0;
  background: transparent;
}
.pm-mobile-memory-shell .memory-page-header.pm-mobile-memory-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 0 14px 10px;
}
.pm-mobile-memory-shell .memory-page-header.pm-mobile-memory-actions::-webkit-scrollbar { display: none; }
.pm-mobile-memory-shell .memory-action-btn {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid var(--pm-border);
  border-radius: 999px;
  background: rgba(255,250,241,.86);
  color: var(--pm-text);
  padding: 0 12px;
  font: 850 12px var(--pm-font);
}
.pm-mobile-memory-shell .memory-action-btn--primary {
  background: var(--pm-orange);
  color: #fff;
  border-color: transparent;
}
.pm-mobile-memory-shell .memory-page-body {
  flex: 1;
  min-height: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
}
.pm-mobile-memory-shell .memory-graph-panel,
.pm-mobile-memory-shell .memory-graph-stage {
  height: 100%;
  min-height: 0;
}
.pm-mobile-memory-shell .memory-graph-panel {
  border-radius: 0;
  background: #071321;
}
.pm-mobile-memory-shell .memory-graph-toolbar {
  position: absolute;
  z-index: 5;
  top: 10px;
  left: 10px;
  right: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.pm-mobile-memory-shell .memory-search-input {
  min-width: 0;
  width: 100%;
  height: 42px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.13);
  color: #fff;
  padding: 0 14px;
  font: 700 13px var(--pm-font);
  outline: none;
}
.pm-mobile-memory-shell .memory-search-input::placeholder { color: rgba(255,255,255,.62); }
.pm-mobile-memory-shell .memory-graph-stats {
  max-width: 112px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.13);
  color: rgba(255,255,255,.86);
  padding: 0 12px;
  font-size: 11px;
  white-space: nowrap;
}
.pm-mobile-memory-shell .memory-graph-stage canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
  background: radial-gradient(circle at center, #0b2441 0, #061321 42%, #030912 100%);
}
.pm-mobile-memory-shell .memory-graph-empty {
  color: rgba(255,255,255,.72);
  font-size: 13px;
}
.pm-mobile-memory-shell .memory-graph-tooltip {
  max-width: 240px;
  border-radius: 14px;
  background: rgba(5, 13, 24, .88);
  color: #fff;
  backdrop-filter: blur(10px);
  z-index: 8;
}
.pm-mobile-memory-shell .memory-side-panel {
  position: absolute;
  left: 10px;
  right: 10px;
  top: auto;
  bottom: 10px;
  max-height: min(68%, 520px);
  width: auto;
  overflow: auto;
  border: 1px solid var(--pm-border);
  border-radius: 18px;
  background: rgba(255,250,241,.95);
  box-shadow: var(--pm-shadow-lg);
  padding: 14px;
  z-index: 11;
}
.pm-mobile-memory-shell .memory-side-panel.collapsed {
  transform: translateY(calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
}
.pm-mobile-memory-shell .memory-panel-card {
  border: 1px solid var(--pm-border);
  border-radius: 14px;
  background: rgba(255,255,255,.66);
  padding: 12px;
  margin-top: 10px;
}
.pm-mobile-memory-shell .memory-controls-fab {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 10;
  min-height: 54px;
  min-width: 86px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(6,19,33,.72);
  color: #fff;
  font: 850 13px var(--pm-font);
  backdrop-filter: blur(10px);
}
.pm-mobile-memory-shell .memory-detail-drawer {
  position: absolute;
  left: 0;
  right: 0;
  top: auto;
  bottom: 0;
  max-height: min(72%, 620px);
  width: auto;
  border: 0;
  border-radius: 22px 22px 0 0;
  background: var(--pm-bg);
  box-shadow: 0 -18px 46px rgba(0,0,0,.18);
  padding: 16px;
  z-index: 14;
  overflow: hidden;
}
.pm-mobile-memory-shell .memory-detail-panel {
  overflow-y: auto;
  padding-bottom: 8px;
}
.pm-mobile-memory-shell .memory-detail-heading h3 {
  font-size: 16px;
  line-height: 1.25;
}
.pm-mobile-memory-shell .memory-detail-meta {
  grid-template-columns: 1fr;
}
.pm-mobile-memory-shell .memory-compose-textarea {
  min-height: 120px;
}
.pm-more-skeleton { display: flex; flex-direction: column; gap: 12px; }
.pm-more-skeleton span {
  height: 138px; border-radius: var(--pm-radius-lg);
  background: linear-gradient(90deg, rgba(255,255,255,.42), rgba(255,255,255,.78), rgba(255,255,255,.42));
  background-size: 220% 100%; animation: pm-more-shimmer 1.2s linear infinite; border: 1px solid var(--pm-border);
}
@keyframes pm-more-shimmer { to { background-position: -220% 0; } }
@media (max-width: 370px) {
  .pm-memory-mini, .pm-more-detail-hero, .pm-more-grid, .pm-more-stats { grid-template-columns: 1fr; }
  .pm-memory-graph-panel .pm-memory-orbit { min-height: 330px; }
}

.pm-proposals-page { display: flex; flex-direction: column; gap: 12px; }
.pm-proposal-card,
.pm-proposal-review-card {
  padding: 14px;
  border-left: 2px solid var(--pm-orange);
}
.pm-proposal-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}
.pm-proposal-review-card .pm-proposal-head { grid-template-columns: 42px minmax(0, 1fr); }
.pm-proposal-head strong {
  display: block;
  font-size: 17px;
  line-height: 1.25;
}
.pm-proposal-card > p,
.pm-proposal-review-card > p {
  margin-top: 10px;
  color: var(--pm-text-soft);
  font-size: 13px;
}
.pm-proposal-badges,
.pm-proposal-files,
.pm-proposal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-top: 10px;
}
.pm-proposal-badges span,
.pm-proposal-files span,
.pm-proposal-badge,
.pm-proposal-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--pm-border);
  border-radius: 8px;
  padding: 3px 9px;
  background: rgba(255,255,255,.52);
  color: var(--pm-text-soft);
  font-size: 11px;
  font-weight: 850;
}
:root[data-theme="dark"] .pm-proposal-badges span,
:root[data-theme="dark"] .pm-proposal-files span,
:root[data-theme="dark"] .pm-proposal-badge,
:root[data-theme="dark"] .pm-proposal-status {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.13);
  color: var(--pm-text-soft);
}
.pm-proposal-badge.orange,
.pm-proposal-status.pending { color: var(--pm-orange); border-color: rgba(234,106,31,.5); background: var(--pm-orange-soft); }
.pm-proposal-badge.gray { color: var(--pm-muted); }
.pm-proposal-badge.blue { color: var(--pm-blue); border-color: rgba(74,130,209,.4); }
.pm-proposal-status.running { color: var(--pm-blue); border-color: rgba(74,130,209,.4); }
.pm-proposal-status.complete { color: var(--pm-green); border-color: rgba(47,174,102,.42); }
.pm-proposal-status.denied { color: var(--pm-red); border-color: rgba(216,71,58,.42); }
:root[data-theme="dark"] .pm-proposal-badge.orange,
:root[data-theme="dark"] .pm-proposal-status.pending {
  color: #ff9d55;
  border-color: rgba(234,106,31,.42);
  background: rgba(234,106,31,.16);
}
:root[data-theme="dark"] .pm-proposal-badge.blue,
:root[data-theme="dark"] .pm-proposal-status.running {
  color: #8db8ff;
  border-color: rgba(74,130,209,.36);
  background: rgba(74,130,209,.13);
}
:root[data-theme="dark"] .pm-proposal-status.complete {
  color: #74df9d;
  border-color: rgba(47,174,102,.34);
  background: rgba(47,174,102,.12);
}
:root[data-theme="dark"] .pm-proposal-status.denied {
  color: #ff8a80;
  border-color: rgba(216,71,58,.34);
  background: rgba(216,71,58,.12);
}
.pm-proposal-files span {
  max-width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pm-proposal-impact { font-size: 12px !important; }
.pm-proposal-actions {
  justify-content: flex-start;
  margin-top: 12px;
}
.pm-proposal-actions .pm-btn {
  flex: 0 0 auto;
  min-width: 96px;
  justify-content: center;
}
.pm-proposal-actions .pm-btn.ghost {
  flex: 1 1 160px;
  min-width: 150px;
}
.pm-proposal-actions .pm-proposal-action-btn {
  flex: 0 0 auto;
}
.pm-proposal-review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 4px 0 8px;
}
.pm-proposal-review-actions .pm-btn { min-height: 52px; font-size: 17px; }
.pm-curator-section { gap: 12px; }
.pm-curator-list { display: flex; flex-direction: column; gap: 12px; }
.pm-curator-card .pm-proposal-head {
  grid-template-columns: 38px minmax(0, 1fr) 44px;
}
.pm-curator-apply-preview {
  border: 1px solid color-mix(in srgb, var(--pm-green) 38%, var(--pm-border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--pm-green) 8%, var(--pm-card));
  color: var(--pm-text);
  padding: 10px;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}
.pm-curator-lesson {
  color: var(--pm-text);
  font-weight: 650;
}
.pm-curator-trigger,
.pm-curator-why {
  color: var(--pm-muted);
  font-size: 12px;
  line-height: 1.4;
}
.pm-curator-trigger {
  border-left: 3px solid var(--pm-accent);
  padding-left: 9px;
}
.pm-curator-trigger strong {
  display: block;
  color: var(--pm-text);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 2px;
}
.pm-curator-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pm-curator-evidence span {
  max-width: 100%;
  border: 1px solid var(--pm-border);
  border-radius: 999px;
  background: rgba(255,255,255,.48);
  color: var(--pm-muted);
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:root[data-theme="dark"] .pm-curator-evidence span {
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.12);
}
.pm-curator-details {
  border-top: 1px solid var(--pm-border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pm-curator-details[hidden] { display: none !important; }
.pm-curator-details pre {
  margin: 0;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--pm-border);
  border-radius: 12px;
  background: rgba(255,255,255,.52);
  color: var(--pm-text);
  padding: 10px;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}
:root[data-theme="dark"] .pm-curator-details pre {
  background: rgba(8,10,14,.42);
  border-color: rgba(255,255,255,.12);
}
.pm-btn.success {
  background: var(--pm-green);
  color: #fff;
  border-color: transparent;
  justify-content: center;
}
.pm-btn.danger {
  background: var(--pm-red);
  color: #fff;
  border-color: transparent;
  justify-content: center;
}
.pm-proposal-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pm-proposal-step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--pm-border);
  border-radius: 14px;
  background: rgba(255,255,255,.52);
  padding: 12px;
}
:root[data-theme="dark"] .pm-proposal-step {
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.12);
}
.pm-proposal-step > b {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--pm-orange);
  background: var(--pm-orange-soft);
  font-size: 20px;
}
.pm-proposal-step strong,
.pm-proposal-step em {
  display: block;
}
.pm-proposal-step strong {
  font-size: 14px;
  line-height: 1.25;
}
.pm-proposal-step em {
  margin-top: 5px;
  color: var(--pm-muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}
.pm-proposal-step small {
  color: var(--pm-orange);
  border: 1px solid rgba(234,106,31,.42);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 900;
}
@media (max-width: 390px) {
  .pm-audit-run-top { grid-template-columns: 1fr auto; }
  .pm-audit-run-top > span:first-child { display: none; }
  .pm-proposal-step { grid-template-columns: 34px minmax(0, 1fr); }
  .pm-proposal-step small { grid-column: 2; justify-self: start; }
}

.pm-section-label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1.2px;
  font-weight: 700;
  color: var(--pm-orange);
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 8px;
}

/* ---------- chat ---------- */
.pm-chat-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 4px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  box-sizing: border-box;
}
.pm-msg {
  width: fit-content;
  max-width: min(86%, calc(100vw - 28px));
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-sizing: border-box;
}
.pm-msg.from-ai { align-self: flex-start; align-items: flex-start; }
.pm-msg.from-user { align-self: flex-end; align-items: flex-end; }
.pm-msg.workflow-linked {
  position: relative;
}
.pm-msg.workflow-linked::before {
  content: "";
  position: absolute;
  top: -14px;
  bottom: -14px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(234,106,31,.12), rgba(234,106,31,.72), rgba(234,106,31,.12));
}
.pm-msg.from-ai.workflow-linked::before { left: -12px; }
.pm-msg.from-user.workflow-linked::before { right: -12px; }
.pm-workflow-chip {
  max-width: 100%;
  border: 1px solid rgba(234,106,31,.25);
  border-radius: 999px;
  background: rgba(234,106,31,.1);
  color: var(--pm-muted);
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}
.pm-bubble {
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: var(--pm-shadow-sm);
  font-size: 15px;
  line-height: 1.45;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}
.pm-msg.from-user .pm-bubble {
  background: var(--pm-orange-soft);
  border-color: rgba(234,106,31,.18);
}
.pm-bubble .pm-sender {
  display: block;
  font-weight: 700;
  color: var(--pm-orange);
  font-size: 13px;
  margin-bottom: 4px;
}
.pm-bubble .pm-time {
  display: block;
  text-align: right;
  font-size: 11px;
  color: var(--pm-muted);
  margin-top: 6px;
  font-weight: 600;
}
.pm-bubble .markdown-body,
.pm-bubble .pm-live-trace,
.pm-bubble .pm-live-segment,
.pm-bubble .pm-live-text,
.pm-bubble .pm-live-md,
.pm-bubble .pm-process-stream,
.pm-bubble .pm-process-full,
.pm-bubble .pm-process-latest,
.pm-bubble .pm-media-gallery,
.pm-bubble .pm-command-actions,
.pm-bubble .pm-chat-approvals-inline,
.pm-bubble .pm-summary-rows,
.pm-bubble .pm-team-rows,
.pm-bubble .pm-numbered {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}
.pm-bubble .markdown-body > *,
.pm-bubble .pm-live-md > *,
.pm-bubble .pm-live-text,
.pm-bubble .pm-process-row,
.pm-bubble .pm-process-row p,
.pm-bubble .pm-process-latest b {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}
.pm-bubble .markdown-body pre {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}
.pm-bubble .markdown-body pre code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.pm-bubble .markdown-body table {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.pm-bubble .visual-block {
  max-width: 100%;
  border-radius: 8px !important;
}
.pm-bubble .visual-block iframe {
  min-height: 220px !important;
}
.pm-msg.from-user .markdown-body p:last-child,
.pm-msg.from-ai .markdown-body p:last-child {
  margin-bottom: 0;
}
.pm-msg-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 0 2px;
  opacity: .88;
}
.pm-msg.from-user .pm-msg-actions { justify-content: flex-end; }
.pm-msg-action {
  min-height: 28px;
  border: 1px solid color-mix(in srgb, var(--pm-border) 82%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--pm-surface) 86%, transparent);
  color: var(--pm-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 9px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 5px 14px rgba(20, 15, 10, .05);
}
.pm-msg-action svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}
.pm-msg-action:disabled {
  opacity: .38;
  box-shadow: none;
}
.pm-msg-action.primary {
  background: var(--pm-orange);
  border-color: var(--pm-orange);
  color: #fff;
}
.pm-msg-variant-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--pm-border);
  border-radius: 999px;
  padding: 2px;
  background: color-mix(in srgb, var(--pm-surface) 90%, transparent);
  color: var(--pm-muted);
  font-size: 11px;
  font-weight: 900;
}
.pm-msg-variant-nav .pm-msg-action {
  width: 24px;
  min-height: 24px;
  padding: 0;
  box-shadow: none;
}
.pm-mobile-edit-composer {
  display: grid;
  gap: 9px;
  width: min(72vw, 420px);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.pm-mobile-edit-input {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--pm-orange) 34%, var(--pm-border));
  border-radius: 14px;
  background: var(--pm-surface);
  color: var(--pm-text);
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  padding: 10px 12px;
  outline: none;
}
.pm-mobile-edit-input:focus {
  border-color: var(--pm-orange);
  box-shadow: 0 0 0 3px rgba(234,106,31,.14);
}
.pm-mobile-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.pm-live-trace {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.pm-live-segment {
  border-left: 3px solid rgba(148,163,184,.45);
  padding: 1px 0 1px 9px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.pm-live-segment > span {
  display: block;
  margin-bottom: 2px;
  color: var(--pm-muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.pm-live-text,
.pm-live-md {
  color: var(--pm-text);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.pm-live-segment.assistant {
  border-color: rgba(59,130,246,.42);
}
.pm-live-segment.assistant > span {
  display: none;
}
.pm-live-segment.think {
  border-color: rgba(99,102,241,.5);
}
.pm-live-segment.tool {
  border-color: rgba(234,106,31,.58);
}
.pm-live-segment.result {
  border-color: rgba(47,125,68,.52);
}
.pm-live-segment.error {
  border-color: rgba(229,74,58,.62);
}
.pm-live-md > :first-child { margin-top: 0; }
.pm-live-md > :last-child { margin-bottom: 0; }
.pm-process-stream {
  margin-top: 10px;
  border: 1px solid var(--pm-border);
  border-radius: 10px;
  background: rgba(255,255,255,.62);
  overflow: hidden;
}
.pm-process-stream summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  font-weight: 800;
  color: var(--pm-text);
}
.pm-process-stream summary::-webkit-details-marker { display: none; }
.pm-process-stream summary em {
  font-style: normal;
  color: var(--pm-muted);
  font-weight: 700;
}
.pm-process-latest {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 10px 8px;
}
.pm-process-latest b {
  display: block;
  font-size: 11px;
  line-height: 1.35;
  color: var(--pm-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-process-full {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--pm-border);
}
.pm-process-stream[open] .pm-process-full { display: flex; }
.pm-process-row {
  display: grid;
  grid-template-columns: minmax(42px, 52px) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 11px;
  min-width: 0;
  max-width: 100%;
}
.pm-process-row span {
  color: var(--pm-muted);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 9px;
  padding-top: 2px;
}
.pm-process-row p {
  margin: 0;
  line-height: 1.45;
  color: var(--pm-text-soft);
  overflow-wrap: anywhere;
}
.pm-process-row.error p { color: var(--pm-red); }
.pm-process-row.tool p { color: #0d4faf; }
.pm-process-row.result p { color: #2f7d44; }
.pm-generated-files {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
}
.pm-media-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  margin-top: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.pm-media-card {
  appearance: none;
  border: 1px solid var(--pm-border);
  border-radius: 13px;
  background: rgba(255,255,255,.76);
  color: var(--pm-text);
  padding: 0;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  position: relative;
  box-shadow: var(--pm-shadow-sm);
}
.pm-media-card img,
.pm-media-card video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #111;
}
.pm-media-card.video video { filter: saturate(.94) brightness(.9); }
.pm-media-card > span:not(.pm-media-play) {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 9px 9px;
  min-width: 0;
}
.pm-media-card strong {
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pm-media-card em {
  color: var(--pm-muted);
  font-size: 10px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pm-media-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  pointer-events: none;
}
.pm-media-play svg {
  width: 42px;
  height: 42px;
  padding: 11px;
  border-radius: 999px;
  background: rgba(0,0,0,.42);
  backdrop-filter: blur(4px);
}
.pm-generated-file {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 9px 11px;
  border: 1px solid var(--pm-border-strong);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,250,241,.78));
  color: var(--pm-text);
  text-decoration: none;
  min-width: 0;
  cursor: pointer;
  box-shadow: var(--pm-shadow-sm);
  text-align: left;
}
.pm-generated-file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--pm-orange-soft);
  color: var(--pm-orange);
}
.pm-generated-file-icon svg {
  width: 17px;
  height: 17px;
}
.pm-generated-file-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pm-generated-file strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.2;
}
.pm-generated-file em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--pm-muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}
:root[data-theme="dark"] .pm-process-stream {
  background: rgba(255,255,255,.045);
  border-color: rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
:root[data-theme="dark"] .pm-process-stream summary {
  color: var(--pm-text);
  background: rgba(255,255,255,.04);
}
:root[data-theme="dark"] .pm-process-stream summary em,
:root[data-theme="dark"] .pm-process-latest b,
:root[data-theme="dark"] .pm-process-row span {
  color: #b8afa7;
}
:root[data-theme="dark"] .pm-process-full {
  border-top-color: rgba(255,255,255,.12);
  background: rgba(0,0,0,.12);
}
:root[data-theme="dark"] .pm-process-row p {
  color: #e6ddd3;
}
:root[data-theme="dark"] .pm-process-row.error p {
  color: #ff9b91;
}
:root[data-theme="dark"] .pm-live-segment {
  border-color: rgba(255,255,255,.18);
}
:root[data-theme="dark"] .pm-live-segment.think {
  border-color: rgba(129,140,248,.56);
}
:root[data-theme="dark"] .pm-live-segment.tool {
  border-color: rgba(234,106,31,.62);
}
:root[data-theme="dark"] .pm-live-text,
:root[data-theme="dark"] .pm-live-md {
  color: #eee7df;
}
:root[data-theme="dark"] .pm-process-row.tool p {
  color: #93c5fd;
}
:root[data-theme="dark"] .pm-process-row.result p {
  color: #86efac;
}
:root[data-theme="dark"] .pm-generated-file {
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.14);
  color: var(--pm-text);
}
:root[data-theme="dark"] .pm-media-card {
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.14);
}
:root[data-theme="dark"] .pm-generated-file:hover,
:root[data-theme="dark"] .pm-generated-file:active {
  background: rgba(255,255,255,.085);
}
.pm-summary-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.pm-summary-row {
  display: flex; gap: 12px; align-items: center;
  background: var(--pm-bg-soft);
  border: 1px solid var(--pm-border);
  border-radius: 14px;
  padding: 10px 12px;
}
.pm-summary-row .pm-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--pm-orange-soft); color: var(--pm-orange);
  display: inline-flex; align-items: center; justify-content: center;
}
.pm-summary-row .pm-icon svg { width: 18px; height: 18px; }
.pm-summary-row .pm-meta { line-height: 1.2; }
.pm-summary-row .pm-meta strong { display: block; font-weight: 700; font-size: 14px; }
.pm-summary-row .pm-meta span { font-size: 12px; color: var(--pm-muted); }

.pm-numbered { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 10px; }
.pm-numbered li { display: flex; gap: 12px; align-items: flex-start; }
.pm-numbered .pm-num {
  flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--pm-orange-soft); color: var(--pm-orange);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
}
.pm-numbered strong { font-weight: 700; font-size: 14px; }
.pm-numbered span { display: block; color: var(--pm-muted); font-size: 12px; }

.pm-team-rows { margin: 6px 0 0; display: flex; flex-direction: column; gap: 8px; }
.pm-team-rows .pm-team-row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.pm-team-rows .pm-team-row .pm-team-icon { font-size: 18px; flex-shrink: 0; }
.pm-team-rows strong { display: block; font-size: 14px; }
.pm-team-rows span { font-size: 12px; color: var(--pm-muted); }
.pm-command-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.pm-media-viewer {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  background: rgba(10,10,10,.96);
  color: #fff;
  padding: max(env(safe-area-inset-top), 12px) 12px max(env(safe-area-inset-bottom), 12px);
}
.pm-media-viewer-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
}
.pm-media-viewer-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.pm-media-viewer-close,
.pm-media-viewer-save,
.pm-media-viewer-zoom button {
  appearance: none;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.1);
  color: #fff;
  border-radius: 12px;
  min-height: 38px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 800;
  text-decoration: none;
}
.pm-media-viewer-close svg,
.pm-media-viewer-save svg {
  width: 16px;
  height: 16px;
}
.pm-media-viewer-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 12px 0;
}
.pm-media-viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform .15s ease;
}
.pm-media-viewer-stage video {
  width: 100%;
  max-height: 100%;
  border-radius: 12px;
  background: #000;
}
.pm-media-viewer-stage audio {
  width: 100%;
}
.pm-media-viewer-zoom {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 4px;
}
.pm-media-viewer-zoom button {
  min-width: 52px;
  font-size: 15px;
}
.pm-command-action {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--pm-border);
  border-radius: 12px;
  background: var(--pm-bg-soft);
  color: var(--pm-text);
  padding: 9px 11px;
  font: inherit;
  text-align: left;
}
.pm-command-action span {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pm-orange);
  flex-shrink: 0;
}
.pm-command-action span svg { width: 17px; height: 17px; }
.pm-command-action strong {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 850;
}
.pm-command-action.danger {
  border-color: rgba(216,71,58,.28);
  background: rgba(216,71,58,.08);
}
.pm-command-action.danger span { color: var(--pm-red); }
.pm-command-action:disabled {
  opacity: .58;
  pointer-events: none;
}

/* composer */
.pm-composer {
  position: absolute;
  left: 10px; right: 10px;
  bottom: calc(var(--pm-tabbar-h) + env(safe-area-inset-bottom) + 8px);
  background: var(--pm-surface-strong);
  border: 1px solid var(--pm-border);
  border-radius: 22px;
  padding: 8px 10px 10px;
  box-shadow: var(--pm-shadow-md);
  z-index: 4;
}
.pm-mobile-queued-prompts {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(var(--pm-tabbar-h) + env(safe-area-inset-bottom) + 82px);
  z-index: 4;
  max-height: min(34vh, 220px);
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(234,106,31,.22);
  border-radius: 18px;
  background: color-mix(in srgb, var(--pm-surface-strong) 94%, var(--pm-orange-soft));
  box-shadow: var(--pm-shadow-md);
}
.pm-mobile-queued-prompts[hidden] { display: none; }
.pm-mobile-queued-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--pm-orange);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pm-mobile-queued-head b {
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--pm-orange-soft);
  color: var(--pm-orange-dark);
}
.pm-mobile-queued-list { display: flex; flex-direction: column; gap: 7px; }
.pm-mobile-queued-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid var(--pm-border);
  border-radius: 13px;
  background: var(--pm-surface);
}
.pm-mobile-queued-item span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 700;
  color: var(--pm-text);
}
.pm-mobile-queued-item em { color: var(--pm-muted); font-style: normal; font-weight: 800; }
.pm-mobile-queued-item button {
  border: 1px solid rgba(216,71,58,.18);
  border-radius: 999px;
  background: rgba(216,71,58,.08);
  color: var(--pm-red);
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  padding: 5px 8px;
}
.pm-composer-row { display: flex; align-items: center; gap: 8px; }
.pm-chat-slash-popover {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(100% + 8px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: var(--pm-surface-strong);
  border: 1px solid var(--pm-border);
  border-radius: 16px;
  box-shadow: var(--pm-shadow-md);
  z-index: 8;
}
.pm-chat-slash-popover[hidden] { display: none; }
.pm-chat-slash-item {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--pm-text);
  padding: 8px 10px;
  text-align: left;
  font: inherit;
}
.pm-chat-slash-item.active,
.pm-chat-slash-item:active {
  background: var(--pm-orange-soft);
  border-color: rgba(234,106,31,.22);
}
.pm-chat-slash-token {
  font-size: 12px;
  font-weight: 900;
  color: var(--pm-orange);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.pm-chat-slash-label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 750;
}
.pm-chat-slash-hint {
  font-size: 11px;
  font-weight: 800;
  color: var(--pm-muted);
}
.pm-command-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin: 0 2px 8px;
  padding: 6px 10px;
  border: 1px solid rgba(234,106,31,.22);
  border-radius: 999px;
  background: var(--pm-orange-soft);
  color: var(--pm-orange);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}
.pm-command-chip[hidden] { display: none; }
.pm-command-chip-token {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.pm-command-chip-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(234,106,31,.14);
  line-height: 1;
}
.pm-attach-tray {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding: 2px 2px 8px;
}
.pm-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}
.pm-attach-tray .pm-attach-list { margin-top: 0; }
.pm-attach-chip {
  position: relative;
  min-width: 0;
  max-width: min(100%, 260px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--pm-border);
  border-radius: 12px;
  background: var(--pm-bg-soft);
}
.pm-attach-chip.image img {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
}
.pm-attach-file {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pm-orange-soft);
  color: var(--pm-orange);
  flex-shrink: 0;
}
.pm-attach-file svg { width: 17px; height: 17px; }
.pm-attach-chip span { min-width: 0; }
.pm-attach-chip strong,
.pm-attach-chip em {
  display: block;
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-attach-chip strong { font-size: 12px; font-weight: 800; }
.pm-attach-chip em { font-size: 11px; color: var(--pm-muted); font-style: normal; }
.pm-attach-remove {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--pm-border);
  background: #fff;
  color: var(--pm-red);
  font-weight: 900;
  line-height: 1;
}
.pm-composer-input {
  flex: 1;
  border: none; background: transparent; outline: none;
  font-size: 15px; padding: 8px 6px;
  color: var(--pm-text);
  font-family: inherit;
}
.pm-composer .pm-send {
  width: 44px; height: 44px; border-radius: 14px;
  position: relative;
  overflow: hidden;
  background:
    conic-gradient(
      from var(--pm-angle, 0deg),
      #ff7a18,
      #f97316,
      #ea580c,
      #fb923c,
      #ff7a18
    );
  border: none; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow:
    0 12px 26px rgba(249,115,22,0.34),
    inset 0 1px 0 rgba(255,255,255,0.28);
  animation: prometheus-liquid-spin 9s linear infinite;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.pm-composer .pm-send::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.36), rgba(255,255,255,0) 34%),
    radial-gradient(circle at 32% 18%, rgba(255,255,255,.48), transparent 34%);
  pointer-events: none;
  mix-blend-mode: screen;
}
.pm-composer .pm-send::after {
  content: '';
  position: absolute;
  inset: -44%;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.34) 48%, transparent 58%);
  transform: translateX(-42%) rotate(8deg);
  animation: pm-send-shine 3.8s ease-in-out infinite;
  pointer-events: none;
}
.pm-composer .pm-send svg {
  position: relative;
  z-index: 1;
  width: 15px;
  height: 15px;
  filter: drop-shadow(0 1px 1px rgba(123,45,5,.24));
}
.pm-composer .pm-send.is-abort {
  background: linear-gradient(135deg, #d8473a, #a52119);
  box-shadow:
    0 12px 26px rgba(216,71,58,0.28),
    inset 0 1px 0 rgba(255,255,255,0.24);
  animation: none;
}
.pm-composer .pm-send.is-abort::after { display: none; }
.pm-composer .pm-send.is-abort svg {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 1px 1px rgba(80,12,8,.28));
}
.pm-composer .pm-send:hover,
.pm-composer .pm-send:active {
  transform: translateY(-1px) scale(1.025);
  box-shadow:
    0 16px 32px rgba(249,115,22,0.42),
    0 0 26px rgba(249,115,22,0.24),
    inset 0 1px 0 rgba(255,255,255,0.32);
}
.pm-composer .pm-send:disabled { opacity: .55; transform: none; filter: saturate(.82); }
@keyframes prometheus-liquid-spin { to { --pm-angle: 360deg; } }
@keyframes pm-send-shine {
  0%, 46% { transform: translateX(-58%) rotate(8deg); opacity: 0; }
  58% { opacity: .85; }
  78%, 100% { transform: translateX(58%) rotate(8deg); opacity: 0; }
}
.pm-composer-meta { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 0; }
.pm-composer-meta .pm-model { font-size: 12px; color: var(--pm-muted); font-weight: 600; }
.pm-composer-meta .pm-context-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--pm-blue);
  background: rgba(74,130,209,.10);
  padding: 5px 12px; border-radius: var(--pm-radius-pill);
  border: 1px solid rgba(74,130,209,.18);
  cursor: pointer;
}
.pm-body.pm-chat-body { padding-bottom: calc(var(--pm-tabbar-h) + env(safe-area-inset-bottom) + 170px); }

/* ---------- voice ---------- */
.pm-voice-stage {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 4px 8px;
  text-align: center;
}
.pm-voice-preview-host {
  position: absolute;
  left: 50%;
  top: clamp(42px, 7vh, 72px);
  transform: translateX(-50%);
  width: min(92vw, 380px);
  min-height: 0;
  margin: 0;
  pointer-events: none;
  z-index: 125;
}
.pm-voice-preview-host.has-preview {
  min-height: 0;
}
.pm-voice-preview-card {
  position: relative;
  z-index: 3;
  width: 100%;
  text-align: left;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  will-change: transform, opacity;
  animation: pm-voice-preview-pop .28s cubic-bezier(.2,1.3,.32,1) both;
}
.pm-voice-preview-card.dragging {
  cursor: grabbing;
  animation: none;
}
.pm-voice-preview-card.leaving {
  animation: pm-voice-preview-fade .26s ease-in both;
  pointer-events: none;
}
.pm-voice-preview-card [data-pm-media] {
  touch-action: none;
}
.pm-voice-preview-card .pm-media-gallery {
  margin-top: 0;
}
.pm-voice-preview-card .pm-media-card,
.pm-voice-preview-card .pm-generated-file {
  background: color-mix(in srgb, var(--pm-surface-strong) 94%, transparent);
  border-color: color-mix(in srgb, var(--pm-orange) 32%, var(--pm-border));
  box-shadow: 0 16px 36px rgba(20, 15, 10, .18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.pm-voice-preview-card .pm-media-card img,
.pm-voice-preview-card .pm-media-card video {
  aspect-ratio: 16 / 9;
}
.pm-voice-preview-label {
  display: inline-flex;
  margin: 0 0 6px 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(34,26,20,.7);
  color: #fffaf1;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  box-shadow: var(--pm-shadow-sm);
}
.pm-voice-preview-ghost {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 8px;
  height: 116px;
  border: 1px solid color-mix(in srgb, var(--pm-orange) 24%, var(--pm-border));
  border-radius: 13px;
  background: color-mix(in srgb, var(--pm-surface-strong) 76%, transparent);
  box-shadow: 0 12px 28px rgba(20, 15, 10, .12);
  transform: translateY(14px) scale(.94);
  opacity: .72;
  z-index: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--pm-muted);
}
.pm-voice-preview-ghost img,
.pm-voice-preview-ghost video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.82) brightness(.92);
}
.pm-voice-preview-ghost strong {
  min-width: 0;
  max-width: 72%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.pm-voice-preview-ghost.ghost-2 {
  left: 28px;
  right: 28px;
  transform: translateY(26px) scale(.88);
  opacity: .42;
  z-index: 0;
}
:root[data-theme="dark"] .pm-voice-preview-card .pm-media-card,
:root[data-theme="dark"] .pm-voice-preview-card .pm-generated-file {
  background: rgba(37,41,49,.9);
  border-color: rgba(234,106,31,.34);
  box-shadow: 0 18px 42px rgba(0,0,0,.42);
}
:root[data-theme="dark"] .pm-voice-preview-ghost {
  background: rgba(37,41,49,.68);
  border-color: rgba(234,106,31,.24);
}
@keyframes pm-voice-preview-pop {
  0% { opacity: 0; transform: translateY(18px) scale(.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pm-voice-preview-fade {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-12px) scale(.98); }
}
.pm-voice-orb {
  position: relative;
  width: min(78vw, 320px); aspect-ratio: 1;
  filter: drop-shadow(0 24px 60px rgba(234,106,31,.32));
  animation: pm-orb-breathe 4.2s ease-in-out infinite;
}
.pm-voice-orb .pm-orb-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.pm-voice-orb .pm-sparkles circle { animation: pm-sparkle 2.8s ease-in-out infinite; transform-origin: center; }
.pm-voice-orb .pm-sparkles circle:nth-child(2) { animation-delay: .4s; }
.pm-voice-orb .pm-sparkles circle:nth-child(3) { animation-delay: .9s; }
.pm-voice-orb .pm-sparkles circle:nth-child(4) { animation-delay: 1.3s; }
.pm-voice-orb .pm-sparkles circle:nth-child(5) { animation-delay: 1.8s; }
.pm-voice-orb .pm-sparkles circle:nth-child(6) { animation-delay: 2.1s; }
.pm-voice-orb .pm-sparkles circle:nth-child(7) { animation-delay: 2.4s; }
.pm-voice-orb .pm-sparkles circle:nth-child(8) { animation-delay: 2.7s; }
.pm-voice-orb .pm-wave { animation: pm-wave-shift 3.4s ease-in-out infinite; }
.pm-voice-orb .pm-wave-bright { animation: pm-wave-shift 3.4s ease-in-out infinite reverse; }
.pm-voice-orb .pm-wave-halo  { animation: pm-wave-pulse 2.2s ease-in-out infinite; }
@keyframes pm-orb-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.025); }
}
@keyframes pm-wave-shift {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-6px); }
}
@keyframes pm-wave-pulse {
  0%, 100% { opacity: .35; }
  50%      { opacity: .75; }
}
@keyframes pm-sparkle {
  0%, 100% { opacity: 0; transform: scale(.6); }
  50%      { opacity: 1; transform: scale(1.4); }
}
.pm-voice-status { margin-top: 22px; font-size: 18px; font-weight: 700; color: var(--pm-text); }
.pm-voice-hint { margin-top: 4px; font-size: 13px; color: var(--pm-muted); }
.pm-voice-mic {
  margin: 22px auto 4px;
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--pm-orange);
  color: #fff; border: none;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 30px rgba(234,106,31,.4);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  overscroll-behavior: contain;
}
.pm-voice-mic svg { width: 36px; height: 36px; }
.pm-voice-mic.pressed { transform: scale(.96); }
.pm-voice-mic.recording { background: var(--pm-red); box-shadow: 0 14px 30px rgba(216,71,58,.4); animation: pm-mic-pulse .9s ease-in-out infinite; }
@keyframes pm-mic-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* Voice orb dynamic states */
.pm-voice-orb.listening   { animation: pm-orb-breathe 1.4s ease-in-out infinite; filter: drop-shadow(0 24px 60px rgba(216,71,58,.45)) hue-rotate(-10deg) saturate(1.4); }
.pm-voice-orb.listening .pm-wave-main,
.pm-voice-orb.listening .pm-wave-bright { animation-duration: 1s; }
.pm-voice-orb.thinking    { animation: pm-orb-breathe 2.6s ease-in-out infinite; filter: drop-shadow(0 24px 60px rgba(125,107,214,.35)); }
.pm-voice-orb.speaking    { animation: pm-orb-breathe 1.6s ease-in-out infinite; filter: drop-shadow(0 24px 70px rgba(234,106,31,.6)) saturate(1.3) brightness(1.05); }
.pm-voice-orb.speaking .pm-wave-main,
.pm-voice-orb.speaking .pm-wave-bright { animation-duration: 1.2s; }
.pm-voice-orb.confirmed   { animation: pm-orb-breathe 1.8s ease-in-out infinite; filter: drop-shadow(0 24px 64px rgba(56,189,248,.42)) hue-rotate(145deg) saturate(1.25) brightness(1.04); }
.pm-voice-orb.confirmed .pm-wave-main,
.pm-voice-orb.confirmed .pm-wave-bright { animation-duration: 1.4s; }

/* Recent commands: tool-label flip animation */
@keyframes pm-flip-out {
  0%   { transform: rotateX(0deg);  opacity: 1; }
  100% { transform: rotateX(-90deg); opacity: 0; }
}
@keyframes pm-flip-in {
  0%   { transform: rotateX(90deg);  opacity: 0; }
  100% { transform: rotateX(0deg);   opacity: 1; }
}
.pm-flip-tool { display: inline-block; transform-origin: center top; backface-visibility: hidden; }
.pm-flip-tool.pm-flipping { animation: pm-flip-out 110ms ease-in forwards, pm-flip-in 180ms 110ms ease-out forwards; }
@keyframes pm-spin { to { transform: rotate(360deg); } }
.pm-mini-spin { display: inline-block; }


.pm-recent { margin-top: 24px; }
.pm-recent-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pm-recent-head h3 { font-size: 16px; font-weight: 700; margin: 0; }
.pm-recent-head a { color: var(--pm-orange); font-size: 13px; font-weight: 700; text-decoration: none; }
.pm-recent-list { display: flex; flex-direction: column; gap: 6px; }
.pm-recent-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-md);
}
.pm-recent-item .pm-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--pm-orange-soft); color: var(--pm-orange);
  display: inline-flex; align-items: center; justify-content: center;
}
.pm-recent-item .pm-icon svg { width: 18px; height: 18px; }
.pm-recent-item .pm-meta { flex: 1; line-height: 1.2; }
.pm-recent-item .pm-meta strong { font-size: 14px; font-weight: 700; display: block; }
.pm-recent-item .pm-meta span { font-size: 12px; color: var(--pm-muted); }

/* ---------- schedule cards ---------- */
.pm-schedule-card {
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-left: 4px solid var(--pm-orange);
  border-radius: var(--pm-radius-lg);
  padding: 16px 18px;
  margin: 12px 0;
  box-shadow: var(--pm-shadow-sm);
}
.pm-schedule-card.color-purple { border-left-color: var(--pm-purple); }
.pm-schedule-card.color-green  { border-left-color: var(--pm-green); }
.pm-schedule-card.color-blue   { border-left-color: var(--pm-blue); }
.pm-schedule-head { display: flex; gap: 10px; align-items: flex-start; }
.pm-schedule-head .pm-emoji { font-size: 22px; line-height: 1; }
.pm-schedule-head h3 { flex: 1; margin: 0; font-size: 16px; font-weight: 700; line-height: 1.25; }
.pm-toggle {
  width: 46px; height: 28px; border-radius: 999px;
  background: #d8cfbf; position: relative;
  border: none; cursor: pointer; flex-shrink: 0;
  transition: background .15s ease;
}
.pm-toggle::after {
  content: '';
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff;
  position: absolute; top: 3px; left: 3px;
  transition: transform .18s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.pm-toggle.on { background: var(--pm-green); }
.pm-toggle.on::after { transform: translateX(18px); }
.pm-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: var(--pm-radius-pill);
  text-transform: lowercase;
  letter-spacing: .2px;
}
.pm-pill.active   { background: rgba(47,174,102,.14); color: var(--pm-green); }
.pm-pill.running  { background: rgba(125,107,214,.14); color: var(--pm-purple); }
.pm-pill.builtin  { background: rgba(125,107,214,.12); color: var(--pm-purple); }
.pm-pill.gray     { background: rgba(80,60,40,.08); color: var(--pm-text-soft); }
.pm-pill.orange   { background: var(--pm-orange-soft); color: var(--pm-orange); }
.pm-tag-row { display: flex; gap: 6px; align-items: center; margin: 4px 0 6px; flex-wrap: wrap; }
.pm-schedule-desc { font-size: 13px; color: var(--pm-text-soft); margin: 4px 0 12px; line-height: 1.4; }
.pm-kv-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 13px;
  margin-bottom: 10px;
}
.pm-kv-grid .pm-kv { display: flex; align-items: center; gap: 6px; color: var(--pm-text-soft); }
.pm-kv-grid .pm-kv svg { width: 14px; height: 14px; opacity: .7; }
.pm-kv-grid .pm-kv b { font-weight: 700; color: var(--pm-text); }
.pm-schedule-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--pm-border);
  font-size: 13px; color: var(--pm-text-soft);
}
.pm-assign-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--pm-orange-soft); color: var(--pm-orange);
  font-size: 11px; font-weight: 700;
  padding: 5px 10px; border-radius: var(--pm-radius-pill);
  max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pm-run-btn {
  background: transparent; color: var(--pm-orange);
  border: 1px solid rgba(234,106,31,.4);
  padding: 7px 14px; border-radius: var(--pm-radius-pill);
  font-weight: 700; font-size: 13px; cursor: pointer;
}
.pm-run-btn:active { background: var(--pm-orange-soft); }

/* ---------- teams overview ---------- */
.pm-team-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin: 8px 0 16px;
}
.pm-team-tile {
  background: var(--pm-surface); border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-lg);
  padding: 16px 14px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; text-align: center; position: relative;
  box-shadow: var(--pm-shadow-sm);
}
.pm-team-tile.featured { border-color: var(--pm-orange); box-shadow: 0 0 0 2px rgba(234,106,31,.22), var(--pm-shadow-md); }
.pm-team-tile .pm-star {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--pm-orange); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.pm-team-tile .pm-house { font-size: 56px; line-height: 1; }
.pm-team-tile .pm-team-name { font-size: 13px; font-weight: 700; line-height: 1.25; }
.pm-team-tile .pm-team-agents {
  font-size: 12px; color: var(--pm-muted); display: inline-flex; align-items: center; gap: 4px;
}

.pm-team-preview {
  background: var(--pm-surface); border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-lg);
  padding: 14px 16px;
  margin: 8px 0;
  box-shadow: var(--pm-shadow-sm);
}
.pm-team-preview-head { display: flex; align-items: center; gap: 12px; }
.pm-team-preview-head .pm-mini-house {
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(74,130,209,.16); display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.pm-team-preview-head h3 { flex: 1; font-size: 14px; font-weight: 700; margin: 0; line-height: 1.25; }
.pm-pill-btn {
  background: transparent; color: var(--pm-orange);
  border: 1px solid rgba(234,106,31,.4);
  padding: 6px 14px; border-radius: var(--pm-radius-pill);
  font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer;
}
.pm-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.pm-member-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--pm-bg-soft);
  border: 1px solid var(--pm-border);
  padding: 5px 10px 5px 5px;
  border-radius: var(--pm-radius-pill);
  font-size: 12px; font-weight: 600;
}
.pm-member-chip .pm-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff;
}
.pm-team-preview .pm-divider { height: 1px; background: var(--pm-border); margin: 10px -4px; }
.pm-team-preview .pm-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; font-size: 13px;
}
.pm-team-preview .pm-row strong { font-weight: 700; }
.pm-progress {
  height: 8px; border-radius: 999px;
  background: rgba(80,60,40,.10);
  overflow: hidden; margin: 6px 0;
}
.pm-progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--pm-orange), #f08a4d);
  border-radius: 999px;
}

/* ---------- team detail ---------- */
.pm-detail-back { padding: 4px 6px; }
.pm-detail-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 0 6px;
}
.pm-detail-head .pm-house-icon { font-size: 30px; line-height: 1; }
.pm-detail-head h1 {
  flex: 1; margin: 0;
  font-size: 22px; font-weight: 800; line-height: 1.2; letter-spacing: -.3px;
}
.pm-detail-head .pm-overflow { color: var(--pm-text-soft); }
.pm-detail-sub { padding: 4px 6px 12px; color: var(--pm-muted); font-size: 13px; font-weight: 600; }

.pm-action-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; padding: 0 2px 10px;
}
.pm-action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 5px;
  border-radius: var(--pm-radius-md);
  padding: 11px 8px;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--pm-border);
  background: var(--pm-surface);
  color: var(--pm-text);
}
.pm-action-btn svg { width: 14px; height: 14px; }
.pm-action-btn.primary { background: var(--pm-orange); color: #fff; border-color: var(--pm-orange); }
.pm-action-btn.danger { color: var(--pm-red); border-color: rgba(216,71,58,.35); }

.pm-tabs {
  display: flex; gap: 18px;
  border-bottom: 1px solid var(--pm-border);
  margin: 4px 2px 14px;
  overflow-x: auto;
  -ms-overflow-style: none; scrollbar-width: none;
}
.pm-tabs::-webkit-scrollbar { display: none; }
.pm-tabs button {
  appearance: none; background: transparent; border: none;
  font-family: inherit; font-size: 14px; font-weight: 700;
  color: var(--pm-muted);
  padding: 10px 0; flex-shrink: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.pm-tabs button.active { color: var(--pm-orange); border-bottom-color: var(--pm-orange); }

.pm-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.pm-card .pm-card-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--pm-orange); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.pm-card .pm-card-head svg { width: 14px; height: 14px; }
.pm-card .pm-card-body { font-size: 14px; line-height: 1.45; color: var(--pm-text-soft); }
.pm-card .pm-card-body.strong { color: var(--pm-text); font-weight: 600; }

.pm-show-more { display: inline-flex; align-items: center; gap: 4px; color: var(--pm-orange); font-size: 13px; font-weight: 700; background: none; border: none; cursor: pointer; }

.pm-input, .pm-textarea {
  width: 100%; box-sizing: border-box;
  background: var(--pm-bg-soft);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-md);
  padding: 12px 14px;
  font-size: 14px; font-family: inherit;
  color: var(--pm-text);
  outline: none;
  margin-bottom: 8px;
}
.pm-textarea { min-height: 90px; resize: vertical; }
.pm-input:focus, .pm-textarea:focus { border-color: var(--pm-orange); }

.pm-row-buttons { display: flex; gap: 8px; }
.pm-btn {
  appearance: none; cursor: pointer;
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  padding: 10px 16px;
  border-radius: var(--pm-radius-md);
  font-family: inherit; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--pm-text);
}
.pm-btn.primary { background: var(--pm-orange); color: #fff; border-color: var(--pm-orange); flex: 1; justify-content: center; }
.pm-btn.ghost { background: transparent; }

/* ---------- settings ---------- */
.pm-settings-body { padding-top: 0; }
.pm-settings-topnav {
  display: flex;
  align-items: center;
  margin: 0 0 6px;
}
.pm-settings-section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 10px 0 18px;
}
.pm-settings-section {
  appearance: none;
  border: 1px solid var(--pm-border);
  background: var(--pm-surface);
  color: var(--pm-text);
  border-radius: var(--pm-radius-lg);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 2px 12px;
  align-items: center;
  text-align: left;
  box-shadow: var(--pm-shadow-sm);
}
.pm-settings-section.active,
.pm-settings-section:active {
  border-color: rgba(234,106,31,.34);
  background: var(--pm-orange-soft);
}
.pm-settings-section > span {
  grid-row: span 2;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--pm-orange-soft);
  color: var(--pm-orange);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pm-settings-section > span svg { width: 20px; height: 20px; }
.pm-settings-section strong {
  font-size: 15px;
  font-weight: 800;
}
.pm-settings-section em {
  font-size: 12px;
  line-height: 1.35;
  color: var(--pm-muted);
  font-style: normal;
}
.pm-settings-card .pm-row-buttons {
  margin-top: 10px;
  flex-wrap: wrap;
}
.pm-settings-field {
  display: block;
  margin: 0 0 10px;
}
.pm-settings-field > span {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--pm-text-soft);
  margin: 0 0 5px;
}
.pm-settings-field > em {
  display: block;
  color: var(--pm-muted);
  font-size: 11px;
  line-height: 1.35;
  font-style: normal;
  margin-top: -3px;
}
.pm-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--pm-muted) 50%), linear-gradient(135deg, var(--pm-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 12px) 52%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.pm-settings-kv {
  display: grid;
  grid-template-columns: minmax(90px, .8fr) minmax(0, 1.2fr);
  gap: 8px 12px;
  font-size: 13px;
}
.pm-settings-kv span {
  color: var(--pm-muted);
  font-weight: 700;
}
.pm-settings-kv strong {
  min-width: 0;
  color: var(--pm-text);
  overflow-wrap: anywhere;
}
.pm-settings-status {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--pm-muted);
}
.pm-settings-status.ok { color: var(--pm-green); }
.pm-settings-status.warn { color: var(--pm-orange-dark); }
.pm-settings-status.error { color: var(--pm-red); }
.pm-settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--pm-border);
  margin-bottom: 10px;
}
.pm-settings-toggle-row strong {
  display: block;
  font-size: 14px;
}
.pm-settings-toggle-row span {
  display: block;
  color: var(--pm-muted);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 2px;
}
.pm-settings-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.pm-settings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pm-settings-row,
.pm-settings-choice,
.pm-settings-channel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--pm-border);
  background: var(--pm-bg-soft);
  border-radius: var(--pm-radius-md);
  padding: 10px 12px;
}
.pm-settings-row-button {
  width: 100%;
  font-family: inherit;
  color: var(--pm-text);
  cursor: pointer;
  text-align: left;
}
.pm-settings-row-button.active {
  border-color: rgba(234,106,31,.34);
  background: var(--pm-orange-soft);
}
.pm-settings-choice {
  justify-content: flex-start;
}
.pm-settings-row span,
.pm-settings-choice span,
.pm-settings-channel div {
  min-width: 0;
  flex: 1;
}
.pm-settings-row strong,
.pm-settings-choice strong,
.pm-settings-channel strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
}
.pm-settings-row em,
.pm-settings-choice em,
.pm-settings-channel span,
.pm-settings-channel em {
  display: block;
  color: var(--pm-muted);
  font-size: 11px;
  line-height: 1.35;
  font-style: normal;
  overflow-wrap: anywhere;
}
.pm-settings-channel {
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.pm-settings-channel .pm-pill {
  flex-shrink: 0;
}
.pm-settings-channel > em {
  flex-basis: 100%;
  padding-left: 2px;
}
.pm-settings-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  font-size: 11px;
  line-height: 1.45;
  color: var(--pm-text-soft);
}
.pm-settings-log > div {
  border: 1px solid var(--pm-border);
  background: var(--pm-bg-soft);
  border-radius: 10px;
  padding: 8px 9px;
  overflow-wrap: anywhere;
}
.pm-settings-log em {
  color: var(--pm-muted);
  font-style: normal;
}
.pm-settings-callout {
  border: 1px solid rgba(74,130,209,.22);
  background: rgba(74,130,209,.10);
  color: #1e4f91;
  border-radius: var(--pm-radius-md);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  margin: 8px 0 12px;
}

/* ---------- placeholder ---------- */
.pm-empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--pm-muted);
}
.pm-empty .pm-empty-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--pm-orange-soft); color: var(--pm-orange);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.pm-empty .pm-empty-icon svg { width: 32px; height: 32px; }
.pm-empty h2 { color: var(--pm-text); font-size: 20px; margin: 0 0 6px; }
.pm-empty p { font-size: 14px; line-height: 1.5; margin: 0; }

/* ── Mobile Canvas Sheet ─────────────────────────────────────────── */
.pm-canvas-sheet {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
}
.pm-canvas-sheet.open { pointer-events: all; }

.pm-canvas-sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.pm-canvas-sheet.open .pm-canvas-sheet-scrim { opacity: 1; }

.pm-canvas-sheet-panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 88vh;
  background: var(--pm-bg);
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -6px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
.pm-canvas-sheet.open .pm-canvas-sheet-panel { transform: translateY(0); }

.pm-canvas-sheet-handle-bar {
  width: 38px; height: 4px;
  background: var(--pm-border);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
  cursor: grab;
  touch-action: none;
}

.pm-canvas-sheet-header {
  display: flex;
  align-items: flex-end;
  padding: 6px 10px 0 14px;
  gap: 6px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--pm-border);
}
.pm-canvas-sheet-tabs {
  display: flex;
  flex: 1;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: flex-end;
}
.pm-canvas-sheet-tabs::-webkit-scrollbar { display: none; }
.pm-canvas-sheet-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px 9px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: 12px; font-weight: 600;
  color: var(--pm-muted);
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  max-width: 160px;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.pm-canvas-sheet-tab.active {
  color: var(--pm-orange);
  border-bottom-color: var(--pm-orange);
}
.pm-canvas-sheet-tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}
.pm-canvas-sheet-tab-close {
  opacity: 0.45;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.pm-canvas-sheet-tab-close:hover { opacity: 1; }
.pm-canvas-sheet-close-btn {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border: none;
  background: var(--pm-bg-soft);
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pm-text);
  font-family: inherit;
  margin-bottom: 10px;
}

.pm-canvas-sheet-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--pm-border);
  flex-shrink: 0;
  min-height: 40px;
}
.pm-canvas-sheet-file-name {
  flex: 1;
  font-size: 12px; font-weight: 600;
  color: var(--pm-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pm-canvas-sheet-save-btn {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 7px;
  border: 1px solid var(--pm-border);
  background: transparent;
  font-size: 12px; font-weight: 600;
  color: var(--pm-text);
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pm-canvas-sheet-save-btn svg { width: 13px; height: 13px; flex-shrink: 0; }

.pm-canvas-sheet-body {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pm-bg-soft);
}
.pm-canvas-sheet-body img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  display: block;
}
.pm-canvas-sheet-body video {
  max-width: 100%; max-height: 100%;
  display: block;
}
.pm-canvas-sheet-body audio {
  width: calc(100% - 32px);
  margin: 20px 16px;
  display: block;
}
.pm-canvas-sheet-body iframe {
  width: 100%; height: 100%;
  border: none;
  background: #fff;
  display: block;
}
.pm-canvas-sheet-empty {
  color: var(--pm-muted);
  font-size: 14px;
  text-align: center;
  padding: 40px 20px;
}

:root[data-theme="dark"] .pm-canvas-sheet-panel {
  box-shadow: 0 -6px 40px rgba(0, 0, 0, 0.55);
}
:root[data-theme="dark"] .pm-canvas-sheet-body {
  background: var(--pm-bg);
}
:root[data-theme="dark"] .pm-canvas-sheet-body iframe {
  background: #1a1a1a;
}

/* ── Voice page approval card ─────────────────────────────────────── */
.pm-voice-approval {
  --va-accent: var(--pm-orange);
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%) translateY(18px);
  width: min(92vw, 400px);
  max-height: min(46vh, 360px);
  overflow: auto;
  background: var(--pm-bg);
  border: 1.5px solid var(--va-accent);
  border-radius: 18px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22), 0 0 0 4px color-mix(in srgb, var(--va-accent) 12%, transparent);
  padding: 16px;
  z-index: 120;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
}
.pm-voice-approval.pm-va-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}
.pm-voice-approval.pm-va-running {
  border-color: color-mix(in srgb, var(--va-accent) 72%, var(--pm-border));
}
.pm-voice-approval.pm-va-success {
  border-color: #2fae66;
  box-shadow: 0 8px 40px rgba(47,174,102,0.22), 0 0 0 4px rgba(47,174,102,0.14);
}
.pm-voice-approval.pm-va-failed {
  border-color: #d8473a;
  box-shadow: 0 8px 40px rgba(216,71,58,0.24), 0 0 0 4px rgba(216,71,58,0.14);
}
.pm-voice-stage { position: relative; }

.pm-va-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}
.pm-va-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.pm-va-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--pm-text);
  flex: 1;
}
.pm-va-risk {
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.pm-va-tool {
  font-size: 15px;
  font-weight: 700;
  color: var(--va-accent);
  margin-bottom: 4px;
  text-transform: capitalize;
}
.pm-va-action {
  font-size: 13px;
  color: var(--pm-text);
  line-height: 1.45;
  margin-bottom: 8px;
}
.pm-va-detail {
  font-size: 12px;
  line-height: 1.35;
  color: var(--pm-muted);
  margin: -2px 0 8px;
}
.pm-va-technical {
  margin: 8px 0 12px;
  border-top: 1px solid var(--pm-border);
  padding-top: 7px;
}
.pm-va-technical summary {
  cursor: pointer;
  color: var(--pm-muted);
  font-size: 12px;
  font-weight: 800;
}
.pm-va-args {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  background: var(--pm-bg-soft);
  border: 1px solid var(--pm-border);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0 0 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--pm-text);
  max-height: 80px;
  overflow-y: auto;
}
.pm-va-terminal-host {
  margin: 10px 0 12px;
}
.pm-va-terminal-host .pm-process-card {
  box-shadow: none;
  border-radius: 12px;
}
.pm-approval-detail {
  display: inline-flex;
  max-width: 100%;
  border: 1px solid var(--pm-border);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--pm-muted);
  background: var(--pm-bg-soft);
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 8px;
}
.pm-approval-technical {
  margin: 8px 0 10px;
  border-top: 1px solid var(--pm-border);
  padding-top: 8px;
}
.pm-approval-technical summary {
  color: var(--pm-muted);
  font-size: 12px;
  font-weight: 800;
}
.pm-approval-technical pre {
  max-height: 140px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 8px 0 0;
  border: 1px solid var(--pm-border);
  border-radius: 10px;
  padding: 9px;
  background: var(--pm-bg-soft);
  color: var(--pm-text-soft);
  font: 11px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.pm-chat-approvals-inline {
  display: grid;
  gap: 8px;
  margin: 10px 0 2px;
}
.pm-chat-approval {
  border: 1px solid color-mix(in srgb, var(--pm-accent) 46%, var(--pm-border));
  background: color-mix(in srgb, var(--pm-accent) 7%, var(--pm-card));
  border-radius: 14px;
  padding: 12px;
  color: var(--pm-text);
  box-shadow: 0 10px 24px rgba(28, 20, 12, .08);
}
.pm-chat-approval.compact {
  box-shadow: none;
  margin-top: 4px;
}
.pm-chat-approval-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--pm-muted);
}
.pm-chat-approval-status {
  border-radius: 999px;
  padding: 3px 8px;
  background: #f1e1c4;
  color: #7b5520;
}
.pm-chat-approval-status.approved {
  background: #d9f1df;
  color: #1f7a3d;
}
.pm-chat-approval-status.denied,
.pm-chat-approval-status.rejected,
.pm-chat-approval-status.failed,
.pm-chat-approval-status.expired {
  background: #f6dddc;
  color: #a2342f;
}
.pm-chat-approval strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}
.pm-chat-approval p {
  margin: 6px 0 0;
  color: var(--pm-text-soft);
  font-size: 13px;
  line-height: 1.45;
}
.pm-chat-approval em,
.pm-chat-approval small {
  display: inline-flex;
  margin-top: 8px;
  color: var(--pm-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}
.pm-chat-approval small {
  margin-left: 8px;
}
.pm-chat-approval-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.pm-chat-approval-btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 10px;
  font-size: 14px;
  font-weight: 900;
}
.pm-chat-approval-btn.approve {
  background: var(--pm-green, #2fae66);
  color: #fff;
}
.pm-chat-approval-btn.reject {
  background: var(--pm-bg-soft);
  color: var(--pm-text);
  border: 1px solid var(--pm-border);
}
.pm-chat-approval-btn.session,
.pm-chat-approval-btn.always {
  background: var(--pm-surface);
  color: var(--pm-text);
  border: 1px solid var(--pm-border);
}
.pm-chat-approval-done {
  margin-top: 10px;
  color: var(--pm-muted);
  font-size: 12px;
  font-weight: 800;
}
.pm-process-approval-link {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.pm-process-approval-link > button {
  width: 100%;
  border: 1px solid var(--pm-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--pm-surface);
  color: var(--pm-text);
  font-size: 13px;
  font-weight: 900;
}
.pm-process-loading {
  border: 1px dashed var(--pm-border);
  border-radius: 12px;
  padding: 10px;
  color: var(--pm-muted);
  background: var(--pm-bg-soft);
  font-size: 12px;
  font-weight: 800;
}
.pm-process-loading.error {
  color: #a2342f;
  background: #fff0ef;
}
.pm-process-card {
  --pm-process-terminal-bg: color-mix(in srgb, var(--pm-surface) 88%, #10140f 12%);
  --pm-process-terminal-bar-bg: color-mix(in srgb, var(--pm-bg-soft) 84%, #10140f 16%);
  --pm-process-terminal-text: var(--pm-text);
  --pm-process-terminal-muted: var(--pm-muted);
  --pm-process-terminal-prompt: var(--pm-accent);
  display: grid;
  gap: 9px;
  border: 1px solid var(--pm-border);
  border-radius: 12px;
  padding: 10px;
  background: var(--pm-card);
  color: var(--pm-text);
}
.pm-process-card.pm-process-success {
  border-color: #2fae66;
  box-shadow: 0 0 0 3px rgba(47,174,102,.14);
}
.pm-process-card.pm-process-failed {
  border-color: #d8473a;
  box-shadow: 0 0 0 3px rgba(216,71,58,.14);
}
:root[data-theme="dark"] .pm-process-card {
  --pm-process-terminal-bg: color-mix(in srgb, var(--pm-surface) 54%, #080a07 46%);
  --pm-process-terminal-bar-bg: color-mix(in srgb, var(--pm-bg-soft) 58%, #11140f 42%);
  --pm-process-terminal-text: color-mix(in srgb, var(--pm-text) 92%, #ffffff 8%);
  --pm-process-terminal-muted: color-mix(in srgb, var(--pm-muted) 86%, #ffffff 14%);
  --pm-process-terminal-prompt: color-mix(in srgb, var(--pm-accent) 76%, #f8d887 24%);
}
.pm-process-terminal {
  overflow: hidden;
  border-radius: 12px;
  background: var(--pm-process-terminal-bg);
  color: var(--pm-process-terminal-text);
  border: 1px solid color-mix(in srgb, var(--pm-border) 65%, transparent);
}
.pm-process-terminal-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: var(--pm-process-terminal-bar-bg);
  color: var(--pm-process-terminal-muted);
  font-size: 11px;
  font-weight: 900;
}
.pm-process-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.pm-process-head span {
  display: block;
  color: var(--pm-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.pm-process-head strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.25;
  word-break: break-word;
}
.pm-process-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f1e1c4;
  color: #7b5520;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.pm-process-pill.running {
  background: #dff0ff;
  color: #1769a8;
}
.pm-process-pill.completed {
  background: #d9f1df;
  color: #1f7a3d;
}
.pm-process-pill.failed,
.pm-process-pill.killed {
  background: #f6dddc;
  color: #a2342f;
}
.pm-process-command,
.pm-process-log {
  min-width: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 0;
  border-radius: 0;
  padding: 10px 12px;
  margin: 0;
  background: transparent;
  color: var(--pm-process-terminal-text);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.pm-process-command span {
  color: var(--pm-process-terminal-prompt);
  font-weight: 900;
}
.pm-process-log {
  max-height: 220px;
  padding-top: 4px;
}
.pm-process-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}
.pm-process-meta span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--pm-border);
  border-radius: 9px;
  padding: 6px 8px;
  background: var(--pm-bg-soft);
  color: var(--pm-muted);
  font-size: 11px;
  font-weight: 800;
}
.pm-process-meta span b {
  color: var(--pm-text);
  text-transform: uppercase;
  font-size: 10px;
}
.pm-process-hint,
.pm-process-summary {
  border-radius: 10px;
  padding: 8px 9px;
  background: #fff5df;
  color: #80590f;
  font-size: 12px;
  font-weight: 800;
}
.pm-process-summary {
  background: var(--pm-bg-soft);
  color: var(--pm-text-soft);
}
.pm-process-summary.failure {
  background: #fff0ef;
  color: #a2342f;
}
.pm-process-tabs,
.pm-process-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.pm-process-tabs button,
.pm-process-actions button,
.pm-process-input button {
  border: 1px solid var(--pm-border);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--pm-surface);
  color: var(--pm-text);
  font-size: 12px;
  font-weight: 900;
}
.pm-process-tabs button.active {
  background: var(--pm-accent);
  border-color: var(--pm-accent);
  color: #fff;
}
.pm-process-actions button:disabled,
.pm-process-input button:disabled,
.pm-process-input input:disabled {
  opacity: .55;
}
.pm-process-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}
.pm-process-input input {
  min-width: 0;
  border: 1px solid var(--pm-border);
  border-radius: 10px;
  padding: 9px 10px;
  background: var(--pm-surface);
  color: var(--pm-text);
  font-size: 13px;
}
#pm-global-approval-host {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
}
.pm-global-approval-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(25, 18, 12, .22), rgba(25, 18, 12, 0));
}
.pm-global-approval-sheet {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(var(--pm-tabbar-h) + env(safe-area-inset-bottom) + 12px);
  pointer-events: auto;
}
.pm-va-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.pm-va-btn {
  padding: 11px 0;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.pm-va-btn:active { opacity: 0.75; }
.pm-va-btn.reject {
  background: var(--pm-bg-soft);
  color: #d8473a;
  border: 1.5px solid #d8473a40;
}
.pm-va-btn.approve {
  background: #2fae66;
  color: #fff;
}
.pm-va-btn.session,
.pm-va-btn.always {
  background: var(--pm-surface);
  color: var(--pm-text);
  border: 1px solid var(--pm-border);
}
.pm-va-btn:disabled {
  opacity: .55;
}

:root[data-theme="dark"] .pm-voice-approval {
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 0 4px color-mix(in srgb, var(--va-accent) 18%, transparent);
}
:root[data-theme="dark"] .pm-va-btn.reject {
  background: rgba(216,71,58,0.12);
}

/* ── In-chat file browser ─────────────────────────────────────────── */
.pm-browse-card {
  margin-top: 10px;
  border: 1px solid var(--pm-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--pm-bg);
}
.pm-browse-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--pm-border);
  background: var(--pm-bg-soft);
}
.pm-browse-crumb {
  padding: 3px 7px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--pm-orange);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.pm-browse-crumb.active {
  color: var(--pm-text);
  cursor: default;
}
.pm-browse-crumb:not(.active):hover { background: var(--pm-border); }
.pm-browse-sep {
  font-size: 12px;
  color: var(--pm-muted);
  flex-shrink: 0;
}
.pm-browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1px;
  background: var(--pm-border);
}
.pm-browse-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 14px 10px 12px;
  border: none;
  background: var(--pm-bg);
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: background 0.12s;
  min-width: 0;
}
.pm-browse-item:hover, .pm-browse-item:active { background: var(--pm-bg-soft); }
.pm-browse-item-icon { font-size: 26px; line-height: 1; flex-shrink: 0; }
.pm-browse-item-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--pm-text);
  word-break: break-all;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.pm-browse-item.dir .pm-browse-item-name { color: var(--pm-orange); }
.pm-browse-empty {
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--pm-muted);
}
.pm-browse-error {
  padding: 14px 16px;
  font-size: 13px;
  color: #d8473a;
}

:root[data-theme="dark"] .pm-browse-item { background: var(--pm-bg); }
:root[data-theme="dark"] .pm-browse-item:hover { background: var(--pm-bg-soft); }

/* ---------- responsive guard ---------- */
@media (min-width: 820px) {
  .pm-app { max-width: 480px; margin: 0 auto; border-left: 1px solid var(--pm-border); border-right: 1px solid var(--pm-border); }
}

/* ---------- CREATIVE PAGE ---------- */
.pm-creative { padding-bottom: 220px; }
.pm-creative-title { text-align: center; font-size: 28px; font-weight: 800; margin: 6px 0 2px; letter-spacing: -0.02em; }
.pm-creative-status { display: flex; align-items: center; justify-content: center; gap: 6px; color: #19a062; font-weight: 700; font-size: 13px; margin-bottom: 14px; }
.pm-creative-dot { width: 8px; height: 8px; border-radius: 50%; background: #19a062; display: inline-block; }

.pm-creative-modeswitch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: var(--pm-surface); border: 1px solid var(--pm-border);
  border-radius: 14px; padding: 4px; margin: 0 auto 14px; max-width: 360px;
}
.pm-creative-modeswitch button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 8px; border-radius: 10px; border: none; background: transparent;
  color: var(--pm-muted); font-weight: 700; font-size: 14px; cursor: pointer;
}
.pm-creative-modeswitch button.active { background: var(--pm-orange-soft); color: var(--pm-orange); }
.pm-creative-modeswitch button .pm-i, .pm-creative-modeswitch button svg { width: 18px; height: 18px; }

.pm-creative-providers { display: flex; gap: 8px; overflow-x: auto; padding: 0 2px 4px; margin-bottom: 14px; }
.pm-creative-provider {
  display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
  padding: 10px 14px; border-radius: 999px; border: 1px solid var(--pm-border);
  background: var(--pm-surface); color: var(--pm-text); font-weight: 600; font-size: 13px;
  cursor: pointer; white-space: nowrap;
}
.pm-creative-provider.active { border-color: var(--pm-orange); color: var(--pm-orange); background: var(--pm-orange-soft); }
.pm-creative-provider-mark { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; }
.pm-creative-provider-mark svg { width: 16px; height: 16px; }
.pm-creative-provider-mark.xai { font-weight: 800; }
.pm-creative-provider-mark.oai { font-weight: 800; }

.pm-creative-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.pm-creative-action {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 8px; border-radius: 12px; border: 1px solid var(--pm-border);
  background: var(--pm-surface); color: var(--pm-orange); font-weight: 700; font-size: 13px;
  cursor: pointer;
}
.pm-creative-action.accent { color: var(--pm-orange); }
.pm-creative-action .pm-i, .pm-creative-action svg { width: 16px; height: 16px; }

.pm-creative-section { margin-bottom: 22px; }
.pm-creative-section-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 2px 10px; }
.pm-creative-section-head h2 { font-size: 17px; font-weight: 800; margin: 0; }
.pm-creative-link { background: transparent; border: none; color: var(--pm-orange); font-weight: 700; font-size: 13px; cursor: pointer; }

.pm-creative-templates { display: grid; grid-auto-flow: column; grid-auto-columns: 128px; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.pm-creative-template {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 8px; border-radius: 14px; border: 1px solid var(--pm-border);
  background: var(--pm-surface); cursor: pointer; text-align: left;
}
.pm-creative-template-thumb {
  width: 100%; aspect-ratio: 1/1; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fff1e3 0%, #ffd9b0 100%);
  color: var(--pm-orange-dark); margin-bottom: 4px;
}
.pm-creative-template-thumb svg { width: 32px; height: 32px; }
.pm-creative-template strong { font-size: 13px; font-weight: 800; line-height: 1.2; }
.pm-creative-template small { color: var(--pm-muted); font-size: 11px; }

.pm-creative-preview {
  width: 100%; aspect-ratio: 16/9; border-radius: 14px;
  background: linear-gradient(180deg, #1d2027 0%, #0e1014 100%);
  display: flex; align-items: center; justify-content: center;
  color: #f3ead9; overflow: hidden; margin-bottom: 12px; position: relative;
}
.pm-creative-preview-empty { text-align: center; color: rgba(243,234,217,.7); }
.pm-creative-preview-empty .pm-empty-icon { display: flex; justify-content: center; opacity: .55; margin-bottom: 6px; }
.pm-creative-preview-stub { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pm-creative-preview-stub svg { width: 40px; height: 40px; color: var(--pm-orange); }
.pm-creative-preview-stub small { color: rgba(243,234,217,.6); font-size: 11px; }
.pm-creative-preview-hint { color: rgba(243,234,217,.6); font-size: 11px; margin-top: 4px; }
.pm-creative-preview video, .pm-creative-preview img { width: 100%; height: 100%; object-fit: contain; }

.pm-creative-chiprow { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; }
.pm-creative-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 10px; border: 1px solid var(--pm-border);
  background: var(--pm-surface); font-size: 11px; font-weight: 700; color: var(--pm-text-soft); white-space: nowrap;
}
.pm-creative-chip.ok { color: #19a062; }
.pm-creative-chip svg { width: 12px; height: 12px; }

.pm-creative-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pm-creative-gallery-empty {
  grid-column: span 2; padding: 24px; text-align: center; color: var(--pm-muted);
  border: 1px dashed var(--pm-border); border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.pm-creative-gallery-empty svg { width: 28px; height: 28px; opacity: .5; }
.pm-creative-gallery-card {
  display: flex; flex-direction: column; gap: 4px; padding: 6px;
  border-radius: 12px; border: 1px solid var(--pm-border);
  background: var(--pm-surface); text-align: left; cursor: pointer;
}
.pm-creative-thumb {
  width: 100%; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden;
  background: var(--pm-bg-soft); display: flex; align-items: center; justify-content: center;
  color: var(--pm-muted); margin-bottom: 4px;
}
.pm-creative-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pm-creative-thumb.video {
  background: linear-gradient(135deg, #232830, #0f1115); color: var(--pm-orange);
  position: relative;
}
.pm-creative-thumb.video svg { width: 32px; height: 32px; }
.pm-creative-thumb.video video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  background: #0f1115;
}
.pm-creative-thumb-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.25); color: #fff; pointer-events: none;
}
.pm-creative-thumb-play svg { width: 28px; height: 28px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.pm-creative-preview video {
  width: 100%; height: 100%; object-fit: contain; background: #000;
}
.pm-creative-gallery-card strong { font-size: 13px; font-weight: 700; line-height: 1.2; }
.pm-creative-gallery-card small { font-size: 11px; color: var(--pm-muted); }

.pm-creative-current-image {
  display: grid; grid-template-columns: 96px 1fr; gap: 12px;
  padding: 12px; border-radius: 14px; border: 1px solid var(--pm-border);
  background: var(--pm-surface); margin-bottom: 14px;
}
.pm-creative-current-thumb {
  width: 96px; height: 96px; border-radius: 12px; overflow: hidden;
  background: var(--pm-bg-soft); display: flex; align-items: center; justify-content: center;
}
.pm-creative-current-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pm-creative-current-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pm-creative-current-meta strong { font-size: 14px; font-weight: 800; }
.pm-creative-current-meta small { font-size: 11px; color: var(--pm-muted); word-break: break-all; }
.pm-creative-current-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.pm-creative-current-actions .pm-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: none; }
.pm-creative-current-actions .pm-btn.primary { background: var(--pm-orange); color: #fff; border: none; }
.pm-creative-current-actions .pm-btn.ghost { background: var(--pm-surface); color: var(--pm-text); border: 1px solid var(--pm-border); }
.pm-creative-current-actions .pm-btn svg { width: 14px; height: 14px; }

.pm-creative-quickrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pm-creative-quick {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  border-radius: 14px; border: 1px solid var(--pm-border);
  background: var(--pm-surface); text-align: left; cursor: pointer;
}
.pm-creative-quick > div { flex: 1; min-width: 0; }
.pm-creative-quick strong { display: block; font-size: 13px; font-weight: 800; }
.pm-creative-quick small { display: block; font-size: 11px; color: var(--pm-muted); }
.pm-creative-quick-icon {
  width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--pm-orange-soft); color: var(--pm-orange);
}
.pm-creative-quick-icon svg { width: 18px; height: 18px; }
.pm-creative-quick > .pm-i, .pm-creative-quick > svg { width: 16px; height: 16px; color: var(--pm-muted); }

.pm-creative-composer {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(var(--pm-tabbar-h, 64px) + env(safe-area-inset-bottom, 0px) + 8px);
  background: var(--pm-surface); border: 1px solid var(--pm-border);
  border-radius: 18px; padding: 8px; z-index: 50;
  box-shadow: 0 16px 40px rgba(0,0,0,.12);
}
.pm-creative-composer-row { display: flex; align-items: center; gap: 6px; }
.pm-creative-input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-size: 14px; padding: 8px 4px; color: var(--pm-text);
}
.pm-creative-send {
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: var(--pm-orange); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.pm-creative-send.busy { opacity: .6; }
.pm-creative-send svg { width: 18px; height: 18px; }
.pm-creative-composer-meta { display: flex; gap: 6px; overflow-x: auto; padding: 6px 2px 0; }
.pm-creative-meta-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-radius: 10px; border: 1px solid var(--pm-border);
  background: var(--pm-bg-soft); color: var(--pm-text); font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.pm-creative-meta-chip.accent { color: var(--pm-orange); }
.pm-creative-meta-chip small { color: var(--pm-muted); font-weight: 600; }
.pm-creative-meta-chip svg { width: 14px; height: 14px; }

.pm-creative-sheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
}
.pm-creative-sheet {
  width: 100%; max-width: 480px; background: var(--pm-surface);
  border-top-left-radius: 20px; border-top-right-radius: 20px;
  padding: 18px 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
  max-height: 75vh; overflow-y: auto;
}
.pm-creative-sheet h3 { margin: 0 0 12px; font-size: 17px; font-weight: 800; text-align: center; }
.pm-creative-sheet-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.pm-creative-sheet-options button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px;
  border-radius: 12px; border: 1px solid var(--pm-border); background: var(--pm-bg-soft);
  font-size: 14px; font-weight: 700; cursor: pointer; color: var(--pm-text);
}
.pm-creative-sheet-options button.active { border-color: var(--pm-orange); color: var(--pm-orange); background: var(--pm-orange-soft); }
.pm-creative-sheet-options button small { color: var(--pm-muted); font-weight: 600; font-size: 11px; }
.pm-creative-sheet-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.pm-creative-sheet-list button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--pm-border);
  background: var(--pm-bg-soft); cursor: pointer; text-align: left;
}
.pm-creative-sheet-list button strong { font-size: 14px; font-weight: 800; }
.pm-creative-sheet-list button small { color: var(--pm-muted); font-size: 12px; }

.pm-creative-extract-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 250;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.pm-creative-extract-modal[hidden] { display: none; }
.pm-creative-extract-card {
  width: 100%; max-width: 380px; background: var(--pm-surface);
  border-radius: 18px; padding: 22px; text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.pm-creative-extract-icon {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 12px;
  background: var(--pm-orange-soft); color: var(--pm-orange);
  display: inline-flex; align-items: center; justify-content: center;
}
.pm-creative-extract-icon svg { width: 28px; height: 28px; }
.pm-creative-extract-card h3 { margin: 0 0 4px; font-size: 17px; font-weight: 800; }
.pm-creative-extract-card .pm-card-body { margin: 0 0 14px; color: var(--pm-text-soft); font-size: 13px; }
.pm-creative-extract-bar {
  height: 6px; background: var(--pm-bg-soft); border-radius: 999px;
  overflow: hidden; margin-bottom: 14px;
}
.pm-creative-extract-bar > div {
  height: 100%; width: 4%; background: var(--pm-orange);
  transition: width .4s ease;
}
.pm-creative-extract-stages {
  list-style: none; margin: 0 0 14px; padding: 0;
  text-align: left; max-height: 200px; overflow-y: auto;
  font-size: 12px; color: var(--pm-text-soft);
}
.pm-creative-extract-stages li {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px;
  border-bottom: 1px solid var(--pm-border);
}
.pm-creative-extract-stages li:last-child { border-bottom: none; }
.pm-creative-extract-stages strong { font-weight: 700; color: var(--pm-text); }
.pm-creative-extract-stages small { color: var(--pm-muted); }
.pm-creative-stage-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--pm-orange);
  display: inline-block; flex: 0 0 auto;
}

[data-theme="dark"] .pm-creative-template-thumb {
  background: linear-gradient(135deg, rgba(234,106,31,.18), rgba(234,106,31,.06));
  color: var(--pm-orange);
}

/* ---------- SUBAGENTS PAGE ---------- */
.pm-subagent-robot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 50px; flex: 0 0 auto;
}
.pm-subagent-robot svg { display: block; }
.pm-subagent-robot-sm { width: 36px; height: 40px; }
.pm-subagent-robot-lg { width: 56px; height: 64px; }
.pm-subagent-tile { align-items: center; }
.pm-tool-chip {
  display: inline-block; padding: 3px 8px; margin: 2px 4px 2px 0;
  border-radius: 999px; background: var(--pm-bg-soft); border: 1px solid var(--pm-border);
  color: var(--pm-text-soft); font-size: 11px; font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.pm-tool-chip.more { background: var(--pm-orange-soft); color: var(--pm-orange); border-color: transparent; }
.pm-subagent-md {
  margin: 0; padding: 14px 16px;
  background: var(--pm-bg-soft); color: var(--pm-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
  max-height: 60vh; overflow: auto;
}
.pm-ctxref {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 0; border-bottom: 1px solid var(--pm-border);
}
.pm-ctxref:last-child { border-bottom: none; }
.pm-ctxref strong { font-size: 13px; }
.pm-ctxref span { font-size: 12px; color: var(--pm-muted); }
.pm-sa-progress {
  display: block; margin-top: 6px; font-size: 11px; font-weight: 600;
  color: var(--pm-orange); font-style: italic;
}
