:root {
  --bg: #f3efe6;
  --panel: #fffcf7;
  --panel-2: #ebe4d8;
  --border: #ddd2c3;
  --text: #1c1917;
  --muted: #7a7066;
  --accent: #0f766e;
  --accent-hover: #0d5e58;
  --accent-soft: #d7efe8;
  --danger: #b42318;
  --success: #157a4b;
  --warning: #b45309;
  --shadow: 0 18px 40px rgba(28, 25, 23, .08);
  --radius: 14px;
  --ink: color-mix(in srgb, var(--text) 88%, var(--accent) 12%);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --log-bg: #efe8dc;
  --log-text: #3f3a34;
  --log-ts: #9a9084;
  --log-logger: #7a7066;
  --log-debug: #7a7066;
  --log-info: #0f766e;
  --log-warning: #b45309;
  --log-error: #b42318;
}

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

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.error-text { color: var(--danger); min-height: 18px; font-size: 13px; }

.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 32%),
    radial-gradient(circle at 88% 82%, color-mix(in srgb, var(--warning) 16%, transparent), transparent 36%),
    var(--bg);
}

.login-card {
  background: var(--panel);
  padding: 32px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow);
}

.login-card h1,
.login-card h2 { font-size: 26px; letter-spacing: -.03em; }

.app { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
  width: 248px;
  background: var(--ink);
  color: var(--panel);
  border-right: 0;
  padding: 22px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-shrink: 0;
  height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 8px;
  color: inherit;
}
.brand span { color: color-mix(in srgb, var(--accent) 55%, white); margin-left: 2px; }

nav { display: flex; flex-direction: column; gap: 14px; flex: 1; overflow-y: auto; padding-right: 4px; }

.nav-group {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: color-mix(in srgb, var(--panel) 58%, transparent);
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 6px 10px 8px;
  font-weight: 700;
}
.nav-group-toggle::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform .15s;
  opacity: .65;
  margin-right: 4px;
}
.nav-group.collapsed .nav-group-toggle::after {
  transform: rotate(-45deg);
  margin-top: 2px;
}
.nav-group-items {
  display: flex;
  flex-direction: column;
}
.nav-group.collapsed .nav-group-items {
  display: none;
}

.nav-group-toggle:hover { color: var(--text); }
.nav-group-toggle:hover { color: var(--panel); }

