:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --color-bg-base: #0f1419;
  --color-bg-surface: #121820;
  --color-bg-elevated: #1c2735;
  --color-bg-active: #1a3050;
  --color-bg-code: #0f1419;
  --color-bg-warning: #2a2318;
  --color-bg-error: #3a1f24;
  --color-bg-info: #152033;

  --color-text-primary: #e7ecf3;
  --color-text-secondary: #c9d7ea;
  --color-text-muted: #8fa3bf;
  --color-text-faint: #6b829e;
  --color-text-meta: #5f738d;
  --color-text-link: #6ab0ff;
  --color-text-error: #ffb4b0;
  --color-text-info: #9ec5ff;

  --color-border: #243041;
  --color-border-input: #2a3a50;
  --color-border-warning: #5c4a2a;
  --color-border-input-focus: #3d8bfd;

  --color-accent: #3d8bfd;
  --color-accent-user: #2458a6;
  --color-danger: #c4453d;

  --radius-sm: 8px;
  --radius-xs: 4px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;

  background: var(--color-bg-base);
  color: var(--color-text-primary);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
  margin: 0;
}

.app-shell {
  display: flex;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  height: 100%;
  background: var(--color-bg-surface);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-base);
  border-right: 1px solid var(--color-border);
  z-index: 3;
  width: min(280px, 78vw);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2;
  cursor: pointer;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-md) var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  min-height: 52px;
}

.sidebar-close,
.header-menu-btn {
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  width: 32px;
  height: 32px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
}

.sidebar-new {
  width: 100%;
  border: 1px dashed var(--color-border-input);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  padding: 10px var(--space-md);
  font-size: 14px;
  cursor: pointer;
  margin-bottom: var(--space-sm);
}

.sidebar-new:hover {
  background: var(--color-bg-elevated);
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sidebar-date-group + .sidebar-date-group {
  margin-top: var(--space-sm);
}

.sidebar-date-divider {
  display: flex;
  justify-content: center;
  padding: 6px 0 8px;
}

.sidebar-date-divider span {
  font-size: 11px;
  color: var(--color-text-faint);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  line-height: 1.4;
}

.sidebar-item-wrap {
  position: relative;
  list-style: none;
}

.sidebar-item {
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-secondary);
  padding: 10px 36px 10px var(--space-md);
  text-align: left;
  cursor: pointer;
}

.sidebar-item-delete {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-faint);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.sidebar-item-wrap:hover .sidebar-item-delete,
.sidebar-item-wrap:focus-within .sidebar-item-delete {
  opacity: 1;
}

.sidebar-item-delete:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
}

.sidebar-item-delete:active {
  color: #e57373;
}

.sidebar-item:hover {
  background: var(--color-bg-elevated);
}

.sidebar-item-active {
  background: var(--color-bg-active);
  color: var(--color-text-primary);
}

.sidebar-item-title {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-item-meta {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--color-text-faint);
}

.sidebar-empty,
.sidebar-more {
  padding: 24px var(--space-md);
  text-align: center;
  font-size: 13px;
  color: var(--color-text-faint);
}

.sidebar-more {
  padding: var(--space-md);
}

.sidebar-footer {
  flex-shrink: 0;
  padding: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.avatar-picker {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.avatar-picker-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  padding: 10px var(--space-md);
  text-align: left;
  cursor: pointer;
}

.avatar-picker-trigger:hover:not(:disabled) {
  background: var(--color-bg-active);
}

.avatar-picker-trigger:disabled {
  opacity: 0.7;
  cursor: wait;
}

.avatar-picker-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.avatar-picker-label {
  font-size: 14px;
  color: var(--color-text-primary);
}

.avatar-picker-hint,
.avatar-picker-error {
  font-size: 11px;
  line-height: 1.4;
}

.avatar-picker-hint {
  color: var(--color-text-faint);
}

.avatar-picker-error {
  margin: 0;
  color: var(--color-text-error);
}

.avatar-picker-reset {
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 12px;
  padding: 4px 0;
  cursor: pointer;
  align-self: flex-start;
}

.avatar-picker-reset:hover:not(:disabled) {
  color: var(--color-text-secondary);
}

.avatar-picker-input {
  display: none;
}

.header-avatar-entry {
  display: flex;
  align-items: center;
}

.user-avatar {
  position: relative;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
}

.user-avatar-sm {
  width: 40px;
  height: 40px;
}

.user-avatar-md {
  width: 48px;
  height: 48px;
}

.user-avatar svg,
.user-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar-interactive {
  cursor: pointer;
}

.user-avatar-interactive:hover {
  filter: brightness(1.08);
}

.user-avatar-edit-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  border-top-left-radius: 4px;
  background: rgba(15, 20, 25, 0.72);
}

.user-avatar-edit-badge::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

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

.header-actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
  align-items: center;
}

.header-actions-mobile {
  display: none;
}

.header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  cursor: pointer;
  flex-shrink: 0;
}

.header-icon-btn:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-active);
}

.header-more-menu {
  position: relative;
}

.header-more-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-elevated);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.header-more-item {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-primary);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.header-more-item:hover:not(:disabled) {
  background: var(--color-bg-active);
}

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

.header-more-item-danger {
  color: var(--color-text-error);
}

.header-more-divider {
  height: 1px;
  margin: 4px 6px;
  background: var(--color-border);
}

.header-more-wechat .ghost-btn,
.header-more-wechat .wechat-account-bound {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-primary);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.header-more-wechat .ghost-btn:hover {
  background: var(--color-bg-active);
}

.header-more-wechat .wechat-account-bound {
  color: var(--color-text-muted);
  cursor: default;
}

@media (min-width: 768px) {
  .app-shell {
    max-width: 960px;
    margin: 0 auto;
  }

  .sidebar-backdrop {
    display: none;
  }

  .sidebar {
    position: static;
    width: 260px;
    flex-shrink: 0;
  }
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-base);
  position: sticky;
  top: 0;
  z-index: 2;
}

.header-title {
  font-weight: 700;
  font-size: 18px;
}

.header-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-btn,
.send-btn,
.danger-btn,
.tool-confirm-actions button {
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

.ghost-btn {
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
}

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

.send-btn {
  background: var(--color-accent);
  color: white;
  min-width: 72px;
}

.danger-btn,
.tool-confirm-actions .danger {
  background: var(--color-danger);
  color: white;
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 10px var(--space-lg);
  font-size: 13px;
}

.banner-error {
  background: var(--color-bg-error);
  color: var(--color-text-error);
}

.banner-offline {
  background: var(--color-bg-warning);
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border-warning);
}

.banner-info {
  background: var(--color-bg-info);
  color: var(--color-text-info);
}

.banner-warning {
  background: var(--color-bg-warning);
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border-warning);
}

.text-error {
  color: var(--color-text-error);
}

.banner-action,
.banner-dismiss {
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.main {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) var(--space-sm);
  background: var(--color-bg-surface);
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding-bottom: var(--space-sm);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--color-text-muted);
  margin-top: 18vh;
  gap: var(--space-sm);
}

.empty-state .tkmind-avatar {
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-xs);
}

.tkmind-avatar {
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #0a0a0a;
}

.tkmind-avatar-sm {
  width: 40px;
  height: 40px;
}

.tkmind-avatar-md {
  width: 48px;
  height: 48px;
}

.tkmind-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-brand-avatar {
  flex-shrink: 0;
}

.user-avatar-input-host {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}

.empty-state h2 {
  color: var(--color-text-primary);
  margin: 0 0 var(--space-xs);
  font-size: 18px;
}

.empty-state p {
  margin: 0;
  font-size: 14px;
}

.msg-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.msg-time-divider {
  display: flex;
  justify-content: center;
  padding: 2px 0;
}

.msg-time-divider span {
  font-size: 12px;
  color: var(--color-text-faint);
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  line-height: 1.4;
}

.msg-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0 6px;
}

.msg-row-user {
  flex-direction: row;
  justify-content: flex-end;
}

.msg-row-assistant {
  flex-direction: row;
  justify-content: flex-start;
}

.msg-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
}

.msg-avatar.user-avatar {
  width: 40px;
  height: 40px;
}

.msg-content {
  max-width: calc(100% - 56px);
  min-width: 0;
}

.msg-row-user .msg-content {
  display: flex;
  justify-content: flex-end;
}

.msg-bubble-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.msg-row-user .msg-bubble-wrap {
  flex-direction: row-reverse;
}

.msg-copy {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-muted);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.msg-bubble-wrap:hover .msg-copy,
.msg-bubble-wrap:focus-within .msg-copy {
  opacity: 1;
  pointer-events: auto;
}

.msg-copy:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--color-text-secondary);
}

.msg-copy-done {
  opacity: 1;
  pointer-events: auto;
  color: #5cd88a;
  background: rgba(92, 216, 138, 0.15);
}

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

.msg-save-page {
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-secondary);
  background: var(--color-bg-elevated);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, border-color 0.15s, color 0.15s;
}

.msg-bubble-wrap:hover .msg-save-page,
.msg-bubble-wrap:focus-within .msg-save-page {
  opacity: 1;
  pointer-events: auto;
}

.msg-save-page:hover {
  color: #eeb04e;
  border-color: rgba(238, 176, 78, 0.6);
}

.msg-save-page:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

@media (hover: none) {
  .msg-copy,
  .msg-save-page {
    opacity: 0.55;
    pointer-events: auto;
  }
}

.page-save-backdrop {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(7, 12, 10, 0.72);
  backdrop-filter: blur(10px);
}

.page-save-panel {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(calc(100dvh - 40px), 720px);
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid rgba(238, 176, 78, 0.3);
  border-radius: 26px;
  color: #18211d;
  background:
    radial-gradient(circle at 100% 0, rgba(47, 111, 87, 0.16), transparent 20rem),
    #f8f3e8;
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.page-save-backdrop.is-preview-scroll-locked {
  overflow: hidden;
}

.page-save-scroll.is-preview-scroll-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

.page-save-scroll {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 18px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.page-save-panel h2 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 34px;
  font-weight: 500;
}

.page-save-panel label,
.mindspace-new-page label,
.mindspace-page-editor label {
  display: grid;
  gap: 8px;
  color: #52605a;
  font-size: 13px;
  font-weight: 700;
}

.page-save-panel input,
.page-save-panel textarea,
.page-save-panel select,
.mindspace-new-page input,
.mindspace-new-page textarea,
.mindspace-new-page select,
.mindspace-page-editor input,
.mindspace-page-editor textarea,
.mindspace-page-editor select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(24, 33, 29, 0.18);
  border-radius: 12px;
  outline: none;
  color: #18211d;
  background: #fffdf7;
  font: inherit;
}

.page-save-panel input:focus,
.page-save-panel textarea:focus,
.page-save-panel select:focus,
.mindspace-new-page input:focus,
.mindspace-new-page textarea:focus,
.mindspace-new-page select:focus,
.mindspace-page-editor input:focus,
.mindspace-page-editor textarea:focus,
.mindspace-page-editor select:focus {
  border-color: #2f6f57;
  box-shadow: 0 0 0 3px rgba(47, 111, 87, 0.12);
}

.page-save-actions {
  display: flex;
  flex-shrink: 0;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 4px;
}

.page-save-actions button {
  padding: 11px 16px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}

.page-save-primary {
  color: #fffaf0;
  background: #2f6f57;
}

.page-save-error {
  color: #8b2d20;
  font-size: 13px;
}

.page-save-notice {
  color: #2f6f57;
  font-size: 13px;
  font-weight: 700;
}

.page-save-state {
  color: #52605a;
  font-size: 14px;
}

.page-save-panel-wide {
  width: min(980px, 100%);
}

.page-save-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 24px;
}

.page-save-form {
  display: grid;
  gap: 16px;
}

.page-save-preview-block {
  display: grid;
  gap: 10px;
}

.page-save-preview-dual {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(120px, 0.65fr);
  gap: 12px;
  align-items: start;
}

.page-save-preview-pane {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.page-save-preview-label {
  color: #52605a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-save-preview-hint {
  margin: 0;
  color: #7a8680;
  font-size: 11px;
  line-height: 1.4;
}

.page-save-mini-page {
  height: min(380px, 46vh);
  border: 1px solid rgba(24, 33, 29, 0.14);
  border-radius: 14px;
  overflow: hidden;
  background: #ece7dc;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  overscroll-behavior: contain;
  isolation: isolate;
}

.page-save-preview-pane-page {
  overscroll-behavior: contain;
}

.page-save-mini-page-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.page-save-card-thumb {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 12px;
  background: linear-gradient(160deg, #f3eee6 0%, #e7efe9 100%);
}

.page-save-card-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-save-card-thumb-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 12px;
  color: #7a8680;
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
}

.page-save-preview-block > span {
  color: #52605a;
  font-size: 13px;
  font-weight: 700;
}

.page-save-preview-frame {
  width: 100%;
  height: min(360px, 40vh);
  min-height: 220px;
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 16px;
  background: #fff;
}

.page-save-source {
  margin: 0;
  color: #68716c;
  font-size: 12px;
}

.page-save-targets {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.page-save-targets legend {
  margin-bottom: 6px;
  grid-column: 1 / -1;
  color: #52605a;
  font-size: 12px;
  font-weight: 700;
}

.page-save-target {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.9);
  cursor: pointer;
}

.page-save-target input {
  width: auto;
  margin-top: 2px;
  flex-shrink: 0;
}

.page-save-target strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
  line-height: 1.3;
}

