:root {
  --bg: #131722;
  --panel: #1f2531;
  --panel-2: #2a3241;
  --card: #fbf7ef;
  --ink: #f6f8fb;
  --dark-ink: #121a28;
  --muted: #aab4c3;
  --line: rgba(148, 163, 184, 0.18);
  --gold: #f3b84e;
  --gold-2: #ffd97d;
  --red: #df4d64;
  --red-2: #ff6a82;
  --teal: #159aa7;
  --green: #34c17a;
  --shadow: 0 18px 44px rgba(2, 6, 23, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(243, 184, 78, 0.2), transparent 38%),
    radial-gradient(circle at 90% 0%, rgba(21, 154, 167, 0.12), transparent 30%),
    linear-gradient(180deg, #1a2030 0%, #111624 72%);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background-color 0.16s ease,
    color 0.16s ease;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 28px;
  line-height: 1.22;
}

h3 {
  font-size: 18px;
}

.app-shell {
  width: min(430px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 18px 100px;
}

body[data-surface="admin"] {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-2: #eef3fb;
  --card: #ffffff;
  --ink: #0f172a;
  --dark-ink: #0f172a;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.22);
  --gold: #2563eb;
  --gold-2: #1d4ed8;
  --red: #dc2626;
  --red-2: #ef4444;
  --teal: #0f766e;
  --green: #16a34a;
  --shadow: 0 20px 42px rgba(15, 23, 42, 0.08);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(21, 128, 61, 0.08), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #eef3fb 100%);
  color: #17202a;
}

.admin-shell {
  width: 100%;
  min-height: 100vh;
  color: #17202a;
}

.admin-layout {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-login-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px;
}

.admin-login-layout .admin-main {
  width: min(520px, 100%);
  padding: 0;
}

.admin-shell .admin-login-card {
  padding: 32px;
}

.admin-shell .admin-login-card h1 {
  margin-top: 6px;
  color: #0f172a;
  font-size: 32px;
}

.admin-shell .admin-login-card .muted {
  margin-top: 10px;
}

.admin-shell .admin-login-card .actions {
  margin-top: 20px;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.98)),
    #0f172a;
  color: #f8fafc;
  border-right: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 12px 0 34px rgba(15, 23, 42, 0.08);
}

.admin-brand {
  padding: 10px 10px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.admin-brand strong {
  display: block;
  font-size: 20px;
  line-height: 1.2;
}

.admin-brand span {
  display: block;
  margin-top: 8px;
  color: #94a3b8;
  font-size: 13px;
}

.admin-nav {
  display: grid;
  gap: 8px;
}

.admin-nav button {
  width: 100%;
  padding: 12px 12px;
  border-radius: 8px;
  text-align: left;
  background: transparent;
  color: #cbd5e1;
}

.admin-nav button.active,
.admin-nav button:hover {
  background: linear-gradient(145deg, #2f6bf5, #1e40af);
  color: #fff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22);
}

.admin-nav span,
.admin-nav small {
  display: block;
}

.admin-nav span {
  font-weight: 800;
}

.admin-nav small {
  margin-top: 4px;
  color: inherit;
  opacity: 0.72;
}

.admin-sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.admin-main {
  min-width: 0;
  padding: 28px 32px 40px;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.admin-topbar h1 {
  margin-top: 4px;
  font-size: 30px;
  color: #0f172a;
}

.admin-topbar .eyebrow {
  color: #2563eb;
}

.admin-top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.admin-kpi,
.admin-shell .admin-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
}

.admin-kpi {
  padding: 18px;
}

.admin-kpi span,
.admin-kpi p,
.admin-shell .muted,
.admin-shell .small,
.admin-shell .switch-row p,
.admin-shell .preset-row p,
.admin-shell .rule-row {
  color: #64748b;
}

.admin-kpi strong {
  display: block;
  margin-top: 8px;
  color: #0f172a;
  font-size: 28px;
  line-height: 1;
}

.admin-kpi p {
  margin-top: 8px;
}

.admin-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.admin-section-grid.two-col {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.admin-section-grid + .admin-section-grid {
  margin-top: 16px;
}

.admin-shell .admin-card {
  margin-top: 0;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 252, 255, 0.98));
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

.admin-shell .wide-card {
  grid-column: 1 / -1;
}

.admin-shell .admin-card h3 {
  color: #0f172a;
  font-size: 16px;
}

.admin-shell .admin-card h3 + .muted,
.admin-shell .admin-card h3 + p {
  margin-top: 8px;
}

.admin-shell .switch-row,
.admin-shell .rule-row,
.admin-shell .preset-row {
  border-color: rgba(148, 163, 184, 0.22);
  background: #f8fbff;
}

.admin-shell .preset-row[data-preset-card] {
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.admin-shell .preset-row[data-preset-card]:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.08);
}

.admin-shell .model-probe-row {
  align-items: center;
  border-color: rgba(37, 99, 235, 0.22);
  background: #f4f8ff;
}

.admin-shell .model-probe-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-shell .model-probe-actions .mini-btn {
  min-width: 108px;
}

.admin-shell .model-probe-actions .mini-btn span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.72;
}

.admin-shell .rule-row.success {
  border-color: rgba(22, 163, 74, 0.22);
  background: #f0fdf4;
  color: #166534;
}

.admin-shell .rule-row.danger {
  border-color: rgba(220, 38, 38, 0.22);
  background: #fef2f2;
  color: #991b1b;
}

.admin-shell .switch-row strong,
.admin-shell .switch-row span,
.admin-shell .preset-row strong {
  color: #17202a;
}

.admin-shell .tag {
  border-color: rgba(37, 99, 235, 0.12);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.admin-shell .toggle {
  background: #cbd5e1;
}

.admin-shell .toggle.on {
  background: #16a34a;
}

.admin-shell .primary {
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: linear-gradient(145deg, #2f6bf5, #1d4ed8);
  color: #fff;
}

.admin-shell .secondary {
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: #fff;
  color: #1d4ed8;
}

.admin-shell .ghost {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
}

.admin-shell .mini-btn.strong {
  border-color: rgba(37, 99, 235, 0.16);
  background: linear-gradient(145deg, #2f6bf5, #1d4ed8);
  color: #fff;
}

.admin-shell .mini-btn.danger {
  border-color: rgba(220, 38, 38, 0.22);
  background: #fff;
  color: #b91c1c;
}

.admin-table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-shell .tenant-management-section {
  grid-column: 1 / -1;
  min-width: 0;
}

.admin-shell .tenant-management-header {
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 0 2px;
}

.admin-shell .tenant-management-header h3 {
  font-size: 18px;
}

.admin-shell .tenant-management-header .mini-btn {
  flex: 0 0 auto;
}

.admin-shell .tenant-card-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.admin-shell .tenant-management-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(520px, 1.4fr);
  gap: 18px;
  align-items: start;
}

.admin-shell .tenant-detail-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 16px;
  min-width: 0;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98)),
    #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.admin-shell .tenant-detail-panel.active {
  border: 2px solid #2563eb;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.98)),
    #fff;
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.1),
    0 22px 44px rgba(37, 99, 235, 0.14);
}