.nav-btn {
  text-align: left;
  background: transparent;
  border: none;
  color: color-mix(in srgb, var(--panel) 82%, white);
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-btn:hover { background: color-mix(in srgb, var(--panel) 12%, transparent); color: var(--panel); }
.nav-btn.active { background: var(--accent); color: #fff; font-weight: 650; }
.nav-btn.logout { color: #fecaca; margin-top: auto; }
.nav-btn .count-pill {
  font-size: 11px;
  background: color-mix(in srgb, var(--panel) 14%, transparent);
  color: inherit;
  border-radius: 999px;
  padding: 1px 7px;
}
.nav-btn.active .count-pill { background: rgba(255,255,255,.18); color: #fff; }

.content { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.content-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px 12px;
  border-bottom: 0;
  background: transparent;
  gap: 16px;
}
.topbar h2 { font-size: 22px; letter-spacing: -.03em; }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.topbar h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
}
.menu-btn span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.sidebar-overlay {
  display: none;
}

.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.online { background: rgba(22,163,74,.1); color: var(--success); }
.badge.offline { background: rgba(220,38,38,.08); color: var(--danger); }

.badge.unused { background: var(--panel-2); color: var(--muted); }
.badge.used { background: rgba(22,163,74,.1); color: var(--success); }
.badge.ended { background: rgba(217,119,6,.12); color: var(--warning); }
.badge.void { background: rgba(220,38,38,.08); color: var(--danger); }
.badge.active { background: rgba(22,163,74,.1); color: var(--success); }
.badge.expired { background: rgba(217,119,6,.12); color: var(--warning); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.chip {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

.help-list {
  margin: 0;
  padding: 4px 0 4px 18px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.8;
}
.help-list code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--panel-2);
  padding: 1px 6px;
  border-radius: 4px;
}

.card-list-head { gap: 10px; flex-wrap: wrap; }
.card-list-head input[type="search"] {
  min-width: 180px;
  margin-left: auto;
}

.tab { display: none; padding: 24px 28px; }
.tab.active { display: block; }
#tab-groups.tab.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 73px);
  overflow: hidden;
}
.groups-shell {
  display: grid;
  grid-template-columns: minmax(280px, 38%) 1fr;
  gap: 16px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}
.groups-shell > .panel {
  margin-bottom: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.groups-pane .list-grid,
.members-pane .table-wrap {
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.members-pane .panel-head { gap: 10px; }
#members-back { display: none; }
.tile.clickable.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

#tab-chat.tab {
  padding: 0;
  height: calc(100vh - 73px);
}
#tab-chat.tab.active {
  display: flex;
  flex-direction: column;
}
.chat-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  background: var(--panel);
  border-top: 1px solid var(--border);
}
.chat-list {
  width: 300px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--panel-2);
}
.chat-list-head {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.chat-list-head input {
  width: 100%;
}
.chat-sessions {
  overflow: auto;
  flex: 1;
}
.chat-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  color: inherit;
}
.chat-item:hover { background: var(--accent-soft); }
.chat-item.active {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.chat-item-body { min-width: 0; flex: 1; }
.chat-item-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.chat-item-title {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-item-time { color: var(--muted); font-size: 11px; flex-shrink: 0; }
.chat-item-preview {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.chat-preview-media {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chat-preview-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 3px;
  vertical-align: middle;
}
.chat-item .avatar { width: 36px; height: 36px; font-size: 13px; flex-shrink: 0; }
.chat-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
}
.chat-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--panel-2) 100%);
}
.chat-head {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
}
.chat-head h3 { font-size: 16px; }
.chat-head p { font-size: 12px; }
.chat-back {
  display: none;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text);
}
.chat-messages {
  flex: 1;
  overflow: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg {
  max-width: min(72%, 560px);
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
}
.chat-msg.self { align-self: flex-end; align-items: flex-end; }

.chat-msg.self { flex-direction: row-reverse; }
.chat-msg-meta { font-size: 11px; color: var(--muted); }
.chat-bubble {
  padding: 9px 12px;
  border-radius: 12px 12px 12px 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}
.chat-msg.self .chat-bubble {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  border-radius: 12px 12px 4px 12px;
}
.chat-at { color: var(--accent); font-weight: 600; }
.chat-msg.self .chat-at { color: #fff; }
.chat-image {
  max-width: min(100%, 420px);
  width: auto;
  height: auto;
  max-height: min(70vh, 720px);
  border-radius: 8px;
  display: block;
  margin-top: 4px;
  object-fit: contain;
}
.chat-face {
  width: 28px;
  height: 28px;
  vertical-align: middle;
  object-fit: contain;
}
.chat-chip {
  display: inline-block;
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--muted);
}
.chat-msg.self .chat-chip { background: rgba(255,255,255,.16); color: #fff; }
.chat-composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  position: relative;
}
.chat-toolbar {
  display: flex;
  gap: 6px;
}
.tool-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
}
.tool-btn:hover { border-color: var(--accent); color: var(--accent); }
.tool-btn:disabled { opacity: .5; cursor: not-allowed; }
.chat-composer-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-composer textarea {
  flex: 1;
  resize: none;
  min-height: 42px;
  max-height: 120px;
  line-height: 1.45;
}
.chat-composer .btn { height: 42px; }
.chat-pending {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pending-item {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.pending-item img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
}
.pending-item.pending-text {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 13px;
}
.pending-x {
  margin-left: 6px;
  border: none;
  background: rgba(0,0,0,.06);
  color: var(--muted);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.pending-item.pending-text .pending-x { background: rgba(0,0,0,.06); }
.chat-emoji-panel {
  position: absolute;
  left: 16px;
  bottom: 100%;
  width: min(360px, 60vw);
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  padding: 10px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(auto-fill, 44px);
  gap: 6px;
  justify-items: center;
  align-content: start;
  scrollbar-width: thin;
}
.chat-emoji-panel .empty.small {
  grid-column: 1 / -1;
  font-size: 13px;
}
.face-pick {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
  cursor: pointer;
  border-radius: 8px;
  padding: 2px;
  background: transparent;
  box-sizing: border-box;
}
.face-pick:hover { background: var(--bg); }
.face-pick.face-pick-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 1px dashed var(--border);
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 20px; }

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-card.selectable {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  text-align: left;
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.stat-card.selectable:hover { border-color: var(--accent); }
.stat-card.selectable.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 27px; font-weight: 700; margin-top: 6px; }
#tab-llm .stat-value { font-size: 16px; word-break: break-all; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.panel-head h3 { font-size: 15px; flex-shrink: 0; }
.panel-head > .muted { min-width: 0; line-height: 1.5; }


.dashboard-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.dashboard-split .panel { margin-bottom: 0; }

.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 24px; }
.info-row { display: flex; flex-direction: column; gap: 3px; }
.info-row dt { color: var(--muted); font-size: 12px; }
.info-row dd { font-size: 14px; font-weight: 500; word-break: break-all; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 18px;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.form-grid label.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.form-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; }

.form-grid .span-2 { grid-column: 1 / -1; }

.form-grid .feat-card { margin: 0; }

.llm-fallbacks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.llm-fallback-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.llm-fallback-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.llm-fallback-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.card-html-editor {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-height: 180px;
  line-height: 1.45;
}
.card-preview-box {
  margin-top: 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 16px;
  background: #eef2f7;
  min-height: 140px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.card-preview-box img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
}