.page-save-target small {
  color: #68716c;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
}

.page-save-aside {
  padding: 18px;
  border-radius: 18px;
  background: rgba(47, 111, 87, 0.08);
}

.page-save-aside h3 {
  margin: 8px 0 14px;
  font-size: 22px;
}

.page-save-destination-preview {
  display: grid;
  gap: 12px;
}

.page-save-destination-preview > span {
  color: #9b6518;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-save-destination-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.page-save-destination-card {
  min-height: 48px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px dashed rgba(24, 33, 29, 0.16);
  background: rgba(255, 253, 247, 0.72);
  font-size: 12px;
}

.page-save-destination-card.is-active {
  border-style: solid;
  border-color: #2f6f57;
  background: rgba(47, 111, 87, 0.12);
  font-weight: 700;
}

.page-save-destination-card.is-muted {
  opacity: 0.55;
}

.page-save-destination-preview p {
  margin: 0;
  color: #52605a;
  font-size: 13px;
  line-height: 1.6;
}

.page-save-private-panel {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(155, 101, 24, 0.08);
  border: 1px solid rgba(155, 101, 24, 0.18);
}

.page-save-private-panel p {
  margin: 0;
  color: #52605a;
  font-size: 13px;
  line-height: 1.6;
}

.page-save-private-findings {
  margin: 0;
  padding-left: 18px;
  color: #6d4c1b;
  font-size: 12px;
}

.page-save-private-ack {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
}

.page-save-private-ack input {
  width: auto;
  margin-top: 3px;
}

.page-save-target.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.msg-open-preview {
  padding: 4px 10px;
  border-radius: 999px;
  color: #2f6f57;
  background: rgba(47, 111, 87, 0.1);
  font-size: 12px;
  text-decoration: none;
}

.msg-bubble-wrap-compact {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.msg-bubble-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}

.msg-bubble-wrap-compact .msg-bubble {
  flex: 1;
  min-width: 0;
  max-width: none;
}

.msg-actions-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 999px;
  color: #52605a;
  background: rgba(255, 252, 244, 0.96);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.msg-actions-toggle.is-open {
  color: #2f6f57;
  background: rgba(47, 111, 87, 0.12);
}

.msg-actions-chevron {
  transition: transform 0.15s ease;
}

.msg-actions-chevron.is-open,
.msg-actions-toggle.is-open .msg-actions-chevron {
  transform: rotate(90deg);
}

.msg-actions-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(24, 33, 29, 0.08);
}

.msg-actions-compact .msg-copy,
.msg-actions-compact .msg-save-page {
  opacity: 1;
  pointer-events: auto;
}

.page-save-panel-compact {
  width: min(440px, calc(100vw - 32px));
}

.page-save-panel-compact .page-save-layout {
  grid-template-columns: 1fr;
}

.page-save-panel-compact .page-save-preview-dual {
  grid-template-columns: 1fr;
}

.page-save-panel-compact .page-save-preview-pane-thumb {
  max-width: 180px;
}

.page-save-panel-compact .page-save-preview-frame {
  min-height: 180px;
}

.mindspace-item-cover-img,
.mindspace-page-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mindspace-page-card.has-cover {
  padding-top: 0;
  overflow: hidden;
}

.mindspace-page-card-cover {
  height: 140px;
  margin: -24px -24px 16px;
  overflow: hidden;
  background: rgba(47, 111, 87, 0.1);
}

.mindspace-page-card-cover iframe {
  width: 100%;
  min-height: 140px;
  border: 0;
  pointer-events: none;
}

.msg-bubble {
  position: relative;
  max-width: min(72vw, 520px);
  padding: 9px 12px;
  border-radius: 6px;
  line-height: 1.5;
  word-break: break-word;
  font-size: 15px;
}

.msg-bubble-assistant {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.msg-bubble-assistant::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 12px;
  border: 6px solid transparent;
  border-right-color: var(--color-bg-elevated);
  border-left: 0;
}

.msg-bubble-user {
  background: var(--color-accent-user);
  color: var(--color-text-primary);
}

.msg-bubble-user::before {
  content: '';
  position: absolute;
  right: -6px;
  top: 12px;
  border: 6px solid transparent;
  border-left-color: var(--color-accent-user);
  border-right: 0;
}

.msg-image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.msg-image-link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: rgba(0, 0, 0, 0.03);
  max-width: 168px;
}

.msg-image-thumb {
  display: block;
  width: auto;
  height: auto;
  max-width: 168px;
  max-height: 168px;
  object-fit: cover;
}

.msg-typing {
  padding: 12px 16px;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 8px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-faint);
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing-bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.thinking {
  margin-bottom: var(--space-sm);
  font-size: 12px;
  color: var(--color-text-muted);
}

.thinking pre {
  white-space: pre-wrap;
  margin: var(--space-sm) 0 0;
  font-size: 12px;
  color: var(--color-text-faint);
}

.tool-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-sm);
}

.tool-badge {
  font-size: 12px;
  background: var(--color-bg-code);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
}

.tool-confirm {
  margin: 0 var(--space-lg) var(--space-sm);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--color-bg-warning);
  border: 1px solid var(--color-border-warning);
}

.tool-confirm-text {
  font-size: 14px;
  margin-bottom: 10px;
}

.tool-confirm-actions {
  display: flex;
  gap: var(--space-sm);
}

.tool-confirm-actions button {
  background: var(--color-accent);
  color: white;
}

.footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg) calc(var(--space-md) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-base);
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.chat-image-attachments {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-image-upload-error {
  color: #8a1f1f;
  font-size: 12px;
}

.chat-image-attachment-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding-bottom: 2px;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: auto;
}

.chat-image-attachment-item {
  position: relative;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
}

.chat-image-attachment-item a {
  display: block;
  width: 100%;
  height: 100%;
}

.chat-image-attachment-thumb {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(24, 33, 29, 0.1);
  background: rgba(0, 0, 0, 0.04);
}

.chat-image-attachment-remove {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  color: var(--color-text-primary);
  background: rgba(0, 0, 0, 0.58);
  font-size: 12px;
  cursor: pointer;
}

.chat-image-upload-trigger {
  position: absolute;
  left: 10px;
  top: 7px;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(24, 33, 29, 0.18);
  border-radius: 7px;
  background: rgba(24, 33, 29, 0.08);
  color: #5d6963;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-image-upload-trigger:hover:not(:disabled) {
  background: rgba(24, 33, 29, 0.12);
  color: #4b5651;
}

.chat-image-upload-trigger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-input-shell {
  position: relative;
  flex: 1;
  min-width: 0;
}

.chat-input-row .input {
  min-width: 0;
  min-height: 38px;
}

.chat-input-row textarea.input.chat-input-field {
  width: 100%;
  padding: 8px 46px 8px 42px;
  font-size: 14px;
  line-height: 1.35;
  resize: none;
}

.chat-input-field-with-image-upload {
  padding-left: 42px;
}

.chat-input-action {
  flex: 0 0 auto;
  white-space: nowrap;
}

.chat-skill-picker {
  position: relative;
  flex: 0 0 auto;
}

.chat-skill-trigger {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 42px;
  height: 42px;
  padding: 4px 8px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-lg);
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.chat-skill-trigger:hover:not(:disabled) {
  color: var(--color-text-primary);
  border-color: var(--color-border-strong);
  background: var(--color-bg-hover);
}

.chat-skill-trigger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chat-skill-trigger-icon {
  width: 16px;
  height: 16px;
}

.chat-skill-trigger-label {
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--color-text-muted);
}

.chat-skill-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-elevated);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.chat-skill-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-primary);
  text-align: left;
  cursor: pointer;
}

.chat-skill-menu-item:hover {
  background: var(--color-bg-hover);
}

.chat-skill-menu-leading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chat-skill-menu-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--color-accent);
}

.chat-skill-menu-item:hover .chat-skill-menu-icon {
  color: var(--color-text-primary);
}

.chat-skill-menu-label {
  font-size: 14px;
  font-weight: 500;
}

.chat-skill-menu-tag {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--color-bg-code);
  color: var(--color-text-muted);
  font-size: 10px;
  line-height: 1.4;
  text-transform: lowercase;
}

.chat-skill-picker.open .chat-skill-trigger {
  color: var(--color-text-primary);
  border-color: var(--color-accent);
  background: var(--color-bg-hover);
}

.voice-btn {
  position: absolute;
  right: 7px;
  bottom: 6px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(24, 33, 29, 0.18);
  border-radius: 7px;
  background: rgba(24, 33, 29, 0.08);
  color: #5d6963;
  cursor: pointer;
  transition:
    background-color 120ms ease,
    color 120ms ease,
    border-color 120ms ease;
}

.voice-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.voice-btn:hover:not(:disabled) {
  background: rgba(24, 33, 29, 0.12);
  color: #4b5651;
  border-color: rgba(24, 33, 29, 0.28);
}

.voice-btn-recording {
  color: #07c160;
  background: rgba(7, 193, 96, 0.12);
  border-color: rgba(7, 193, 96, 0.28);
  box-shadow: none;
  animation: none;
}

.voice-btn-wechat {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.voice-btn-busy:not(.voice-btn-recording) {
  opacity: 0.55;
}

.voice-btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #07c160;
  border-top-color: transparent;
  border-radius: 50%;
  animation: voice-spin 0.8s linear infinite;
}

.voice-btn-eq {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  width: 18px;
  height: 18px;
}

.voice-btn-eq-bar {
  width: 2px;
  border-radius: 1px;
  background: currentColor;
  animation: voice-bars 0.85s ease-in-out infinite;
}

.voice-btn-eq-bar:nth-child(1) {
  height: 8px;
}

.voice-btn-eq-bar:nth-child(2) {
  height: 14px;
  animation-delay: 0.15s;
}

.voice-btn-eq-bar:nth-child(3) {
  height: 11px;
  animation-delay: 0.3s;
}

.voice-btn-eq-bar:nth-child(4) {
  height: 16px;
  animation-delay: 0.45s;
}

.voice-notice {
  font-size: 12px;
  color: var(--color-danger);
  padding: 0 2px;
}

@keyframes voice-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes voice-bars {
  0%,
  100% {
    transform: scaleY(0.35);
    opacity: 0.55;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

.voice-dialog-backdrop {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 12, 10, 0.72);
  backdrop-filter: blur(10px);
}

.voice-dialog {
  display: grid;
  gap: 16px;
  width: min(480px, 100%);
  padding: 22px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-bg-surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.voice-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.voice-dialog-eyebrow {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.voice-dialog-header h3 {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 600;
}

.voice-dialog-close {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid var(--color-border-input);
  border-radius: 999px;
  color: var(--color-text-secondary);
  background: var(--color-bg-elevated);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.voice-waveform {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 72px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--color-bg-elevated);
}

.voice-waveform-bar {
  display: block;
  width: 4px;
  height: var(--voice-bar-height, 18%);
  min-height: 8px;
  border-radius: 999px;
  background: var(--color-text-faint);
  transition: height 80ms linear;
}

.voice-waveform-active .voice-waveform-bar {
  background: var(--color-accent);
}

.voice-waveform-idle .voice-waveform-bar {
  animation: voice-wave-idle 1.1s ease-in-out infinite;
}

.voice-waveform-idle .voice-waveform-bar:nth-child(odd) {
  animation-delay: 0.15s;
}

@keyframes voice-wave-idle {
  0%,
  100% {
    height: 18%;
  }
  50% {
    height: 56%;
  }
}

.voice-dialog-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: 20px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.voice-dialog-input {
  width: 100%;
  min-height: 96px;
}

.voice-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

.input {
  flex: 1;
  resize: none;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  padding: 10px var(--space-md);
  font: inherit;
}

.input:focus {
  outline: none;
  border-color: var(--color-border-input-focus);
}

.meta {
  font-size: 11px;
  color: var(--color-text-meta);
  text-align: center;
  padding: 0 var(--space-lg) 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Markdown rendering === */
.bubble-text {
  font-size: 15px;
  color: inherit;
}

.bubble-text .md-p {
  margin: 0 0 0.5em;
}

.bubble-text .md-p:last-child {
  margin-bottom: 0;
}

.bubble-text .md-h1,
.bubble-text .md-h2,
.bubble-text .md-h3,
.bubble-text .md-h4,
.bubble-text .md-h5,
.bubble-text .md-h6 {
  margin: 0.8em 0 0.3em;
  font-weight: 600;
  color: var(--color-text-primary);
}

.bubble-text .md-h1 { font-size: 1.3em; }
.bubble-text .md-h2 { font-size: 1.15em; }
.bubble-text .md-h3 { font-size: 1.05em; }

.bubble-text a {
  color: var(--color-text-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bubble-text a:active {
  opacity: 0.7;
}

.bubble-text code {
  background: var(--color-bg-code);
  padding: 2px 6px;
  border-radius: var(--radius-xs, 4px);
  font-size: 0.9em;
  font-family: "SF Mono", "Fira Code", Menlo, monospace;
}

.bubble-text pre {
  background: var(--color-bg-code);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  overflow-x: auto;
  margin: 0.5em 0;
  font-size: 0.85em;
  line-height: 1.5;
}

.bubble-text pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.bubble-text .md-li {
  list-style: none;
  margin: 0.2em 0;
  padding-left: 0.5em;
}

.bubble-text .md-li::before {
  content: "•";
  margin-right: 0.5em;
  color: var(--color-text-link);
}

.bubble-text .md-img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 0.5em 0;
}

.bubble-text strong {
  color: var(--color-text-primary);
}

.bubble-text em {
  font-style: italic;
}

.bubble-text s {
  text-decoration: line-through;
  color: var(--color-text-muted);
}

.bubble-text br {
  display: block;
  content: "";
  margin: 0.5em 0;
}

/* === Login Screen === */
.app-loading,
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
}

.app-loading {
  color: var(--color-text-muted);
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 360px;
}

.login-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  min-height: 28px;
}

.login-plaza-back {
  margin-bottom: var(--space-sm);
}

.login-plaza-back a {
  color: var(--color-text-muted, #4a5751);
  font-size: 14px;
  text-decoration: none;
}

.login-plaza-back a:hover {
  color: var(--color-text-link, #2f6f57);
}

.login-topbar-sep {
  width: 1px;
  height: 14px;
  background: var(--color-border);
}

.login-link {
  border: none;
  background: none;
  padding: 4px 2px;
  font-size: 14px;
  color: var(--color-text-link);
  cursor: pointer;
  transition: opacity 0.15s;
}

.login-link:hover {
  opacity: 0.8;
}

.login-form {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: var(--space-md);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.login-brand-avatar {
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-xs);
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: var(--color-text-primary);
}

.login-desc {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: var(--space-xs) 0 0;
}

.login-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.login-input {
  width: 100%;
  padding: 14px var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-input);
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.login-input::placeholder {
  color: var(--color-text-faint);
}

.login-input:focus {
  border-color: var(--color-border-input-focus);
}

.login-input-error {
  border-color: var(--color-danger);
}

.login-error {
  font-size: 14px;
  color: var(--color-text-error);
  margin: calc(-1 * var(--space-sm)) 0 0;
}

.login-success {
  font-size: 14px;
  color: #7dd3a0;
  margin: calc(-1 * var(--space-sm)) 0 0;
}

.login-wechat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: var(--radius-lg);
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background: #07c160;
  color: white;
  transition: opacity 0.2s;
}

.login-wechat-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.login-wechat-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  transition: border-color 0.2s, background 0.2s;
}

.login-wechat-secondary:hover:not(:disabled) {
  border-color: rgba(7, 193, 96, 0.45);
  background: rgba(7, 193, 96, 0.05);
}

.login-wechat-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.login-wechat-secondary .login-wechat-icon {
  color: #07c160;
}

.login-alt-methods {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
}

.login-wechat-scan-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-elevated);
  overflow: hidden;
}

.login-wechat-scan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.login-wechat-scan-close {
  border: none;
  background: none;
  padding: 0;
  font-size: 13px;
  color: var(--color-text-link);
  cursor: pointer;
}

.login-wechat-scan-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
}