.admin-shell .tenant-detail-head {
  align-items: flex-start;
}

.admin-shell .tenant-detail-head h3 {
  margin-top: 6px;
}

.admin-shell .tenant-detail-summary,
.admin-shell .finance-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-shell .finance-category-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.admin-shell .finance-category-card span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.admin-shell .finance-category-card strong {
  display: block;
  margin: 6px 0 8px;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.admin-shell .finance-category-card p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.admin-field span {
  color: #334155;
  font-weight: 800;
}

.admin-field small {
  color: #64748b;
  line-height: 1.45;
}

.admin-shell .admin-field input,
.admin-shell .admin-field textarea,
.admin-shell .admin-field select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
}

.admin-shell .admin-field input:focus,
.admin-shell .admin-field textarea:focus,
.admin-shell .admin-field select:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.admin-shell .admin-field textarea {
  min-height: 132px;
}

.admin-shell .admin-field select[multiple] {
  min-height: 112px;
  padding: 8px;
}

.admin-shell .merchant-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.admin-shell .merchant-preset-composer {
  display: grid;
  gap: 8px;
  min-width: 0;
  align-content: start;
  padding: 12px 0;
  border-top: 1px solid #e2e8f0;
}

.admin-shell .merchant-preset-label {
  display: grid;
  gap: 4px;
}

.admin-shell .merchant-preset-label {
  color: #334155;
  font-weight: 800;
}

.admin-shell .merchant-preset-label small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.4;
}

.admin-shell .merchant-preset-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-shell .merchant-preset-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: 12px;
}

.admin-shell .merchant-preset-option:has(input:checked) {
  border-color: #197864;
  background: #e4f4ef;
  color: #176553;
}

.admin-shell .merchant-preset-option input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-height: 0;
  margin: 0;
  accent-color: #197864;
}

.admin-shell .merchant-preset-composer > textarea {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #1f2937;
  font: inherit;
  line-height: 1.6;
}

.admin-shell .source-run-summary {
  margin: 10px 0 0;
  color: #475569;
  overflow-wrap: anywhere;
  border-left: 3px solid #197864;
  padding-left: 12px;
}

.admin-shell .source-run-summary ul { max-height: 220px; overflow: auto; padding-left: 20px; }

.knowledge-editor {
  min-height: 100%;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.knowledge-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.knowledge-map .rule-row {
  margin: 0;
}

.admin-shell .knowledge-list-card {
  align-content: start;
}

.admin-shell .knowledge-list-rows {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.admin-shell .knowledge-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-shell .knowledge-row:hover {
  border-color: rgba(37, 99, 235, 0.24);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.06);
}

.admin-shell .knowledge-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-shell .knowledge-row-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-shell .import-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.36);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.98));
}