.join-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.join-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.join-comment {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  min-height: 40px;
  white-space: pre-wrap;
  word-break: break-word;
}
.join-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.join-status { font-size: 12px; font-weight: 600; }
.join-status.approved { color: var(--success); }
.join-status.rejected { color: var(--warning); }
.join-status.blocked { color: var(--danger); }
.feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.feat-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feat-card.off { opacity: .7; }
.feat-card#fb-exempt-card { margin-bottom: 16px; }
.feat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.feat-card h4 { font-size: 15px; font-weight: 650; }
.feat-card p { font-size: 12px; line-height: 1.45; }
.feat-search {
  width: 100%;
  margin-bottom: 12px;
}
.feat-group-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feat-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
}
.feat-group.off { opacity: .82; }
.feat-group-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.feat-group-meta {
  min-width: 0;
  flex: 1;
}
.feat-group-meta .tile-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feat-minis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.feat-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
}
.feat-mini > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feat-mini .switch input:disabled + span { opacity: .45; cursor: not-allowed; }
.ug-switch-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(180px, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  align-items: stretch;
}
.ug-switch-grid .feat-card { margin: 0; }
.ug-switch-grid .ug-kinds { grid-column: 1 / -1; }
.ug-kinds {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ug-kinds .feat-mini { flex: 1; }
.ug-kinds.is-off { opacity: .55; }
.llm-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.llm-panels .panel { margin: 0; }
.llm-result { word-break: break-all; }

input, select, textarea {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"] { width: auto; }

.pick { position: relative; width: 100%; z-index: 1; }
.pick.open { z-index: 30; }
select.pick-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  padding: 0;
  border: 0;
}
.pick-btn {
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 32px 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  position: relative;
  min-height: 38px;
}
.pick-btn::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
}
.pick.open .pick-btn {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.pick.open .pick-btn::after { transform: translateY(-20%) rotate(225deg); }
.pick-menu {
  position: fixed;
  z-index: 40;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 240px;
  overflow: auto;
  box-shadow: var(--shadow);
  padding: 4px;
}
.pick-opt {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.pick-opt:hover, .pick-opt.active { background: var(--accent-soft); color: var(--accent); }
.pick-opt:disabled { opacity: .45; cursor: default; }
.pick-empty { padding: 10px; font-size: 13px; color: var(--muted); }
.log-toolbar .pick { width: auto; min-width: 148px; }

.card-created {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.card-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}
.card-code-text { font-weight: 600; }
.card-code-meta {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--muted);
  background: var(--panel);
  border-radius: 999px;
  padding: 1px 7px;
}
.card-code:hover { border-color: var(--accent); }
.card-list-head .seg {
  flex: 1 1 240px;
  min-width: 240px;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.pager .muted { font-size: 13px; }
.pager .btn { min-width: 72px; }

.color-swatch {
  width: 42px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.theme-color.open-color { align-items: start; }
.color-sliders {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 2px 2px;
}
.color-sliders label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.color-sliders input[type="range"] {
  width: 100%;
  padding: 0;
  accent-color: var(--accent);
}

.btn {
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }
.btn.ghost:hover { color: var(--text); }
.btn.danger { background: rgba(220,38,38,.08); color: var(--danger); }
.btn.danger:hover { background: rgba(220,38,38,.16); }
.btn.small { padding: 5px 12px; font-size: 12px; }

.table { width: 100%; border-collapse: collapse; }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table th, .table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.table th { color: var(--muted); font-weight: 600; background: var(--panel-2); }
.table tbody tr:hover { background: var(--panel-2); }
.table td.actions { text-align: right; }

.trigger-log { margin-top: 14px; }
.trigger-log td { vertical-align: middle; }
.trigger-log .trigger-time {
  white-space: nowrap;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.trigger-log .trigger-hit {
  max-width: 240px;
  word-break: break-all;
}
.trigger-log .trigger-action { white-space: normal; }
.trigger-log .cell-title,
.trigger-log .cell-sub {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge.fb-act {
  flex-wrap: wrap;
  white-space: normal;
  line-height: 1.35;
  height: auto;
  max-width: 100%;
  padding: 4px 10px;
  gap: 6px;
}
.fb-act-text::before { content: attr(data-full); }
.fb-act-time { font-weight: 500; opacity: .85; }
.fb-act-recall { background: var(--panel-2); color: var(--muted); }
.fb-act-warn { background: rgba(217,119,6,.12); color: var(--warning); }
.fb-act-mute { background: rgba(37,99,235,.1); color: var(--accent); }
.fb-act-warnmute { background: rgba(220,38,38,.08); color: var(--danger); }
.fb-act-pass { background: rgba(22,163,74,.1); color: var(--success); }
.fb-act-fail { background: rgba(100,116,139,.12); color: var(--muted); }

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

.tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border .15s, transform .1s;
}
.tile.clickable { cursor: pointer; }
.tile.clickable:hover { border-color: var(--accent); transform: translateY(-1px); }
.tile-title { font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.tile-title .tag {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}
.tile-sub { color: var(--muted); font-size: 12px; }

.avatar {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; flex-shrink: 0;
}

.avatar {
  position: relative;
  overflow: hidden;
}
.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--panel-2);
}
.avatar-sm { width: 30px; height: 30px; font-size: 12px; border-radius: 8px; }
.avatar-xs { width: 22px; height: 22px; font-size: 10px; border-radius: 6px; }
.avatar-md { width: 42px; height: 42px; font-size: 15px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; border-radius: 14px; }
.cell-avatar { display: flex; align-items: center; gap: 8px; }
.cell-avatar .avatar-sm { width: 28px; height: 28px; }
.cell-avatar .avatar-xs { width: 22px; height: 22px; }
.cell-title { font-size: 13px; font-weight: 500; }
.cell-sub { color: var(--muted); font-size: 11px; }
.server-face { grid-column: 1 / -1; }
.chat-head-face { flex-shrink: 0; }
.chat-head-face .avatar { width: 42px; height: 42px; }
.chat-head-text { flex: 1; min-width: 0; }
.chat-pin {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}
.chat-item:hover .chat-pin, .chat-pin.on, .chat-pin-head { opacity: 1; }
.chat-pin:hover, .chat-pin.on { color: var(--accent); background: var(--accent-soft); }
.chat-pin-head { margin-left: auto; opacity: 1; width: 34px; height: 34px; }
.chat-item.pinned { background: var(--accent-soft); }
.chat-pin-tag {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 0 5px;
  vertical-align: middle;
}
.chat-msg-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.chat-msg.self .chat-msg-col { align-items: flex-end; }

.tile-head { display: flex; gap: 10px; align-items: center; }

.tile-head .tile-title { flex: 1; min-width: 0; }
.switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span {
  position: absolute;
  inset: 0;
  background: #d0d7e2;
  border-radius: 99px;
  cursor: pointer;
  transition: background .15s;
}
.switch span::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .2);
  transition: transform .15s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.llm-models-hint { font-size: 12px; }

.role-owner { color: var(--warning); }
.role-admin { color: var(--accent); }
.role-member { color: var(--muted); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
  font-size: 13px;
}

.crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 13px; }
.crumbs a { color: var(--accent); cursor: pointer; text-decoration: none; }
.crumbs .sep { color: var(--muted); }

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 11px 22px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  font-size: 14px;
  z-index: 100;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

.confirm-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(16, 24, 40, .36);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}
.confirm-card {
  width: min(400px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(16, 24, 40, .18);
  padding: 22px 22px 18px;
}
.confirm-card h3 { font-size: 16px; margin-bottom: 8px; }
.confirm-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.confirm-actions .btn { min-width: 72px; }

.detail-card {
  width: min(720px, 100%);
  max-height: min(88vh, 860px);
  display: flex;
  flex-direction: column;
}
.detail-body {
  overflow: auto;
  max-height: min(72vh, 720px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.audit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.audit-time {
  font-size: 12px;
  color: var(--muted);
}
.audit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}
.detail-row.is-empty .detail-value { color: var(--muted); }
.detail-block .detail-value {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  max-height: 260px;
  overflow: auto;
}
.detail-urls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.detail-url {
  word-break: break-all;
  color: var(--accent);
}
.detail-image {
  display: block;
  max-width: 100%;
  max-height: 280px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  object-fit: contain;
}
.badge.audit-hit { background: rgba(220,38,38,.08); color: var(--danger); }
.badge.audit-pass { background: rgba(22,163,74,.1); color: var(--success); }
.badge.audit-fail { background: rgba(100,116,139,.12); color: var(--muted); }
.trigger-log .trigger-vision {
  max-width: 280px;
}
.detail-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.detail-value {
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}
.ig-vision-view {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent, #2563eb);
  cursor: pointer;
  font: inherit;
  text-align: left;
  word-break: break-all;
}
.ig-vision-view:hover { text-decoration: underline; }

.live-tag {
  font-size: 11px;
  color: var(--success);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.live-tag::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }


.log-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.log-toolbar .check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
}
.log-search {
  min-width: 160px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
}
#tab-logs.tab.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 73px);
  height: calc(100dvh - 73px);
  min-height: 0;
  overflow: hidden;
}
.log-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
}
.log-view {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  background: var(--log-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  flex: 1;
  max-height: none;
  min-height: 180px;
  overflow: auto;
  color: var(--log-text);
  scrollbar-width: thin;
  scrollbar-color: #c5ced9 transparent;
}
.log-view::-webkit-scrollbar { width: 8px; }
.log-view::-webkit-scrollbar-thumb {
  background: #c5ced9;
  border-radius: 8px;
}
.log-view::-webkit-scrollbar-track { background: transparent; }
.log-view-compact { max-height: 220px; flex: none; }
.log-view .empty { padding: 24px 12px; font-family: inherit; }
.log-nav {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel-2);
  flex: 0 0 auto;
}
.log-nav-btn {
  border: none;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  min-height: 36px;
  font-size: 13px;
  cursor: pointer;
  width: auto;
}
.log-nav-btn:last-child { border-right: none; }
.log-nav-btn:hover { color: var(--text); }
.log-nav-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.log-toolbar .btn { width: auto; flex: none; }
.log-line { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0; }
.log-ts { color: var(--log-ts); flex-shrink: 0; }
.log-io {
  flex-shrink: 0;
  width: 22px;
  font-weight: 700;
}
.log-io.in { color: var(--accent); }
.log-io.out { color: var(--success); }
.log-level { font-weight: 600; width: 64px; flex-shrink: 0; }
.log-logger { color: var(--log-logger); min-width: 88px; flex-shrink: 0; }
.log-msg { flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-word; }
.log-line.debug, .log-line.debug .log-level { color: var(--log-debug); }
.log-line.info .log-level { color: var(--log-info); }
.log-line.warning, .log-line.warning .log-level, .log-line.warning .log-msg { color: var(--log-warning); }
.log-line.error, .log-line.error .log-level, .log-line.error .log-msg { color: var(--log-error); }