.login-wechat-scan-qr-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
}

.login-wechat-scan-qr {
  display: block;
  width: 180px;
  height: 180px;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.login-wechat-scan-qr.is-expired {
  filter: grayscale(0.35) opacity(0.45);
}

.login-wechat-wxlogin {
  width: 180px;
  height: 180px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
}

.login-wechat-wxlogin.is-expired {
  filter: grayscale(0.35) opacity(0.45);
}

.login-wechat-wxlogin iframe {
  width: 300px;
  height: 300px;
  transform: scale(0.6);
  transform-origin: 0 0;
  border: none;
}

.login-wechat-scan-expired-mask {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  background: rgba(15, 20, 25, 0.72);
  color: #fff;
  cursor: pointer;
  padding: 12px;
}

.login-wechat-scan-expired-text {
  font-size: 15px;
  font-weight: 600;
}

.login-wechat-scan-expired-action {
  font-size: 13px;
  color: #7dd3a0;
}

.login-wechat-scan-expired-mask:hover {
  background: rgba(15, 20, 25, 0.82);
}

.login-wechat-scan-loading {
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--color-bg-surface);
  color: var(--color-text-muted);
  font-size: 13px;
}

.login-wechat-scan-tip {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.5;
}

.login-mode-switch {
  align-self: center;
  border: none;
  background: none;
  padding: 4px 2px;
  font-size: 14px;
  color: var(--color-text-link);
  cursor: pointer;
}

.login-mode-switch:hover {
  opacity: 0.8;
}

.login-wechat-btn:hover:not(:disabled) {
  opacity: 0.92;
}

.login-wechat-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.login-wechat-btn-outline {
  background: transparent;
  border: 1px solid #07c160;
  color: #07c160;
}

.login-wechat-btn-outline:hover:not(:disabled) {
  background: rgba(7, 193, 96, 0.08);
  opacity: 1;
}

.login-password-toggle {
  align-self: center;
  margin-top: calc(-1 * var(--space-sm));
}

.wechat-bind-card {
  max-width: 400px;
}

.wechat-bind-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin-bottom: var(--space-xs);
  object-fit: cover;
}

.wechat-bind-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.wechat-bind-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

.wechat-bind-option strong {
  font-size: 16px;
  color: var(--color-text-primary);
}

.wechat-bind-option span {
  font-size: 13px;
  color: var(--color-text-muted);
}

.wechat-bind-option:hover:not(:disabled) {
  border-color: var(--color-border-input-focus);
  background: var(--color-bg-elevated);
}

.wechat-bind-option-primary {
  border-color: rgba(7, 193, 96, 0.45);
  background: rgba(7, 193, 96, 0.06);
}

.wechat-bind-hint {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

.wechat-bind-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.wechat-bind-back {
  align-self: center;
}

.wechat-scan-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
}

.wechat-scan-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.wechat-scan-qr {
  width: 220px;
  height: 220px;
  border-radius: var(--radius-md);
  background: white;
  padding: 8px;
}

.wechat-scan-hint {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
}

.wechat-account-bound {
  cursor: default;
  opacity: 0.85;
  white-space: nowrap;
}

.wechat-account-debug-trigger {
  cursor: pointer;
}

.wechat-debug-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 8, 14, 0.62);
}

.wechat-debug-card {
  width: min(560px, 100%);
  max-height: min(80vh, 720px);
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(20, 29, 40, 0.98), rgba(14, 20, 28, 0.98));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  padding: 18px;
}

.wechat-debug-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
}

.wechat-debug-head h3 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.15;
}

.wechat-debug-eyebrow {
  margin: 0;
  color: #76d89f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.wechat-debug-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.wechat-debug-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--color-text-primary);
}

.wechat-debug-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.wechat-debug-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(118, 216, 159, 0.12);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
}

.wechat-debug-item span {
  color: var(--color-text-faint);
  font-size: 12px;
}

.wechat-debug-item strong,
.wechat-debug-item code {
  color: var(--color-text-primary);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-all;
}

.wechat-debug-item code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.wechat-debug-hint,
.wechat-debug-error {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.wechat-debug-hint {
  color: var(--color-text-muted);
}

.wechat-debug-error {
  color: var(--color-text-error);
}

.wechat-debug-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: 18px;
}

.wechat-open-hint {
  margin: calc(-1 * var(--space-sm)) 0 0;
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.5;
}

.wechat-open-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(0, 0, 0, 0.55);
}

.wechat-open-guide {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 24px 20px 20px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--color-bg-surface);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
}

.wechat-open-guide h2 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--color-text-primary);
}

.wechat-open-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
}

.wechat-open-success {
  margin: 0 0 12px;
  color: #07c160;
  font-size: 14px;
}

.wechat-open-warning {
  margin: 0 0 12px;
  color: var(--color-text-error);
  font-size: 14px;
}

.wechat-open-steps {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--color-text-primary);
  font-size: 14px;
  line-height: 1.6;
}

.wechat-open-steps li + li {
  margin-top: 8px;
}

.wechat-open-url {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  color: var(--color-text-muted);
  font-size: 12px;
}

.wechat-bind-banner {
  flex-wrap: wrap;
  gap: 8px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--color-text-faint);
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}


.balance-pill {
  align-self: center;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-elevated);
  color: var(--color-text-info);
  font-size: 12px;
}

.balance-pill-btn {
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
}

.balance-pill-btn:hover {
  border-color: rgba(106, 176, 255, 0.35);
  background: var(--color-bg-active);
}

.balance-popover-wrap {
  position: relative;
  align-self: center;
}

.balance-ring-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  flex-shrink: 0;
}

.balance-ring-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.balance-ring-svg {
  width: 40px;
  height: 40px;
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 4px rgba(61, 214, 197, 0.55));
}

.balance-ring-track {
  fill: none;
  stroke: #1a2838;
  stroke-width: 4;
}

.balance-ring-spent {
  fill: none;
  stroke: #e8a44a;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s ease;
  filter: drop-shadow(0 0 3px rgba(232, 164, 74, 0.45));
}

.balance-ring-remain {
  fill: none;
  stroke: #3dd6c5;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s ease, stroke 0.2s;
  filter: drop-shadow(0 0 4px rgba(61, 214, 197, 0.55));
}

.balance-ring-btn.low .balance-ring-remain {
  stroke: #ddb945;
  filter: drop-shadow(0 0 4px rgba(221, 185, 69, 0.5));
}

.balance-ring-btn.low .balance-ring-svg {
  filter: drop-shadow(0 0 4px rgba(221, 185, 69, 0.5));
}

.balance-ring-btn.empty .balance-ring-remain {
  stroke: #ef7b7b;
  animation: balance-ring-pulse 1.8s ease-in-out infinite;
}

.balance-ring-btn.empty .balance-ring-svg {
  filter: drop-shadow(0 0 4px rgba(239, 123, 123, 0.5));
}

@keyframes balance-ring-pulse {
  0%,
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(239, 123, 123, 0.5));
  }

  50% {
    opacity: 0.55;
    filter: drop-shadow(0 0 8px rgba(239, 123, 123, 0.5));
  }
}

.balance-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  pointer-events: none;
}

.balance-ring-btn.low .balance-ring-center {
  color: #ddb945;
}

.balance-ring-btn.empty .balance-ring-center {
  color: #ef7b7b;
  font-size: 9px;
}

.balance-popover {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  padding: 14px;
  background: #171f2b;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 120;
}

.balance-popover-wrap.open .balance-popover {
  display: block;
}

.balance-popover h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
}

.balance-popover-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 6px;
}

