* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ???????????? 960??????????????? */
  --app-max-width: 960px;
  --app-inline-pad: 16px;
}

@media (min-width: 1200px) {
  :root {
    --app-max-width: 1080px;
    --app-inline-pad: 20px;
  }
}

@media (min-width: 1400px) {
  :root {
    --app-max-width: 1180px;
    --app-inline-pad: 24px;
  }
}

@media (min-width: 1600px) {
  :root {
    --app-max-width: 1280px;
    --app-inline-pad: 28px;
  }
}

@media (min-width: 1800px) {
  :root {
    --app-max-width: 1360px;
    --app-inline-pad: 32px;
  }
}

@media (min-width: 2000px) {
  :root {
    --app-max-width: 1440px;
    --app-inline-pad: 36px;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
  min-height: 100vh;
  color: #e2e8f0;
}

.app {
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 10px var(--app-inline-pad) 12px;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #334155;
  margin-bottom: 8px;
  flex-shrink: 0;
  min-height: 44px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
}

.brand-sub {
  font-size: 0.78rem;
  color: #94a3b8;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.topbar-nav-btn {
  border: 1px solid #475569;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.85);
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
}

.topbar-nav-btn:hover,
.topbar-nav-btn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: #818cf8;
  color: #e2e8f0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-menu-btn:hover,
.chat-menu-btn.active {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
}

.chat-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  z-index: 900;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.chat-sidebar-overlay.show {
  opacity: 1;
}

.chat-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: min(300px, 88vw);
  height: 100vh;
  background: #1e293b;
  border-right: 1px solid #334155;
  z-index: 901;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s ease;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
}

.chat-sidebar.open {
  transform: translateX(0);
}

.chat-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
}

.chat-sidebar-head h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f1f5f9;
}

.chat-sidebar-close {
  padding: 4px 8px;
}

.new-chat-btn {
  margin: 12px 14px 8px;
  padding: 10px 12px;
  border: 1px dashed #6366f1;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.08);
  color: #c7d2fe;
  font-size: 0.88rem;
  cursor: pointer;
  text-align: center;
  flex-shrink: 0;
}

.new-chat-btn:hover {
  background: rgba(99, 102, 241, 0.16);
  border-color: #818cf8;
}

.chat-thread-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 16px;
}

.chat-thread-item {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
}

.chat-thread-item:hover {
  background: rgba(51, 65, 85, 0.6);
}

.chat-thread-item.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(129, 140, 248, 0.45);
}

.chat-thread-main {
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 10px 8px 10px 12px;
  border: none;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
}

.chat-thread-item.active .chat-thread-main {
  color: #f1f5f9;
}

.chat-thread-delete {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.chat-thread-item:hover .chat-thread-delete,
.chat-thread-item.active .chat-thread-delete {
  opacity: 1;
}

.chat-thread-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.chat-thread-title {
  font-size: 0.86rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-thread-meta {
  margin-top: 4px;
  font-size: 0.72rem;
  color: #64748b;
}

.chat-thread-empty {
  padding: 24px 12px;
  text-align: center;
  color: #64748b;
  font-size: 0.85rem;
}

.prompt-template-body {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  max-height: min(60vh, 520px);
}

.prompt-template-search-wrap {
  margin: 0 0 0;
}

.prompt-template-topic-label {
  display: block;
  margin: 0 14px 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #e2e8f0;
}

.prompt-template-topic-input {
  width: calc(100% - 28px);
  margin: 0 14px 14px;
  padding: 10px 12px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #0f172a;
  color: #f1f5f9;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 72px;
  font-family: inherit;
}

.prompt-template-topic-input:focus {
  outline: none;
  border-color: #818cf8;
}

.prompt-template-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 14px 14px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.prompt-template-body .preset-empty {
  padding: 12px 14px;
}

.prompt-template-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid #475569;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.prompt-template-item:hover {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
}

.prompt-template-item-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.prompt-template-item-preview {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu {
  position: relative;
}

.user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid #475569;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  font-size: 0.82rem;
  cursor: pointer;
}

.user-menu-btn:hover,
.user-menu-btn.open {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 168px;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  padding: 6px;
  z-index: 50;
}

.user-dropdown[hidden] {
  display: none !important;
}

.user-dropdown-meta {
  padding: 8px 10px;
  font-size: 0.78rem;
  color: #94a3b8;
  border-bottom: 1px solid #334155;
  margin-bottom: 4px;
}

.user-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #e2e8f0;
  font-size: 0.84rem;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.user-dropdown-item:hover {
  background: rgba(99, 102, 241, 0.12);
}

.user-dropdown-item.danger {
  color: #fca5a5;
}

.link-item {
  color: #93c5fd !important;
}

.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.mode-tab {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

.mode-tab.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: #818cf8;
  color: #e2e8f0;
}

@media (max-width: 768px) {
  .mode-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding-bottom: 4px;
  }

  .mode-tabs::-webkit-scrollbar {
    display: none;
  }

  .mode-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    min-width: 4.5em;
    padding: 8px 14px;
    line-height: 1.2;
  }
}

.chat-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: calc(100vh - 92px);
  max-height: calc(100vh - 92px);
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid #334155;
  border-radius: 14px;
  overflow: hidden;
}

.chat-panel {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.chat-messages[hidden] {
  display: none !important;
}

.chat-empty {
  color: #64748b;
  text-align: center;
  margin: auto;
  font-size: 0.95rem;
}

.msg {
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: fadeIn 0.25s ease;
  position: relative;
}

.chat-messages.export-mode .msg:not([data-loading]) {
  max-width: 92%;
  padding-left: 28px;
}

.msg-export-check-wrap {
  position: absolute;
  left: 0;
  top: 8px;
  display: none;
}

.chat-messages.export-mode .msg-export-check-wrap {
  display: flex;
  align-items: center;
}

.msg-export-check {
  width: 18px;
  height: 18px;
  accent-color: #6366f1;
  cursor: pointer;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.assistant { align-self: flex-start; }

.msg-multi-compare-wrap {
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  animation: fadeIn 0.25s ease;
}

.msg-multi-compare-header {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 10px;
  text-align: center;
  letter-spacing: 0.02em;
}

.msg-multi-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.msg-compare-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid #334155;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.55);
  overflow: hidden;
  min-height: 120px;
}

.msg-compare-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #334155;
  background: rgba(30, 41, 59, 0.65);
}

.msg-compare-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.msg-compare-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msg-compare-avatar .msg-avatar-fallback {
  font-size: 0.58rem;
}

.msg-compare-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-compare-body {
  flex: 1;
  padding: 12px;
  min-height: 72px;
}

.msg-compare-body .msg-bubble {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: 0.92rem;
}

.msg-compare-body img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 8px;
  background: #0f172a;
  cursor: zoom-in;
}

.freeimg-variant-select {
  flex-shrink: 0;
  min-width: 64px;
  padding: 6px 8px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.78rem;
  cursor: pointer;
}

.freeimg-variant-select:focus {
  outline: none;
  border-color: #818cf8;
}

.msg-compare-actions {
  padding: 0 10px 10px;
}

.msg-compare-actions .msg-icon-actions {
  flex-wrap: wrap;
}

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  overflow: hidden;
}

.msg-avatar img { width: 100%; height: 100%; object-fit: cover; }

.msg-avatar-fallback {
  font-size: 0.65rem;
  font-weight: 700;
  color: #a5b4fc;
}

.model-multi-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid #334155;
  background: rgba(15, 23, 42, 0.5);
  overflow: hidden;
}

.model-multi-bar-nav-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.model-multi-bar-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.model-multi-bar-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.model-multi-bar-scroll .btn-small {
  flex-shrink: 0;
  white-space: nowrap;
}

.model-multi-bar-nav {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #475569;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.85);
  color: #cbd5e1;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.model-multi-bar-nav:hover:not(:disabled) {
  border-color: #818cf8;
  color: #e2e8f0;
  background: rgba(99, 102, 241, 0.15);
}

.model-multi-bar-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.model-multi-bar .model-multi-hint,
.model-multi-bar > .btn-primary-small {
  flex-shrink: 0;
}

.model-multi-hint {
  font-size: 0.82rem;
  color: #94a3b8;
}

.model-item.multi-mode {
  cursor: pointer;
}

.model-item.multi-mode .model-multi-check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: #6366f1;
}

.model-item.multi-selected {
  border: 1px solid rgba(129, 140, 248, 0.5);
  background: rgba(99, 102, 241, 0.12);
}

.favorite-item-meta {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 6px;
}

.favorites-body {
  padding: 12px 14px !important;
}

.notepad-modal-card {
  width: min(var(--app-max-width), calc(100vw - 24px));
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notepad-modal-card.is-fullscreen {
  width: 100vw !important;
  max-width: none !important;
  height: 100vh !important;
  max-height: none !important;
  border-radius: 0;
  border-left: none;
  border-right: none;
}

.notepad-modal-card.is-fullscreen .notepad-body {
  height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
}

.notepad-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.notepad-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notepad-body {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 0;
  flex: 1;
  min-height: 0;
  height: min(70vh, 640px);
  max-height: calc(90vh - 56px);
  padding: 0 !important;
  overflow: hidden;
}

.notepad-body.is-sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.notepad-body.is-sidebar-collapsed .notepad-sidebar {
  width: 0;
  min-width: 0;
  border-right: none;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.notepad-sidebar {
  border-right: 1px solid #334155;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  transition: opacity 0.15s ease;
}

.notepad-sidebar-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid #334155;
}

.notepad-search-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 8px 10px;
  font-size: 0.86rem;
}

.notepad-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notepad-list-item {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #e2e8f0;
  text-align: left;
  padding: 10px 10px 28px;
  cursor: pointer;
  position: relative;
}

.notepad-list-item:hover {
  background: rgba(51, 65, 85, 0.45);
}

.notepad-list-item.is-active {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(129, 140, 248, 0.45);
}

.notepad-list-item.is-open-tab:not(.is-active) {
  border-color: rgba(148, 163, 184, 0.35);
}

.notepad-list-open-tab {
  position: absolute;
  right: 6px;
  bottom: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #475569;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.9);
  color: #cbd5e1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
}

.notepad-list-item:hover .notepad-list-open-tab,
.notepad-list-item.is-active .notepad-list-open-tab {
  opacity: 1;
}

.notepad-list-open-tab:hover {
  border-color: #818cf8;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.2);
}

.notepad-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.notepad-tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 8px 0;
  border-bottom: 1px solid #334155;
  background: rgba(15, 23, 42, 0.65);
  scrollbar-width: thin;
}

.notepad-tabs[hidden] {
  display: none !important;
}

.notepad-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 180px;
  height: 32px;
  padding: 0 6px 0 10px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: rgba(51, 65, 85, 0.35);
  color: #94a3b8;
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
}

.notepad-tab:hover {
  color: #e2e8f0;
  background: rgba(71, 85, 105, 0.55);
}

.notepad-tab.is-active {
  color: #e2e8f0;
  background: #1e293b;
  border-color: #475569;
  box-shadow: 0 1px 0 #1e293b;
}

.notepad-tab.is-dirty .notepad-tab-title::before {
  content: "? ";
  color: #fbbf24;
  font-size: 0.7em;
}

.notepad-tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.notepad-tab-close {
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

.notepad-tab-close:hover {
  background: rgba(248, 113, 113, 0.25);
  color: #fecaca;
}

.notepad-paste-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 220px;
  resize: vertical;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 10px 12px;
  font-size: 0.86rem;
  line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.notepad-list-item.is-active {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.16);
}

.notepad-list-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
  word-break: break-word;
}

.notepad-list-preview {
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.4;
  margin-bottom: 4px;
  word-break: break-word;
}

.notepad-list-time {
  font-size: 0.7rem;
  color: #64748b;
}

.notepad-main {
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.35);
}

.notepad-editor,
.notepad-editor-empty {
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  overflow: hidden;
}

/* ????? display:flex??? [hidden] ?????????? */
.notepad-editor[hidden],
.notepad-editor-empty[hidden] {
  display: none !important;
}

.notepad-editor-empty {
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.92rem;
}

.notepad-title-input,
.notepad-tags-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #0f172a;
  color: #f8fafc;
  padding: 10px 12px;
  flex-shrink: 0;
}

.notepad-title-input {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.notepad-tags-wrap {
  position: relative;
  flex-shrink: 0;
  margin-bottom: 10px;
  z-index: 60;
}

.notepad-tags-input {
  font-size: 0.86rem;
  font-weight: 400;
  margin-bottom: 0;
  color: #e2e8f0;
}

.notepad-tags-input::placeholder {
  color: #64748b;
}

.notepad-tags-suggest {
  position: fixed;
  z-index: 16000;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #0f172a;
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.55);
}

.notepad-tags-suggest[hidden] {
  display: none !important;
}

.notepad-tags-suggest-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: #e2e8f0;
  font-size: 0.86rem;
  cursor: pointer;
}

.notepad-tags-suggest-item:hover,
.notepad-tags-suggest-item.is-active {
  background: rgba(99, 102, 241, 0.22);
  color: #c7d2fe;
}

.notepad-tags-suggest-empty {
  padding: 8px 12px;
  color: #64748b;
  font-size: 0.8rem;
}

.notepad-list-tags {
  font-size: 0.7rem;
  color: #a5b4fc;
  margin-bottom: 4px;
  word-break: break-word;
}

.notepad-action-menus {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

.notepad-dropup {
  position: relative;
}

.notepad-dropup-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  min-width: 160px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0f172a;
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.55);
  z-index: 15050;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notepad-dropup-menu[hidden] {
  display: none !important;
}

.notepad-dropup-menu button {
  appearance: none;
  border: none;
  background: transparent;
  color: #e2e8f0;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.84rem;
  white-space: nowrap;
}

.notepad-dropup-menu button:hover {
  background: rgba(99, 102, 241, 0.2);
}

.notepad-content-input {
  flex: 1;
  width: 100%;
  min-height: 0;
  box-sizing: border-box;
  border: 1px solid #475569;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  font-size: 0.92rem;
  line-height: 1.6;
  resize: vertical;
}

.notepad-editor-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 320px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  border: 1px solid #475569;
  border-radius: 10px;
  overflow: auto;
  background: #fff;
}

.notepad-editor-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.92);
  color: #475569;
  font-size: 0.9rem;
}

.notepad-editor-loading[hidden] {
  display: none !important;
}

/* ??????????? UEditor ?? display/flex????????????? */
.notepad-editor-wrap > .edui-default {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.notepad-editor-wrap .edui-editor {
  border: none !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.chat-selection-toolbar {
  position: fixed;
  z-index: 12050;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
  border: 1px solid #e2e8f0;
}

.chat-selection-toolbar[hidden] {
  display: none !important;
}

.chat-hl-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.15);
  cursor: pointer;
  padding: 0;
}

.chat-hl-swatch-yellow { background: #fef08a; }
.chat-hl-swatch-cyan { background: #a5f3fc; }
.chat-hl-swatch-pink { background: #fbcfe8; }

.chat-sel-action {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-sel-action:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.msg-bubble mark.chat-hl {
  border-radius: 2px;
  padding: 0 2px;
  color: #000 !important;
}

.msg-bubble mark.chat-hl-yellow {
  background: #fef08a;
  color: #000 !important;
}

.msg-bubble mark.chat-hl-cyan {
  background: #a5f3fc;
  color: #000 !important;
}

.msg-bubble mark.chat-hl-pink {
  background: #fbcfe8;
  color: #000 !important;
}

.notepad-editor-actions {
  position: relative;
  z-index: 15000;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  flex-shrink: 0;
  overflow: visible;
}

.notepad-save-hint {
  font-size: 0.78rem;
  color: #94a3b8;
  order: -1;
  width: 100%;
  margin: 0 0 2px;
}

.chat-selection-toolbar.is-notepad {
  z-index: 14050;
}

@media (max-width: 760px) {
  .notepad-body {
    grid-template-columns: 1fr;
    min-height: min(72vh, 640px);
  }

  .notepad-body.is-sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .notepad-body.is-sidebar-collapsed .notepad-sidebar {
    display: none;
  }

  .notepad-sidebar {
    border-right: 0;
    border-bottom: 1px solid #334155;
    max-height: 38vh;
  }
}

.favorites-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.favorite-item {
  border: 1px solid #475569;
  border-radius: 10px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.55);
}

.favorite-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.favorite-item-title {
  font-weight: 600;
  color: #f1f5f9;
  font-size: 0.92rem;
}

.favorite-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.favorite-item-content {
  font-size: 0.85rem;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  max-height: 120px;
  overflow: auto;
}

.favorite-item-thumb {
  max-width: 120px;
  max-height: 80px;
  border-radius: 6px;
  margin-top: 8px;
  display: block;
}

.my-articles-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.my-article-item {
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.my-article-item-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.my-article-item-main {
  flex: 1;
  min-width: 0;
}

.my-article-item-title {
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
  cursor: pointer;
  user-select: none;
}

.my-article-item-title:hover {
  color: #f8fafc;
}

.my-article-item-meta {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 4px;
}

.my-article-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-self: flex-end;
}

.my-article-item-actions .btn-xsmall {
  font-size: 0.72rem;
  padding: 3px 8px;
  line-height: 1.3;
}

.my-characters-body {
  padding: 12px 16px 18px !important;
  max-height: calc(85vh - 56px);
  overflow-y: auto;
}

.my-characters-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.my-character-card {
  border: 1px solid #334155;
  border-radius: 12px;
  background: #020617;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.my-character-thumb-wrap {
  aspect-ratio: 16 / 9;
  background: #0f172a;
}

.my-character-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.my-character-info {
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.my-character-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.35;
  word-break: break-word;
}

.my-character-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.msg-text-btn {
  min-width: 2.2rem;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

@media (max-width: 768px) {
  .my-characters-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

.my-projects-body,
.my-project-view-body {
  padding: 12px 16px 18px !important;
  max-height: calc(85vh - 56px);
  overflow-y: auto;
}

.my-project-view-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.my-project-side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 0;
  max-height: calc(85vh - 72px);
  overflow-y: auto;
  padding-right: 2px;
}

.my-project-side-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border: 1px solid #334155;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
  overflow: hidden;
}

.my-project-side-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 12px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.my-project-side-toggle:hover {
  background: rgba(148, 163, 184, 0.08);
}

.my-project-side-title {
  margin: 0;
  font-size: 0.9rem;
  color: #e2e8f0;
}

.my-project-side-chevron {
  flex-shrink: 0;
  font-size: 0.65rem;
  color: #94a3b8;
  transition: transform 0.15s ease;
}

.my-project-side-block.is-collapsed .my-project-side-chevron {
  transform: rotate(-90deg);
}

.my-project-side-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px 12px;
}

.my-project-side-block.is-collapsed .my-project-side-body {
  display: none;
}

.soft-article-result-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 60vh;
  overflow: auto;
}

.soft-article-result-item {
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.4);
}

.soft-article-result-item.is-error {
  border-color: #7f1d1d;
}

.soft-article-result-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.soft-article-result-meta {
  font-size: 0.8rem;
  color: #94a3b8;
}

.soft-article-result-body {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 10px;
  font-family: inherit;
  font-size: 0.88rem;
  color: #e2e8f0;
  max-height: 220px;
  overflow: auto;
}

.soft-article-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.compare-poster-modal-card {
  max-width: min(1100px, 96vw);
}

.compare-poster-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 450px);
  gap: 16px;
  align-items: start;
}

.compare-poster-form {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.compare-poster-form > .form-field,
.compare-poster-form > .form-actions {
  margin-top: 10px;
  margin-bottom: 6px;
}

.compare-poster-form > .form-field:first-child {
  margin-top: 0;
}

.compare-poster-template-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.compare-poster-bg-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 8px;
}

.compare-poster-bg-color-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  font-size: 0.85rem;
}

.compare-poster-bg-color-item input[type="color"] {
  width: 42px;
  height: 28px;
  padding: 0;
  border: 1px solid #475569;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.compare-poster-actions {
  margin: 8px 0 4px;
}

.compare-poster-brand-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow: auto;
  padding: 4px 2px;
}

.compare-poster-brand-row {
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 8px;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.compare-poster-brand-row.is-own {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35);
}

.compare-poster-brand-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #e2e8f0;
  font-size: 0.85rem;
}

.compare-poster-brand-row input {
  width: 100%;
  border: 1px solid #475569;
  border-radius: 6px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 6px 8px;
  font-size: 0.85rem;
}

.compare-poster-brand-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.compare-poster-preview-wrap {
  position: sticky;
  top: 0;
  max-width: 450px;
  width: 100%;
  justify-self: center;
}

.compare-poster-preview-stage {
  position: relative;
  overflow: hidden;
  max-height: min(70vh, 720px);
  border-radius: 12px;
  border: 1px solid #334155;
  background: #0f172a;
  padding: 8px;
}

.compare-poster-preview-inner {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  transform-origin: top center;
  will-change: transform;
}

.compare-poster-canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  background: #0f172a;
  display: block;
}

.compare-poster-loupe {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  pointer-events: none;
  z-index: 5;
  background: #0f172a;
}

.compare-poster-loupe canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
}

.compare-poster-zoom-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.compare-poster-brand-row-head-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.compare-poster-brand-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #475569;
  background: #0f172a;
}