.admin-shell .import-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.admin-shell .import-panel-head span,
.admin-shell .import-tip {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.admin-shell .import-panel .actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-shell .knowledge-workspace { min-width: 0; color: #30343a; }
.admin-shell .knowledge-workspace .admin-card { background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 16px 0; }
.admin-shell .knowledge-workspace .wide-card { grid-column: auto; }
.admin-shell .knowledge-workspace .knowledge-editor { min-height: 0; border: 0; padding: 0; background: transparent; }
.admin-shell .knowledge-workspace .admin-field { min-width: 0; }
.admin-shell .knowledge-workspace .admin-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-shell .knowledge-workspace .import-panel .admin-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-shell .knowledge-workspace .knowledge-draft-detail { grid-template-columns: 1fr; }
.admin-shell .knowledge-workspace .knowledge-draft-detail p { font-size: 12px; line-height: 1.6; }
.admin-shell .candidate-list { min-width: 0; margin: 0; padding: 0; border: 0; }
.admin-shell .knowledge-draft-row .candidate-list { max-height: 600px; min-height: 0; overflow: auto; scrollbar-gutter: stable; overscroll-behavior: contain; }
.admin-shell .candidate-empty { padding: 36px 12px; color: #72767e; text-align: center; }
.admin-shell .knowledge-draft-metadata { padding: 10px 0; border-bottom: 1px solid #dfe1e5; min-width: 0; }
.admin-shell .knowledge-draft-metadata > summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.admin-shell .knowledge-draft-metadata .draft-category-pools { margin-top: 10px; }
.admin-shell .knowledge-workspace .knowledge-draft-row { padding: 18px 0; background: transparent; border-radius: 0; }
.admin-shell .knowledge-overview { margin-bottom: 16px; }
.admin-shell .knowledge-overview-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.admin-shell .knowledge-overview-head h2 { margin: 4px 0 8px; font-size: 22px; }
.admin-shell .knowledge-scope-summary { display: grid; gap: 6px; min-width: 220px; padding: 12px; border-left: 3px solid #2563eb; background: #eff6ff; color: #1e3a8a; }
.admin-shell .knowledge-scope-summary span { color: #475569; font-size: 12px; }
.admin-shell .knowledge-view-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 18px; border-bottom: 1px solid #dfe1e5; }
.admin-shell .knowledge-view-tab { min-height: 44px; padding: 11px 8px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: #525660; text-align: center; cursor: pointer; font-size: 14px; }
.admin-shell .knowledge-view-tab span { color: #64748b; font-size: 12px; }
.admin-shell .knowledge-view-tab.active { border-bottom-color: #197864; background: transparent; color: #176553; }
.admin-shell .knowledge-view { display: none; }
.admin-shell .knowledge-view.active { display: block; }
.admin-shell .knowledge-view > .admin-card, .admin-shell .knowledge-view .admin-card { margin-top: 0; }
.admin-shell .candidate-toolbar { display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1fr) minmax(120px, .8fr) auto; gap: 10px; align-items: end; margin: 14px 0 8px; padding: 10px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; }
.admin-shell .candidate-toolbar label { display: grid; gap: 5px; color: #475569; font-size: 12px; font-weight: 800; }
.admin-shell .candidate-toolbar .candidate-check { display: flex; align-items: center; align-self: center; }
.admin-shell .candidate-toolbar input, .admin-shell .candidate-toolbar select { min-height: 36px; min-width: 0; margin: 0; background: #fff; color: #252830; border: 1px solid #d2d6dc; border-radius: 6px; }
.admin-shell .candidate-toolbar > span { padding-bottom: 10px; color: #475569; font-size: 12px; white-space: nowrap; }
.admin-shell .candidate-table-head, .admin-shell .knowledge-candidate > summary { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; align-items: center; }
.admin-shell .candidate-table-head { padding: 8px 12px; color: #64748b; font-size: 11px; font-weight: 900; }
.admin-shell .knowledge-candidate { margin-top: 6px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; }
.admin-shell .knowledge-candidate[hidden] { display: none; }
.admin-shell .knowledge-row[hidden] { display: none; }
.admin-shell .knowledge-candidate > summary { padding: 11px 12px; cursor: pointer; list-style-position: inside; color: #334155; font-size: 13px; }
.admin-shell .candidate-identity, .admin-shell .knowledge-candidate > summary > span { min-width: 0; display: grid; gap: 3px; }
.admin-shell .knowledge-candidate small { overflow-wrap: anywhere; color: #64748b; font-size: 11px; font-weight: 500; line-height: 1.4; }
.admin-shell .candidate-edit-label { color: #2563eb !important; }
.admin-shell .candidate-quality { width: max-content; padding: 3px 7px; border-radius: 5px; background: #f1f5f9; font-size: 11px; }
.admin-shell .candidate-quality.good { background: #dcfce7; color: #166534; }
.admin-shell .candidate-reason { overflow-wrap: anywhere; color: #475569; max-height: 84px; overflow: hidden; }
.admin-shell .candidate-editor { padding: 0 14px 14px 30px; border-top: 1px solid #e2e8f0; background: #f8fafc; }
.admin-shell .candidate-editor .admin-field { margin-top: 10px; }
.admin-shell .candidate-editor textarea { min-height: 72px; }
.admin-shell .candidate-flags { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.admin-shell .candidate-check { display: flex; align-items: center; gap: 6px; color: #475569; font-size: 12px; }
.admin-shell .candidate-check input { width: auto; }
.admin-shell .candidate-evidence { margin-top: 12px; padding: 10px 12px; border-left: 3px solid #cbd5e1; background: #fff; color: #475569; font-size: 12px; }
.admin-shell .candidate-evidence p { margin: 5px 0 0; line-height: 1.5; }
.admin-shell .candidate-evidence a { display: inline-block; margin-top: 7px; color: #2563eb; }
.admin-shell .draft-review-notice { margin: 8px 0; padding: 8px 10px; border-left: 3px solid #f59e0b; background: #fffbeb; color: #92400e; font-size: 12px; }
@media (max-width: 900px) {
  .admin-shell .knowledge-view-tabs, .admin-shell .candidate-toolbar { grid-template-columns: 1fr 1fr; }
  .admin-shell .candidate-table-head { display: none; }
  .admin-shell .knowledge-candidate > summary { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .admin-shell .knowledge-overview-head { flex-direction: column; gap: 12px; }
  .admin-shell .knowledge-draft-row .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .admin-shell .knowledge-draft-row .actions button { width: 100%; min-height: 40px; border-radius: 6px; white-space: normal; padding: 8px; }
  .admin-shell .knowledge-scope-summary { width: 100%; min-width: 0; }
  .admin-shell .knowledge-workspace .admin-form-grid,
  .admin-shell .knowledge-workspace .import-panel .admin-form-grid { grid-template-columns: 1fr; }
  .admin-shell .candidate-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 8px 0; }
  .admin-shell .candidate-toolbar label:first-child { grid-column: 1 / -1; }
  .admin-shell .candidate-editor { padding: 0 12px 12px; }
  .admin-shell .knowledge-candidate > summary { gap: 10px; }
  .admin-shell .merchant-preset-grid { grid-template-columns: 1fr; }
}

.admin-shell .merchant-dish-import {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-shell .compact-field {
  margin-top: 0;
}

.admin-shell .compact-field span {
  font-size: 12px;
}

.admin-shell .model-config-row {
  align-items: start;
}

.admin-shell .model-config-row > div:first-child {
  width: 100%;
}

.admin-shell .model-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.admin-shell .tenant-row {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.admin-shell .tenant-row:first-child {
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  padding-top: 18px;
}

.admin-shell .tenant-row:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.12);
}

.admin-shell .tenant-row.active {
  border: 2px solid #2563eb;
  padding: 17px;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(248, 251, 255, 0.98)),
    #fff;
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.1),
    0 20px 38px rgba(37, 99, 235, 0.16);
}

.admin-shell .tenant-row[data-tenant-status="paused"] {
  border-color: rgba(234, 88, 12, 0.32);
}

.admin-shell .tenant-row[data-tenant-status="paused"]:hover {
  border-color: rgba(234, 88, 12, 0.62);
}

.admin-shell .tenant-row-head,
.admin-shell .tenant-row-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-shell .tenant-row-foot {
  flex-wrap: wrap;
}

.admin-shell .tenant-card-head {
  align-items: flex-start;
}

.admin-shell .tenant-card-title {
  min-width: 0;
}

.admin-shell .tenant-card-title strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.admin-shell .tenant-card-title p {
  margin-top: 7px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.admin-shell .tenant-card-eyebrow {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-shell .tenant-card-badges {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 6px;
  flex-direction: column;
}

.admin-shell .tenant-card-selection {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.admin-shell .tenant-card-selection.selected {
  border-color: rgba(37, 99, 235, 0.24);
  background: #dbeafe;
  color: #1d4ed8;
}

.admin-shell .tenant-card-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-shell .tenant-summary-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(241, 245, 249, 0.72);
}

.admin-shell .tenant-summary-item span,
.admin-shell .tenant-summary-item small {
  display: block;
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}

.admin-shell .tenant-summary-item strong {
  display: block;
  margin: 4px 0;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.admin-shell .tenant-summary-item small {
  color: #94a3b8;
}

.admin-shell .tenant-card-form {
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-shell .tenant-card-form input {
  min-width: 0;
}

.admin-shell .tenant-card-switch {
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-shell .tenant-card-foot {
  align-items: flex-end;
}

.admin-shell .tenant-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-shell .tenant-card-actions .selected-action {
  border-color: rgba(37, 99, 235, 0.3);
  background: #dbeafe;
  color: #1d4ed8;
}

.admin-shell .tenant-detail-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-shell .tenant-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(248, 250, 252, 0.92));
}

.admin-shell .tenant-detail-actions .mini-btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 900;
}

.admin-shell .tenant-action-primary {
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.admin-shell .tenant-action-neutral {
  border-color: rgba(37, 99, 235, 0.16);
  background: #fff;
  color: #1d4ed8;
}

.admin-shell .tenant-action-neutral:hover {
  background: #eff6ff;
}

.admin-shell .mini-btn.warning {
  border-color: rgba(234, 88, 12, 0.24);
  background: #fff7ed;
  color: #c2410c;
}

.admin-shell .mini-btn.danger {
  border-color: rgba(220, 38, 38, 0.24);
  background: #fef2f2;
  color: #b91c1c;
}

.admin-shell .tenant-action-warning:hover {
  border-color: rgba(234, 88, 12, 0.42);
  background: #ffedd5;
}

.admin-shell .tenant-action-danger:hover {
  border-color: rgba(220, 38, 38, 0.42);
  background: #fee2e2;
}

.admin-shell .mini-btn:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.admin-shell .tenant-ledger-section {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.admin-shell .tenant-ledger-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-shell .tenant-ledger-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-shell .tenant-ledger-card > strong {
  display: block;
  margin-bottom: 8px;
  color: #0f172a;
}

.admin-shell .ledger-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.admin-shell .ledger-entry-row:first-of-type {
  border-top: 0;
}

.admin-shell .ledger-entry-row span,
.admin-shell .ledger-entry-row small {
  color: #64748b;
  font-size: 12px;
}

.admin-shell .ledger-entry-row p {
  margin: 3px 0 0;
  color: #334155;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.admin-shell .ledger-entry-row strong {
  display: block;
  color: #0f172a;
  font-size: 13px;
  text-align: right;
}

.admin-shell .admin-user-management-card {
  display: grid;
  gap: 16px;
}

.admin-shell .tenant-user-list {
  display: grid;
  gap: 12px;
}

.admin-shell .tenant-user-panel {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: #fff;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.admin-shell .tenant-user-panel.active {
  border: 2px solid #2563eb;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.98)),
    #fff;
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.1),
    0 18px 38px rgba(37, 99, 235, 0.14);
}

.admin-shell .tenant-user-summary {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 0;
  border-radius: 0;
  background: #f8fafc;
  color: #0f172a;
  text-align: left;
}

.admin-shell .tenant-user-panel.active .tenant-user-summary {
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(248, 250, 252, 0.96));
}

.admin-shell .tenant-user-summary:hover {
  background: #eff6ff;
}

.admin-shell .tenant-user-summary strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 16px;
}

.admin-shell .tenant-user-summary p {
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
}

.admin-shell .tenant-user-summary-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}

.admin-shell .tenant-user-detail {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.admin-shell .tenant-user-create-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-shell .tenant-user-accounts {
  display: grid;
  gap: 10px;
}

.admin-shell .staff-user-row {
  margin: 0;
}

.admin-shell .tenant-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: #475569;
  font-size: 13px;
}

.admin-shell .tenant-stats span {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
}

.admin-shell .analytics-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.admin-shell .analytics-row strong,
.admin-shell .analytics-row p,
.admin-shell .switch-row strong,
.admin-shell .switch-row p,
.admin-shell .rule-row {
  overflow-wrap: anywhere;
}

.admin-shell .analytics-row:first-of-type {
  border-top: 0;
}

.admin-shell .analytics-row p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.admin-shell .analytics-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.admin-shell .analytics-chips span {
  min-width: 64px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  text-align: center;
}

.admin-shell .knowledge-draft-row {
  display: grid;
  gap: 10px;
}

.admin-shell .draft-validation {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-shell .draft-validation strong {
  color: #0f172a;
  font-size: 13px;
}

.admin-shell .draft-validation.needs-review {
  border-color: rgba(217, 119, 6, 0.28);
  background: #fffbeb;
}

.admin-shell .draft-validation .analytics-chips {
  justify-content: flex-start;
}

.admin-shell .draft-category-pools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-shell .draft-category-pools span {
  padding: 5px 8px;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}

.admin-shell .draft-process-state {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: #fff;
}

.admin-shell .draft-process-state span {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.admin-shell .draft-process-state p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.admin-shell .draft-process-state.active {
  border-color: rgba(37, 99, 235, 0.26);
  background: rgba(37, 99, 235, 0.06);
}

.admin-shell .knowledge-draft-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.admin-shell .knowledge-draft-detail {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.admin-shell .knowledge-draft-detail b {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
  font-size: 13px;
}

.admin-shell .knowledge-draft-detail ul {
  margin: 0;
  padding-left: 18px;
  color: #475569;
  font-size: 12px;
  line-height: 1.7;
}

.admin-shell .knowledge-draft-detail p {
  margin: 0;
}

@media (max-width: 760px) {
  .admin-shell .knowledge-draft-head,
  .admin-shell .knowledge-draft-detail {
    grid-template-columns: 1fr;
  }

  .admin-shell .knowledge-draft-head .tag {
    justify-self: start;
  }
}

.interaction-feedback {
  position: sticky;
  top: 12px;
  z-index: 40;
  width: min(100%, 760px);
  margin: 0 auto 14px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.interaction-feedback[data-kind="pending"] {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.12);
  color: #dbeafe;
}

.interaction-feedback[data-kind="success"] {
  border-color: rgba(22, 163, 74, 0.28);
  background: rgba(22, 163, 74, 0.12);
  color: #dcfce7;
}

.interaction-feedback[data-kind="error"] {
  border-color: rgba(220, 38, 38, 0.3);
  background: rgba(220, 38, 38, 0.12);
  color: #fee2e2;
}

.brand-row,
.space-row,
.metric-row,
.tabs,
.note-head,
.actions,
.field-pair {
  display: flex;
  align-items: center;
}

.space-row,
.note-head {
  justify-content: space-between;
  gap: 14px;
}

.hero,
.account-card,
.suggestion,
.menu-card,
.feature-card,
.page-block,
.note-card,
.admin-card,
.form-card,
.result-card,
.refill-card,
.boss-lock {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(43, 47, 63, 0.86), rgba(23, 27, 40, 0.88)),
    rgba(24, 20, 16, 0.84);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(41, 52, 74, 0.96), rgba(20, 27, 42, 0.94)),
    radial-gradient(circle at 12% 0%, rgba(243, 184, 78, 0.16), transparent 42%);
}

.brand-row {
  gap: 12px;
}

.logo {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #1a1208;
  font-size: 30px;
  font-weight: 900;
  background: linear-gradient(145deg, #f8dda4, #c28b3d);
}

.eyebrow {
  margin-top: 7px;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.staff-code {
  margin-left: auto;
  color: var(--ink);
  text-align: right;
  font-size: 13px;
  letter-spacing: 2px;
}

.metric-row {
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 17px;
}

.pill {
  border: 1px solid rgba(216, 177, 111, 0.35);
  background: rgba(216, 177, 111, 0.08);
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--gold-2);
  font-size: 14px;
  font-weight: 800;
}

.muted,
.hint,
.page-sub {
  color: var(--muted);
  line-height: 1.55;
}

.hint {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
}

.small {
  font-size: 12px;
}

.small-title {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 5px;
}

.small-title span {
  float: right;
  color: rgba(248, 240, 223, 0.44);
  letter-spacing: 1px;
}

.suggestion {
  margin: 18px 0;
  padding: 20px;
}

.suggestion p {
  margin: 12px 0 18px;
  font-size: 25px;
  line-height: 1.42;
}

.section {
  margin-top: 22px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 6px;
}

.section-label::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.menu-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr auto 18px;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 18px 12px;
  margin-bottom: 12px;
  text-align: left;
  backdrop-filter: blur(14px);
}

.menu-num {
  color: var(--gold);
  font-size: 22px;
  font-weight: 900;
  writing-mode: vertical-rl;
}

.menu-main p,
.feature-copy p,
.note-card p,
.switch-row p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.menu-main,
.feature-copy,
.note-card,
.copy-card,
.included-box,
.warning,
.output-summary {
  min-width: 0;
}

.menu-main h3,
.feature-copy h3,
.page-block h2,
.form-card h2,
.note-card h3,
.result-card h3 {
  color: var(--ink);
}

.cost,
.chev {
  color: var(--gold-2);
  white-space: nowrap;
  font-weight: 900;
}

.chev {
  font-size: 26px;
  opacity: 0.65;
}

.back {
  display: inline-flex;
  min-height: 38px;
  margin-bottom: 16px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
}

.feature-card {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 12px;
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  text-align: left;
  backdrop-filter: blur(14px);
}

.feature-card.is-disabled {
  opacity: 0.58;
}

.feature-card.is-selected {
  border-color: rgba(216, 177, 111, 0.88);
  background:
    linear-gradient(135deg, rgba(58, 49, 36, 0.98), rgba(38, 33, 26, 0.96)),
    rgba(42, 37, 30, 0.84);
}

.feature-card.is-selected .thumb {
  outline: 2px solid rgba(216, 177, 111, 0.88);
}

.thumb {
  width: 86px;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  display: grid;
  place-items: center;
  padding: 8px;
  white-space: pre-line;
  text-align: center;
  color: #422813;
  font-size: 13px;
  font-weight: 900;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 246, 225, 0.82)),
    linear-gradient(145deg, #f9dfaa, #ffd0bd);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.tag {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(216, 177, 111, 0.12);
  color: var(--gold-2);
  font-size: 11px;
  font-weight: 800;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.mini-btn {
  min-height: 34px;
  border: 1px solid rgba(216, 177, 111, 0.34);
  border-radius: 999px;
  padding: 0 14px;
  background: transparent;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.mini-btn.strong {
  background: rgba(216, 177, 111, 0.13);
  color: var(--gold-2);
}

.sticky-generate {
  position: sticky;
  bottom: 92px;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  border: 1px solid rgba(216, 177, 111, 0.58);
  border-radius: 18px;
  padding: 12px;
  margin: 24px 0 6px;
  background: rgba(34, 30, 24, 0.96);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.sticky-generate span,
.sticky-generate p {
  color: var(--muted);
  font-size: 12px;
}

.sticky-generate strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
}

.sticky-generate .primary {
  min-height: 48px;
  white-space: nowrap;
}

.sticky-generate p {
  grid-column: 1 / -1;
  text-align: center;
}

.primary,
.secondary,
.ghost,
.publish,
.tab {
  min-height: 50px;
  border-radius: 12px;
  padding: 0 16px;
  font-weight: 900;
}

.primary:hover,
.secondary:hover,
.ghost:hover,
.mini-btn:hover,
.publish:hover,
.tab:hover,
.menu-card:hover,
.feature-card:hover {
  transform: translateY(-1px);
}

.primary {
  background: linear-gradient(145deg, #ddb879, #c99a55);
  color: #19120a;
}

.primary.teal {
  background: var(--teal);
  color: #fff;
}

.secondary {
  border: 1px solid rgba(216, 177, 111, 0.38);
  background: transparent;
  color: var(--gold-2);
}

.ghost {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
}

.wide {
  width: 100%;
}

.page-block,
.note-card,
.admin-card,
.form-card,
.boss-lock {
  padding: 18px;
  margin-top: 16px;
}

.tabs {
  gap: 10px;
  margin: 24px 0 12px;
}

.tab {
  flex: 1;
  background: transparent;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.tab.active {
  color: var(--gold);
  border-color: var(--gold);
}

.comment-generate-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.comment-generate-card span {
  color: var(--gold);
  letter-spacing: 5px;
  font-weight: 900;
}

.target-note {
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
  background: rgba(216, 177, 111, 0.1);
  color: var(--gold-2);
  line-height: 1.45;
}

.target-note small {
  color: var(--muted);
}

.strategy-card {
  border: 1px solid rgba(216, 177, 111, 0.24);
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
  background: rgba(216, 177, 111, 0.07);
}

.preset-card {
  border: 1px solid rgba(8, 124, 135, 0.34);
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
  background:
    linear-gradient(135deg, rgba(8, 124, 135, 0.18), rgba(216, 177, 111, 0.06)),
    rgba(36, 32, 26, 0.82);
}

.preset-card h3 {
  margin-top: 10px;
  color: #bff5f2;
}

.preset-card p {
  margin-top: 8px;
  color: #d9d0c2;
  line-height: 1.5;
}

.strategy-card p {
  margin-top: 10px;
  color: #d9d0c2;
  line-height: 1.55;
}

.strategy-card strong {
  color: var(--gold-2);
}

.field {
  margin: 16px 0;
}

.field-pair {
  align-items: flex-start;
  gap: 12px;
}

.field-pair .field {
  flex: 1;
}

.field label,
.refill-panel label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 900;
}

input,
textarea,
select,
.refill-panel textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px;
  background: rgba(20, 18, 14, 0.55);
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.model-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 16px;
}

.model-strip span {
  border: 1px solid rgba(8, 124, 135, 0.35);
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(8, 124, 135, 0.16);
  color: #8ce2e8;
  font-size: 11px;
  font-weight: 800;
}

.swap-demo {
  display: grid;
  grid-template-columns: 1fr 20px 1fr 20px 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 18px;
}

.swap-demo div {
  aspect-ratio: 1;
  border-radius: 12px;
  display: grid;
  place-items: center;
  padding: 8px;
  text-align: center;
  color: var(--dark-ink);
  background: linear-gradient(145deg, #fff7dd, #dff5f2);
  font-size: 12px;
  font-weight: 900;
}

.swap-demo span {
  display: block;
  margin-bottom: 4px;
  color: #087c87;
  font-size: 16px;
}

.upload-box {
  display: grid;
  place-items: center;
  min-height: 130px;
  margin: 16px 0;
  border: 1.5px dashed rgba(255, 255, 255, 0.36);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  color: var(--muted);
  font-weight: 900;
}

.upload-box span {
  display: block;
  margin-top: 10px;
}

.upload-box.uploaded {
  border-color: rgba(52, 193, 122, 0.6);
  background: rgba(52, 193, 122, 0.08);
  color: #d5fff0;
}

.swap-upload-input {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
}

.account-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 16px;
  margin-bottom: 18px;
  background:
    linear-gradient(135deg, rgba(48, 55, 74, 0.94), rgba(24, 29, 43, 0.94)),
    rgba(42, 37, 30, 0.84);
}

.account-card h3 {
  font-size: 20px;
}

.account-card p,
.quota span,
.quota em {
  color: var(--muted);
  font-style: normal;
}

.quota {
  text-align: right;
}

.quota strong {
  display: inline-block;
  color: var(--ink);
  font-size: 32px;
}

.bar {
  grid-column: 1 / -1;
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c28b3d, #efcb88);
}

.result-card {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(35, 40, 54, 0.94), rgba(23, 27, 40, 0.96)),
    rgba(42, 37, 30, 0.84);
}

.asset-stack {
  display: grid;
  gap: 16px;
}

.asset-label {
  margin-bottom: -6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.poster,
.list-poster,
.gradient-poster,
.phone-photo,
.chat-poster,
.receipt-poster {
  width: 100%;
  min-height: 440px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.poster,
.phone-photo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}

.poster {
  background: #fff1d8;
  color: var(--dark-ink);
}

.poster h2 {
  color: #4f2b15;
  font-size: 44px;
}

.poster span,
.poster p {
  color: #7b4d1a;
  font-weight: 900;
}

.handdraw,
.recruit-cover,
.recruit-flow {
  background:
    linear-gradient(180deg, rgba(255, 250, 235, 0.96), rgba(255, 235, 202, 0.9)),
    linear-gradient(135deg, #f4dfaa, #bce2d4);
}

.guide {
  background: linear-gradient(145deg, #d4f4ee, #fff0c3 54%, #ffd5d0);
}

.swap-result {
  background: linear-gradient(145deg, #e0fbff, #fff0c6 52%, #ffd7ce);
}

.recruit-flow ol {
  width: min(290px, 100%);
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.recruit-flow li {
  margin-top: 10px;
  border: 2px solid #d9a849;
  border-radius: 999px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.6);
  color: #253053;
  font-weight: 900;
}

.phone-photo {
  border: 1px dashed rgba(255, 255, 255, 0.28);
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
    rgba(255, 255, 255, 0.04);
  background-size: 24px 24px;
  color: var(--muted);
  font-size: 22px;
  font-weight: 900;
}

.phone-photo span {
  color: var(--gold);
  font-size: 14px;
}

.list-poster,
.gradient-poster {
  padding: 28px;
  background: #fffaf0;
  color: var(--dark-ink);
}

.chat-poster,
.receipt-poster {
  padding: 24px;
  background: linear-gradient(180deg, #f5f8ff, #e8eefc);
  color: #13203a;
}

.hype-chat {
  background: linear-gradient(180deg, #eff6ff, #dde9ff);
}

.private-chat {
  background: linear-gradient(180deg, #f6f7fb, #e8edf8);
}

.list-poster h2 {
  margin-bottom: 8px;
  font-size: 34px;
}

.list-poster p {
  display: inline-block;
  margin-bottom: 18px;
  background: #ffe986;
  font-weight: 900;
}

.list-poster div {
  margin-top: 10px;
  font-size: 15px;
}

.list-poster span {
  display: inline-block;
  width: 26px;
  color: #248b57;
  font-weight: 900;
}

.gradient-poster {
  display: grid;
  gap: 14px;
}

.gradient-poster section {
  border-radius: 10px;
  padding: 16px;
  background: #fff;
}

.gradient-poster h3 {
  color: #1c1c1c;
  font-size: 24px;
}

.gradient-poster p {
  margin-top: 6px;
  color: #333;
  font-weight: 800;
}

.chat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 900;
  font-size: 20px;
}

.chat-time {
  margin: 10px 0 16px;
  color: #6b7280;
  font-size: 12px;
  text-align: center;
}

.bubble {
  max-width: 84%;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.5;
  font-size: 15px;
  font-weight: 800;
}

.bubble.left {
  margin-right: auto;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.bubble.right {
  margin-left: auto;
  background: #dce8ff;
}

.markup {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.markup span {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

.receipt-poster h2 {
  margin-bottom: 16px;
  color: #1f2a44;
  font-size: 34px;
}

.receipt-row {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.12);
}

.receipt-row span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.receipt-row strong {
  color: #1e3a8a;
  font-size: 18px;
}

.receipt-row em {
  color: #475569;
  font-style: normal;
  font-weight: 800;
}

.save-tip {
  margin: 12px 0 18px;
  color: rgba(248, 240, 223, 0.58);
  text-align: center;
}

.output-summary,
.included-box,
.warning {
  border-radius: 12px;
  padding: 13px;
  margin-top: 14px;
  line-height: 1.55;
}

.output-summary {
  border: 1px solid rgba(100, 205, 172, 0.78);
  color: #d8fff3;
}

.included-box,
.warning,
.notice {
  background: rgba(216, 177, 111, 0.12);
  color: var(--gold-2);
}

.copy-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 16px;
  margin-top: 14px;
  background: rgba(14, 13, 10, 0.32);
  line-height: 1.65;
}

.copy-card p {
  margin-top: 12px;
  color: #d9d0c2;
  white-space: pre-line;
}

.copy-card .tags,
.tags {
  color: var(--gold);
}

.publish {
  width: 100%;
  margin-top: 14px;
  color: #fff;
  letter-spacing: 7px;
}

.publish.douyin {
  background: var(--red);
}

.publish.xhs {
  border: 1px solid rgba(198, 61, 83, 0.65);
  background: transparent;
  color: #ff9da8;
}

.fallback-row {
  margin-top: 14px;
  color: rgba(248, 240, 223, 0.36);
  text-align: center;
}

.fallback-row button {
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
}

.refill-card {
  margin-top: 16px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(34, 43, 62, 0.9), rgba(19, 24, 37, 0.92)),
    rgba(42, 37, 30, 0.84);
}

.refill-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.refill-summary em {
  color: var(--muted);
  font-style: normal;
}

.refill-panel {
  margin-top: 12px;
}

.refill-panel p {
  margin-bottom: 12px;
  color: var(--muted);
}

.note-card {
  margin-bottom: 12px;
}

.note-link {
  overflow-wrap: anywhere;
  color: var(--gold);
}

.status {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.actions {
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.actions button {
  flex: 1;
}

.record-card .actions .record-delete {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffb4a6;
}

.record-card .actions .record-delete svg {
  width: 18px;
  height: 18px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(398px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 8px;
  background: rgba(34, 30, 24, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.bottom-nav button {
  min-height: 60px;
  border-radius: 17px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.bottom-nav button.active {
  background: rgba(216, 177, 111, 0.16);
  color: var(--gold-2);
}

.switch-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.switch-row strong {
  color: inherit;
}

.feature-config-row {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.preset-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.preset-row + .preset-row {
  margin-top: 12px;
}

.preset-row.active {
  border-color: rgba(8, 124, 135, 0.52);
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.96), rgba(255, 255, 255, 0.98));
  box-shadow: 0 0 0 4px rgba(8, 124, 135, 0.08);
}

.admin-shell .preset-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-shell .preset-row-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.admin-shell .preset-edit-grid {
  margin-top: 0;
}

.admin-shell .preset-edit-grid--tight {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-shell .preset-edit-grid--tight .knowledge-editor {
  min-height: auto;
  padding: 12px;
}

.admin-shell .preset-edit-grid--tight .knowledge-editor textarea {
  min-height: 84px;
  max-height: 140px;
  resize: vertical;
}

.admin-shell .preset-risk {
  grid-column: 1 / -1;
}

.admin-shell .preset-risk textarea {
  min-height: 88px;
  max-height: 132px;
}

.admin-shell .preset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.preset-row p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.feature-config-row:first-of-type {
  border-top: 0;
}

.feature-config-row p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.rule-row {
  border-top: 1px solid var(--line);
  padding: 12px 0;
  color: #d9d0c2;
  line-height: 1.55;
  font-size: 14px;
}

.rule-row:first-of-type {
  border-top: 0;
}

.switch-row:first-of-type {
  border-top: 0;
}

.toggle {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  padding: 3px;
  background: #4c4943;
}

.toggle::before {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.toggle.on {
  background: var(--green);
}

.toggle.on::before {
  transform: translateX(22px);
}

.boss-lock {
  display: grid;
  gap: 16px;
  justify-items: center;
  margin-top: 48px;
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.stats-grid div {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 8px;
  background:
    linear-gradient(180deg, rgba(42, 48, 67, 0.9), rgba(24, 29, 42, 0.93)),
    rgba(42, 37, 30, 0.84);
  text-align: center;
}

.stats-grid strong {
  display: block;
  color: var(--gold);
  font-size: 24px;
}

.stats-grid span {
  color: var(--muted);
  font-size: 12px;
}

.browser-guide {
  min-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  text-align: center;
}

.browser-guide .arrow {
  align-self: flex-end;
  color: #ffc72c;
  font-size: 74px;
  line-height: 1;
}

.browser-guide h1 {
  font-size: 32px;
}

.browser-guide p {
  color: #a9b0ba;
  line-height: 1.7;
}

.guide-box {
  display: grid;
  gap: 14px;
  border: 1px solid #38404a;
  border-radius: 18px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.guide-box div {
  display: flex;
  gap: 14px;
  align-items: center;
}

.guide-box strong {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(216, 177, 111, 0.2);
  color: #ffd26d;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  align-items: end;
  background: rgba(0, 0, 0, 0.52);
}

.drawer-panel {
  width: min(430px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  padding: 20px;
  background: #231f19;
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.36);
}

.preview-panel {
  position: relative;
  width: min(430px, 100vw);
  max-height: calc(100vh - 40px);
  margin: 0 auto;
  overflow: auto;
  padding: 22px;
}

.close-preview {
  position: sticky;
  top: 0;
  float: right;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 34px;
}

.preview-title {
  clear: both;
  margin: 76px 0 16px;
  color: var(--gold);
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 8px;
}

.preview-art {
  margin-bottom: 16px;
}

.preview-art .poster,
.preview-art .list-poster,
.preview-art .gradient-poster,
.preview-art .compare-example {
  min-height: 460px;
}

.compare-example {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 460px;
  border-radius: 18px;
  padding: 38px;
  background: #f0e3c8;
  color: #1d1b17;
  overflow: hidden;
}

.compare-example span {
  position: absolute;
  color: rgba(100, 82, 48, 0.09);
  font-size: 260px;
  font-weight: 900;
}

.compare-example h2 {
  position: relative;
  z-index: 1;
  font-size: 30px;
  line-height: 1.38;
}

.progress-panel {
  width: min(520px, 100vw);
  min-height: 0;
  max-height: calc(100vh - 24px);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(19, 25, 34, 0.98), rgba(28, 35, 46, 0.98));
  text-align: left;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.24);
  position: relative;
  overflow: auto;
}

.progress-panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: radial-gradient(circle at top right, rgba(255, 155, 187, 0.14), transparent 34%), radial-gradient(circle at bottom left, rgba(72, 176, 255, 0.12), transparent 30%);
  pointer-events: none;
}

.progress-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.progress-panel h3 {
  margin-bottom: 8px;
  font-size: 21px;
  line-height: 1.25;
}

.progress-panel-subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  line-height: 1.55;
}

.progress-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.progress-eta {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  white-space: nowrap;
}

.progress-panel-detail {
  margin: 4px 0 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.6;
}

.progress-track {
  height: 12px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9bbb, #ff3150);
  transition: width 0.6s ease;
  box-shadow: 0 0 24px rgba(255, 49, 80, 0.25);
}

.progress-history {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 4px 0 0;
  max-height: 180px;
  overflow: auto;
  text-align: left;
}

.progress-stage-list {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.progress-stage {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
}

.progress-stage span {
  color: rgba(255, 255, 255, 0.96);
  font-size: 13px;
  font-weight: 800;
}

.progress-stage p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  line-height: 1.45;
}

.progress-stage.done {
  background: rgba(59, 130, 246, 0.12);
}

.progress-stage.active {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  animation: progressPulse 1.8s ease-in-out infinite;
}

.progress-history-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-history-item span {
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

.progress-history-item p {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  line-height: 1.5;
}

.progress-history-item.active {
  background: rgba(255, 255, 255, 0.16);
}

.progress-history-item.active span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: #ff9bbb;
  box-shadow: 0 0 0 4px rgba(255, 155, 187, 0.12);
  vertical-align: middle;
}

@keyframes progressPulse {
  0%, 100% {
    transform: translateY(0);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 10px 20px rgba(16, 185, 129, 0.08);
  }
}

.notice {
  margin: 16px 0;
  border-radius: 12px;
  padding: 14px;
  line-height: 1.55;
}

.identity-note {
  margin: 14px 0;
  border: 1px solid rgba(44, 117, 92, 0.18);
  border-radius: 12px;
  padding: 12px;
  background: rgba(44, 117, 92, 0.07);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.identity-note span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line);
}

.muted-primary {
  margin-top: 14px;
}

.compact {
  margin: 14px 0;
}

.hidden {
  display: none;
}

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
  }

  .admin-nav,
  .admin-kpi-grid,
  .admin-section-grid,
  .admin-section-grid.two-col,
  .admin-table-grid,
  .admin-form-grid,
  .knowledge-map,
  .admin-shell .tenant-management-layout,
  .admin-shell .tenant-detail-summary,
  .admin-shell .finance-category-grid,
  .admin-shell .tenant-ledger-groups,
  .admin-shell .tenant-user-create-form,
  .admin-shell .knowledge-row-grid {
    grid-template-columns: 1fr;
  }

  .admin-shell .tenant-user-summary {
    display: grid;
  }

  .admin-shell .tenant-user-summary-meta {
    justify-items: start;
    white-space: normal;
  }

  .admin-shell .tenant-detail-panel {
    position: static;
  }

  .admin-main {
    padding: 20px 16px 32px;
  }

  .admin-topbar {
    display: grid;
  }

  .admin-top-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 360px) {
  .app-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .feature-card {
    grid-template-columns: 70px 1fr;
  }

  .feature-card .cost {
    grid-column: 2;
  }

  .thumb {
    width: 70px;
  }

  .poster h2 {
    font-size: 36px;
  }

  .actions button,
  .field-pair .field {
    flex-basis: 100%;
  }
}
.collection-plan-editor { margin: 16px 0; }
.collection-categories { padding: 12px 0; border-top: 1px solid #d9dfdd; }
.collection-categories summary { cursor: pointer; font-weight: 600; }
.collection-category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px 24px; padding-top: 16px; }
.collection-category-row { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(120px, 1fr); gap: 10px; align-items: center; min-width: 0; }
.collection-category-row > label { display: flex; gap: 8px; align-items: center; overflow-wrap: anywhere; }
.collection-category-row input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 16px; }
.collection-category-row .admin-field { min-width: 0; }
.coverage-table-wrap { overflow-x: auto; max-width: 100%; margin-top: 12px; }
.coverage-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.coverage-table th, .coverage-table td { text-align: left; padding: 8px; border-bottom: 1px solid #d9dfdd; min-width: 58px; }
.coverage-table th:first-child { min-width: 100px; }
.candidate-quality.unknown { color: #745b19; background: #fff5d8; }
.structured-store-asset { margin: 0; width: 100%; }
.structured-store-asset img { display: block; width: 100%; height: auto; }
.admin-shell .feature-quality-probe { padding: 20px 0; border-bottom: 1px solid #d9dfdd; margin-bottom: 24px; }
.admin-shell .feature-quality-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.admin-shell .feature-quality-controls label { display: grid; gap: 5px; min-width: 150px; }
.admin-shell .feature-quality-controls select { font: inherit; padding: 8px; max-width: 100%; }
.admin-shell .feature-quality-summary, .admin-shell .feature-quality-checks { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.admin-shell .feature-quality-output { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 24px; margin-top: 18px; }
.admin-shell .feature-quality-output img { display: block; width: 100%; height: auto; }
.admin-shell .feature-quality-output pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.admin-shell .feature-quality-output h4, .admin-shell .feature-quality-output p { overflow-wrap: anywhere; }
@media (max-width: 700px) { .admin-shell .feature-quality-output { grid-template-columns: minmax(0, 1fr); } }
:is(.store-import-summary, .store-import-evidence) { overflow-wrap: anywhere; }
.store-import-summary { margin: 12px 0; padding: 12px 0; border-block: 1px solid #d9dedb; }
.store-import-evidence dl { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 3fr); gap: 6px 12px; font-size: 13px; }
.store-import-evidence dt { color: #626a65; }
.store-import-evidence dd { margin: 0; white-space: pre-wrap; }
.admin-shell .knowledge-row-caption { display: block; color: #626a65; margin-top: 4px; overflow-wrap: anywhere; }
.batch-controls { border-top: 1px solid #d5dce0; padding-top: 16px; display: grid; gap: 12px; min-width: 0; }
.batch-controls > label { display: grid; gap: 6px; }
.batch-controls select, .batch-detail select { width: 100%; max-width: 100%; min-width: 0; }
.batch-clear-fields, .batch-counts { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.batch-clear-fields label, .batch-confirm { display: flex; gap: 8px; align-items: flex-start; }
.batch-clear-fields input, .batch-confirm input { width: 16px; flex: 0 0 16px; }
.batch-preview { margin: 12px 0; padding: 16px 0; border-top: 2px solid #45806b; display: grid; gap: 12px; min-width: 0; }
.batch-preview h4 { margin: 0; font-size: 16px; }
.batch-preview > button { justify-self: start; }
.batch-detail-list, .batch-member-list { max-height: 420px; overflow: auto; overscroll-behavior: contain; }
.batch-detail, .batch-history-row { padding: 12px 0; border-bottom: 1px solid #d5dce0; min-width: 0; overflow-wrap: anywhere; }
.batch-detail summary, .batch-history-row summary { cursor: pointer; font-size: 14px; }
.batch-detail summary span, .batch-history-row summary span { margin-left: 12px; color: #526162; }
.batch-field-diff > div { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(0, 2fr) minmax(0, 2fr); gap: 8px; padding: 8px 0; border-top: 1px solid #e5e8e9; font-size: 13px; overflow-wrap: anywhere; }
.batch-field-diff > div > span:last-child { color: #265e4c; }
@media (max-width: 600px) {
  .batch-field-diff > div { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .batch-field-diff > div > b { grid-column: 1 / -1; }
  .batch-detail summary span, .batch-history-row summary span { display: block; margin: 4px 0 0; }
}

.publication-panel {
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.publication-panel .copy-card.compact { max-height: 180px; overflow-y: auto; overflow-wrap: anywhere; }
.publication-handoff { display: grid; gap: 8px; margin: 12px 0; }
.publication-handoff p { margin: 0; overflow-wrap: anywhere; }
.publication-panel #manual-copy-text { box-sizing: border-box; width: 100%; font-size: 16px; }
.swap-media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.swap-media-slot { min-width: 0; }
.swap-media-slot .upload-box { display: flex; flex-direction: column; position: relative; gap: 8px; margin: 0 0 8px; padding: 12px; min-width: 0; }
.swap-media-slot .upload-box img, .swap-image-empty { display: block; width: 100%; height: 160px; object-fit: contain; background: #f2f4f3; }
.swap-image-empty { display: grid; place-items: center; font-size: 32px; color: #64716b; }
.swap-media-slot .upload-box span { max-width: 100%; overflow-wrap: anywhere; font-size: 12px; }
.swap-probe-controls > label { display: grid; gap: 6px; max-width: 360px; }
.swap-probe-controls select, .swap-probe-controls textarea { width: 100%; min-width: 0; }
.swap-probe-controls textarea { min-height: 76px; resize: vertical; }
.admin-shell .feature-quality-probe select, .admin-shell .feature-quality-probe textarea { background: #fff; color: #182b35; border: 1px solid #b5c7d0; border-radius: 6px; padding: 10px; }
.admin-shell .feature-quality-probe select:disabled, .admin-shell .feature-quality-probe textarea:disabled { background: #edf2f5; color: #596b73; }
.admin-shell .swap-media-slot .upload-box { background: #f7fafb; color: #233e48; border: 1px dashed #98b4bf; border-radius: 6px; }
.admin-shell .swap-media-slot .upload-box.uploaded { background: #e7f3ee; border-color: #83b8a3; color: #174b38; }
.admin-shell .swap-media-slot .upload-box span { color: #45616b; }
.swap-media-slot .upload-box .swap-image-empty { display: grid; place-items: center; font-size: 32px; }
@media (max-width: 600px) {
  .swap-media-grid { grid-template-columns: 1fr; }
  .swap-media-slot .upload-box img, .swap-image-empty { height: 180px; }
}