.theme-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.theme-card {
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 12px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.theme-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.theme-swatch { display: flex; height: 28px; border-radius: 8px; overflow: hidden; }
.theme-swatch i { flex: 1; }
.theme-card strong { font-size: 14px; }
.theme-card span { font-size: 12px; color: var(--muted); }
.theme-color-groups { display: flex; flex-direction: column; gap: 18px; }
.theme-color-group h4 { font-size: 13px; margin-bottom: 10px; }
.theme-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.theme-color {
  display: grid;
  grid-template-columns: 1fr 42px 92px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.theme-log-preview { max-height: none; flex: none; }

.rank-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel-2);
  min-width: 180px;
}
.rank-toolbar .seg {
  flex: 1 1 220px;
}
.seg-btn {
  border: none;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 8px 4px;
  min-height: 38px;
  font-size: 13px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  width: auto;
}
.seg-btn:last-child { border-right: none; }
.seg-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.rank-result { margin-top: 14px; }
.rank-no { font-weight: 600; color: var(--muted); }
.rank-no.top { color: var(--accent); }
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}
.rank-avatar { width: 38px; height: 38px; border-radius: 10px; }
.rank-main { min-width: 0; }
.rank-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.rank-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-qq { color: var(--muted); font-size: 12px; }
.rank-bar { margin-top: 6px; height: 6px; border-radius: 99px; background: var(--panel-2, #eef1f6); overflow: hidden; }
.rank-bar-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-soft), var(--accent)); transition: width .3s ease; }
.rank-count { text-align: right; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.rank-count b { font-size: 15px; color: var(--accent); }
.rank-count .muted { font-size: 11px; }

.rank-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.rank-metric {
  font-size: 11px;
  color: var(--muted);
  background: var(--panel-2);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
  line-height: 1.4;
}
.rank-metric b {
  color: var(--text);
  font-weight: 650;
  margin-left: 4px;
}
.rank-last {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}
.cmd-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.cmd-section + .cmd-section {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.cmd-section-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .04em;
  padding: 2px 0 4px;
}

.cmd-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.cmd-row:last-child { border-bottom: none; }
.cmd-body { min-width: 0; }
.cmd-name { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.cmd-body input { width: 100%; }

.cmd-access { width: 100%; max-width: 240px; }
.data-row { cursor: pointer; }
.data-row:hover td { background: color-mix(in srgb, var(--panel-2) 70%, transparent); }
.data-row.active td { background: var(--accent-soft); }
.cmd-switch { position: relative; display: inline-flex; align-items: center; }
.cmd-switch input { display: none; }
.switch-track {
  display: inline-block;
  width: 38px; height: 22px;
  border-radius: 99px;
  background: var(--border);
  position: relative;
  transition: background .2s ease;
  cursor: pointer;
}
.switch-track::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.cmd-switch input:checked + .switch-track { background: var(--accent); }
.cmd-switch input:checked + .switch-track::after { transform: translateX(16px); }
.api-result { margin-top: 14px; }
.api-console {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #0f1419;
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow: auto;
  color: #d5deea;
}
.api-console .api-line { padding: 1px 0; }
.api-console .empty { color: #8b9bb0; font-family: inherit; }
.api-console .api-line:first-child { color: #7eb3de; }
.apipreset { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.apipreset .chip { border-radius: 99px; }
.fb-table,
.stack-table { margin-top: 14px; }
.fb-table input,
.stack-table input,
.fb-table select,
.stack-table select { width: 100%; min-width: 100px; }
.fb-table .actions,
.stack-table .actions { white-space: nowrap; }
.fb-table td.cell-sub,
.stack-table td.cell-sub {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.auth-hint {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger, #dc2626);
  color: #fff;
  font-size: 13px;
}
.auth-hint.hidden { display: none; }
.btn.danger { color: var(--danger, #dc2626); border-color: currentColor; }
@media (max-width: 860px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #tab-llm .cards { grid-template-columns: 1fr; }
  .stat-card { padding: 12px 14px; }
  .stat-value { font-size: 22px; }
  #tab-llm .stat-value { font-size: 14px; }
  .form-grid, .info-grid, .llm-panels, .dashboard-split, .ug-switch-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .tab { padding: 12px; }
  .topbar { padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .hub-subnav { padding: 0 12px 10px; }
  .menu-btn { display: inline-flex; width: 40px; height: 40px; }
  .nav-btn { min-height: 44px; padding: 12px 14px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="hidden"]),
  select, textarea, .pick-btn {
    font-size: 16px;
    min-height: 44px;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(280px, 86vw);
    height: 100vh;
    height: 100dvh;
    padding-top: calc(22px + env(safe-area-inset-top));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: none;
  }
  .app.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 24px rgba(16, 24, 40, .12);
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, .36);
    z-index: 15;
  }
  .app.sidebar-open .sidebar-overlay { display: block; }
  #tab-chat.tab { height: calc(100dvh - 61px - env(safe-area-inset-top)); }
  #tab-groups.tab.active { height: calc(100dvh - 61px - env(safe-area-inset-top)); }
  .chat-list { width: 100%; }
  .chat-main { display: none; }
  .chat-shell.chat-open .chat-list { display: none; }
  .chat-shell.chat-open .chat-main { display: flex; }
  .chat-back { display: inline-flex; min-height: 40px; align-items: center; }
  .groups-shell { grid-template-columns: 1fr; }
  .groups-shell.members-open .groups-pane { display: none; }
  .groups-shell:not(.members-open) .members-pane { display: none; }
  .groups-shell:not(.members-open) #members-back { display: none; }
  .groups-shell.members-open #members-back { display: inline-flex; }
  .chat-msg { max-width: 88%; }
  .chat-pin { opacity: 1; }
  .chat-composer {
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  }
  .chat-composer textarea { min-height: 44px; font-size: 16px; }
  .chat-composer .btn { height: 44px; }
  .chat-emoji-panel {
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
    max-height: min(320px, 42dvh);
  }
  .panel { padding: 14px; margin-bottom: 12px; }
  .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 12px;
  }
  .panel-head h3 { font-size: 16px; }
  .panel-head > .muted { flex: 1 1 100%; white-space: normal; word-break: break-word; }
  .form-actions { flex-wrap: wrap; gap: 10px; }
  #tab-logs.tab.active {
    height: calc(100dvh - 61px - env(safe-area-inset-top));
    padding: 12px;
  }
  .log-toolbar, .cmd-toolbar, .rank-toolbar, .card-list-head {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }
  .log-nav {
    flex: 1 1 180px;
    min-width: 168px;
  }
  .log-nav-btn {
    flex: 1;
    min-width: 0;
    padding: 0 8px;
  }
  .log-toolbar select, .log-toolbar input,
  .cmd-toolbar select, .card-list-head input, .card-list-head select,
  .rank-toolbar select {
    min-width: 0;
    flex: 1 1 140px;
    margin-left: 0;
  }
  .rank-toolbar {
    flex: 1 1 240px;
    flex-direction: row;
    align-items: center;
  }
  .rank-toolbar select,
  .rank-toolbar .seg,
  .rank-toolbar .btn {
    width: auto;
  }
  .rank-toolbar select { flex: 1 1 140px; min-width: 0; }
  .rank-toolbar .seg { flex: 1 1 220px; min-width: 0; }
  .rank-toolbar .btn { flex: 0 0 auto; }
  .rank-item { gap: 8px; padding: 10px 12px; }
  .rank-count { padding-top: 2px; }
  .feat-group-main { min-width: 0; }
  .feat-minis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-list-head .seg {
    flex: 1 1 100%;
    min-width: 0;
  }
  .card-list-head .seg-btn { flex: 1; min-width: 0; }
  .card-code { min-height: 44px; }
  #card-duration-chips .chip { width: auto; }
  .fb-table,
  .stack-table {
    overflow: visible;
  }
  .fb-table table,
  .stack-table table,
  .fb-table thead,
  .stack-table thead,
  .fb-table tbody,
  .stack-table tbody,
  .fb-table th,
  .stack-table th,
  .fb-table td,
  .stack-table td,
  .fb-table tr,
  .stack-table tr {
    display: block;
    width: 100%;
  }
  .fb-table thead,
  .stack-table thead { display: none; }
  .fb-table tbody,
  .stack-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .fb-table tr,
  .stack-table tr {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-2);
    box-sizing: border-box;
  }
  .fb-table td,
  .stack-table td {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 8px 0;
    border: none;
    white-space: normal;
  }
  .fb-table td::before,
  .stack-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
  }
  .fb-table td:not([data-label])::before,
  .stack-table td:not([data-label])::before { content: none; }
  .fb-table td.empty,
  .stack-table td.empty { text-align: center; padding: 16px 0; }
  .fb-table tr:has(td.empty),
  .stack-table tr:has(td.empty) {
    border: none;
    background: transparent;
    padding: 0;
  }
  .fb-table td.fb-cell-enabled,
  .stack-table td.fb-cell-enabled {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .fb-table td.actions,
  .stack-table td.actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    white-space: normal;
  }
  .fb-table input,
  .stack-table input,
  .fb-table select,
  .stack-table select {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
  .trigger-log .trigger-time { white-space: normal; }
  .trigger-log .trigger-hit { max-width: none; }
  .trigger-log td.trigger-action {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .trigger-log .cell-title,
  .trigger-log .cell-sub {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
}

@media (max-width: 560px) {
  .stat-value { font-size: 20px; }
  .login-card { width: min(340px, calc(100vw - 24px)); padding: 28px 20px; }
  .tab { padding: 10px; }
  .panel { padding: 12px; }
  .topbar-right .live-tag { display: none; }
  .log-line { flex-wrap: wrap; gap: 4px 8px; }
  .log-logger { min-width: 0; }
  .log-level { width: auto; }
  .chat-head { padding: 10px 12px; min-height: 56px; }
  .audit-grid { grid-template-columns: 1fr; }
}

html.theme-glass {
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .72), 0 10px 36px rgba(40, 70, 130, .12);
  --glass-fill: color-mix(in srgb, var(--panel) 56%, transparent);
  --glass-fill-2: color-mix(in srgb, var(--panel-2) 48%, transparent);
  --glass-stroke: color-mix(in srgb, #ffffff 68%, var(--border));
}
html.theme-glass body,
html.theme-glass .login-view {
  background-color: var(--bg);
  background-image:
    radial-gradient(980px 560px at 8% -12%, rgba(120, 176, 255, .48), transparent 58%),
    radial-gradient(760px 500px at 98% 0%, rgba(186, 150, 255, .34), transparent 52%),
    radial-gradient(680px 420px at 72% 110%, rgba(72, 214, 206, .30), transparent 56%),
    linear-gradient(180deg, rgba(255, 255, 255, .38), transparent 42%);
  background-attachment: fixed;
}
html.theme-glass .content,
html.theme-glass .tab,
html.theme-glass .chat-shell,
html.theme-glass .chat-main {
  background: transparent;
}
html.theme-glass .sidebar,
html.theme-glass .topbar,
html.theme-glass .panel,
html.theme-glass .content-head,
html.theme-glass .stat-card,
html.theme-glass .login-card,
html.theme-glass .confirm-card,
html.theme-glass .nav-group,
html.theme-glass .chat-list,
html.theme-glass .chat-head,
html.theme-glass .chat-bubble,
html.theme-glass .chat-composer,
html.theme-glass .tile,
html.theme-glass .theme-card,
html.theme-glass .feat-card,
html.theme-glass .rank-item,
html.theme-glass .cmd-section {
  background: var(--glass-fill);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  border-color: var(--glass-stroke);
  box-shadow: var(--shadow);
}
html.theme-glass .chat-list,
html.theme-glass .nav-group,
html.theme-glass .theme-card,
html.theme-glass .btn.ghost {
  background: var(--glass-fill-2);
}
html.theme-glass input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="hidden"]),
html.theme-glass select,
html.theme-glass textarea {
  background: color-mix(in srgb, var(--panel) 74%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
html.theme-glass .pick-btn,
html.theme-glass .pick-menu {
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-color: var(--glass-stroke);
}
html.theme-glass .table th,
html.theme-glass .table tbody tr:hover {
  background: color-mix(in srgb, var(--panel-2) 55%, transparent);
}

/* 宣纸控制台视觉层 */
html { color-scheme: light; }
body {
  background-image:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 0);
  background-size: 22px 22px;
}
button, .chip, .seg-btn, .tool-btn, .nav-btn, .pick-btn, .tile.clickable, .stat-card.selectable {
  cursor: pointer;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.nav-btn:focus-visible,
.chip:focus-visible,
.seg-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.login-stage {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 28px;
  align-items: stretch;
}
.login-brand {
  padding: 36px 8px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.login-brand h1 {
  font-size: clamp(36px, 6vw, 56px);
  letter-spacing: -.05em;
  line-height: 1.05;
}
.login-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.login-card .btn { width: 100%; min-height: 44px; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  flex-shrink: 0;
  letter-spacing: 0;
}
.login-brand .brand-mark {
  width: 56px;
  height: 56px;
  font-size: 26px;
  border-radius: 16px;
}
.brand-copy {
  display: flex;
  flex-direction: column;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.15;
}
.brand-copy em {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--panel) 62%, transparent);
}
.page-heading { min-width: 0; }
.page-kicker {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.tab { padding: 8px 28px 32px; }
.hub-subnav {
  padding: 0 28px 12px;
}
.hub-subnav .seg {
  width: min(100%, 720px);
  min-width: 0;
}
.tab-fill { padding: 0; }
.stat-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 18px 18px 16px 20px;
}
.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
}
.stat-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.stat-value { font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.panel { border-radius: 16px; }
.panel-head h3 { font-size: 16px; letter-spacing: -.02em; }
.btn {
  min-height: 40px;
  border-radius: 10px;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.btn.primary { box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 28%, transparent); }
.btn.primary:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--success);
}
.live-tag::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 50%, transparent);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.chat-shell { border-top: 0; }
.chat-list { background: color-mix(in srgb, var(--panel) 88%, var(--panel-2)); }
.chat-item { border-bottom-color: color-mix(in srgb, var(--border) 70%, transparent); }
.chat-bubble { border-radius: 16px 16px 16px 6px; }
.confirm-mask {
  background: color-mix(in srgb, var(--text) 46%, transparent);
  backdrop-filter: blur(8px);
}
.confirm-card { border-radius: 18px; box-shadow: var(--shadow); }
.table th { background: color-mix(in srgb, var(--panel-2) 70%, var(--panel)); }
.switch span { background: color-mix(in srgb, var(--muted) 38%, var(--panel-2)); }
html.theme-glass .sidebar,
html.theme-glass .nav-group {
  background: color-mix(in srgb, var(--panel) 42%, transparent);
  color: var(--text);
}
html.theme-glass .brand-copy em,
html.theme-glass .nav-group-toggle,
html.theme-glass .nav-btn {
  color: var(--text);
}
html.theme-glass .nav-btn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
html.theme-glass .nav-btn.active { background: var(--accent); color: #fff; }
@media (max-width: 860px) {
  .login-stage { grid-template-columns: 1fr; gap: 18px; }
  .login-brand { padding: 8px 4px 0; }
  .login-brand h1 { font-size: 36px; }
  .tab { padding: 12px; }
  .sidebar { background: var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

.appeal-body {
  min-height: 100vh;
  background: var(--bg);
}
.appeal-body.appeal-fx-on { overflow: hidden; }
.appeal-fx {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #02110f;
  color: #9fffea;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity .28s ease;
}
.appeal-fx[hidden] { display: none !important; }
.appeal-fx.is-out { opacity: 0; }
.appeal-fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.appeal-fx-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(45, 212, 191, .12), transparent 48%),
    linear-gradient(180deg, rgba(2, 17, 15, .28), rgba(2, 17, 15, .62)),
    repeating-linear-gradient(90deg, rgba(45, 212, 191, .05) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(0deg, rgba(45, 212, 191, .04) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(
      180deg,
      transparent 0 2px,
      rgba(0, 0, 0, .18) 2px 3px
    );
}
 .appeal-fx-hud {
   position: relative;
   z-index: 1;
    width: min(1080px, 94vw);
    height: min(640px, 88vh);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid rgba(94, 234, 212, .28);
    overflow: hidden;
    background: rgba(2, 18, 16, .42);
   box-shadow:
     0 0 0 1px rgba(15, 118, 110, .18) inset,
     0 0 40px rgba(45, 212, 191, .12);
 }
 .appeal-fx-hud::before,
 .appeal-fx-hud::after {
   content: "";
   position: absolute;
   width: 18px;
   height: 18px;
   border: 2px solid #5eead4;
 }
 .appeal-fx-hud::before {
   top: -1px;
   left: -1px;
   border-right: 0;
   border-bottom: 0;
 }
 .appeal-fx-hud::after {
   right: -1px;
   bottom: -1px;
   border-left: 0;
   border-top: 0;
 }
 .appeal-fx-top,
 .appeal-fx-foot {
   display: flex;
   justify-content: space-between;
   gap: 12px;
   font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    letter-spacing: .08em;
    color: #5eead4;
 }
 .appeal-fx-main {
   flex: 1;
   min-height: 0;
    display: grid;
    grid-template-columns: 1.35fr 0.9fr;
    gap: 14px;
 }
 .appeal-fx-panel {
   min-height: 0;
   min-width: 0;
   padding: 12px 12px 10px;
   border: 1px solid rgba(94, 234, 212, .22);
   background: rgba(1, 12, 11, .55);
 }
 .appeal-fx-panel-h {
   margin: 0 0 8px;
   font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    letter-spacing: .12em;
    color: #99f6e4;
 }
 .appeal-fx-hero {
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   text-align: center;
   padding: 12px;
   border: 1px solid rgba(236, 255, 251, .18);
    min-width: 0;
    overflow: hidden;
   background:
     radial-gradient(ellipse at 50% 30%, rgba(45, 212, 191, .16), transparent 62%),
     rgba(1, 12, 11, .35);
 }
 .appeal-fx-brand {
   font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
   letter-spacing: .28em;
   font-size: 12px;
   color: #5eead4;
   text-transform: none;
   margin-bottom: 10px;
 }
 .appeal-fx-title {
   position: relative;
   font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
   font-size: clamp(28px, 5vw, 44px);
   letter-spacing: .12em;
   color: #ecfffb;
   text-shadow: 0 0 18px rgba(45, 212, 191, .55);
   margin: 0 0 10px;
    max-width: 100%;
 }
 .appeal-fx-title::before,
 .appeal-fx-title::after {
   content: attr(data-text);
   position: absolute;
   inset: 0;
   pointer-events: none;
 }
 .appeal-fx-title::before {
   color: #67e8f9;
   transform: translate(-2px, 0);
   clip-path: inset(0 0 55% 0);
   opacity: .7;
 }
 .appeal-fx-title::after {
   color: #fda4af;
   transform: translate(2px, 0);
   clip-path: inset(50% 0 0 0);
   opacity: .55;
 }
 .appeal-fx-sub {
   margin: 0 0 18px;
   font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
   font-size: 11px;
   letter-spacing: .18em;
   color: #99f6e4;
 }
 .appeal-fx-bar {
   width: min(280px, 80%);
   height: 6px;
   border: 1px solid rgba(94, 234, 212, .5);
   background: rgba(15, 118, 110, .25);
   overflow: hidden;
 }
 .appeal-fx-bar i {
   display: block;
   width: 0;
   height: 100%;
   background: linear-gradient(90deg, #0f766e, #5eead4, #ecfffb);
    box-shadow: 0 0 12px rgba(94, 234, 212, .7);
    transition: width 2.4s linear;
  }
  .appeal-fx-stage {
    margin: 10px 0 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    letter-spacing: .14em;
    color: #ccfbf1;
    min-height: 1.4em;
  }
  .appeal-fx-stage::after {
    content: "_";
    margin-left: 4px;
    animation: appeal-fx-blink .8s step-end infinite;
  }
  @keyframes appeal-fx-blink {
    50% { opacity: 0; }
  }
  .appeal-fx-gate {
    width: 100%;
    max-width: 240px;
    margin-top: 12px;
    display: grid;
    gap: 8px;
    min-width: 0;
  }
  .appeal-fx-gate[hidden] { display: none !important; }
  .appeal-fx-gate input {
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(94, 234, 212, .5);
    border-radius: 0;
    background: rgba(1, 12, 11, .72);
    color: #ecfffb;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 16px;
    letter-spacing: .14em;
    text-align: center;
    box-shadow: none;
    max-width: 100%;
  }
  .appeal-fx-gate input:focus {
    outline: 0;
    border-color: #5eead4;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, .2);
  }
  .appeal-fx-gate button {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #5eead4;
    border-radius: 0;
    background: rgba(15, 118, 110, .35);
    color: #ecfffb;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    letter-spacing: .18em;
    cursor: pointer;
    max-width: 100%;
  }
  .appeal-fx-gate button:hover {
    background: rgba(45, 212, 191, .28);
  }
  .appeal-fx-gate button:disabled {
    opacity: .55;
    cursor: default;
  }
  .appeal-fx-gate-err {
    min-height: 1.3em;
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: #fda4af;
  }
  .appeal-fx-hud.is-gate .appeal-fx-bar,
  .appeal-fx-hud.is-gate .appeal-fx-sub {
    display: none;
  }
  .appeal-fx-hud.is-gate .appeal-fx-title {
    font-size: clamp(22px, 4.2vw, 32px);
    margin-bottom: 6px;
  }
  .appeal-fx-hud.is-gate .appeal-fx-brand {
    margin-bottom: 6px;
  }
  .appeal-fx-hud.is-gate .appeal-fx-stage {
    margin-top: 6px;
  }
  .appeal-fx-log {
   font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
   font-size: 12px;
   line-height: 1.65;
   color: #5eead4;
   min-height: 0;
    height: calc(100% - 24px);
    margin: 0;
    overflow: hidden auto;
    scrollbar-width: none;
    text-align: left;
    white-space: pre-wrap;
  }
  .appeal-fx-log::-webkit-scrollbar { display: none; }
 .appeal-fx-stats {
   list-style: none;
   margin: 0;
   padding: 0;
   display: grid;
   gap: 10px;
   font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
   font-size: 12px;
   color: #99f6e4;
 }
 .appeal-fx-stats li {
   display: flex;
   justify-content: space-between;
   gap: 8px;
   border-bottom: 1px dashed rgba(94, 234, 212, .2);
   padding-bottom: 8px;
 }
 .appeal-fx-stats b {
   color: #ecfffb;
   font-weight: 650;
 }
 .appeal-fx-hex {
   margin: 0;
   width: 100%;
   overflow: hidden;
   white-space: nowrap;
   font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
   font-size: 11px;
   letter-spacing: .08em;
   color: #2dd4bf;
   opacity: .85;
 }
  @media (max-width: 760px) {
    .appeal-fx-hud { height: min(720px, 92vh); }
    .appeal-fx-main {
      grid-template-columns: 1fr;
      grid-template-rows: auto 1fr auto;
    }
    .appeal-fx-hero { min-height: 180px; }
    .appeal-fx-log { height: 9.2em; }
    .appeal-fx-hud.is-gate .appeal-fx-panel { display: none; }
    .appeal-fx-hud.is-gate .appeal-fx-main {
      grid-template-columns: 1fr;
      grid-template-rows: 1fr;
    }
    .appeal-fx-hud.is-gate .appeal-fx-hero { min-height: 0; }
  }
 .appeal-shell {
  max-width: 520px;
  margin: 48px auto;
  padding: 28px 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.appeal-shell h1 { font-size: 26px; margin: 8px 0 12px; }
.appeal-form { display: grid; gap: 14px; margin-top: 16px; }
.appeal-form textarea {
  width: 100%;
  margin-top: 6px;
  min-height: 140px;
  resize: vertical;
}
.appeal-upload {
  position: relative;
  display: block;
  cursor: pointer;
}
.appeal-upload-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 132px;
  padding: 20px 16px;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel-2) 70%, var(--panel));
  text-align: center;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.appeal-upload:hover .appeal-upload-copy,
.appeal-upload:focus-within .appeal-upload-copy,
.appeal-upload.has-files .appeal-upload-copy {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.appeal-upload:focus-within .appeal-upload-copy {
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.appeal-upload-icon { color: var(--accent); }
.appeal-upload-copy strong {
  font-size: 15px;
  font-weight: 650;
}
.appeal-upload-copy em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.appeal-upload-names {
  display: block;
  max-width: 100%;
  font-size: 13px;
  color: var(--accent);
  word-break: break-all;
}
.appeal-upload-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.appeal-upload-input:focus {
  border: 0;
  box-shadow: none;
}
.appeal-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.appeal-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