.compare-poster-field-with-count {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.compare-poster-char-count {
  font-size: 0.72rem;
  color: #94a3b8;
  text-align: right;
  line-height: 1.2;
}

.compare-poster-char-count.is-over {
  color: #f87171;
}

.compare-poster-char-count.is-short {
  color: #fbbf24;
}

@media (max-width: 900px) {
  .compare-poster-layout {
    grid-template-columns: 1fr;
  }
  .compare-poster-preview-wrap {
    position: static;
    max-width: 450px;
    margin: 0 auto;
  }
}

.my-project-slogans-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
  position: sticky;
  top: 0;
}

.my-project-slogans-title {
  margin: 0;
  font-size: 0.9rem;
  color: #e2e8f0;
}

.my-project-slogans-input {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.45;
  font-family: inherit;
}

.my-project-gen-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.my-project-gen-field > span {
  font-size: 12px;
  color: #94a3b8;
}

.my-project-gen-field input,
.my-project-gen-field select,
.my-project-gen-field textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
}

.my-project-gen-types-btn {
  width: 100%;
  justify-content: center;
}

.my-project-gen-types-label {
  margin: 0;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.4;
  word-break: break-word;
}

.my-project-gen-status {
  margin: 0;
  font-size: 12px;
  color: #a5b4fc;
  line-height: 1.4;
}

.project-article-gen-bar .pipeline-queue-head-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.project-article-types-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.project-article-type-card {
  text-align: left;
  border: 1px solid #334155;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.project-article-type-card:hover {
  border-color: #64748b;
}

.project-article-type-card.is-selected {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.18);
}

.project-article-type-card .type-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.project-article-type-card .type-intro,
.project-article-type-card .type-fit,
.project-article-type-card .type-example {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
  margin-top: 2px;
}

.my-project-gen-result-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.my-project-gen-result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(55vh, 480px);
  overflow-y: auto;
}

.my-project-gen-result-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
}

.my-project-gen-result-item .title-btn {
  flex: 1;
  text-align: left;
  background: none;
  border: none;
  color: #e2e8f0;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}

.my-project-gen-result-item .title-btn:hover {
  color: #a5b4fc;
}

.my-project-gen-result-item .meta {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

.my-project-gen-detail-content {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  width: 100%;
  min-height: 280px;
  max-height: min(55vh, 480px);
  overflow-y: auto;
  resize: vertical;
  box-sizing: border-box;
}

.my-project-view-main {
  min-width: 0;
}

@media (max-width: 720px) {
  .my-project-view-layout {
    grid-template-columns: 1fr;
  }
  .my-project-side-panel,
  .my-project-slogans-panel {
    position: static;
    max-height: none;
  }
  .project-article-types-grid {
    grid-template-columns: 1fr;
  }
}

.icon-tool-btn.active-mode {
  color: #a5b4fc;
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.18);
}

.my-projects-toolbar,
.my-project-view-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.intro-outro-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 640px) {
  .intro-outro-row {
    grid-template-columns: 1fr;
  }
}

.intro-outro-block h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.intro-outro-preview {
  width: 100%;
  max-height: 160px;
  background: #0f172a;
  border-radius: 8px;
  border: 1px solid #334155;
}

.intro-outro-name {
  font-size: 12px;
  color: #94a3b8;
  margin: 6px 0;
  word-break: break-all;
}

.photo-video-batch-job-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 8px;
}

.photo-video-batch-job-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
  font-size: 12px;
  color: #cbd5e1;
}

.photo-video-batch-job-item .meta {
  color: #94a3b8;
}

.my-projects-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.my-project-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
}

.my-project-card-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: #f1f5f9;
}

.my-project-card-meta {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 4px;
}

.my-project-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.my-project-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.my-project-image-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #334155;
  background: #0f172a;
}

.my-project-image-card img,
.my-project-image-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.my-project-media-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: #fff;
  background: rgba(15, 23, 42, 0.75);
  pointer-events: none;
}

.my-project-intro-outro {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.my-project-intro-outro .intro-outro-preview {
  width: 100%;
  max-height: 140px;
  background: #020617;
  border-radius: 6px;
}

.photo-video-intro-project-wrap {
  margin-top: 4px;
}

.photo-video-ref-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 10px;
}

.photo-video-ref-card {
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px;
  background: #0f172a;
}

.photo-video-ref-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.photo-video-ref-card-head video {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  background: #020617;
  flex-shrink: 0;
}

.photo-video-ref-card-meta {
  flex: 1;
  min-width: 0;
}

.photo-video-ref-card-name {
  font-size: 0.85rem;
  color: #e2e8f0;
  word-break: break-all;
}

.photo-video-ref-card-project {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 2px;
}

.photo-video-ref-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.photo-video-ref-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.photo-video-ref-fields input,
.photo-video-ref-fields select {
  width: 100%;
  border: 1px solid #334155;
  border-radius: 6px;
  background: #020617;
  color: #e2e8f0;
  padding: 6px 8px;
  font-size: 0.85rem;
}

.photo-video-ref-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.photo-video-ref-pick-card {
  position: relative;
  border: 1px solid #334155;
  border-radius: 8px;
  overflow: hidden;
  background: #0f172a;
  cursor: pointer;
}

.photo-video-ref-pick-card.is-selected {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px #38bdf8;
}

.photo-video-ref-pick-card video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #020617;
}

.photo-video-ref-pick-card .photo-video-ref-pick-name {
  padding: 6px 8px;
  font-size: 0.75rem;
  color: #cbd5e1;
  line-height: 1.35;
}

.photo-video-ref-pick-card .photo-video-ref-pick-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #38bdf8;
  color: #0f172a;
  font-size: 12px;
  display: none;
  align-items: center;
  justify-content: center;
}

.photo-video-ref-pick-card.is-selected .photo-video-ref-pick-check {
  display: flex;
}

.my-project-upload-btn {
  cursor: pointer;
}

.my-article-view-meta {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 12px;
}

.my-article-view-brief {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.08);
}

.my-article-view-brief-label {
  display: block;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 6px;
}

.my-article-view-field {
  margin-bottom: 12px;
}

.my-article-content-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.my-article-content-label-row > span {
  font-size: 13px;
  color: #94a3b8;
}

#articleEditorWrap {
  border: 1px solid #334155;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.my-article-view-content {
  white-space: pre-wrap;
  line-height: 1.7;
  color: #e2e8f0;
  width: 100%;
  min-height: 280px;
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.35);
  resize: vertical;
  font-family: inherit;
  font-size: inherit;
  box-sizing: border-box;
}

.my-article-view-content-preview {
  white-space: pre-wrap;
  line-height: 1.75;
  color: #e2e8f0;
  width: 100%;
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
  box-sizing: border-box;
  margin-bottom: 10px;
}

.my-article-view-content-preview .my-article-inline-para {
  margin: 0 0 12px;
  white-space: pre-wrap;
}

.my-article-view-content-preview .my-article-inline-image-wrap {
  margin: 12px 0;
  text-align: center;
}

.my-article-view-content-preview .my-article-inline-image-wrap img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #334155;
}

.my-article-inline-image-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.my-publish-view-cover {
  margin-bottom: 12px;
}

.my-publish-view-cover img {
  max-width: 240px;
  height: auto;
  border-radius: 8px;
  border: 1px solid #334155;
}

.my-publish-view-content {
  min-height: 200px;
  max-height: 420px;
}

.my-publish-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(100, 116, 139, 0.25);
  color: #94a3b8;
  flex-shrink: 0;
}

.my-publish-status-badge.is-published {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.my-publish-toolbar {
  margin-bottom: 14px;
}

.my-publish-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.9rem;
}

.my-publish-search-input:focus {
  outline: none;
  border-color: #64748b;
}

.my-publish-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.my-publish-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  min-height: 180px;
}

.my-publish-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.my-publish-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: #f1f5f9;
  word-break: break-word;
}

.my-publish-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.my-publish-card-row {
  display: flex;
  gap: 8px;
  line-height: 1.45;
}

.my-publish-card-label {
  flex-shrink: 0;
  width: 4.5em;
  color: #94a3b8;
}

.my-publish-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #334155;
}

.my-publish-status-change {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 0.8rem;
  color: #94a3b8;
}

.my-publish-status-select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.8rem;
}

.my-publish-platform-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 6px;
}

.my-publish-platform-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: #e2e8f0;
  cursor: pointer;
}

.my-publish-list-cover-wrap {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #334155;
}

.my-publish-list-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.my-article-view-images {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.my-article-illustration-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.my-article-illustration-card {
  border: 1px solid #334155;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.35);
}

.my-article-illustration-card.is-regenerating {
  opacity: 0.65;
  pointer-events: none;
}

.my-article-illustration-card img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
  border: none;
  border-radius: 0;
}

.my-article-illustration-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  font-size: 0.78rem;
  color: #94a3b8;
}

.my-article-illustration-snippet {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-article-illustration-regen-btn {
  flex-shrink: 0;
  font-size: 0.72rem;
  padding: 2px 8px;
}

.my-article-view-images img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid #334155;
  cursor: zoom-in;
}

.my-article-main-images {
  margin-top: 12px;
}

.my-article-images-section-label {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

.my-article-view-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.my-article-view-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.my-article-view-header h3 {
  flex: 1;
  min-width: 0;
}

.my-article-main-image-card {
  position: relative;
  border: 2px solid #334155;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.5);
}

.my-article-main-image-card.selected {
  border-color: #6366f1;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35);
}

.my-article-main-image-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.my-article-main-image-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  font-size: 0.75rem;
}

.my-article-main-image-badge {
  color: #a5b4fc;
  font-size: 0.72rem;
}

.my-article-main-image-select-btn {
  font-size: 0.72rem;
  padding: 2px 8px;
}

.my-article-main-images-hint {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0 0 8px;
}

.my-article-main-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.my-article-main-images-grid img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-main-image-prompt {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
  box-sizing: border-box;
}

.article-main-image-templates {
  margin-top: 4px;
}

.article-main-image-templates-label {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

.article-main-image-template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.article-main-image-template-btn {
  padding: 8px 6px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #0f172a;
  color: #cbd5e1;
  font-size: 0.78rem;
  cursor: pointer;
  text-align: center;
}

.article-main-image-template-btn:hover,
.article-main-image-template-btn.active {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.15);
  color: #e0e7ff;
}

.article-main-image-actions {
  justify-content: space-between;
  margin-top: 12px;
}

.rewrite-loading-card {
  text-align: center;
}

.rewrite-loading-body {
  padding: 28px 20px !important;
}

.rewrite-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 16px;
  border: 3px solid #334155;
  border-top-color: #818cf8;
  border-radius: 50%;
  animation: rewriteSpin 0.8s linear infinite;
}

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

.rewrite-loading-text {
  color: #e2e8f0;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.rewrite-stop-btn {
  min-width: 88px;
  border-color: #64748b;
  color: #e2e8f0;
}

.rewrite-stop-btn:hover:not(:disabled) {
  border-color: #f87171;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
}

.rewrite-stop-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.model-multi-bar .btn-small.active-mode {
  border-color: #818cf8;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.18);
}

.topic-round-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 12px 0 4px;
}

.topic-round-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #475569;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.55);
}

.topic-round-option input {
  accent-color: #6366f1;
}

.discussion-round-marker {
  text-align: center;
  font-size: 0.78rem;
  color: #64748b;
  padding: 10px 0 4px;
  letter-spacing: 0.04em;
}

.debate-side-marker {
  text-align: center;
  font-size: 0.76rem;
  font-weight: 600;
  color: #818cf8;
  padding: 8px 0 2px;
}

.debate-team-section {
  margin: 14px 0 4px;
}

.debate-team-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.debate-side-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.debate-side-badge.pro {
  color: #86efac;
  background: rgba(34, 197, 94, 0.15);
}

.debate-side-badge.con {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
}

.debate-side-badge.host {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.15);
}

.debate-team-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
}

.debate-chip,
.debate-chip-empty {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
}

.debate-chip {
  color: #e2e8f0;
  background: rgba(51, 65, 85, 0.65);
  border: 1px solid #475569;
}

.debate-chip-empty {
  color: #64748b;
  font-style: italic;
}

.debate-round-label {
  margin-top: 14px;
  margin-bottom: 4px;
  font-size: 0.85rem;
  color: #94a3b8;
}

.debate-round-options {
  grid-template-columns: repeat(3, 1fr);
}

.werewolf-panel {
  flex-shrink: 0;
  margin: 8px 16px 0;
  padding: 12px 14px;
  border: 1px solid #334155;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
}

.werewolf-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.party-panel-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.party-panel-chevron {
  font-size: 0.65rem;
  color: #64748b;
  transition: transform 0.2s ease;
}

.party-game-panel.collapsed .party-panel-body {
  display: none;
}

.party-game-panel.collapsed .werewolf-panel-head {
  margin-bottom: 0;
}

.party-game-panel.collapsed .party-panel-chevron {
  transform: rotate(-90deg);
}

.werewolf-panel-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #e2e8f0;
}

.werewolf-phase-label {
  font-size: 0.78rem;
  color: #a5b4fc;
}

.werewolf-seat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.werewolf-seat {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #475569;
  background: rgba(30, 41, 59, 0.65);
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
}

.werewolf-seat-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.werewolf-seat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(148, 163, 184, 0.45);
}

.werewolf-seat-avatar-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #e2e8f0;
  background: rgba(51, 65, 85, 0.9);
  border: 2px solid rgba(148, 163, 184, 0.35);
}

.werewolf-shield-question {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 12px 0 10px;
  line-height: 1.5;
}

.werewolf-shield-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.werewolf-shield-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #475569;
  background: rgba(30, 41, 59, 0.55);
  cursor: pointer;
  font-size: 0.88rem;
  color: #cbd5e1;
}

.werewolf-shield-option:has(input:checked) {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.werewolf-shield-option input {
  margin-top: 3px;
  flex-shrink: 0;
}

.werewolf-shield-result {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
  margin-bottom: 8px;
}

.werewolf-shield-result.ok {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.35);
}

.werewolf-shield-result.err {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.werewolf-seat.dead {
  opacity: 0.45;
  border-color: #334155;
}

.werewolf-seat-num {
  font-weight: 700;
  color: #cbd5e1;
}

.werewolf-seat-name {
  color: #e2e8f0;
  margin-top: 2px;
}

.werewolf-seat-role {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
}

.werewolf-seat-role.wolf {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.18);
}

.werewolf-seat-role.seer {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.18);
}

.undercover-panel {
  border-color: rgba(236, 72, 153, 0.35);
}

.undercover-panel .werewolf-panel-title {
  color: #f9a8d4;
}

.werewolf-seat-role.civilian {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.werewolf-seat-role.undercover {
  background: rgba(236, 72, 153, 0.2);
  color: #f9a8d4;
}

.werewolf-seat-role.villager {
  color: #86efac;
  background: rgba(34, 197, 94, 0.15);
}

.werewolf-seat-word {
  font-size: 0.65rem;
  color: #94a3b8;
  margin-top: 4px;
}

.werewolf-system-msg {
  text-align: center;
  font-size: 0.8rem;
  color: #94a3b8;
  padding: 8px 12px;
  margin: 6px 0;
  border-radius: 8px;
  background: rgba(51, 65, 85, 0.35);
  line-height: 1.45;
}

.werewolf-private-msg {
  text-align: center;
  font-size: 0.82rem;
  color: #fde68a;
  padding: 8px 12px;
  margin: 6px 0;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  line-height: 1.45;
}

.werewolf-action-bar {
  padding: 10px 12px 0;
  border-top: 1px solid rgba(51, 65, 85, 0.6);
}

.mini-game-restart-bar {
  padding: 12px;
  border-top: 1px solid rgba(51, 65, 85, 0.6);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.mini-game-restart-bar[hidden] {
  display: none !important;
}

.mini-game-restart-bar.mini-game-in-progress {
  justify-content: flex-end;
  padding-top: 8px;
}

.mini-game-restart-bar.mini-game-in-progress .mini-game-restart-msg {
  display: none;
}

.mini-game-restart-msg {
  flex: 1 1 200px;
  margin: 0;
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.mini-game-restart-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.story-relay-style-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.story-relay-style-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.6);
  font-size: 0.72rem;
  color: #cbd5e1;
  cursor: pointer;
  text-align: center;
  line-height: 1.25;
  min-height: 34px;
}

.story-relay-style-option:has(input:checked) {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.2);
  color: #e0e7ff;
}

.story-relay-style-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.story-relay-style-option span {
  pointer-events: none;
}

.werewolf-action-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #c7d2fe;
  margin-bottom: 8px;
}

.werewolf-action-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.werewolf-target-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #475569;
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  font-size: 0.82rem;
  cursor: pointer;
}

.werewolf-target-btn:hover {
  border-color: #818cf8;
}

.werewolf-target-btn.selected {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.25);
  color: #e0e7ff;
}

.werewolf-action-bar.undercover-vote-mode {
  padding: 8px 0 0;
  border-top: 1px solid rgba(51, 65, 85, 0.6);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.werewolf-action-bar.undercover-vote-mode .werewolf-action-title {
  margin-bottom: 0;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.undercover-vote-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  padding: 0;
  overflow: visible;
}

.undercover-vote-card {
  flex: none;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border: 2px solid rgba(71, 85, 105, 0.8);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.undercover-vote-card:hover {
  border-color: #818cf8;
}

.undercover-vote-card.selected {
  border-color: #a78bfa;
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.35);
}

.undercover-vote-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 200px;
  min-height: 0;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.5), rgba(15, 23, 42, 0.9));
  overflow: hidden;
}

.undercover-vote-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.undercover-vote-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: rgba(148, 163, 184, 0.5);
  background: radial-gradient(circle at 50% 30%, rgba(99, 102, 241, 0.15), transparent 60%);
}

.undercover-vote-card-seat {
  padding: 4px 4px 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  text-align: center;
}

.undercover-vote-card-name {
  padding: 0 4px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #f1f5f9;
  text-align: center;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.undercover-vote-confirm-btn {
  flex-shrink: 0;
  width: 100%;
  margin-top: 4px;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.undercover-vote-confirm-btn:hover {
  filter: brightness(1.08);
}

.undercover-vote-confirm-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.composer.undercover-vote-active .composer-row {
  display: none;
}

.composer.undercover-vote-active {
  padding-top: 8px;
  padding-bottom: 10px;
}

.undercover-vote-modal .modal-backdrop {
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(4px);
}

.undercover-vote-result-card {
  position: relative;
  overflow: hidden;
  max-width: 440px;
  border: 1px solid rgba(129, 140, 248, 0.45);
  box-shadow:
    0 0 0 1px rgba(99, 102, 241, 0.2),
    0 24px 60px rgba(15, 23, 42, 0.85),
    0 0 40px rgba(99, 102, 241, 0.15);
  background: linear-gradient(165deg, #1e1b4b 0%, #0f172a 45%, #1e293b 100%);
}

.undercover-vote-result-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    radial-gradient(circle at 20% 15%, rgba(167, 139, 250, 0.35) 0%, transparent 42%),
    radial-gradient(circle at 85% 80%, rgba(99, 102, 241, 0.28) 0%, transparent 40%),
    repeating-linear-gradient(
      -32deg,
      transparent,
      transparent 14px,
      rgba(148, 163, 184, 0.04) 14px,
      rgba(148, 163, 184, 0.04) 15px
    );
  pointer-events: none;
}

.undercover-vote-result-inner {
  position: relative;
  z-index: 1;
  padding: 20px 22px 18px;
}

.undercover-vote-result-header {
  text-align: center;
  margin-bottom: 16px;
}

.undercover-vote-result-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.22);
  border: 1px solid rgba(129, 140, 248, 0.35);
  margin-bottom: 8px;
}

.undercover-vote-result-header h3 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(90deg, #e0e7ff, #a5b4fc, #f0abfc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.undercover-vote-result-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.undercover-vote-eliminated {
  text-align: center;
  padding: 14px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.undercover-vote-eliminated.tie {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(120, 53, 15, 0.2);
}

.undercover-vote-eliminated-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 6px;
}

.undercover-vote-eliminated-meta {
  font-size: 0.82rem;
  color: #94a3b8;
}

.undercover-vote-role-tag {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.undercover-vote-role-tag.civilian {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(74, 222, 128, 0.35);
}

.undercover-vote-role-tag.undercover {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.undercover-vote-role-tag.wolf {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.undercover-vote-role-tag.seer {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.undercover-vote-role-tag.villager {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(74, 222, 128, 0.35);
}

.undercover-vote-tally-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 6px;
}

.undercover-vote-tally-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.undercover-vote-tally-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.8rem;
  color: #e2e8f0;
}

.undercover-vote-tally-row.is-winner .undercover-vote-tally-name {
  color: #fde68a;
  font-weight: 700;
}

.undercover-vote-tally-bar-wrap {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.8);
  overflow: hidden;
}

.undercover-vote-tally-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  transition: width 0.45s ease;
}

.undercover-vote-tally-row.is-winner .undercover-vote-tally-bar {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.undercover-vote-detail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 120px;
  overflow-y: auto;
}

.undercover-vote-detail-list li {
  font-size: 0.76rem;
  color: #cbd5e1;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.55);
}

.undercover-vote-result-actions {
  margin-top: 16px;
  justify-content: center;
}

