:root {
  --bg: #101516;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-hover: rgba(255, 255, 255, 0.085);
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.24);
  --text: #f0f0eb;
  --muted: #a6adae;
  --dim: #7f898b;
  --gold: #e4b863;
  --gold-light: #f3dca8;
  --danger: #f0b1a6;
  --radius: 8px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  letter-spacing: 0;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(12, 17, 18, 0.93), rgba(12, 17, 18, 0.96)),
    url("/static/assets/glass.jpg") center/cover fixed;
}
button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
button {
  border: 0;
}
svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke-width: 1.7;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.4;
}
h2 {
  font-size: 16px;
  font-weight: 600;
}
h3 {
  font-size: 14px;
  font-weight: 600;
}
small {
  font-size: 12px;
}
p {
  line-height: 1.7;
}
.muted {
  color: var(--muted);
}
.dim {
  color: var(--dim);
}
.gold {
  color: var(--gold);
}
.mono {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.app-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 30px 16px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(40px) saturate(180%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.13),
    inset 0 -1px rgba(0, 0, 0, 0.3);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 36px;
  font-size: 18px;
  font-weight: 600;
}
.brand b {
  font-weight: 400;
  color: var(--muted);
}
.brand small {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  letter-spacing: 0;
  color: var(--dim);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 40px;
  border: 1px solid rgba(228, 184, 99, 0.45);
  border-radius: 8px;
  background: rgba(228, 184, 99, 0.09);
  color: var(--gold);
  box-shadow: inset 0 1px rgba(243, 220, 168, 0.25);
}
.brand-mark svg {
  width: 23px;
  height: 23px;
}
.nav-label {
  padding: 0 15px 12px;
  font-size: 10px;
  letter-spacing: 0;
  color: var(--dim);
}
nav {
  display: grid;
  gap: 5px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 11px 14px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 6px;
  transition:
    background 0.5s var(--ease),
    color 0.5s var(--ease);
}
.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}
.nav-link.active {
  background: rgba(228, 184, 99, 0.09);
  border-color: rgba(228, 184, 99, 0.16);
  color: var(--gold-light);
}
.nav-link span {
  flex: 1;
}
.nav-link .badge-count {
  flex: none;
  font-size: 10px;
  padding: 1px 5px;
  border: 1px solid rgba(228, 184, 99, 0.25);
  border-radius: 4px;
  color: var(--gold);
}
.nav-divider {
  height: 1px;
  background: var(--line);
  margin: 16px 12px;
}
.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 25px 9px 0;
  font-size: 11px;
  color: var(--muted);
}
.sidebar-bottom small {
  display: block;
  font-size: 9px;
  color: var(--dim);
  margin-top: 5px;
}
.version {
  margin-left: auto;
  color: var(--dim);
  font-size: 10px;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(228, 184, 99, 0.07);
}
.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 76px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  background: rgba(255, 255, 255, 0.02);
  gap: 15px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  white-space: nowrap;
}
.breadcrumb > span {
  color: var(--dim);
}
.breadcrumb strong {
  font-weight: 400;
}
.breadcrumb svg {
  width: 12px;
  color: var(--dim);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.topbar select {
  min-height: 34px;
  padding: 6px 28px 6px 10px;
  max-width: 190px;
  font-size: 12px;
  background-color: rgba(255, 255, 255, 0.04);
}
.connection {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
main {
  padding: 32px 36px 40px;
  flex: 1;
  min-width: 0;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.page-header .eyebrow {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0;
  margin-bottom: 8px;
}
.page-header .subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.page-actions,
.actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 37px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    inset 0 -1px rgba(0, 0, 0, 0.3);
  transition:
    background 0.5s var(--ease),
    border-color 0.5s var(--ease),
    transform 0.5s var(--ease);
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
}
.button:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  transform: translateY(-1px);
}
.button:active {
  transform: scale(0.98);
}
.button.primary {
  color: var(--gold-light);
  border-color: rgba(228, 184, 99, 0.4);
  background: rgba(228, 184, 99, 0.14);
  box-shadow:
    inset 0 1px rgba(243, 220, 168, 0.19),
    inset 0 -1px rgba(0, 0, 0, 0.2);
}
.button.primary:hover {
  background: rgba(228, 184, 99, 0.21);
}
.button.ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--muted);
}
.button.danger {
  color: var(--danger);
}
.button.small {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 11px;
}
.icon-button {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 5px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  transition:
    background 0.5s var(--ease),
    color 0.5s var(--ease);
}
.icon-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: var(--line);
}
.icon-button svg {
  width: 16px;
  height: 16px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 5px 0 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  gap: 24px;
}
.stat {
  border-right: 1px solid var(--line);
  padding-right: 22px;
  min-width: 0;
}
.stat:last-child {
  border-right: 0;
}
.stat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}
.stat-label svg {
  width: 16px;
  height: 16px;
  color: var(--dim);
}
.stat-value {
  font-size: 34px;
  line-height: 1.3;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin: 12px 0 6px;
}
.stat-meta {
  color: var(--dim);
  font-size: 11px;
}
.stat:first-child .stat-value {
  color: var(--gold-light);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 28px;
}
.side-column {
  border-left: 1px solid var(--line);
  padding-left: 26px;
  min-width: 0;
}
.section {
  margin-bottom: 30px;
  min-width: 0;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  min-height: 30px;
}
.section-heading .caption {
  font-size: 11px;
  color: var(--dim);
  margin-top: 5px;
}
.section-heading h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-heading h2 svg {
  width: 16px;
  color: var(--gold);
}
.section-heading a {
  font-size: 11px;
  color: var(--muted);
}
.section-heading a:hover {
  color: var(--gold-light);
}
.table-wrap {
  width: 100%;
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 12px;
}
th {
  color: var(--dim);
  font-size: 10px;
  font-weight: 400;
  white-space: nowrap;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}
