/* ComfyUI Remote Studio — Sculptural Porcelain & Fluid Spring Design System */
:root {
  --bg: #F4F3EF;
  --bg-subtle: rgba(20, 20, 18, 0.055);
  --surface: rgba(255, 255, 255, 0.94);
  --surface-solid: #FFFFFF;
  --surface-glass: rgba(255, 255, 255, 0.78);
  --surface-nav: rgba(255, 255, 255, 0.86);
  --ink: #141413;
  --ink-2: #4A4945;
  --ink-muted: #84827C;
  --ink-faint: #B3B1AA;
  --border: rgba(20, 20, 18, 0.068);
  --border-strong: rgba(20, 20, 18, 0.125);
  --specular: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  --shadow-xs: 0 1px 2px rgba(18, 18, 16, 0.045), 0 0 0 0.5px rgba(18, 18, 16, 0.02);
  --shadow-sm: 0 1px 2px rgba(18, 18, 16, 0.03), 0 6px 20px -4px rgba(18, 18, 16, 0.055);
  --shadow-md: 0 2px 6px rgba(18, 18, 16, 0.04), 0 14px 32px -6px rgba(18, 18, 16, 0.085);
  --shadow-lg: 0 4px 12px rgba(18, 18, 16, 0.055), 0 20px 44px -8px rgba(18, 18, 16, 0.13);

  --green: #15803D;
  --green-soft: #ECFDF3;
  --amber: #C26A0E;
  --amber-soft: #FFF8EB;
  --red: #C81E1E;
  --red-soft: #FEF2F2;

  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 26px;
  --r-full: 999px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --spring-fluid: cubic-bezier(0.28, 1.08, 0.36, 1);
  --spring-bounce: cubic-bezier(0.34, 1.38, 0.64, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  overscroll-behavior-y: none;
  scrollbar-width: none;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(90% 44% at 15% 0%, rgba(255, 241, 224, 0.65) 0%, rgba(255, 241, 224, 0) 68%),
    radial-gradient(80% 40% at 88% 4%, rgba(232, 238, 250, 0.52) 0%, rgba(232, 238, 250, 0) 66%),
    linear-gradient(180deg, #F7F6F2 0%, #F2F1EC 100%);
}
html::-webkit-scrollbar, body::-webkit-scrollbar, .sheet-panel::-webkit-scrollbar {
  display: none;
}

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

.hidden { display: none !important; }

/* ===================== TOP BAR ===================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: rgba(247, 247, 245, 0.84);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.top-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.top-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}

/* Segmented Mode Switch with 120fps Gliding Glass Thumb */
.mode-segment {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: rgba(20, 20, 18, 0.055);
  padding: 3px;
  border-radius: var(--r-full);
  border: 1px solid rgba(20, 20, 18, 0.05);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}
.mode-segment .seg-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 0;
  border-radius: var(--r-full);
  background: #FFFFFF;
  box-shadow: 0 2px 8px rgba(18, 18, 16, 0.09), 0 1px 1px rgba(18, 18, 16, 0.04);
  transition: transform 0.36s var(--spring-fluid), width 0.36s var(--spring-fluid), opacity 0.2s;
  pointer-events: none;
  z-index: 0;
  will-change: transform, width;
}
.mode-segment button {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  padding: 6px 15px;
  border-radius: var(--r-full);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.24s var(--ease), transform 0.14s var(--ease);
}
.mode-segment button:active { transform: scale(0.96); }
.mode-segment button.active {
  color: var(--ink);
}
.mode-segment:not(:has(.seg-thumb)) button.active {
  background: #FFFFFF;
  box-shadow: var(--shadow-xs);
}

.top-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.14s var(--spring), background 0.2s var(--spring), color 0.18s, border-color 0.18s;
}
.privacy-pill:active { transform: scale(0.94); }
.privacy-pill.active {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
  box-shadow: 0 3px 10px rgba(17, 17, 17, 0.2);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s var(--ease);
}
.status-pill:active { transform: scale(0.95); }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}
.status-dot.online { background: var(--green); box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.16); }
.status-dot.starting { background: var(--amber); animation: pulse 1.2s infinite; }

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