.undercover-vote-result-ok {
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.undercover-vote-result-ok:hover {
  filter: brightness(1.06);
}

.werewolf-seat.is-me {
  border-color: #818cf8;
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.35);
}

.werewolf-seat-role.unknown {
  color: #94a3b8;
  background: rgba(51, 65, 85, 0.5);
}

.werewolf-join-label {
  margin: 10px 0 4px;
}

.werewolf-seat-pick {
  margin: 8px 0 12px;
}

.werewolf-seat-options {
  grid-template-columns: repeat(3, 1fr);
}

.model-item.model-item-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.topic-end-text {
  color: #cbd5e1;
  text-align: center;
  margin: 8px 0 4px;
}

.msg-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.msg-sender-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.02em;
  line-height: 1.2;
  padding: 0 2px;
  user-select: none;
}

.msg.assistant .msg-sender-name {
  color: #94a3b8;
}

.msg-icon-actions {
  display: flex;
  gap: 6px;
  padding: 0 2px;
}

.msg-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #475569;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.65);
  color: #94a3b8;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.msg-icon-btn:hover {
  border-color: #818cf8;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.12);
}

.msg-icon-btn.is-speaking {
  border-color: #34d399;
  color: #a7f3d0;
  background: rgba(52, 211, 153, 0.15);
}

.msg-icon-btn.is-speaking:hover {
  border-color: #f87171;
  color: #fecaca;
  background: rgba(248, 113, 113, 0.12);
}

.msg-bubble {
  padding: 12px 14px;
  border-radius: 14px;
  line-height: 1.55;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.user .msg-bubble {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-bottom-right-radius: 4px;
}

.msg.assistant .msg-bubble {
  background: #1e293b;
  border: 1px solid #475569;
  border-bottom-left-radius: 4px;
}

.msg-bubble img {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 8px;
  display: block;
  cursor: zoom-in;
}

.msg-bubble .msg-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.msg-loading {
  color: #94a3b8;
  font-style: italic;
}

.loading-dots {
  display: inline-block;
  min-width: 1.35em;
  text-align: left;
}

.composer {
  border-top: 1px solid #334155;
  padding: 12px;
  background: rgba(15, 23, 42, 0.85);
  flex-shrink: 0;
}

.composer-actions-wrap {
  position: relative;
  flex: 0 0 auto;
  width: auto;
  display: flex;
  align-items: center;
}

.aspect-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  min-width: 280px;
  padding: 10px;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 20;
}

.aspect-popover[hidden] {
  display: none !important;
}

.aspect-popover-title {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

.aspect-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.aspect-popover-head .aspect-popover-title {
  margin-bottom: 0;
}

.preset-clear-btn {
  flex-shrink: 0;
  padding: 2px 8px;
  border: 1px solid #475569;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  font-size: 0.72rem;
  line-height: 1.4;
  cursor: pointer;
}

.preset-clear-btn:hover:not(:disabled) {
  border-color: #818cf8;
  color: #e0e7ff;
  background: rgba(99, 102, 241, 0.12);
}

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

.aspect-options-compact {
  margin-bottom: 0;
  gap: 6px;
}

.aspect-options-compact .aspect-option {
  padding: 6px 8px;
  font-size: 0.72rem;
}

#aspectRatioBtn,
#wordLimitBtn {
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}

.composer.mode-text #aspectRatioBtn,
.composer.mode-text #imagePresetBtn,
.composer.mode-text #fourPanelComicBtn,
.composer.mode-text #videoDurationBtn,
.composer.mode-text #videoResolutionBtn,
.composer.mode-text #videoAspectBtn,
.composer.mode-text .video-frames-wrap {
  display: none !important;
}

.composer.mode-image #wordLimitBtn,
.composer.mode-image #pipelineBtn,
.composer.mode-image #videoDurationBtn,
.composer.mode-image #videoResolutionBtn,
.composer.mode-image #videoAspectBtn,
.composer.mode-image .video-frames-wrap {
  display: none !important;
}

.composer.mode-video #wordLimitBtn,
.composer.mode-video #pipelineBtn,
.composer.mode-video #aspectRatioBtn,
.composer.mode-video #imagePresetBtn,
.composer.mode-video #fourPanelComicBtn,
.composer.mode-video #imagePromptHelpBtn,
.composer.mode-video #characterSetupBtn,
.composer.mode-video .image-ref-upload-wrap,
.composer.mode-video .text-ref-upload-wrap {
  display: none !important;
}

.aspect-btn-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: #a5b4fc;
}

.aspect-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.aspect-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border: 2px solid #475569;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.aspect-option:has(input:checked) {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
}

.aspect-option input { display: none; }

.ratio-box {
  display: block;
  border: 2px solid #94a3b8;
  border-radius: 2px;
  background: rgba(148, 163, 184, 0.1);
}

.r-1-1 { width: 28px; height: 28px; }
.r-3-4 { width: 21px; height: 28px; }
.r-4-3 { width: 28px; height: 21px; }
.r-9-16 { width: 16px; height: 28px; }
.r-16-9 { width: 28px; height: 16px; }

.model-row { margin-top: 4px; }

.composer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.image-ref-upload-wrap {
  position: relative;
  flex-shrink: 0;
  align-self: flex-end;
}

.image-ref-upload-btn {
  position: relative;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 1px dashed rgba(148, 163, 184, 0.55);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
  color: #94a3b8;
  cursor: pointer;
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.image-ref-upload-btn:hover {
  border-color: rgba(96, 165, 250, 0.75);
  color: #bfdbfe;
  background: rgba(30, 41, 59, 0.65);
}

.image-ref-upload-plus {
  position: relative;
  z-index: 1;
  font-size: 32px;
  line-height: 1;
  font-weight: 300;
  display: block;
  margin: 0;
  padding: 0;
  transform: translateY(-1px);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}

.image-ref-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-ref-preview.is-placeholder {
  opacity: 0.92;
}

.image-ref-remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.image-ref-remove-btn:hover {
  background: rgba(239, 68, 68, 0.92);
}

.prompt-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #475569;
  border-radius: 14px;
  background: #0f172a;
  padding: 4px 6px 6px;
  transition: border-color 0.15s;
}

.prompt-input-wrap:focus-within {
  border-color: #6366f1;
}

.prompt-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px 2px;
  min-height: 40px;
}

.prompt-tools-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-width: 0;
}

.prompt-tool-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex-shrink: 0;
}

.prompt-tool-btn:hover:not(:disabled),
.prompt-tool-btn.active {
  color: #e2e8f0;
  background: rgba(99, 102, 241, 0.22);
}

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

.prompt-size-menu-btn {
  width: auto;
  min-width: 42px;
  padding: 0 6px;
}

.prompt-tool-chevron {
  opacity: 0.75;
}

.prompt-size-wrap {
  position: relative;
}

.prompt-size-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 30;
  min-width: 120px;
  padding: 4px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #0f172a;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prompt-size-menu[hidden] {
  display: none !important;
}

.prompt-size-menu-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  text-align: left;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 0.82rem;
  cursor: pointer;
}

.prompt-size-menu-item:hover,
.prompt-size-menu-item.active {
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
}

.prompt-size-menu-item[hidden] {
  display: none !important;
}

.prompt-expand-btn,
.prompt-voice-btn,
.prompt-optimize-btn,
.prompt-fullscreen-btn {
  position: static;
  top: auto;
  right: auto;
}

.prompt-voice-btn:hover:not(:disabled),
.prompt-voice-btn.active,
.prompt-expand-btn:hover:not(:disabled),
.prompt-optimize-btn:hover:not(:disabled) {
  color: #e2e8f0;
  background: rgba(99, 102, 241, 0.22);
}

.prompt-input-wrap.expanded #promptInput {
  min-height: min(52vh, 520px);
  max-height: min(75vh, 800px);
}

.prompt-expand-btn.active {
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.3);
}

.composer-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.composer-toolbar-hidden {
  display: none !important;
}

.composer-more-wrap {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.composer-more-btn {
  font-size: 1.35rem;
  font-weight: 300;
  line-height: 1;
}

.composer-more-plus {
  display: block;
  transform: translateY(-1px);
}

.composer-more-btn.open,
.composer-more-btn:hover:not(:disabled) {
  border-color: #818cf8;
  color: #e2e8f0;
  background: rgba(99, 102, 241, 0.12);
}

.composer-more-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  min-width: 168px;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  padding: 6px;
  z-index: 30;
}

.composer-more-menu[hidden] {
  display: none !important;
}

.composer-more-item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #e2e8f0;
  font-size: 0.84rem;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.composer-more-item:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.12);
  color: #f8fafc;
}

.composer-more-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.composer-more-item.active {
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.18);
}

.composer-more-item[hidden] {
  display: none !important;
}

.composer.mode-text .composer-more-image-only {
  display: none !important;
}

.composer.mode-image .composer-more-text-only,
.composer.mode-video .composer-more-text-only,
.composer.mode-video .composer-more-image-only {
  display: none !important;
}

.composer-more-meta {
  color: #a5b4fc;
  font-weight: 700;
}

.composer-more-wrap .composer-more-subpopover {
  left: 0;
  right: auto;
  min-width: 240px;
}

.icon-tool-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #475569;
  border-radius: 12px;
  background: #0f172a;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* display:flex ????? [hidden]?????? */
.icon-tool-btn[hidden] {
  display: none !important;
}

.icon-tool-btn:hover:not(:disabled) {
  border-color: #818cf8;
  color: #e2e8f0;
  background: rgba(99, 102, 241, 0.12);
}

.icon-tool-btn.active {
  border-color: #818cf8;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.2);
}

.export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.35);
  font-size: 0.85rem;
  color: #cbd5e1;
}

.export-bar[hidden] {
  display: none !important;
}

.export-bar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#keywordMineGeoBtn {
  background: linear-gradient(135deg, #f163a5, #f65c9b) !important;
  border-color: transparent !important;
  color: #fff !important;
}

#keywordMineGeoBtn:disabled {
  opacity: 0.65;
}

.btn-primary-small {
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  border-color: transparent !important;
  color: #fff !important;
}

.btn-danger-small {
  background: linear-gradient(135deg, #dc2626, #ef4444) !important;
  border-color: transparent !important;
  color: #fff !important;
}

.delete-bar {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
}

.model-icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #475569;
  border-radius: 12px;
  background: #0f172a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.model-icon-btn:hover:not(:disabled) {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
}

.model-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.model-icon-fallback {
  font-size: 0.72rem;
  font-weight: 700;
  color: #a5b4fc;
  letter-spacing: -0.02em;
}

#promptInput {
  width: 100%;
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 10px 12px 8px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #f1f5f9;
  font-size: 0.95rem;
  line-height: 1.45;
  resize: none;
  outline: none;
  box-sizing: border-box;
}

#promptInput:focus { border-color: transparent; }

.prompt-resize-handle {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 0;
  bottom: auto;
  height: 10px;
  cursor: ns-resize;
  border-radius: 4px;
  opacity: 0.5;
  z-index: 3;
}

.prompt-resize-handle::after {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  margin: 3px auto 0;
  border-radius: 2px;
  background: rgba(148, 163, 184, 0.55);
}

.prompt-resize-handle:hover {
  opacity: 0.95;
  background: rgba(99, 102, 241, 0.12);
}

.prompt-input-wrap.has-custom-height #promptInput {
  overflow-y: auto;
}

body.composer-resizing {
  cursor: ns-resize !important;
  user-select: none;
}

body.composer-resizing * {
  cursor: ns-resize !important;
}

.prompt-fullscreen-btn {
  /* now a menu item; keep class for JS toggles */
}

.prompt-fullscreen-btn:hover,
.prompt-fullscreen-btn.active {
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.2);
}

.composer-stats {
  margin-top: 2px;
  font-size: 0.72rem;
  color: #64748b;
  padding: 0 4px 2px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.composer-stats-count,
.composer-stats-limit {
  font-size: inherit;
  color: inherit;
  flex: 0 0 auto;
  text-align: left;
  white-space: nowrap;
  order: 1;
}

.composer-stats-limit {
  color: #94a3b8;
  margin-left: 2px;
}

.composer-stats-model {
  font-size: inherit;
  color: #94a3b8;
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  margin-left: auto;
  order: 2;
  max-width: 60%;
}

.composer-fullscreen-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(2px);
}

.composer.composer-fullscreen {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1050;
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  border-radius: 14px;
  border: 1px solid #334155;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  padding: 16px;
}

.composer.composer-fullscreen #promptInput {
  min-height: min(60vh, 520px);
  max-height: min(72vh, 680px);
}

.composer.composer-fullscreen .composer-stats {
  font-size: 0.8rem;
}

.feature-limit-hint {
  color: #86efac;
  font-weight: 600;
}

.chat-cleanup-empty-btn {
  width: 100%;
  margin: 0 0 8px;
}

.chat-thread-empty-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(51, 65, 85, 0.65);
  vertical-align: middle;
}

.btn-send, .btn-ghost, .btn-small {
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.btn-send {
  padding: 10px 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  flex-shrink: 0;
}

.btn-send.btn-stop {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

.btn-ghost {
  padding: 6px 12px;
  background: #334155;
  color: #e2e8f0;
  font-size: 0.85rem;
}

.btn-small {
  padding: 5px 10px;
  background: #334155;
  color: #e2e8f0;
  font-size: 0.8rem;
  border: 1px solid #475569;
}

button:disabled { opacity: 0.5; cursor: not-allowed; }

.composer-status { margin-top: 8px; }

.progress-bar {
  height: 4px;
  background: #334155;
  border-radius: 2px;
  overflow: hidden;
  display: none;
}

.progress-bar.active { display: block; }

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width 0.3s;
}

.modal[hidden] { display: none !important; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.modal-card {
  position: relative;
  width: min(420px, 92vw);
  max-height: 70vh;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #334155;
}

.modal-body {
  overflow-y: auto;
  padding: 8px;
}

.model-item-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-item-wrap .model-item {
  flex: 1;
  min-width: 0;
}

.model-item-test {
  flex-shrink: 0;
  padding: 6px 10px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-size: 0.75rem;
  cursor: pointer;
}

.model-item-test:hover:not(:disabled) {
  border-color: #818cf8;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.12);
}

.model-item-test:disabled {
  opacity: 0.55;
  cursor: wait;
}

.model-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #e2e8f0;
  text-align: left;
  cursor: pointer;
}

.model-item:hover, .model-item.active {
  background: rgba(99, 102, 241, 0.15);
}

.model-item img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: #0f172a;
}

.model-item .meta {
  font-size: 0.75rem;
  color: #64748b;
}

.modal-card-sm {
  width: min(360px, 92vw);
}

.modal-card-game-setup {
  max-height: min(92vh, 720px);
}

.modal-card-game-setup .modal-body.form-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.form-body {
  padding: 16px !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.84rem;
  color: #cbd5e1;
}

.form-field input {
  padding: 9px 10px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #0f172a;
  color: #f1f5f9;
}

.form-field select {
  padding: 9px 10px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #0f172a;
  color: #f1f5f9;
  width: 100%;
}

.co-write-option-label {
  margin-top: 4px;
}

.co-write-image-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
}

.co-write-image-count-options {
  grid-template-columns: repeat(3, 1fr);
}

.co-write-image-model-field {
  margin-top: 0;
}

.co-write-illustration-caption {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 8px;
  line-height: 1.45;
}

.co-write-illustration-msg img {
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid #334155;
}

.form-msg {
  min-height: 1.2em;
  font-size: 0.82rem;
  color: #f87171;
}

.form-msg.ok {
  color: #4ade80;
}

.btn-block {
  width: 100%;
}

.image-preview-card {
  position: relative;
  max-width: min(92vw, var(--app-max-width));
  max-height: 90vh;
  padding: 8px;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.image-preview-card img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 24px);
  object-fit: contain;
  border-radius: 8px;
}

.image-preview-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(12px);
  z-index: 200;
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.96);
  border: 1px solid #475569;
  color: #e2e8f0;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast.success {
  border-color: #22c55e;
  color: #bbf7d0;
}

.toast.error {
  border-color: #ef4444;
  color: #fecaca;
}

.prompt-extras {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px dashed #475569;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #94a3b8;
  white-space: pre-wrap;
  word-break: break-word;
}

.word-limit-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.word-limit-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid #475569;
  cursor: pointer;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.word-limit-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.word-limit-option:has(input:checked) {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.18);
  color: #e0e7ff;
}

.preset-category-popover {
  min-width: 280px;
}

.preset-scheme-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #334155;
}

.preset-scheme-select {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.78rem;
}

.preset-scheme-save-btn,
.preset-scheme-del-btn {
  flex-shrink: 0;
  padding: 6px 8px !important;
  font-size: 0.75rem !important;
}

.preset-category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.preset-category-btn {
  padding: 8px 10px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #0f172a;
  color: #cbd5e1;
  font-size: 0.8rem;
  cursor: pointer;
  text-align: center;
}

.preset-category-btn:hover {
  border-color: #818cf8;
  color: #e0e7ff;
}

.preset-category-btn.selected {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.2);
  color: #e0e7ff;
}

.modal-card-md {
  width: min(560px, 92vw);
}

.modal-card-lg {
  width: min(880px, 96vw);
  max-height: 85vh;
}

.image-prompt-help-btn {
  font-size: 1.15rem;
  line-height: 1;
}

.composer.mode-text .image-prompt-help-btn,
.composer.mode-text .image-ref-upload-wrap {
  display: none !important;
}

.composer.mode-image .text-ref-upload-wrap {
  display: none !important;
}

.video-frames-wrap {
  position: relative;
  flex-shrink: 0;
  align-self: flex-end;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: flex-start;
}

.video-input-mode-toggle {
  display: block;
  width: auto;
  margin-bottom: 0;
}

.video-input-mode-toggle[hidden] {
  display: none !important;
}

.video-mode-segment {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 2px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid #334155;
}

.video-mode-tab {
  flex: none;
  border: none;
  background: transparent;
  color: #94a3b8;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.68rem;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  min-width: 0;
}

.video-mode-tab.is-active {
  color: #f8fafc;
  background: rgba(99, 102, 241, 0.35);
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.45);
}

.video-frames-group,
.video-refs-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-end;
}

.video-frames-group[hidden],
.video-refs-group[hidden] {
  display: none !important;
}

.video-ref-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-end;
}

.video-ref-thumb {
  position: relative;
  width: 52px;
  height: 52px;
}

.video-ref-thumb img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #475569;
  display: block;
}

.video-ref-thumb button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.video-frame-slot {
  position: relative;
}

.video-frame-btn {
  position: relative;
}

.video-frame-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  text-align: center;
  font-size: 0.58rem;
  font-weight: 700;
  color: #e2e8f0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.video-duration-popover {
  min-width: 220px;
  padding: 12px 14px;
}

.video-duration-range {
  width: 100%;
  margin: 8px 0 4px;
  accent-color: #818cf8;
}

.video-duration-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #94a3b8;
}

.msg-video-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(520px, 100%);
  width: 100%;
}

.msg-video-wrap video {
  width: 100%;
  border-radius: 10px;
  background: #0f172a;
  max-height: 420px;
  min-height: 180px;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  display: block;
}

.msg-video-error {
  font-size: 13px;
  color: #b91c1c;
  line-height: 1.5;
  padding: 4px 2px;
}

.msg-video-error a {
  color: #4f46e5;
  word-break: break-all;
}

.msg-video-last-frame {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg-video-last-frame span {
  font-size: 0.75rem;
  color: #94a3b8;
}

.msg-video-last-frame img {
  max-width: 220px;
  border-radius: 8px;
  cursor: pointer;
  transition: outline 0.15s ease, transform 0.15s ease;
}

.msg-video-last-frame img:hover {
  outline: 2px solid #818cf8;
  outline-offset: 2px;
  transform: translateY(-1px);
}

.text-ref-upload-wrap {
  position: relative;
  flex-shrink: 0;
  align-self: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-end;
  max-width: min(280px, 42vw);
}

.text-ref-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-end;
}

.text-ref-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.45);
  flex-shrink: 0;
}

.text-ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.text-ref-thumb-remove {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  padding: 0;
}

.text-ref-add-btn {
  width: 56px;
  height: 56px;
}

.text-ref-add-btn .image-ref-upload-plus {
  font-size: 26px;
}

.msg-user-ref-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.msg-user-ref-images img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  cursor: zoom-in;
}

.image-prompt-help-card {
  background: #0f172a;
  border-color: #334155;
}

.image-prompt-help-body {
  padding: 16px 18px 20px !important;
  max-height: calc(85vh - 56px);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.image-prompt-help-body::-webkit-scrollbar {
  display: none;
}

.image-prompt-help-intro h4 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: #f8fafc;
}

.image-prompt-help-intro p {
  margin: 0 0 18px;
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.55;
}

.image-prompt-help-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.image-prompt-help-step-card {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.65);
}

.image-prompt-help-step-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #4ade80;
}

.image-prompt-help-step-card h5 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: #f1f5f9;
}

.image-prompt-help-step-card p {
  margin: 0;
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.5;
}

.image-prompt-help-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 12px;
  margin-bottom: 14px;
}

.image-prompt-help-panel {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.65);
}

.image-prompt-help-panel h5 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: #f1f5f9;
}

.image-prompt-help-muted {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: #94a3b8;
}

.image-prompt-help-formula {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #020617;
  font-size: 0.84rem;
  color: #e2e8f0;
  line-height: 1.55;
}