.balance-popover-label {
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.balance-popover-label-muted {
  color: var(--color-text-faint);
}

.balance-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.balance-dot-remain {
  background: #3dd6c5;
  box-shadow: 0 0 6px rgba(61, 214, 197, 0.55);
}

.balance-dot-spent {
  background: #e8a44a;
  box-shadow: 0 0 6px rgba(232, 164, 74, 0.45);
}

.balance-popover-bar {
  height: 6px;
  border-radius: var(--radius-pill);
  background: #1a2838;
  overflow: hidden;
  display: flex;
  margin: 10px 0 0;
}

.balance-popover-bar-spent {
  background: #e8a44a;
}

.balance-popover-bar-remain {
  background: #3dd6c5;
}

.balance-popover-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.balance-popover-section h5 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.balance-popover-hint {
  margin: 4px 0 0;
  font-size: 10px;
  line-height: 1.45;
  color: var(--color-text-faint);
}

.balance-popover-warning {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.balance-popover-cta {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  margin-top: 12px;
}

.balance-popover-cta:hover {
  filter: brightness(1.08);
}

.notification-center {
  position: relative;
}

.notification-center-trigger {
  position: relative;
}

.notification-center-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #d9485f;
  color: #fff;
  font-size: 10px;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(217, 72, 95, 0.3);
}

.notification-center-popover {
  z-index: 120;
  border: 1px solid rgba(106, 176, 255, 0.18);
  border-radius: 20px;
  color: #e7ecf3;
  background:
    radial-gradient(circle at 100% 0, rgba(61, 139, 253, 0.16), transparent 16rem),
    linear-gradient(180deg, #1a2433 0%, #121820 100%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  padding: 14px;
}

.notification-center-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.notification-center-head h4 {
  margin: 0;
  font-size: 16px;
}

.notification-center-head p {
  margin: 4px 0 0;
  color: var(--color-text-muted);
  font-size: 12px;
}

.notification-center-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.notification-center-filters {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.notification-center-filter {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-secondary);
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.notification-center-filter.is-active {
  border-color: rgba(106, 176, 255, 0.45);
  color: #fff;
  background: rgba(106, 176, 255, 0.16);
}

.notification-center-state {
  margin: 14px 0 0;
  color: var(--color-text-muted);
  font-size: 13px;
}

.notification-center-state.is-error {
  color: #ff9aa9;
}

.notification-center-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  max-height: 420px;
  overflow: auto;
}

.notification-center-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.notification-center-item.is-unread {
  border-color: rgba(106, 176, 255, 0.35);
  background: rgba(106, 176, 255, 0.09);
}

.notification-center-item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.notification-center-item-head strong {
  font-size: 14px;
}

.notification-center-item-head span {
  color: var(--color-text-muted);
  font-size: 11px;
}

.notification-center-item p {
  margin: 8px 0 0;
  color: var(--color-text-secondary);
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.5;
}

.notification-center-digest {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.notification-center-digest-line {
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.notification-center-digest-line.is-title {
  color: #fff;
  font-weight: 600;
}

.notification-center-item-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.notification-center-read-tag {
  color: var(--color-text-muted);
  font-size: 12px;
}

.notification-center-read-btn {
  border: 1px solid rgba(106, 176, 255, 0.42);
  border-radius: 8px;
  padding: 6px 10px;
  color: #f7fbff;
  background: linear-gradient(180deg, rgba(106, 176, 255, 0.32), rgba(54, 125, 218, 0.34));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.notification-center-read-btn:hover {
  border-color: rgba(148, 199, 255, 0.66);
  background: linear-gradient(180deg, rgba(130, 191, 255, 0.42), rgba(65, 139, 234, 0.46));
}

.notification-center-clear-btn,
.notification-center-clear-all-btn {
  border: 1px solid rgba(255, 138, 128, 0.34);
  border-radius: 8px;
  padding: 6px 10px;
  color: #ffeceb;
  background: rgba(255, 107, 96, 0.13);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.notification-center-clear-btn:hover,
.notification-center-clear-all-btn:hover {
  border-color: rgba(255, 166, 158, 0.58);
  background: rgba(255, 107, 96, 0.22);
}

.notification-center-clear-all-btn {
  padding: 5px 9px;
}

.recharge-backdrop {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  overflow-y: auto;
  background: rgba(7, 12, 10, 0.76);
  backdrop-filter: blur(10px);
}

.recharge-dialog {
  display: grid;
  gap: 16px;
  width: min(460px, 100%);
  max-height: min(92vh, 760px);
  overflow: auto;
  margin: auto;
  flex-shrink: 0;
  padding: clamp(22px, 4vw, 30px);
  border: 1px solid rgba(106, 176, 255, 0.22);
  border-radius: 24px;
  color: #e7ecf3;
  background:
    radial-gradient(circle at 100% 0, rgba(61, 139, 253, 0.16), transparent 16rem),
    linear-gradient(180deg, #1a2433 0%, #121820 100%);
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.45);
}

.recharge-dialog-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.recharge-eyebrow {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recharge-dialog h3 {
  margin: 6px 0 0;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
}

.recharge-close {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-secondary);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.recharge-balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.recharge-balance-row strong {
  color: var(--color-text-link);
  font-size: 20px;
}

.recharge-muted {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.recharge-tier-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.recharge-tier {
  padding: 14px 10px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
}

.recharge-tier-active {
  border-color: rgba(106, 176, 255, 0.65);
  background: rgba(61, 139, 253, 0.16);
  color: #d9ebff;
}

.recharge-tier:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.recharge-projected {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.recharge-error {
  margin: 0;
  color: var(--color-text-error);
  font-size: 14px;
}

.recharge-success {
  margin: 0;
  color: #7dd3a0;
  font-size: 14px;
}

.recharge-qr-panel {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px dashed var(--color-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.recharge-qr {
  width: 220px;
  height: 220px;
  border-radius: 12px;
  background: #fff;
}

.recharge-h5-panel {
  display: grid;
  gap: 10px;
}

.recharge-h5-link {
  display: inline-flex;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 12px;
  color: white;
  background: #07c160;
  text-decoration: none;
  font-weight: 700;
}

.recharge-actions {
  display: grid;
  gap: 10px;
}

.recharge-pay-btn,
.recharge-secondary-btn {
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
}

.recharge-pay-btn {
  color: white;
  background: linear-gradient(135deg, #07c160, #06ad56);
}

.recharge-pay-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.recharge-secondary-btn {
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
}

.recharge-warning,
.recharge-legal {
  margin: 0;
  color: var(--color-text-faint);
  font-size: 12px;
  line-height: 1.6;
}

/* ── Subscribe modal ───────────────────────────────── */
.subscribe-dialog {
  background: var(--color-surface, #1a2320);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 24px;
  width: min(92vw, 780px);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.45);
}

.subscribe-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.subscribe-dialog-head h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

.subscribe-balance-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  padding: 10px 14px;
  background: rgba(255,255,255,.04);
  border-radius: 8px;
  margin-bottom: 20px;
}

.subscribe-balance-row strong {
  font-size: 16px;
  font-weight: 700;
  margin-left: 2px;
}

.subscribe-current-plan-tag {
  margin-left: auto;
  font-size: 12px;
  color: var(--color-text-secondary);
  background: rgba(76,175,125,.12);
  border-radius: 4px;
  padding: 2px 8px;
}

/* ── Plan grid ────────────────────────────────────── */
.subscribe-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 560px) {
  .subscribe-plan-grid {
    grid-template-columns: 1fr;
  }
  .subscribe-dialog {
    padding: 18px 16px;
  }
}

.subscribe-plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px 14px 14px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: rgba(255,255,255,.03);
  transition: border-color .15s, background .15s;
}

.subscribe-plan-card--active {
  border-color: var(--color-accent, #4caf7d);
  background: rgba(76,175,125,.07);
}

.subscribe-plan-card--highlight {
  border-color: rgba(76,175,125,.5);
}

.subscribe-plan-badge-top {
  position: absolute;
  top: -1px;
  right: 12px;
  font-size: 11px;
  font-weight: 600;
  background: var(--color-accent, #4caf7d);
  color: #0d1a13;
  border-radius: 0 0 6px 6px;
  padding: 2px 8px;
  letter-spacing: .3px;
}

.subscribe-plan-card-head {
  margin-bottom: 12px;
}

.subscribe-plan-name {
  display: block;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.subscribe-plan-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.subscribe-plan-price-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-accent, #4caf7d);
}

.subscribe-plan-price-unit {
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* Feature list */
.subscribe-plan-features {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.subscribe-plan-features li {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  line-height: 1.4;
}

.subscribe-feat-label {
  color: var(--color-text-secondary);
}

.subscribe-feat-val {
  font-weight: 500;
}

/* Buttons */
.subscribe-plan-btn {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}

.subscribe-plan-btn:disabled {
  cursor: not-allowed;
  opacity: .6;
}

.subscribe-plan-btn--buy {
  background: var(--color-accent, #4caf7d);
  color: #0d1a13;
}

.subscribe-plan-btn--buy:hover:not(:disabled) {
  opacity: .88;
}

.subscribe-plan-btn--short {
  background: rgba(255,255,255,.07);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.subscribe-plan-btn--current {
  background: rgba(255,255,255,.04);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.subscribe-plan-btn--locked {
  background: transparent;
  color: var(--color-text-faint);
  border: 1px dashed var(--color-border);
  cursor: default;
}

.subscribe-plan-card--locked {
  opacity: .55;
}

/* Shortfall banner */
.subscribe-shortfall {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255,180,0,.07);
  border: 1px solid rgba(255,180,0,.2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 10px;
}

.subscribe-shortfall .recharge-pay-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 13px;
}

.subscribe-autorenew-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 4px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--color-border);
}

.subscribe-autorenew-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.subscribe-autorenew-hint {
  font-size: 12px;
  color: var(--color-text-faint);
}

.subscribe-legal {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--color-text-faint);
  text-align: center;
}

.admin-page {
  min-height: 100%;
  padding: 0;
  overflow: auto;
}

.admin-page-head {
  margin-bottom: 16px;
}

.admin-page-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.admin-back-inline {
  display: inline-block;
  margin-bottom: 8px;
  text-decoration: none;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-stat-card {
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
}

.admin-stat-label {
  font-size: 13px;
  color: var(--color-text-muted);
}

.admin-stat-value {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 600;
}

.admin-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.admin-link-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
}

.admin-link-card:hover {
  border-color: var(--color-border-input);
  background: var(--color-bg-subtle, rgba(0, 0, 0, 0.03));
}

.admin-link-card-title {
  font-weight: 600;
}

.admin-inline-link {
  text-decoration: none;
  display: inline-block;
}

.admin-dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.admin-dl div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px;
}

.admin-dl dt {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 13px;
}

.admin-dl dd {
  margin: 0;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.admin-tab {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-text-primary);
  font-size: 14px;
  white-space: nowrap;
}

.admin-tab:hover {
  background: var(--color-bg-subtle, rgba(0, 0, 0, 0.03));
}

.admin-tab.active {
  border-color: var(--color-border-input);
  background: var(--color-bg-surface);
  font-weight: 600;
}

.admin-nav-section + .admin-nav-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.admin-nav-section-label {
  padding: 0 12px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.admin-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--color-bg-base);
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-surface);
}

.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-topbar-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-topbar-user {
  color: var(--color-text-muted);
  font-size: 13px;
}

.admin-back-link {
  text-decoration: none;
  white-space: nowrap;
}

.admin-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.admin-sidebar {
  flex: 0 0 200px;
  padding: 16px 12px;
  border-right: 1px solid var(--color-border);
  background: var(--color-bg-surface);
}

.admin-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: 14px;
}

.admin-nav-link:hover {
  background: var(--color-bg-subtle, rgba(0, 0, 0, 0.04));
}

.admin-nav-link.active {
  background: var(--color-bg-subtle, rgba(0, 0, 0, 0.06));
  font-weight: 600;
}

.admin-main {
  flex: 1;
  min-width: 0;
  padding: 20px;
  overflow: auto;
}

@media (max-width: 768px) {
  .admin-body {
    flex-direction: column;
  }

  .admin-sidebar {
    flex: none;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: 8px 12px;
  }

  .admin-sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
  }

  .admin-nav-link {
    white-space: nowrap;
  }

  .admin-topbar {
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .admin-main {
    padding: 12px;
  }
}

.admin-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-header h1 {
  margin: 0;
  font-size: 22px;
}

.admin-card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}

.admin-card h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

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

.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-input);
  background: var(--color-bg-base);
  color: var(--color-text-primary);
}

.admin-form textarea {
  grid-column: 1 / -1;
  min-height: 88px;
  resize: vertical;
  font-family: inherit;
}

.global-model-card {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle, rgba(0, 0, 0, 0.02));
}

.global-model-form {
  margin-top: 10px;
}

.admin-table-wrap {
  overflow: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--color-border);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.admin-table .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.skill-name-tag {
  margin-left: var(--space-sm);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--color-bg-code);
  font-size: 0.85em;
}

.publish-banner a {
  color: var(--color-text-link);
  word-break: break-all;
}

.capability-intro {
  margin: 0 0 1rem;
}

.capability-section-title {
  margin: 1.25rem 0 0.75rem;
  font-size: 1rem;
}

/* ── Capability filter bar ───────────────────────────── */
.capability-filter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.capability-filter-btn {
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--color-border-input);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.capability-filter-btn:hover {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
}

.capability-filter-btn.active {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  border-color: var(--color-text-muted);
  font-weight: 600;
}

/* ── Capability grid ─────────────────────────────────── */
.capability-grid {
  display: grid;
  gap: 0.75rem;
}

.capability-group {
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
}

.capability-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border-input);
}

.capability-group-header h3 {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  font-weight: 600;
}

.capability-group-count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.capability-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.capability-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
}

.capability-item + .capability-item {
  border-top: 1px solid var(--color-border-input);
}

.capability-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.capability-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.capability-desc {
  font-size: 0.8rem;
}

/* ── Toggle switch ───────────────────────────────────── */
.capability-toggle {
  flex-shrink: 0;
  cursor: pointer;
}

.capability-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  display: inline-flex;
  align-items: center;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--color-border-input);
  position: relative;
  transition: background 0.2s;
}

.capability-toggle input:checked + .toggle-track {
  background: #22c55e;
}

.capability-toggle input:disabled + .toggle-track {
  opacity: 0.4;
  cursor: not-allowed;
}

.toggle-thumb {
  position: absolute;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.capability-toggle input:checked + .toggle-track .toggle-thumb {
  left: 19px;
}

/* ── Risk pills ──────────────────────────────────────── */
.risk-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
}

.risk-low {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.risk-medium {
  background: rgba(234, 179, 8, 0.15);
  color: #ca8a04;
}

.risk-high {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.capability-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.capability-user-picker {
  margin-bottom: 0.75rem;
}

.admin-actions {
  white-space: nowrap;
}

.muted {
  color: var(--color-text-muted);
  font-size: 12px;
}

.login-btn {
  width: 100%;
  border: none;
  border-radius: var(--radius-lg);
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background: var(--color-accent);
  color: white;
  transition: opacity 0.2s;
}

.login-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.mindspace-preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px clamp(20px, 5vw, 72px);
  color: #e7ecf3;
  font-size: 13px;
  background: #1a3050;
  border-bottom: 1px solid rgba(106, 176, 255, 0.2);
}

.mindspace-preview-banner a {
  color: #9ec5ff;
  text-decoration: none;
  white-space: nowrap;
}

.mindspace-preview-banner a:hover {
  text-decoration: underline;
}

.mindspace-page {
  min-height: 100vh;
  color: #18211d;
  background:
    radial-gradient(circle at 12% 8%, rgba(238, 176, 78, 0.14), transparent 18rem),
    radial-gradient(circle at 88% 22%, rgba(47, 111, 87, 0.14), transparent 20rem),
    #f4f0e7;
}

.mindspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(24, 33, 29, 0.12);
  background: rgba(244, 240, 231, 0.86);
  backdrop-filter: blur(18px);
}