td {
  padding: 16px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  vertical-align: middle;
  max-width: 350px;
  overflow-wrap: anywhere;
}
td:first-child,
th:first-child {
  padding-left: 0;
}
td:last-child,
th:last-child {
  padding-right: 0;
}
.row-title {
  font-weight: 500;
  line-height: 1.6;
}
.row-sub {
  margin-top: 5px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.5;
}
.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.state.gold {
  color: var(--gold-light);
  border-color: rgba(228, 184, 99, 0.25);
  background: rgba(228, 184, 99, 0.06);
}
.state.error {
  color: var(--danger);
  border-color: rgba(240, 177, 166, 0.23);
}
.state i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}
.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  gap: 13px;
  min-height: 192px;
  padding: 28px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.empty > svg {
  width: 28px;
  height: 28px;
  stroke-width: 1;
  color: var(--dim);
}
.empty p {
  max-width: 400px;
  overflow-wrap: anywhere;
}
.empty .button {
  margin-top: 3px;
}
.pending-item {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.pending-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 10px;
  color: var(--dim);
}
.pending-item h3 {
  font-size: 12px;
  line-height: 1.7;
  margin: 9px 0 7px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.pending-item p {
  font-size: 11px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pending-item .actions {
  margin-top: 12px;
}
.chart {
  height: 90px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 8px 0 0;
  margin-top: 18px;
}
.chart-column {
  flex: 1;
  min-width: 0;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}
.chart-bar {
  width: 100%;
  max-width: 20px;
  min-height: 2px;
  background: rgba(228, 184, 99, 0.4);
  border-top: 1px solid var(--gold);
  border-radius: 2px 2px 0 0;
}
.chart-column span {
  display: block;
  font-size: 9px;
  color: var(--dim);
  margin-top: 8px;
}
.activity {
  display: flex;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.activity > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  flex-shrink: 0;
}
.activity h3 {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.6;
}
.activity p {
  font-size: 10px;
  color: var(--dim);
  margin-top: 4px;
}
.activity-body {
  min-width: 0;
}
.activity-body h3 {
  overflow-wrap: anywhere;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition:
    background 0.5s var(--ease),
    border-color 0.5s var(--ease);
}
.quick-action:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}
.quick-action > svg {
  color: var(--gold);
  width: 18px;
}
.quick-action b {
  font-weight: 400;
  font-size: 12px;
}
.quick-action small {
  display: block;
  font-size: 10px;
  color: var(--dim);
  margin-top: 5px;
}
.quick-action .arrow {
  color: var(--dim);
  margin-left: auto;
  width: 13px;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 20px;
  flex-wrap: wrap;
}
.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  max-width: 100%;
  flex-wrap: wrap;
}
.segment {
  padding: 7px 12px;
  background: transparent;
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  min-height: 30px;
}
.segment.active {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.1);
}
.search {
  position: relative;
  min-width: 180px;
  max-width: 300px;
  flex: 1;
}
.search svg {
  position: absolute;
  left: 11px;
  top: 11px;
  width: 15px;
  height: 15px;
  color: var(--dim);
}
.search input {
  padding-left: 35px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}