/* ===================== MAIN LAYOUT ===================== */
.app-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 8px 16px calc(220px + var(--safe-bottom));
}

.app-main.no-dock {
  padding-bottom: calc(108px + var(--safe-bottom));
}

/* Offline quick notice */
.offline-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--amber-soft);
  border: 1px solid rgba(217, 119, 6, 0.18);
  border-radius: var(--r-md);
}

/* ===================== CANVAS STAGE ===================== */
.canvas-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.empty-canvas-wrap {
  min-height: calc(100dvh - 285px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-canvas {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 38px 22px 32px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 30px;
  box-shadow: var(--specular), var(--shadow-md);
}

.empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--ink);
}
.empty-icon.hero-orb {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  background: linear-gradient(145deg, #272624 0%, #0F0F0E 100%);
  color: #FAF9F5;
  box-shadow:
    0 10px 26px -4px rgba(17, 17, 15, 0.34),
    0 0 0 6px rgba(20, 20, 18, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  animation: orbFloat 4.2s ease-in-out infinite;
}
@keyframes orbFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.hero-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.empty-canvas h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.empty-canvas p {
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--ink-muted);
  max-width: 300px;
}

/* Inspiration chips */
.inspo-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.inspo-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink-2);
  padding: 7px 13px;
  border-radius: var(--r-full);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.inspo-chip:active { transform: scale(0.95); background: var(--bg-subtle); }

/* Upload Frame for Img2Img */
.upload-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 230px;
  background: var(--surface);
  border: 1.5px dashed rgba(17, 17, 17, 0.16);
  border-radius: var(--r-lg);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, transform 0.15s var(--ease);
}
.upload-frame:active { transform: scale(0.99); }
.upload-frame.has-image {
  border-style: solid;
  border-color: var(--border);
  padding: 0;
  background: #ECECE8;
}
.upload-frame img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
}
.upload-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.ref2-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}

/* Live Progress Shimmer Card */
.progress-stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.progress-track {
  width: 100%;
  height: 5px;
  background: var(--bg-subtle);
  border-radius: var(--r-full);
  overflow: hidden;
  margin: 12px 0 8px;
}
/* Panel entrance animation */
.tab-panel:not(.hidden),
.canvas-stage:not(.hidden) {
  animation: panelEnter 0.28s var(--spring) both;
}
@keyframes panelEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Artwork & card reveal */
.artwork-card, .audio-card {
  animation: cardReveal 0.36s var(--spring) both;
}
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.progress-fill {
  position: relative;
  height: 100%;
  width: 6%;
  background: var(--ink);
  border-radius: var(--r-full);
  overflow: hidden;
  transition: width 0.38s var(--spring);
}
.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.42) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: barShimmer 1.4s infinite ease-in-out;
}
@keyframes barShimmer {
  to { transform: translateX(100%); }
}
.live-preview-img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: var(--r-md);
  margin-top: 10px;
  background: var(--bg);
}

/* Artwork Result Showcase */
.artwork-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 10px;
  box-shadow: var(--shadow-md);
}
.artwork-img {
  width: 100%;
  border-radius: 18px;
  display: block;
  background: var(--bg);
  cursor: zoom-in;
}
.artwork-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 4px 2px;
}
.artwork-meta {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artwork-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Before / After Compare */
.compare-wrap {
  position: relative;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  background: var(--bg);
}
.compare-wrap img { width: 100%; display: block; pointer-events: none; }
.compare-before {
  position: absolute;
  inset: 0;
  overflow: hidden;
  width: 50%;
  border-right: 2px solid #FFFFFF;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.18);
}
.compare-before img {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: auto;
  max-width: none;
}
.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.compare-tag {
  position: absolute;
  top: 10px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  background: rgba(17, 17, 17, 0.62);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
}
.compare-tag.left { left: 10px; }
.compare-tag.right { right: 10px; }

/* ===================== FLOATING COMPOSER DOCK ===================== */
.composer-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(76px + var(--safe-bottom));
  z-index: 35;
  padding: 0 14px;
  pointer-events: none;
}

.composer-inner {
  max-width: 660px;
  margin: 0 auto;
  pointer-events: auto;
}

.pills-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 16px 8px 2px;
  scrollbar-width: none;
}
.pills-bar::-webkit-scrollbar { display: none; }