.image-prompt-help-templates {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.image-prompt-help-templates li {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #020617;
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.image-prompt-help-examples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.image-prompt-help-example-card {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.65);
}

.image-prompt-help-example-card h5 {
  margin: 0 0 6px;
  font-size: 0.92rem;
  color: #f1f5f9;
}

.image-prompt-help-example-card blockquote {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #020617;
  font-size: 0.82rem;
  color: #e2e8f0;
  line-height: 1.55;
}

.image-prompt-help-example-bad blockquote {
  color: #cbd5e1;
}

.image-prompt-help-tip {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: #94a3b8;
}

.image-prompt-help-checklist {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.65);
}

.image-prompt-help-checklist h5 {
  margin: 0 0 12px;
  font-size: 0.92rem;
  color: #f1f5f9;
}

.image-prompt-help-checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.image-prompt-help-check-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #020617;
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.45;
}

@media (max-width: 768px) {
  .image-prompt-help-steps,
  .image-prompt-help-row,
  .image-prompt-help-examples,
  .image-prompt-help-checklist-grid {
    grid-template-columns: 1fr;
  }
}

.character-setup-btn {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  min-width: 2.1rem;
  padding: 0 4px;
}

.composer.mode-text .character-setup-btn {
  display: none !important;
}

.character-setup-card {
  background: #0f172a;
  border-color: #334155;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.character-setup-body {
  padding: 14px 16px 18px !important;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
}

.char-setup-section {
  margin-bottom: 14px;
}

.char-setup-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 6px;
}

.char-setup-hint {
  margin: 4px 0 8px;
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.45;
}

.char-setup-model-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #020617;
  color: #e2e8f0;
  font-size: 0.88rem;
}

.char-setup-fields-panel {
  margin-bottom: 14px;
  border: 1px solid #334155;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.55);
  overflow: hidden;
}

.char-setup-fields-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #334155;
  background: rgba(2, 6, 23, 0.5);
}

.char-setup-fields-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f1f5f9;
}

.char-setup-fields-toggle {
  flex-shrink: 0;
}

.char-setup-fields-panel.is-collapsed .char-setup-fields {
  display: none;
}

.char-setup-fields {
  max-height: min(42vh, 360px);
  overflow-y: auto;
  padding: 8px 10px 10px;
}

.char-setup-group {
  border: 1px solid #1e293b;
  border-radius: 10px;
  margin-bottom: 8px;
  background: #020617;
  overflow: hidden;
}

.char-setup-group:last-child {
  margin-bottom: 0;
}

.char-setup-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: #e2e8f0;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.char-setup-group-toggle:hover {
  background: rgba(51, 65, 85, 0.35);
}

.char-setup-chevron {
  font-size: 0.7rem;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.char-setup-group.is-open .char-setup-chevron {
  transform: rotate(180deg);
}

.char-setup-group-body {
  display: none;
  padding: 0 10px 10px;
}

.char-setup-group.is-open .char-setup-group-body {
  display: block;
}

.char-setup-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.char-setup-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.char-setup-field-label {
  font-size: 0.74rem;
  color: #94a3b8;
  line-height: 1.3;
}

.char-setup-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.8rem;
}

.char-setup-description {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #020617;
  color: #e2e8f0;
  font-size: 0.86rem;
  line-height: 1.55;
  resize: vertical;
}

.char-setup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, #0f172a 70%, transparent);
  padding-bottom: 2px;
}

@media (max-width: 768px) {
  .character-setup-card {
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .character-setup-body {
    max-height: calc(100vh - 52px);
  }

  .char-setup-field-grid {
    grid-template-columns: 1fr;
  }

  .char-setup-fields {
    max-height: min(50vh, 420px);
  }

  .char-setup-actions {
    flex-direction: column-reverse;
  }

  .char-setup-actions .btn-small {
    width: 100%;
    justify-content: center;
  }
}

.image-history-body {
  padding: 12px 16px 16px !important;
  max-height: calc(85vh - 56px);
  overflow: auto;
}

.image-history-hint {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 12px;
}

.image-history-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  margin-left: 16px;
}

.image-history-select-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.image-history-delete-btn {
  background: #dc2626 !important;
  border: 1px solid #b91c1c !important;
}

.image-history-grid.select-mode .image-history-item {
  cursor: pointer;
}

.image-history-item.selected {
  border-color: #818cf8;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
}

.image-history-check {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  width: 18px;
  height: 18px;
  accent-color: #818cf8;
  cursor: pointer;
}

.image-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.image-history-item {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid #475569;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #0f172a;
  padding: 0;
}

.image-history-item:hover {
  border-color: #818cf8;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.image-history-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-history-item time {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4px 6px;
  font-size: 0.65rem;
  color: #e2e8f0;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.88));
  pointer-events: none;
}

.preset-picker-body {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  max-height: min(60vh, 480px);
}

.preset-search-wrap {
  padding: 12px 14px;
  border-bottom: 1px solid #334155;
  background: #0f172a;
  position: sticky;
  top: 0;
  z-index: 2;
}

.preset-search-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 0.9rem;
}

.preset-search-input:focus {
  outline: none;
  border-color: #818cf8;
}

.preset-table-wrap {
  overflow: auto;
  flex: 1;
}

.preset-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  table-layout: fixed;
}

.preset-col-name {
  width: 34%;
  min-width: 5.5em;
}

.preset-name-cell {
  min-width: 5.5em;
  font-weight: 500;
  color: #e2e8f0;
}

.preset-col-desc {
  width: 66%;
}

.preset-table th,
.preset-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #334155;
  text-align: left;
  vertical-align: top;
}

.preset-table th:first-child,
.preset-table td:first-child {
  min-width: 5.5em;
  white-space: normal;
  word-break: break-all;
}

.preset-table th:last-child,
.preset-table td:last-child {
  color: #94a3b8;
  word-break: break-word;
}

.preset-table th {
  color: #94a3b8;
  font-weight: 600;
  background: #0f172a;
  position: sticky;
  top: 0;
}

.preset-table tbody tr {
  cursor: pointer;
}

.preset-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.12);
}

.preset-table tbody tr.active {
  background: rgba(99, 102, 241, 0.22);
}

.preset-empty {
  padding: 24px;
  text-align: center;
  color: #64748b;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .chat-layout {
    height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
  }

  .composer {
    padding: 10px;
  }

  #promptInput {
    min-height: 72px;
    max-height: 160px;
    font-size: 16px;
  }

  .prompt-input-wrap.expanded #promptInput {
    min-height: min(48vh, 440px);
    max-height: min(70vh, 680px);
  }

  /* ?? ???????????? + ?????? tab?PC ??? ?? */
  .composer-row {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .prompt-input-wrap {
    width: 100%;
    order: 2;
  }

  .composer.mode-image .image-ref-upload-wrap:not([hidden]),
  .composer.mode-text .text-ref-upload-wrap:not([hidden]),
  .composer.mode-video .video-frames-wrap:not([hidden]) {
    order: 1;
    width: 100%;
    max-width: none;
    align-self: stretch;
    box-sizing: border-box;
    margin: 0;
    padding: 8px;
    border: 1px solid #334155;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.65);
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .composer.mode-image .image-ref-upload-wrap:not([hidden])::-webkit-scrollbar,
  .composer.mode-text .text-ref-upload-wrap:not([hidden])::-webkit-scrollbar,
  .composer.mode-video .video-frames-wrap:not([hidden])::-webkit-scrollbar {
    display: none;
  }

  .composer.mode-video .video-frames-wrap:not([hidden]) {
    flex-direction: column;
    align-items: stretch;
    overflow-x: hidden;
  }

  .composer.mode-video .video-input-mode-toggle {
    width: 100%;
  }

  .composer.mode-video .video-mode-segment {
    width: 100%;
    justify-content: stretch;
  }

  .composer.mode-video .video-mode-tab {
    flex: 1;
    text-align: center;
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .composer.mode-video .video-frames-group,
  .composer.mode-video .video-refs-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .composer.mode-video .video-frames-group::-webkit-scrollbar,
  .composer.mode-video .video-refs-group::-webkit-scrollbar {
    display: none;
  }

  .composer.mode-image .image-ref-upload-btn,
  .composer.mode-video .video-frame-btn,
  .composer.mode-text .text-ref-add-btn {
    width: 64px;
    height: 64px;
    min-height: 64px;
    border-radius: 10px;
  }

  .composer.mode-text .text-ref-thumb,
  .composer.mode-video .video-ref-thumb,
  .composer.mode-video .video-ref-thumb img {
    width: 64px;
    height: 64px;
  }

  .composer.mode-image #promptInput {
    min-height: 72px;
    max-height: 120px;
  }

  .prompt-composer-bar {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 6px;
    min-height: 0;
  }

  .prompt-tools-left {
    order: 0;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
  }

  .prompt-tools-left::-webkit-scrollbar {
    display: none;
  }

  .composer-actions-wrap {
    order: 1;
    width: 100%;
    max-width: none;
    margin-left: 0 !important;
  }

  .composer-actions {
    flex-wrap: nowrap !important;
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding: 2px 2px 4px;
  }

  .composer-actions::-webkit-scrollbar {
    display: none;
  }

  .composer-actions > *,
  .composer-more-wrap {
    flex: 0 0 auto;
  }

  .composer-actions .icon-tool-btn:not([hidden]),
  .composer-actions .model-icon-btn,
  .composer-actions #aspectRatioBtn,
  .composer-actions #wordLimitBtn,
  .composer-actions #imagePresetBtn,
  .composer-actions #fourPanelComicBtn,
  .composer-actions .composer-more-btn {
    width: auto;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 999px;
    gap: 4px;
  }

  .composer-actions .model-icon-btn {
    width: 36px;
    padding: 0;
    border-radius: 50%;
  }

  .composer-actions .character-setup-btn {
    padding: 0 12px;
    font-size: 0.78rem;
    font-weight: 600;
  }

  .composer-actions .aspect-btn-label {
    font-size: 0.68rem;
  }

  .composer-actions .btn-send {
    margin-left: auto;
    position: sticky;
    right: 0;
    z-index: 3;
    flex-shrink: 0;
    padding: 8px 14px;
    min-height: 36px;
    border-radius: 999px;
    box-shadow: -10px 0 14px rgba(15, 23, 42, 0.95);
  }

  .composer-stats {
    font-size: 0.68rem;
    line-height: 1.35;
    padding: 0 2px;
    white-space: normal;
  }

  /* ?????????????????????????? */
  #promptSizeWrap {
    display: none !important;
  }

  .prompt-tools-left:not(:has(#promptVoiceBtn:not([hidden]))) {
    display: none !important;
  }

  /* ???????/???/??????? */
  .composer.mode-video #videoDurationBtnLabel,
  .composer.mode-video #videoResolutionBtnLabel,
  .composer.mode-video #videoAspectBtnLabel {
    display: none !important;
  }

  .composer.mode-video #videoDurationBtn,
  .composer.mode-video #videoResolutionBtn,
  .composer.mode-video #videoAspectBtn {
    width: 36px;
    min-width: 36px;
    padding: 0;
  }

  .composer-more-wrap .composer-more-subpopover {
    left: 0;
    right: auto;
    min-width: min(240px, calc(100vw - 32px));
  }

  .aspect-popover {
    left: 0;
    right: 0;
    min-width: 0;
  }

  .export-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .export-bar-actions {
    justify-content: flex-end;
  }

  /* ?????????????????? */
  .hotsearch-search-bar {
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
  }

  .hotsearch-search-input {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }

  .hotsearch-search-bar > .btn-small {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .hotsearch-search-bar > .hotsearch-admin-only:not([hidden]) {
    flex: 1 1 calc(50% - 4px);
  }

  /* ???????????????????? */
  .my-article-item-actions {
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid rgba(51, 65, 85, 0.55);
    justify-content: flex-end;
  }

  /* ???????????????? */
  .cover-editor-controls {
    max-height: 28vh;
    padding: 8px 10px 10px;
  }

  .cover-editor-preview-wrap {
    flex: 1.4;
    min-height: 0;
    padding: 10px 12px 12px;
  }

  .cover-preview-stage {
    min-height: min(52vh, 480px);
    padding: 12px;
  }
}

/* ?? ???? ?? */
.hotsearch-panel[hidden] {
  display: none !important;
}

.hotsearch-panel:not([hidden]) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hotsearch-panel-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px 6px;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
}

.hotsearch-panel-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #e2e8f0;
}

.hotsearch-panel-hint {
  font-size: 0.72rem;
  color: #64748b;
}

.hotsearch-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 12px;
}

.hotsearch-blocks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

@media (max-width: 720px) {
  .hotsearch-blocks-grid {
    grid-template-columns: 1fr;
  }
}

.hotsearch-status {
  font-size: 0.78rem;
  color: #94a3b8;
  text-align: center;
  padding: 24px 12px;
}

.hotsearch-status-error {
  color: #f87171;
}

.hotsearch-block {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid #334155;
  border-radius: 8px;
  margin-bottom: 0;
  overflow: hidden;
  min-width: 0;
}

.hotsearch-block-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 5px 8px;
  background: rgba(99, 102, 241, 0.1);
  border-bottom: 1px solid #334155;
}

.hotsearch-block-title {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #c7d2fe;
  margin: 0;
}

.hotsearch-block-all {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #818cf8;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 1px 4px;
  margin-left: auto;
}

.hotsearch-block-all:hover {
  color: #a5b4fc;
  text-decoration: underline;
}

.hotsearch-list {
  display: flex;
  flex-direction: column;
}

.hotsearch-blocks-grid .hotsearch-block-list {
  flex: 1;
}

.hotsearch-blocks-grid .hotsearch-item {
  padding: 6px 10px;
}

.hotsearch-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
  background: transparent;
  padding: 8px 12px;
  cursor: pointer;
  color: inherit;
}

.hotsearch-item:last-child {
  border-bottom: none;
}

.hotsearch-item:hover {
  background: rgba(99, 102, 241, 0.08);
}

.hotsearch-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.hotsearch-item-tags {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.hotsearch-blocks-grid .hotsearch-tag {
  padding: 1px 5px;
  font-size: 0.68rem;
}

.hotsearch-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hotsearch-tag-hot {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #f97316);
}

.hotsearch-tag-top {
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.35);
  border: 1px solid rgba(245, 158, 11, 0.55);
}

.hotsearch-tag-rising {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.22);
  border: 1px solid rgba(34, 197, 94, 0.45);
}

.hotsearch-tag-falling {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.hotsearch-tag-new {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.22);
  border: 1px solid rgba(59, 130, 246, 0.45);
}

.hotsearch-tag-sustained {
  color: #ddd6fe;
  background: rgba(139, 92, 246, 0.22);
  border: 1px solid rgba(139, 92, 246, 0.45);
}

.hotsearch-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.hotsearch-detail-tags .hotsearch-item-tags {
  gap: 6px;
}

.hotsearch-detail-tags .hotsearch-tag {
  font-size: 0.72rem;
  padding: 2px 8px;
}

.hotsearch-blocks-grid .hotsearch-item-title {
  font-size: 0.92rem;
  line-height: 1.35;
}

.hotsearch-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}

.hotsearch-blocks-grid .hotsearch-item-desc {
  margin-top: 2px;
  font-size: 0.68rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hotsearch-item-desc {
  margin-top: 3px;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
}

.hotsearch-item-meta {
  margin-top: 4px;
  font-size: 0.72rem;
  color: #64748b;
}

.hotsearch-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.5);
}

.hotsearch-search-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #475569;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  font-size: 0.82rem;
  padding: 7px 10px;
}

.hotsearch-search-input:focus {
  outline: none;
  border-color: #6366f1;
}

.hotsearch-search-results {
  flex-shrink: 0;
  border-bottom: 1px solid #334155;
  background: rgba(99, 102, 241, 0.06);
  max-height: 42vh;
  overflow-y: auto;
}

.hotsearch-search-results-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #c7d2fe;
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
}

.hotsearch-search-results-head #hotsearchSearchResultsTitle {
  flex: 1;
  min-width: 0;
}

.hotsearch-inspire-btn {
  flex-shrink: 0;
  border: 1px solid rgba(129, 140, 248, 0.55);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(168, 85, 247, 0.25));
  color: #e0e7ff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hotsearch-inspire-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(129, 140, 248, 0.45);
  color: #fff;
}

.hotsearch-full-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hotsearch-full-header h3 {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.hotsearch-inspire-hint {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 0 0 12px;
}

.hotsearch-inspire-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.hotsearch-inspire-pages {
  margin: 0 0 16px;
}

.hotsearch-inspire-pages-label {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: #94a3b8;
}

.hotsearch-inspire-pages-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 120px;
  overflow-y: auto;
}

.hotsearch-inspire-page-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.7);
  color: #cbd5e1;
  font-size: 0.78rem;
  cursor: pointer;
  user-select: none;
}

.hotsearch-inspire-page-chip:has(input:checked) {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.18);
  color: #e2e8f0;
}

.hotsearch-inspire-page-chip input {
  margin: 0;
  accent-color: #818cf8;
}

.hotsearch-inspire-kw-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.hotsearch-inspire-result-body {
  position: relative;
  min-height: 180px;
}

.hotsearch-inspire-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  text-align: center;
}

.hotsearch-inspire-loading[hidden] {
  display: none !important;
}

.hotsearch-inspire-orbit {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 20px;
}

.hotsearch-inspire-orbit span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}

.hotsearch-inspire-orbit span:nth-child(1) {
  border-top-color: #818cf8;
  border-right-color: rgba(129, 140, 248, 0.3);
  animation: hotsearch-inspire-spin 1.1s linear infinite;
}

.hotsearch-inspire-orbit span:nth-child(2) {
  inset: 10px;
  border-bottom-color: #c084fc;
  border-left-color: rgba(192, 132, 252, 0.3);
  animation: hotsearch-inspire-spin 1.6s linear infinite reverse;
}

.hotsearch-inspire-orbit span:nth-child(3) {
  inset: 20px;
  border-top-color: #22d3ee;
  animation: hotsearch-inspire-spin 0.9s linear infinite;
}

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

.hotsearch-inspire-loading-text {
  font-size: 1rem;
  font-weight: 600;
  color: #c7d2fe;
  margin: 0 0 6px;
}

.hotsearch-inspire-loading-sub {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0;
}

.hotsearch-inspire-dots::after {
  content: "";
  animation: hotsearch-inspire-dots 1.4s steps(4, end) infinite;
}

@keyframes hotsearch-inspire-dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

.hotsearch-inspire-result-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hotsearch-inspire-result-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(71, 85, 105, 0.7);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
}

.hotsearch-inspire-result-main {
  flex: 1;
  min-width: 0;
}

.hotsearch-inspire-result-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0 0 6px;
  line-height: 1.45;
}

.hotsearch-inspire-result-point {
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.hotsearch-inspire-result-point strong {
  color: #a5b4fc;
  font-weight: 600;
}

.hotsearch-inspire-result-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.hotsearch-inspire-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(60vh, 520px);
  overflow: auto;
}

.hotsearch-inspire-history-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(71, 85, 105, 0.7);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
}

.hotsearch-inspire-history-main {
  flex: 1;
  min-width: 0;
}

.hotsearch-inspire-history-kw {
  margin: 0 0 4px;
  font-size: 0.78rem;
  color: #a5b4fc;
}

.hotsearch-inspire-history-meta {
  margin: 6px 0 0;
  font-size: 0.72rem;
  color: #64748b;
}

.hotsearch-inspire-fav-btn {
  flex-shrink: 0;
  margin-top: 2px;
}

.hotsearch-inspire-fav-btn.is-done {
  opacity: 0.65;
  pointer-events: none;
}

.hotsearch-inspire-debug {
  margin-top: 16px;
  border-top: 1px dashed rgba(71, 85, 105, 0.8);
  padding-top: 12px;
}

.hotsearch-inspire-debug-summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  user-select: none;
}

.hotsearch-inspire-debug-meta {
  font-size: 0.78rem;
  color: #64748b;
  margin: 8px 0 12px;
  line-height: 1.5;
}

.hotsearch-inspire-debug-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #a5b4fc;
  margin: 0 0 6px;
}

.hotsearch-inspire-debug-pre {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(71, 85, 105, 0.7);
  color: #cbd5e1;
  font-size: 0.75rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
}

.hotsearch-fav-association {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.12);
  font-size: 0.78rem;
  color: #a5b4fc;
  line-height: 1.45;
  white-space: pre-line;
}

.hotsearch-fav-association strong {
  color: #c7d2fe;
}

.hotsearch-search-clear {
  font-size: 0.72rem;
  padding: 2px 6px;
  margin-left: auto;
}

.hotsearch-platform-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 6px;
}

.hotsearch-platform-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.35);
}

.hotsearch-platform-check:hover {
  border-color: rgba(129, 140, 248, 0.45);
  background: rgba(30, 41, 59, 0.55);
}

.hotsearch-platform-check input {
  margin: 0;
  accent-color: #818cf8;
}

.hotsearch-platform-check:has(input:checked) {
  border-color: rgba(129, 140, 248, 0.65);
  background: rgba(79, 70, 229, 0.18);
  color: #e0e7ff;
}

.form-field-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: #94a3b8;
}

.form-field-label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: #cbd5e1;
}