.mindspace-header-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mindspace-back-plaza {
  color: #17221d;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(24, 33, 29, 0.14);
}

.mindspace-header-actions,
.mindspace-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mindspace-header-actions .balance-popover-wrap {
  align-self: center;
}

.mindspace-plaza-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  color: #18211d;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(24, 33, 29, 0.14);
}

.mindspace-plaza-link:hover {
  border-color: rgba(47, 111, 87, 0.35);
  color: #245742;
}

.mindspace-back,
.mindspace-primary,
.mindspace-secondary,
.mindspace-card button,
.mindspace-state button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}

.mindspace-back {
  padding: 10px 16px;
  color: #f8f4ea;
  background: #18211d;
}

.mindspace-content {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.mindspace-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px;
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 252, 244, 0.96), rgba(229, 237, 226, 0.9)),
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(24, 33, 29, 0.025) 42px 43px);
  box-shadow: 0 10px 30px rgba(48, 54, 45, 0.08);
}

.mindspace-hero-left {
  min-width: 0;
}

.mindspace-hero-left .mindspace-actions {
  margin-top: 14px;
}

.mindspace-hero-quota {
  padding: 12px 14px;
  border-radius: 16px;
  color: #f7f1e6;
  background: #18211d;
}

.mindspace-hero-quota-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
}

.mindspace-hero-quota-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mindspace-hero-quota-buy-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(238, 176, 78, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #eeb04e;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.mindspace-hero-quota-buy-trigger:hover {
  border-color: rgba(238, 176, 78, 0.58);
  background: rgba(238, 176, 78, 0.14);
  transform: translateY(-1px);
}

.mindspace-hero-quota-top strong {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.mindspace-hero-quota-track {
  height: 4px;
  margin: 8px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.mindspace-hero-quota-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #eeb04e;
}

.mindspace-hero-quota-meta {
  margin: 0;
  font-size: 10px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.58);
}

.mindspace-hero-purchase {
  margin-top: 10px;
}