.param-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  background: var(--surface-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  border-radius: var(--r-full);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: transform 0.14s var(--ease), background 0.14s;
}
.param-pill:active { transform: scale(0.95); background: var(--surface); }
.param-pill.dark {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
}

/* AI Conversational Mode Toggle Pill */
.param-pill.ai-toggle {
  gap: 6px;
  padding: 6px 12px 6px 8px;
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  transition: transform 0.16s var(--spring), background 0.22s var(--spring), color 0.2s, border-color 0.2s, box-shadow 0.22s var(--spring);
}
.ai-check-box {
  width: 15px;
  height: 15px;
  border-radius: 5px;
  border: 1.5px solid var(--ink-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.22s var(--spring-bounce);
}
.ai-check-box svg {
  width: 10px;
  height: 10px;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.18s var(--spring), transform 0.24s var(--spring-bounce);
}
.param-pill.ai-toggle.checked {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
  box-shadow: 0 4px 14px rgba(17, 17, 17, 0.22);
}
.param-pill.ai-toggle.checked .ai-check-box {
  background: #FFFFFF;
  border-color: #FFFFFF;
  color: var(--ink);
}
.param-pill.ai-toggle.checked .ai-check-box svg {
  opacity: 1;
  transform: scale(1);
}

.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(20, 20, 18, 0.10);
  border-radius: 26px;
  padding: 8px 8px 8px 16px;
  box-shadow: var(--specular), 0 12px 32px -6px rgba(18, 18, 16, 0.12), 0 2px 6px rgba(18, 18, 16, 0.05);
  transition: transform 0.28s var(--spring), border-color 0.28s var(--ease), box-shadow 0.34s var(--ease);
}
.composer-box:focus-within {
  transform: translateY(-1px);
  border-color: rgba(20, 20, 18, 0.22);
  box-shadow: var(--specular), 0 18px 42px -8px rgba(18, 18, 16, 0.16), 0 3px 10px rgba(18, 18, 16, 0.06);
}
.composer-box.ai-mode {
  border-color: rgba(20, 20, 18, 0.55);
  box-shadow:
    var(--specular),
    0 0 0 1px rgba(20, 20, 18, 0.12),
    0 12px 34px -6px rgba(124, 92, 230, 0.15),
    0 10px 28px -8px rgba(217, 130, 43, 0.14),
    0 16px 38px -8px rgba(18, 18, 16, 0.12);
  animation: aiAuraBreathe 3.6s ease-in-out infinite;
}
@keyframes aiAuraBreathe {
  0%, 100% {
    box-shadow:
      var(--specular),
      0 0 0 1px rgba(20, 20, 18, 0.12),
      0 12px 32px -6px rgba(124, 92, 230, 0.13),
      0 10px 26px -8px rgba(217, 130, 43, 0.12),
      0 16px 38px -8px rgba(18, 18, 16, 0.12);
  }
  50% {
    box-shadow:
      var(--specular),
      0 0 0 1.5px rgba(20, 20, 18, 0.2),
      0 14px 38px -4px rgba(124, 92, 230, 0.22),
      0 12px 32px -6px rgba(217, 130, 43, 0.19),
      0 18px 42px -8px rgba(18, 18, 16, 0.14);
  }
}

.composer-box textarea {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  overflow-y: hidden;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
  min-height: 38px;
  max-height: 112px;
  padding: 8px 0;
  margin: 0;
}
.composer-box textarea::placeholder { color: var(--ink-faint); }

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.14s var(--ease), opacity 0.15s;
}
.send-btn:active { transform: scale(0.92); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.send-btn svg { width: 18px; height: 18px; }

/* ===================== FLOATING 4-TAB BOTTOM NAV ===================== */
.nav-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 16px 16px calc(10px + var(--safe-bottom));
  background: linear-gradient(to top, var(--bg) 62%, rgba(247, 247, 245, 0) 100%);
  pointer-events: none;
}