.hotsearch-blocks-grid .hotsearch-pager {
  padding: 4px 6px;
  gap: 6px;
}

.hotsearch-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid rgba(51, 65, 85, 0.5);
}

.hotsearch-pager-btn {
  border: 1px solid #475569;
  background: rgba(15, 23, 42, 0.8);
  color: #cbd5e1;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

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

.hotsearch-pager-info {
  font-size: 0.72rem;
  color: #94a3b8;
}

.hotsearch-empty {
  font-size: 0.75rem;
  color: #64748b;
  text-align: center;
  padding: 16px;
}

.hotsearch-full-body {
  max-height: min(70vh, 640px);
  overflow-y: auto;
}

.hotsearch-detail-body {
  font-size: 0.82rem;
}

.hotsearch-detail-thumb-wrap {
  margin-bottom: 12px;
  text-align: center;
}

.hotsearch-detail-thumb {
  max-width: 100%;
  max-height: 180px;
  border-radius: 8px;
  object-fit: cover;
}

.hotsearch-detail-headline {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 8px;
  line-height: 1.4;
}

.hotsearch-detail-desc {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.55;
  margin: 0 0 12px;
  white-space: pre-wrap;
}

.hotsearch-detail-meta {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 0.75rem;
}

.hotsearch-detail-meta div {
  display: flex;
  gap: 8px;
}

.hotsearch-detail-meta dt {
  color: #64748b;
  min-width: 4.5em;
}

.hotsearch-detail-meta dd {
  margin: 0;
  color: #e2e8f0;
}

.hotsearch-detail-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.hotsearch-favorites-list .favorite-item-content {
  font-size: 0.75rem;
}

.hotsearch-fav-meta {
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 4px;
}

.hotsearch-fav-meta span + span::before {
  content: " ? ";
}

.hotsearch-fav-view-btn {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  flex: 1;
  min-width: 0;
}

.hotsearch-fav-view-btn:hover .favorite-item-title {
  color: #a5b4fc;
}

.hotsearch-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hotsearch-analysis-card .modal-body {
  max-height: min(78vh, 720px);
  overflow-y: auto;
}

.hotsearch-analysis-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 0 0 12px;
}

.hotsearch-analysis-md {
  font-size: 0.82rem;
  line-height: 1.65;
  color: #e2e8f0;
}

.hotsearch-analysis-md h2 {
  font-size: 1rem;
  margin: 18px 0 10px;
  color: #f8fafc;
}

.hotsearch-analysis-md h3 {
  font-size: 0.92rem;
  margin: 16px 0 8px;
  color: #e0e7ff;
}

.hotsearch-analysis-md h4 {
  font-size: 0.86rem;
  margin: 12px 0 6px;
  color: #c7d2fe;
}

.hotsearch-analysis-md p {
  margin: 0 0 10px;
}

.hotsearch-analysis-md ul {
  margin: 0 0 12px 1.1em;
  padding: 0;
}

.hotsearch-analysis-md li {
  margin-bottom: 6px;
}

.hotsearch-analysis-md hr {
  border: none;
  border-top: 1px solid rgba(71, 85, 105, 0.6);
  margin: 16px 0;
}

.hotsearch-analysis-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 8px;
}

.hotsearch-analysis-section-head h2,
.hotsearch-analysis-section-head h3,
.hotsearch-analysis-section-head h4 {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.hotsearch-analysis-speak-btn {
  flex-shrink: 0;
}

.hotsearch-analysis-speak-btn.is-speaking {
  background: rgba(99, 102, 241, 0.25);
  border-color: #818cf8;
  color: #e0e7ff;
}

.hotsearch-search-bar .hotsearch-admin-only[hidden] {
  display: none;
}

.entertainment-panel[hidden] {
  display: none !important;
}

.entertainment-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.entertainment-panel-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 12px 16px 8px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
}

.entertainment-panel-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f1f5f9;
}

.entertainment-panel-hint {
  font-size: 0.72rem;
  color: #64748b;
}

.entertainment-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 20px 16px;
  overflow-y: auto;
}

.entertainment-game-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 20px 18px;
  border: 1px solid rgba(71, 85, 105, 0.65);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.92));
  color: #e2e8f0;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.entertainment-game-card:hover {
  border-color: #818cf8;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.entertainment-game-card[hidden] {
  display: none;
}

.entertainment-game-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.entertainment-game-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
}

.entertainment-game-desc {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.45;
}

.usage-panel-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.usage-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.usage-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  color: #94a3b8;
  padding: 4px 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.usage-row strong {
  color: #e2e8f0;
  font-weight: 600;
}

.article-status-badge {
  display: inline-block;
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}

.article-status-unused { background: #334155; color: #94a3b8; }
.article-status-published { background: #14532d; color: #86efac; }
.article-status-discarded { background: #451a1a; color: #fca5a5; }
.article-status-modified { background: #1e3a5f; color: #93c5fd; }

.feature-summary-card {
  margin: 8px 16px;
  padding: 12px 14px;
  border: 1px solid #334155;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  font-size: 0.82rem;
  color: #cbd5e1;
}

.feature-summary-card h4 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: #e2e8f0;
}

.feature-summary-list {
  margin: 0 0 10px;
  padding-left: 18px;
}

.feature-summary-list li {
  margin-bottom: 6px;
}

.feature-summary-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.feature-summary-retry-card.is-failed {
  border-color: #b45309;
  background: rgba(120, 53, 15, 0.35);
}

.feature-summary-retry-card.is-failed h4 {
  color: #fdba74;
}

.topic-library-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.topic-library-item {
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
}

.topic-library-item-title {
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 4px;
}

.topic-library-item-meta {
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 4px;
}

.topic-library-item-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  white-space: pre-wrap;
}

.topic-library-item-actions {
  margin-top: 8px;
}

.topic-library-select-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.topic-library-select-label input {
  margin-top: 4px;
  flex-shrink: 0;
}

.pipeline-queue-bar {
  flex-shrink: 0;
  width: 100%;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1px solid rgba(129, 140, 248, 0.45);
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.pipeline-queue-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.pipeline-queue-toggle:hover {
  background: rgba(99, 102, 241, 0.08);
}

.pipeline-queue-title {
  font-size: 0.84rem;
  color: #e2e8f0;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-queue-head-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pipeline-queue-status {
  font-size: 0.75rem;
  color: #a5b4fc;
  font-weight: 500;
}

.pipeline-queue-active-step {
  font-size: 0.72rem;
  color: #94a3b8;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-queue-bar.expanded .pipeline-queue-active-step {
  display: none;
}

.pipeline-queue-chevron {
  font-size: 0.65rem;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.pipeline-queue-bar.expanded .pipeline-queue-chevron {
  transform: rotate(180deg);
}

.pipeline-queue-body {
  padding: 0 14px 12px;
  border-top: 1px solid rgba(51, 65, 85, 0.6);
}

.pipeline-queue-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
}

.pipeline-queue-step {
  display: flex;
  flex-direction: column;
  gap: 0;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.4;
  border-radius: 8px;
  border: 1px solid transparent;
  overflow: hidden;
}

.pipeline-queue-step-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
}

.pipeline-queue-step-head:hover {
  background: rgba(99, 102, 241, 0.08);
}

.pipeline-queue-step-expanded {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(15, 23, 42, 0.55);
}

.pipeline-queue-step-label {
  flex: 1;
  min-width: 0;
}

.pipeline-queue-step-chevron {
  flex-shrink: 0;
  font-size: 0.65rem;
  color: #64748b;
  transition: transform 0.2s ease;
  margin-top: 2px;
}

.pipeline-queue-step-expanded .pipeline-queue-step-chevron {
  transform: rotate(180deg);
}

.pipeline-queue-step-detail {
  margin: 0 8px 8px 24px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid rgba(51, 65, 85, 0.75);
}

.pipeline-queue-step-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.74rem;
}

.pipeline-queue-step-detail-row:last-of-type {
  margin-bottom: 8px;
}

.pipeline-queue-step-detail-label {
  flex-shrink: 0;
  width: 2.5em;
  color: #64748b;
}

.pipeline-queue-step-detail-status {
  font-weight: 600;
}

.pipeline-queue-step-detail-status.pipeline-step-active {
  color: #c7d2fe;
}

.pipeline-queue-step-detail-status.pipeline-step-done {
  color: #86efac;
}

.pipeline-queue-step-detail-status.pipeline-step-error {
  color: #fca5a5;
}

.pipeline-queue-step-detail-text {
  color: #cbd5e1;
  word-break: break-word;
}

.pipeline-queue-step-duration {
  color: #a5b4fc;
  font-variant-numeric: tabular-nums;
}

.pipeline-queue-step-detail-logs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 140px;
  overflow-y: auto;
  padding-top: 6px;
  border-top: 1px solid rgba(51, 65, 85, 0.55);
}

.pipeline-queue-step-log-entry {
  display: flex;
  gap: 8px;
  font-size: 0.72rem;
  line-height: 1.35;
}

.pipeline-queue-step-log-time {
  flex-shrink: 0;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.pipeline-queue-step-log-msg {
  color: #94a3b8;
  word-break: break-word;
}

.pipeline-queue-step-log-empty {
  font-size: 0.72rem;
  color: #64748b;
  font-style: italic;
}

.pipeline-queue-waiting {
  margin: 0;
  font-size: 0.78rem;
  color: #94a3b8;
}

.pipeline-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #475569;
  flex-shrink: 0;
}

.pipeline-step-active {
  color: #c7d2fe;
}

.pipeline-step-active .pipeline-step-dot {
  background: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.25);
}

.pipeline-step-done {
  color: #86efac;
}

.pipeline-step-done .pipeline-step-dot {
  background: #22c55e;
}

.pipeline-step-error {
  color: #fca5a5;
}

.pipeline-step-error .pipeline-step-dot {
  background: #ef4444;
}

.pipeline-setup-body .field-hint {
  margin: 0 0 8px;
}

.pipeline-source-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.pipeline-source-head > span {
  font-weight: 600;
  color: #e2e8f0;
}

.pipeline-queue-bar.has-error {
  border-color: rgba(239, 68, 68, 0.55);
}

.pipeline-queue-bar.has-error .pipeline-queue-status {
  color: #fca5a5;
}

.pipeline-queue-bar.has-done {
  border-color: rgba(34, 197, 94, 0.45);
}

.pipeline-queue-bar.has-done .pipeline-queue-status {
  color: #86efac;
}

.pipeline-source-editor {
  width: 100%;
  min-height: 120px;
  max-height: 220px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.55);
  font-size: 0.82rem;
  line-height: 1.5;
  color: #cbd5e1;
  resize: vertical;
  font-family: inherit;
}

.pipeline-source-editor:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2);
}

.pipeline-modal {
  z-index: 1100;
}

.modal.modal-layer-top {
  z-index: 1110;
}

.hotsearch-detail-actions {
  flex-wrap: wrap;
}

.pipeline-stage-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 4px;
}

.pipeline-inline-options {
  margin: 6px 0 8px;
}

.pipeline-queue-retry {
  margin-left: auto;
}

.my-articles-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
}

.my-articles-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}

.my-articles-batch-divider {
  color: #64748b;
  align-self: center;
}

.my-articles-batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.my-article-batch-check {
  flex-shrink: 0;
  margin-top: 4px;
}

.my-article-pipeline-ctx {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(129, 140, 248, 0.35);
  background: rgba(30, 41, 59, 0.45);
  font-size: 0.82rem;
  line-height: 1.55;
}

.my-article-pipeline-block + .my-article-pipeline-block {
  margin-top: 10px;
}

.my-article-pipeline-pre {
  margin: 6px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.55);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  max-height: 180px;
  overflow: auto;
}

.pipeline-write-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pipeline-write-mode-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.55);
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.pipeline-write-mode-btn:hover {
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.55);
}

.pipeline-write-mode-btn.active[data-write-mode="cowrite"] {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(248, 113, 113, 0.45);
}

.pipeline-write-mode-btn.active[data-write-mode="direct"] {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(96, 165, 250, 0.45);
}

.pipeline-cowrite-row {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.pipeline-cowrite-item {
  display: grid;
  grid-template-columns: 88px auto 1fr;
  align-items: center;
  gap: 8px;
}

.pipeline-cowrite-label {
  font-size: 0.78rem;
  color: #94a3b8;
}

/* ???? / ?????? */
.voice-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 6px;
  min-height: 52px;
}

.voice-text-mode-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid #475569;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-text-mode-btn:hover:not(:disabled) {
  color: #e2e8f0;
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.15);
}

.prompt-input-wrap.voice-input-mode .prompt-tools-left,
.prompt-input-wrap.voice-input-mode .prompt-voice-btn,
.prompt-input-wrap.voice-input-mode .prompt-expand-btn,
.prompt-input-wrap.voice-input-mode .prompt-fullscreen-btn,
.prompt-input-wrap.voice-input-mode .prompt-optimize-btn,
.prompt-input-wrap.voice-input-mode .prompt-size-wrap {
  display: none !important;
}

.prompt-input-wrap.voice-input-mode #promptInput,
.prompt-input-wrap.voice-input-mode .prompt-resize-handle,
.prompt-input-wrap.voice-input-mode .prompt-extras,
.prompt-input-wrap.voice-input-mode .composer-stats {
  display: none !important;
}

.voice-input-bar[hidden] {
  display: none !important;
}

.voice-record-btn {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.voice-record-btn.recording {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.voice-record-status {
  font-size: 0.78rem;
  color: #94a3b8;
  white-space: nowrap;
}

.voice-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.voice-msg-bubble {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 120px;
  max-width: 240px;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  cursor: pointer;
}

.msg.user .voice-msg-bubble {
  background: rgba(37, 99, 235, 0.25);
}

.voice-msg-bubble.is-speaking,
.voice-msg-bubble.is-speaking .voice-msg-bars i {
  animation: voice-bar-pulse 0.8s ease-in-out infinite alternate;
}

.voice-msg-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
}

.voice-msg-bars i {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: currentColor;
  height: 6px;
}

.voice-msg-bars i:nth-child(2) { height: 10px; }
.voice-msg-bars i:nth-child(3) { height: 16px; }
.voice-msg-bars i:nth-child(4) { height: 11px; }
.voice-msg-bars i:nth-child(5) { height: 7px; }

.voice-msg-bubble.is-speaking .voice-msg-bars i:nth-child(1) { animation-delay: 0s; }
.voice-msg-bubble.is-speaking .voice-msg-bars i:nth-child(2) { animation-delay: 0.1s; }
.voice-msg-bubble.is-speaking .voice-msg-bars i:nth-child(3) { animation-delay: 0.2s; }
.voice-msg-bubble.is-speaking .voice-msg-bars i:nth-child(4) { animation-delay: 0.15s; }
.voice-msg-bubble.is-speaking .voice-msg-bars i:nth-child(5) { animation-delay: 0.05s; }

@keyframes voice-bar-pulse {
  from { transform: scaleY(0.6); opacity: 0.7; }
  to { transform: scaleY(1.2); opacity: 1; }
}

.voice-msg-duration {
  font-size: 0.82rem;
  opacity: 0.85;
}

.voice-msg-transcribe {
  border: none;
  background: none;
  color: #60a5fa;
  font-size: 0.78rem;
  padding: 0;
  cursor: pointer;
}

.voice-msg-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 100%;
}

.tq-answer-bar {
  padding: 10px 12px 8px;
  border-bottom: 1px solid #334155;
  background: #1e293b;
}

.tq-answer-question {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: #e2e8f0;
  line-height: 1.5;
}

.tq-answer-btns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.tq-answer-btn {
  padding: 10px 6px;
  border-radius: 10px;
  border: 1px solid #475569;
  background: #334155;
  color: #f8fafc;
  font-size: 0.9rem;
  cursor: pointer;
}

.tq-answer-btn:hover {
  background: #475569;
}

.composer.tq-answer-active .composer-row {
  opacity: 1;
  pointer-events: auto;
}

.five-destiny-log {
  margin-top: 8px;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.five-destiny-log-row {
  padding: 4px 0;
  border-bottom: 1px solid #334155;
}

.mini-game-panel .party-panel-body {
  padding: 8px 12px 12px;
}

.mini-game-stat {
  font-size: 0.82rem;
  color: #94a3b8;
}

/* ??? ???? ??? */
body.literature-exam-open {
  overflow: hidden;
}

.literature-exam-modal {
  z-index: 1200;
  align-items: flex-start;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(28px, env(safe-area-inset-bottom, 0px));
}

.literature-exam-modal .literature-exam-backdrop {
  position: fixed;
}

.literature-exam-backdrop {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99, 102, 241, 0.35), transparent 70%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(236, 72, 153, 0.2), transparent 60%),
    rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(8px);
}

.literature-exam-stage {
  position: relative;
  width: min(640px, calc(100vw - 24px));
  margin: 2vh auto 16px;
  padding: 0;
  flex-shrink: 0;
  animation: literature-exam-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes literature-exam-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.literature-exam-close {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 5;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.literature-exam-close:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: transparent;
}

.literature-exam-quiz {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.literature-exam-arena-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(129, 140, 248, 0.35);
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.15);
}

.literature-exam-fighter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.literature-exam-fighter-ai {
  flex-direction: row-reverse;
  text-align: right;
}

.literature-exam-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.45);
  flex-shrink: 0;
}

.literature-exam-fighter-user .literature-exam-avatar {
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.literature-exam-fighter-ai .literature-exam-avatar {
  border-color: rgba(244, 114, 182, 0.65);
  box-shadow: 0 0 14px rgba(244, 114, 182, 0.35);
}

.literature-exam-fighter-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.literature-exam-fighter-score {
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #f8fafc;
  min-width: 1.4em;
  text-align: center;
}

.literature-exam-bar-wrap {
  position: relative;
  padding: 6px 0;
}

.literature-exam-bar-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.literature-exam-bar-user {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 50%;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  border-radius: 999px 0 0 999px;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.45);
}

.literature-exam-bar-ai {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 50%;
  background: linear-gradient(270deg, #ec4899, #f472b6);
  border-radius: 0 999px 999px 0;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 16px rgba(244, 114, 182, 0.45);
}

.literature-exam-bar-clash {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 4px;
  margin-left: -2px;
  background: #fef08a;
  border-radius: 2px;
  box-shadow: 0 0 12px #fde047, 0 0 24px rgba(253, 224, 71, 0.5);
  transition: left 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
}

.literature-exam-bar-glow {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  pointer-events: none;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.06);
}

.literature-exam-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.literature-exam-round {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #a5b4fc;
  text-transform: uppercase;
}

.literature-exam-timer-wrap {
  display: flex;
  align-items: center;
}

.literature-exam-timer-ring {
  --timer-pct: 100%;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    conic-gradient(#818cf8 var(--timer-pct), rgba(51, 65, 85, 0.6) 0);
  box-shadow: 0 0 20px rgba(129, 140, 248, 0.35);
  transition: background 0.35s linear;
}

.literature-exam-timer {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.95);
  font-size: 1.1rem;
  font-weight: 800;
  color: #e0e7ff;
  font-variant-numeric: tabular-nums;
}

.literature-exam-timer.urgent {
  color: #fca5a5;
  animation: literature-exam-pulse 0.6s ease-in-out infinite;
}

@keyframes literature-exam-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.literature-exam-card {
  padding: 20px 18px 18px;
  border-radius: 0 0 16px 16px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.99));
  border: 1px solid rgba(129, 140, 248, 0.28);
  border-top: none;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.literature-exam-question {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.55;
  color: #f1f5f9;
  min-height: 3em;
}

.literature-exam-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.literature-exam-options.locked {
  pointer-events: none;
}

.literature-exam-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.65);
  color: #e2e8f0;
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.literature-exam-option:hover {
  transform: translateY(-2px);
  border-color: rgba(129, 140, 248, 0.65);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
  background: rgba(51, 65, 85, 0.85);
}

.literature-exam-option-key {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}

.literature-exam-option-text {
  font-size: 0.88rem;
  line-height: 1.45;
}

.literature-exam-option.is-correct {
  border-color: rgba(34, 197, 94, 0.75);
  background: rgba(22, 101, 52, 0.35);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.25);
}

.literature-exam-option.is-wrong {
  border-color: rgba(239, 68, 68, 0.75);
  background: rgba(127, 29, 29, 0.35);
}

.literature-exam-option.picked-ai {
  outline: 2px dashed rgba(244, 114, 182, 0.75);
  outline-offset: 2px;
}

.literature-exam-feedback {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.5;
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
}

.literature-exam-feedback.is-ok {
  background: rgba(22, 101, 52, 0.35);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.literature-exam-feedback.is-err {
  background: rgba(127, 29, 29, 0.3);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.literature-exam-end {
  text-align: center;
  padding: 36px 24px 28px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(30, 27, 75, 0.98), rgba(15, 23, 42, 0.99));
  border: 1px solid rgba(129, 140, 248, 0.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: literature-exam-in 0.4s ease;
}

.literature-exam-end-badge {
  font-size: 3rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 16px rgba(253, 224, 71, 0.5));
}

.literature-exam-end-title {
  margin: 0 0 8px;
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(90deg, #fde047, #f472b6, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.literature-exam-end-sub {
  margin: 0 0 18px;
  color: #94a3b8;
  font-size: 0.92rem;
}

.literature-exam-end-scores {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 22px;
  font-size: 1rem;
  color: #e2e8f0;
}

.literature-exam-end-scores strong {
  font-size: 1.5rem;
  color: #f8fafc;
}

.literature-exam-end-vs {
  font-weight: 800;
  color: #818cf8;
  font-size: 0.85rem;
}

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

/* VS ?? */
.literature-exam-intro {
  text-align: center;
  padding: 36px 28px 32px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(30, 27, 75, 0.98), rgba(15, 23, 42, 0.99));
  border: 1px solid rgba(129, 140, 248, 0.45);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: literature-exam-in 0.4s ease;
}

.literature-exam-intro-label {
  margin: 0 0 24px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #a5b4fc;
  text-transform: uppercase;
}

.literature-exam-intro-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 28px;
}