.mindspace-hero-purchase-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.mindspace-hero-purchase-chip,
.mindspace-hero-purchase-btn {
  border: 1px solid rgba(238, 176, 78, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff3d7;
  cursor: pointer;
}

.mindspace-hero-purchase-chip {
  padding: 6px 10px;
  font-size: 12px;
}

.mindspace-hero-purchase-chip.is-active {
  border-color: rgba(238, 176, 78, 0.72);
  background: rgba(238, 176, 78, 0.18);
  color: #fff7ea;
}

.mindspace-hero-purchase-btn {
  padding: 8px 12px;
  font-size: 12px;
}

.mindspace-hero-purchase-chip:disabled,
.mindspace-hero-purchase-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.mindspace-hero-purchase-input {
  min-width: 96px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.mindspace-hero-purchase-meta,
.mindspace-hero-purchase-message {
  margin: 8px 0 0;
  font-size: 10px;
  line-height: 1.45;
}

.mindspace-hero-purchase-meta {
  color: rgba(255, 255, 255, 0.58);
}

.mindspace-hero-purchase-message {
  color: #eeb04e;
}

.mindspace-hero-quota-cleanup {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #eeb04e;
  font-size: 10px;
  cursor: pointer;
}

.mindspace-hero-quota-cleanup:hover {
  text-decoration: underline;
}

.mindspace-space-purchase-dialog {
  width: min(430px, 100%);
  max-width: 430px;
  gap: 14px;
  padding: 18px;
  color: #18211d;
}

.mindspace-space-purchase-dialog .mindspace-upload-dialog-bar {
  gap: 10px;
}

.mindspace-space-purchase-dialog h3 {
  font-size: 22px;
}

.mindspace-space-purchase-dialog .mindspace-upload-dialog-desc {
  color: #44504a;
  font-size: 13px;
  line-height: 1.5;
}

.mindspace-space-purchase-dialog .mindspace-hero-purchase-meta {
  color: #5a655f;
  font-size: 11px;
}

.mindspace-space-purchase-dialog .mindspace-hero-purchase-chip {
  border-color: rgba(24, 33, 29, 0.14);
  background: #f6efe2;
  color: #24312c;
  font-weight: 600;
}

.mindspace-space-purchase-dialog .mindspace-hero-purchase-chip:hover {
  border-color: rgba(155, 101, 24, 0.38);
  background: #f1e4c7;
}

.mindspace-space-purchase-dialog .mindspace-hero-purchase-chip.is-active {
  border-color: rgba(155, 101, 24, 0.52);
  background: #eeb04e;
  color: #2d1c00;
}

.mindspace-space-purchase-dialog .mindspace-hero-purchase-input {
  min-width: 140px;
  border-color: rgba(24, 33, 29, 0.18);
  background: #fffaf2;
  color: #18211d;
}

.mindspace-space-purchase-dialog .mindspace-hero-purchase-input::placeholder {
  color: #7b817c;
}

.mindspace-space-purchase-dialog .mindspace-hero-purchase-message {
  color: #9b6518;
  font-size: 12px;
  font-weight: 600;
}

.mindspace-space-purchase-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.mindspace-space-purchase-summary::-webkit-scrollbar {
  display: none;
}

.mindspace-space-purchase-summary div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(24, 33, 29, 0.14);
  border-radius: 12px;
  background: #efe7d8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.mindspace-space-purchase-summary span {
  display: inline-block;
  margin-bottom: 0;
  font-size: 11px;
  color: #564f45;
  font-weight: 600;
}

.mindspace-space-purchase-summary strong {
  display: block;
  color: #18211d;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}

.mindspace-space-purchase-recharge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(183, 128, 19, 0.22);
  background: #f5dfad;
  color: #5e4308;
  font-size: 12px;
  font-weight: 600;
}

.mindspace-hero-cleanup {
  grid-column: 1 / -1;
  padding: 16px 18px;
  border-radius: 16px;
  color: #f7f1e6;
  background: #24312c;
}

.mindspace-hero-cleanup > p {
  margin: 0 0 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

.mindspace-hero h1 {
  margin: 4px 0 8px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: 0;
}

.mindspace-hero p,
.mindspace-card p,
.mindspace-empty p {
  color: #59635e;
  line-height: 1.55;
}

.mindspace-eyebrow {
  margin: 0;
  color: #9b6518 !important;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.mindspace-primary,
.mindspace-secondary {
  padding: 10px 14px;
}

.mindspace-primary {
  color: #fffaf0;
  background: #2f6f57;
}

.mindspace-secondary {
  color: #18211d;
  border: 1px solid rgba(24, 33, 29, 0.18);
  background: transparent;
}

.mindspace-primary:disabled,
.mindspace-secondary:disabled,
.mindspace-card button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.mindspace-cleanup-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.mindspace-cleanup-list li + li {
  margin-top: 10px;
}

.mindspace-cleanup-list label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
}

.mindspace-cleanup-list strong {
  display: block;
}

.mindspace-cleanup-list small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}

.mindspace-cleanup-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.mindspace-schedule-module {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 16px;
  background: rgba(255, 252, 244, 0.9);
  box-shadow: 0 8px 24px rgba(48, 54, 45, 0.06);
}

.mindspace-schedule-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mindspace-schedule-head h2 {
  margin: 3px 0 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 24px;
  font-weight: 500;
}

.mindspace-schedule-link {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  color: #18211d;
  background: rgba(24, 33, 29, 0.08);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.mindspace-schedule-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: #68716c;
  font-size: 12px;
}

.mindspace-schedule-summary strong {
  color: #18211d;
  font-size: 13px;
}

.mindspace-schedule-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.mindspace-schedule-item {
  display: grid;
  grid-template-columns: 42px 42px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 9px;
  border-radius: 12px;
  background: rgba(24, 33, 29, 0.045);
}

.mindspace-schedule-item time {
  color: #2f6f57;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.mindspace-schedule-kind {
  display: inline-flex;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 6px;
  color: #18211d;
  background: rgba(238, 176, 78, 0.2);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.mindspace-schedule-kind.is-event {
  color: #f8f4ea;
  background: #2f6f57;
}

.mindspace-schedule-kind.is-reminder {
  color: #75362c;
  background: #f5d9ca;
}

.mindspace-schedule-item strong {
  display: block;
  overflow: hidden;
  color: #18211d;
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mindspace-schedule-item small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #7b847f;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mindspace-schedule-empty {
  margin: 10px 0 0;
  color: #68716c;
  font-size: 13px;
  line-height: 1.5;
}

.mindspace-section {
  margin-top: 28px;
}

.mindspace-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mindspace-section-heading h2,
.mindspace-empty h2 {
  margin: 3px 0 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 26px;
  font-weight: 500;
}

.mindspace-section-heading > span {
  color: #68716c;
  font-size: 13px;
}

.mindspace-section-link {
  flex: 0 0 auto;
  align-self: flex-start;
  border: 0;
  border-radius: 999px;
  padding: 5px 9px;
  color: #18211d;
  background: rgba(24, 33, 29, 0.08);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.mindspace-recent-work .mindspace-section-heading {
  flex-direction: row;
  align-items: flex-start;
}

.mindspace-independent-page {
  min-height: calc(100vh - 96px);
  padding-top: 4px;
}

.mindspace-independent-page .mindspace-section-heading {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(24, 33, 29, 0.1);
}

.mindspace-recent-work-empty {
  padding: 28px 32px;
  border: 1px dashed rgba(24, 33, 29, 0.16);
  border-radius: 24px;
  background: rgba(255, 252, 244, 0.55);
}

.mindspace-recent-work-empty p {
  margin: 0;
  max-width: 52ch;
  color: #59635e;
  line-height: 1.7;
}

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

.mindspace-card {
  min-height: auto;
  padding: 14px;
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 14px;
  background: rgba(255, 252, 244, 0.82);
}

.mindspace-grid-secondary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.mindspace-grid-secondary .mindspace-card,
.mindspace-grid-secondary .mindspace-agent-jobs-module {
  grid-column: auto;
  min-height: auto;
}

.mindspace-agent-jobs-module {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 14px;
  border: 1px dashed rgba(47, 111, 87, 0.35);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(220, 235, 226, 0.72), rgba(255, 253, 245, 0.92));
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.mindspace-agent-jobs-module .mindspace-eyebrow {
  margin: 0;
}

.mindspace-agent-jobs-module strong {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 500;
  color: #18211d;
}

.mindspace-agent-jobs-module > span:last-child {
  color: #68716c;
  font-size: 13px;
}

.mindspace-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.mindspace-pagination button {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(24, 33, 29, 0.08);
}

.mindspace-pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mindspace-pagination span {
  color: #68716c;
  font-size: 13px;
}

.mindspace-card-private {
  background: linear-gradient(145deg, #f4e1d4, #fff9ef);
}

.mindspace-card-public {
  background: linear-gradient(145deg, #dcebe2, #fffdf5);
}

.mindspace-card-draft {
  background: linear-gradient(145deg, #e4e8d5, #fffdf5);
}

.mindspace-card-top {
  display: flex;
  justify-content: space-between;
  color: #68716c;
  font-size: 12px;
}

.mindspace-card-code {
  color: #2f6f57;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.mindspace-card h3 {
  margin: 10px 0 5px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 20px;
  font-weight: 500;
}

.mindspace-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 12px;
}

.mindspace-card button {
  margin-top: 6px;
  padding: 6px 9px;
  color: #18211d;
  background: rgba(24, 33, 29, 0.08);
  font-size: 12px;
}

.mindspace-inline-back {
  margin-bottom: 18px;
  padding: 0;
  border: 0;
  color: #2f6f57;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.mindspace-security-note {
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid rgba(139, 45, 32, 0.18);
  border-radius: 16px;
  color: #75362c;
  background: #f8e8de;
}

.mindspace-upload-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 12, 10, 0.72);
  backdrop-filter: blur(10px);
}

.mindspace-upload-dialog {
  --mindspace-upload-padding: clamp(20px, 4vw, 32px);
  display: grid;
  gap: 18px;
  width: min(520px, 100%);
  max-height: min(92dvh, 720px);
  overflow: auto;
  padding: var(--mindspace-upload-padding);
  border: 1px solid rgba(238, 176, 78, 0.3);
  border-radius: 24px;
  color: #18211d;
  background:
    radial-gradient(circle at 100% 0, rgba(47, 111, 87, 0.14), transparent 18rem),
    #f8f3e8;
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.4);
}

.mindspace-upload-dialog-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.mindspace-upload-dialog h3 {
  margin: 4px 0 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 500;
}

.mindspace-upload-dialog-close {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid rgba(24, 33, 29, 0.14);
  border-radius: 999px;
  color: #18211d;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.mindspace-upload-dialog-close:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mindspace-upload-dialog-desc {
  margin: 0;
  color: #68716c;
  font-size: 14px;
  line-height: 1.6;
}

.mindspace-upload-dialog input[type='file'] {
  width: 100%;
  padding: 16px;
  border: 1px dashed rgba(24, 33, 29, 0.28);
  border-radius: 16px;
  background: #fffdf7;
}

.mindspace-upload-error {
  margin: -6px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(172, 55, 55, 0.24);
  border-radius: 10px;
  color: #9a2f2f;
  background: rgba(255, 238, 232, 0.82);
  font-size: 13px;
  line-height: 1.5;
}

.mindspace-upload-file,
.mindspace-upload-actions,
.mindspace-asset-row,
.mindspace-asset-actions {
  display: flex;
  align-items: center;
}

.mindspace-upload-file {
  justify-content: space-between;
  gap: 20px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(47, 111, 87, 0.08);
}

.mindspace-agent-dialog {
  width: min(620px, 100%);
}

.mindspace-delete-dialog {
  width: min(640px, 100%);
}

.mindspace-delete-summary {
  margin: 0;
  padding-left: 20px;
  color: #18211d;
  display: grid;
  gap: 8px;
}

.mindspace-delete-summary li {
  line-height: 1.5;
}

.mindspace-delete-public-url {
  display: block;
  margin-top: 12px;
  word-break: break-all;
  color: #2f6f57;
}

.mindspace-delete-assets {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.mindspace-delete-assets div {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(47, 111, 87, 0.08);
}

.mindspace-delete-assets span {
  color: #68716c;
  font-size: 12px;
}

.mindspace-delete-dialog .mindspace-delete-confirm {
  color: #fff5f5;
  background: #9b3d3d;
  border-color: #9b3d3d;
}

.mindspace-agent-asset {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(24, 33, 29, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.mindspace-agent-asset span {
  color: #68716c;
  font-size: 13px;
}

.mindspace-agent-field {
  display: grid;
  gap: 10px;
}

.mindspace-agent-field span {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #7d6236;
  text-transform: uppercase;
}

.mindspace-agent-field textarea {
  width: 100%;
  min-height: 180px;
  padding: 16px;
  border: 1px solid rgba(24, 33, 29, 0.14);
  border-radius: 16px;
  color: #18211d;
  background: #fffdf7;
  font: inherit;
  resize: vertical;
}

.mindspace-agent-field textarea:focus {
  outline: 2px solid rgba(47, 111, 87, 0.18);
  outline-offset: 2px;
}

.mindspace-agent-status {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 14px;
  background: rgba(47, 111, 87, 0.08);
  color: #244438;
}

.mindspace-agent-status.is-failed {
  background: rgba(139, 45, 32, 0.1);
  color: #7a2f24;
}

.mindspace-agent-status.is-completed {
  background: rgba(173, 116, 27, 0.12);
  color: #6f4b16;
}

.mindspace-agent-history {
  display: grid;
  gap: 16px;
}

.mindspace-agent-history-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(24, 33, 29, 0.1);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(245, 240, 229, 0.94));
}

.mindspace-agent-history-card.is-running,
.mindspace-agent-history-card.is-queued {
  border-color: rgba(47, 111, 87, 0.24);
}

.mindspace-agent-history-card.is-failed {
  border-color: rgba(139, 45, 32, 0.24);
  background: linear-gradient(180deg, rgba(252, 241, 236, 0.96), rgba(248, 232, 222, 0.94));
}

.mindspace-agent-history-top,
.mindspace-agent-history-meta,
.mindspace-agent-history-actions {
  display: flex;
  align-items: center;
}

.mindspace-agent-history-top,
.mindspace-agent-history-meta {
  justify-content: space-between;
  gap: 16px;
}

.mindspace-agent-history-top strong {
  display: block;
  margin-bottom: 4px;
}

.mindspace-agent-history-top p,
.mindspace-agent-history-meta {
  margin: 0;
  color: #68716c;
  font-size: 13px;
  line-height: 1.5;
}

.mindspace-agent-history-top span {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(24, 33, 29, 0.08);
  font-size: 12px;
  text-transform: uppercase;
}

.mindspace-agent-history-error {
  padding: 12px 14px;
  border-radius: 12px;
  color: #7a2f24;
  background: rgba(139, 45, 32, 0.08);
  font-size: 13px;
}

.mindspace-agent-history-actions {
  gap: 10px;
  flex-wrap: wrap;
}

.mindspace-agent-history-actions button {
  padding: 10px 14px;
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 999px;
  color: #18211d;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font: inherit;
}

.mindspace-upload-actions {
  position: sticky;
  bottom: calc(0px - var(--mindspace-upload-padding));
  justify-content: flex-end;
  gap: 10px;
  margin: 2px calc(0px - var(--mindspace-upload-padding))
    calc(0px - var(--mindspace-upload-padding));
  padding: 14px var(--mindspace-upload-padding) var(--mindspace-upload-padding);
  border-top: 1px solid rgba(24, 33, 29, 0.1);
  background: rgba(248, 243, 232, 0.94);
  backdrop-filter: blur(12px);
}

.mindspace-asset-list {
  display: grid;
  gap: 12px;
}

.mindspace-asset-row {
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 18px;
  background: rgba(255, 252, 244, 0.82);
}

.mindspace-asset-icon {
  display: grid;
  flex: 0 0 52px;
  height: 52px;
  place-items: center;
  border-radius: 14px;
  color: #fffaf0;
  background: #2f6f57;
  font-size: 11px;
  font-weight: 800;
}

.mindspace-asset-copy {
  min-width: 0;
  flex: 1;
}

.mindspace-asset-copy h3 {
  overflow: hidden;
  margin: 0 0 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mindspace-asset-copy p {
  margin: 0;
  color: #68716c;
  font-size: 12px;
}

.mindspace-asset-actions {
  gap: 8px;
}

.mindspace-asset-actions button,
.mindspace-asset-share {
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  color: #18211d;
  background: rgba(24, 33, 29, 0.08);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.mindspace-asset-actions button {
  color: #8b2d20;
}

.mindspace-asset-actions .mindspace-delete-confirm {
  color: #fffaf0;
  background: #8b2d20;
}

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

.mindspace-recent-work-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mindspace-recent-work-grid.is-all-pages {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mindspace-recent-work .mindspace-feed-card-wrap {
  gap: 6px;
}

.mindspace-recent-work .mindspace-feed-card {
  border-radius: 10px;
}

.mindspace-recent-work .mindspace-feed-cover {
  aspect-ratio: 4 / 3;
}

.mindspace-recent-work-grid.is-all-pages .mindspace-feed-cover {
  aspect-ratio: 1 / 1;
}

.mindspace-recent-work .mindspace-feed-body {
  padding: 8px 10px 10px;
}

.mindspace-recent-work .mindspace-feed-title {
  font-size: 13px;
}

.mindspace-recent-work .mindspace-feed-meta,
.mindspace-recent-work .mindspace-feed-card-actions button {
  font-size: 11px;
}

.mindspace-recent-work .mindspace-feed-card-actions button {
  padding: 5px 9px;
}

.mindspace-feed-card-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mindspace-feed-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mindspace-feed-card-actions button {
  padding: 6px 9px;
  border: 0;
  border-radius: 999px;
  color: #18211d;
  background: rgba(24, 33, 29, 0.08);
  cursor: pointer;
  font: inherit;
}

.mindspace-feed-card-actions button:last-child {
  color: #8b2d20;
}

.mindspace-feed-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  color: inherit;
  background: #fff;
  box-shadow: 0 2px 10px rgba(24, 33, 29, 0.07);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.mindspace-feed-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(24, 33, 29, 0.12);
}

.mindspace-feed-cover {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: linear-gradient(160deg, #f3eee6 0%, #e7efe9 100%);
  container-type: size;
}

.mindspace-feed-cover-media {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  pointer-events: none;
}

.mindspace-feed-cover-preview {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0a0a0a;
  pointer-events: none;
}

.mindspace-feed-cover-preview iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 390px;
  height: 844px;
  border: 0;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(min(calc(100cqw / 390), calc(100cqh / 844)));
  pointer-events: none;
}

.mindspace-preview-embed {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f5f0e5;
}

.mindspace-preview-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.mindspace-feed-cover-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #7a8680;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.mindspace-feed-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  backdrop-filter: blur(6px);
}

.mindspace-feed-body {
  padding: 8px 9px 9px;
}

.mindspace-feed-title {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: #18211d;
}

.mindspace-feed-meta {
  margin: 4px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: #939c97;
}

.mindspace-page-reader {
  margin-top: 18px;
}

.mindspace-page-reader-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  background: rgba(244, 240, 231, 0.92);
  backdrop-filter: blur(14px);
}

.mindspace-page-reader-bar span {
  color: #68716c;
  font-size: 12px;
}

.mindspace-page-reader-sheet {
  min-height: min(720px, calc(100vh - 170px));
  padding: 22px 18px 34px;
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 18px;
  background: #fffdf8;
  box-shadow: 0 12px 30px rgba(24, 33, 29, 0.08);
}

.mindspace-page-reader-sheet h2 {
  margin: 6px 0 10px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 32px;
  font-weight: 500;
}

.mindspace-page-reader-summary {
  margin: 0;
  color: #68716c;
  font-size: 14px;
  line-height: 1.6;
}

.mindspace-page-reader-body {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.mindspace-page-reader-body p {
  margin: 0;
  color: #29342f;
  font-size: 16px;
  line-height: 1.85;
}

@media (min-width: 900px) {
  .mindspace-feed-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .mindspace-recent-work-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .mindspace-recent-work-grid.is-all-pages {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1120px) {
  .mindspace-feed-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

  .mindspace-recent-work-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .mindspace-recent-work-grid.is-all-pages {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 1380px) {
  .mindspace-recent-work-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
  }

  .mindspace-recent-work-grid.is-all-pages {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (min-width: 761px) {
  .mindspace-page-reader {
    margin-top: 32px;
  }

  .mindspace-page-reader-sheet {
    width: min(860px, 100%);
    margin: 0 auto;
    padding: 42px 48px 64px;
    border-radius: 24px;
  }

  .mindspace-page-reader-sheet h2 {
    font-size: 48px;
  }
}

.mindspace-page-grid,
.mindspace-item-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.mindspace-asset-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.mindspace-asset-filters button {
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  color: #52605a;
  background: rgba(24, 33, 29, 0.08);
  cursor: pointer;
  font: inherit;
}

.mindspace-asset-filters button.is-active {
  color: #fffaf0;
  background: #2f6f57;
}

.mindspace-asset-bulkbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -4px 0 18px;
  color: #52605a;
  font-size: 13px;
}

.mindspace-asset-bulkbar button {
  padding: 7px 11px;
  border: 0;
  border-radius: 999px;
  color: #18211d;
  background: rgba(24, 33, 29, 0.08);
  cursor: pointer;
  font: inherit;
}

.mindspace-asset-bulkbar button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.mindspace-asset-bulkbar .mindspace-asset-bulk-delete {
  color: #fffaf0;
  background: #8b2d20;
}

.mindspace-section-subheading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 14px;
}

.mindspace-section-subheading h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.mindspace-section-subheading span {
  color: #68716c;
  font-size: 13px;
}

.mindspace-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.mindspace-image-grid.is-compact {
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.mindspace-image-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mindspace-image-card.is-compact {
  gap: 0;
}

.mindspace-image-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgba(24, 33, 29, 0.1);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(47, 111, 87, 0.08);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.mindspace-image-grid.is-compact .mindspace-image-thumb {
  border-radius: 10px;
}

.mindspace-image-grid.is-compact .mindspace-image-thumb:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24, 33, 29, 0.1);
}

.mindspace-image-pagination {
  margin-top: 0;
  margin-bottom: 20px;
}

.mindspace-image-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(24, 33, 29, 0.12);
}

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

.mindspace-image-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mindspace-image-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}

.mindspace-image-size {
  color: #68716c;
  font-size: 11px;
}

.mindspace-image-card .mindspace-item-actions {
  gap: 6px;
}

.mindspace-image-card .mindspace-item-actions button,
.mindspace-image-card .mindspace-item-actions .mindspace-asset-share {
  padding: 5px 9px;
  font-size: 12px;
}

.mindspace-asset-select {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #18211d;
  background: rgba(255, 252, 244, 0.92);
  box-shadow: 0 4px 12px rgba(24, 33, 29, 0.1);
  font-size: 12px;
  font-weight: 700;
}

.mindspace-asset-select.is-card {
  position: static;
  justify-self: start;
}

.mindspace-asset-select input {
  width: 14px;
  height: 14px;
  accent-color: #2f6f57;
}

.mindspace-item-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 22px;
  background: rgba(255, 252, 244, 0.9);
}

.mindspace-item-card.is-work {
  background:
    linear-gradient(145deg, rgba(255, 252, 244, 0.96), rgba(224, 235, 223, 0.88));
}

.mindspace-item-card-main {
  display: grid;
  gap: 14px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.mindspace-item-icon,
.mindspace-item-cover {
  display: grid;
  place-items: center;
  min-height: 88px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(47, 111, 87, 0.1);
}

.mindspace-item-icon {
  font-size: 28px;
}

.mindspace-item-cover iframe {
  width: 100%;
  min-height: 140px;
  border: 0;
  pointer-events: none;
  transform: scale(1);
  transform-origin: top left;
}

.mindspace-item-copy h3 {
  margin: 8px 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
}

.mindspace-item-copy p {
  margin: 0;
  color: #68716c;
  font-size: 12px;
}

.mindspace-item-badge {
  color: #9b6518;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mindspace-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mindspace-item-actions button,
.mindspace-item-actions .mindspace-asset-share {
  padding: 7px 11px;
  border: 0;
  border-radius: 999px;
  color: #18211d;
  background: rgba(24, 33, 29, 0.08);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.mindspace-item-actions .mindspace-delete-confirm {
  color: #fffaf0;
  background: #8b2d20;
}

.share-sheet-backdrop {
  position: fixed;
  z-index: 140;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(7, 12, 10, 0.56);
}

.share-sheet-panel {
  width: min(520px, 100%);
  max-height: min(82vh, 720px);
  overflow: auto;
  padding: 18px 18px 22px;
  border-radius: 24px 24px 20px 20px;
  background: #fffaf2;
  box-shadow: 0 24px 80px rgba(24, 33, 29, 0.24);
}

.share-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.share-sheet-eyebrow {
  margin: 0;
  color: #9b6518;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.share-sheet-header h2 {
  margin: 4px 0 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 28px;
  font-weight: 500;
  color: #18211d;
}

.share-sheet-subtitle {
  margin: 6px 0 0;
  color: #68716c;
  font-size: 13px;
}

.share-sheet-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(24, 33, 29, 0.08);
  color: #18211d;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.share-sheet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.share-sheet-option {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 14px 10px;
  border: 1px solid rgba(24, 33, 29, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font: inherit;
}

.share-sheet-option:disabled {
  opacity: 0.6;
  cursor: wait;
}

.share-sheet-option-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.share-sheet-option-wechat_moments .share-sheet-option-icon {
  background: linear-gradient(145deg, #07c160, #06ad56);
}

.share-sheet-option-xiaohongshu .share-sheet-option-icon {
  background: linear-gradient(145deg, #ff2442, #d91534);
}

.share-sheet-option-toutiao .share-sheet-option-icon {
  background: linear-gradient(145deg, #ff4d00, #e04300);
}

.share-sheet-option-weibo .share-sheet-option-icon {
  background: linear-gradient(145deg, #ff8200, #e56f00);
}

.share-sheet-option-douyin .share-sheet-option-icon {
  background: linear-gradient(145deg, #111111, #444444);
}

.share-sheet-option-copy_link .share-sheet-option-icon,
.share-sheet-option-system .share-sheet-option-icon {
  background: linear-gradient(145deg, #2f6f57, #245845);
}

.share-sheet-option-label {
  color: #18211d;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.share-sheet-link {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(24, 33, 29, 0.05);
}

.share-sheet-link code {
  word-break: break-all;
  font-size: 12px;
  color: #445049;
}

.share-sheet-message {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  color: #245845;
  background: rgba(47, 111, 87, 0.12);
  font-size: 13px;
}

@media (max-width: 480px) {
  .share-sheet-backdrop {
    padding: 0;
    place-items: end stretch;
  }

  .share-sheet-panel {
    width: 100%;
    border-radius: 24px 24px 0 0;
  }

  .share-sheet-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.mindspace-asset-preview-backdrop {
  position: fixed;
  z-index: 130;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 12, 10, 0.72);
}

.mindspace-asset-preview-panel {
  display: flex;
  flex-direction: column;
  width: min(1100px, 100%);
  height: min(82vh, 900px);
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  background: #f8f3e8;
}

.mindspace-asset-preview-panel iframe {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 16px;
  background: #fff;
}

.mindspace-asset-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mindspace-page-card {
  min-height: auto;
  padding: 16px;
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 16px;
  color: #18211d;
  background:
    linear-gradient(145deg, rgba(255, 252, 244, 0.95), rgba(224, 235, 223, 0.88));
  cursor: pointer;
  text-align: left;
}

.mindspace-page-card > span {
  color: #9b6518;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mindspace-page-card h3 {
  margin: 12px 0 6px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 22px;
  font-weight: 500;
}

.mindspace-page-card p {
  display: -webkit-box;
  overflow: hidden;
  color: #5f6963;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.mindspace-page-card small {
  color: #7b847f;
}

.mindspace-new-page {
  display: grid;
  gap: 14px;
  width: min(820px, 100%);
  padding: 18px;
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 18px;
  background: rgba(255, 252, 244, 0.86);
}

.mindspace-new-page h2,
.mindspace-page-detail h2 {
  margin: 5px 0 10px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 30px;
  font-weight: 500;
}

.mindspace-page-floating-actions {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  display: flex;
  gap: 10px;
  align-items: center;
}

.mindspace-page-floating-action {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  color: #18211d;
  background: #fffaf0;
  cursor: pointer;
  font: inherit;
  box-shadow: 0 12px 28px rgba(24, 33, 29, 0.2);
}

.mindspace-page-floating-action.is-secondary {
  color: #fff;
  background: #2f6f57;
}

.mindspace-page-floating-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mindspace-page-export-feedback {
  position: fixed;
  right: 24px;
  bottom: 84px;
  z-index: 120;
  max-width: 240px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(24, 33, 29, 0.88);
  color: #fffaf0;
  font-size: 12px;
  line-height: 1.4;
}

.mindspace-page-detail {
  margin-top: 28px;
}

.mindspace-state.mindspace-error {
  display: grid;
  gap: 10px;
}

.mindspace-asset-delete-blockers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mindspace-asset-delete-blockers button {
  padding: 8px 12px;
  border: 1px solid rgba(24, 33, 29, 0.18);
  border-radius: 999px;
  background: #fffaf0;
  cursor: pointer;
}

.mindspace-page-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mindspace-page-status span,
.mindspace-page-status strong {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(24, 33, 29, 0.08);
  font-size: 12px;
}

.mindspace-page-status span {
  color: #fffaf0;
  background: #2f6f57;
}

.mindspace-publication-live,
.mindspace-publish-panel {
  margin-bottom: 22px;
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 22px;
}

.mindspace-publication-live {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  color: #eff8f2;
  background: linear-gradient(120deg, #214f3f, #32755b);
}

.mindspace-publication-live > div {
  display: grid;
  gap: 5px;
}

.mindspace-publication-live > div:last-child {
  display: flex;
  grid-auto-flow: column;
}

.mindspace-publication-live small {
  color: rgba(255, 255, 255, 0.68);
}

.mindspace-publication-url {
  color: #fff;
  font-weight: 600;
  word-break: break-all;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mindspace-publication-url:hover {
  color: rgba(255, 255, 255, 0.88);
}

.mindspace-publication-live a:not(.mindspace-publication-url),
.mindspace-publication-live button {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: #fff;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}

.mindspace-publish-success {
  display: flex;
  justify-content: center;
  padding: 48px 20px 64px;
}

.mindspace-publish-success-card {
  width: min(520px, 100%);
  display: grid;
  gap: 16px;
  padding: 32px 28px;
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 24px;
  background: #fffdf8;
  box-shadow: 0 18px 48px rgba(24, 33, 29, 0.08);
  text-align: center;
}

.mindspace-publish-success-card h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 34px);
  color: #183127;
}

.mindspace-publish-success-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #214f3f;
}

.mindspace-publish-success-url {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  color: #32755b;
  font-size: 14px;
  word-break: break-all;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mindspace-publish-success-note {
  margin: 0;
  color: rgba(24, 33, 29, 0.62);
  font-size: 14px;
}

.mindspace-publish-success-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.mindspace-publish-success-actions .mindspace-primary,
.mindspace-publish-success-actions a,
.mindspace-publish-success-actions button {
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
}

.mindspace-publish-success-actions a,
.mindspace-publish-success-actions button {
  border: 1px solid rgba(24, 33, 29, 0.14);
  color: #183127;
  background: #fff;
  text-decoration: none;
}

.mindspace-publish-success-card .mindspace-inline-back {
  justify-self: center;
  margin-top: 4px;
}

.mindspace-publish-success-card .mindspace-security-note {
  text-align: left;
}

.mindspace-publish-panel {
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 34px);
  background: linear-gradient(145deg, #fffaf0, #e4eddf);
}

.mindspace-publish-panel h3 {
  margin: 4px 0 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 30px;
  font-weight: 500;
}

.mindspace-slug-field {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(24, 33, 29, 0.18);
  border-radius: 12px;
  background: #fffdf7;
}

.mindspace-slug-field span {
  padding-left: 14px;
  color: #6d7771;
  font-size: 12px;
  white-space: nowrap;
}

.mindspace-slug-field input {
  border: 0;
  background: transparent;
}

.mindspace-publish-check {
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(238, 176, 78, 0.16);
}

.mindspace-publish-check.is-passed {
  background: rgba(47, 111, 87, 0.12);
}

.mindspace-publish-check.is-blocked {
  color: #75362c;
  background: #f8e8de;
}

.mindspace-publish-check p {
  margin: 8px 0 0;
  font-size: 13px;
}

.mindspace-publish-slug-suggest button {
  margin-left: 6px;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  color: #18211d;
  background: rgba(24, 33, 29, 0.08);
  cursor: pointer;
  font: inherit;
}

.mindspace-publish-warning-note {
  color: #6d7771;
  font-size: 12px;
}

.mindspace-fix-notice {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #2f5a44;
  background: rgba(47, 90, 68, 0.18);
  color: #d7eadf;
}

.mindspace-fix-notice strong {
  display: block;
  margin-bottom: 8px;
}

.mindspace-fix-notice ul {
  margin: 0;
  padding-left: 18px;
}

.mindspace-fix-notice li {
  margin: 4px 0;
}

.mindspace-fix-notice p {
  margin: 10px 0 0;
  color: #a8c7b3;
  font-size: 12px;
}

.mindspace-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  gap: 22px;
  align-items: start;
}

.mindspace-page-layout.is-html-page {
  grid-template-columns: 1fr;
}

.mindspace-page-layout.is-html-page .mindspace-page-preview {
  order: 2;
}

.mindspace-page-editor,
.mindspace-page-preview {
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 24px;
  background: rgba(255, 252, 244, 0.86);
}

.mindspace-page-editor {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.mindspace-page-content-input {
  min-height: 340px;
  resize: vertical;
  line-height: 1.65;
}

.mindspace-html-source-editor {
  border-top: 1px solid rgba(24, 33, 29, 0.1);
}

.mindspace-html-source-editor summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  color: #6d7771;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.mindspace-html-source-editor summary::-webkit-details-marker {
  display: none;
}

.mindspace-html-source-editor summary::before {
  content: '›';
  color: #9aa59f;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.15s ease;
}

.mindspace-html-source-editor[open] summary::before {
  transform: rotate(90deg);
}

.mindspace-html-source-editor[open] summary {
  border-bottom: 1px solid rgba(24, 33, 29, 0.1);
}

.mindspace-html-source-editor .mindspace-page-content-input {
  min-height: 420px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.mindspace-page-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mindspace-page-editor-actions span {
  color: #6d7771;
  font-size: 12px;
}

.mindspace-publish-action-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.mindspace-publish-plaza-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #4f5a54;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.mindspace-publish-plaza-toggle input {
  margin: 0;
}

.mindspace-page-preview {
  overflow: visible;
}

.mindspace-page-preview-dual {
  padding: 16px 18px 0;
  grid-template-columns: minmax(0, 1fr) 180px;
}

.mindspace-page-preview-dual .page-save-preview-pane-thumb {
  width: 180px;
}

.mindspace-page-preview-dual .page-save-mini-page {
  height: min(380px, 46vh);
}

.mindspace-page-preview-dual + .mindspace-html-source-editor {
  margin-top: 12px;
}

.mindspace-page-thumb-actions {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.mindspace-page-thumb-actions button {
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  color: #18211d;
  background: rgba(24, 33, 29, 0.08);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
}

.mindspace-page-thumb-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mindspace-page-thumb-note,
.mindspace-page-thumb-error {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.45;
}

.mindspace-page-thumb-note {
  color: #6d7771;
}

.mindspace-page-thumb-error {
  color: #8b2d20;
}

.mindspace-page-preview-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  color: #f8f2e8;
  background: #18211d;
}

.mindspace-page-preview-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mindspace-page-preview-actions a,
.mindspace-page-preview-bar button {
  border: 0;
  color: #eeb04e;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
}

.mindspace-page-preview-actions button:disabled {
  color: rgba(238, 176, 78, 0.35);
  cursor: not-allowed;
}

.mindspace-page-preview-actions button.is-refresh-pending,
.mindspace-page-fullscreen-preview-actions button.is-refresh-pending {
  color: #18211d;
  background: #eeb04e;
  box-shadow: 0 0 0 2px rgba(238, 176, 78, 0.35);
  animation: mindspace-refresh-pulse 1.4s ease-in-out infinite;
}

@keyframes mindspace-refresh-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(238, 176, 78, 0.35);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(238, 176, 78, 0.18);
  }
}

.mindspace-page-editable-hint {
  margin: 0;
  padding: 10px 18px 0;
  color: #6d7771;
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mindspace-page-editable-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.mindspace-page-editable-legend-swatch-text {
  background: rgba(61, 139, 253, 0.92);
}

.mindspace-page-editable-legend-swatch-media {
  background: rgba(201, 132, 24, 0.94);
}

.mindspace-page-editable-legend-swatch-link {
  background: rgba(124, 92, 255, 0.92);
}

.mindspace-page-editable-legend-swatch-bg {
  background: rgba(47, 111, 87, 0.92);
}

.mindspace-page-preview-loading {
  padding: 18px;
  color: #6d7771;
  font-size: 13px;
}

.mindspace-page-preview-sync {
  color: rgba(238, 176, 78, 0.85);
  font-size: 12px;
}

.mindspace-page-preview-frame {
  display: block;
  width: 100%;
  min-height: 680px;
  border: 0;
  background: #f5f0e5;
}

.mindspace-page-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.mindspace-page-meta > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 18px;
  border-radius: 16px;
  background: rgba(24, 33, 29, 0.07);
}

.mindspace-page-meta span {
  color: #6d7771;
  font-size: 12px;
}

.mindspace-page-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mindspace-version-history {
  margin-top: 42px;
}

.mindspace-version-history h3 {
  margin: 5px 0 16px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 30px;
  font-weight: 500;
}

.mindspace-version-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(24, 33, 29, 0.12);
}

.mindspace-version-row time {
  color: #6d7771;
  font-size: 12px;
}

.mindspace-empty,
.mindspace-state {
  margin-top: 16px;
  padding: 20px;
  border: 1px dashed rgba(24, 33, 29, 0.2);
  border-radius: 16px;
  text-align: center;
}

.mindspace-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.mindspace-state button {
  padding: 9px 14px;
}

.mindspace-error {
  color: #8b2d20;
  border-color: rgba(139, 45, 32, 0.35);
}

@media (min-width: 761px) {
  .mindspace-content {
    width: min(1180px, calc(100% - 40px));
    padding: 52px 0 80px;
  }

  .mindspace-hero {
    grid-template-columns: minmax(0, 1fr) min(272px, 34%);
    gap: 28px 40px;
    padding: clamp(28px, 5vw, 64px);
    border-radius: 32px;
    box-shadow: 0 24px 70px rgba(48, 54, 45, 0.1);
  }

  .mindspace-hero-left .mindspace-actions {
    margin-top: 24px;
  }

  .mindspace-hero h1 {
    margin: 6px 0 12px;
    font-size: clamp(42px, 7vw, 82px);
  }

  .mindspace-hero p,
  .mindspace-card p,
  .mindspace-empty p {
    line-height: 1.7;
  }

  .mindspace-eyebrow {
    font-size: 12px;
    letter-spacing: 0.18em;
  }

  .mindspace-primary,
  .mindspace-secondary {
    padding: 13px 20px;
  }

  .mindspace-section {
    margin-top: 64px;
  }

  .mindspace-section-heading {
    gap: 24px;
    margin-bottom: 22px;
  }

  .mindspace-section-heading h2,
  .mindspace-empty h2 {
    margin: 6px 0 0;
    font-size: clamp(28px, 4vw, 44px);
  }

  .mindspace-grid {
    grid-template-columns: repeat(12, 1fr);
    gap: 18px;
  }

  .mindspace-card {
    grid-column: span 4;
    min-height: 220px;
    padding: 24px;
    border-radius: 24px;
  }

  .mindspace-grid-secondary {
    grid-column: span 12;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .mindspace-grid-secondary .mindspace-card,
  .mindspace-grid-secondary .mindspace-agent-jobs-module {
    min-height: 180px;
  }

  .mindspace-agent-jobs-module {
    gap: 8px;
    padding: 20px 22px;
    border-radius: 24px;
  }

  .mindspace-agent-jobs-module strong {
    font-size: 24px;
  }

  .mindspace-card h3 {
    margin: 30px 0 8px;
    font-size: 28px;
  }

  .mindspace-card button {
    margin-top: 8px;
    padding: 9px 14px;
  }

  .mindspace-feed-grid {
    gap: 12px;
  }

  .mindspace-feed-card-actions {
    gap: 8px;
  }

  .mindspace-feed-card-actions button {
    padding: 7px 11px;
  }

  .mindspace-feed-cover {
    aspect-ratio: 3 / 4;
  }

  .mindspace-feed-body {
    padding: 10px 12px 12px;
  }

  .mindspace-feed-title {
    font-size: 14px;
  }

  .mindspace-feed-meta {
    margin-top: 6px;
    font-size: 12px;
  }

  .mindspace-page-grid,
  .mindspace-item-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .mindspace-page-card {
    min-height: 230px;
    padding: 24px;
    border-radius: 24px;
  }

  .mindspace-page-card h3 {
    margin: 30px 0 10px;
    font-size: 28px;
  }

  .mindspace-new-page {
    gap: 20px;
    padding: clamp(24px, 5vw, 48px);
    border-radius: 28px;
  }

  .mindspace-new-page h2,
  .mindspace-page-detail h2 {
    font-size: clamp(34px, 5vw, 52px);
  }

  .mindspace-page-detail {
    margin-top: 64px;
  }

  .mindspace-empty,
  .mindspace-state {
    margin-top: 24px;
    padding: 38px;
    border-radius: 24px;
  }
}

@media (max-width: 760px) {
  .mindspace-header {
    padding: 14px 16px;
  }

  .mindspace-header-actions > span {
    display: none;
  }

  .mindspace-content {
    width: min(100% - 24px, 1180px);
    padding-top: 18px;
  }

  .mindspace-hero,
  .mindspace-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .mindspace-recent-work .mindspace-section-heading {
    align-items: flex-start;
    flex-direction: row;
  }

  .mindspace-recent-work .mindspace-section-link {
    width: auto;
    padding: 5px 9px;
    font-size: 12px;
  }

  .mindspace-hero {
    grid-template-columns: 1fr;
    gap: 20px;
    border-radius: 24px;
  }

  .mindspace-hero-quota {
    width: 100%;
  }

  .mindspace-space-purchase-summary {
    grid-template-columns: repeat(3, minmax(88px, 1fr));
    gap: 6px;
  }

  .mindspace-space-purchase-summary div {
    padding: 8px 9px;
    border-radius: 10px;
  }

  .mindspace-space-purchase-summary span {
    font-size: 10px;
  }

  .mindspace-space-purchase-summary strong {
    font-size: 11px;
  }

  .mindspace-space-purchase-recharge {
    flex-direction: column;
    align-items: stretch;
  }

  .mindspace-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mindspace-actions .mindspace-primary,
  .mindspace-actions .mindspace-secondary {
    padding-inline: 8px;
    font-size: 13px;
  }

  .mindspace-card,
  .mindspace-card:nth-child(4),
  .mindspace-card:nth-child(5) {
    grid-column: auto;
  }

  .mindspace-grid-secondary .mindspace-agent-jobs-module {
    grid-column: 1 / -1;
  }

  .mindspace-assets-section .mindspace-section-heading .mindspace-primary {
    width: 100%;
  }

  .mindspace-asset-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .mindspace-asset-copy {
    width: calc(100% - 68px);
  }

  .mindspace-asset-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .mindspace-page-grid,
  .mindspace-item-grid {
    grid-template-columns: 1fr;
  }

  .page-save-layout {
    grid-template-columns: 1fr;
  }

  .page-save-aside {
    order: -1;
  }

  .mindspace-page-layout {
    grid-template-columns: 1fr;
  }

  .mindspace-page-preview-frame {
    min-height: 560px;
  }

  .mindspace-page-floating-actions {
    right: 16px;
    bottom: 16px;
  }

  .mindspace-page-export-feedback {
    right: 16px;
    bottom: 72px;
    max-width: calc(100vw - 32px);
  }

  .mindspace-page-meta {
    grid-template-columns: 1fr;
  }

  .mindspace-page-editor-actions,
  .mindspace-version-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .mindspace-page-editor-actions {
    flex-direction: column;
  }

  .mindspace-page-status,
  .mindspace-publication-live {
    align-items: flex-start;
    flex-direction: column;
  }

  .mindspace-publication-live > div:last-child {
    width: 100%;
  }

  .mindspace-slug-field {
    align-items: stretch;
    flex-direction: column;
  }

  .mindspace-slug-field span {
    padding: 10px 14px 0;
  }

  .mindspace-section {
    margin-top: 42px;
  }

  .mindspace-section-heading > span {
    display: none;
  }
}

.logout-btn {
  color: var(--color-text-error);
}

@media (max-width: 767px) {
  .header {
    padding: 10px var(--space-md);
    gap: var(--space-sm);
  }

  .header-left {
    gap: var(--space-sm);
    flex: 1;
    min-width: 0;
  }

  .header-brand-avatar,
  .header-title {
    display: none;
  }

  .header-sub {
    margin-top: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
  }

  .header-actions-desktop {
    display: none;
  }

  .header-actions-mobile {
    display: flex;
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .header {
    padding-inline: var(--space-md);
  }

  .header-actions {
    gap: var(--space-xs);
  }

  .ghost-btn {
    padding: 8px 9px;
    font-size: 12px;
  }

  .wechat-debug-overlay {
    padding: 12px;
    align-items: flex-end;
  }

  .wechat-debug-card {
    max-height: 86vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .wechat-debug-grid {
    grid-template-columns: 1fr;
  }

  .wechat-debug-actions {
    flex-direction: column;
  }
}

.space-chat-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: inherit;
  background: #fffaf0;
  box-shadow:
    0 10px 30px rgba(24, 33, 29, 0.18),
    0 0 0 1px rgba(47, 111, 87, 0.18);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.space-chat-fab:hover {
  transform: translateY(-2px);
}

.space-chat-fab.is-streaming {
  box-shadow:
    0 10px 30px rgba(47, 111, 87, 0.28),
    0 0 0 2px rgba(47, 111, 87, 0.35);
  animation: space-chat-fab-pulse 1.6s ease-in-out infinite;
}

.space-chat-fab.has-pending-tool .space-chat-fab-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d64545;
  box-shadow: 0 0 0 2px #fffaf0;
}

@keyframes space-chat-fab-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

.space-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 900;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(480px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 120px));
  overflow: hidden;
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 24px;
  background: rgba(255, 252, 244, 0.98);
  box-shadow: 0 24px 60px rgba(24, 33, 29, 0.18);
}

.space-chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(24, 33, 29, 0.08);
}

.space-chat-panel-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.space-chat-panel-brand strong {
  display: block;
  font-size: 14px;
}

.space-chat-context-chip {
  display: block;
  overflow: hidden;
  color: #6d7771;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.space-chat-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.space-chat-panel-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  color: #52605a;
  font-size: 22px;
  line-height: 1;
  background: rgba(24, 33, 29, 0.06);
  cursor: pointer;
}

.space-chat-panel-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  color: #8a1f1f;
  font-size: 13px;
  background: rgba(214, 69, 69, 0.08);
}

.space-chat-panel-body {
  overflow: auto;
  padding: 12px 14px 0;
}

.space-chat-panel-body .msg-content {
  max-width: calc(100% - 48px);
}

.space-chat-panel-body .msg-bubble-wrap-compact {
  width: 100%;
}

.space-chat-panel-body .msg-bubble-wrap-compact .msg-bubble {
  width: 100%;
  max-width: none;
}

.space-chat-panel-body .message-list {
  min-height: 100%;
}

.space-chat-panel-body .empty-state-compact {
  padding: 28px 12px;
}

.space-chat-panel-body .empty-state-compact h2 {
  font-size: 20px;
}

.space-chat-panel-body .empty-state-compact p {
  font-size: 13px;
}

.space-chat-panel-footer {
  display: grid;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(24, 33, 29, 0.08);
  background: rgba(255, 252, 244, 0.96);
}

.space-chat-panel-footer .chat-input-row .ghost-btn {
  padding: 8px 10px;
  font-size: 13px;
}

.space-chat-panel-dismiss {
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  color: #6d7771;
  font-size: 13px;
  background: rgba(24, 33, 29, 0.05);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.space-chat-panel-dismiss:hover {
  color: #52605a;
  background: rgba(24, 33, 29, 0.09);
}

.tool-confirm-compact {
  margin: 0 16px 8px;
  border-radius: 16px;
}

@media (max-width: 720px) {
  .space-chat-fab {
    right: 16px;
    bottom: 16px;
  }

  .space-chat-panel {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: min(75vh, calc(100vh - 48px));
    border-right: 0;
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
  }

  .space-chat-panel-actions .ghost-btn {
    display: none;
  }
}

.mindspace-page-fullscreen-preview {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #fffaf0;
}

.mindspace-page-fullscreen-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(24, 33, 29, 0.08);
  background: rgba(255, 252, 244, 0.98);
}

.mindspace-page-fullscreen-preview-title {
  min-width: 0;
}

.mindspace-page-fullscreen-preview-title strong {
  display: block;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mindspace-page-fullscreen-preview-hint {
  display: block;
  margin-top: 4px;
  color: #6d7771;
  font-size: 11px;
  line-height: 1.4;
}

.mindspace-page-fullscreen-preview-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.mindspace-page-fullscreen-preview-actions button {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  color: #52605a;
  font-size: 13px;
  background: rgba(24, 33, 29, 0.06);
  cursor: pointer;
}

.mindspace-page-fullscreen-preview-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mindspace-page-fullscreen-preview-actions .mindspace-primary {
  color: #fff;
  background: #2f6f57;
}

.mindspace-page-fullscreen-preview-body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #f4f1e8;
}

.mindspace-page-fullscreen-preview-frame {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 0;
  height: 100%;
  border: 0;
  background: #fff;
}

.space-chat-stack-overlay .space-chat-fab,
.space-chat-stack-overlay .space-chat-panel {
  z-index: 1010;
}

@media (max-width: 720px) {
  .mindspace-page-fullscreen-preview-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .mindspace-page-fullscreen-preview-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