.floating-nav {
  position: relative;
  max-width: 420px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface-nav);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--r-full);
  padding: 5px;
  box-shadow: var(--specular), 0 0 0 0.5px rgba(20, 20, 18, 0.08), var(--shadow-lg);
  pointer-events: auto;
}
.nav-thumb {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: 0;
  border-radius: var(--r-full);
  background: rgba(20, 20, 18, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition: transform 0.38s var(--spring-fluid), width 0.38s var(--spring-fluid);
  pointer-events: none;
  z-index: 0;
  will-change: transform, width;
}

.nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: transparent;
  border-radius: var(--r-full);
  padding: 7px 4px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.24s var(--ease), transform 0.16s var(--spring);
}
.nav-item:active { transform: scale(0.91); }
.nav-item svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.9;
  transition: transform 0.32s var(--spring-bounce);
}
.nav-item.active {
  color: var(--ink);
}
.nav-item.active svg {
  transform: translateY(-1px) scale(1.08);
}

/* ===================== BUTTONS & FORM CONTROLS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.13s var(--ease), background 0.15s, opacity 0.15s;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-full { width: 100%; }
.btn-primary { background: var(--ink); color: #FFFFFF; }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--ink); }
.btn-soft { background: var(--bg-subtle); color: var(--ink); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: rgba(220, 38, 38, 0.15); }
.btn-success { background: var(--green-soft); color: var(--green); border-color: rgba(22, 163, 74, 0.18); }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }
.btn-xs { padding: 5px 10px; font-size: 12px; }

.card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--specular), var(--shadow-sm);
  scroll-margin-top: 68px;
  transition: transform 0.24s var(--spring), box-shadow 0.24s var(--ease);
}
.tab-panel:not(.hidden) > .card {
  animation: cardStaggerIn 0.36s var(--spring) both;
}
.tab-panel:not(.hidden) > .card:nth-child(2) { animation-delay: 35ms; }
.tab-panel:not(.hidden) > .card:nth-child(3) { animation-delay: 70ms; }
.tab-panel:not(.hidden) > .card:nth-child(4) { animation-delay: 105ms; }
.tab-panel:not(.hidden) > .card:nth-child(5) { animation-delay: 140ms; }
.tab-panel:not(.hidden) > .card:nth-child(6) { animation-delay: 175ms; }
@keyframes cardStaggerIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 3-Mode Connection Route Switcher */
.route-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.route-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.16s var(--spring), background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.route-option:active { transform: scale(0.98); }
.route-option.current {
  background: #FFFFFF;
  border-color: rgba(20, 20, 18, 0.24);
  box-shadow: var(--shadow-xs);
}
.route-opt-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.route-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.route-icon.pub {
  background: var(--green-soft);
  border-color: rgba(21, 128, 61, 0.18);
  color: var(--green);
}
.route-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.route-url {
  font-size: 11.5px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.route-cta {
  flex-shrink: 0;
  padding: 5px 11px;
  border-radius: var(--r-full);
  background: var(--ink);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 600;
}
.route-option.current .route-cta {
  background: var(--green-soft);
  color: var(--green);
}
.route-custom-row {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.card-head > div:first-child {
  min-width: 0;
  flex: 1;
}
.state-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--ink-muted);
}
.state-tag.online { background: var(--green-soft); color: var(--green); }
.state-tag.starting { background: var(--amber-soft); color: var(--amber); }
.state-tag.offline { background: var(--red-soft); color: var(--red); }
.card-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.card-sub {
  font-size: 12px;
  color: var(--ink-muted);
}

.field {
  margin-bottom: 14px;
  min-width: 0;
}
.field:last-child { margin-bottom: 0; }
.field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}

input[type="text"], input[type="number"], input[type="password"], select, .sheet-textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
select {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 12px;
}
input:focus, select:focus, .sheet-textarea:focus {
  border-color: var(--ink);
  background: var(--surface);
}
.sheet-textarea { resize: vertical; min-height: 68px; line-height: 1.5; }

input[type="range"] {
  width: 100%;
  accent-color: var(--ink);
  cursor: pointer;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.grid-2 > * { min-width: 0; }

/* Aspect ratio cards inside bottom sheet */
.ratio-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.ratio-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 4px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1.5px solid transparent;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.ratio-btn .box { border: 1.5px solid currentColor; border-radius: 3px; }
.ratio-btn.active {
  background: var(--surface);
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

/* iOS Switch Row */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--ink-2);
}
.toggle-row:first-of-type { border-top: none; }
.toggle-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--ink);
}