.literature-exam-intro-fighter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 100px;
}

.literature-exam-intro-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 28px rgba(99, 102, 241, 0.45);
  animation: literature-exam-intro-pulse 1.6s ease-in-out infinite;
}

.literature-exam-intro-fighter:first-child .literature-exam-intro-avatar {
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.35);
}

.literature-exam-intro-fighter:last-child .literature-exam-intro-avatar {
  border-color: rgba(244, 114, 182, 0.7);
  box-shadow: 0 0 28px rgba(244, 114, 182, 0.35);
  animation-delay: 0.4s;
}

@keyframes literature-exam-intro-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.literature-exam-intro-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #e2e8f0;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.literature-exam-intro-vs-badge {
  font-size: 1.8rem;
  font-weight: 900;
  font-style: italic;
  background: linear-gradient(135deg, #fde047, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 12px rgba(253, 224, 71, 0.4));
}

.literature-exam-intro-countdown {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  color: #f8fafc;
  text-shadow: 0 0 30px rgba(129, 140, 248, 0.6);
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.literature-exam-intro-countdown.go {
  font-size: 2rem;
  color: #86efac;
  text-shadow: 0 0 24px rgba(34, 197, 94, 0.55);
  animation: literature-exam-in 0.35s ease;
}

.literature-exam-intro-hint {
  margin: 0;
  font-size: 0.82rem;
  color: #64748b;
}

.literature-exam-play {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.literature-exam-quiz .literature-exam-end {
  margin-top: 0;
  padding: 20px 18px 18px;
  border-radius: 0 0 16px 16px;
  border: 1px solid rgba(129, 140, 248, 0.28);
  border-top: 1px solid rgba(129, 140, 248, 0.15);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.99));
  box-shadow: none;
  animation: literature-exam-in 0.35s ease;
}

.literature-exam-quiz .literature-exam-arena-head {
  border-radius: 16px 16px 0 0;
}

.literature-exam-quiz:has(.literature-exam-end:not([hidden])) .literature-exam-arena-head {
  border-radius: 16px 16px 0 0;
}

.literature-exam-quiz .literature-exam-end-badge {
  font-size: 2.2rem;
  margin-bottom: 6px;
}

.literature-exam-quiz .literature-exam-end-title {
  font-size: 1.45rem;
  margin-bottom: 6px;
}

.literature-exam-quiz .literature-exam-end-sub {
  margin-bottom: 14px;
}

.literature-exam-quiz .literature-exam-end-scores {
  margin-bottom: 16px;
}

.literature-exam-review {
  text-align: left;
  margin-bottom: 18px;
  overflow: visible;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 14px;
}

.literature-exam-review-title {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #cbd5e1;
}

.literature-exam-review-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.literature-exam-review-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.literature-exam-review-q {
  font-size: 0.86rem;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.45;
  margin-bottom: 6px;
}

.literature-exam-review-num {
  color: #818cf8;
  margin-right: 4px;
}

.literature-exam-review-wrong {
  font-size: 0.8rem;
  color: #fca5a5;
  margin-bottom: 4px;
}

.literature-exam-review-right {
  font-size: 0.8rem;
  color: #86efac;
}

.literature-exam-feedback.is-timeout {
  background: rgba(120, 53, 15, 0.35);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.literature-exam-quiz .literature-exam-end-actions {
  padding-bottom: 8px;
}

@media (max-width: 520px) {
  .literature-exam-options {
    grid-template-columns: 1fr;
  }

  .literature-exam-fighter-name {
    display: none;
  }

  .literature-exam-stage {
    margin-top: 0;
    margin-bottom: 24px;
  }
}

/* ?? ???? ?? */
.cover-panel[hidden] {
  display: none !important;
}

.cover-panel:not([hidden]) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cover-panel-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px 6px;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
}

.cover-panel-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #e2e8f0;
}

.cover-panel-hint {
  font-size: 0.72rem;
  color: #64748b;
}

.cover-pages-bar {
  flex-shrink: 0;
  padding: 8px 14px 10px;
  border-bottom: 1px solid #334155;
  background: rgba(15, 23, 42, 0.35);
}

.cover-pages-bar-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 14px;
}

.cover-pages-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(44px, 1fr));
  gap: 6px;
  flex: 1;
  min-width: 240px;
  max-width: 360px;
}

.cover-page-chip {
  position: relative;
  display: flex;
  min-width: 0;
}

.cover-page-btn {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  padding: 4px 22px 4px 6px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #1e293b;
  color: #cbd5e1;
  font-size: 0.78rem;
  cursor: pointer;
}

.cover-page-btn:hover {
  border-color: #38bdf8;
  color: #e2e8f0;
}

.cover-page-btn.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  color: #e0f2fe;
  font-weight: 600;
}

.cover-page-del {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #475569;
  border-radius: 50%;
  background: #0f172a;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.cover-page-chip:hover .cover-page-del,
.cover-page-chip.is-active .cover-page-del {
  display: inline-flex;
}

.cover-page-del:hover {
  border-color: #f87171;
  color: #fecaca;
  background: #7f1d1d;
}

.cover-pages-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cover-editor-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 0;
  overflow: hidden;
}

.cover-editor-controls {
  width: 280px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 10px 12px 16px;
  border-right: 1px solid #334155;
  background: rgba(15, 23, 42, 0.45);
}

.cover-control-block {
  margin-bottom: 10px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.35);
  overflow: hidden;
}

.cover-control-block:last-child {
  margin-bottom: 0;
}

.cover-block-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.cover-block-toggle:hover {
  background: rgba(51, 65, 85, 0.35);
}

.cover-block-toggle-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #e2e8f0;
  flex-shrink: 0;
}

.cover-block-toggle-hint {
  flex: 1;
  min-width: 0;
  font-size: 0.68rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cover-block-chevron {
  flex-shrink: 0;
  font-size: 0.65rem;
  color: #94a3b8;
  transition: transform 0.15s ease;
}

.cover-control-block.is-collapsed .cover-block-chevron {
  transform: rotate(-90deg);
}

.cover-block-body {
  padding: 0 12px 12px;
}

.cover-control-block.is-collapsed .cover-block-body {
  display: none;
}

.cover-control-section {
  margin-bottom: 14px;
}

.cover-control-section:last-child {
  margin-bottom: 0;
}

/* ?? ? ????????????? */
[data-cover-block="text"] .cover-control-section {
  margin-bottom: 20px;
}

[data-cover-block="text"] .cover-control-section:last-child {
  margin-bottom: 0;
}

[data-cover-block="text"] .cover-block-body,
[data-cover-block="text"] .cover-control-label,
[data-cover-block="text"] .cover-font-size-field,
[data-cover-block="text"] .cover-check-field,
[data-cover-block="text"] .cover-color-field,
[data-cover-block="text"] .cover-text-rich-hint,
[data-cover-block="text"] .cover-align-btn {
  line-height: 25px;
}

[data-cover-block="text"] .cover-color-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

[data-cover-block="text"] .cover-color-row .cover-color-field {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

[data-cover-block="text"] .cover-control-label-nested {
  margin-top: 8px;
}

[data-cover-block="text"] .cover-title-bold-field {
  margin-top: 15px;
}

.cover-control-label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.cover-control-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.cover-control-label-row .cover-control-label {
  margin: 0;
}

.cover-section-toggle-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #334155;
  border-radius: 6px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.65rem;
  line-height: 1;
  cursor: pointer;
}

.cover-section-toggle-btn:hover {
  border-color: #38bdf8;
  color: #e2e8f0;
}

.cover-size-list.collapsed {
  display: none;
}

.cover-section-toggle-btn.collapsed {
  transform: rotate(-90deg);
}

.cover-text-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.82rem;
  font-family: inherit;
  resize: vertical;
  min-height: 36px;
}

.cover-text-rich {
  min-height: 72px;
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  resize: none;
  line-height: 1.45;
  cursor: text;
}

.cover-text-rich:empty::before {
  content: attr(data-placeholder);
  color: #64748b;
  pointer-events: none;
}

.cover-text-rich-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

.cover-text-input-single {
  resize: none;
  min-height: 0;
}

.cover-text-input:focus {
  outline: none;
  border-color: #38bdf8;
}

.cover-select {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.82rem;
}

.cover-theme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.cover-theme-btn,
.cover-texture-btn {
  padding: 7px 4px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #1e293b;
  color: #cbd5e1;
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.cover-theme-btn:hover,
.cover-texture-btn:hover {
  border-color: #475569;
}

.cover-theme-btn.active,
.cover-texture-btn.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  color: #e0f2fe;
}

.cover-size-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cover-size-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #1e293b;
  color: #cbd5e1;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.cover-size-btn:hover {
  border-color: #475569;
}

.cover-size-btn.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.cover-size-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e2e8f0;
}

.cover-size-sub {
  font-size: 0.68rem;
  color: #64748b;
}

.cover-texture-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cover-texture-btn {
  flex: 1 1 calc(33% - 6px);
  min-width: 52px;
}

.cover-bg-type-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.cover-bg-type-tab {
  flex: 1;
  padding: 6px 4px;
  border: 1px solid #334155;
  border-radius: 6px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.72rem;
  cursor: pointer;
}

.cover-bg-type-tab.active {
  border-color: #38bdf8;
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.1);
}

.cover-bg-panel[hidden] {
  display: none !important;
}

.cover-color-field,
.cover-select-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.cover-check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: #cbd5e1;
  cursor: pointer;
}

.cover-check-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #38bdf8;
}

.cover-color-field input[type="color"] {
  width: 44px;
  height: 30px;
  padding: 2px;
  border: 1px solid #334155;
  border-radius: 6px;
  background: #0f172a;
  cursor: pointer;
}

.cover-upload-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cover-upload-btn {
  cursor: pointer;
}

.cover-icon-preview {
  margin-top: 8px;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #334155;
}

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

.cover-editor-preview-wrap {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 16px;
  gap: 12px;
}

.cover-control-sublabel {
  margin: 10px 0 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
}

.cover-icon-mode-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.cover-icon-mode-btn {
  padding: 5px 8px;
  border: 1px solid #334155;
  border-radius: 6px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.68rem;
  cursor: pointer;
}

.cover-icon-mode-btn.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  color: #e0f2fe;
}

.cover-font-size-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.72rem;
  color: #94a3b8;
}

.cover-font-size-field input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: #38bdf8;
}

.cover-font-size-field output {
  min-width: 28px;
  text-align: right;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

.cover-align-group {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.cover-align-btn {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.72rem;
  cursor: pointer;
}

.cover-align-btn:hover {
  border-color: #475569;
  color: #e2e8f0;
}

.cover-align-btn.is-active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  color: #e0f2fe;
}

.cover-grad-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.cover-grad-cat-btn {
  padding: 4px 8px;
  border: 1px solid #334155;
  border-radius: 999px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.68rem;
  cursor: pointer;
}

.cover-grad-cat-btn.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  color: #e0f2fe;
}

.cover-grad-preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.cover-grad-preset-btn {
  aspect-ratio: 1.35;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s, transform 0.1s;
}

.cover-grad-preset-btn:hover {
  transform: scale(1.03);
}

.cover-grad-preset-btn.active {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px #38bdf8;
}

.cover-grad-custom-btn {
  width: 100%;
  margin-bottom: 8px;
}

.cover-grad-custom-panel {
  padding-top: 4px;
  border-top: 1px dashed #334155;
}

.cover-grad-custom-panel[hidden] {
  display: none !important;
}

.cover-preview-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 16px;
  overflow: hidden;
  position: relative;
}

.cover-preview-canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  border-radius: 4px;
  cursor: default;
}

.cover-preview-canvas.is-draggable {
  cursor: grab;
}

.cover-preview-canvas.is-dragging {
  cursor: grabbing;
}

.cover-sticker-overlay {
  position: absolute;
  pointer-events: none;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.cover-sticker-item {
  position: absolute;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.cover-sticker-item.selected {
  outline: 2px dashed rgba(56, 189, 248, 0.85);
  outline-offset: 3px;
  border-radius: 4px;
}

.cover-sticker-item.is-dragging {
  cursor: grabbing;
}

.cover-sticker-item img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.cover-sticker-tools {
  display: none;
}

.cover-sticker-item.selected .cover-sticker-tools {
  display: block;
}

.cover-sticker-del,
.cover-sticker-resize {
  position: absolute;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

.cover-sticker-del {
  top: -8px;
  right: -8px;
  background: #ef4444;
  font-size: 14px;
}

.cover-sticker-resize {
  bottom: -8px;
  right: -8px;
  background: #3b82f6;
  cursor: nwse-resize;
  font-size: 11px;
}

.cover-sticker-section {
  position: relative;
}

.cover-sticker-open-btn {
  width: 100%;
}

.cover-sticker-modal {
  z-index: 120;
}

.cover-sticker-modal-card {
  max-height: 80vh;
}

.cover-sticker-modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 16px;
  min-height: 280px;
}

.cover-sticker-picker-hint {
  margin: 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

.cover-sticker-picker-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
  max-height: 88px;
  overflow-y: auto;
}

.cover-sticker-picker-cat-btn {
  padding: 5px 10px;
  border: 1px solid #334155;
  border-radius: 6px;
  background: #0f172a;
  color: #94a3b8;
  font-size: 0.72rem;
  cursor: pointer;
  white-space: nowrap;
}

.cover-sticker-picker-cat-btn:hover,
.cover-sticker-picker-cat-btn.active {
  border-color: #38bdf8;
  color: #e2e8f0;
  background: #172554;
}

.cover-sticker-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 180px;
  max-height: min(48vh, 420px);
  padding: 2px;
}

.cover-sticker-picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
  cursor: pointer;
  min-width: 0;
}

.cover-sticker-picker-item:hover,
.cover-sticker-picker-item:focus-visible {
  border-color: #38bdf8;
  background: #172554;
  outline: none;
}

.cover-sticker-picker-item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 6px;
}

.cover-sticker-picker-item span {
  font-size: 0.68rem;
  color: #94a3b8;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  line-height: 1.2;
}

.cover-sticker-picker-empty {
  margin: 16px 4px;
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
}

@media (max-width: 640px) {
  .cover-sticker-picker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cover-illustration-section {
  margin-top: 4px;
}

.cover-editor-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
}

.cover-save-template-wrap {
  position: relative;
}

.cover-save-template-popover {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  min-width: 112px;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0f172a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cover-save-template-popover[hidden] {
  display: none !important;
}

.cover-save-template-opt {
  border: 0;
  background: transparent;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.3;
  padding: 8px 10px;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
}

.cover-save-template-opt:hover {
  background: #1e293b;
}

.cover-text-block-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cover-text-block-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cover-text-block-chip {
  border: 1px solid #475569;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.cover-text-block-chip.is-active {
  border-color: #60a5fa;
  background: #1d4ed8;
  color: #fff;
}

.cover-text-block-actions {
  display: flex;
  gap: 6px;
}

.cover-template-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cover-template-tabs {
  display: flex;
  gap: 6px;
}

.cover-template-tab {
  flex: 1;
  border: 1px solid #475569;
  background: #1e293b;
  color: #cbd5e1;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  cursor: pointer;
}

.cover-template-tab.active {
  border-color: #60a5fa;
  background: #1d4ed8;
  color: #fff;
}

.cover-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cover-template-card {
  display: flex;
  flex-direction: column;
  height: 168px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #0f172a;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  color: inherit;
}

.cover-template-card:hover {
  border-color: #60a5fa;
}

.cover-template-thumb {
  height: 96px;
  background: #1e293b center / cover no-repeat;
  flex-shrink: 0;
}

.cover-template-meta {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  flex: 1;
}

.cover-template-title {
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cover-template-tags,
.cover-template-user {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cover-template-empty {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}

.cover-template-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  color: #cbd5e1;
}

@media (max-width: 900px) {
  .cover-editor-layout {
    flex-direction: column;
  }

  .cover-editor-controls {
    width: 100%;
    max-height: 42vh;
    border-right: none;
    border-bottom: 1px solid #334155;
  }

  .cover-theme-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ===== ???? ===== */
.inspiration-panel[hidden] {
  display: none !important;
}

.inspiration-panel:not([hidden]) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
}

.inspiration-panel-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 16px 8px;
  flex-shrink: 0;
}

.inspiration-panel-title {
  font-size: 16px;
  font-weight: 600;
  color: #f1f5f9;
}

.inspiration-panel-hint {
  font-size: 12px;
  color: #94a3b8;
}

.inspiration-search-bar {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  flex-shrink: 0;
}

.inspiration-search-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 14px;
}

.inspiration-search-input::placeholder {
  color: #64748b;
}

.inspiration-scroll-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 16px 16px;
}

.inspiration-status {
  text-align: center;
  color: #94a3b8;
  padding: 24px 0;
  font-size: 14px;
}

.inspiration-status-error {
  color: #f87171;
}

.inspiration-masonry {
  column-count: 3;
  column-gap: 12px;
}

@media (max-width: 1200px) {
  .inspiration-masonry {
    column-count: 3;
  }
}

@media (max-width: 900px) {
  .inspiration-masonry {
    column-count: 2;
  }
}

@media (max-width: 560px) {
  .inspiration-masonry {
    column-count: 1;
  }
}

.inspiration-card {
  break-inside: avoid;
  margin-bottom: 12px;
  cursor: pointer;
  width: 100%;
  display: inline-block;
}

.inspiration-card-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.inspiration-card-media {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #1e293b;
}

.inspiration-card-img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #1e293b;
}

.inspiration-card-img.is-loaded {
  object-fit: contain;
  background: #0f172a;
}

.inspiration-card-img[data-src]:not([src]),
.inspiration-card-img[src=""] {
  aspect-ratio: 3 / 4;
  min-height: 160px;
}

.inspiration-card-img.inspiration-img-error {
  min-height: 160px;
  object-fit: contain;
  background: #1e293b;
}

.inspiration-model-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  max-width: calc(100% - 52px);
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(4px);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inspiration-fav-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(4px);
  color: #f8fafc;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.inspiration-fav-btn:hover {
  transform: scale(1.08);
  background: rgba(30, 41, 59, 0.92);
}

.inspiration-fav-btn.is-done {
  color: #fb7185;
  opacity: 0.85;
  pointer-events: none;
}

.inspiration-card-meta {
  padding: 8px 2px 4px;
}

.inspiration-card-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.inspiration-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.inspiration-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.4;
}

.inspiration-sentinel {
  height: 1px;
}

.inspiration-detail-modal .modal-card.inspiration-detail-card {
  width: min(var(--app-max-width), calc(100vw - 32px));
  max-height: calc(100vh - 48px);
}

.inspiration-detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  padding: 0 16px 16px;
  min-height: 0;
}

.inspiration-detail-image-wrap {
  min-height: 200px;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  border-radius: 10px;
  overflow: auto;
}

.inspiration-detail-image {
  max-width: 100%;
  max-height: 70vh;
  display: block;
  border-radius: 8px;
}

.inspiration-detail-prompts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: auto;
}

.inspiration-prompt-block {
  display: flex;
  flex-direction: column;
}

.inspiration-prompt-block h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 600;
}

.inspiration-prompt-text {
  padding: 10px 12px;
  border-radius: 8px;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow: auto;
}

.inspiration-copy-btn {
  margin-top: 8px;
  align-self: flex-start;
}

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

@media (max-width: 768px) {
  .inspiration-detail-body {
    grid-template-columns: 1fr;
  }
}

/* ?? ???? ?? */
.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.keyword-mine-panel[hidden] {
  display: none !important;
}

.keyword-mine-panel:not([hidden]) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
}

.keyword-mine-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 8px;
  flex-shrink: 0;
}

.keyword-mine-panel-head-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.keyword-mine-panel-title {
  font-size: 16px;
  font-weight: 600;
  color: #f1f5f9;
}

.keyword-mine-panel-hint {
  font-size: 12px;
  color: #94a3b8;
}

.keyword-mine-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: flex-end;
  padding: 0 16px 12px;
  flex-shrink: 0;
}

.keyword-mine-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.keyword-mine-field > span {
  font-size: 12px;
  color: #94a3b8;
}

.keyword-mine-seed {
  flex: 1;
  min-width: 180px;
}

.keyword-mine-field input,
.keyword-mine-field select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 14px;
}

.keyword-mine-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #cbd5e1;
  padding-bottom: 6px;
  cursor: pointer;
  user-select: none;
}

.keyword-mine-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 0 16px 10px;
  flex-shrink: 0;
}

.keyword-mine-count {
  font-size: 13px;
  color: #94a3b8;
}