.field.full {
  grid-column: 1/-1;
}
.field-label {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.field-label small {
  font-size: 10px;
  color: var(--dim);
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  min-height: 40px;
  padding: 10px 12px;
  outline: none;
  transition:
    border-color 0.5s var(--ease),
    background 0.5s var(--ease);
  font-size: 12px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(228, 184, 99, 0.5);
  box-shadow: 0 0 0 2px rgba(228, 184, 99, 0.08);
  background: rgba(255, 255, 255, 0.07);
}
input::placeholder,
textarea::placeholder {
  color: var(--dim);
}
textarea {
  resize: vertical;
  line-height: 1.8;
  min-height: 108px;
}
select {
  padding-right: 26px;
}
option {
  background: #202827;
  color: var(--text);
}
input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  accent-color: var(--gold);
  flex-shrink: 0;
  padding: 0;
}
input[type="number"] {
  font-variant-numeric: tabular-nums;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.switch {
  position: relative;
  width: 31px;
  height: 18px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--line);
  border-radius: 10px;
  flex-shrink: 0;
  padding: 0;
}
.switch:after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dim);
  transition: transform 0.5s var(--ease);
}
.switch.on {
  background: rgba(228, 184, 99, 0.15);
  border-color: rgba(228, 184, 99, 0.4);
}
.switch.on:after {
  transform: translateX(13px);
  background: var(--gold);
}
.inline-control {
  display: flex;
  gap: 10px;
  align-items: center;
}
.inline-control input {
  flex: 1;
}
.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 30px;
}
.editor {
  min-width: 0;
}
.editor .field {
  margin-bottom: 20px;
}
.editor-title {
  font-size: 20px;
  min-height: 58px;
  padding: 12px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.editor-body {
  min-height: 360px;
  border: 0;
  background: transparent;
  padding: 16px 0;
  font-size: 14px;
  line-height: 2;
  border-radius: 0;
}
.editor-body:focus,
.editor-title:focus {
  background: transparent;
  box-shadow: none;
  border-color: var(--line-strong);
}
.editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.editor-counter {
  font-size: 11px;
  color: var(--dim);
}
.settings-column {
  border-left: 1px solid var(--line);
  padding-left: 26px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.settings-column > .field {
  gap: 10px;
}
.settings-column h3 {
  font-size: 12px;
  margin-bottom: 12px;
}
.ai-panel {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.ai-panel .button {
  width: 100%;
  margin-top: 12px;
}
.images {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.image-item {
  position: relative;
  width: 80px;
  height: 80px;
  flex: none;
}
.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.image-item button {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.7);
  width: 23px;
  height: 23px;
  color: white;
}
.file-label {
  position: relative;
  overflow: hidden;
}
.file-label input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}
.history-image {
  width: 120px;
  height: 100px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.item-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(40px) saturate(180%);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.13),
    inset 0 1px rgba(255, 255, 255, 0.13),
    inset 0 -1px rgba(0, 0, 0, 0.25);
  padding: 20px;
  min-width: 0;
}
.item-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}
.account-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--gold);
  flex-shrink: 0;
  object-fit: cover;
}
.account-info h3 {
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.account-info .row-sub {
  font-size: 11px;
}
.card-details {
  display: grid;
  gap: 12px;
  margin: 16px 0 22px;
  font-size: 11px;
}
.detail-pair {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  line-height: 1.6;
}
.detail-pair > span:first-child {
  color: var(--dim);
}
.detail-pair > span:last-child {
  text-align: right;
  overflow-wrap: anywhere;
  min-width: 0;
}
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.account-note {
  font-size: 11px;
  color: var(--muted);
  padding-top: 22px;
  line-height: 1.8;
}
.source-list {
  display: grid;
  gap: 0;
}
.source-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.source-symbol {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--gold);
  flex-shrink: 0;
}
.source-content {
  flex: 1;
  min-width: 0;
}
.source-content h3 {
  line-height: 1.6;
  margin-bottom: 6px;
}
.source-content p {
  font-size: 11px;
  color: var(--dim);
  overflow-wrap: anywhere;
}
.source-preview {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.topic-chip {
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10px;
  color: var(--muted);
  text-align: left;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.topic-chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
}
.source-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
}
.inbox-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 26px;
}
.post-list {
  border-right: 1px solid var(--line);
  padding-right: 22px;
  min-width: 0;
}
.post-option {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  padding: 15px 12px;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 2px solid transparent;
  min-height: 75px;
}
.post-option.active {
  background: rgba(228, 184, 99, 0.05);
  border-left-color: var(--gold);
  color: var(--text);
}
.post-option b {
  display: block;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.post-option small {
  display: block;
  margin-top: 7px;
  font-size: 10px;
  color: var(--dim);
}
.comment-item {
  display: flex;
  gap: 13px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.comment-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 31px;
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--dim);
  font-size: 11px;
}
.comment-content {
  flex: 1;
  min-width: 0;
}
.comment-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}
.comment-top small {
  font-size: 10px;
  color: var(--dim);
}
.comment-body {
  font-size: 13px;
  line-height: 1.9;
  margin: 9px 0 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.comment-item.child {
  margin-left: 28px;
}
.comment-content .actions {
  justify-content: flex-end;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
  color: var(--dim);
  font-size: 11px;
}
.workspace-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px 36px;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0;
}
.workspace-footer span:last-child {
  letter-spacing: 0;
}
.loading-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 340px;
  color: var(--muted);
  font-size: 12px;
}
.spin {
  animation: spin 1.5s linear infinite;
}
.button[aria-busy="true"],
.icon-button[aria-busy="true"] {
  position: relative;
  opacity: 1;
  cursor: wait;
  transform: none;
}
.busy-label {
  display: contents;
  visibility: hidden;
}
.busy-spinner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.busy-spinner svg {
  width: 20px;
  height: 20px;
}
.post-target {
  padding-bottom: 18px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.target-heading,
.picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.post-preview {
  min-width: 0;
}
.post-preview h3 {
  margin: 12px 0;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: var(--dim);
  font-size: 11px;
}
.post-meta a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.post-meta svg {
  width: 12px;
  height: 12px;
}
.post-preview-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.9;
  margin-bottom: 14px;
}
.post-preview.compact .post-preview-text {
  max-height: 145px;
  overflow: auto;
}
.post-preview-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.post-preview-images a {
  display: block;
  height: 110px;
  min-width: 0;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.post-preview-images img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.post-tags {
  font-size: 12px;
  color: var(--gold-light);
  margin: 10px 0;
  overflow-wrap: anywhere;
}
.post-loading {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}
.post-loading svg {
  width: 18px;
  height: 18px;
}
.post-picker-modal {
  width: min(1040px, calc(100vw - 28px));
}
.picker-lookup {
  display: flex;
  gap: 8px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.picker-lookup input {
  min-width: 0;
  flex: 1;
}
.post-picker-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  min-height: 360px;
}
.picker-list-pane {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding-right: 22px;
}
#picker-post-list {
  max-height: 410px;
  overflow: auto;
}
.picker-post {
  display: flex;
  align-items: flex-start;
  text-align: left;
  gap: 10px;
  width: 100%;
  padding: 14px 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text);
}
.picker-post:hover,
.picker-post.active {
  background: var(--surface-hover);
  border-left-color: var(--gold);
}
.picker-post > span {
  flex: 1;
  min-width: 0;
}
.picker-post b {
  display: block;
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.picker-excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
  margin: 5px 0;
}
.picker-post small {
  display: block;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.7;
}
.picker-post img {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 4px;
}
#picker-detail {
  max-height: 470px;
  overflow: auto;
  min-width: 0;
}
#picker-detail > .button {
  margin-top: 18px;
}
.ai-context-state {
  margin-bottom: 15px;
}
.model-picker {
  display: flex;
  gap: 8px;
  align-items: center;
}
.model-picker input,
.model-picker select {
  flex: 1;
  min-width: 0;
  width: 0;
}
.model-picker .button {
  flex: none;
}
@media (max-width: 700px) {
  .model-picker {
    flex-wrap: wrap;
  }
  .model-picker input,
  .model-picker select {
    flex: 1 1 180px;
    width: auto;
  }
  .model-picker .button {
    width: 100%;
    justify-content: center;
  }
  .post-picker-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    min-height: 0;
  }
  .picker-list-pane {
    border-right: 0;
    padding-right: 0;
  }
  #picker-post-list {
    max-height: 200px;
  }
  #picker-detail {
    max-height: none;
  }
  .picker-toolbar {
    gap: 4px;
  }
  .picker-toolbar .segment {
    padding: 8px;
    font-size: 11px;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(27, 33, 33, 0.92);
  color: var(--text);
  backdrop-filter: blur(60px) saturate(180%);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.5),
    inset 0 1px rgba(255, 255, 255, 0.17),
    inset 0 -1px rgba(0, 0, 0, 0.4);
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(7px);
}
.modal-header {
  padding: 23px 26px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.modal-header h2 {
  font-size: 17px;
}
.modal-body {
  padding: 24px 26px;
  max-height: calc(90vh - 150px);
  overflow: auto;
}
.modal-footer {
  padding: 16px 26px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}
.modal-section-title {
  font-size: 11px;
  color: var(--gold);
  margin: 20px 0 15px;
  grid-column: 1/-1;
}
.notice {
  padding: 13px 15px;
  border: 1px solid rgba(228, 184, 99, 0.23);
  border-radius: 6px;
  background: rgba(228, 184, 99, 0.05);
  font-size: 11px;
  color: var(--gold-light);
  line-height: 1.9;
  overflow-wrap: anywhere;
}
.notice.error {
  color: var(--danger);
  border-color: rgba(240, 177, 166, 0.2);
  background: rgba(240, 177, 166, 0.04);
}
.qr {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 18px;
  text-align: center;
}
.qr img {
  width: 220px;
  height: 220px;
  border: 12px solid white;
  border-radius: 6px;
  background: white;
}
.qr h3 {
  font-size: 15px;
}
.qr p {
  font-size: 12px;
  color: var(--muted);
}
.history-detail {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 2;
  overflow-wrap: anywhere;
}
.history-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 20px;
}
.error-inline {
  font-size: 12px;
  color: var(--danger);
  line-height: 1.8;
  padding: 12px 0;
}
.password-wrap {
  position: relative;
}
.password-wrap input {
  padding-right: 42px;
}
.password-wrap button {
  position: absolute;
  right: 5px;
  top: 4px;
}
.api-code {
  font-family: Consolas, monospace;
  padding: 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mobile-only {
  display: none;
}
#toasts {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  display: grid;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
}
.toast {
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(30, 37, 36, 0.95);
  color: var(--text);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  font-size: 12px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.toast.error {
  color: var(--danger);
}
@media (min-width: 1600px) {
  main {
    padding: 36px 48px 48px;
  }
  .topbar {
    padding: 0 48px;
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 36px;
  }
  .stats {
    gap: 36px;
  }
  .side-column {
    padding-left: 32px;
  }
}
@media (max-width: 1150px) {
  .app-shell {
    grid-template-columns: 194px minmax(0, 1fr);
  }
  .sidebar {
    padding: 26px 12px 16px;
  }
  .brand {
    font-size: 16px;
    gap: 9px;
  }
  .brand small {
    font-size: 9px;
  }
  .brand-mark {
    width: 32px;
  }
  .topbar {
    padding: 0 24px;
  }
  main {
    padding: 26px 24px 36px;
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 20px;
  }
  .side-column {
    padding-left: 20px;
  }
  .quick-grid {
    grid-template-columns: 1fr;
  }
  .stats {
    gap: 18px;
  }
  .stat {
    padding-right: 14px;
  }
  .connection {
    display: none;
  }
  .workbench {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 22px;
  }
  .settings-column {
    padding-left: 20px;
  }
  .inbox-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }
}
@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .side-column {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 25px 0 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
  }
  .side-column .section:first-child {
    grid-column: 1/-1;
  }
  .quick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .quick-action {
    padding: 14px 10px;
    gap: 8px;
  }
  .workbench {
    grid-template-columns: 1fr;
  }
  .settings-column {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 25px 0 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .ai-panel {
    grid-column: 1/-1;
  }
  .inbox-layout {
    grid-template-columns: 1fr;
  }
  .post-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 20px;
    max-height: 260px;
    overflow: auto;
  }
  .topbar-actions {
    gap: 8px;
  }
  .breadcrumb {
    gap: 7px;
  }
  .source-row {
    flex-wrap: wrap;
  }
  .source-actions {
    margin-left: 56px;
  }
  .stat-value {
    font-size: 29px;
  }
}
@media (max-width: 700px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 224px;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.5s var(--ease),
      visibility 0.5s;
    background: rgba(26, 32, 32, 0.92);
  }
  body.menu-open .sidebar {
    opacity: 1;
    visibility: visible;
  }
  body.menu-open::after {
    content: "";
    position: fixed;
    inset: 0 0 0 224px;
    z-index: 40;
    background: rgba(0, 0, 0, 0.4);
  }
  .mobile-only {
    display: inline-grid;
  }
  .topbar {
    height: 64px;
    padding: 0 16px;
    gap: 8px;
  }
  .topbar .breadcrumb > span,
  .topbar .breadcrumb > svg {
    display: none;
  }
  .topbar-actions {
    margin-left: auto;
  }
  .topbar select {
    max-width: 142px;
    font-size: 11px;
  }
  .breadcrumb strong {
    font-size: 11px;
  }
  main {
    padding: 24px 18px 30px;
  }
  .page-header {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
  }
  h1 {
    font-size: 24px;
  }
  .page-actions .button {
    padding: 8px 10px;
    min-height: 34px;
    font-size: 11px;
  }
  .page-header .subtitle {
    line-height: 1.8;
    font-size: 11px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    padding-bottom: 24px;
  }
  .stat:nth-child(2) {
    border-right: 0;
  }
  .stat-label {
    font-size: 11px;
  }
  .stat-value {
    font-size: 30px;
  }
  .quick-grid {
    grid-template-columns: 1fr;
  }
  .quick-action {
    padding: 15px;
  }
  .side-column {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .side-column .section:first-child {
    grid-column: auto;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field.full,
  .modal-section-title {
    grid-column: auto;
  }
  .settings-column {
    grid-template-columns: 1fr;
  }
  .ai-panel {
    grid-column: auto;
  }
  .editor-body {
    min-height: 290px;
  }
  .cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .toolbar {
    gap: 12px;
  }
  .search {
    max-width: none;
    flex-basis: 100%;
  }
  .source-actions {
    margin-left: 0;
    flex-basis: 100%;
  }
  .source-symbol {
    width: 34px;
    height: 34px;
  }
  .source-row {
    gap: 12px;
  }
  .comment-item.child {
    margin-left: 15px;
  }
  .comment-top {
    flex-wrap: wrap;
    gap: 5px;
  }
  .workspace-footer {
    padding: 15px 18px;
    font-size: 8px;
  }
  .modal-header {
    padding: 18px 20px;
  }
  .modal-body {
    padding: 20px;
  }
  .modal-footer {
    padding: 14px 20px;
  }
  .editor-footer {
    flex-wrap: wrap;
  }
  .table-wrap table {
    min-width: 620px;
  }
  .page-header .eyebrow {
    font-size: 9px;
  }
  .source-content h3 {
    font-size: 13px;
  }
  .qr img {
    width: 200px;
    height: 200px;
  }
  #toasts {
    bottom: 16px;
    right: 16px;
  }
}
body.locked .sidebar,
body.locked .topbar,
body.locked .workspace-footer {
  display: none;
}
body.locked .workspace {
  margin-left: 0;
}
body.locked .app-shell {
  grid-template-columns: minmax(0, 1fr);
}
body.locked #main {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 22px;
}
.access-screen {
  width: 100%;
  max-width: 360px;
}
.access-screen .brand {
  margin-bottom: 58px;
}
.access-screen h1 {
  font-size: 26px;
  margin: 0 0 10px;
}
.access-screen form {
  margin-top: 30px;
}
.access-screen .button {
  width: 100%;
  margin-top: 10px;
}
[hidden] {
  display: none !important;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