/* ===================== iOS BOTTOM SHEET ===================== */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(17, 17, 17, 0.32);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.24s var(--spring);
}
.sheet-backdrop.open {
  opacity: 1;
}

.sheet-panel {
  width: 100%;
  max-width: 640px;
  max-height: 82vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  padding: 10px 20px calc(24px + var(--safe-bottom));
  box-shadow: 0 -12px 44px rgba(0, 0, 0, 0.14);
  transform: translateY(100%);
  transition: transform 0.34s var(--spring);
  will-change: transform;
}
.sheet-backdrop.open .sheet-panel {
  transform: translateY(0);
}
.sheet-panel.dragging {
  transition: none !important;
}

.sheet-handle {
  width: 40px;
  height: 4.5px;
  border-radius: var(--r-full);
  background: rgba(17, 17, 17, 0.16);
  margin: 2px auto 14px;
  cursor: grab;
  touch-action: none;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.sheet-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ===================== VOICE & AUDIO ===================== */
.voice-chip-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.voice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.voice-row.active {
  background: var(--surface);
  border-color: var(--ink);
  box-shadow: var(--shadow-xs);
}
.audio-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.audio-card audio {
  width: 100%;
  height: 40px;
  margin-top: 10px;
}
.rec-btn.recording {
  background: var(--red-soft);
  color: var(--red);
  border-color: rgba(220, 38, 38, 0.35);
  animation: pulse 1.1s infinite;
}

/* ===================== GALLERY ===================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 580px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}
.gallery-tile {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: 1 / 1;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.22s var(--spring), box-shadow 0.22s var(--spring);
  animation: tileFade 0.32s var(--spring) both;
}
.gallery-tile:active { transform: scale(0.96); }
@keyframes tileFade {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-tile .badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  color: var(--ink);
}

/* ===================== QR, LOGS & MODAL ===================== */
.qr-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.qr-box {
  background: #FFFFFF;
  padding: 10px;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  line-height: 0;
}
.url-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 7px 8px 7px 11px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.url-copy > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.55;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  color: var(--ink-2);
  scrollbar-width: thin;
}
.log-box::-webkit-scrollbar { width: 5px; }
.log-box::-webkit-scrollbar-thumb { background: rgba(17,17,17,0.16); border-radius: 99px; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(17, 17, 17, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  animation: modalFade 0.22s var(--spring) both;
}
.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 26px;
  padding: 16px;
  box-shadow: var(--shadow-lg);
  animation: modalZoom 0.28s var(--spring) both;
}
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalZoom {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-card img {
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  border-radius: 16px;
  background: var(--bg);
}

/* Toast */
.toast {
  position: fixed;
  top: calc(62px + var(--safe-top));
  left: 50%;
  transform: translate(-50%, -14px) scale(0.96);
  opacity: 0;
  z-index: 200;
  background: var(--ink);
  color: #FFFFFF;
  padding: 9px 18px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  max-width: 88vw;
  text-align: center;
  pointer-events: none;
  transition: transform 0.28s var(--spring-bounce), opacity 0.22s var(--spring);
}
.toast.show {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
}

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

/* Meter bar */
.meter-track {
  width: 100%;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--bg-subtle);
  overflow: hidden;
  margin-top: 8px;
}
.meter-fill {
  height: 100%;
  width: 0%;
  background: var(--ink);
  border-radius: var(--r-full);
  transition: width 0.35s var(--ease);
}

/* ===================== AI CONVERSATIONAL STUDIO ===================== */
.ai-chat-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: panelEnter 0.28s var(--spring) both;
}