.keyword-mine-status {
  margin: 0 16px 8px;
  font-size: 13px;
  color: #94a3b8;
}

.keyword-mine-status.is-error {
  color: #f87171;
}

.keyword-mine-geo-loading {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at center, rgba(14, 165, 233, 0.16), transparent 55%),
    rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
}

.keyword-mine-geo-loading[hidden] {
  display: none !important;
}

.keyword-mine-geo-loading-card {
  position: relative;
  width: min(420px, 92vw);
  padding: 28px 26px 24px;
  border-radius: 16px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background:
    linear-gradient(160deg, rgba(15, 23, 42, 0.96), rgba(8, 47, 73, 0.9));
  box-shadow:
    0 0 0 1px rgba(125, 211, 252, 0.08) inset,
    0 20px 60px rgba(2, 6, 23, 0.55),
    0 0 40px rgba(14, 165, 233, 0.18);
  overflow: hidden;
  text-align: center;
}

.keyword-mine-geo-loading-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.75);
  color: #e2e8f0;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.keyword-mine-geo-loading-close:hover {
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.35);
}

.keyword-mine-geo-loading-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 20%,
    rgba(125, 211, 252, 0.08) 45%,
    transparent 70%
  );
  animation: keyword-mine-geo-scan 2.8s linear infinite;
  pointer-events: none;
}

.keyword-mine-geo-loading-orbit {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
}

.keyword-mine-geo-loading-orbit span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: #38bdf8;
  border-right-color: rgba(56, 189, 248, 0.25);
  animation: keyword-mine-geo-spin 1.4s linear infinite;
}

.keyword-mine-geo-loading-orbit span:nth-child(2) {
  inset: 8px;
  border-top-color: #a78bfa;
  animation-duration: 2s;
  animation-direction: reverse;
}

.keyword-mine-geo-loading-orbit span:nth-child(3) {
  inset: 16px;
  border-top-color: #22d3ee;
  animation-duration: 1.1s;
}

.keyword-mine-geo-loading-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #67e8f9;
  margin-bottom: 8px;
  font-weight: 600;
}

.keyword-mine-geo-loading-stage {
  font-size: 0.95rem;
  color: #e2e8f0;
  margin-bottom: 14px;
  font-weight: 600;
}

.keyword-mine-geo-loading-text {
  min-height: 1.6em;
  font-size: 0.92rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: linear-gradient(90deg, #7dd3fc, #c4b5fd, #67e8f9, #7dd3fc);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: keyword-mine-geo-gradient 3s linear infinite;
  letter-spacing: 0.02em;
}

.keyword-mine-geo-loading-text::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: linear-gradient(180deg, #67e8f9, #38bdf8);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
  animation: keyword-mine-geo-caret 0.8s steps(1) infinite;
}

.keyword-mine-geo-loading-bar {
  margin-top: 18px;
  height: 3px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.8);
  overflow: hidden;
}

.keyword-mine-geo-loading-bar i {
  display: block;
  height: 100%;
  width: 38%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, #38bdf8, #a78bfa, transparent);
  animation: keyword-mine-geo-bar 1.6s ease-in-out infinite;
}

@keyframes keyword-mine-geo-spin {
  to { transform: rotate(360deg); }
}

@keyframes keyword-mine-geo-scan {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

@keyframes keyword-mine-geo-gradient {
  0% { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}

@keyframes keyword-mine-geo-caret {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes keyword-mine-geo-bar {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.keyword-mine-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 16px 16px;
}

.keyword-mine-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.keyword-mine-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.keyword-mine-group-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.keyword-mine-group-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  align-items: center;
}

.keyword-mine-group-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.keyword-mine-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #1e293b;
}

.keyword-mine-item:hover {
  border-color: #475569;
}

.keyword-mine-item-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
  cursor: pointer;
}

.keyword-mine-item-check input {
  margin-top: 3px;
  flex-shrink: 0;
}

.keyword-mine-item-body {
  min-width: 0;
  flex: 1;
}

.keyword-mine-item-text {
  font-size: 14px;
  color: #f1f5f9;
  line-height: 1.4;
  word-break: break-word;
}

.keyword-mine-item-hint {
  margin-top: 4px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

.keyword-mine-item-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.keyword-mine-item-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  align-self: flex-start;
}

.keyword-mine-more-wrap {
  position: relative;
}

.keyword-mine-more-btn {
  min-width: 36px;
  letter-spacing: 1px;
  font-weight: 700;
}

.keyword-mine-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  min-width: 88px;
  padding: 4px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.keyword-mine-more-menu[hidden] {
  display: none !important;
}

.keyword-mine-more-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  text-align: left;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
}

.keyword-mine-more-item:hover {
  background: rgba(59, 130, 246, 0.2);
}

.keyword-mine-cover-btn,
.keyword-mine-auto-btn,
.keyword-mine-qa-btn,
.keyword-mine-dig-btn,
.keyword-mine-knowledge-card-btn {
  flex-shrink: 0;
  margin-top: 0;
  white-space: nowrap;
}

.keyword-mine-qa-gen-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 10px;
}

.keyword-mine-qa-result-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.keyword-mine-qa-list,
.keyword-mine-qa-library-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
}

.keyword-mine-qa-library-list {
  max-height: none;
}

.keyword-mine-item-hint.is-muted {
  color: #64748b;
}

.qa-tag-field {
  position: relative;
}

.qa-tag-input-wrap {
  position: relative;
}

.qa-tag-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 30;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  max-height: 180px;
  overflow-y: auto;
}

.qa-tag-suggest-item {
  display: block;
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  text-align: left;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.86rem;
}

.qa-tag-suggest-item:hover {
  background: rgba(59, 130, 246, 0.18);
}

.qa-library-toolbar {
  flex-wrap: wrap;
  gap: 8px;
}

.my-qa-item-top {
  margin-bottom: 6px;
}

.my-qa-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
}

.my-qa-status-badge.status-pending {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.18);
}

.my-qa-status-badge.status-to_publish {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.16);
}

.my-qa-status-badge.status-to_answer {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.16);
}

.my-qa-status-badge.status-answered {
  color: #86efac;
  background: rgba(34, 197, 94, 0.16);
}

.my-qa-status-select {
  min-width: 92px;
  max-width: 110px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.78rem;
}

.my-qa-url-meta a {
  color: #93c5fd;
  word-break: break-all;
}

.my-qa-url-meta a:hover {
  text-decoration: underline;
}

.keyword-mine-cover-card {
  max-height: 88vh;
}

.keyword-mine-cover-body {
  overflow-y: auto;
  max-height: calc(88vh - 56px);
}

.keyword-mine-cover-step-actions {
  justify-content: flex-start;
  margin: 4px 0 8px;
}

.keyword-mine-cover-section-label {
  font-size: 0.84rem;
  color: #cbd5e1;
  margin-bottom: 8px;
  font-weight: 600;
}

.keyword-mine-cover-titles-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.keyword-mine-cover-title-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
  cursor: pointer;
}

.keyword-mine-cover-title-item:hover {
  border-color: #38bdf8;
}

.keyword-mine-cover-title-item:has(input:checked) {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

.keyword-mine-cover-title-item input {
  margin-top: 3px;
  flex-shrink: 0;
}

.keyword-mine-cover-title-text {
  flex: 1;
  min-width: 0;
  color: #e2e8f0;
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
}

.keyword-mine-cover-methods-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.keyword-mine-cover-method-field span {
  font-size: 0.8rem;
  color: #94a3b8;
}

.keyword-mine-cover-method-input {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  font-size: 0.84rem;
  line-height: 1.45;
  font-family: inherit;
  padding: 9px 10px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #0f172a;
  color: #f1f5f9;
  box-sizing: border-box;
}

#keywordMineCoverStatus.is-error {
  color: #fca5a5;
}

.keyword-mine-knowledge-card-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 10px;
}

.keyword-mine-knowledge-card-style-field {
  margin-bottom: 8px;
}

.keyword-mine-knowledge-card-style-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.keyword-mine-knowledge-card-theme-output {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.keyword-mine-knowledge-card-keyword-input {
  width: 100%;
  min-height: 56px;
  resize: vertical;
  line-height: 1.45;
}

.keyword-mine-knowledge-card-process-block {
  margin-bottom: 14px;
}

.keyword-mine-knowledge-card-process-block h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.keyword-mine-knowledge-card-process-pre {
  margin: 0;
  padding: 10px 12px;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#keywordMineKnowledgeCardStatus.is-error {
  color: #fca5a5;
}

.cover-project-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  margin: 8px 0 12px;
}

.cover-project-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.cover-project-list-name {
  font-weight: 600;
}

.cover-project-list-meta {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.75;
}

.cover-project-list-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.keyword-mine-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.4;
  background: #334155;
  color: #cbd5e1;
}

.keyword-mine-badge-baidu {
  background: #1e3a5f;
  color: #93c5fd;
}

.keyword-mine-badge-ai {
  background: #3b2f1a;
  color: #fcd34d;
}

.keyword-mine-badge-paste {
  background: #1a3b2f;
  color: #86efac;
}

.keyword-mine-empty {
  color: #64748b;
  font-size: 14px;
  text-align: center;
  padding: 32px 0;
}

.keyword-mine-mine-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.keyword-mine-mine-section[hidden] {
  display: none !important;
}

.keyword-mine-panel.is-geo-mode .keyword-mine-geo {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.keyword-mine-geo {
  margin: 0 14px 10px;
  padding: 12px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  flex-shrink: 0;
  max-height: 42vh;
  overflow: auto;
}

.keyword-mine-geo-hist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
  margin-bottom: 8px;
}

.keyword-mine-geo-hist-main {
  min-width: 0;
  flex: 1;
}

.keyword-mine-geo-hist-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.keyword-mine-geo-hist-meta {
  font-size: 12px;
  color: #94a3b8;
}

.keyword-mine-geo-hist-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.keyword-mine-geo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.keyword-mine-geo-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.keyword-mine-geo-raw-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(62vh, 640px);
  overflow: auto;
}

.keyword-mine-geo-raw-block {
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
}

.keyword-mine-geo-raw-block h4 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: #e2e8f0;
}

.keyword-mine-geo-raw-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.55;
  color: #cbd5e1;
}

.keyword-mine-geo-head-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  min-width: 0;
}

.keyword-mine-geo-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #e2e8f0;
}

.keyword-mine-geo-meta {
  font-size: 12px;
  color: #94a3b8;
}

.keyword-mine-geo-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: #64748b;
}

.keyword-mine-geo-recommend {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.08);
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.55;
  position: relative;
}

.keyword-mine-geo-recommend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.keyword-mine-geo-recommend-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #7dd3fc;
}

.keyword-mine-geo-recommend-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.keyword-mine-geo-recommend-close:hover {
  background: rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
}

.keyword-mine-geo-recommend-text {
  color: #f1f5f9;
  word-break: break-word;
  white-space: pre-wrap;
}

.keyword-mine-geo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.keyword-mine-geo-card {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.35);
}

.keyword-mine-geo-card-main {
  flex: 1;
  min-width: 0;
}

.keyword-mine-geo-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 6px;
}

.keyword-mine-geo-card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #94a3b8;
}

.keyword-mine-geo-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.7);
  color: #cbd5e1;
}

.keyword-mine-geo-chip.is-easy {
  background: rgba(22, 101, 52, 0.35);
  color: #86efac;
}

.keyword-mine-geo-chip.is-mid {
  background: rgba(146, 64, 14, 0.35);
  color: #fcd34d;
}

.keyword-mine-geo-chip.is-hard {
  background: rgba(153, 27, 27, 0.35);
  color: #fca5a5;
}

.keyword-mine-geo-card-copy {
  font-size: 13px;
  line-height: 1.45;
  color: #cbd5e1;
}

.keyword-mine-geo-card-reason {
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
}

.keyword-mine-geo-card-side {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.keyword-mine-geo-modal-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(58vh, 560px);
  overflow: auto;
}

.keyword-mine-geo-block {
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
}

.keyword-mine-geo-block h4 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: #e2e8f0;
}

.keyword-mine-geo-block p,
.keyword-mine-geo-block li {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #cbd5e1;
}

.keyword-mine-geo-block ul {
  margin: 0;
  padding-left: 18px;
}

.keyword-mine-geo-source-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.keyword-mine-geo-source-table th,
.keyword-mine-geo-source-table td {
  border-bottom: 1px solid #334155;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  color: #cbd5e1;
}

.keyword-mine-geo-source-table th {
  color: #94a3b8;
  font-weight: 500;
}

.keyword-mine-geo-source-table a {
  color: #93c5fd;
  word-break: break-all;
}

@media (max-width: 720px) {
  .keyword-mine-geo-card {
    flex-direction: column;
  }
  .keyword-mine-geo-card-side {
    justify-content: flex-end;
  }
}

/* ?? ????? ?? */
.photo-video-panel[hidden] {
  display: none !important;
}

.photo-video-panel:not([hidden]) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.photo-video-panel-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px 6px;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.photo-video-panel-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #e2e8f0;
}

.photo-video-panel-hint {
  font-size: 0.72rem;
  color: #64748b;
}

.photo-video-ffmpeg-warn {
  margin: 8px 14px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  font-size: 0.78rem;
}

.photo-video-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 0;
  overflow: hidden;
}

.photo-video-controls {
  width: 300px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 10px 12px 16px;
  border-right: 1px solid #334155;
  background: rgba(15, 23, 42, 0.45);
}

.photo-video-preview-col {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 12px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.photo-video-section {
  margin-bottom: 14px;
}

.photo-video-label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
}

.photo-video-hint {
  margin: 0 0 8px;
  font-size: 0.72rem;
  color: #64748b;
}

.photo-video-random-btn {
  margin-bottom: 0;
  flex-shrink: 0;
}

.photo-video-upload-zone {
  border: 1px dashed #475569;
  border-radius: 10px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.35);
}

.photo-video-upload-zone.is-dragover {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.08);
}

.photo-video-image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
  min-height: 48px;
}

.photo-video-empty-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.72rem;
  color: #64748b;
  text-align: center;
  padding: 8px 0;
}

.photo-video-thumb {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #334155;
  background: #0f172a;
  display: flex;
  flex-direction: column;
}

.photo-video-thumb img {
  width: 100%;
  height: 112px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.photo-video-score-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  font-size: 11px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.75);
  color: #fef3c7;
}

.photo-video-thumb-caption {
  padding: 4px;
  background: rgba(15, 23, 42, 0.95);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.photo-video-caption-input,
.photo-video-effect-select,
.photo-video-fit-select {
  width: 100%;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  padding: 3px 6px;
  box-sizing: border-box;
}

.photo-video-caption-input {
  min-height: 52px;
  resize: vertical;
  line-height: 1.35;
  white-space: pre-wrap;
  font-family: inherit;
}

.photo-video-bgm-pick {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.photo-video-bgm-audio {
  width: 100%;
  height: 32px;
}

.my-article-project-recommend {
  margin-bottom: 12px;
}

.my-article-project-recommend-hint {
  font-size: 12px;
  color: #64748b;
  margin: 4px 0 10px;
}

.my-article-project-recommend-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.photo-video-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  color: #f8fafc;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.photo-video-upload-btn {
  display: inline-flex;
  cursor: pointer;
}

.photo-video-check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
}

.photo-video-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #cbd5e1;
  cursor: pointer;
}

.photo-video-check-inline {
  margin-top: 8px;
}

.photo-video-text-input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.82rem;
}

.photo-video-select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.82rem;
}

.photo-video-hint.is-error {
  color: #fca5a5;
}

.photo-video-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.photo-video-progress-wrap {
  margin-top: 10px;
}

.photo-video-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: #1e293b;
  overflow: hidden;
}

.photo-video-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  transition: width 0.25s ease;
}

.photo-video-status {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
  min-height: 1.2em;
}

.photo-video-status.is-error {
  color: #f87171;
}

.photo-video-preview-wrap {
  width: min(100%, 360px);
}

.photo-video-preview {
  width: 100%;
  max-height: 640px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: #000;
}

.photo-video-download-btn {
  display: inline-flex;
  margin-top: 10px;
  text-decoration: none;
}

.photo-video-preview-placeholder {
  width: min(100%, 360px);
  padding: 24px 16px;
  border: 1px dashed #334155;
  border-radius: 12px;
  text-align: center;
  color: #64748b;
  font-size: 0.82rem;
}

.photo-video-upload-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.photo-video-font-select {
  flex: 1;
  min-width: 0;
}

.photo-video-batch-sync {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.35;
}

.photo-video-batch-sync input {
  margin-top: 2px;
  flex-shrink: 0;
}

.photo-video-thumb.is-selected {
  border-color: #818cf8;
  box-shadow: 0 0 0 1px #818cf8;
}

.photo-video-color-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.photo-video-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid #64748b;
  padding: 0;
  cursor: pointer;
  box-sizing: border-box;
}

.photo-video-color-swatch.is-border {
  box-shadow: inset 0 0 0 2px rgba(15, 23, 42, 0.35);
}

.photo-video-caption-stage {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 16px;
}

.photo-video-caption-frame-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.photo-video-caption-frame {
  position: relative;
  width: 100%;
  max-width: 320px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 9 / 16;
}

.photo-video-caption-frame.is-landscape {
  max-width: 480px;
  aspect-ratio: 16 / 9;
}

.photo-video-caption-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
}

.photo-video-caption-overlay {
  position: absolute;
  left: 50%;
  top: 82%;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: 90%;
  padding: 4px 8px 10px 4px;
  cursor: grab;
  user-select: none;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.25;
  font-weight: 700;
  z-index: 2;
  touch-action: none;
  -webkit-text-stroke: 1px #ffffff;
  paint-order: stroke fill;
}

.photo-video-caption-text {
  display: inline-block;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  pointer-events: none;
}

.photo-video-caption-resize {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  font-size: 11px;
  line-height: 16px;
  cursor: nwse-resize;
  touch-action: none;
  z-index: 3;
}

.photo-video-caption-overlay.is-dragging {
  cursor: grabbing;
}

.photo-video-caption-overlay.is-resizing {
  cursor: nwse-resize;
}

.photo-video-caption-size-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.photo-video-caption-size-row input[type="range"] {
  flex: 1;
}

.photo-video-history-section {
  margin-top: 0.5rem;
}

.photo-video-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
}

.photo-video-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid #334155;
}

.photo-video-history-item.is-error {
  border-color: rgba(248, 113, 113, 0.35);
}

.photo-video-history-title {
  font-size: 0.85rem;
  color: #e2e8f0;
}

.photo-video-history-meta {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.photo-video-history-status {
  font-size: 0.72rem;
  color: #86efac;
}

.photo-video-history-status.is-error {
  color: #fca5a5;
}

.photo-video-history-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.35rem;
}

@media (max-width: 900px) {
  .photo-video-layout {
    flex-direction: column;
  }

  .photo-video-controls {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #334155;
    max-height: 52vh;
  }

  .photo-video-check-grid {
    grid-template-columns: 1fr;
  }
}

/* ????? */
.kb-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.kb-search-input,
.kb-filter-select {
  flex: 1;
  min-width: 140px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  padding: 6px 10px;
  font-size: 13px;
}

.kb-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  margin-bottom: 10px;
}

.kb-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 6px;
}

.kb-card-meta,
.kb-view-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-size: 12px;
  color: #94a3b8;
}

.kb-card-time {
  margin-top: 6px;
  font-size: 11px;
  color: #64748b;
}

.kb-card-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  max-width: 280px;
}

.kb-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  font-size: 11px;
}

.kb-muted {
  color: #94a3b8;
}

.kb-stars,
.kb-stars-inline {
  color: #475569;
  letter-spacing: 2px;
}

.kb-stars {
  display: flex;
  gap: 2px;
  margin-top: 4px;
}

.kb-star {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.kb-star.is-on,
.kb-stars-inline {
  color: #fbbf24;
}

.kb-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 720px) {
  .kb-edit-grid {
    grid-template-columns: 1fr;
  }
  .kb-card {
    flex-direction: column;
  }
  .kb-card-actions {
    max-width: none;
    justify-content: flex-start;
  }
}

.kb-edit-card {
  z-index: 110;
}

.kb-edit-card .modal-body {
  max-height: calc(90vh - 56px);
  overflow-y: auto;
}

.kb-view-notes {
  margin: 10px 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid #334155;
}

.kb-view-notes h4 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.kb-notes-body {
  font-size: 0.9rem;
  color: #e2e8f0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.kb-view-content {
  min-height: 120px;
}

.kb-view-content img {
  max-width: 100%;
  height: auto;
}

#kbEditorWrap {
  border: 1px solid #334155;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

/* ---- ?????? ---- */
.pest-report-card {
  max-width: min(920px, 96vw);
}

.pest-report-body {
  max-height: calc(90vh - 120px);
  overflow-y: auto;
  padding-bottom: 8px;
}

.pest-block {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.7);
}

.pest-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.pest-block h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: #e2e8f0;
  font-weight: 600;
}

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

.pest-block-head h4 {
  margin: 0;
}

.pest-preset-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pest-preset-wrap label {
  margin: 0;
  font-size: 0.82rem;
  color: #94a3b8;
  white-space: nowrap;
}

.pest-preset-select {
  min-width: 160px;
  max-width: 220px;
}

.pest-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.pest-form-grid-1 {
  grid-template-columns: 1fr;
}