.ai-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}
.ai-chat-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ai-badge-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--ink);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ai-chat-head-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.ai-chat-head-sub {
  font-size: 11.5px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-config-link {
  border: none;
  background: var(--amber-soft);
  color: var(--amber);
  padding: 4px 9px;
  border-radius: var(--r-full);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.ai-mini-switch {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  padding: 2px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.ai-mini-switch button {
  border: none;
  background: transparent;
  padding: 4px 9px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--spring);
}
.ai-mini-switch button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.sub-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  margin-bottom: 12px;
}
.sub-panel input[type="text"],
.sub-panel input[type="password"],
.sub-panel select {
  background: var(--surface);
}

/* ===================== ONE-TAP PRIVACY MODE (HIDE IMAGES) ===================== */
.privacy-media-box {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}
.ai-action-output .privacy-media-box {
  border-radius: 12px;
}
.privacy-veil {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 4;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  background: rgba(247, 247, 245, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}
.privacy-veil span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  background: rgba(17, 17, 17, 0.78);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-sm);
}

body.privacy-mode .privacy-media-box:not(.peek-open) img,
body.privacy-mode .upload-frame.has-image:not(.peek-open) img,
body.privacy-mode .compare-wrap:not(.peek-open) img,
body.privacy-mode .gallery-tile:not(.peek-open) img,
body.privacy-mode #i2iPreviewImg2 {
  filter: blur(30px) saturate(0.45);
  transform: scale(1.1);
  transition: filter 0.24s var(--spring), transform 0.24s var(--spring);
}
.privacy-media-box img,
.upload-frame img,
.compare-wrap img,
.gallery-tile img {
  transition: filter 0.24s var(--spring), transform 0.24s var(--spring);
}
body.privacy-mode .privacy-media-box:not(.peek-open) > .privacy-veil,
body.privacy-mode .upload-frame.has-image:not(.peek-open) > .privacy-veil {
  display: flex;
}
body.privacy-mode .gallery-tile:not(.peek-open)::after {
  content: "已隐藏";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(247, 247, 245, 0.35);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

/* ===================== MULTI-JOB QUEUE PANEL ===================== */
.queue-panel {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
}
.queue-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12px;
}
.queue-item-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.queue-mode-tag {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-2);
}
.queue-prompt-txt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

.ai-welcome-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px 20px 22px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.ai-welcome-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.ai-welcome-card p {
  margin: 0 auto 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 320px;
}

.ai-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-row {
  display: flex;
  flex-direction: column;
  animation: chatPop 0.28s var(--spring) both;
}
.chat-row.user { align-items: flex-end; }
.chat-row.assistant { align-items: flex-start; }

@keyframes chatPop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-bubble {
  max-width: 88%;
  padding: 11px 15px;
  font-size: 14px;
  line-height: 1.58;
  word-break: break-word;
  white-space: pre-wrap;
}
.chat-row.user .chat-bubble {
  background: var(--ink);
  color: #FFFFFF;
  border-radius: 20px 20px 6px 20px;
  box-shadow: var(--shadow-xs);
}
.chat-row.assistant .chat-bubble {
  max-width: 94%;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 20px 20px 20px 6px;
  box-shadow: var(--shadow-sm);
}

/* Thinking 3-dot animation & live streaming status */
.chat-stream-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-muted);
}
.chat-stream-bar.has-text {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.chat-stream-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.chat-stop-btn {
  border: none;
  background: var(--bg-subtle);
  color: var(--ink-2);
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-stop-btn:active { transform: scale(0.94); }
.chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 2px;
}
.chat-typing span {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--ink-muted);
  animation: dotBounce 1.2s infinite ease-in-out both;
}
.chat-typing span:nth-child(2) { animation-delay: 0.16s; }
.chat-typing span:nth-child(3) { animation-delay: 0.32s; }
@keyframes dotBounce {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-4px); }
}

/* Structured AI Action / Plan Card inside Assistant Bubble */
.ai-action-card {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  white-space: normal;
}
.ai-action-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.ai-action-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
}
.ai-action-badge.dispatched {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
}
.ai-action-badge.done {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(22, 163, 74, 0.2);
}
.ai-action-badge.warn {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: rgba(217, 119, 6, 0.22);
}
.ai-action-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.ai-action-prompt {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 8px 10px;
  margin-bottom: 8px;
  word-break: break-word;
}
.ai-action-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.ai-action-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 2px 8px;
}
.ai-action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ai-action-output {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.ai-action-output img {
  width: 100%;
  border-radius: 12px;
  display: block;
  cursor: zoom-in;
  background: var(--surface);
}
.ai-action-output audio {
  width: 100%;
  height: 38px;
}