.pest-form-span-2 {
  grid-column: 1 / -1;
}

.pest-form-grid label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8rem;
  color: #94a3b8;
}

.pest-form-grid input,
.pest-form-grid textarea,
.pest-preset-select,
.pest-report-card input[type="text"],
.pest-report-card input[type="date"],
.pest-report-card input[type="tel"],
.pest-report-card select,
.pest-report-card textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid rgba(100, 116, 139, 0.75);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  color: #f1f5f9;
  font-size: 0.92rem;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pest-report-card textarea {
  min-height: 88px;
  resize: vertical;
}

.pest-form-grid input:focus,
.pest-form-grid textarea:focus,
.pest-preset-select:focus,
.pest-report-card input:focus,
.pest-report-card select:focus,
.pest-report-card textarea:focus {
  border-color: rgba(96, 165, 250, 0.85);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.pest-preset-select {
  min-width: 180px;
  max-width: 240px;
  cursor: pointer;
}

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

.pest-photo-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(51, 65, 85, 0.85);
  border-radius: 10px;
}

.pest-photo-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-size: 0.86rem;
}

.pest-photo-table th,
.pest-photo-table td {
  border-bottom: 1px solid rgba(51, 65, 85, 0.75);
  padding: 10px;
  vertical-align: top;
  text-align: left;
}

.pest-photo-table th {
  background: rgba(15, 23, 42, 0.65);
  color: #cbd5e1;
  font-weight: 600;
  white-space: nowrap;
}

.pest-photo-table tr:last-child td {
  border-bottom: none;
}

.pest-photo-cell-img {
  width: 110px;
}

.pest-photo-cell-act {
  width: 78px;
  text-align: center;
  vertical-align: middle;
}

.pest-photo-gen-btn {
  white-space: nowrap;
  min-width: 56px;
}

.pest-photo-gen-btn.is-retry {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.55);
}

.pest-photo-thumb-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.5);
}

.pest-photo-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pest-photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  font-size: 14px;
  z-index: 1;
}

.pest-photo-remove:hover {
  background: #b91c1c;
}

.pest-photo-result {
  width: 100%;
  min-height: 88px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid rgba(100, 116, 139, 0.65);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  font-size: 0.84rem;
  line-height: 1.45;
  resize: vertical;
}

.pest-photo-status {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: #94a3b8;
}

.pest-photo-status.is-busy {
  color: #93c5fd;
}

.pest-photo-status.is-error {
  color: #fca5a5;
}

.pest-photo-empty {
  margin: 0;
  padding: 16px;
  text-align: center;
  color: #64748b;
  font-size: 0.88rem;
}

.pest-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.pest-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.9rem;
  color: #e2e8f0;
  cursor: pointer;
}

.pest-check input {
  width: auto;
  margin: 0;
}

.pest-hint {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: #94a3b8;
}

.pest-report-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(51, 65, 85, 0.7);
}

.pest-report-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pest-result-card {
  width: min(920px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.pest-result-card.is-fullscreen {
  width: 100vw !important;
  max-width: none !important;
  height: 100vh !important;
  max-height: none !important;
  border-radius: 0;
}

.pest-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pest-result-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pest-result-body {
  flex: 1;
  overflow: auto;
  padding: 16px 20px 8px;
  background: #f8fafc;
  color: #0f172a;
}

.pest-result-doc {
  font-size: 14px;
  line-height: 1.7;
  color: #0f172a;
  outline: none;
}

.pest-result-doc h1 {
  text-align: center;
  font-size: 22px;
  margin: 0 0 18px;
  color: #0f172a;
}

.pest-result-doc h2 {
  font-size: 16px;
  margin: 22px 0 10px;
  color: #0f172a;
  border-left: 3px solid #2563eb;
  padding-left: 8px;
}

.pest-result-doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 14px;
  background: #fff;
}

.pest-result-doc th,
.pest-result-doc td {
  border: 1px solid #334155;
  padding: 8px 10px;
  vertical-align: top;
  text-align: left;
  word-break: break-word;
}

.pest-result-doc th {
  background: #e2e8f0;
  font-weight: 600;
}

.pest-result-doc .pest-basic-info-table th {
  width: 14%;
  white-space: nowrap;
  background: #f1f5f9;
  font-weight: 600;
}

.pest-result-doc .pest-basic-info-table td {
  width: 36%;
}

.pest-result-doc .pest-risk-photos-table img,
.pest-result-doc img.pest-risk-photo {
  width: 100px !important;
  max-width: 100px !important;
  max-height: 100px !important;
  height: auto !important;
  object-fit: cover;
  display: block;
}

.pest-result-doc .pest-result-knowledge img,
.pest-result-doc .pest-result-knowledge-wide img {
  width: auto;
  max-width: 100%;
  max-height: none;
  height: auto;
  object-fit: contain;
}

.pest-result-doc .pest-result-knowledge-wide img {
  width: 600px;
  max-width: min(600px, 100%);
}

.pest-result-doc .pest-result-knowledge {
  margin: 6px 0 10px;
}

.pest-result-doc .pest-result-knowledge p,
.pest-result-doc .pest-result-knowledge-wide p {
  margin: 0 0 6px;
}

.pest-result-doc .pest-result-knowledge p:empty,
.pest-result-doc .pest-result-knowledge-wide p:empty {
  display: none;
}

.pest-result-doc .pest-harm-table td,
.pest-result-doc .pest-harm-table th {
  vertical-align: middle;
}

.pest-result-doc .pest-result-solution-block p {
  margin: 0 0 8px;
}

.pest-result-doc .pest-result-sign {
  margin-top: 48px;
  text-align: right;
  line-height: 1.8;
}

.pest-result-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(51, 65, 85, 0.7);
}

.pest-my-reports-card {
  width: min(1100px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pest-my-reports-body {
  display: flex;
  gap: 0;
  flex: 1;
  min-height: 0;
  padding: 0 !important;
  overflow: hidden;
}

.pest-my-reports-sidebar {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid rgba(51, 65, 85, 0.7);
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.45);
}

.pest-my-reports-tools {
  padding: 10px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.65);
}

.pest-my-reports-search {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(100, 116, 139, 0.65);
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
}

.pest-my-reports-list {
  flex: 1;
  overflow: auto;
  padding: 8px;
}

.pest-my-reports-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  margin-bottom: 6px;
}

.pest-my-reports-item:hover {
  background: rgba(51, 65, 85, 0.55);
}

.pest-my-reports-item.is-active {
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(37, 99, 235, 0.2);
}

.pest-my-reports-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 4px;
}

.pest-my-reports-item-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 0;
}

.pest-my-reports-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #0f172a;
}

.pest-my-reports-editor {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pest-my-reports-title {
  margin: 12px 14px 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(100, 116, 139, 0.55);
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  font-size: 1rem;
}

.pest-my-reports-content {
  flex: 1;
  min-height: 280px;
  margin: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  outline: none;
}

.pest-my-reports-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 14px 14px;
}

.pest-my-reports-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

@media (max-width: 640px) {
  .pest-form-grid {
    grid-template-columns: 1fr;
  }
  .pest-form-span-2 {
    grid-column: auto;
  }
}

/* ???? ? ???? */
.video-desc-modal-card {
  width: min(780px, 96vw);
  max-height: min(82vh, 740px);
}
.video-desc-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.video-desc-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(70vh, 640px);
  overflow: hidden;
  padding-top: 8px;
}
.video-desc-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.video-desc-cat-tab {
  border: 1px solid #334155;
  background: #1e293b;
  color: #94a3b8;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.video-desc-cat-tab:hover {
  border-color: #475569;
  color: #e2e8f0;
}
.video-desc-cat-tab.active {
  color: #f1f5f9;
  border-color: #60a5fa;
  background: rgba(96, 165, 250, 0.15);
}
.video-desc-cat-tab.is-picked {
  color: #ecfdf5;
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.22);
}
.video-desc-cat-tab.active.is-picked {
  color: #ecfdf5;
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.32);
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.35);
}
.video-desc-block-tabs {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.video-desc-block-tab {
  flex: 1;
  border: 1px solid #475569;
  background: #0f172a;
  color: #94a3b8;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}
.video-desc-block-tab.active {
  color: #e2e8f0;
  border-color: #818cf8;
  background: rgba(129, 140, 248, 0.12);
}
.video-desc-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  gap: 8px;
  overflow: hidden;
}
.video-desc-section[hidden] {
  display: none !important;
}
.video-desc-section-hint {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
  flex-shrink: 0;
}
.video-desc-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  flex: 1;
  min-height: 0;
  max-height: min(48vh, 420px);
  overflow: auto;
  padding: 2px;
  align-content: start;
}
.video-desc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 108px;
  padding: 12px 14px 14px;
  border: 1px solid #334155;
  border-radius: 12px;
  background: #1e293b;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.video-desc-card:hover {
  border-color: #64748b;
  background: #243247;
}
.video-desc-card.is-selected {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.25);
}
.video-desc-card-title {
  display: block;
  width: 100%;
  padding-right: 24px;
  font-size: 0.92rem;
  font-weight: 650;
  color: #f1f5f9;
  line-height: 1.35;
  word-break: break-word;
}
.video-desc-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.45;
}
.video-desc-heart {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.55);
  color: #64748b;
  cursor: pointer;
  padding: 0;
}
.video-desc-heart:hover {
  background: rgba(248, 113, 113, 0.16);
  color: #f87171;
}
.video-desc-heart.is-fav {
  color: #f43f5e;
}
@media (max-width: 640px) {
  .video-desc-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ???? ??????? Site Audit ???? */
.site-audit-panel[hidden] {
  display: none !important;
}
.site-audit-panel:not([hidden]) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
}
.site-audit-panel-head {
  padding: 14px 16px 8px;
  flex-shrink: 0;
}
.site-audit-panel-head-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}
.site-audit-panel-title {
  font-size: 16px;
  font-weight: 600;
  color: #f1f5f9;
}
.site-audit-panel-hint {
  font-size: 12px;
  color: #94a3b8;
}
.site-audit-form,
.site-audit-form-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: flex-end;
  padding: 0 16px 10px;
  flex-shrink: 0;
}
.site-audit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 100px;
}
.site-audit-field span {
  font-size: 12px;
  color: #94a3b8;
}
.site-audit-field input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 14px;
  min-width: 0;
}
.site-audit-url {
  flex: 1 1 280px;
}
.site-audit-brand {
  flex: 0 1 140px;
}
.site-audit-keywords {
  flex: 1 1 260px;
}
.site-audit-hint-inline {
  font-size: 12px;
  color: #64748b;
  padding-bottom: 8px;
}
.site-audit-status {
  margin: 0 16px 8px;
  font-size: 13px;
  color: #94a3b8;
}
.site-audit-status.is-error {
  color: #f87171;
}
.site-audit-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 16px 16px;
}
.site-audit-empty {
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.6;
  padding: 24px 8px;
}
.site-audit-empty ul {
  margin: 12px 0 0;
  padding-left: 18px;
}
.site-audit-score-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.site-audit-score-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 12px 14px;
}
.site-audit-score-card.is-overall {
  border-color: #38bdf8;
}
.site-audit-score-label {
  font-size: 12px;
  color: #94a3b8;
}
.site-audit-score-value {
  font-size: 28px;
  font-weight: 700;
  color: #f1f5f9;
  margin-top: 4px;
}
.site-audit-grade {
  font-size: 18px;
  color: #38bdf8;
  margin-left: 4px;
}
.site-audit-score-bar {
  margin-top: 8px;
  height: 4px;
  border-radius: 999px;
  background: #334155;
  overflow: hidden;
}
.site-audit-score-bar i {
  display: block;
  height: 100%;
  background: #38bdf8;
}
.site-audit-meta-line {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 10px;
  word-break: break-all;
}
.site-audit-spa-warn {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  margin-bottom: 12px;
}
.site-audit-actions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0;
}
.site-audit-actions-head h4 {
  margin: 0;
  font-size: 14px;
  color: #e2e8f0;
}
.site-audit-top-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.site-audit-action-item {
  display: flex;
  gap: 10px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px 12px;
}
.site-audit-action-pri {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #0f172a;
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.site-audit-action-title {
  font-size: 13px;
  color: #f1f5f9;
}
.site-audit-action-how {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}
.site-audit-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.site-audit-chip {
  border: 1px solid #334155;
  background: #1e293b;
  color: #94a3b8;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.site-audit-chip.is-active {
  border-color: #38bdf8;
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.12);
}
.site-audit-check {
  border: 1px solid #334155;
  border-radius: 8px;
  background: #1e293b;
  margin-bottom: 8px;
  overflow: hidden;
}
.site-audit-check summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}
.site-audit-check summary::-webkit-details-marker {
  display: none;
}
.site-audit-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  flex-shrink: 0;
}
.site-audit-check.is-pass .site-audit-dot { background: #34d399; }
.site-audit-check.is-warn .site-audit-dot { background: #fbbf24; }
.site-audit-check.is-fail .site-audit-dot { background: #f87171; }
.site-audit-check.is-skip .site-audit-dot { background: #64748b; }
.site-audit-check-name {
  font-size: 13px;
  color: #e2e8f0;
  font-weight: 600;
}
.site-audit-tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #0f172a;
  color: #94a3b8;
}
.site-audit-check-msg {
  flex: 1 1 180px;
  font-size: 12px;
  color: #94a3b8;
}
.site-audit-check-body {
  padding: 0 12px 12px;
  font-size: 13px;
  color: #cbd5e1;
}
.site-audit-evidence {
  margin: 8px 0 0;
  padding: 8px;
  background: #0f172a;
  border-radius: 6px;
  font-size: 11px;
  color: #94a3b8;
  overflow: auto;
  max-height: 160px;
}
.site-audit-remediation {
  margin: 18px 0 14px;
  padding: 14px 14px 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.35);
}

.site-audit-remediation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.site-audit-remediation-head h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  color: #e2e8f0;
}

.site-audit-remediation-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}

.site-audit-remediation-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.site-audit-remediation-item {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.35);
}

.site-audit-remediation-item.is-fail {
  border-color: rgba(248, 113, 113, 0.35);
}

.site-audit-remediation-item.is-warn {
  border-color: rgba(251, 191, 36, 0.3);
}

.site-audit-remediation-item-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.site-audit-remediation-idx {
  flex: 0 0 auto;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  background: #a5b4fc;
}

.site-audit-remediation-item-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #f1f5f9;
  font-size: 13px;
}

.site-audit-remediation-sev {
  font-size: 11px;
  color: #94a3b8;
}

.site-audit-remediation-item p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.65;
  color: #cbd5e1;
}

.site-audit-remediation-item p b {
  color: #e2e8f0;
}

.site-audit-remediation-status {
  color: #fde68a !important;
}

.site-audit-remediation-example {
  margin: 0 0 8px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.site-audit-remediation-accept {
  margin-bottom: 0 !important;
  color: #86efac !important;
}

.site-audit-artifacts {
  margin-top: 16px;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 12px;
  color: #94a3b8;
}
.site-audit-artifacts summary {
  cursor: pointer;
  color: #e2e8f0;
  font-size: 13px;
}
.site-audit-art-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px;
  font-size: 12px;
  padding: 6px 0;
  border-top: 1px solid #1e293b;
}
.site-audit-art-row b {
  color: #94a3b8;
  font-weight: 500;
}
.site-audit-art-row span {
  color: #cbd5e1;
  word-break: break-word;
}
.site-audit-muted {
  color: #64748b;
  font-size: 13px;
}
.site-audit-history-modal[hidden] {
  display: none !important;
}
.site-audit-history-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-audit-history-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
}
.site-audit-history-card {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  max-height: min(70vh, 640px);
  overflow: auto;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px 16px;
}
.site-audit-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.site-audit-history-head h3 {
  margin: 0;
  font-size: 16px;
  color: #f1f5f9;
}
.site-audit-history-item {
  width: 100%;
  display: flex;
  gap: 10px;
  text-align: left;
  border: 1px solid #334155;
  background: #1e293b;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  color: inherit;
}
.site-audit-history-grade {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #0f172a;
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.site-audit-history-url {
  display: block;
  font-size: 13px;
  color: #e2e8f0;
  word-break: break-all;
}
.site-audit-history-meta {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}
@media (max-width: 720px) {
  .site-audit-score-row {
    grid-template-columns: 1fr;
  }
}

/* ???? ???????????? + ????? ???? */
.site-audit-actions-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}
.site-audit-loading[hidden] {
  display: none !important;
}
.site-audit-loading {
  margin: 0 16px 10px;
  flex-shrink: 0;
}
.site-audit-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 16px 16px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}
.site-audit-loading-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #334155;
  border-top-color: #38bdf8;
  animation: site-audit-spin 0.8s linear infinite;
}
@keyframes site-audit-spin {
  to { transform: rotate(360deg); }
}
.site-audit-loading-eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #64748b;
}
.site-audit-loading-stage {
  font-size: 14px;
  color: #e2e8f0;
}
.site-audit-loading-bar {
  width: min(280px, 70%);
  height: 3px;
  border-radius: 999px;
  background: #334155;
  overflow: hidden;
  margin-top: 4px;
}
.site-audit-loading-bar i {
  display: block;
  height: 100%;
  width: 40%;
  background: #38bdf8;
  border-radius: 999px;
  animation: site-audit-bar 1.2s ease-in-out infinite;
}
@keyframes site-audit-bar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(280%); }
}
.site-audit-source-modal[hidden] {
  display: none !important;
}
.site-audit-source-modal {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-audit-source-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
}
.site-audit-source-card {
  position: relative;
  width: min(920px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px 16px;
  overflow: hidden;
}
.site-audit-source-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.site-audit-source-head h3 {
  margin: 0;
  font-size: 16px;
  color: #f1f5f9;
}
.site-audit-source-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-audit-source-meta {
  margin: 0 0 8px;
  font-size: 12px;
  color: #64748b;
  word-break: break-all;
  flex-shrink: 0;
}
.site-audit-source-pre {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 12px;
  overflow: auto;
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ???? ???????AI ???? ???? */
.site-audit-check summary {
  position: relative;
}
.site-audit-check.is-fail summary,
.site-audit-check.is-warn summary {
  padding-right: 88px;
}
.site-audit-ai-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  flex-shrink: 0;
  z-index: 1;
}
.site-audit-ai-advice {
  margin-top: 1.6em;
  white-space: pre-wrap;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.6;
}
.site-audit-ai-advice.is-loading {
  color: #94a3b8;
}
.site-audit-ai-advice.is-error {
  color: #f87171;
}
.site-audit-ai-modal[hidden] {
  display: none !important;
}
.site-audit-ai-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-audit-ai-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
}
.site-audit-ai-card {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px 16px 16px;
}
.site-audit-ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.site-audit-ai-head h3 {
  margin: 0;
  font-size: 16px;
  color: #f1f5f9;
}
.site-audit-ai-topic {
  margin: 0 0 12px;
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
  word-break: break-word;
}
.site-audit-ai-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.site-audit-ai-field span {
  font-size: 12px;
  color: #94a3b8;
}
.site-audit-ai-field select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 14px;
}
.site-audit-ai-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.site-audit-stars {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  letter-spacing: 0;
  line-height: 1;
}
.site-audit-star {
  font-size: 13px;
  color: #334155;
}
.site-audit-star.is-on {
  color: #fbbf24;
}
.site-audit-check.is-fail .site-audit-star.is-on {
  color: #f87171;
}
.site-audit-check.is-warn .site-audit-star.is-on {
  color: #fbbf24;
}

/* ËÄ¸ñÂþ»­ */
.four-panel-comic-modal[hidden] { display: none !important; }
.four-panel-comic-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.four-panel-comic-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.four-panel-comic-card {
  position: relative;
  width: min(560px, 96vw);
  max-height: min(88vh, 860px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}
.four-panel-comic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
}
.four-panel-comic-head h3 {
  margin: 0;
  font-size: 16px;
  color: #f1f5f9;
}
.four-panel-comic-body {
  padding: 14px 16px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.four-panel-comic-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.four-panel-comic-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #cbd5e1;
}
.four-panel-comic-field select,
.four-panel-comic-field textarea {
  width: 100%;
  border: 1px solid #475569;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  resize: vertical;
}
.four-panel-comic-field textarea {
  min-height: 72px;
  line-height: 1.5;
}
.four-panel-comic-ref-label {
  font-size: 13px;
  color: #cbd5e1;
  margin-bottom: 6px;
}
.four-panel-comic-ref-box {
  display: flex;
  align-items: center;
  gap: 10px;
}
.four-panel-comic-ref-upload {
  width: 72px;
  height: 72px;
  border: 1px dashed #64748b;
  border-radius: 10px;
  background: #0f172a;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
}
.four-panel-comic-ref-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.four-panel-comic-ref-upload #fourPanelComicRefPlus {
  font-size: 28px;
  line-height: 1;
}
.four-panel-comic-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.four-panel-comic-actions-bottom {
  justify-content: space-between;
}
.four-panel-comic-actions-bottom .btn-primary-small {
  margin-left: auto;
}
.four-panel-comic-status {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
}
.four-panel-comic-status.is-error {
  color: #f87171;
}
@media (max-width: 560px) {
  .four-panel-comic-row {
    grid-template-columns: 1fr;
  }
  .four-panel-comic-actions-bottom {
    flex-wrap: wrap;
  }
}
