﻿:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
  --bg: #f4f6f9;
  --panel: #ffffff;
  --text: #182033;
  --muted: #667085;
  --line: #d8dee8;
  --soft: #f8fafc;
  --blue: #276ef1;
  --blue-dark: #1e56c7;
  --blue-soft: #eef4ff;
  --green: #067647;
  --red: #b42318;
  --amber: #b7791f;
  --shadow: 0 12px 34px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}
.auth-screen {
  position: relative;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(39, 110, 241, 0.10), transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, #eef4ff 44%, #f7fafc 100%);
}
.auth-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(39, 110, 241, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39, 110, 241, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  animation: authGrid 18s linear infinite;
}
.auth-screen::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(39, 110, 241, 0.24), transparent);
  animation: authRail 5s ease-in-out infinite;
}
.auth-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.auth-bg span {
  position: absolute;
  left: 9%;
  right: 9%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(39, 110, 241, 0.25), rgba(20, 184, 166, 0.28), transparent);
  opacity: 0.42;
  transform-origin: center;
  animation: authLineDrift 7s ease-in-out infinite;
}
.auth-bg span:nth-child(1) { top: 29%; }
.auth-bg span:nth-child(2) { top: 56%; animation-delay: -2.4s; }
.auth-bg span:nth-child(3) { top: 76%; animation-delay: -4.8s; }
.auth-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.72fr);
  gap: 18px;
  align-items: stretch;
}
.icp-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.icp-footer a {
  color: inherit;
  text-decoration: none;
}
.icp-footer a:hover {
  color: var(--blue);
  text-decoration: underline;
}
.auth-icp {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 10px;
  z-index: 2;
}
.app-icp {
  margin-top: 22px;
  padding: 10px 0 0;
}

.app-version {
  display: none;
}

body.module-home-active .app-version {
  position: fixed;
  right: 26px;
  bottom: 20px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 26px;
  padding: 0 12px;
  border: 1px solid rgba(185, 133, 52, .32);
  border-radius: 999px;
  background: rgba(255, 253, 250, .82);
  color: #9b681f;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  box-shadow: 0 10px 24px rgba(30, 25, 18, .08);
  backdrop-filter: blur(10px);
}
.auth-story,
.auth-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(151, 164, 184, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.14);
  backdrop-filter: blur(18px);
}
.auth-story {
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-content: center;
  gap: 18px;
  padding: 28px;
  color: var(--text);
}
.auth-navline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #276ef1, #14b8a6);
  box-shadow: 0 10px 24px rgba(39, 110, 241, 0.24);
  animation: authPulse 2.4s ease-in-out infinite;
}
.auth-status-pill {
  padding: 6px 10px;
  border: 1px solid #c7d7fe;
  border-radius: 999px;
  background: #eef4ff;
  color: #244ba8;
  font-size: 12px;
  font-weight: 800;
}
.eyebrow {
  color: #276ef1;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.auth-story h1 {
  max-width: 760px;
  margin-top: 6px;
  color: #111827;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.12;
}
.auth-lede {
  max-width: 720px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.65;
}
.auth-workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.auth-workflow-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 14px;
  border: 1px solid #c7d7fe;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 12px 28px rgba(39, 110, 241, 0.07);
}
.auth-workflow-step strong {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #276ef1, #14b8a6);
  color: #fff;
  font-size: 13px;
}
.auth-workflow-step span {
  display: block;
  color: #182033;
  font-weight: 850;
  line-height: 1.35;
}
.auth-workflow-step p {
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
  line-height: 1.55;
}
.auth-workflow-step p,
.capability-grid span,
.pain-strip p,
.auth-footnote,
.auth-panel-head p {
  color: #667085;
}
.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.capability-grid article {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
}
.capability-grid strong {
  color: #182033;
}
.capability-grid span {
  font-size: 12px;
  line-height: 1.42;
}
.pain-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #abefc6;
  border-radius: 8px;
  background: #f6fef9;
}
.pain-strip span {
  color: #067647;
  font-size: 13px;
  font-weight: 800;
}
.pain-strip p {
  font-size: 13px;
  line-height: 1.45;
}
.legal-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #c7d7fe;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fbff, #f6fef9);
}
.legal-strip strong {
  color: #182033;
  font-size: 13px;
}
.legal-strip span {
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}
.legal-strip button,
.auth-legal-links button,
.auth-consent button {
  border: 0;
  background: transparent;
  color: #244ba8;
  font-weight: 800;
  padding: 0;
  min-height: auto;
}
.legal-strip button {
  padding: 5px 8px;
  border: 1px solid #d7e3f7;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  white-space: nowrap;
}
.legal-strip button:hover,
.auth-legal-links button:hover,
.auth-consent button:hover {
  color: var(--green);
  text-decoration: underline;
}
.auth-panel {
  align-self: center;
  display: grid;
  gap: 14px;
  padding: 24px;
  color: var(--text);
}
.auth-panel::before {
  content: "";
  position: absolute;
  left: -40%;
  top: 0;
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(185, 133, 52, .38), transparent);
  animation: panelLine 3.2s linear infinite;
}
.auth-panel h2 {
  color: #111827;
  font-size: 26px;
}
.auth-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 5px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #f1f5fb;
}
.auth-switch button {
  min-height: 42px;
  border-color: transparent;
  background: transparent;
  color: #667085;
}
.auth-switch button.active {
  color: #fff;
  background: #276ef1;
  box-shadow: 0 10px 26px rgba(39, 110, 241, 0.22);
}
.auth-form {
  display: none;
  gap: 14px;
}
.auth-form.active {
  display: grid;
}
.auth-panel label {
  color: #344054;
}
.auth-panel input {
  min-height: 48px;
  border-color: #d8dee8;
  background: #fff;
  color: var(--text);
}
.auth-panel input::placeholder {
  color: #98a2b3;
}
.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 8px;
}
.auth-code-row button {
  min-height: 48px;
  padding: 0 10px;
  white-space: nowrap;
}
.auth-remember {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #667085;
  font-size: 13px;
}
.auth-remember input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 0;
  accent-color: #22d3ee;
}
.auth-consent {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid #d7e3f7;
  border-radius: 8px;
  background: #f8fbff;
  color: #475467;
  font-size: 13px;
  line-height: 1.6;
}
.auth-consent input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: #276ef1;
}
.auth-consent span {
  min-width: 0;
}
.auth-panel .primary {
  min-height: 50px;
  border-color: #276ef1;
  background: linear-gradient(135deg, #276ef1, #1e56c7);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.32);
  animation: primaryBreath 2.8s ease-in-out infinite;
}
.auth-panel-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.auth-panel-foot span {
  padding: 5px 8px;
  border: 1px solid #d8dee8;
  border-radius: 999px;
  background: #f8fafc;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}
.auth-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-top: 2px;
  color: #667085;
  font-size: 12px;
}
.auth-legal-links::before {
  content: "协议";
  color: #98a2b3;
  font-weight: 800;
}
.password-fallback {
  border-top: 1px solid #e4e7ec;
  padding-top: 4px;
}
.password-fallback summary {
  cursor: pointer;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}
.password-fallback .auth-form {
  margin-top: 12px;
}
.password-fallback button {
  min-height: 42px;
}
.auth-footnote {
  font-size: 13px;
}
@keyframes authGrid {
  from { background-position: 0 0, 0 0; }
  to { background-position: 96px 96px, 96px 96px; }
}
@keyframes authRail {
  0%, 100% { transform: translateY(0); opacity: 0.25; }
  50% { transform: translateY(56vh); opacity: 0.65; }
}
@keyframes authLineDrift {
  0%, 100% { transform: translateX(-2%) scaleX(0.94); }
  50% { transform: translateX(2%) scaleX(1); }
}
@keyframes authPulse {
  0%, 100% { box-shadow: 0 8px 18px rgba(39, 110, 241, 0.2); }
  50% { box-shadow: 0 14px 30px rgba(20, 184, 166, 0.28); }
}
@keyframes heroScan {
  0%, 18% { transform: translateX(-110%); opacity: 0; }
  42%, 62% { opacity: 1; }
  100% { transform: translateX(110%); opacity: 0; }
}
@keyframes panelLine {
  from { transform: translateX(0); }
  to { transform: translateX(220%); }
}
@keyframes primaryBreath {
  0%, 100% { box-shadow: 0 12px 28px rgba(37, 99, 235, 0.26); }
  50% { box-shadow: 0 18px 44px rgba(34, 211, 238, 0.36); }
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.account-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

body.workflow-active .account-menu-wrap {
  display: none !important;
}

body.workflow-active .workflow-quota-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 32px;
  padding: 6px 14px calc(6px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(229, 231, 235, .95);
  background: rgba(255, 255, 255, .96);
  color: #667085;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, .06);
}

body.workflow-active .workflow-quota-bar strong {
  display: inline;
  color: #111827;
  font-size: 14px;
}

.return-button {
  height: 38px;
  min-width: 84px;
  padding: 0 18px;
  border: 1px solid #dfb679;
  border-radius: 8px;
  background: #fffdfa;
  color: #9b681f;
  font: inherit;
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: none;
}

.return-button:hover {
  background: #fff7e9;
  border-color: #d8a35a;
}
.account-trigger {
  min-height: 40px;
  border: 1px solid #cfe6dd;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f6fffb 100%);
  color: #1f3b35;
  padding: 0 34px 0 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  box-shadow: 0 10px 24px rgba(11, 107, 97, 0.10);
}
.account-trigger::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  vertical-align: -4px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 38%, #ffffff 0 3px, transparent 3.5px),
    radial-gradient(circle at 50% 72%, #ffffff 0 6px, transparent 6.5px),
    linear-gradient(135deg, #0b6b61, #36b37e);
}
.account-trigger::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid #6b7b85;
  border-bottom: 2px solid #6b7b85;
  transform: translateY(-62%) rotate(45deg);
}
.account-trigger:hover,
.account-trigger[aria-expanded="true"] {
  border-color: #8dd7be;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(11, 107, 97, 0.16);
}
.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 80;
  display: none;
  min-width: 148px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}
.account-menu.active {
  display: grid;
  gap: 6px;
}
.account-menu button {
  min-height: 38px;
  justify-content: flex-start;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-weight: 750;
  text-align: left;
}
.account-menu button:hover {
  background: #f2f7f5;
}
.corner-tools {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 70;
  display: flex;
  gap: 10px;
}
.corner-tool-button {
  width: 44px;
  height: 44px;
  border: 1px solid #d8dde3;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: #24312f;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}
.corner-tool-button:hover {
  border-color: #9fd4c4;
  background: #f6fffb;
  color: var(--green);
  transform: translateY(-1px);
}
.settings-glyph {
  position: relative;
  width: 22px;
  height: 18px;
  background:
    linear-gradient(currentColor, currentColor) 0 2px / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 8px / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 14px / 100% 2px no-repeat;
}
.settings-glyph::before {
  content: "";
  position: absolute;
  left: 4px;
  top: -1px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 10px 6px 0 currentColor, -1px 12px 0 currentColor;
}
.settings-glyph::after {
  content: none;
}
.account-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.account-info div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.account-info strong,
.account-info span {
  display: block;
}
.account-info span {
  color: var(--muted);
  font-size: 13px;
}
.membership-info {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.membership-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #abefc6;
  border-radius: 8px;
  background: #f6fef9;
}
.membership-card strong {
  color: var(--green);
}
.membership-card span {
  color: var(--muted);
  font-size: 13px;
}
.admin-users-list {
  display: grid;
  gap: 12px;
}
.admin-user-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-user-toolbar > div {
  display: grid;
  gap: 2px;
  min-width: 84px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.admin-user-toolbar strong {
  font-size: 22px;
  color: var(--text);
  line-height: 1;
}
.admin-user-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.admin-user-toolbar label {
  flex: 1 1 260px;
  min-width: min(360px, 100%);
  margin: 0;
  color: var(--muted);
}
.admin-user-toolbar input {
  min-height: 40px;
  margin-top: 4px;
}
#adminUserVisibleCount {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid #d7e3f7;
  border-radius: 999px;
  background: #f8fbff;
  color: #244ba8;
  font-size: 12px;
  font-weight: 800;
}
.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.admin-users-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.admin-users-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f7faf9;
  color: #475467;
  text-align: left;
  font-weight: 800;
  white-space: nowrap;
}
.admin-users-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f2;
  vertical-align: middle;
}
.admin-users-table tbody tr:last-child td {
  border-bottom: 0;
}
.admin-users-table tbody tr:hover {
  background: #fbfdfc;
}
.admin-user-main {
  min-width: 180px;
}
.admin-user-main strong,
.admin-user-main span,
.metric-cell strong,
.metric-cell span {
  display: block;
}
.admin-user-main strong,
.metric-cell strong {
  color: var(--text);
  font-size: 15px;
}
.admin-user-main span,
.membership-cell span,
.metric-cell span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.membership-cell {
  min-width: 118px;
}
.membership-cell strong,
.membership-cell span {
  display: block;
}
.membership-cell strong {
  color: var(--text);
  font-size: 14px;
}
.membership-quota-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.membership-quota-grid div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}
.membership-quota-grid b {
  display: block;
  color: var(--text);
  font-size: 20px;
}
.membership-quota-grid span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.membership-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.status-pill.active {
  background: #ecfdf3;
  color: #067647;
}
.status-pill.disabled {
  background: #f2f4f7;
  color: #667085;
}
.quota-edit-cell {
  min-width: 210px;
  display: grid;
  grid-template-columns: repeat(3, 62px);
  gap: 8px;
}
.quota-edit-cell label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.quota-edit-cell input {
  width: 62px;
  min-height: 34px;
  margin-top: 3px;
  padding: 6px 8px;
  font-size: 13px;
}
.library-package-list {
  min-width: 0;
}
.library-packages-table .compact-input {
  width: 92px;
  min-height: 34px;
  padding: 6px 8px;
}
.library-package-main strong {
  display: block;
  color: var(--text);
}
.library-package-main span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.admin-row-actions {
  min-width: 140px;
  white-space: nowrap;
}
.admin-row-actions button {
  min-height: 34px;
  margin-right: 6px;
  padding: 0 10px;
}
.payment-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.billing-model-note {
  margin: 8px 0 14px;
  padding: 10px 12px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #7a4b12;
  font-size: 13px;
  line-height: 1.65;
}
.payment-plan {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.plan-head span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #244ba8;
  font-size: 12px;
  font-weight: 700;
}
.payment-plan h3 {
  margin: 0 0 4px;
}
.plan-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.plan-price strong {
  font-size: 24px;
  color: var(--text);
}
.plan-price del {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.plan-allowance {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #abefc6;
  border-radius: 999px;
  background: #f6fef9;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}
.plan-desc {
  color: var(--muted);
  font-size: 13px;
}
.plan-desc {
  min-height: 40px;
  line-height: 1.55;
}

.shell {
  width: min(1440px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 24px 0 40px;
  min-width: 0;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.active-workflow-banner {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid #fedf89;
  border-radius: 8px;
  background: #fffbeb;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.06);
}
.active-workflow-banner.hidden { display: none; }
.floating-workflow-queue {
  position: fixed;
  right: 22px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 72;
  display: inline-grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  gap: 10px;
  width: 48px;
  min-height: 48px;
  padding: 0;
  border: 1px solid rgba(185, 133, 52, .42);
  border-radius: 999px;
  background: rgba(255, 253, 250, .96);
  color: #23201b;
  text-align: left;
  box-shadow: 0 18px 46px rgba(30, 25, 18, .16);
  backdrop-filter: blur(14px);
}
.floating-workflow-queue.expanded {
  grid-template-columns: 12px minmax(0, 1fr);
  justify-items: stretch;
  width: min(320px, calc(100vw - 44px));
  min-height: 58px;
  padding: 11px 14px;
  border-radius: 8px;
}
.floating-workflow-queue.hidden { display: none; }
.floating-workflow-queue:hover {
  border-color: rgba(185, 133, 52, .72);
  background: #fffaf1;
  transform: translateY(-1px);
}
.floating-queue-dot {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #12b76a;
  box-shadow: 0 0 0 6px rgba(18, 183, 106, .14);
}
.floating-workflow-queue:not(.expanded) .floating-queue-dot::after {
  content: "";
  position: absolute;
  inset: -13px;
  border: 1px solid rgba(185, 133, 52, .28);
  border-radius: 999px;
}
.floating-workflow-queue:not(.expanded) > span:not(.floating-queue-dot) {
  display: none;
}
.floating-workflow-queue strong,
.floating-workflow-queue small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.floating-workflow-queue strong {
  font-size: 14px;
  line-height: 1.25;
}
.floating-workflow-queue small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.active-workflow-head,
.active-workflow-item,
.run-card-head,
.run-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.active-workflow-head p,
.active-workflow-item span {
  color: var(--muted);
  font-size: 13px;
}
.active-workflow-list {
  display: grid;
  gap: 8px;
}
.active-workflow-item {
  padding: 10px 12px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fff;
}
.run-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #244ba8;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
}
h1 { margin: 0 0 6px; font-size: 24px; }
h2 { margin: 0; font-size: 21px; }
h3 { margin: 0 0 12px; font-size: 16px; }
p { margin: 0; color: var(--muted); line-height: 1.7; }

.view { display: none; }
.view.active { display: block; }
.module-home {
  display: none;
}
.module-home.active {
  min-height: calc(100vh - 96px);
  display: grid;
  place-items: center;
  padding: 8px 0 24px;
}
.module-home-active .topbar > div:first-child {
  display: none;
}
.module-home-active .topbar {
  justify-content: flex-end;
  margin-bottom: 8px;
}
.module-home-active .shell {
  padding-top: 12px;
  padding-bottom: 16px;
}
.module-home-active .app-icp {
  margin-top: 8px;
  padding-top: 0;
}
.module-launcher {
  width: min(1520px, 100%);
  display: grid;
  gap: 12px;
  animation: moduleEnter 520ms cubic-bezier(.2, .8, .2, 1) both;
}
.module-launcher::before {
  display: none;
  content: none;
}
.module-primary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.launcher-main {
  perspective: 1200px;
}
.module-card {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 260px;
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 30px;
  overflow: hidden;
  border: 1px solid rgba(151, 164, 184, .36);
  border-radius: 8px;
  background:
    radial-gradient(circle at 24% 18%, rgba(39, 110, 241, .16), transparent 32%),
    linear-gradient(180deg, #fff, #f8fafc);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  box-shadow: 0 24px 70px rgba(16, 24, 40, .12);
  transform: translateY(10px) scale(.98);
  animation: moduleCardIn 560ms cubic-bezier(.2, .8, .2, 1) 90ms both;
}
.preview-module {
  animation-delay: 220ms;
  background:
    radial-gradient(circle at 75% 20%, rgba(20, 184, 166, .18), transparent 34%),
    linear-gradient(180deg, #fff, #f8fafc);
}
.library-module {
  animation-delay: 150ms;
  background:
    radial-gradient(circle at 76% 18%, rgba(154, 77, 24, .14), transparent 34%),
    linear-gradient(180deg, #fff, #fafcff);
}
.module-card::before {
  content: "";
  position: absolute;
  inset: -35%;
  z-index: -1;
  background: conic-gradient(from 180deg, transparent, rgba(39, 110, 241, .12), transparent, rgba(20, 184, 166, .14), transparent);
  opacity: 0;
  transition: opacity .25s ease, transform .5s ease;
}
.module-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 12%, rgba(255,255,255,.78) 42%, transparent 68%);
  transform: translateX(-120%);
  opacity: .72;
}
.module-card:hover::before {
  opacity: 1;
  transform: rotate(18deg);
}
.module-card:hover::after {
  animation: moduleShine 850ms ease;
}
.module-card:hover,
.module-tool-card:hover {
  transform: translateY(-4px);
  border-color: #b2ccff;
  box-shadow: 0 28px 80px rgba(39, 110, 241, .16);
}
.module-icon {
  width: 72px;
  height: 72px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #276ef1, #14b8a6);
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  box-shadow: 0 18px 42px rgba(39, 110, 241, .22);
}
.module-card strong {
  display: block;
  font-size: 26px;
  line-height: 1.2;
}
.module-card small {
  display: block;
  max-width: 260px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.module-tool-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  animation: moduleCardIn 520ms cubic-bezier(.2, .8, .2, 1) 260ms both;
}
.module-tool-card {
  min-height: 112px;
  display: grid;
  place-items: center;
  gap: 9px;
  padding: 14px 10px;
  border: 1px solid rgba(151, 164, 184, .34);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  color: var(--text);
  box-shadow: 0 16px 42px rgba(16, 24, 40, .08);
  cursor: pointer;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.module-tool-card span {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #eef4ff;
  color: #244ba8;
  font-size: 18px;
  font-weight: 900;
}
.module-tool-card strong {
  font-size: 14px;
  line-height: 1.2;
}
.module-account-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(151, 164, 184, .34);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 16px 42px rgba(16, 24, 40, .08);
}
.module-account-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.module-account-summary span {
  color: var(--muted);
  font-size: 13px;
}
.module-account-summary strong {
  color: var(--text);
  font-size: 16px;
}
.module-account-summary small {
  color: var(--muted);
  font-size: 13px;
}
.module-profile-button {
  min-width: 104px;
  height: 42px;
  border: 1px solid #bfd1f8;
  border-radius: 8px;
  background: #fff;
  color: #244ba8;
  font-weight: 800;
  cursor: pointer;
}
.module-system-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr);
  gap: 18px;
}
.module-system-grid.knowledge-priority {
  grid-template-columns: minmax(330px, .7fr) minmax(540px, 1.3fr);
  align-items: stretch;
}
.module-system-panel {
  min-height: 0;
  padding: 18px;
  border: 1px solid rgba(151, 164, 184, .34);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f8fafc);
  box-shadow: 0 24px 70px rgba(16, 24, 40, .1);
}
.creator-system {
  background:
    radial-gradient(circle at 8% 8%, rgba(39, 110, 241, .1), transparent 26%),
    linear-gradient(180deg, #fff, #f8fafc);
}
.library-system,
.knowledge-system {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 6%, rgba(20, 184, 166, .18), transparent 34%),
    radial-gradient(circle at 10% 100%, rgba(16, 185, 129, .12), transparent 28%),
    linear-gradient(180deg, #fff, #f8fafc);
}
.knowledge-system::before {
  content: "";
  position: absolute;
  inset: -30% -20%;
  z-index: -1;
  background: linear-gradient(110deg, transparent 18%, rgba(255, 255, 255, .82) 42%, transparent 66%);
  transform: translateX(-38%);
  animation: knowledgeSweep 6.8s ease-in-out infinite;
}
.module-system-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.module-system-head h2 {
  margin: 0;
  font-size: 22px;
}
.module-system-head p {
  margin-top: 4px;
  color: var(--muted);
}
.module-system-head.compact-head {
  margin-bottom: 18px;
}
.module-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.module-title-row em {
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff5e8;
  color: #c05621;
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
}
.module-system-mark {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #276ef1, #14b8a6);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 18px 36px rgba(39, 110, 241, .2);
}
.library-system .module-system-mark {
  background: linear-gradient(135deg, #0f766e, #22c55e);
}
.knowledge-system .module-system-mark {
  background: linear-gradient(135deg, #059669, #14b8a6);
  box-shadow: 0 18px 40px rgba(5, 150, 105, .24);
}
.module-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.module-action-grid.compact {
  grid-template-columns: 1fr;
}
.module-action-card {
  min-height: 122px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(151, 164, 184, .34);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.module-action-card:hover {
  transform: translateY(-3px);
  border-color: #b2ccff;
  box-shadow: 0 18px 42px rgba(39, 110, 241, .13);
}
.module-action-card strong {
  font-size: 18px;
}
.module-action-card small {
  color: var(--muted);
  line-height: 1.6;
}
.module-action-card.primary-action {
  border-color: rgba(39, 110, 241, .28);
  background: #f5f8ff;
}
.creator-menu {
  display: grid;
  gap: 10px;
}
.creator-menu-item,
.knowledge-shortcut {
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(151, 164, 184, .28);
  border-radius: 8px;
  background: rgba(255,255,255,.9);
  color: var(--text);
  text-align: left;
  box-shadow: 0 12px 34px rgba(16, 24, 40, .06);
  cursor: pointer;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.creator-menu-item:hover,
.knowledge-shortcut:hover {
  transform: translateX(4px);
  border-color: #b2ccff;
  box-shadow: 0 18px 46px rgba(39, 110, 241, .13);
}
.creator-menu-item.primary-action {
  border-color: rgba(39, 110, 241, .32);
  background: #f5f8ff;
}
.module-action-icon {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #2f7bf6, #22a7f0);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(39, 110, 241, .2);
}
.module-action-icon.gold {
  background: linear-gradient(135deg, #f59e0b, #facc15);
  box-shadow: 0 14px 28px rgba(245, 158, 11, .2);
}
.creator-menu-item strong,
.knowledge-shortcut strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
}
.creator-menu-item small,
.knowledge-shortcut small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.55;
}
.creator-menu-item i,
.knowledge-shortcut i {
  color: #98a2b3;
  font-size: 30px;
  font-style: normal;
  transition: transform .2s ease, color .2s ease;
}
.creator-menu-item:hover i,
.knowledge-shortcut:hover i {
  color: #276ef1;
  transform: translateX(3px);
}
.knowledge-hero-card {
  position: relative;
  min-height: 248px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 14px;
  align-items: center;
  padding: 24px 28px;
  overflow: hidden;
  border: 1px solid rgba(16, 185, 129, .46);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(236, 253, 245, .92), rgba(255,255,255,.94) 46%, rgba(209, 250, 229, .7));
  box-shadow: 0 24px 70px rgba(5, 150, 105, .16), inset 0 0 0 1px rgba(255,255,255,.72);
  animation: knowledgeGlow 4.8s ease-in-out infinite;
}
.knowledge-hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 12%, rgba(255,255,255,.82) 44%, transparent 70%);
  transform: translateX(-120%);
  animation: knowledgeShine 5.8s ease-in-out infinite;
}
.knowledge-hero-copy {
  position: relative;
  z-index: 2;
}
.knowledge-eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  color: #047857;
  font-size: 14px;
  font-weight: 900;
}
.knowledge-hero-copy h3 {
  margin: 0;
  color: #0f172a;
  font-size: 29px;
  line-height: 1.22;
}
.knowledge-hero-copy p {
  max-width: 480px;
  margin-top: 8px;
  color: #475467;
  font-size: 15px;
}
.knowledge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
.knowledge-primary-button,
.knowledge-secondary-button {
  height: 42px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}
.knowledge-primary-button {
  border: 1px solid #047857;
  background: linear-gradient(135deg, #10b981, #047857);
  color: #fff;
  box-shadow: 0 18px 42px rgba(5, 150, 105, .24);
}
.knowledge-primary-button span {
  display: inline-block;
  margin-left: 6px;
  transition: transform .18s ease;
}
.knowledge-primary-button:hover span {
  transform: translateX(4px);
}
.knowledge-secondary-button {
  border: 1px solid rgba(5, 150, 105, .28);
  background: rgba(255,255,255,.82);
  color: #0f513f;
}
.knowledge-visual {
  position: relative;
  z-index: 1;
  min-height: 184px;
  animation: knowledgeFloat 4.6s ease-in-out infinite;
}
.knowledge-book {
  position: absolute;
  right: 36px;
  top: 20px;
  width: 98px;
  height: 124px;
  border: 1px solid rgba(4, 120, 87, .3);
  border-radius: 8px 14px 14px 8px;
  background: linear-gradient(135deg, #34d399, #059669 58%, #047857);
  box-shadow: 0 28px 50px rgba(5, 150, 105, .28);
}
.knowledge-book::before,
.knowledge-book::after {
  content: "";
  position: absolute;
  top: 9px;
  width: 12px;
  height: 108px;
  border-radius: 8px;
  background: rgba(255,255,255,.34);
}
.knowledge-book::before { left: 12px; }
.knowledge-book::after { right: -15px; background: rgba(4, 120, 87, .22); }
.knowledge-book span {
  position: absolute;
  left: 34px;
  top: 48px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,.34);
  box-shadow: inset 0 0 0 12px rgba(255,255,255,.26);
}
.knowledge-page {
  position: absolute;
  width: 58px;
  height: 70px;
  border: 1px solid rgba(20, 184, 166, .22);
  border-radius: 8px;
  background: rgba(255,255,255,.62);
  box-shadow: 0 16px 34px rgba(16, 24, 40, .08);
}
.page-one { left: 14px; top: 54px; transform: rotate(-7deg); }
.page-two { right: 2px; top: 10px; transform: rotate(8deg); }
.knowledge-orbit {
  position: absolute;
  border: 1px solid rgba(20, 184, 166, .28);
  border-radius: 999px;
  transform: rotate(-18deg);
}
.orbit-one { right: 8px; top: 40px; width: 188px; height: 78px; }
.orbit-two { right: 28px; top: 64px; width: 150px; height: 58px; animation: orbitPulse 3.8s ease-in-out infinite; }
.knowledge-feature-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid rgba(16, 185, 129, .16);
  border-radius: 8px;
  background: rgba(255,255,255,.84);
}
.knowledge-feature-row span {
  color: #047857;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}
.knowledge-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.knowledge-shortcut {
  min-height: 88px;
  background: rgba(255,255,255,.88);
}
.knowledge-shortcut.passive {
  cursor: default;
}
.knowledge-shortcut.passive:hover {
  transform: none;
  border-color: rgba(151, 164, 184, .28);
  box-shadow: 0 12px 34px rgba(16, 24, 40, .06);
}
@keyframes moduleEnter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes moduleCardIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes moduleShine {
  from { transform: translateX(-120%); }
  to { transform: translateX(120%); }
}
@keyframes moduleLine {
  0%, 100% { opacity: .35; transform: scaleX(.92); }
  50% { opacity: 1; transform: scaleX(1); }
}
@keyframes knowledgeSweep {
  0%, 58%, 100% { transform: translateX(-42%); opacity: 0; }
  24% { transform: translateX(18%); opacity: .8; }
}
@keyframes knowledgeShine {
  0%, 46%, 100% { transform: translateX(-120%); opacity: 0; }
  58% { opacity: .82; }
  78% { transform: translateX(120%); opacity: 0; }
}
@keyframes knowledgeGlow {
  0%, 100% { box-shadow: 0 24px 70px rgba(5, 150, 105, .14), inset 0 0 0 1px rgba(255,255,255,.72); }
  50% { box-shadow: 0 28px 84px rgba(5, 150, 105, .22), inset 0 0 0 1px rgba(255,255,255,.82); }
}
@keyframes knowledgeFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes orbitPulse {
  0%, 100% { opacity: .35; transform: rotate(-18deg) scale(.96); }
  50% { opacity: .75; transform: rotate(-18deg) scale(1.03); }
}
@media (prefers-reduced-motion: reduce) {
  .knowledge-system::before,
  .knowledge-hero-card,
  .knowledge-hero-card::after,
  .knowledge-visual,
  .orbit-two {
    animation: none;
  }
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  min-width: 0;
  box-shadow: var(--shadow);
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin: 6px 0 14px;
}
.page-head.compact-head { margin-bottom: 10px; }
.page-head p { max-width: 760px; }
.workflow-steps-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 36px;
  margin-bottom: 18px;
}
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 0;
}
.steps .preview-step { display: none; }
.step {
  border: 1px solid var(--line);
  background: #fff;
  color: #475467;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-align: center;
  font-weight: 600;
}
.step strong {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475467;
  font-size: 13px;
}
.step span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.active { border-color: #9fc2ff; background: var(--blue-soft); color: #244ba8; }
.step.active strong { background: var(--blue); color: #fff; }
.workflow-step-actions {
  min-width: 112px;
  justify-content: flex-start;
}

.flow-page { display: none; min-height: calc(100vh - 160px); }
.flow-page.active { display: block; }
.workflow-mobile-title { display: none; }
.workflow-quota-bar {
  display: none;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}
.compact-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}
.form-sections {
  display: grid;
  gap: 18px;
}
.form-section {
  display: grid;
  gap: 12px;
}
.form-section h3 {
  margin: 0;
  color: #344054;
  font-size: 15px;
}
.advanced-options {
  margin-top: 16px;
  color: var(--muted);
}
.advanced-options summary {
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  color: #475467;
}
.advanced-options .check {
  margin-top: 12px;
}
.advanced-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.model-options {
  display: grid;
  gap: 12px;
  max-height: 360px;
  overflow: auto;
}
.model-vendor {
  display: grid;
  gap: 8px;
}
.model-vendor h4 {
  margin: 0;
  color: #344054;
  font-size: 13px;
}
.model-vendor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}
.model-option {
  display: grid;
  gap: 3px;
  justify-items: start;
  text-align: left;
  padding: 9px 10px;
}
.model-option strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-option span {
  color: var(--muted);
  font-size: 12px;
}
.model-option.active {
  border-color: #b2ccff;
  background: var(--blue-soft);
  color: #244ba8;
}
.split-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.8fr) minmax(480px, 1.2fr);
  gap: 16px;
}
.generation-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 14px;
  min-height: calc(100vh - 220px);
  align-items: stretch;
}
.result-workbench {
  display: grid;
  grid-template-columns: 300px minmax(460px, 1fr) 380px;
  gap: 16px;
  min-height: 520px;
}
.bottom-review {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 380px;
  gap: 18px;
}
.settings-layout {
  display: grid;
  gap: 16px;
}
.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}
.settings-modal.active { display: block; }
.settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}
.settings-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(1180px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.24);
  overflow: hidden;
}
.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.settings-header p { margin-top: 4px; }
.settings-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  padding: 12px 20px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}
.settings-tab {
  border-color: transparent;
  background: transparent;
  color: #475467;
  font-weight: 700;
}
.settings-tab.active {
  border-color: #b2ccff;
  background: #eef4ff;
  color: #244ba8;
}
.settings-body {
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 20px;
}
.settings-tab-panel { display: none; }
.settings-tab-panel.active { display: block; }
.settings-single-mode .settings-tabs {
  display: none;
}
.settings-single-mode .settings-dialog {
  grid-template-rows: auto minmax(0, 1fr);
}
.settings-library-admin-only #settingsTabAdmin .settings-layout > .panel:first-child {
  display: none;
}
.settings-library-admin-only #settingsTabAdmin .settings-layout {
  grid-template-columns: 1fr;
}
.settings-tab-panel > .actions,
.settings-layout > .actions {
  justify-content: flex-start;
}
.settings-actions {
  position: sticky;
  bottom: -20px;
  z-index: 3;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 12px;
  margin: 18px -20px -20px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}
.settings-note {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.category-editor {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  margin-top: 14px;
}
.category-tabs {
  display: grid;
  gap: 8px;
  align-content: start;
  max-height: 560px;
  overflow: auto;
}
.category-tab {
  display: grid;
  gap: 4px;
  justify-items: start;
  text-align: left;
  padding: 11px 12px;
}
.category-tab strong {
  line-height: 1.35;
}
.category-tab span {
  max-width: 100%;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.category-tab.active {
  border-color: #b2ccff;
  background: #eef4ff;
  color: #244ba8;
}
.category-tab.active span {
  color: #3b5fb8;
}
.category-form {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--soft);
}
.category-form-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.category-form-head strong {
  font-size: 16px;
}
.category-form-head button {
  padding: 7px 10px;
  font-size: 13px;
}

#addCategory.add-category-highlight {
  border-color: #c9963a;
  background: linear-gradient(180deg, #2b2117, #11100e);
  color: #ffd978;
  box-shadow: 0 10px 24px rgba(43, 32, 18, .18);
  font-weight: 900;
}

#addCategory.add-category-highlight:hover {
  transform: translateY(-1px);
  border-color: #d7aa54;
  background: linear-gradient(180deg, #352818, #15120e);
  color: #ffe49a;
}

#quickAddCategory {
  border-color: #c9963a;
  background: linear-gradient(180deg, #2b2117, #11100e);
  color: #ffd978;
  box-shadow: 0 8px 18px rgba(43, 32, 18, .16);
  font-weight: 900;
}

#quickAddCategory:hover {
  transform: translateY(-1px);
  border-color: #d7aa54;
  color: #ffe49a;
}

.admin-plan-settings {
  display: grid;
  gap: 18px;
}

.admin-plan-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.admin-plan-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
}

.admin-plan-head p {
  margin: 6px 0 0;
  color: #64748b;
}

.admin-plan-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

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

.admin-plan-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #eadfce;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #fffdf8);
  box-shadow: 0 16px 40px rgba(43, 32, 18, .08);
}

.admin-plan-card:hover {
  border-color: #c9963a;
  box-shadow: 0 20px 48px rgba(43, 32, 18, .13);
}

.admin-plan-card label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.admin-plan-card input,
.admin-plan-card textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #e2d6c4;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.admin-plan-card textarea {
  resize: vertical;
}

.admin-plan-card-head,
.admin-plan-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-plan-card-head {
  grid-template-columns: minmax(0, 1fr) 110px;
}

.admin-plan-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 2px;
}

.admin-plan-toggles label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #eadfce;
  border-radius: 999px;
  background: #fff8e9;
  color: #8a5b14;
  font-size: 13px;
}

.admin-plan-toggles input {
  width: auto;
}

.admin-referral-panel {
  display: grid;
  gap: 16px;
}

.admin-referral-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.admin-referral-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
}

.admin-referral-head p {
  margin: 6px 0 0;
  color: #64748b;
}

.admin-referral-section {
  display: grid;
  gap: 12px;
}

.admin-referral-table td strong,
.admin-referral-records td strong {
  display: block;
  color: var(--ink);
}

.admin-referral-table td small,
.admin-referral-records td small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.admin-referral-table code {
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff8e9;
  color: #9a661a;
  font-weight: 900;
}

.admin-referral-records .admin-row-actions {
  min-width: 170px;
}

.admin-referral-records .admin-row-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

label { display: grid; gap: 7px; color: #344054; font-size: 14px; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(39, 110, 241, 0.12);
  border-color: #84adff;
}
.category-select-row span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.category-select-row button {
  height: 48px;
  padding-inline: 14px;
  white-space: nowrap;
}
textarea { resize: vertical; }
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.check input { width: auto; }
.autopilot-box {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(180px, 1fr);
  gap: 12px 16px;
  align-items: end;
  border: 1px solid #c7d7fe;
  border-radius: 8px;
  padding: 14px;
  background: #f5f8ff;
}
.autopilot-box .check { margin: 0 0 10px; }
.autopilot-box p { grid-column: 1 / -1; }
.autopilot-mode #flowSteps .step[data-step="2"],
.autopilot-mode #flowSteps .step[data-step="3"] {
  opacity: 0.52;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.actions.slim { margin-top: 0; }
button, .button-link {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
button.primary:hover { background: var(--blue-dark); }
button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}
button.secondary { background: #eef4ff; border-color: #c7d7fe; color: #244ba8; }
button.danger { color: var(--red); border-color: #f4b8b0; background: #fff7f6; }
button.danger.is-stopping {
  color: #9a3412;
  border-color: #fed7aa;
  background: #fff7ed;
}
button.ghost-danger { background: #fff; }
.button-link { margin-top: 10px; color: #244ba8; background: #eef4ff; border-color: #c7d7fe; }
.button-link.disabled { opacity: 0.5; pointer-events: none; }

.flow-footer, .toolbar, .panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.flow-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 20px -20px -20px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-radius: 0 0 8px 8px;
}
.flow-footer .muted {
  color: #344054;
  font-weight: 600;
}
.flow-footer-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
}
.quota-dock {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 8px;
}
.quota-dock:empty {
  display: none;
}
.quota-dock div {
  min-width: 104px;
  padding: 7px 10px;
  border: 1px solid #d7e3f7;
  border-radius: 8px;
  background: #f8fbff;
}
.quota-dock strong,
.quota-dock span {
  display: block;
}
.quota-dock strong {
  color: #182033;
  font-size: 15px;
  line-height: 1.2;
}
.quota-dock span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.toolbar { margin-bottom: 10px; }
.toolbar strong { display: block; font-size: 17px; }
.toolbar span { color: var(--muted); font-size: 13px; }
.queue-quota-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
  padding: 12px 14px;
  border: 1px solid #b2ccff;
  border-radius: 8px;
  background: #eef4ff;
  color: #244ba8;
  font-weight: 700;
}
.queue-quota-hint span {
  min-width: 0;
  line-height: 1.5;
}
.quota-upgrade-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border-color: #d8a35a;
  background: #fffdfa;
  color: #8d6427;
  font-size: 13px;
  font-weight: 850;
}
.queue-quota-hint.error .quota-upgrade-button {
  border-color: #f4b8b0;
  background: #fff;
  color: var(--red);
}
.queue-quota-hint.error {
  border-color: #fecdca;
  background: #fff7f6;
  color: var(--red);
}
.queue-quota-hint.success {
  border-color: #abefc6;
  background: #f6fef9;
  color: var(--green);
}
.muted { color: var(--muted); }
.hidden { display: none !important; }
.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--soft);
}
.notice.error { color: var(--red); }
.notice.success { color: var(--green); }
.notice.warn {
  color: var(--amber);
  margin-bottom: 8px;
}
.app-dialog-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
}
.app-dialog-modal.active {
  display: block;
}
.app-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .42);
}
.app-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(460px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(16, 24, 40, .24);
}
.app-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.app-dialog-head span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}
.app-dialog-head h2 {
  margin-top: 4px;
  font-size: 20px;
}
.app-dialog-body {
  padding: 18px;
}
.app-dialog-body p {
  color: #344054;
  white-space: pre-wrap;
}
.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--soft);
}
.app-dialog-modal.error .app-dialog-head span {
  color: var(--red);
}

.app-dialog-modal.workflow-confirm .app-dialog {
  width: min(760px, calc(100vw - 32px));
  border-color: #e7d6bd;
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 14%, rgba(197, 138, 33, 0.08), transparent 30%),
    linear-gradient(135deg, #fff, #fffdf6);
  box-shadow: 0 24px 70px rgba(20, 20, 20, 0.22);
}

.app-dialog-modal.workflow-confirm .app-dialog-head {
  padding: 22px 32px 18px;
  border-bottom-color: #e8ddcd;
  background: #fff;
}

.app-dialog-modal.workflow-confirm .app-dialog-head span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid #f3d19b;
  border-radius: 999px;
  background: #fff1d7;
  color: #b47718;
  font-size: 13px;
  font-weight: 900;
}

.app-dialog-modal.workflow-confirm .app-dialog-head h2 {
  margin-top: 12px;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.18;
}

.app-dialog-modal.workflow-confirm .app-dialog-body {
  padding: 20px 32px 22px;
}

.app-dialog-modal.workflow-confirm .app-dialog-actions {
  padding: 16px 32px;
  border-top-color: #e8ddcd;
  background: #fbfcfe;
}

.app-dialog-modal.workflow-confirm .app-dialog-actions button {
  min-width: 126px;
  min-height: 46px;
  border-radius: 13px;
  font-size: 16px;
  font-weight: 850;
}

.app-dialog-modal.workflow-confirm .app-dialog-actions button.primary {
  min-width: 210px;
  border-color: #111;
  background: linear-gradient(180deg, #17130e, #060504);
  color: #f5c45d;
  box-shadow: 0 16px 36px rgba(20, 20, 20, .18);
}

.workflow-confirm-card {
  display: grid;
  gap: 14px;
}

.workflow-confirm-card p {
  margin: 0;
  color: #64748b;
  line-height: 1.6;
}

.workflow-confirm-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.workflow-confirm-card dl div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  background: #fffdf8;
}

.workflow-confirm-card dt {
  color: #64748b;
  font-weight: 800;
}

.workflow-confirm-card dd {
  margin: 0;
  color: var(--ink);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.workflow-confirm-redesign {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(0, 1.5fr);
  gap: 14px;
  align-items: stretch;
}

.workflow-confirm-redesign .workflow-confirm-lead {
  grid-column: 1 / -1;
  margin: 0;
  color: #66758a;
  font-size: 15px;
  line-height: 1.55;
}

.workflow-confirm-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-height: 118px;
  padding: 18px 20px;
  border: 1px solid #e9d5b6;
  border-radius: 14px;
  background: linear-gradient(105deg, #fff7e8, #fff);
}

.workflow-confirm-hero span {
  display: block;
  color: #8b5e13;
  font-size: 13px;
  font-weight: 850;
}

.workflow-confirm-hero strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 950;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.workflow-confirm-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.workflow-confirm-card .workflow-confirm-metrics div {
  display: block;
  grid-template-columns: none;
  min-width: 0;
  min-height: 118px;
  padding: 16px 14px;
  border: 1px solid #e8dccb;
  border-radius: 14px;
  background: #fff;
}

.workflow-confirm-metrics dt {
  display: flex;
  gap: 7px;
  align-items: center;
  color: #65748a;
  font-size: 13px;
  font-weight: 850;
}

.workflow-confirm-metrics dt span {
  position: relative;
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid #e6be76;
  border-radius: 999px;
  background: #fff4df;
}

.workflow-confirm-metrics dt span::after {
  width: 9px;
  height: 5px;
  border: solid #b47718;
  border-width: 0 0 2px 2px;
  content: "";
  transform: rotate(-45deg) translate(1px, -1px);
}

.workflow-confirm-card .workflow-confirm-metrics dd {
  margin: 22px 0 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 950;
  line-height: 1.2;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

@media (max-width: 640px) {
  .app-dialog-modal.workflow-confirm .app-dialog-head,
  .app-dialog-modal.workflow-confirm .app-dialog-body,
  .app-dialog-modal.workflow-confirm .app-dialog-actions {
    padding-left: 20px;
    padding-right: 20px;
  }

  .workflow-confirm-redesign {
    grid-template-columns: 1fr;
  }

  .workflow-confirm-metrics {
    grid-template-columns: 1fr;
  }

  .app-dialog-modal.workflow-confirm .app-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .app-dialog-modal.workflow-confirm .app-dialog-actions button,
  .app-dialog-modal.workflow-confirm .app-dialog-actions button.primary {
    width: 100%;
    min-width: 0;
  }
}
.save-status {
  align-self: center;
  min-height: 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: right;
}
.save-status.success { color: var(--green); }
.save-status.error { color: var(--red); }

.compact-list, .topic-list, .job-list {
  display: grid;
  gap: 10px;
  overflow: auto;
}
.compact-list { max-height: 560px; }
.topic-list { max-height: calc(100vh - 300px); }
.job-list { max-height: calc(100vh - 360px); }
.next-action {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
}
.mini-card, .topic-item, .job, .result-job {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.mini-card {
  display: grid;
  gap: 5px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.mini-card:hover,
.topic-item:hover,
.job:hover,
.result-job:hover {
  border-color: #b2ccff;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.06);
}
.mini-card span { color: var(--muted); }

.topic-generating-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid #eadfce;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 248, 233, .92), rgba(255, 255, 255, .98)),
    #fff;
  box-shadow: 0 14px 36px rgba(43, 32, 18, .08);
}

.topic-generating-head {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.topic-generating-head strong,
.topic-generating-head span {
  display: block;
}

.topic-generating-head strong {
  color: var(--ink);
  font-size: 18px;
}

.topic-generating-head span {
  margin-top: 4px;
  color: #64748b;
  line-height: 1.5;
}

.topic-orbit {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid #eadfce;
  border-radius: 50%;
  background: #fff8e9;
  animation: topicPulse 1.7s ease-in-out infinite;
}

.topic-orbit i {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c9963a;
  box-shadow: 0 0 0 5px rgba(201, 150, 58, .12);
  animation: topicDot 1.4s ease-in-out infinite;
}

.topic-orbit i:nth-child(1) {
  left: 8px;
  top: 9px;
}

.topic-orbit i:nth-child(2) {
  right: 8px;
  top: 16px;
  animation-delay: .18s;
}

.topic-orbit i:nth-child(3) {
  left: 18px;
  bottom: 8px;
  animation-delay: .36s;
}

.topic-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #f2eadf;
}

.topic-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9a661a, #ffd978, #9a661a);
  animation: topicProgress 1.25s ease-in-out infinite;
}

.topic-loading-list {
  display: grid;
  gap: 10px;
}

.topic-loading-card {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #f0e4d2;
  border-radius: 9px;
  background: rgba(255, 255, 255, .82);
  animation: topicCardFloat 1.6s ease-in-out infinite;
  animation-delay: calc(var(--delay) * .16s);
}

.topic-loading-card span,
.topic-loading-card strong,
.topic-loading-card em {
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, #f1e7d7 0%, #fff6e6 46%, #f1e7d7 100%);
  background-size: 220% 100%;
  animation: topicSkeleton 1.3s ease-in-out infinite;
  animation-delay: calc(var(--delay) * .12s);
}

.topic-loading-card span {
  width: 22px;
  height: 22px;
  grid-row: span 2;
}

.topic-loading-card strong {
  height: 14px;
  width: min(88%, 460px);
}

.topic-loading-card em {
  height: 10px;
  width: min(58%, 280px);
}

@keyframes topicPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(201, 150, 58, .18); }
  50% { transform: scale(1.04); box-shadow: 0 0 0 8px rgba(201, 150, 58, 0); }
}

@keyframes topicDot {
  0%, 100% { transform: translateY(0); opacity: .65; }
  50% { transform: translateY(-4px); opacity: 1; }
}

@keyframes topicProgress {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(250%); }
}

@keyframes topicSkeleton {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

@keyframes topicCardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
.topic-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.topic-item div { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.topic-item input { width: auto; margin-top: 6px; }
.topic-item span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef4ff;
  color: #244ba8;
  font-size: 13px;
}
.topic-item strong { font-weight: 600; line-height: 1.55; }
.topic-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.5;
}
.row-actions { flex: 0 0 auto; }
.row-actions button { padding: 7px 9px; font-size: 13px; }
.side-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.side-panel-head h3 { margin: 0; }
.side-panel-head button {
  padding: 6px 9px;
  font-size: 13px;
}

.workflow-generate-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}
.workflow-generate-head > div:first-child {
  display: none;
}
.workflow-generate-head h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.15;
  color: #182230;
}
.workflow-generate-head p {
  margin: 8px 0 0;
  color: #667085;
  font-size: 18px;
  font-weight: 700;
}
.workflow-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.workflow-head-actions button {
  min-width: 92px;
  min-height: 44px;
  border-radius: 8px;
  font-size: 18px;
}
.workflow-stage-stepper {
  display: none;
  grid-template-columns: auto minmax(24px, 1fr) auto minmax(24px, 1fr) auto minmax(24px, 1fr) auto;
  align-items: start;
  gap: 8px;
  margin: 0 0 20px;
}
.workflow-stage-stepper span {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #344054;
  font-weight: 800;
}
.workflow-stage-stepper strong {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #cfd6e2;
  border-radius: 999px;
  background: #f8fafc;
  color: #182230;
  font-size: 18px;
}
.workflow-stage-stepper em {
  font-style: normal;
  font-size: 15px;
}
.workflow-stage-stepper i {
  height: 2px;
  margin-top: 19px;
  background: #d0d5dd;
}
.workflow-stage-stepper .active strong {
  border-color: #b87512;
  background: #242424;
  color: #fff;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #c47a0a;
}
.workflow-stage-stepper .active em { color: #c47a0a; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
  background: var(--soft);
}
.stats strong {
  display: block;
  font-size: clamp(14px, 2vw, 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats span { color: var(--muted); font-size: 12px; }
#flowPage4 #workflowStats.stats {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .78);
}
#flowPage4 #workflowStats.stats div {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  flex: 1 1 0;
  min-width: 0;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid #d0d5dd;
  border-radius: 0;
  background: transparent;
}
#flowPage4 #workflowStats.stats div:last-child { border-right: 0; }
#flowPage4 #workflowStats.stats strong {
  order: 2;
  font-size: 20px;
  line-height: 1;
  color: #182230;
}
#flowPage4 #workflowStats.stats span {
  order: 1;
  color: #667085;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
.workflow-stop-notice {
  margin: -2px 0 12px;
  padding: 9px 10px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}
.workflow-stop-notice.hidden { display: none; }
.workflow-job-tabs {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  padding: 14px 0 0;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.workflow-job-tabs button {
  position: relative;
  flex: 0 0 auto;
  padding: 12px 0 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #667085;
  font-size: 16px;
  font-weight: 800;
}
.workflow-job-tabs button span {
  margin-left: 6px;
  color: inherit;
}
.workflow-job-tabs button.active {
  color: var(--blue);
}
.workflow-job-tabs button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 999px;
  background: var(--blue);
}
.workflow-job-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 210px);
  gap: 12px;
  margin-bottom: 14px;
}
#flowPage4 .workflow-job-toolbar {
  display: none !important;
}
.workflow-job-search {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #98a2b3;
}
.workflow-job-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  font-size: 15px;
}
.workflow-job-search input:focus {
  outline: none;
  box-shadow: none;
}
#workflowJobStatusFilter {
  min-height: 42px;
  border-radius: 8px;
  background: #fff;
}
.workflow-job-header {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 100px 120px 72px 42px;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #667085;
  font-size: 14px;
  font-weight: 800;
}
.workflow-job-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 100px 120px 72px 42px;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-width: 0 0 1px;
  border-radius: 0;
  box-shadow: none;
}
.workflow-job-row:first-child {
  border-top: 1px solid var(--line);
}
.workflow-job-row.active {
  background: #f8fbff;
  box-shadow: inset 3px 0 0 var(--blue);
}
.workflow-job-row .job-info {
  min-width: 0;
}
.workflow-job-row strong {
  display: block;
  color: #182230;
  font-size: 16px;
  line-height: 1.4;
}
.workflow-job-row .job-info span {
  display: block;
  margin-top: 3px;
  color: #667085;
  font-size: 14px;
}
.job-status-badge {
  justify-self: start;
  padding: 6px 9px;
  border-radius: 6px;
  background: #f2f4f7;
  color: #667085;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}
.job-status-badge.running {
  background: #eaf2ff;
  color: var(--blue);
}
.job-status-badge.pending {
  background: #fff7ed;
  color: #b45309;
}
.job-status-badge.completed {
  background: #ecfdf3;
  color: #067647;
}
.job-status-badge.failed {
  background: #fff1f0;
  color: #b42318;
}
.job-progress-cell {
  display: grid;
  gap: 6px;
  justify-items: center;
  color: #344054;
  font-size: 14px;
}
.job-progress-cell i {
  display: block;
  width: 72px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e7ec;
}
.job-progress-cell b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}
.workflow-job-row time {
  color: #667085;
  font-size: 15px;
}
.workflow-job-row time span + span::before {
  content: " · ";
}
.job-view-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--blue);
  font-size: 21px;
  line-height: 1;
}
.job-view-button:hover {
  background: #eef4ff;
}
.job strong, .result-job strong { display: block; line-height: 1.45; }
.job span, .result-job span { color: var(--muted); font-size: 13px; }
.job.running, .result-job.running { border-color: #b2ccff; background: #f5f8ff; }
.job.completed, .result-job.completed { border-color: #abefc6; background: #f6fef9; }
.job.failed, .result-job.failed { border-color: #fecdca; background: #fff7f6; }
.job.skipped, .result-job.skipped { opacity: 0.65; }
.job.running strong, .result-job.running strong { color: #244ba8; }
.job.completed strong, .result-job.completed strong { color: var(--green); }
.job.failed strong, .result-job.failed strong { color: var(--red); }

.timeline {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0 0 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
}
.timeline-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  color: #475467;
  min-width: 122px;
  flex: 0 0 122px;
  display: flex;
  align-items: center;
  gap: 7px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.compact-timeline {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 10px;
}
.timeline-item::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  background: #fff;
  flex: 0 0 auto;
}
.timeline-item strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-item span { color: var(--muted); font-size: 13px; }
.timeline-item.pending {
  border-color: #d8dee8;
  background: #f8fafc;
  color: #667085;
}
.timeline-item.running {
  border-color: #84adff;
  background: #eef4ff;
  color: #244ba8;
  box-shadow: 0 0 0 2px rgba(39, 110, 241, 0.08);
}
.timeline-item.running::before {
  border-color: var(--blue);
  background: radial-gradient(circle at center, var(--blue) 0 34%, #fff 38%);
}
.timeline-item.completed {
  border-color: #75e0a7;
  background: #f6fef9;
  color: #067647;
}
.timeline-item.completed::before {
  content: "✓";
  display: grid;
  place-items: center;
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.timeline-item.failed {
  border-color: #fda29b;
  background: #fff7f6;
  color: #b42318;
}
.timeline-item.failed::before {
  content: "!";
  display: grid;
  place-items: center;
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.timeline-item.skipped {
  border-style: dashed;
  opacity: 0.68;
}

.live-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: stretch;
  min-height: calc(100vh - 260px);
}
pre, .result {
  white-space: pre-wrap;
  background: #0b1220;
  color: #d6e2ff;
  border-radius: 8px;
  padding: 14px;
  overflow: auto;
  margin: 0;
}
#liveText {
  height: calc(100vh - 390px);
  min-height: 360px;
  overflow: auto;
  padding: 18px 22px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.9;
  border-radius: 8px;
}
#liveText h2,
#liveText h3,
#liveText h4 {
  margin: 22px 0 10px;
  color: #101828;
  line-height: 1.45;
}
#liveText h2 { font-size: 20px; }
#liveText h3 { font-size: 18px; }
#liveText h4 { font-size: 16px; }
#liveText p {
  margin: 0 0 16px;
  color: #182033;
  line-height: 1.9;
}
#liveText strong { font-weight: 700; }
#liveText code {
  background: #eef2f7;
  border-radius: 4px;
  padding: 1px 5px;
}
#liveText .image-ref,
#liveText .list-line {
  color: #475467;
}
.result.small { min-height: 80px; max-height: 112px; }
.settings-result {
  margin-top: 14px;
  max-height: 120px;
}
.reader-panel, .image-panel { min-width: 0; }
.reader-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
}
.image-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}
.image-panel h3 { margin-bottom: 8px; }
.log-strip {
  align-self: end;
}
.log-strip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.log-strip-head button {
  padding: 5px 9px;
  font-size: 13px;
}
.current-event {
  min-height: 48px;
  border: 1px solid #c7d7fe;
  border-radius: 8px;
  background: #eef4ff;
  color: #244ba8;
  padding: 10px 11px;
  line-height: 1.55;
  font-size: 13px;
}

.article-image {
  max-width: 680px;
  margin: 24px auto;
}
.article-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #eef2f7;
  cursor: zoom-in;
}
.article-image img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #eef2f7;
}
.article-image figcaption {
  text-align: center;
  background: #fff;
}

.thumb-grid, .image-card-grid {
  display: grid;
  gap: 10px;
  align-content: start;
}
.thumb-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: calc(100vh - 480px);
  overflow: auto;
}
.thumb-grid figure:first-child { grid-column: 1 / -1; }
.image-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
figure { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.image-thumb-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #eef2f7;
  cursor: zoom-in;
}
.image-kind {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 1;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1.4;
}
figure img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #eef2f7;
}
figcaption {
  display: grid;
  gap: 4px;
  padding: 8px;
  font-size: 12px;
  color: var(--muted);
}
figcaption code, .artifact-list code {
  word-break: break-all;
  white-space: pre-wrap;
}

body.lightbox-open { overflow: hidden; }
.image-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
}
.image-lightbox.active { display: block; }
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 12, 24, 0.82);
}
.lightbox-stage {
  position: absolute;
  inset: 28px;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
}
.lightbox-stage img {
  max-width: min(1400px, calc(100vw - 150px));
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
}
.lightbox-close {
  top: 0;
  right: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 28px;
}
.lightbox-nav {
  top: 50%;
  width: 46px;
  height: 64px;
  padding: 0;
  transform: translateY(-50%);
  font-size: 38px;
}
.lightbox-prev { left: 0; }
.lightbox-next { right: 0; }
.lightbox-caption {
  max-width: min(1100px, calc(100vw - 120px));
  margin-top: 12px;
  color: #dbe7ff;
  font-size: 13px;
  word-break: break-all;
  text-align: center;
}

.summary-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 980;
}
.summary-modal.active { display: block; }
.summary-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: grayscale(0.2);
}
.summary-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(820px, calc(100vw - 40px));
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdfa;
  box-shadow: 0 24px 80px rgba(16, 24, 40, 0.22);
  overflow: hidden;
}
.summary-dialog header,
.summary-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 40px 44px 22px;
  border-bottom: 0;
}
.summary-dialog footer {
  justify-content: space-between;
  padding: 24px 44px 16px;
  border-top: 1px solid #e5d8c5;
  border-bottom: 0;
  background: #fffdfa;
}
.summary-dialog h2 {
  margin: 0;
  color: #111827;
  font-size: 28px;
  line-height: 1.15;
}
.summary-dialog header p {
  margin: 5px 0 0;
  color: #526275;
  font-size: 16px;
  line-height: 1.5;
}
.summary-head-main {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 0;
}
.summary-success-icon {
  position: relative;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border: 1px solid #9ee6b6;
  border-radius: 50%;
  background: #eafbf0;
}
.summary-success-icon::after {
  content: "";
  position: absolute;
  left: 24px;
  top: 15px;
  width: 18px;
  height: 36px;
  border-right: 5px solid #119b5a;
  border-bottom: 5px solid #119b5a;
  transform: rotate(38deg);
}
.summary-dialog .icon-button {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-color: #d9e1ec;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
}
.summary-body {
  display: grid;
  gap: 36px;
  padding: 22px 44px 28px;
}
.summary-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.summary-stat {
  min-height: 102px;
  display: grid;
  align-content: center;
  padding: 18px 22px;
  border: 1px solid #d8e2ee;
  border-radius: 10px;
  background: #f8fbff;
}
.summary-stat strong,
.summary-stat span {
  display: block;
}
.summary-stat strong {
  color: #111827;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: 0;
  white-space: nowrap;
}
.summary-stat span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}
.summary-save-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 72px;
  padding: 20px 28px;
  border: 1px solid #f0cf9f;
  border-radius: 10px;
  background: #fff8e9;
}
.summary-save-status strong {
  display: block;
  color: #111827;
  font-size: 18px;
}
.summary-save-status span {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.55;
}
.summary-status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 17px;
  background: #dcf7df;
  color: #08773c;
  font-size: 13px;
  font-weight: 800;
}
.summary-results {
  display: grid;
  gap: 12px;
}
.summary-results h3 {
  margin: 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.25;
}
.summary-result-list {
  overflow: hidden;
  border: 1px solid #dfe5ef;
  border-radius: 10px;
  background: #fff;
}
.summary-result-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 76px;
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid #eef2f6;
  border-radius: 0;
  background: #fff;
  text-align: left;
}
.summary-result-row:last-child {
  border-bottom: 0;
}
.summary-result-row:disabled {
  opacity: .65;
}
.summary-result-row:not(:disabled):hover {
  background: #f8fbff;
}
.summary-result-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: #eaf2ff;
  color: #2f68b4;
  font-size: 15px;
  font-weight: 900;
}
.summary-result-row.failed .summary-result-icon {
  background: #fff1f0;
  color: #b42318;
}
.summary-result-row.running .summary-result-icon {
  background: #eef4ff;
  color: var(--blue);
}
.summary-result-title {
  min-width: 0;
}
.summary-result-title strong,
.summary-result-title small {
  display: block;
}
.summary-result-title strong {
  overflow: hidden;
  color: #111827;
  font-size: 16px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary-result-title small {
  margin-top: 3px;
  color: #667085;
  font-size: 13px;
}
.summary-result-status {
  padding: 7px 13px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #667085;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}
.summary-result-status.completed {
  background: #dcf7df;
  color: #08773c;
}
.summary-result-status.running {
  background: #eaf2ff;
  color: var(--blue);
}
.summary-result-status.failed {
  background: #fff1f0;
  color: #b42318;
}
.summary-result-status.pending {
  background: #fff7ed;
  color: #b45309;
}
.summary-result-row i {
  color: #667085;
  font-size: 28px;
  font-style: normal;
  line-height: 1;
}
.summary-footer-left {
  display: flex;
  gap: 18px;
}
.summary-dialog footer button {
  min-width: 132px;
  min-height: 42px;
  border-radius: 9px;
}
.summary-dialog .secondary-accent {
  border-color: #d9a35b;
  color: #8a5b16;
  background: #fff8ec;
}
.contact-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1100;
}
.contact-modal.active { display: block; }
.contact-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}
.contact-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(16, 24, 40, 0.24);
  overflow: auto;
}
.contact-dialog header,
.contact-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.contact-dialog footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}
.contact-dialog h2 {
  margin: 0;
  font-size: 18px;
}
.contact-dialog header p {
  margin-top: 4px;
  font-size: 13px;
}
.contact-body {
  display: grid;
  gap: 14px;
  justify-items: center;
  padding: 16px;
}
.contact-body img {
  width: min(320px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.contact-copy {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px;
  border: 1px solid #c7d7fe;
  border-radius: 8px;
  background: #f5f8ff;
  text-align: center;
}
.contact-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.payment-status {
  color: var(--text);
}
.payment-status.success {
  color: var(--green);
}
.payment-status.error {
  color: var(--red);
}
.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
}
.legal-modal.active {
  display: block;
}
.legal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 18%, rgba(39, 110, 241, 0.18), transparent 28%),
    rgba(15, 23, 42, 0.46);
}
.legal-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(16, 24, 40, 0.28);
  overflow: hidden;
}
.legal-dialog header,
.legal-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.legal-dialog header h2 {
  margin-top: 3px;
}
.legal-dialog footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: #fbfcfe;
}
.legal-dialog footer span {
  color: var(--muted);
  font-size: 13px;
}
.legal-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}
.legal-tabs button {
  min-height: 40px;
  border-color: #d7e3f7;
  background: #fff;
  color: #475467;
}
.legal-tabs button.active {
  border-color: #b2ccff;
  background: #eef4ff;
  color: #244ba8;
  box-shadow: 0 8px 20px rgba(39, 110, 241, 0.08);
}
.legal-body {
  overflow: auto;
  padding: 18px;
  background:
    linear-gradient(rgba(39, 110, 241, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39, 110, 241, 0.035) 1px, transparent 1px),
    #fff;
  background-size: 28px 28px;
}
.legal-doc-head {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #c7d7fe;
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.92);
}
.legal-doc-head span {
  color: #244ba8;
  font-size: 12px;
  font-weight: 800;
}
.legal-doc-head p {
  color: #475467;
  font-size: 14px;
}
.legal-section-list {
  display: grid;
  gap: 10px;
}
.legal-section-list article {
  padding: 14px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
}
.legal-section-list h3 {
  margin: 0 0 6px;
  font-size: 15px;
}
.legal-section-list p {
  color: #475467;
  font-size: 13px;
  line-height: 1.75;
}

.consent-prompt-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: none;
}
.consent-prompt-modal.active {
  display: block;
}
.consent-prompt-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(4px);
}
.consent-prompt-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(420px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid #c7d7fe;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(16, 24, 40, 0.26);
}
.consent-prompt-dialog h2 {
  margin: 0;
  font-size: 21px;
}
.consent-prompt-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.consent-prompt-dialog label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d7e3f7;
  border-radius: 8px;
  background: #f8fbff;
  color: #344054;
  line-height: 1.55;
}
.consent-prompt-dialog input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.consent-prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.result-list, .result-media { overflow: hidden; }
.result-text, .result-media, .result-list { min-height: 520px; }
.result-job {
  width: 100%;
  text-align: left;
  display: block;
}
.result-job.active { outline: 2px solid #b2ccff; }
.artifact-list { display: grid; gap: 7px; margin-top: 12px; }
.artifact-list code {
  display: block;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px;
  color: #475467;
  background: var(--soft);
}
.quality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.quality-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--soft);
}
.quality-item strong, .quality-item span { display: block; }
.quality-item span { color: var(--muted); font-size: 13px; }
.quality-item p { font-size: 13px; }
.quality-item.pass { border-color: #abefc6; background: #f6fef9; }
.quality-item.fail { border-color: #fecdca; background: #fff7f6; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.card.active-run {
  border-color: #fedf89;
  background: #fffcf2;
}
.card h3 {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 1.45;
}
.card p {
  margin-top: 10px;
  min-height: 44px;
  color: #475467;
  font-size: 14px;
}
.card code {
  display: block;
  color: #475467;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
}
.run-card {
  display: grid;
  gap: 10px;
  align-content: start;
}
.run-card .run-card-head {
  align-items: flex-start;
}
.run-type {
  color: #244ba8;
  font-size: 12px;
  font-weight: 850;
}
.run-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.run-meta span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid #d7e3f7;
  border-radius: 999px;
  background: #f8fbff;
}
.run-card-compact .run-actions {
  margin-top: 2px;
}
.usage-snapshot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.usage-snapshot div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 10px;
}
.usage-snapshot strong,
.usage-snapshot span {
  display: block;
}
.usage-snapshot strong {
  color: var(--ink);
  font-size: 17px;
}
.usage-snapshot span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.run-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.run-metrics span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  color: #475467;
  font-size: 12px;
}

@media (max-width: 1280px) {
  .split-layout, .generation-layout, .result-workbench, .bottom-review, .live-preview { grid-template-columns: 1fr; }
  .module-system-grid,
  .module-system-grid.knowledge-priority { grid-template-columns: 1fr; }
  .knowledge-hero-card { grid-template-columns: minmax(0, 1fr) 250px; }
  .result-text, .result-media, .result-list { min-height: auto; }
  .category-editor { grid-template-columns: 1fr; }
  .category-tabs {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    max-height: none;
  }
}
@media (max-width: 1040px) {
  .auth-shell {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .auth-panel { align-self: stretch; }
  .capability-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-workflow-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { padding: 16px; }
  .grid, .steps, .stats, .thumb-grid, .image-card-grid, .module-primary-grid, .module-tool-grid, .module-action-grid { grid-template-columns: 1fr; }
  .module-home.active {
    min-height: calc(100vh - 96px);
    padding-top: 12px;
  }
  .module-system-panel {
    min-height: auto;
    padding: 16px;
  }
  .knowledge-hero-card {
    grid-template-columns: 1fr;
    padding: 22px;
  }
  .knowledge-hero-copy h3 {
    font-size: 26px;
  }
  .knowledge-visual {
    min-height: 180px;
  }
  .knowledge-book {
    right: calc(50% - 58px);
    top: 18px;
  }
  .knowledge-feature-row,
  .knowledge-shortcuts {
    grid-template-columns: 1fr;
  }
  .creator-menu-item,
  .knowledge-shortcut {
    grid-template-columns: 52px minmax(0, 1fr) 18px;
  }
  .module-account-strip,
  .module-account-summary {
    align-items: stretch;
    flex-direction: column;
  }
  .module-profile-button {
    width: 100%;
  }
  .module-card {
    min-height: 178px;
  }
  .admin-user-toolbar {
    align-items: stretch;
  }
  .admin-user-toolbar label,
  #adminUserVisibleCount {
    width: 100%;
  }
  .settings-dialog {
    inset: 10px;
    width: auto;
    max-height: none;
    transform: none;
  }
  .settings-tabs { grid-template-columns: 1fr; }
  .auth-screen {
    height: auto;
    min-height: 100vh;
    padding: 16px 16px 44px;
    place-items: start center;
    overflow-y: auto;
  }
  .auth-shell { max-height: none; }
  .auth-icp {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    margin-top: 14px;
  }
  .auth-navline {
    align-items: flex-start;
    flex-direction: column;
  }
  .auth-story,
  .auth-panel {
    padding: 18px;
  }
  .auth-panel {
    order: -1;
  }
  .auth-story h1 {
    font-size: 30px;
  }
  .auth-workflow-grid { grid-template-columns: 1fr; }
  .capability-grid,
  .pain-strip,
  .legal-strip {
    grid-template-columns: 1fr;
  }
  .legal-tabs {
    grid-template-columns: 1fr;
  }
  .legal-dialog footer {
    align-items: stretch;
    flex-direction: column;
  }
  .flow-footer-right,
  .quota-dock {
    width: 100%;
    justify-content: stretch;
  }
  .quota-dock {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .quota-dock div {
    min-width: 0;
  }
.topic-item { align-items: stretch; flex-direction: column; }
.page-head, .toolbar, .flow-footer { align-items: stretch; flex-direction: column; }
}

/* Ink-white / black-gold refresh for workflow and billing surfaces. */
:root {
  --ink: #141414;
  --ink-2: #242424;
  --paper: #fbfaf7;
  --paper-2: #f5f2eb;
  --gold: #c08a3d;
  --gold-soft: #fff6e8;
  --gold-line: #d7ad72;
  --silver-line: #dedbd3;
}
.account-trigger {
  border-color: #d7d3ca;
  background: linear-gradient(180deg, #fff, #f7f5ef);
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(20, 20, 20, 0.10);
}
.account-trigger::before {
  background:
    radial-gradient(circle at 50% 38%, #fff 0 3px, transparent 3.5px),
    radial-gradient(circle at 50% 72%, #fff 0 6px, transparent 6.5px),
    linear-gradient(135deg, #1c1c1c, #5d5446);
}
.account-trigger:hover,
.account-trigger[aria-expanded="true"] {
  border-color: var(--gold-line);
  box-shadow: 0 16px 36px rgba(120, 80, 28, 0.16);
}
.corner-tool-button {
  border-color: #d8d4cc;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
}
.corner-tool-button:hover {
  border-color: var(--gold-line);
  background: var(--gold-soft);
  color: var(--ink);
}
#appShell.shell {
  background:
    radial-gradient(circle at 18% 6%, rgba(192, 138, 61, 0.12), transparent 28%),
    radial-gradient(circle at 92% 4%, rgba(20, 20, 20, 0.05), transparent 22%);
}
#workflow {
  color: var(--ink);
}
.steps {
  gap: 10px;
}
.step {
  min-height: 54px;
  border-color: var(--silver-line);
  background: rgba(255,255,255,.88);
  color: #56504a;
  box-shadow: 0 10px 28px rgba(20, 20, 20, 0.04);
}
.step strong {
  background: #f0eee8;
  color: #6b6258;
}
.step.active {
  border-color: var(--gold-line);
  background: linear-gradient(180deg, #fffaf0, #fff);
  color: var(--ink);
  box-shadow: inset 0 3px 0 var(--gold), 0 18px 40px rgba(120, 80, 28, 0.10);
}
.step.active strong {
  background: var(--ink);
  color: #f7d796;
}
#workflow .page-head h2 {
  color: var(--ink);
}
#workflow .panel {
  border-color: var(--silver-line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(20, 20, 20, 0.08);
}
#workflow .form-section h3 {
  color: var(--ink);
}
#workflow label {
  color: #4f4a44;
}
#workflow input,
#workflow select,
#workflow textarea,
#settingsTabBilling input,
#settingsTabBilling select {
  border-color: #d8d4cc;
  background: #fffdfa;
}
#workflow input:focus,
#workflow select:focus,
#workflow textarea:focus {
  border-color: var(--gold-line);
  outline: 3px solid rgba(192, 138, 61, 0.14);
}
#workflow .category-select-row button,
#workflow button.secondary {
  border-color: #d8d4cc;
  background: #fffdfa;
  color: var(--ink);
}
#workflow .category-select-row button:hover,
#workflow button.secondary:hover {
  border-color: var(--gold-line);
  background: var(--gold-soft);
}
.autopilot-box {
  border-color: #ecd4af;
  background:
    linear-gradient(135deg, rgba(255, 246, 232, 0.92), rgba(255, 255, 255, 0.96));
}
#workflow .advanced-options summary {
  color: var(--ink);
}
.flow-footer {
  border-top-color: var(--silver-line);
  background: rgba(255, 253, 250, 0.96);
}
.quota-dock div {
  border-color: #e6dccd;
  background: #fffdf8;
}
.quota-dock strong {
  color: var(--ink);
}
#workflow button.primary,
#step1Next.primary,
#flowGenerateTopics.primary,
#flowCreateStart.primary,
#step2Next.primary {
  border-color: var(--ink);
  background: linear-gradient(180deg, #242424, #101010);
  color: #f7d796;
  box-shadow: 0 14px 32px rgba(20, 20, 20, 0.18);
}
#workflow button.primary:hover,
#step1Next.primary:hover,
#flowGenerateTopics.primary:hover,
#flowCreateStart.primary:hover,
#step2Next.primary:hover {
  background: #000;
  box-shadow: 0 18px 44px rgba(20, 20, 20, 0.24);
}
#workflow .model-option.active,
#workflow .category-tab.active {
  border-color: var(--gold-line);
  background: var(--gold-soft);
  color: var(--ink);
}

#settingsModal.active .settings-backdrop {
  background: rgba(20, 20, 20, 0.48);
  backdrop-filter: blur(2px);
}
.settings-dialog {
  border-color: #d8d4cc;
  background: #fffdfa;
  box-shadow: 0 30px 90px rgba(20, 20, 20, 0.28);
}
.settings-header {
  border-bottom-color: var(--silver-line);
  background: linear-gradient(180deg, #fff, #fbfaf7);
}
.settings-header h2 {
  color: var(--ink);
}
.settings-tabs {
  background: var(--paper);
  border-bottom-color: var(--silver-line);
}
.settings-tab.active {
  border-color: var(--gold-line);
  background: var(--gold-soft);
  color: var(--ink);
}
#settingsTabBilling {
  color: var(--ink);
}
#settingsTabBilling .settings-layout {
  gap: 18px;
}
#settingsTabBilling .billing-overview-layout {
  grid-template-columns: minmax(300px, .9fr) minmax(420px, 1.4fr);
  align-items: stretch;
}
#settingsTabBilling .billing-overview-layout > .panel:nth-child(3) {
  grid-column: 1 / -1;
}
#settingsTabBilling .panel {
  border-color: #d8d4cc;
  background: #fffdfa;
  box-shadow: 0 18px 54px rgba(20, 20, 20, 0.08);
}
#settingsTabBilling .panel-title h2 {
  color: var(--ink);
}
#settingsTabBilling .panel-title button,
#refreshBillingSecondary,
#refreshBilling {
  border-color: #d8d4cc;
  background: #fff;
  color: var(--ink);
}
#settingsTabBilling .panel-title button:hover,
#refreshBillingSecondary:hover,
#refreshBilling:hover {
  border-color: var(--gold-line);
  background: var(--gold-soft);
}
#settingsTabBilling .membership-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-color: #e2bf86;
  background:
    linear-gradient(135deg, rgba(255, 246, 232, .94), rgba(255, 255, 255, .98));
  box-shadow: inset 4px 0 0 var(--gold);
}
#settingsTabBilling .membership-card::after {
  content: "";
  position: absolute;
  inset: auto 22px -34px auto;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(192, 138, 61, .22);
  border-radius: 999px;
  pointer-events: none;
}
#settingsTabBilling .membership-card strong {
  color: var(--ink);
  font-size: 18px;
}
#settingsTabBilling .membership-card > span {
  color: #6a6258;
}
#settingsTabBilling .membership-quota-grid div {
  border-color: #e2d8ca;
  background: rgba(255,255,255,.82);
}
#settingsTabBilling .membership-quota-grid b {
  color: var(--ink);
}
#settingsTabBilling .payment-plans {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
#settingsTabBilling .payment-plan {
  position: relative;
  min-height: 330px;
  align-content: start;
  padding: 16px;
  border-color: #ddd8cf;
  background: linear-gradient(180deg, #fff, #fffdf9);
  box-shadow: 0 18px 48px rgba(20, 20, 20, 0.07);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
#settingsTabBilling .payment-plan:hover {
  transform: translateY(-3px);
  border-color: var(--gold-line);
  box-shadow: 0 24px 64px rgba(120, 80, 28, 0.13);
}
#settingsTabBilling .plan-head span {
  border: 1px solid #eed7b5;
  background: var(--gold-soft);
  color: #7a541c;
  font-weight: 850;
}
#settingsTabBilling .payment-plan h3 {
  color: var(--ink);
  font-size: 18px;
}
#settingsTabBilling .plan-head p,
#settingsTabBilling .plan-desc {
  color: #6a6258;
}
#settingsTabBilling .plan-price strong {
  color: var(--ink);
  font-size: 26px;
}
#settingsTabBilling .plan-allowance {
  border-color: #e2bf86;
  background: var(--gold-soft);
  color: #7a541c;
}
#settingsTabBilling .payment-plan button.primary {
  align-self: end;
  width: 100%;
  margin-top: auto;
  border-color: var(--ink);
  background: linear-gradient(180deg, #242424, #101010);
  color: #f7d796;
  box-shadow: 0 14px 32px rgba(20, 20, 20, 0.16);
}
#settingsTabBilling .payment-plan button.primary:hover {
  background: #000;
}
#settingsTabBilling #paymentStatus {
  color: #7a541c;
}

.referral-panel {
  min-width: 0;
}

.referral-program {
  display: grid;
  gap: 14px;
  height: 100%;
  min-height: 158px;
  padding: 18px;
  border: 1px solid #ead8bd;
  border-radius: 12px;
  background:
    radial-gradient(circle at 96% 85%, rgba(209, 147, 47, .12) 0 42px, transparent 43px),
    linear-gradient(135deg, rgba(255, 248, 237, .96), rgba(255, 255, 255, .98));
  box-shadow: inset 4px 0 0 var(--gold);
}

.referral-head span {
  display: inline-flex;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f7eddd;
  color: #9a661a;
  font-size: 12px;
  font-weight: 800;
}

.referral-head h2 {
  margin: 8px 0 4px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.referral-head p,
.referral-program small {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

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

.referral-stats div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #eadfce;
  border-radius: 10px;
  background: rgba(255, 255, 255, .78);
}

.referral-stats strong,
.referral-stats span {
  display: block;
  overflow-wrap: anywhere;
}

.referral-stats strong {
  color: var(--ink);
  font-size: 19px;
  line-height: 1.15;
}

.referral-stats span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.referral-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.referral-link-row span {
  min-width: 0;
  padding: 11px 12px;
  overflow: hidden;
  border: 1px solid #eadfce;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.referral-link-row button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  border-color: #d8c5a8;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.referral-link-row button:first-of-type {
  border-color: #111827;
  background: #111827;
  color: #f3c86b;
}

@media (max-width: 1180px) {
  #settingsTabBilling .billing-overview-layout {
    grid-template-columns: 1fr;
  }
  #settingsTabBilling .billing-overview-layout > .panel:nth-child(3) {
    grid-column: auto;
  }
  #settingsTabBilling .payment-plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .referral-stats,
  .referral-link-row {
    grid-template-columns: 1fr;
  }
  #settingsTabBilling .payment-plans {
    grid-template-columns: 1fr;
  }
}
/* Ink paper visual refresh: login, module home, and knowledge entry */
:root {
  --ink-bg: #f6f4ef;
  --ink-panel: #fffdfa;
  --ink-text: #151411;
  --ink-muted: #68645d;
  --ink-line: #d9d2c7;
  --ink-gold: #b98534;
  --ink-gold-soft: #fff1d9;
  --ink-shadow: 0 24px 70px rgba(30, 25, 18, .09);
}
body {
  background:
    radial-gradient(circle at 14% 12%, rgba(185, 133, 52, .08), transparent 28%),
    radial-gradient(circle at 86% 8%, rgba(20, 20, 20, .035), transparent 26%),
    linear-gradient(180deg, #fbfaf7 0%, var(--ink-bg) 100%);
}
.auth-screen {
  background:
    radial-gradient(circle at 16% 18%, rgba(185, 133, 52, .08), transparent 28%),
    linear-gradient(180deg, #fbfaf7 0%, #f2efea 100%);
}
.auth-screen::before {
  background-image:
    linear-gradient(rgba(23, 21, 18, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 21, 18, .035) 1px, transparent 1px);
}
.auth-screen::after,
.auth-bg span {
  background: linear-gradient(90deg, transparent, rgba(185, 133, 52, .28), transparent);
}
.auth-shell {
  width: min(1120px, 100%);
}
.auth-story,
.auth-panel,
.module-system-panel,
.module-account-strip,
.knowledge-hero-card,
.creator-menu-item,
.knowledge-shortcut,
.account-trigger,
.account-menu,
.modal-card,
.panel {
  border-color: var(--ink-line);
  border-radius: 8px;
  background: rgba(255, 253, 250, .92);
  box-shadow: var(--ink-shadow);
}
.auth-story,
.auth-panel {
  backdrop-filter: blur(16px);
}
.brand-mark,
.module-system-mark,
.module-action-icon,
.module-action-icon.gold {
  border: 2px solid var(--ink-text);
  background: var(--ink-panel);
  color: var(--ink-text);
  box-shadow: none;
}
.auth-status-pill,
.module-title-row em,
.pill {
  border: 1px solid #ead8b8;
  background: var(--ink-gold-soft);
  color: #8a5a16;
}
.eyebrow {
  color: #9b6a22;
}
.auth-story h1,
.auth-panel h2,
.module-system-head h2,
.module-title-row h2,
.knowledge-hero-copy h3,
.creator-menu-item strong,
.knowledge-shortcut strong {
  color: var(--ink-text);
  font-weight: 900;
  letter-spacing: 0;
}
.auth-lede,
.auth-panel-head p,
.auth-workflow-step p,
.capability-grid span,
.pain-strip p,
.module-system-head p,
.creator-menu-item small,
.knowledge-shortcut small,
.knowledge-hero-copy p,
.knowledge-feature-row,
.module-account-summary span,
.module-account-summary small {
  color: var(--ink-muted);
}
.auth-workflow-step,
.capability-grid article,
.pain-strip {
  border-color: var(--ink-line);
  background: rgba(255, 253, 250, .9);
  box-shadow: none;
}
.auth-workflow-step strong {
  border: 1px solid var(--ink-text);
  background: var(--ink-text);
  color: #fff7e8;
}
.auth-switch,
.password-fallback,
.auth-consent {
  border-color: var(--ink-line);
  background: #fbf8f2;
}
.auth-switch button.active,
button.primary,
.primary,
.knowledge-primary-button {
  border-color: var(--ink-text);
  background: var(--ink-text);
  color: #fff7e8;
  box-shadow: 0 14px 34px rgba(23, 21, 18, .14);
}
button.secondary,
.secondary,
.knowledge-secondary-button,
.module-profile-button {
  border-color: var(--ink-line);
  background: rgba(255, 253, 250, .9);
  color: var(--ink-text);
}
input,
textarea,
select {
  border-color: var(--ink-line);
  background: #fffdfa;
  color: var(--ink-text);
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--ink-gold);
  box-shadow: 0 0 0 3px rgba(185, 133, 52, .14);
}
.module-home-active .shell {
  min-height: 100vh;
  padding: 30px clamp(24px, 3vw, 52px) 18px;
}
.module-home.active {
  min-height: calc(100vh - 86px);
  align-items: start;
  padding-top: 18px;
}
.module-launcher {
  width: min(1540px, 100%);
}
.module-system-grid.knowledge-priority {
  grid-template-columns: minmax(360px, .72fr) minmax(560px, 1.28fr);
  gap: 26px;
}
.module-system-panel {
  padding: 28px;
  background: rgba(255, 253, 250, .92);
}
.creator-system,
.knowledge-system {
  background:
    linear-gradient(180deg, rgba(255, 253, 250, .94), rgba(251, 248, 242, .92));
}
.knowledge-system::before,
.knowledge-hero-card::after {
  background: linear-gradient(110deg, transparent 18%, rgba(185, 133, 52, .1) 42%, transparent 66%);
}
.module-system-head {
  margin-bottom: 24px;
}
.module-system-mark {
  width: 68px;
  height: 68px;
  font-size: 34px;
}
.creator-menu {
  gap: 14px;
}
.creator-menu-item,
.knowledge-shortcut {
  min-height: 96px;
  grid-template-columns: 58px minmax(0, 1fr) 22px;
  padding: 16px;
  background: rgba(255, 253, 250, .86);
}
.creator-menu-item.primary-action {
  border-color: rgba(185, 133, 52, .78);
  background: linear-gradient(90deg, rgba(255, 244, 224, .92), rgba(255, 253, 250, .92));
  box-shadow: inset 4px 0 0 var(--ink-gold), 0 16px 40px rgba(80, 58, 28, .08);
}
.creator-menu-item:hover,
.knowledge-shortcut:hover {
  transform: translateX(5px);
  border-color: rgba(185, 133, 52, .72);
  box-shadow: 0 18px 46px rgba(80, 58, 28, .12);
}
.creator-menu-item:hover i,
.knowledge-shortcut:hover i {
  color: var(--ink-gold);
}
.module-action-icon {
  width: 48px;
  height: 48px;
  font-size: 23px;
}
.knowledge-hero-card {
  min-height: 304px;
  grid-template-columns: minmax(0, 1fr) 260px;
  border-color: var(--ink-line);
  background: rgba(255, 253, 250, .88);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6), 0 18px 54px rgba(30, 25, 18, .07);
}
.knowledge-eyebrow {
  color: #6b4a1b;
  background: #fff4df;
  border-color: #ead8b8;
}
.knowledge-primary-button {
  min-width: 156px;
}
.knowledge-secondary-button {
  color: var(--ink-text);
}
.knowledge-feature-row {
  border-color: var(--ink-line);
  background: rgba(255, 253, 250, .78);
}
.knowledge-feature-row span + span {
  border-left-color: var(--ink-line);
}
.knowledge-visual {
  filter: grayscale(.9) sepia(.18) saturate(.8);
}
.knowledge-book {
  background: linear-gradient(145deg, #25231f, #0f0e0c);
  box-shadow: 0 22px 42px rgba(23, 21, 18, .2);
}
.knowledge-book span {
  background: linear-gradient(180deg, #f8d993, #b98534);
}
.knowledge-orbit {
  border-color: rgba(185, 133, 52, .52);
}
.knowledge-page {
  border-color: var(--ink-line);
  background: rgba(255, 253, 250, .74);
}
.knowledge-shortcut.passive {
  background: rgba(255, 253, 250, .86);
}
.topbar {
  border-color: var(--ink-line);
}
.account-trigger {
  background: rgba(255, 253, 250, .92);
}
.account-avatar {
  background: var(--ink-text);
}
.corner-tool-button {
  border-color: var(--ink-line);
  background: rgba(255, 253, 250, .9);
  box-shadow: 0 14px 34px rgba(30, 25, 18, .09);
}
@media (max-width: 980px) {
  .auth-shell,
  .module-system-grid.knowledge-priority,
  .knowledge-hero-card {
    grid-template-columns: 1fr;
  }
  .knowledge-visual {
    min-height: 220px;
  }
}

/* One-screen public landing page */
.auth-landing {
  min-height: 100vh;
  height: 100vh;
  padding: clamp(22px, 3vw, 44px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: clamp(14px, 2vh, 24px);
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 0%, rgba(255, 255, 255, .92) 0 22%, transparent 23%),
    linear-gradient(160deg, transparent 0 52%, rgba(236, 232, 224, .7) 53% 58%, transparent 59%),
    linear-gradient(180deg, #fbfaf7 0%, #f7f4ee 100%);
}
.auth-landing::before {
  opacity: .38;
  background-size: 42px 42px;
}
.landing-brand {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  color: #151411;
}
.landing-brand strong {
  font-size: clamp(26px, 3vw, 44px);
  font-weight: 950;
  letter-spacing: 0;
}
.landing-logo {
  width: clamp(46px, 4.6vw, 70px);
  height: clamp(46px, 4.6vw, 70px);
  position: relative;
  display: inline-block;
  border: 3px solid #151411;
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(-22deg);
}
.landing-logo::before {
  content: "";
  position: absolute;
  left: 12%;
  top: 43%;
  width: 70%;
  height: 18%;
  border-radius: 999px;
  background: linear-gradient(90deg, #151411 0 62%, #b98534 63% 100%);
  transform: rotate(-28deg);
}
.landing-logo::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 0;
  width: 12px;
  height: 12px;
  clip-path: polygon(50% 0, 65% 35%, 100% 50%, 65% 65%, 50% 100%, 35% 65%, 0 50%, 35% 35%);
  background: #b98534;
}
.landing-shell {
  width: 100%;
  max-width: none;
  max-height: none;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 420px);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}
.landing-hero {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .75fr);
  align-items: center;
  gap: clamp(18px, 3vw, 52px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.hero-title-wrap {
  position: relative;
  min-width: 0;
}
.hero-title-wrap h1 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", "STXingkai", "FangSong", "STSong", "SimSun", serif;
  font-size: clamp(60px, 7.4vw, 128px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: .04em;
  color: #161614;
  white-space: nowrap;
  background: linear-gradient(180deg, #1a1816 0 62%, #8a5a1a 62% 78%, #2a241c 78% 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 18px 30px rgba(20, 18, 14, .10);
}
.hero-title-wrap h1::after {
  content: "";
  display: block;
  width: min(520px, 72%);
  height: clamp(8px, 1vw, 14px);
  margin: clamp(2px, .5vh, 8px) 0 0 6%;
  border-bottom: clamp(5px, .7vw, 9px) solid #b98534;
  border-radius: 0 0 60% 60%;
  transform: skewX(-26deg);
  filter: drop-shadow(0 4px 8px rgba(185, 133, 52, .25));
}
.hero-title-wrap p {
  display: none;
}
.hero-star {
  position: absolute;
  right: 28%;
  top: -6%;
  width: clamp(28px, 3vw, 46px);
  height: clamp(28px, 3vw, 46px);
  clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%);
  background: linear-gradient(135deg, #d5a44f, #9b661c);
  filter: drop-shadow(0 6px 10px rgba(185, 133, 52, .35));
}
.hero-visual {
  position: relative;
  min-height: clamp(290px, 43vh, 510px);
}
.hero-visual::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 4%;
  height: 18%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, #f0eadf 0 36%, #e8e0d2 38% 50%, transparent 60%),
    radial-gradient(ellipse at center, rgba(30, 25, 18, .18), transparent 70%);
  box-shadow: 0 8px 0 rgba(0,0,0,.02);
  filter: blur(.4px);
}
.hero-visual::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 10%;
  height: 10%;
  border-radius: 50%;
  background: linear-gradient(180deg, #fffdfa, #e9e2d3);
  box-shadow:
    inset 0 -3px 6px rgba(30, 25, 18, .12),
    0 6px 16px rgba(30, 25, 18, .10);
}
.hero-book {
  position: absolute;
  right: 14%;
  top: 8%;
  width: clamp(150px, 14vw, 230px);
  height: clamp(220px, 24vw, 330px);
  border: 2px solid #b9b1a5;
  border-right: 8px solid #b98534;
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(0,0,0,.06) 0 7px, transparent 8px),
    linear-gradient(145deg, #fbfaf7, #e9e5dd);
  box-shadow: 0 28px 70px rgba(30, 25, 18, .16);
  transform: rotateY(-16deg) rotateZ(-1deg);
}
.hero-book span {
  position: absolute;
  left: 50%;
  top: 42%;
  width: clamp(44px, 4vw, 66px);
  height: clamp(44px, 4vw, 66px);
  transform: translate(-50%, -50%);
  clip-path: polygon(50% 0, 63% 34%, 100% 36%, 70% 58%, 82% 94%, 50% 74%, 18% 94%, 30% 58%, 0 36%, 37% 34%);
  background: linear-gradient(135deg, #f6d58d, #bd812d);
  filter: drop-shadow(0 8px 12px rgba(120, 82, 30, .22));
}
.hero-paper {
  position: absolute;
  left: 9%;
  top: 28%;
  width: clamp(120px, 13vw, 210px);
  height: clamp(170px, 18vw, 280px);
  border: 1px solid #dfd8cf;
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 22px 52px rgba(30, 25, 18, .1);
}
.hero-paper::before,
.hero-paper::after {
  content: "";
  position: absolute;
  left: 24%;
  right: 18%;
  height: 10px;
  border-radius: 999px;
  background: #d8d2c7;
}
.hero-paper::before { top: 33%; }
.hero-paper::after { top: 46%; box-shadow: 0 34px 0 #d8d2c7; }
.hero-shield {
  position: absolute;
  left: 0;
  bottom: 12%;
  width: clamp(92px, 9vw, 142px);
  height: clamp(112px, 11vw, 176px);
  border: 2px solid #cfc7bb;
  border-radius: 40% 40% 48% 48%;
  background: rgba(255,255,255,.76);
  box-shadow: 0 22px 52px rgba(30, 25, 18, .12);
}
.hero-shield::after {
  content: "";
  position: absolute;
  left: 29%;
  top: 40%;
  width: 42%;
  height: 22%;
  border-left: 7px solid #b98534;
  border-bottom: 7px solid #b98534;
  transform: rotate(-42deg);
}
.hero-orbit {
  position: absolute;
  border: 1px solid rgba(112, 92, 62, .28);
  border-radius: 50%;
}
.orbit-a {
  left: 2%;
  right: 0;
  top: 28%;
  height: 36%;
  transform: rotate(-8deg);
}
.orbit-b {
  left: 10%;
  right: 8%;
  top: 30%;
  height: 44%;
  transform: rotate(16deg);
}
.landing-login {
  width: min(420px, 100%);
  justify-self: center;
  padding: clamp(26px, 3vw, 42px);
  background: rgba(255, 253, 250, .88);
}
.landing-login .auth-panel-head h2 {
  font-size: clamp(28px, 2.5vw, 40px);
}
.landing-login .auth-panel-head p {
  margin-top: 8px;
  font-size: 15px;
}
.unified-phone-form {
  gap: 18px;
}
.field-with-icon {
  height: 66px;
  display: grid !important;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid var(--ink-line);
  border-radius: 8px;
  background: rgba(255,255,255,.78);
  color: #171512;
}
.field-with-icon > span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid #171512;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 900;
}
.field-with-icon input {
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
}
.code-field {
  grid-template-columns: 28px minmax(0, 1fr) 126px;
}
.code-field button {
  height: 48px;
  border-color: #b98534;
  color: #9b681f;
  background: #fffdfa;
}
.landing-login .primary {
  height: 66px;
  font-size: 20px;
  color: #f3ca78;
  background: linear-gradient(180deg, #1e1c18, #111010);
  border-color: #1e1c18;
  box-shadow: 0 14px 32px rgba(20, 18, 12, .22);
  animation: none;
}
.landing-login .primary:hover {
  background: #111010;
  box-shadow: 0 18px 44px rgba(20, 18, 12, .30);
}
.compact-remember {
  display: none !important;
}
.landing-consent {
  display: block !important;
  margin-top: 18px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  line-height: 1.7;
  text-align: center;
}
.landing-consent input {
  display: none;
}
.landing-consent button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #9b681f;
}
.landing-admin-login {
  margin-top: 14px;
  box-shadow: none;
}
.landing-admin-login summary {
  color: #8b8275;
  text-align: center;
}
.landing-categories {
  position: relative;
  z-index: 2;
  display: grid;
  gap: clamp(12px, 1.6vh, 18px);
}
.landing-section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  color: #171512;
}
.landing-section-title strong {
  font-size: clamp(24px, 2.5vw, 36px);
}
.landing-section-title span {
  width: 90px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #b98534);
}
.landing-section-title span:last-child {
  background: linear-gradient(90deg, #b98534, transparent);
}
.landing-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 34px);
}
.landing-category-grid article {
  min-height: clamp(112px, 14vh, 150px);
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 20px 28px;
  border: 1px solid var(--ink-line);
  border-radius: 8px;
  background: rgba(255, 253, 250, .78);
  box-shadow: 0 18px 46px rgba(30, 25, 18, .06);
}
.landing-category-grid strong {
  color: #151411;
  font-size: clamp(24px, 2vw, 34px);
}
.landing-category-grid p {
  color: var(--ink-muted);
  font-size: clamp(14px, 1vw, 17px);
}
.category-art {
  width: 86px;
  height: 70px;
  display: grid;
  place-items: center;
  border: 1px solid #cfc7bb;
  border-radius: 8px;
  color: #b98534;
  font-size: 34px;
  font-weight: 900;
  background: rgba(255,255,255,.72);
}
.category-art.book {
  transform: rotate(8deg);
  box-shadow: 7px 5px 0 #d7a752;
}
.category-art.data {
  border-radius: 50% / 18%;
  background:
    linear-gradient(#fffdfa, #fffdfa) padding-box,
    repeating-linear-gradient(180deg, transparent 0 18px, #d7a752 19px 21px) border-box;
}
.auth-icp {
  position: static;
  z-index: 2;
}
@media (max-width: 1100px) {
  .auth-landing {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }
  .landing-shell,
  .landing-hero,
  .landing-category-grid {
    grid-template-columns: 1fr;
  }
  .hero-title-wrap h1 {
    font-size: clamp(56px, 13vw, 110px);
    white-space: normal;
  }
  .landing-login {
    justify-self: stretch;
    width: 100%;
  }
}

/* Login page reconstructed from design slices. */
.auth-landing {
  padding: clamp(28px, 3vw, 44px) clamp(42px, 4vw, 64px) clamp(24px, 2.6vw, 38px);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: clamp(10px, 1.7vh, 20px);
  background:
    radial-gradient(circle at 82% 0%, rgba(255, 255, 255, .95) 0 21%, transparent 22%),
    linear-gradient(160deg, transparent 0 54%, rgba(238, 235, 228, .62) 55% 60%, transparent 61%),
    linear-gradient(180deg, #fbfaf7 0%, #f7f4ef 100%);
}
.auth-landing .landing-brand {
  height: clamp(48px, 6.2vh, 72px);
}
.landing-brand-img {
  display: block;
  width: clamp(160px, 15vw, 238px);
  height: auto;
}
.landing-brand .landing-logo,
.landing-brand strong {
  display: none !important;
}
.auth-landing .landing-shell {
  grid-template-columns: minmax(0, 1.5fr) minmax(330px, 420px);
  gap: clamp(22px, 4vw, 62px);
  align-items: center;
}
.auth-landing .landing-hero {
  grid-template-columns: minmax(0, .95fr) minmax(310px, .85fr);
  gap: clamp(12px, 2.5vw, 44px);
}
.hero-wordmark-img {
  display: block;
  width: min(100%, clamp(390px, 38vw, 620px));
  height: auto;
  filter: drop-shadow(0 14px 26px rgba(20, 18, 14, .10));
}
.hero-title-wrap h1,
.hero-title-wrap h1::after,
.hero-title-wrap p,
.hero-title-wrap .hero-star {
  display: none !important;
}
.auth-landing .hero-visual {
  min-height: auto;
  display: grid;
  place-items: center;
}
.auth-landing .hero-visual::before,
.auth-landing .hero-visual::after,
.auth-landing .hero-visual > :not(.hero-illustration-img) {
  display: none !important;
}
.hero-illustration-img {
  display: block;
  width: min(100%, clamp(330px, 36vw, 560px));
  height: auto;
}
.auth-landing .landing-login {
  width: min(420px, 100%);
  padding: clamp(28px, 3vw, 42px);
  border-color: rgba(216, 210, 200, .95);
  background: rgba(255, 253, 250, .9);
  box-shadow: 0 22px 68px rgba(30, 25, 18, .14);
}
.auth-landing .landing-categories {
  gap: clamp(8px, 1.2vh, 14px);
}
.landing-section-title {
  display: grid;
  place-items: center;
}
.landing-section-title img {
  display: block;
  width: min(360px, 31vw);
  height: auto;
}
.landing-section-title span,
.landing-section-title strong {
  display: none !important;
}
.landing-category-grid {
  gap: clamp(16px, 2vw, 34px);
}
.landing-category-grid article {
  min-height: auto;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.landing-category-grid article img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 30px rgba(30, 25, 18, .05));
}
@media (max-width: 1100px) {
  .auth-landing .landing-shell,
  .auth-landing .landing-hero,
  .landing-category-grid {
    grid-template-columns: 1fr;
  }
  .hero-wordmark-img,
  .hero-illustration-img {
    width: min(100%, 560px);
  }
}

/* Final scoped polish for workflow and billing after the global ink theme. */
body:not(.module-home-active) #workflow .step.active {
  border-color: var(--gold-line);
  background: linear-gradient(180deg, #fff8ea, #fffdfa);
  color: var(--ink);
  box-shadow: inset 0 3px 0 var(--gold), 0 18px 40px rgba(120, 80, 28, 0.10);
}
body:not(.module-home-active) #workflow .step.active strong {
  background: var(--ink);
  color: #f7d796;
}
body:not(.module-home-active) #workflow .panel,
#settingsTabBilling.active .panel {
  border-color: var(--silver-line);
  background: rgba(255, 253, 250, 0.94);
}
body:not(.module-home-active) #workflow .autopilot-box {
  border-color: #ecd4af;
  background: linear-gradient(135deg, rgba(255, 246, 232, 0.92), rgba(255, 255, 255, 0.96));
}
body:not(.module-home-active) #workflow button.primary,
#settingsTabBilling.active .payment-plan button.primary {
  border-color: var(--ink);
  background: linear-gradient(180deg, #242424, #101010);
  color: #f7d796;
  box-shadow: 0 14px 32px rgba(20, 20, 20, 0.18);
}
body:not(.module-home-active) #workflow button.primary:hover,
#settingsTabBilling.active .payment-plan button.primary:hover {
  background: #000;
}
#settingsTabBilling.active .payment-plan,
#settingsTabBilling.active .membership-card {
  border-color: #ddd8cf;
  background: linear-gradient(180deg, #fff, #fffdf9);
}
#settingsTabBilling.active .membership-card {
  border-color: #e2bf86;
  background: linear-gradient(135deg, rgba(255, 246, 232, .94), rgba(255, 255, 255, .98));
  box-shadow: inset 4px 0 0 var(--gold);
}
#settingsTabBilling.active .plan-head span,
#settingsTabBilling.active .plan-allowance {
  border-color: #eed7b5;
  background: var(--gold-soft);
  color: #7a541c;
}

/* Unified WeChat payment dialog */
.contact-modal .contact-backdrop {
  background: rgba(18, 18, 18, 0.5);
  backdrop-filter: blur(2px);
}

.contact-dialog.payment-dialog {
  width: min(960px, calc(100vw - 48px));
  max-height: calc(100vh - 42px);
  overflow: hidden;
  border: 1px solid rgba(205, 199, 188, 0.95);
  border-radius: 8px;
  background:
    radial-gradient(circle at 82% 18%, rgba(218, 166, 73, 0.08), transparent 28%),
    #fffdfa;
  box-shadow: 0 28px 88px rgba(20, 20, 20, 0.32);
}

.payment-dialog header {
  padding: 24px 28px 18px;
  border-bottom: 0;
}

.payment-dialog header h2 {
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
  color: #161616;
}

.payment-dialog header p {
  margin-top: 8px;
  color: #6f7378;
  font-size: 16px;
}

.payment-dialog .icon-button {
  width: 38px;
  height: 38px;
  border-color: rgba(25, 25, 25, 0.12);
  border-radius: 8px;
  background: #fff;
  color: #181818;
  font-size: 24px;
  box-shadow: 0 8px 18px rgba(22, 22, 22, 0.06);
}

.payment-body {
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 34px;
  align-items: stretch;
  justify-items: stretch;
  padding: 0 28px 24px;
}

.payment-qr-panel {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 16px;
  padding: 4px 34px 8px 0;
  border-right: 1px solid rgba(205, 199, 188, 0.9);
}

.payment-qr-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 262px;
  height: 262px;
  padding: 24px;
  border: 1px solid rgba(205, 199, 188, 0.92);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 42px rgba(30, 30, 30, 0.08);
}

.payment-qr-frame img {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 4px;
  object-fit: contain;
}

.payment-qr-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(22, 22, 22, 0.92) 10px, transparent 10px) 0 0 / 24px 24px,
    linear-gradient(rgba(22, 22, 22, 0.92) 10px, transparent 10px) 0 0 / 24px 24px,
    #fff;
  color: rgba(255, 255, 255, 0.86);
  font-size: 30px;
  font-weight: 900;
}

.payment-qr-caption {
  color: #77716a;
  font-size: 15px;
}

.payment-device-tips {
  width: min(100%, 320px);
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #e0a936;
  border-radius: 8px;
  background: #fff7df;
  color: #6f4100;
  box-shadow: 0 12px 26px rgba(160, 96, 0, 0.12);
}

.payment-device-tips strong {
  color: #111827;
  font-size: 14px;
  font-weight: 900;
}

.payment-device-tips span {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.payment-device-tips span::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.7em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #d17a00;
  transform: translateY(-50%);
}

.payment-waiting {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 212px;
  padding: 14px 20px;
  border: 1px solid rgba(200, 151, 65, 0.34);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf9, #fbf7ef);
  color: #a66e1e;
  font-size: 18px;
}

.payment-waiting strong {
  font-size: 18px;
  font-weight: 800;
}

.payment-waiting i {
  width: 32px;
  height: 4px;
  border-radius: 999px;
  background: radial-gradient(circle, #bd8128 2px, transparent 3px) 0 0 / 11px 4px;
}

.payment-clock {
  position: relative;
  width: 24px;
  height: 24px;
  border: 2px solid #bd8128;
  border-radius: 999px;
}

.payment-clock::before,
.payment-clock::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  border-radius: 999px;
  background: #bd8128;
  transform-origin: center top;
}

.payment-clock::before {
  height: 8px;
  transform: translate(-50%, -1px);
}

.payment-clock::after {
  height: 7px;
  transform: translate(-50%, -1px) rotate(125deg);
}

.payment-summary-panel {
  display: grid;
  gap: 16px;
  padding: 22px 26px 14px;
  border: 1px solid rgba(205, 199, 188, 0.92);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 252, 246, 0.86)),
    #fff;
}

.payment-product span {
  color: #a66e1e;
  font-size: 15px;
  font-weight: 700;
}

.payment-product h3 {
  margin: 10px 0 8px;
  color: #171717;
  font-size: 25px;
  line-height: 1.25;
}

.payment-product p {
  color: #555b62;
  font-size: 16px;
  line-height: 1.6;
}

.payment-price-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.payment-price-row strong {
  color: #151515;
  font-size: 44px;
  line-height: 1;
}

.payment-price-row span {
  color: #a66e1e;
  font-size: 15px;
  font-weight: 700;
}

.payment-price-row span::before {
  content: "◇";
  margin-right: 6px;
}

.payment-expire {
  margin: -4px 0 2px;
  color: #53565a;
  font-size: 16px;
}

.payment-expire b {
  color: #9a621b;
}

.payment-order-detail {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid rgba(205, 199, 188, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.payment-order-detail div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 36px;
  color: #4e5358;
}

.payment-order-detail dt,
.payment-order-detail dd {
  margin: 0;
  font-size: 15px;
}

.payment-order-detail dd {
  color: #222;
  font-weight: 700;
}

.payment-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 20px;
  padding: 6px 40px 0;
}

.payment-actions .primary,
.payment-actions button {
  height: 50px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 800;
}

.payment-actions .primary {
  border: 1px solid #171717;
  background: linear-gradient(180deg, #262728, #0f0f0f);
  color: #d9a34f;
  box-shadow: 0 12px 24px rgba(15, 15, 15, 0.2);
}

.payment-actions .primary:hover {
  background: linear-gradient(180deg, #303132, #151515);
}

#paymentRefreshStatus {
  border: 1px solid rgba(184, 134, 60, 0.72);
  background: #fffdfa;
  color: #b27722;
}

.payment-dialog footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 18px;
  padding: 17px 28px 24px;
  border-top: 1px solid rgba(205, 199, 188, 0.78);
  color: #7a7f86;
  font-size: 14px;
}

#paymentBack {
  border: 0;
  background: transparent;
  color: #a66e1e;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}

.payment-status.success {
  color: #99702b;
}

.payment-status.error {
  color: #b3261e;
}

@media (max-width: 820px) {
  .contact-dialog.payment-dialog {
    width: min(560px, calc(100vw - 24px));
    overflow: auto;
  }

  .payment-body {
    grid-template-columns: 1fr;
  }

  .payment-qr-panel {
    padding-right: 0;
    padding-bottom: 24px;
    border-right: 0;
    border-bottom: 1px solid rgba(205, 199, 188, 0.9);
  }

  .payment-actions,
  .payment-dialog footer {
    grid-template-columns: 1fr;
  }

  .payment-actions {
    padding-inline: 0;
  }
}

/* Final login slice layout overrides: keep the provided prototype horizontal at desktop 100%. */
.auth-landing {
  place-items: stretch !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  height: 100vh !important;
  min-height: 560px;
  overflow: hidden !important;
  padding: clamp(20px, 3vh, 34px) clamp(32px, 4vw, 58px) clamp(20px, 3vh, 34px) !important;
  gap: clamp(8px, 1.4vh, 14px) !important;
}
.auth-landing .landing-brand {
  justify-self: start !important;
  align-self: start !important;
  height: auto !important;
}
.auth-landing .landing-brand-img {
  width: clamp(150px, 13.6vw, 236px) !important;
}
.auth-landing .landing-shell {
  width: 100% !important;
  min-height: 0 !important;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 26vw) !important;
  gap: clamp(18px, 3.2vw, 58px) !important;
  align-items: center !important;
}
.auth-landing .landing-hero {
  height: auto !important;
  min-height: 0 !important;
  grid-template-columns: minmax(0, .98fr) minmax(270px, .82fr) !important;
  gap: clamp(10px, 2.2vw, 42px) !important;
  align-items: center !important;
}
.auth-landing .hero-wordmark-img {
  width: min(100%, clamp(330px, 34vw, 620px)) !important;
}
.auth-landing .hero-illustration-img {
  width: min(100%, clamp(280px, 31vw, 540px)) !important;
}
.auth-landing .landing-login {
  width: min(100%, 420px) !important;
  padding: clamp(22px, 2.4vw, 36px) !important;
  align-self: center !important;
}
.auth-landing .landing-login .auth-panel-head h2 {
  font-size: clamp(26px, 2.1vw, 36px) !important;
}
.auth-landing .field-with-icon,
.auth-landing .landing-login .primary {
  height: clamp(52px, 6.5vh, 64px) !important;
}
.auth-landing .landing-categories {
  align-self: end !important;
  gap: clamp(6px, 1vh, 12px) !important;
}
.auth-landing .landing-section-title img {
  width: min(320px, 26vw) !important;
}
.auth-landing .landing-category-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: clamp(16px, 2vw, 34px) !important;
}
.auth-landing .auth-icp {
  display: none !important;
}
@media (max-width: 760px) {
  .auth-landing {
    height: auto !important;
    min-height: 100vh;
    overflow: auto !important;
  }
  .auth-landing .landing-shell,
  .auth-landing .landing-hero,
  .auth-landing .landing-category-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Login page final handoff: black-gold slice reconstruction. */
.auth-landing .landing-categories {
  display: none !important;
}

.auth-screen.auth-landing {
  --login-ink: #14161a;
  --login-muted: #5f6470;
  --login-line: #d8d2c8;
  --login-gold: #b98534;
  --login-paper: #fffdf9;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 100vh !important;
  min-height: 720px;
  display: grid !important;
  grid-template-rows: 88px minmax(520px, 1fr) 24px;
  gap: 0 !important;
  padding: 34px 64px 18px !important;
  overflow: hidden !important;
  background:
    radial-gradient(circle at 86% -18%, rgba(255, 255, 255, 0.96) 0 23%, rgba(250, 248, 244, 0) 24%),
    linear-gradient(160deg, rgba(255, 255, 255, 0) 0 53%, rgba(235, 231, 224, 0.7) 54% 60%, rgba(255, 255, 255, 0) 61%),
    linear-gradient(180deg, #fbfaf7 0%, #f8f5ef 100%) !important;
  border: 1px solid rgba(18, 18, 18, 0.12);
}

.auth-screen.auth-landing::before {
  content: "";
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: 340px;
  height: 132px;
  opacity: 0.7;
  background:
    linear-gradient(170deg, transparent 0 30%, rgba(226, 222, 214, 0.8) 31% 45%, transparent 46%),
    linear-gradient(168deg, transparent 0 42%, rgba(244, 242, 238, 0.94) 43% 60%, transparent 61%);
  pointer-events: none;
}

.auth-screen.auth-landing::after,
.auth-landing .auth-bg,
.auth-landing .auth-bg span {
  display: none !important;
}

.auth-landing .landing-brand {
  position: relative;
  z-index: 2;
  align-self: start !important;
  justify-self: start !important;
  height: 74px !important;
  display: flex !important;
  align-items: center !important;
}

.auth-landing .landing-brand-img {
  width: 254px !important;
  max-width: 28vw;
  height: auto;
  display: block;
}

.auth-landing .landing-shell {
  position: relative;
  z-index: 1;
  width: 100% !important;
  max-width: 1540px;
  justify-self: center;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(520px, 1fr) 430px !important;
  align-items: center !important;
  gap: clamp(32px, 5vw, 80px) !important;
}

.auth-landing .landing-hero {
  min-height: 430px !important;
  height: 100% !important;
  display: grid !important;
  grid-template-columns: minmax(500px, 0.95fr) minmax(430px, 0.8fr) !important;
  align-items: center !important;
  gap: clamp(20px, 2.7vw, 54px) !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.auth-landing .hero-title-wrap {
  align-self: center;
  min-width: 0;
}

.auth-landing .hero-wordmark-img {
  display: block !important;
  width: min(100%, 610px) !important;
  height: auto;
  margin-left: -24px;
  filter: drop-shadow(0 18px 28px rgba(24, 22, 18, 0.08));
}

.auth-landing .hero-title-wrap h1,
.auth-landing .hero-title-wrap p,
.auth-landing .hero-title-wrap .hero-star {
  display: none !important;
}

.auth-landing .hero-visual {
  position: relative;
  min-height: 430px !important;
  display: grid;
  place-items: center;
}

.auth-landing .hero-visual::before,
.auth-landing .hero-visual::after,
.auth-landing .hero-visual > :not(.hero-illustration-img) {
  display: none !important;
}

.auth-landing .hero-illustration-img {
  display: block !important;
  width: min(100%, 540px) !important;
  height: auto;
  transform: translateX(-2%);
  filter: drop-shadow(0 24px 40px rgba(28, 24, 18, 0.08));
}

.auth-landing .landing-login {
  width: 430px !important;
  min-height: 508px;
  align-self: center !important;
  justify-self: end !important;
  padding: 46px 36px 34px !important;
  border: 1px solid rgba(205, 199, 188, 0.95) !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 28px 70px rgba(28, 24, 18, 0.12) !important;
  backdrop-filter: blur(10px);
}

.auth-landing .landing-login::before {
  display: none !important;
}

.auth-landing .landing-login .auth-panel-head h2 {
  margin: 0;
  color: var(--login-ink) !important;
  font-size: 34px !important;
  line-height: 1.2;
  font-weight: 950;
}

.auth-landing .landing-login .auth-panel-head p {
  margin-top: 14px;
  color: var(--login-muted) !important;
  font-size: 16px !important;
}

.auth-landing .unified-phone-form {
  gap: 22px !important;
  margin-top: 28px;
}

.auth-landing .field-with-icon {
  height: 66px !important;
  display: grid !important;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 18px !important;
  border: 1px solid var(--login-line) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.86) !important;
  box-shadow: none !important;
}

.auth-landing .field-with-icon > span {
  width: 22px;
  height: 22px;
  border: 2px solid #171512;
  border-radius: 4px;
  color: transparent;
  font-size: 0;
}

.auth-landing .field-with-icon:first-child > span::before {
  content: "";
  display: block;
  width: 9px;
  height: 15px;
  margin: 2px auto;
  border: 2px solid #171512;
  border-radius: 2px;
}

.auth-landing .code-field > span::before {
  content: "";
  display: block;
  width: 14px;
  height: 16px;
  margin: 1px auto;
  clip-path: polygon(50% 0, 100% 18%, 88% 75%, 50% 100%, 12% 75%, 0 18%);
  border: 2px solid #171512;
}

.auth-landing .field-with-icon input {
  height: 100% !important;
  min-width: 0;
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #171512 !important;
  font-size: 16px !important;
}

.auth-landing .field-with-icon input::placeholder {
  color: #a1a4aa !important;
}

.auth-landing .code-field {
  grid-template-columns: 28px minmax(0, 1fr) 126px !important;
}

.auth-landing .code-field button {
  height: 48px !important;
  border: 1px solid var(--login-gold) !important;
  border-radius: 8px !important;
  background: #fffdf9 !important;
  color: #a36a1f !important;
  font-weight: 800;
  font-size: 16px;
}

.auth-landing .landing-login .primary {
  height: 70px !important;
  margin-top: 10px;
  border: 1px solid #17191c !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, #23272b 0%, #121416 100%) !important;
  color: #f1c776 !important;
  font-size: 22px !important;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(18, 19, 20, 0.24) !important;
}

.auth-landing .landing-login .primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 44px rgba(18, 19, 20, 0.32) !important;
}

.auth-landing .login-brand-title {
  display: none;
}

.auth-landing .compact-remember {
  display: none !important;
}

.auth-landing .landing-consent {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #5f6470 !important;
  line-height: 1.4;
  font-size: 14px;
  white-space: nowrap;
}

.auth-landing .landing-consent input {
  display: block !important;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: #a36a1f;
}

.auth-landing .landing-consent span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.auth-landing .landing-consent button {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #a36a1f !important;
  font-weight: 800;
  font-size: inherit;
  white-space: nowrap;
}

.auth-landing .landing-admin-login {
  margin-top: 12px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.auth-landing .landing-admin-login summary {
  color: #8a8073;
  text-align: center;
}

.auth-landing #authMessage {
  margin-top: 12px;
}

.auth-landing .landing-categories {
  position: relative;
  z-index: 2;
  display: grid !important;
  align-self: end !important;
  gap: 18px !important;
  width: 100%;
  max-width: 1495px;
  justify-self: center;
}

.auth-landing .landing-section-title {
  display: flex !important;
  justify-content: center;
}

.auth-landing .landing-section-title img {
  display: block;
  width: 430px !important;
  max-width: 32vw;
  height: auto;
}

.auth-landing .landing-category-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 30px !important;
}

.auth-landing .landing-category-grid article {
  display: block !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.auth-landing .landing-category-grid img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  filter: drop-shadow(0 18px 32px rgba(28, 24, 18, 0.06));
}

.auth-landing .auth-icp {
  position: relative !important;
  z-index: 2;
  display: block !important;
  justify-self: center;
  align-self: end;
  color: #90939a;
  font-size: 13px;
}

@media (max-width: 1380px) {
  .auth-screen.auth-landing {
    grid-template-rows: 70px minmax(480px, 1fr) 20px;
    padding-inline: 46px !important;
  }

  .auth-landing .landing-shell {
    grid-template-columns: minmax(520px, 1fr) 390px !important;
  }

  .auth-landing .landing-hero {
    grid-template-columns: minmax(430px, 0.95fr) minmax(350px, 0.8fr) !important;
  }

  .auth-landing .landing-login {
    width: 390px !important;
    min-height: 458px;
    padding: 34px 30px 28px !important;
  }

  .auth-landing .hero-wordmark-img {
    width: min(100%, 540px) !important;
  }

  .auth-landing .hero-illustration-img {
    width: min(100%, 455px) !important;
  }
}

@media (max-width: 1060px) {
  .auth-screen.auth-landing {
    height: auto !important;
    min-height: 100vh;
    overflow: auto !important;
    grid-template-rows: auto auto auto auto;
    padding: 28px 24px !important;
  }

  .auth-landing .landing-shell,
  .auth-landing .landing-hero,
  .auth-landing .landing-category-grid {
    grid-template-columns: 1fr !important;
  }

  .auth-landing .landing-login {
    width: min(100%, 430px) !important;
    justify-self: center !important;
  }

  .auth-landing .hero-wordmark-img,
  .auth-landing .hero-illustration-img {
    margin-inline: auto;
    transform: none;
  }

  .auth-landing .landing-section-title img {
    max-width: min(430px, 80vw);
  }
}

/* Final login page: single composed background + overlaid auth UI. */
.auth-screen.auth-landing {
  --login-panel-w: clamp(400px, 23vw, 450px);
  width: 100%;
  min-height: 100vh !important;
  height: 100vh !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  padding: 0 !important;
  overflow: hidden !important;
  background:
    url("/assets/login_page_slices/landing_background_no_login.webp?v=20260623-login") center top / cover no-repeat,
    #fbfaf7 !important;
  border: 0;
}

.auth-screen.auth-landing.hidden {
  display: none !important;
}

.auth-screen.auth-landing.auth-leaving {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  animation: authToModule 420ms cubic-bezier(.22, .78, .24, 1) both;
}

@keyframes authToModule {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-18px) scale(.985);
    filter: blur(8px);
  }
}

.auth-screen.auth-landing::before,
.auth-screen.auth-landing::after {
  content: none !important;
  display: none !important;
  animation: none !important;
}

.auth-landing .auth-bg,
.auth-landing .landing-brand,
.auth-landing .landing-hero,
.auth-landing .landing-categories {
  display: none !important;
}

.auth-landing .landing-shell {
  position: relative;
  z-index: 2;
  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: stretch !important;
  gap: 0 !important;
  padding: 0 !important;
  pointer-events: none;
}

.auth-landing .landing-login {
  pointer-events: auto;
  position: absolute !important;
  top: clamp(88px, 10.6vh, 112px);
  left: min(calc(100vw - var(--login-panel-w) - 72px), max(1120px, 69.5vw));
  grid-column: auto;
  width: var(--login-panel-w) !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: calc(100vh - 150px) !important;
  justify-self: auto !important;
  align-self: auto !important;
  margin: 0 !important;
  padding: clamp(28px, 3.3vh, 38px) 34px 28px !important;
  border: 1px solid rgba(205, 199, 188, 0.94) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  box-shadow: 0 22px 56px rgba(28, 24, 18, 0.12) !important;
  backdrop-filter: blur(8px);
  overflow: hidden !important;
}

.auth-landing .landing-login .auth-panel-head h2 {
  font-size: clamp(26px, 1.85vw, 34px) !important;
  line-height: 1.15;
  color: #14161a !important;
}

.auth-landing .landing-login .auth-panel-head p {
  display: none !important;
}

.auth-landing .unified-phone-form {
  margin-top: clamp(26px, 3vh, 34px) !important;
  gap: 16px !important;
}

.auth-landing .field-with-icon {
  height: 56px !important;
  border-color: rgba(205, 199, 188, 0.98) !important;
  background: rgba(255, 255, 255, 0.84) !important;
  transition: border-color .16s ease, background-color .16s ease;
}

.auth-landing .field-with-icon:focus-within {
  border-color: rgba(185, 133, 52, .72) !important;
  background: rgba(255, 255, 255, .94) !important;
  box-shadow: none !important;
  outline: none !important;
}

.auth-landing .field-with-icon > span {
  position: relative;
  width: 24px !important;
  height: 24px !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: transparent !important;
  font-size: 0 !important;
}

.auth-landing .field-with-icon > span::before,
.auth-landing .field-with-icon > span::after {
  content: "";
  position: absolute;
  display: block;
  box-sizing: border-box;
}

.auth-landing .field-with-icon:first-child > span::before {
  inset: 1px 5px;
  border: 2px solid #171512;
  border-radius: 6px;
}

.auth-landing .field-with-icon:first-child > span::after {
  left: 11px;
  bottom: 4px;
  width: 2px;
  height: 2px;
  border-radius: 999px;
  background: #171512;
  box-shadow: 0 -16px 0 #171512;
}

.auth-landing .code-field > span::before {
  left: 4px;
  top: 2px;
  width: 16px;
  height: 19px;
  border: 2px solid #171512;
  border-radius: 8px 8px 9px 9px;
  clip-path: polygon(50% 0, 100% 17%, 92% 72%, 50% 100%, 8% 72%, 0 17%);
}

.auth-landing .code-field > span::after {
  left: 9px;
  top: 9px;
  width: 8px;
  height: 5px;
  border-left: 2px solid #171512;
  border-bottom: 2px solid #171512;
  transform: rotate(-45deg);
}

.auth-landing .field-with-icon input,
.auth-landing .field-with-icon input:focus,
.auth-landing .field-with-icon input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

.auth-landing .code-field {
  grid-template-columns: 28px minmax(0, 1fr) 112px !important;
}

.auth-landing .code-field button {
  height: 42px !important;
  font-size: 14px !important;
}

.auth-landing .landing-login .primary {
  height: 58px !important;
  margin-top: 6px;
  font-size: 20px !important;
  background: linear-gradient(180deg, #23272b 0%, #121416 100%) !important;
  color: #f1c776 !important;
  box-shadow: 0 14px 30px rgba(18, 19, 20, 0.22) !important;
}

.auth-landing .landing-consent {
  margin-top: 16px !important;
  font-size: 14px !important;
}

.auth-landing .landing-admin-login {
  display: none !important;
}

.auth-landing .auth-icp {
  position: fixed !important;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 2;
  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  width: auto;
  padding: 0 18px;
  color: #8d929a;
  font-size: 13px;
  pointer-events: auto;
}

.auth-landing .auth-icp a {
  color: inherit;
  text-decoration: none;
}

.auth-landing .auth-icp span a {
  color: #9b681f;
  font-weight: 700;
}

@media (max-width: 1180px) {
  .auth-screen.auth-landing {
    height: auto !important;
    min-height: 100vh !important;
    overflow: auto !important;
    background-image:
      url("/assets/login_page_slices/landing_background_no_login_mobile.webp?v=20260623-login"),
      linear-gradient(#fbfaf7, #fbfaf7) !important;
    background-size: 100% auto, auto !important;
    background-position: left top, center !important;
  }

  .auth-landing .landing-shell {
    grid-template-columns: 1fr !important;
    justify-items: center;
    padding: 45vh 24px 36px !important;
  }

  .auth-landing .landing-login {
    position: relative !important;
    top: auto;
    left: auto;
    grid-column: 1;
    justify-self: center !important;
    width: min(430px, calc(100vw - 48px)) !important;
  }

  .auth-landing .auth-icp {
    position: relative !important;
    left: auto;
    right: auto;
    bottom: auto;
    padding-bottom: 12px;
  }
}

/* Module home final black-gold restoration and viewport fit. */
body.module-home-active {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(185, 133, 52, .08), transparent 32%),
    linear-gradient(180deg, #fbfaf7 0%, #f7f3ec 100%);
}

body.module-home-active #authScreen,
body.module-home-active .auth-icp {
  display: none !important;
}

body.module-home-active #appShell.shell {
  width: 100%;
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 3vh, 30px) clamp(32px, 5vw, 64px) clamp(14px, 2vh, 22px);
  overflow: hidden;
}

body.module-home-active .topbar {
  flex: 0 0 auto;
  min-height: 44px;
  margin: 0 0 clamp(8px, 1.8vh, 18px);
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.module-home-active .module-home.active {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
}

body.module-home-active .module-launcher {
  width: min(1500px, 100%);
  max-height: 100%;
  display: grid;
  align-items: center;
}

body.module-home-active .module-system-grid.knowledge-priority {
  grid-template-columns: minmax(360px, .72fr) minmax(560px, 1.28fr);
  gap: clamp(18px, 2vw, 28px);
  align-items: stretch;
  max-height: min(760px, calc(100vh - 128px));
}

body.module-home-active .module-system-panel {
  min-height: 0;
  padding: clamp(20px, 2.8vh, 28px);
  border: 1px solid rgba(214, 207, 196, .9);
  border-radius: 8px;
  background: rgba(255, 253, 250, .92);
  box-shadow: 0 26px 74px rgba(30, 25, 18, .09);
}

body.module-home-active .creator-system,
body.module-home-active .knowledge-system,
body.module-home-active .knowledge-hero-card,
body.module-home-active .knowledge-feature-row,
body.module-home-active .creator-menu-item,
body.module-home-active .knowledge-shortcut {
  background:
    linear-gradient(180deg, rgba(255, 253, 250, .96), rgba(251, 248, 242, .92)) !important;
}

body.module-home-active .knowledge-system {
  background:
    radial-gradient(circle at 84% 30%, rgba(198, 151, 72, .12), transparent 24%),
    linear-gradient(180deg, rgba(255, 254, 250, .96), rgba(250, 247, 241, .92)) !important;
}

body.module-home-active .knowledge-hero-card {
  background:
    radial-gradient(circle at 86% 32%, rgba(198, 151, 72, .13), transparent 24%),
    linear-gradient(135deg, rgba(255, 253, 248, .98), rgba(253, 249, 241, .94)) !important;
}

body.module-home-active .knowledge-system::before,
body.module-home-active .knowledge-hero-card::after {
  display: none !important;
  animation: none !important;
}

body.module-home-active .module-system-head {
  margin-bottom: clamp(16px, 2.2vh, 24px);
}

body.module-home-active .module-system-head h2 {
  color: #121417;
  font-size: clamp(24px, 2vw, 32px);
  letter-spacing: 0;
}

body.module-home-active .module-system-head p,
body.module-home-active .creator-menu-item small,
body.module-home-active .knowledge-shortcut small,
body.module-home-active .knowledge-hero-copy p {
  color: #5f6470;
}

body.module-home-active .module-system-mark,
body.module-home-active .knowledge-system .module-system-mark,
body.module-home-active .library-system .module-system-mark,
body.module-home-active .module-action-icon {
  border: 1px solid rgba(20, 20, 20, .18);
  background:
    radial-gradient(circle at 30% 18%, rgba(255,255,255,.22), transparent 32%),
    linear-gradient(145deg, #4a4a48 0%, #232321 58%, #11110f 100%) !important;
  color: #f5d28a !important;
  box-shadow: 0 16px 32px rgba(20, 20, 18, .18) !important;
}

body.module-home-active .module-system-mark {
  width: clamp(56px, 6vh, 68px);
  height: clamp(56px, 6vh, 68px);
  font-size: clamp(28px, 3.3vh, 34px);
}

body.module-home-active .module-action-icon {
  width: clamp(42px, 4.8vh, 52px);
  height: clamp(42px, 4.8vh, 52px);
  font-size: clamp(20px, 2.4vh, 24px);
}

body.module-home-active .module-action-icon.gold {
  background:
    radial-gradient(circle at 30% 18%, rgba(255,255,255,.28), transparent 32%),
    linear-gradient(145deg, #f2c675, #b98534) !important;
  color: #2a2115 !important;
}

body.module-home-active .creator-menu {
  gap: clamp(8px, 1.2vh, 14px);
}

body.module-home-active .creator-menu-item,
body.module-home-active .knowledge-shortcut {
  min-height: clamp(72px, 9vh, 96px);
  grid-template-columns: clamp(42px, 5vh, 58px) minmax(0, 1fr) 22px;
  gap: clamp(10px, 1.2vw, 16px);
  padding: clamp(11px, 1.5vh, 16px);
  border-color: rgba(214, 207, 196, .82);
  box-shadow: 0 12px 30px rgba(30, 25, 18, .055);
}

body.module-home-active .creator-menu-item.primary-action {
  border-color: rgba(185, 133, 52, .88);
  background: linear-gradient(90deg, rgba(255, 246, 232, .98), rgba(255, 253, 250, .94)) !important;
  box-shadow: inset 4px 0 0 #b98534, 0 14px 34px rgba(80, 58, 28, .08);
}

body.module-home-active .creator-menu-item:hover,
body.module-home-active .knowledge-shortcut:hover {
  transform: translateX(4px);
  border-color: rgba(185, 133, 52, .74);
  box-shadow: 0 16px 38px rgba(80, 58, 28, .12);
}

body.module-home-active .creator-menu-item:hover i,
body.module-home-active .knowledge-shortcut:hover i {
  color: #b98534;
}

body.module-home-active .creator-menu-item strong,
body.module-home-active .knowledge-shortcut strong {
  color: #15171a;
  font-size: clamp(16px, 1.55vw, 22px);
}

body.module-home-active .module-title-row em {
  border: 1px solid #ead8b8;
  background: #fff4df;
  color: #9a621b;
}

body.module-home-active .knowledge-hero-card {
  min-height: clamp(210px, 30vh, 304px);
  grid-template-columns: minmax(0, 1fr) clamp(190px, 18vw, 260px);
  padding: clamp(18px, 2.5vh, 28px);
  border-color: rgba(185, 133, 52, .78);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.66), 0 18px 54px rgba(30, 25, 18, .07);
  animation: none !important;
}

body.module-home-active .knowledge-eyebrow {
  color: #6b4a1b;
  background: #fff4df;
  border: 1px solid #ead8b8;
  border-radius: 4px;
  padding: 2px 4px;
}

body.module-home-active .knowledge-hero-copy h3 {
  color: #111315;
  font-size: clamp(24px, 2.6vw, 36px);
}

body.module-home-active .knowledge-primary-button {
  border-color: #191919;
  background: linear-gradient(180deg, #282827, #11110f) !important;
  color: #f5d28a;
  box-shadow: 0 18px 42px rgba(23, 21, 18, .18);
}

body.module-home-active .knowledge-secondary-button {
  border-color: rgba(214, 207, 196, .95);
  background: rgba(255, 253, 250, .86);
  color: #272727;
}

body.module-home-active .knowledge-feature-row {
  margin: clamp(10px, 1.4vh, 14px) 0;
  padding: 0;
  min-height: clamp(44px, 5.6vh, 58px);
  align-items: center;
  border-color: rgba(214, 207, 196, .9);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}

body.module-home-active .knowledge-feature-row span {
  color: #191919 !important;
  font-size: clamp(13px, 1.15vw, 16px);
  font-weight: 800;
}

body.module-home-active .knowledge-feature-row span + span {
  border-left: 1px solid rgba(214, 207, 196, .9);
}

body.module-home-active .knowledge-visual {
  animation: none !important;
  filter: none !important;
}

body.module-home-active .knowledge-book {
  background: linear-gradient(145deg, #4a4a48 0%, #232321 60%, #11110f 100%) !important;
  box-shadow: 0 22px 42px rgba(23, 21, 18, .2);
}

body.module-home-active .knowledge-book::before {
  background: linear-gradient(180deg, #f7d998, #bd812d);
}

body.module-home-active .knowledge-book::after {
  background: rgba(24, 22, 18, .18);
}

body.module-home-active .knowledge-book span {
  background: linear-gradient(180deg, #f8d993, #b98534) !important;
  box-shadow: none;
}

body.module-home-active .knowledge-orbit,
body.module-home-active .knowledge-page {
  border-color: rgba(185, 133, 52, .42);
  animation: none !important;
}

body.module-home-active .knowledge-shortcuts {
  gap: clamp(8px, 1vw, 12px);
}

body.module-home-active .knowledge-shortcut.passive {
  background: rgba(255, 253, 250, .86) !important;
}

body.module-home-active .account-avatar {
  background: linear-gradient(180deg, #e7bc69, #b98534) !important;
  color: #fff;
}

body.module-home-active .account-trigger {
  border-color: rgba(214, 207, 196, .9);
  background: rgba(255, 253, 250, .94);
  box-shadow: 0 12px 28px rgba(30, 25, 18, .08);
}

body.module-home-active .corner-tool-button {
  border-color: rgba(214, 207, 196, .9);
  background: rgba(255, 253, 250, .94);
}

body.module-home-active .app-icp {
  flex: 0 0 auto;
  margin-top: clamp(8px, 1.4vh, 14px);
  padding: 0;
  color: #8d929a;
}

@media (max-height: 850px) and (min-width: 981px) {
  body.module-home-active #appShell.shell {
    padding-top: 14px;
    padding-bottom: 10px;
  }

  body.module-home-active .topbar {
    min-height: 38px;
    margin-bottom: 6px;
  }

  body.module-home-active .module-system-panel {
    padding: 18px;
  }

  body.module-home-active .module-system-head {
    margin-bottom: 14px;
  }

  body.module-home-active .creator-menu-item,
  body.module-home-active .knowledge-shortcut {
    min-height: 70px;
    padding: 10px 12px;
  }

  body.module-home-active .knowledge-hero-card {
    min-height: 214px;
    padding: 18px;
  }

  body.module-home-active .knowledge-hero-copy h3 {
    font-size: 27px;
  }

  body.module-home-active .knowledge-feature-row {
    min-height: 42px;
    margin: 8px 0;
  }

  body.module-home-active .app-icp {
    margin-top: 6px;
  }
}

@media (max-width: 1100px) {
  body.module-home-active {
    overflow: auto;
  }

  body.module-home-active #appShell.shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  body.module-home-active .module-home.active {
    place-items: start center;
  }

  body.module-home-active .module-system-grid.knowledge-priority {
    grid-template-columns: 1fr;
    max-height: none;
  }

  body.module-home-active .knowledge-hero-card {
    grid-template-columns: minmax(0, 1fr);
  }

  body.module-home-active .knowledge-visual {
    display: none;
  }
}


/* Final module home hierarchy: two core creator actions + simplified knowledge entry. */
body.module-home-active .module-system-grid.knowledge-priority {
  grid-template-columns: minmax(430px, .78fr) minmax(640px, 1.22fr);
  gap: clamp(22px, 2.2vw, 38px);
}

body.module-home-active .creator-system {
  padding: clamp(24px, 3vh, 34px);
}

body.module-home-active .creator-priority-label {
  margin: 4px 0 12px;
  color: #8d6427;
  font-size: 14px;
  font-weight: 900;
}

body.module-home-active .creator-priority-label.secondary-label {
  margin-top: clamp(20px, 3vh, 30px);
  color: #82796f;
}

body.module-home-active .creator-menu-primary,
body.module-home-active .creator-menu-secondary {
  display: grid;
  gap: clamp(10px, 1.6vh, 16px);
}

body.module-home-active .creator-menu-secondary {
  gap: clamp(8px, 1.1vh, 12px);
}

body.module-home-active .creator-menu-item.primary-action {
  min-height: clamp(96px, 12vh, 112px);
  border-color: rgba(185, 133, 52, .9);
  background: linear-gradient(90deg, rgba(255, 247, 234, .98), rgba(255, 254, 250, .96)) !important;
  box-shadow: inset 5px 0 0 #b98534, 0 18px 42px rgba(80, 58, 28, .10);
}

body.module-home-active .creator-menu-item.secondary-action {
  min-height: clamp(58px, 8vh, 74px);
  opacity: .94;
  background: rgba(255, 255, 253, .9) !important;
  box-shadow: 0 10px 24px rgba(30, 25, 18, .045);
}

body.module-home-active .creator-menu-item.secondary-action strong {
  font-size: clamp(15px, 1.2vw, 19px);
}

body.module-home-active .creator-menu-item.secondary-action small {
  font-size: clamp(12px, .9vw, 14px);
}

body.module-home-active .creator-menu-item.secondary-action .module-action-icon {
  width: clamp(38px, 4.2vh, 48px);
  height: clamp(38px, 4.2vh, 48px);
  font-size: clamp(18px, 2.1vh, 22px);
}

body.module-home-active .knowledge-system {
  padding: clamp(26px, 3.4vh, 42px);
}

body.module-home-active .knowledge-head {
  margin-bottom: clamp(22px, 3vh, 34px);
}

body.module-home-active .knowledge-head .module-system-mark {
  width: clamp(58px, 6.2vh, 72px);
  height: clamp(58px, 6.2vh, 72px);
}

body.module-home-active .knowledge-head h2 {
  font-size: clamp(34px, 3.5vw, 48px);
}

body.module-home-active .knowledge-head p {
  max-width: 760px;
  font-size: clamp(16px, 1.3vw, 19px);
}

body.module-home-active .knowledge-hero-card {
  min-height: clamp(310px, 43vh, 420px);
  grid-template-columns: minmax(0, 1fr) clamp(230px, 23vw, 330px);
  align-items: center;
  padding: clamp(28px, 4vh, 48px);
}

body.module-home-active .knowledge-eyebrow,
body.module-home-active .knowledge-secondary-button,
body.module-home-active .knowledge-feature-row,
body.module-home-active .knowledge-shortcuts {
  display: none !important;
}

body.module-home-active .knowledge-hero-copy h3 {
  margin: 0;
  font-size: clamp(34px, 3.7vw, 54px);
  line-height: 1.2;
}

body.module-home-active .knowledge-hero-copy p {
  max-width: 650px;
  margin-top: clamp(18px, 2.2vh, 26px);
  font-size: clamp(17px, 1.35vw, 21px);
  line-height: 1.8;
}

body.module-home-active .knowledge-hero-copy .knowledge-value-copy {
  max-width: 760px;
  margin: 0;
  color: #5f6470;
  font-size: clamp(17px, 1.35vw, 21px);
  line-height: 1.8;
  font-weight: 400;
}

body.module-home-active .knowledge-actions {
  margin-top: clamp(26px, 3.2vh, 38px);
}

body.module-home-active .knowledge-primary-button {
  min-width: clamp(190px, 17vw, 230px);
  height: clamp(56px, 7vh, 70px);
  justify-content: center;
  font-size: clamp(18px, 1.45vw, 22px);
}

body.module-home-active .knowledge-value-strip {
  min-height: 56px;
  display: flex;
  align-items: center;
  margin-top: clamp(18px, 2.6vh, 30px);
  padding: 0 clamp(22px, 2vw, 32px);
  border: 1px solid rgba(214, 207, 196, .9);
  border-radius: 8px;
  background: rgba(255, 255, 253, .88);
  color: #23201b;
  font-size: clamp(15px, 1.2vw, 18px);
  font-weight: 700;
}

body.module-home-active .knowledge-visual {
  min-height: 270px;
}

body.module-home-active .knowledge-book {
  width: clamp(120px, 10vw, 165px);
  height: clamp(180px, 15vw, 235px);
}

body.module-home-active .knowledge-page {
  background: rgba(255, 253, 248, .72);
}

body.module-home-active #moduleLibraryAdmin {
  text-align: left;
}

@media (max-height: 850px) and (min-width: 981px) {
  body.module-home-active .knowledge-hero-card {
    min-height: 285px;
  }
  body.module-home-active .knowledge-hero-copy h3 {
    font-size: clamp(30px, 3vw, 42px);
  }
  body.module-home-active .knowledge-value-strip {
    min-height: 48px;
    margin-top: 14px;
  }
}

@media (max-width: 1100px) {
  body.module-home-active .module-system-grid.knowledge-priority {
    grid-template-columns: 1fr;
  }
}

/* Billing card alignment: keep matching rows on the same baseline. */
#settingsTabBilling.active .payment-plans,
#settingsTabBilling .payment-plans {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}

#settingsTabBilling.active .payment-plan,
#settingsTabBilling .payment-plan {
  min-height: 300px;
  grid-template-rows: 76px 44px 38px 42px 52px;
  align-content: stretch;
  gap: 10px;
}

#settingsTabBilling.active .plan-head,
#settingsTabBilling .plan-head {
  min-width: 0;
  align-items: flex-start;
}

#settingsTabBilling.active .plan-head > div,
#settingsTabBilling .plan-head > div {
  min-width: 0;
}

#settingsTabBilling.active .payment-plan h3,
#settingsTabBilling .payment-plan h3,
#settingsTabBilling.active .plan-head p,
#settingsTabBilling .plan-head p,
#settingsTabBilling.active .plan-desc,
#settingsTabBilling .plan-desc,
#settingsTabBilling.active .plan-allowance,
#settingsTabBilling .plan-allowance {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#settingsTabBilling.active .plan-head p,
#settingsTabBilling .plan-head p {
  margin: 6px 0 0;
  font-size: 14px;
}

#settingsTabBilling.active .plan-price,
#settingsTabBilling .plan-price {
  align-items: center;
}

#settingsTabBilling.active .plan-allowance,
#settingsTabBilling .plan-allowance {
  align-self: center;
  justify-self: start;
  min-width: 76px;
}

#settingsTabBilling.active .plan-desc,
#settingsTabBilling .plan-desc {
  min-height: 0;
  margin: 0;
  align-self: center;
  line-height: 1.5;
}

#settingsTabBilling.active .payment-plan button.primary,
#settingsTabBilling .payment-plan button.primary {
  align-self: end;
  min-height: 50px;
  margin-top: 0;
}

@media (max-width: 1180px) {
  #settingsTabBilling.active .payment-plans,
  #settingsTabBilling .payment-plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  #settingsTabBilling.active .payment-plans,
  #settingsTabBilling .payment-plans {
    grid-template-columns: 1fr;
  }
}



/* Redesigned Knowledge Library Management Styles */
.library-package-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 16px;
  padding: 4px;
}

.library-package-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.03);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
  cursor: pointer;
}

.library-package-card:hover {
  transform: translateY(-4px);
  border-color: rgba(39, 110, 241, 0.4);
  box-shadow: 0 16px 36px rgba(16, 24, 40, 0.08);
}

.library-package-card.published:hover {
  border-color: rgba(6, 118, 71, 0.4);
}

.library-package-card .card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), #14b8a6);
  opacity: 0.8;
}

.library-package-card.unpublished .card-glow {
  background: linear-gradient(90deg, var(--muted), var(--line));
}

.library-package-card.free-open .card-glow {
  background: linear-gradient(90deg, #b98534, #22c55e);
}

.card-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.card-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--muted);
  border: 1px solid var(--line);
}

.library-package-card.published .card-status-badge {
  background: #ecfdf3;
  color: var(--green);
  border-color: #abefc6;
}

.library-package-card.free-open .card-status-badge {
  background: #fff7e8;
  color: #9b681f;
  border-color: #f0c783;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}

.library-package-card.published .status-dot {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.library-package-card h3 {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 38px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.meta-label {
  font-weight: 600;
  color: var(--text);
  opacity: 0.7;
}

.card-footer-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  align-items: center;
  border-top: 1px solid var(--soft);
  padding-top: 16px;
  gap: 8px;
}

.metric-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-group.clickable-metric {
  cursor: pointer;
}

.metric-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.metric-val.highlighted {
  color: var(--blue);
}

.metric-lbl {
  font-size: 11px;
  color: var(--muted);
}

.card-edit-btn {
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.card-edit-btn:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
  color: var(--blue);
}

/* Modal / Slide-out drawer */
.library-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.library-edit-modal.active {
  display: block;
  opacity: 1;
}

.library-edit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.library-edit-dialog {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100%);
  background: var(--panel);
  box-shadow: -12px 0 40px rgba(16, 24, 40, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.library-edit-modal.active .library-edit-dialog {
  transform: translateX(0);
}

.library-edit-header {
  padding: 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.library-edit-header h2 {
  font-size: 20px;
  margin: 0;
}

.library-edit-header p {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}

.library-edit-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.library-edit-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.library-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.library-edit-form label.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.library-edit-form input[type="text"],
.library-edit-form input[type="number"],
.library-edit-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.library-edit-form input:focus,
.library-edit-form textarea:focus {
  border-color: var(--blue);
}

.library-edit-form .grid.double-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Tabs & details list */
.library-details-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  flex: 1;
  min-height: 300px;
}

.library-details-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}

.library-details-tab {
  background: none;
  border: none;
  padding: 0 0 10px 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0;
}

.library-details-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.library-details-content {
  flex: 1;
}

.details-pane {
  display: none;
}

.details-pane.active {
  display: block;
}

.details-empty {
  color: var(--muted);
  padding: 30px;
  text-align: center;
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--soft);
}

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

.details-table th,
.details-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.details-table th {
  font-weight: 600;
  color: var(--muted);
  background: var(--soft);
}

.details-table td small {
  color: var(--muted);
}

.inline-danger-btn {
  min-height: 30px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fff7f7;
  color: #b91c1c;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.inline-danger-btn:hover {
  border-color: #ef4444;
  background: #fee2e2;
}

.article-name-cell {
  font-weight: 600;
  color: var(--text);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  background: var(--blue-soft);
  color: var(--blue);
}

.library-edit-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  background: var(--soft);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.library-edit-footer button {
  min-width: 100px;
}

.library-edit-footer-spacer {
  flex: 1;
}

#settingsTabBilling .membership-info {
  margin-top: 10px;
}

#settingsTabBilling .membership-card,
#settingsTabBilling.active .membership-card {
  padding: 14px 18px !important;
  min-height: 0;
}

#settingsTabBilling .membership-card::after {
  width: 86px;
  height: 86px;
  inset: auto 26px -30px auto;
}

#settingsTabBilling .membership-card strong {
  font-size: 17px;
  line-height: 1.25;
}

#settingsTabBilling .membership-card > span {
  margin-top: 3px;
  font-size: 12px;
}

#settingsTabBilling .membership-quota-grid {
  gap: 8px;
  margin-top: 10px;
}

#settingsTabBilling .membership-quota-grid div {
  min-height: 46px;
  padding: 7px 10px;
}

#settingsTabBilling .membership-quota-grid b {
  font-size: 18px;
  line-height: 1.1;
}

#settingsTabBilling .membership-quota-grid span {
  margin-top: 1px;
  font-size: 11px;
}

#settingsTabBilling .membership-card small {
  margin-top: 7px;
  font-size: 12px;
}

/* Management center prototype layout */
#settingsModal .settings-backdrop {
  background:
    linear-gradient(90deg, rgba(15, 23, 42, .10) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 23, 42, .09) 1px, transparent 1px),
    rgba(15, 23, 42, .34);
  background-size: 40px 40px;
}

#settingsModal .settings-dialog {
  width: min(1760px, calc(100vw - 48px));
  height: min(980px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  grid-template-columns: 200px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  border-color: #ded4c7;
  border-radius: 16px;
  background: #fffdf8;
  box-shadow: 0 24px 70px rgba(16, 24, 40, .24);
}

#settingsModal .settings-header {
  grid-column: 1 / -1;
  min-height: 74px;
  padding: 22px 40px 14px;
  border-bottom-color: #e6d9c8;
  background: #fffdf8;
}

#settingsModal .settings-header h2 {
  margin: 0;
  color: #111827;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 950;
}

#settingsModal .settings-header p {
  display: none;
}

#settingsModal #settingsClose {
  width: 38px;
  height: 38px;
  border-color: #d8e2ee;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font-size: 24px;
}

#settingsModal .settings-tabs {
  display: flex;
  grid-column: 1;
  grid-row: 2;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 24px 18px 24px 24px;
  border-right: 1px solid #e6d9c8;
  border-bottom: 0;
  background: #fffaf2;
}

#settingsModal .settings-tab {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #dfc7a7;
  border-radius: 8px;
  background: #fffdfa;
  color: #526275;
  text-align: left;
  font-weight: 900;
}

#settingsModal .settings-tab.active {
  border-color: #111827;
  background: #111827;
  color: #f5ce78;
  box-shadow: none;
}

#settingsModal .settings-body {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  padding: 24px 28px 42px;
  background: #fffdf8;
}

#settingsModal.settings-single-mode .settings-body {
  grid-column: 1 / -1;
}

#settingsModal .settings-tab-panel {
  max-width: 100%;
  min-width: 0;
}

#settingsModal .management-section-head,
#settingsModal .panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
}

#settingsModal .management-section-head {
  align-items: center;
  justify-content: flex-end;
}

#settingsModal .management-section-head h2,
#settingsModal .panel-title h2,
#settingsModal .settings-tab-panel > .panel-title h2 {
  margin: 0;
  color: #111827;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 950;
}

#settingsModal .management-section-head p {
  margin: 8px 0 0;
  color: #536681;
  font-size: 15px;
}

#settingsModal .management-section-head > button,
#settingsModal .panel-title > button,
#settingsModal .settings-actions button,
#settingsModal .topic-edit-prototype button {
  min-width: 112px;
  height: 42px;
  border: 1px solid #dfc7a7;
  border-radius: 9px;
  background: #fffdfa;
  color: #243142;
  font-weight: 900;
}

#settingsModal #settingsTabAdmin {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

#settingsModal #settingsTabAdmin > .management-section-head {
  position: absolute;
  top: 6px;
  right: 0;
  z-index: 2;
  margin: 0;
}

#settingsModal .library-package-list {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  overflow: hidden;
}

#settingsModal button.primary,
#settingsModal .primary,
#settingsModal .topic-edit-prototype button.primary,
#settingsModal .settings-actions button.primary {
  border-color: #111827;
  background: #111827;
  color: #f5ce78;
}

#settingsModal .management-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  max-width: 980px;
  margin-bottom: 36px;
}

#settingsModal .management-kpi-grid div {
  min-height: 94px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 8px 16px;
  padding: 20px 18px;
  border: 1px solid #dfc7a7;
  border-radius: 10px;
  background: #fffdfa;
}

#settingsModal .management-kpi-grid span {
  grid-column: 1 / -1;
  color: #536681;
  font-size: 13px;
}

#settingsModal .management-kpi-grid strong {
  color: #111827;
  font-size: 28px;
  line-height: 1;
  white-space: nowrap;
}

#settingsModal .management-kpi-grid em {
  align-self: end;
  color: #9b681f;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

#settingsModal .library-package-filterbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0 0 14px;
  padding: 0;
  overflow: hidden;
}

#settingsModal .library-filter-group {
  flex: 0 0 300px;
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  width: auto;
  max-width: none;
  padding: 4px;
  border: 1px solid #dfc7a7;
  border-radius: 999px;
  background: #f8f0e2;
}

#settingsModal .library-filter-group button {
  height: 36px;
  padding: 0 10px;
  min-width: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5f6470;
  font-weight: 900;
}

#settingsModal .library-filter-group button.active {
  background: #111827;
  color: #f5ce78;
}

#settingsModal .admin-order-filterbar {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: 260px;
  padding: 4px;
  border: 1px solid #dfc7a7;
  border-radius: 999px;
  background: #f8f0e2;
}

#settingsModal .admin-order-filterbar button {
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5f6470;
  font-weight: 900;
}

#settingsModal .admin-order-filterbar button.active {
  background: #111827;
  color: #f5ce78;
}

#settingsModal .library-type-select {
  min-width: 0;
  flex: 0 0 220px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#settingsModal .library-type-select span {
  color: #243142;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

#settingsModal .library-type-select select {
  flex: 1 1 auto;
  height: 44px;
  min-width: 0;
  padding: 0 12px;
}

#settingsModal .library-package-toolbar {
  display: contents;
}

#settingsModal .library-package-search {
  flex: 1 1 360px;
  max-width: none;
  min-width: 240px;
  display: block;
}

#settingsModal .library-package-search span {
  display: none;
}

#settingsModal .library-package-search input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  font-size: 15px;
}

#settingsModal .library-auto-classify {
  flex: 0 0 auto;
  height: 44px;
  min-width: 132px;
  border: 1px solid #111827;
  border-radius: 8px;
  background: #111827;
  color: #f5ce78;
  font-weight: 900;
}

#settingsModal .library-auto-classify:disabled {
  cursor: wait;
  opacity: .62;
}

#settingsModal .library-package-cards-grid {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  overflow: hidden;
}

#settingsModal .library-package-card {
  position: relative;
  min-width: 0;
  min-height: 178px;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 24px 22px 18px;
  border: 1px solid #dfc7a7;
  border-top: 4px solid #c7903e;
  border-radius: 8px;
  background: #fffdfa;
  box-shadow: none;
  cursor: pointer;
}

#settingsModal .library-package-card.free-open {
  border-top-color: #111827;
}

#settingsModal .library-package-card.unpublished {
  border-top-color: #d3c6b5;
  background: #fbf8f2;
}

#settingsModal .library-package-card .card-glow,
#settingsModal .library-package-card .card-meta {
  display: none;
}

#settingsModal .card-status-badge {
  width: fit-content;
  margin-bottom: 18px;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid #dfc7a7;
  background: #fff7e9;
  color: #9b681f;
  font-size: 13px;
  font-weight: 900;
}

#settingsModal .library-package-card.free-open .card-status-badge {
  border-color: #111827;
  background: #111827;
  color: #f5ce78;
}

#settingsModal .library-package-card.unpublished .card-status-badge {
  border-color: #d8d4cc;
  background: #f6f2eb;
  color: #6b7280;
}

#settingsModal .status-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 999px;
  background: currentColor;
}

#settingsModal .library-package-card h3 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 20px;
  line-height: 1.3;
}

#settingsModal .library-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

#settingsModal .library-card-tags span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #dfc7a7;
  border-radius: 999px;
  background: #fbf5eb;
  color: #9b681f;
  font-size: 12px;
  font-weight: 900;
}

#settingsModal .library-package-card .card-desc {
  margin: 0;
  color: #536681;
  font-size: 13px;
}

#settingsModal .card-footer-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 112px;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #e8dccb;
}

#settingsModal .metric-group {
  display: flex;
  gap: 5px;
  align-items: baseline;
}

#settingsModal .metric-val {
  color: #111827;
  font-weight: 900;
}

#settingsModal .metric-lbl {
  color: #536681;
  font-size: 12px;
}

#settingsModal .card-edit-btn {
  height: 36px;
  border-color: #dfc7a7;
  color: #243142;
  background: #fffdfa;
  font-weight: 900;
}

#settingsModal .topic-edit-prototype {
  display: grid;
  grid-template-columns: minmax(360px, 470px) minmax(0, 1fr);
  gap: 30px;
}

#settingsModal .panel,
#settingsModal .topic-edit-prototype .panel,
#settingsModal #settingsTabOrders .panel {
  border: 1px solid #dfc7a7;
  border-radius: 10px;
  background: #fffdfa;
  box-shadow: none;
}

#settingsModal .topic-edit-prototype .panel,
#settingsModal #settingsTabOrders .panel {
  padding: 28px;
}

#settingsModal .content-audit-panel {
  display: grid;
  gap: 16px;
}

#settingsModal .content-audit-toolbar {
  display: grid;
  gap: 14px;
}

#settingsModal .management-kpi-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#settingsModal .content-audit-filterbar {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(280px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

#settingsModal .content-audit-filterbar button {
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid #dfc7a7;
  border-radius: 9px;
  background: #111827;
  color: #f5ce78;
  font-weight: 900;
}

#settingsModal .content-audit-table {
  overflow-x: auto;
}

#settingsModal .content-audit-table .management-table {
  min-width: 1320px;
}

#settingsModal .content-audit-title {
  min-width: 340px;
  max-width: 520px;
}

#settingsModal .content-audit-title strong,
#settingsModal .content-audit-title span,
#settingsModal .content-audit-table small {
  display: block;
}

#settingsModal .content-audit-title strong {
  color: #12305c;
  line-height: 1.45;
}

#settingsModal .content-audit-title span,
#settingsModal .content-audit-table small {
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
}

#settingsModal .audit-status {
  display: inline-flex;
  min-width: 84px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef4ff;
  color: #075cd8;
  font-size: 12px;
  font-weight: 900;
}

#settingsModal .audit-status.success {
  background: #dcfae6;
  color: #087443;
}

#settingsModal .audit-status.info {
  background: #e0f2fe;
  color: #026aa2;
}

#settingsModal .audit-status.danger {
  background: #fee4e2;
  color: #b42318;
}

#settingsModal .audit-status.muted {
  background: #f2f4f7;
  color: #667085;
}

#settingsModal #settingsTabOrders .panel {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#settingsModal #settingsTabOrders .management-table {
  min-width: 860px;
}

#settingsModal .topic-edit-prototype h2 {
  margin: 0 0 24px;
  color: #111827;
  font-size: 22px;
}

#settingsModal .topic-edit-prototype h2 span {
  margin-left: 14px;
  color: #536681;
  font-size: 14px;
}

#settingsModal label {
  color: #243142;
  font-weight: 800;
}

#settingsModal input,
#settingsModal textarea,
#settingsModal select {
  border-color: #dfc7a7;
  border-radius: 8px;
  background: #fffdfa;
}

#settingsModal input:focus,
#settingsModal textarea:focus,
#settingsModal select:focus {
  border-color: #c7903e;
  outline: 3px solid rgba(199, 144, 62, .14);
}

#settingsModal .management-table,
#settingsModal .admin-users-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  color: #243142;
}

#settingsModal .management-table th,
#settingsModal .admin-users-table th {
  padding: 14px 16px;
  border-bottom: 1px solid #e8dccb;
  background: #f7f2ea;
  color: #536681;
  font-weight: 900;
  text-align: left;
}

#settingsModal .management-table td,
#settingsModal .admin-users-table td {
  padding: 18px 16px;
  border-bottom: 1px solid #e8dccb;
}

#settingsModal .management-table .link-button {
  min-width: auto;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #244ba8;
  font-weight: 900;
}

#settingsModal .admin-users-list {
  gap: 14px;
}

#settingsModal #settingsTabUsers {
  position: relative;
}

#settingsModal #settingsTabUsers > .management-section-head {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  margin: 0;
  gap: 10px;
  flex-wrap: nowrap;
}

#settingsModal .refresh-status {
  order: -1;
  min-width: 94px;
  color: #9b681f;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

#settingsModal .admin-user-toolbar {
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 0;
  min-height: 42px;
  padding-right: 240px;
  flex-wrap: nowrap;
}

#settingsModal .admin-user-toolbar > div {
  display: none;
}

#settingsModal .admin-user-toolbar strong {
  font-size: 18px;
}

#settingsModal .admin-user-toolbar label {
  flex: 0 1 460px;
  min-width: 460px;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  color: #243142;
  font-weight: 900;
}

#settingsModal .admin-user-toolbar input {
  flex: 1 1 auto;
  min-width: 0;
  margin-top: 0;
}

#settingsModal #adminUserVisibleCount,
#settingsModal .adminUserTotalCount {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid #dfc7a7;
  border-radius: 999px;
  border-color: #dfc7a7;
  background: #fffdfa;
  color: #9b681f;
  font-size: 12px;
  font-weight: 900;
}

#settingsModal .admin-table-wrap {
  border-color: #dfc7a7;
  border-radius: 10px;
  box-shadow: none;
}

#settingsModal .category-editor {
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 30px;
  margin-top: 22px;
}

#settingsModal .category-tab {
  min-height: 72px;
  border-color: #e8dccb;
  background: #fffdfa;
}

#settingsModal .category-tab.active {
  border-color: #84b8ff;
  background: #edf6ff;
  color: #0b5ccf;
}

#settingsModal .category-form {
  padding: 28px;
  border-color: #dfc7a7;
  background: #fffdfa;
}

#settingsModal .cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

@media (max-width: 1200px) {
  #settingsModal .settings-dialog {
    width: calc(100vw - 40px);
  }
  #settingsModal .management-kpi-grid,
  #settingsModal .library-package-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #settingsModal .topic-edit-prototype {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  #settingsModal .settings-dialog {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
  }
  #settingsModal .settings-tabs {
    grid-column: 1;
    grid-row: 2;
    flex-direction: row;
    overflow-x: auto;
    padding-top: 14px;
    padding-bottom: 14px;
    border-right: 0;
    border-bottom: 1px solid #e6d9c8;
  }
  #settingsModal .settings-header,
  #settingsModal .settings-tabs,
  #settingsModal .settings-body {
    padding-left: 18px;
    padding-right: 18px;
  }
  #settingsModal .settings-tab {
    flex: 0 0 auto;
    width: auto;
    min-width: 96px;
    text-align: center;
  }
  #settingsModal .settings-body {
    grid-column: 1;
    grid-row: 3;
  }
  #settingsModal .management-kpi-grid,
  #settingsModal .library-package-cards-grid {
    grid-template-columns: 1fr;
  }
  #settingsModal #settingsTabOrders .panel {
    padding: 12px;
  }
  #settingsModal #settingsTabOrders .management-table,
  #settingsModal #settingsTabOrders .management-table thead,
  #settingsModal #settingsTabOrders .management-table tbody,
  #settingsModal #settingsTabOrders .management-table tr,
  #settingsModal #settingsTabOrders .management-table th,
  #settingsModal #settingsTabOrders .management-table td {
    display: block;
  }
  #settingsModal #settingsTabOrders .management-table {
    min-width: 0;
    width: 100%;
  }
  #settingsModal #settingsTabOrders .management-table thead {
    display: none;
  }
  #settingsModal #settingsTabOrders .management-table tbody {
    display: grid;
    gap: 10px;
  }
  #settingsModal #settingsTabOrders .management-table tr {
    border: 1px solid #eadcc8;
    border-radius: 10px;
    background: #fffdfa;
    padding: 10px 12px;
  }
  #settingsModal #settingsTabOrders .management-table td {
    border: 0;
    padding: 8px 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #settingsModal #settingsTabOrders .management-table td + td {
    border-top: 1px solid rgba(223, 199, 167, .62);
  }
  #settingsModal #settingsTabOrders .management-table td::before {
    content: "";
    display: block;
    margin-bottom: 3px;
    color: #6b7280;
    font-size: 11px;
    font-weight: 900;
  }
  #settingsModal #settingsTabOrders .management-table td:nth-child(1)::before { content: "订单号"; }
  #settingsModal #settingsTabOrders .management-table td:nth-child(2)::before { content: "用户"; }
  #settingsModal #settingsTabOrders .management-table td:nth-child(3)::before { content: "专题"; }
  #settingsModal #settingsTabOrders .management-table td:nth-child(4)::before { content: "金额"; }
  #settingsModal #settingsTabOrders .management-table td:nth-child(5)::before { content: "状态"; }
  #settingsModal #settingsTabOrders .management-table td:nth-child(6)::before { content: "支付时间"; }
  #settingsModal #settingsTabOrders .management-table td:nth-child(7)::before { content: "来源"; }
  #settingsModal #settingsTabOrders .management-table td:nth-child(8)::before { content: "操作"; }
  #settingsModal #settingsTabOrders .management-table .link-button {
    width: 100%;
    min-height: 38px;
  }
  #settingsModal .library-package-filterbar {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    overflow: visible;
  }
  #settingsModal .library-filter-group {
    width: 100%;
    max-width: 100%;
    flex-basis: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 12px;
  }
  #settingsModal .library-type-select,
  #settingsModal .library-package-search,
  #settingsModal .library-auto-classify {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex-basis: auto;
  }
  #settingsModal .library-auto-classify {
    min-width: 0;
  }
}

/* Creator settings tabs on the module home settings entry. */
#settingsModal .creator-settings-shell {
  display: grid;
  gap: 22px;
}

#settingsModal .creator-settings-tabs {
  width: fit-content;
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(104px, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid #e7d2b4;
  border-radius: 999px;
  background: #fbf4e7;
}

#settingsModal .creator-settings-tab {
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #4b5563;
  font-weight: 900;
}

#settingsModal .creator-settings-tab.active {
  background: #111827;
  color: #f5ce78;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.16);
}

#settingsModal .creator-settings-panel {
  display: none;
}

#settingsModal .creator-settings-panel.active {
  display: block;
}

#settingsModal .creator-settings-card {
  min-height: 220px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 34px 36px;
  border: 1px solid #dfc7a7;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 252, 246, 0.98), rgba(255, 249, 238, 0.88));
}

#settingsModal .creator-settings-card h2 {
  margin: 0;
  color: #101828;
  font-size: 26px;
  letter-spacing: 0;
}

#settingsModal .creator-settings-card p {
  max-width: 680px;
  margin: 12px 0 0;
  color: #536681;
  line-height: 1.8;
  font-size: 15px;
}

#settingsModal .creator-settings-open {
  min-width: 176px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #111827;
  color: #f5ce78;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 18px 32px rgba(17, 24, 39, 0.16);
}

#settingsModal .wechat-settings-inline {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid #dfc7a7;
  border-radius: 10px;
  background: #fffdfa;
}

#settingsModal .wechat-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid #eadcc8;
  background: linear-gradient(135deg, rgba(255, 252, 246, 0.98), rgba(255, 249, 238, 0.88));
}

#settingsModal .wechat-settings-head h2 {
  margin: 0;
  color: #101828;
  font-size: 22px;
}

#settingsModal .wechat-settings-head p {
  margin: 6px 0 0;
  color: #536681;
  line-height: 1.6;
}

#settingsModal .wechat-settings-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#settingsModal .wechat-settings-head-actions button,
#settingsModal .wechat-inline-form button {
  min-height: 40px;
  border: 1px solid #dfc7a7;
  border-radius: 8px;
  background: #fffdfa;
  color: #243142;
  padding: 0 14px;
  font-weight: 900;
}

#settingsModal .wechat-settings-head-actions .secondary-action {
  color: #9b681f;
}

#settingsModal .wechat-inline-form button.primary {
  border-color: #111827;
  background: #111827;
  color: #f5ce78;
}

#settingsModal .wechat-account-list {
  display: grid;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid #eadcc8;
}

#settingsModal .wechat-account-empty {
  padding: 14px;
  border: 1px dashed #dfc7a7;
  border-radius: 8px;
  background: #fffaf0;
  color: #536681;
}

#settingsModal .wechat-account-row {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e0d3c1;
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

#settingsModal .wechat-account-row.active {
  border-color: #0b6b61;
  background: #eef7f5;
  box-shadow: 0 0 0 3px rgba(11, 107, 97, 0.08);
}

#settingsModal .wechat-account-row strong,
#settingsModal .wechat-account-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#settingsModal .wechat-account-row strong {
  color: #111827;
  font-size: 15px;
}

#settingsModal .wechat-account-row small {
  margin-top: 4px;
  color: #536681;
  font-size: 12px;
}

#settingsModal .wechat-account-row em {
  color: #9b681f;
  font-style: normal;
  font-weight: 900;
}

#settingsModal .wechat-account-list.collapsed .wechat-account-row small {
  display: none;
}

#settingsModal .wechat-inline-form,
#settingsModal .wechat-config-detail {
  display: grid;
  gap: 15px;
}

#settingsModal .wechat-inline-form {
  padding: 18px;
}

#settingsModal .wechat-config-detail.collapsed {
  display: none;
}

#settingsModal .ad-template-settings {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  min-height: 520px;
}

#settingsModal .ad-template-side,
#settingsModal .ad-template-form {
  border: 1px solid rgba(208, 180, 139, .7);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  padding: 18px;
}

#settingsModal .ad-template-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#settingsModal .ad-template-side h2,
#settingsModal .ad-template-form h2 {
  margin: 0;
  font-size: 22px;
}

#settingsModal .ad-template-side p,
#settingsModal .ad-template-form p {
  margin: 6px 0 0;
  color: #536079;
  font-size: 14px;
  line-height: 1.6;
}

#settingsModal .ad-template-list {
  display: grid;
  gap: 10px;
  min-height: 120px;
}

#settingsModal .ad-template-row {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(208, 180, 139, .78);
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}

#settingsModal .ad-template-row.active {
  border-color: #0f766e;
  background: #e7f8f3;
  box-shadow: inset 3px 0 0 #14b8a6;
}

#settingsModal .ad-template-row strong {
  font-size: 14px;
  line-height: 1.4;
}

#settingsModal .ad-template-row small,
#settingsModal .ad-template-empty {
  color: #64748b;
  font-size: 12px;
}

#settingsModal .ad-template-form {
  display: grid;
  gap: 14px;
}

#settingsModal .ad-template-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

#settingsModal .check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

#settingsModal .check-row input {
  width: auto;
}

#settingsModal .wechat-ip-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid #dfc7a7;
  border-radius: 8px;
  background: #fffaf0;
}

#settingsModal .wechat-ip-box span {
  display: block;
  margin-bottom: 4px;
  color: #7a6141;
  font-size: 12px;
  font-weight: 900;
}

#settingsModal .wechat-ip-box strong {
  color: #111827;
  font-size: 20px;
  letter-spacing: 0;
}

#settingsModal .wechat-notice {
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.7;
}

#settingsModal .wechat-config-guide {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid #eadcc8;
  border-radius: 8px;
  background: #fffaf0;
}

#settingsModal .wechat-config-guide h3 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 15px;
}

#settingsModal .wechat-config-guide ol {
  margin: 0;
  padding-left: 20px;
  color: #46515f;
  line-height: 1.8;
}

#settingsModal .queue-settings-inline {
  display: grid;
  grid-template-columns: 300px minmax(300px, 0.72fr) minmax(420px, 1fr);
  gap: 22px;
}

#settingsModal .queue-rules-panel,
#settingsModal .queue-bulk-panel,
#settingsModal .queue-list-panel {
  border: 1px solid #dfc7a7;
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.86);
}

#settingsModal .queue-rules-panel {
  min-height: 680px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 26px;
  padding: 28px 24px;
}

#settingsModal .queue-rules-panel h2,
#settingsModal .queue-bulk-panel h2,
#settingsModal .queue-list-panel h2 {
  margin: 0;
  color: #111827;
  font-size: 24px;
}

#settingsModal .queue-rules-panel p,
#settingsModal .queue-bulk-panel p,
#settingsModal .queue-list-panel p {
  margin: 4px 0 0;
  color: #667085;
  line-height: 1.5;
}

#settingsModal .queue-bulk-panel {
  min-height: 680px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 18px;
  padding: 28px 22px;
}

#settingsModal .queue-bulk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

#settingsModal .queue-bulk-head span {
  flex: 0 0 auto;
  min-width: 78px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #075cd8;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

#settingsModal .queue-bulk-controls {
  display: grid;
  gap: 14px;
}

#settingsModal .queue-bulk-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#settingsModal .queue-bulk-actions button {
  min-height: 40px;
  border: 1px solid #dfc7a7;
  border-radius: 9px;
  background: #fffdfa;
  color: #111827;
  font-weight: 900;
}

#settingsModal .queue-bulk-actions button.primary {
  grid-column: 1 / -1;
  border-color: #11100e;
  background: #11100e;
  color: #f5ce78;
}

#settingsModal .queue-bulk-article-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-right: 4px;
}

#settingsModal .queue-bulk-article {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e4d3ba;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

#settingsModal .queue-bulk-article input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin-top: 2px;
  accent-color: #075cd8;
}

#settingsModal .queue-bulk-article span {
  min-width: 0;
}

#settingsModal .queue-bulk-article strong,
#settingsModal .queue-bulk-article small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

#settingsModal .queue-bulk-article strong {
  color: #111827;
  font-size: 15px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
}

#settingsModal .queue-bulk-article small {
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
}

#settingsModal .queue-bulk-empty {
  padding: 34px 12px;
  border: 1px dashed #dfc7a7;
  border-radius: 10px;
  color: #667085;
  text-align: center;
}

#settingsModal .queue-rule-fields {
  display: grid;
  align-content: start;
  gap: 22px;
}

#settingsModal .queue-interval-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

#settingsModal .queue-interval-pills button {
  min-height: 36px;
  border: 1px solid #dfc7a7;
  border-radius: 999px;
  background: #fffdfa;
  color: #a15c00;
  padding: 0 10px;
  font-weight: 900;
}

#settingsModal .queue-interval-pills button.active {
  border-color: #11100e;
  background: #11100e;
  color: #f5ce78;
}

#settingsModal .queue-checks {
  display: grid;
  gap: 14px;
}

#settingsModal .queue-checks label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #111827;
  font-size: 15px;
}

#settingsModal .queue-checks input {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: #07946a;
}

#settingsModal .queue-rule-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 10px;
}

#settingsModal .queue-rule-actions button,
#settingsModal .queue-list-actions button {
  min-height: 44px;
  border: 1px solid #dfc7a7;
  border-radius: 9px;
  background: #fffdfa;
  color: #111827;
  font-weight: 900;
}

#settingsModal .queue-rule-actions button.primary {
  border-color: #11100e;
  background: #11100e;
  color: #f5ce78;
}

#settingsModal .queue-list-panel {
  min-height: 680px;
  padding: 28px;
}

#settingsModal .queue-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

#settingsModal .queue-list-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#settingsModal .queue-inline-table-head,
#settingsModal .queue-inline-item {
  display: grid;
  grid-template-columns: 58px minmax(220px, 1fr) minmax(76px, .38fr) minmax(58px, .28fr) minmax(72px, .34fr) minmax(148px, .58fr);
  align-items: center;
  gap: 0;
}

#settingsModal .queue-inline-table-head {
  height: 48px;
  padding: 0 20px;
  border: 1px solid #dfc7a7;
  border-radius: 9px;
  background: #f7f1e8;
  color: #667085;
  font-size: 13px;
  font-weight: 900;
}

#settingsModal .queue-inline-list {
  position: relative;
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

#settingsModal .queue-inline-list::before {
  content: "";
  position: absolute;
  left: 96px;
  top: 36px;
  bottom: 36px;
  width: 1px;
  background: #d9b678;
}

#settingsModal .queue-inline-item {
  position: relative;
  min-height: 82px;
  padding: 0 20px;
  border: 1px solid #dfc7a7;
  border-radius: 12px;
  background: rgba(255, 252, 247, 0.92);
}

#settingsModal .queue-inline-item.active {
  border-color: #d17a00;
  box-shadow: inset 0 0 0 1px #d17a00;
}

#settingsModal .queue-inline-item.dragging {
  opacity: 0.55;
}

#settingsModal .queue-drag-handle {
  width: 48px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid #dfc7a7;
  border-radius: 8px;
  background: #fff;
  color: #596579;
  cursor: grab;
  font-weight: 900;
  line-height: 1.1;
}

#settingsModal .queue-time-cell {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

#settingsModal .queue-order-dot {
  width: 40px;
  height: 40px;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 1px solid #d17a00;
  border-radius: 999px;
  background: #fff5df;
  color: #bd6b00;
  font-weight: 950;
}

#settingsModal .queue-inline-item.active .queue-order-dot {
  border-color: #11100e;
  background: #11100e;
  color: #f5ce78;
}

#settingsModal .queue-time-cell strong,
#settingsModal .queue-article-cell strong {
  display: block;
  overflow: hidden;
  color: #111827;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#settingsModal .queue-time-cell strong {
  font-size: 16px;
}

#settingsModal .queue-time-cell small,
#settingsModal .queue-article-cell small {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: #667085;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#settingsModal .queue-article-cell {
  min-width: 0;
}

#settingsModal .queue-article-cell strong {
  font-size: 16px;
}

#settingsModal .queue-topic-pill,
#settingsModal .queue-status-pill {
  min-width: 70px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

#settingsModal .queue-topic-pill {
  background: #e5f7f1;
  color: #00805d;
}

#settingsModal .queue-status-pill {
  background: #fff3d9;
  color: #c27000;
}

#settingsModal .queue-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  min-width: 0;
  flex-wrap: wrap;
}

#settingsModal .queue-row-actions button {
  min-height: 32px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #075cd8;
  font-weight: 900;
}

#settingsModal .queue-row-actions button[data-queue-time] {
  color: #a15c00;
}

#settingsModal .queue-row-actions button[data-queue-delete] {
  color: #b42318;
}

#settingsModal .queue-inline-empty {
  padding: 42px 14px;
  border: 1px dashed #dfc7a7;
  border-radius: 10px;
  background: #fffaf0;
  color: #667085;
  text-align: center;
}

#settingsModal .queue-inline-footnote {
  margin-top: 82px;
  border: 1px solid #e4b262;
  border-radius: 8px;
  background: #fff7e8;
  color: #b56700;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 760px) {
  #settingsModal .creator-settings-tabs,
  #settingsModal .creator-settings-card,
  #settingsModal .wechat-settings-head,
  #settingsModal .wechat-ip-box,
  #settingsModal .ad-template-settings,
  #settingsModal .ad-template-form-head,
  #settingsModal .queue-settings-inline,
  #settingsModal .queue-list-head {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  #settingsModal .creator-settings-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #settingsModal .creator-settings-card,
  #settingsModal .ad-template-settings,
  #settingsModal .queue-settings-inline {
    grid-template-columns: 1fr;
  }

  #settingsModal .queue-rules-panel,
  #settingsModal .queue-bulk-panel,
  #settingsModal .queue-list-panel {
    min-height: 0;
  }

  #settingsModal .queue-bulk-panel {
    padding: 18px;
  }

  #settingsModal .queue-inline-table-head {
    display: none;
  }

  #settingsModal .queue-inline-item {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px;
  }

  #settingsModal .queue-inline-list::before {
    display: none;
  }
}

/* Mobile browser adaptation for the full management system. */
@media (max-width: 760px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    width: 100%;
    overflow-x: hidden;
  }

  body,
  button,
  input,
  select,
  textarea {
    font-size: 15px;
  }

  button,
  input,
  select,
  textarea {
    min-height: 44px;
  }

  img,
  video,
  canvas {
    max-width: 100%;
  }

  .shell,
  #appShell.shell {
    width: 100%;
    padding: 12px;
    overflow-x: hidden;
    background:
      radial-gradient(circle at 12% 0%, rgba(192, 138, 61, 0.10), transparent 30%),
      linear-gradient(180deg, #fbfaf7 0%, #f6f4ef 100%);
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 28;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: -12px -12px 12px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
    border-bottom: 1px solid rgba(217, 210, 199, 0.82);
    background: rgba(255, 253, 250, 0.94);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 24px rgba(30, 25, 18, 0.08);
  }

  .topbar h1 {
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    color: var(--ink-text, #151411);
    font-size: 19px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar p {
    display: none;
  }

  .topbar-actions {
    min-width: 0;
    justify-content: flex-end;
    gap: 6px;
  }

  .return-button,
  .account-trigger,
  .corner-tool-button,
  .icon-button {
    min-width: 44px;
    min-height: 44px;
  }

  .return-button {
    width: auto;
    padding: 0 12px;
  }

  .account-trigger {
    max-width: 46vw;
    padding-right: 30px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .account-menu {
    position: fixed;
    top: calc(56px + env(safe-area-inset-top, 0px));
    right: 12px;
    left: auto;
    width: min(220px, calc(100vw - 24px));
  }

  .corner-tools {
    left: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  body.module-home-active .app-version {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .module-home.active {
    min-height: auto;
    place-items: stretch;
    padding: 0 0 18px;
  }

  .module-launcher,
  .module-system-grid,
  .module-system-grid.knowledge-priority,
  .module-action-grid,
  .module-tool-grid,
  .knowledge-shortcuts,
  .knowledge-feature-row {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .module-system-panel,
  .panel {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(30, 25, 18, 0.08);
  }

  .module-system-head {
    align-items: flex-start;
    gap: 10px;
  }

  .module-system-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    font-size: 20px;
  }

  .module-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .creator-menu-item,
  .knowledge-shortcut {
    min-height: 72px;
    grid-template-columns: 42px minmax(0, 1fr) 16px;
    gap: 10px;
    padding: 12px;
  }

  .creator-menu-item small,
  .knowledge-shortcut small {
    font-size: 12px;
    line-height: 1.45;
  }

  .knowledge-hero-card {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .knowledge-visual {
    display: none;
  }

  .knowledge-actions,
  .knowledge-primary-button,
  .knowledge-secondary-button {
    width: 100%;
  }

  .steps {
    position: sticky;
    top: calc(65px + env(safe-area-inset-top, 0px));
    z-index: 24;
    display: flex;
    gap: 8px;
    margin: 0 -12px 12px;
    padding: 8px 12px;
    overflow-x: auto;
    border-bottom: 1px solid rgba(217, 210, 199, 0.72);
    background: rgba(251, 250, 247, 0.96);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .steps::-webkit-scrollbar {
    display: none;
  }

  .step {
    flex: 0 0 auto;
    min-width: 78px;
    min-height: 46px;
    padding: 8px 10px;
    gap: 6px;
  }

  .step span {
    max-width: 58px;
    font-size: 13px;
  }

  .flow-page {
    min-height: auto;
  }

  .page-head,
  .toolbar,
  .flow-footer,
  .flow-footer-right,
  .active-workflow-head,
  .active-workflow-item,
  .run-card-head,
  .run-actions,
  .panel-title,
  .side-panel-head,
  .actions,
  .actions.slim,
  .queue-list-head,
  .management-section-head,
  .settings-actions {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .page-head {
    margin-top: 0;
  }

  .page-head h2 {
    font-size: 19px;
    line-height: 1.35;
  }

  .page-head p {
    font-size: 13px;
  }

  .grid,
  .compact-grid,
  .split-layout,
  .generation-layout,
  .result-workbench,
  .bottom-review,
  .live-preview,
  .settings-layout,
  .form-sections,
  .advanced-grid,
  .stats,
  .thumb-grid,
  .image-card-grid,
  .cards,
  .account-info,
  .membership-quota-grid,
  .management-kpi-grid,
  .topic-edit-prototype,
  .category-editor,
  .ad-template-settings,
  .queue-settings-inline,
  .payment-body,
  .contact-body {
    grid-template-columns: 1fr !important;
  }

  .form-section,
  .advanced-options,
  .autopilot-box,
  label,
  .check {
    min-width: 0;
  }

  label > span,
  .category-select-row span {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  input,
  select,
  textarea {
    width: 100%;
    max-width: 100%;
  }

  textarea {
    min-height: 120px;
  }

  .quota-dock {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .quota-dock div {
    min-width: 0;
  }

  .topic-list {
    max-height: none;
  }

  .topic-item {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .topic-item div {
    width: 100%;
  }

  .topic-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-height: 20px;
  }

  .topic-item .topic-actions,
  .topic-item > .actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .job-list,
  .compact-list,
  .model-options,
  .result-list,
  .preview-list {
    max-height: none;
    overflow: visible;
  }

  .progress-panel,
  .side-panel,
  .result-text,
  .result-media,
  .result-list {
    min-height: auto;
  }

  .timeline,
  .compact-timeline {
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .live-article,
  .wechat-article,
  .article-preview,
  .preview-content {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .live-article img,
  .wechat-article img,
  .article-preview img,
  .image-card img {
    height: auto;
    object-fit: contain;
  }

  .admin-table-wrap,
  .table-wrap,
  .management-table,
  .admin-users-table,
  .library-packages-table {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table.management-table,
  table.admin-users-table,
  .library-packages-table table {
    min-width: 720px;
  }

  .admin-user-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .quota-edit-cell {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .quota-edit-cell input {
    width: 100%;
  }

  #settingsModal #settingsTabUsers .admin-table-wrap {
    overflow-x: hidden;
    border: 0;
    background: transparent;
  }

  #settingsModal #settingsTabUsers .admin-users-table,
  #settingsModal #settingsTabUsers .admin-users-table tbody,
  #settingsModal #settingsTabUsers .admin-users-table tr,
  #settingsModal #settingsTabUsers .admin-users-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  #settingsModal #settingsTabUsers .admin-users-table {
    border-collapse: separate;
    border-spacing: 0;
  }

  #settingsModal #settingsTabUsers .admin-users-table thead {
    display: none;
  }

  #settingsModal #settingsTabUsers .admin-users-table tr {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid #e8dccb;
    border-radius: 10px;
    background: #fffdfa;
  }

  #settingsModal #settingsTabUsers .admin-users-table td {
    box-sizing: border-box;
    padding: 7px 0;
    border: 0;
  }

  #settingsModal #settingsTabUsers .admin-users-table td::before {
    display: block;
    margin-bottom: 4px;
    color: #667085;
    font-size: 12px;
    font-weight: 900;
  }
  #settingsModal #settingsTabUsers .admin-users-table td:nth-child(1)::before { content: "\7528\6237"; }
  #settingsModal #settingsTabUsers .admin-users-table td:nth-child(2)::before { content: "\72b6\6001"; }
  #settingsModal #settingsTabUsers .admin-users-table td:nth-child(3)::before { content: "\89d2\8272"; }
  #settingsModal #settingsTabUsers .admin-users-table td:nth-child(4)::before { content: "\4f1a\5458\7c7b\578b"; }
  #settingsModal #settingsTabUsers .admin-users-table td:nth-child(5)::before { content: "\514d\8d39\989d\5ea6"; }
  #settingsModal #settingsTabUsers .admin-users-table td:nth-child(6)::before { content: "\672c\6708\6d88\8017"; }
  #settingsModal #settingsTabUsers .admin-users-table td:nth-child(7)::before { content: "\5269\4f59"; }
  #settingsModal #settingsTabUsers .admin-users-table td:nth-child(8)::before { content: "\6bcf\6708\589e\52a0"; }
  #settingsModal #settingsTabUsers .admin-users-table td:nth-child(9)::before { content: "\64cd\4f5c"; }

  #settingsModal #settingsTabUsers .quota-edit-cell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #settingsModal #settingsTabUsers .quota-edit-cell label {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    color: #344054;
    font-size: 14px;
    font-weight: 900;
  }

  #settingsModal #settingsTabUsers .quota-edit-cell label span {
    writing-mode: horizontal-tb;
    white-space: nowrap;
  }

  #settingsModal #settingsTabUsers .quota-edit-cell input {
    width: 100%;
    min-height: 42px;
    margin: 0;
    font-size: 16px;
  }

  #settingsModal #settingsTabUsers .admin-row-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  #settingsModal #settingsTabUsers .admin-row-actions button {
    width: 100%;
    min-height: 40px;
  }

  .settings-modal,
  .summary-modal,
  .contact-modal,
  .legal-modal,
  .consent-prompt-modal,
  .library-edit-modal,
  .image-lightbox {
    z-index: 90;
  }

  .settings-dialog,
  #settingsModal .settings-dialog,
  .summary-dialog,
  .contact-dialog,
  .legal-dialog,
  .consent-prompt-dialog,
  .library-edit-dialog {
    inset: 8px !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: calc(100vh - 16px) !important;
    transform: none !important;
    border-radius: 10px;
  }

  .settings-dialog,
  #settingsModal .settings-dialog,
  .library-edit-dialog {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .settings-header,
  #settingsModal .settings-header,
  .library-edit-header {
    padding: 14px;
  }

  .settings-tabs,
  #settingsModal .settings-tabs,
  .legal-tabs,
  .library-details-tabs,
  .creator-settings-tabs {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 14px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .settings-tabs::-webkit-scrollbar,
  #settingsModal .settings-tabs::-webkit-scrollbar,
  .legal-tabs::-webkit-scrollbar,
  .library-details-tabs::-webkit-scrollbar,
  .creator-settings-tabs::-webkit-scrollbar {
    display: none;
  }

  .settings-tab,
  #settingsModal .settings-tab,
  .legal-tabs button,
  .library-details-tab,
  .creator-settings-tab {
    flex: 0 0 auto;
    min-width: 96px;
    min-height: 40px;
    white-space: nowrap;
  }

  .settings-body,
  #settingsModal .settings-body,
  .summary-body,
  .contact-body,
  .legal-body,
  .library-edit-body {
    min-height: 0;
    overflow: auto;
    padding: 14px;
    -webkit-overflow-scrolling: touch;
  }

  .summary-dialog footer,
  .contact-dialog footer,
  .legal-dialog footer,
  .library-edit-footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .summary-dialog {
    top: auto !important;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    border-radius: 22px 22px 10px 10px !important;
    overflow: hidden;
  }

  .summary-dialog header {
    padding: 24px 18px 12px;
    gap: 12px;
  }

  .summary-head-main {
    gap: 16px;
  }

  .summary-success-icon {
    width: 58px;
    height: 58px;
  }

  .summary-success-icon::after {
    left: 19px;
    top: 12px;
    width: 14px;
    height: 29px;
  }

  .summary-dialog h2 {
    font-size: 26px;
  }

  .summary-dialog header p {
    font-size: 15px;
  }

  .summary-body {
    gap: 22px;
  }

  .summary-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border: 1px solid #d8e2ee;
    border-radius: 8px;
    background: #f8fbff;
  }

  .summary-stat {
    min-height: 74px;
    padding: 10px 6px;
    border: 0;
    border-right: 1px solid #d8e2ee;
    border-radius: 0;
    background: transparent;
    text-align: center;
  }

  .summary-stat:last-child {
    border-right: 0;
  }

  .summary-stat strong {
    font-size: 20px;
  }

  .summary-save-status {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 16px;
  }

  .summary-results h3 {
    font-size: 20px;
  }

  .summary-result-row {
    grid-template-columns: 34px minmax(0, 1fr) auto 18px;
    gap: 10px;
    min-height: 72px;
    padding: 12px 12px;
  }

  .summary-result-title strong {
    font-size: 15px;
  }

  .summary-result-title small {
    display: none;
  }

  .summary-result-status {
    padding: 6px 10px;
    font-size: 12px;
  }

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

  .summary-dialog footer button {
    width: 100%;
  }

  #settingsModal .management-section-head,
  #settingsModal #settingsTabUsers > .management-section-head {
    position: static;
    align-items: stretch;
    flex-wrap: wrap;
    padding-right: 0;
  }

  #settingsModal .admin-order-filterbar {
    width: 100%;
  }

  #settingsModal #settingsTabOrders .management-section-head > button {
    width: 100%;
  }

  #settingsModal .admin-user-toolbar {
    min-height: auto;
    padding-right: 0;
    flex-wrap: wrap;
  }

  #settingsModal .admin-user-toolbar label {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  #settingsModal .category-editor,
  #settingsModal .ad-template-settings,
  #settingsModal .queue-settings-inline {
    grid-template-columns: 1fr !important;
  }

  #settingsModal .category-tabs {
    display: flex;
    overflow-x: auto;
    gap: 8px;
  }

  #settingsModal .category-tab {
    flex: 0 0 180px;
  }

  #settingsModal .creator-settings-card {
    min-height: auto;
    padding: 18px;
  }

  #settingsModal .wechat-settings-head-actions,
  #settingsModal .queue-rule-actions,
  #settingsModal .queue-list-actions,
  #settingsModal .payment-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  #settingsModal .queue-rules-panel,
  #settingsModal .queue-list-panel {
    min-height: auto;
    padding: 16px;
  }

  #settingsModal .queue-inline-table-head {
    display: none;
  }

  #settingsModal .queue-inline-item {
    grid-template-columns: 1fr !important;
    gap: 12px;
    min-height: auto;
    padding: 14px;
  }

  #settingsModal .queue-inline-list::before {
    display: none;
  }

  #settingsModal .queue-time-cell {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  #settingsModal .queue-row-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    white-space: normal;
  }

  .contact-dialog.payment-dialog {
    width: auto;
  }

  .payment-qr-panel,
  .payment-summary-panel {
    padding: 0;
  }

  .payment-qr-frame {
    width: min(260px, 72vw);
    height: min(260px, 72vw);
    margin: 0 auto;
  }

  .lightbox-stage {
    inset: 10px;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
  }

  .lightbox-close {
    top: 8px;
    right: 8px;
  }

  .lightbox-nav {
    width: 42px;
    height: 42px;
  }

  .auth-screen.auth-landing {
    min-height: 100vh;
    grid-template-rows: auto auto;
    padding: 16px 14px calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    overflow: auto !important;
    border: 0;
  }

  .auth-landing .landing-brand-img {
    width: min(190px, 58vw) !important;
  }

  .auth-landing .landing-shell {
    width: 100% !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .auth-landing .landing-hero {
    display: none;
  }

  .auth-landing .landing-login {
    width: 100% !important;
    padding: 18px !important;
  }

  .auth-landing .field-with-icon.code-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    height: auto !important;
  }

  .auth-landing .field-with-icon.code-field button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .shell,
  #appShell.shell {
    padding: 10px;
  }

  .topbar {
    margin-inline: -10px;
    padding-inline: 10px;
  }

  .steps {
    margin-inline: -10px;
    padding-inline: 10px;
  }

  .panel,
  .module-system-panel {
    padding: 12px;
  }

  .creator-menu-item,
  .knowledge-shortcut {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .creator-menu-item i,
  .knowledge-shortcut i {
    display: none;
  }

  .topic-item .topic-actions,
  .topic-item > .actions,
  #settingsModal .queue-row-actions {
    grid-template-columns: 1fr;
  }

  .account-trigger {
    max-width: 40vw;
    padding-left: 10px;
  }
}

@media (max-width: 980px) {
  .auth-screen.auth-landing {
    width: 100vw !important;
    min-width: 0 !important;
    min-height: 100vh !important;
    height: auto !important;
    display: block !important;
    padding: 14px 14px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .auth-landing .landing-brand {
    display: none !important;
  }

  .auth-landing .landing-brand-img {
    display: none !important;
  }

  .auth-landing .landing-shell {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: block !important;
  }

  .auth-landing .landing-hero,
  .auth-landing .landing-categories {
    display: none !important;
  }

  .auth-landing .landing-login {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: clamp(28px, 10vh, 86px) 0 0 !important;
    padding: 18px !important;
    transform: none !important;
  }

  .auth-landing .unified-phone-form,
  .auth-landing .landing-admin-login .auth-form {
    width: 100% !important;
    min-width: 0 !important;
  }

  .auth-landing .field-with-icon {
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 54px !important;
  }

  .auth-landing .field-with-icon input {
    width: 100% !important;
    min-width: 0 !important;
  }

  .auth-landing .code-field {
    display: grid !important;
    grid-template-columns: 40px minmax(0, 1fr) !important;
    gap: 0 !important;
  }

  .auth-landing .code-field button {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    margin-top: 10px !important;
  }

  .auth-landing .landing-login .primary {
    width: 100% !important;
    min-width: 0 !important;
  }
}

@media (max-width: 980px) {
  .auth-screen.auth-landing {
    background: var(--login-paper, #fffdf9) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .auth-landing .auth-bg,
  .auth-landing .landing-brand,
  .auth-landing .landing-brand-img,
  .auth-landing .landing-hero,
  .auth-landing .landing-categories,
  .auth-landing .auth-icp {
    display: none !important;
  }

  .auth-landing .landing-shell {
    width: 100% !important;
    max-width: 420px !important;
  }

  .auth-landing .landing-login {
    margin: 0 !important;
    width: 100% !important;
  }
}

@media (max-width: 760px) {
  .auth-screen.auth-landing {
    min-height: 100svh !important;
    align-items: flex-start !important;
    padding: calc(34px + env(safe-area-inset-top, 0px)) 16px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-y: auto !important;
  }

  .auth-landing .landing-shell {
    display: block !important;
    max-width: 410px !important;
    padding: 0 !important;
  }

  .auth-landing .landing-login {
    padding: 20px 18px !important;
  }

  .auth-landing .landing-login .auth-panel-head {
    margin-bottom: 16px;
  }

  .auth-landing .landing-login .auth-panel-head h2 {
    font-size: 23px !important;
    line-height: 1.25;
  }

  .auth-landing .landing-login .auth-panel-head p {
    font-size: 13px !important;
    line-height: 1.55;
  }

  body.module-home-active {
    min-height: 100svh;
    overflow-y: auto !important;
  }

  body.module-home-active #appShell.shell {
    height: auto !important;
    min-height: 100svh !important;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    overflow: visible !important;
  }

  body.module-home-active .topbar {
    min-height: 44px !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
  }

  body.module-home-active .module-home.active {
    display: block !important;
    padding: 0 !important;
  }

  body.module-home-active .module-launcher {
    display: block !important;
    width: 100% !important;
    max-height: none !important;
  }

  body.module-home-active .module-system-grid.knowledge-priority {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    max-height: none !important;
  }

  body.module-home-active .module-system-panel {
    padding: 14px !important;
  }

  body.module-home-active .creator-system {
    padding: 14px !important;
  }

  body.module-home-active .module-system-head,
  body.module-home-active .knowledge-head {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
  }

  body.module-home-active .module-system-mark,
  body.module-home-active .knowledge-head .module-system-mark {
    width: 42px !important;
    height: 42px !important;
    font-size: 20px !important;
  }

  body.module-home-active .module-title-row {
    min-width: 0;
    display: block !important;
  }

  body.module-home-active .module-system-head h2,
  body.module-home-active .knowledge-head h2 {
    font-size: 21px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
  }

  body.module-home-active .module-system-head p,
  body.module-home-active .knowledge-head p {
    margin-top: 3px !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }

  body.module-home-active .creator-priority-label {
    margin: 10px 0 8px !important;
    font-size: 12px !important;
  }

  body.module-home-active .creator-priority-label.secondary-label {
    margin-top: 12px !important;
  }

  body.module-home-active .creator-menu-primary,
  body.module-home-active .creator-menu-secondary {
    gap: 8px !important;
  }

  body.module-home-active .creator-menu-primary {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.module-home-active .creator-menu-secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.module-home-active .creator-menu-item,
  body.module-home-active .creator-menu-item.primary-action,
  body.module-home-active .creator-menu-item.secondary-action {
    grid-template-columns: 1fr !important;
    justify-items: center !important;
    text-align: center !important;
    padding: 10px 12px !important;
  }

  body.module-home-active .creator-menu-item.primary-action {
    min-height: 76px !important;
  }

  body.module-home-active .creator-menu-item.secondary-action {
    min-height: 64px !important;
    padding: 8px 6px !important;
  }

  body.module-home-active .creator-menu-item .module-action-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 17px !important;
  }

  body.module-home-active .creator-menu-item i {
    display: none !important;
  }

  body.module-home-active .creator-menu-item strong {
    font-size: 15px !important;
    line-height: 1.25 !important;
  }

  body.module-home-active .creator-menu-item small {
    display: none !important;
  }

  body.module-home-active .creator-menu-item.secondary-action strong {
    font-size: 13px !important;
    line-height: 1.25 !important;
  }

  body.module-home-active .knowledge-system {
    padding: 14px !important;
  }

  body.module-home-active .knowledge-hero-card {
    min-height: auto !important;
    display: block !important;
    padding: 16px !important;
  }

  body.module-home-active .knowledge-hero-copy,
  body.module-home-active .knowledge-hero-copy .knowledge-value-copy {
    min-width: 0 !important;
    max-width: none !important;
  }

  body.module-home-active .knowledge-hero-copy .knowledge-value-copy {
    font-size: 14px !important;
    line-height: 1.65 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }

  body.module-home-active .knowledge-actions {
    margin-top: 14px !important;
  }

  body.module-home-active .knowledge-primary-button {
    width: 100% !important;
    min-width: 0 !important;
    height: 48px !important;
    font-size: 16px !important;
  }

  body.module-home-active .knowledge-value-strip {
    min-height: auto !important;
    margin-top: 10px !important;
    padding: 10px 12px !important;
    display: block !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }

  body.module-home-active .app-icp {
    display: none !important;
  }
}

@media (max-width: 380px) {
  .auth-screen.auth-landing {
    padding-top: calc(22px + env(safe-area-inset-top, 0px)) !important;
  }

  .auth-landing .landing-login {
    padding: 18px 14px !important;
  }

  body.module-home-active .module-system-panel,
  body.module-home-active .creator-system,
  body.module-home-active .knowledge-system {
    padding: 12px !important;
  }
}

.admin-activity-panel {
  display: grid;
  gap: 14px;
}

.activity-filterbar {
  display: grid;
  grid-template-columns: 150px 190px minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.activity-filterbar label {
  margin: 0;
}

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

.activity-kpis div,
.activity-analysis-grid section,
.activity-user-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.activity-kpis div {
  padding: 12px;
}

.activity-kpis strong {
  display: block;
  color: #121417;
  font-size: 24px;
  line-height: 1;
}

.activity-kpis span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.activity-analysis-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr .8fr;
  gap: 12px;
}

.activity-analysis-grid section {
  min-width: 0;
  padding: 14px;
}

.activity-analysis-grid h3 {
  margin: 0 0 10px;
  color: #23201b;
  font-size: 15px;
}

.activity-bars,
.activity-user-list {
  display: grid;
  gap: 8px;
}

.activity-bar-row {
  display: grid;
  grid-template-columns: minmax(88px, .8fr) minmax(90px, 1fr) 40px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.activity-bar-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-bar-row b {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #b98534, #047857);
}

.activity-bar-row em {
  color: #23201b;
  font-style: normal;
  font-weight: 850;
  text-align: right;
}

.activity-user-row {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.activity-user-row strong {
  color: #23201b;
  font-size: 13px;
}

.activity-user-row span {
  color: var(--muted);
  font-size: 12px;
}

.activity-type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff7e9;
  color: #8d6427;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.admin-activity-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.admin-activity-table .management-table {
  min-width: 980px;
}

@media (max-width: 760px) {
  .queue-quota-hint {
    align-items: stretch;
    flex-direction: column;
  }

  .quota-upgrade-button {
    width: 100%;
  }

  .floating-workflow-queue {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: 48px;
    min-height: 48px;
    padding: 0;
  }

  .floating-workflow-queue.expanded {
    width: min(320px, calc(100vw - 24px));
    min-height: 54px;
    padding: 10px 12px;
  }

  .floating-workflow-queue strong,
  .floating-workflow-queue small {
    white-space: nowrap;
    word-break: normal;
  }

  .activity-filterbar,
  .activity-analysis-grid {
    grid-template-columns: 1fr;
  }

  .activity-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-bar-row {
    grid-template-columns: minmax(72px, .75fr) minmax(90px, 1fr) 34px;
  }
}

@media (max-width: 980px) {
  .auth-landing .landing-admin-login {
    display: block !important;
    margin-top: 10px !important;
  }

  .auth-landing .landing-admin-login summary {
    display: block !important;
    cursor: pointer;
    color: #8a8073 !important;
    font-size: 12px !important;
    line-height: 1.4;
    text-align: center;
  }

  .auth-landing .landing-admin-login .auth-form {
    display: grid !important;
    gap: 10px !important;
    margin-top: 10px !important;
  }

  .auth-landing .landing-admin-login:not([open]) .auth-form {
    display: none !important;
  }
}

@media (max-width: 760px) {
  .auth-screen.auth-landing {
    padding-top: calc(22px + env(safe-area-inset-top, 0px)) !important;
  }
}

@media (max-width: 760px) {
  #workflow .steps {
    max-width: calc(100vw - 24px);
    margin-inline: 0;
    padding-inline: 0 4px;
  }

  #workflow .step {
    flex-basis: 78px;
    max-width: 84px;
  }

  #workflow .autopilot-box {
    grid-template-columns: 1fr !important;
    align-items: stretch;
  }

  #workflow .autopilot-box label,
  #workflow .autopilot-box input {
    width: 100%;
    max-width: 100%;
  }

  #workflow .autopilot-box p {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .library-edit-dialog {
    inset: 0 !important;
    width: 100vw !important;
    height: 100svh !important;
    max-height: none !important;
    border-radius: 0 !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
  }

  .library-edit-header {
    align-items: flex-start;
    gap: 10px;
  }

  .library-edit-header h2 {
    font-size: 18px;
    line-height: 1.25;
  }

  .library-edit-form .grid.double-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .library-details-section {
    min-height: 0;
    padding-top: 14px;
  }

  .library-details-content {
    min-height: 0;
  }

  .details-table,
  .details-table thead,
  .details-table tbody,
  .details-table tr,
  .details-table th,
  .details-table td {
    display: block;
  }

  .details-table {
    border-collapse: separate;
    border-spacing: 0;
  }

  .details-table thead {
    display: none;
  }

  .details-table tbody {
    display: grid;
    gap: 10px;
  }

  .details-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdfa;
    padding: 10px;
  }

  .details-table td {
    border: 0;
    padding: 8px 0;
    font-size: 13px;
    line-height: 1.45;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .details-table td + td {
    border-top: 1px solid rgba(220, 225, 232, .72);
  }

  .details-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
  }

  .article-name-cell {
    max-width: none;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .inline-danger-btn {
    width: 100%;
    min-height: 36px;
  }

  .library-edit-footer {
    position: sticky;
    bottom: 0;
  }
}

@media (max-width: 980px) {
  .auth-screen.auth-landing {
    align-items: flex-start !important;
    padding-top: calc(58px + env(safe-area-inset-top, 0px)) !important;
  }

  .auth-landing .landing-shell {
    display: block !important;
    max-width: 420px !important;
  }

  .auth-landing .login-brand-title {
    display: block !important;
    margin: 0 0 18px !important;
    color: #151719;
    text-align: center;
    font-size: 30px;
    line-height: 1.15;
    font-weight: 950;
    letter-spacing: 0;
  }

  .auth-landing .landing-login {
    margin-top: 0 !important;
  }
}

@media (max-width: 760px) {
  .auth-screen.auth-landing {
    padding-top: calc(72px + env(safe-area-inset-top, 0px)) !important;
  }

  .auth-landing .login-brand-title {
    margin-bottom: 20px !important;
    font-size: 31px;
  }

  .auth-landing .landing-login {
    padding: 22px 18px 24px !important;
  }

  .auth-landing .landing-consent {
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    letter-spacing: 0;
  }

  .auth-landing .landing-consent input {
    width: 14px;
    height: 14px;
  }

  .auth-landing .landing-consent span {
    gap: 2px;
  }
}

@media (max-width: 360px) {
  .auth-landing .landing-consent {
    font-size: 11px;
  }
}

@media (max-width: 980px) {
  .auth-screen.auth-landing {
    background:
      linear-gradient(180deg, rgba(255, 253, 248, .98) 0%, rgba(250, 246, 238, .96) 100%) !important;
    padding-top: calc(42px + env(safe-area-inset-top, 0px)) !important;
  }

  .auth-landing .landing-shell {
    max-width: 430px !important;
  }

  .auth-landing .login-brand-title {
    display: grid !important;
    justify-items: center;
    gap: 7px;
    margin: 0 0 18px !important;
    text-align: center;
  }

  .auth-landing .login-brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(176, 123, 45, .38);
    border-radius: 999px;
    background: linear-gradient(180deg, #fff8e7 0%, #f5deb0 100%);
    color: #8a5a18;
    font-size: 17px;
    font-weight: 950;
    box-shadow: 0 10px 24px rgba(177, 125, 50, .18);
  }

  .auth-landing .login-brand-title h1 {
    margin: 0;
    color: #151719;
    font-size: 31px;
    line-height: 1.08;
    font-weight: 950;
    letter-spacing: 0;
  }

  .auth-landing .login-brand-title p {
    margin: 0;
    color: #73706a;
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: 0;
  }

  .auth-landing .login-brand-tags {
    display: flex;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
    margin-top: 3px;
  }

  .auth-landing .login-brand-tags span {
    flex: 0 1 auto;
    min-width: 0;
    padding: 5px 8px;
    border: 1px solid rgba(211, 190, 157, .74);
    border-radius: 999px;
    background: rgba(255, 255, 255, .58);
    color: #807468;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
  }

  .auth-landing .landing-login {
    border-color: rgba(224, 213, 198, .95) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, .82) !important;
    box-shadow: 0 18px 48px rgba(44, 35, 22, .11) !important;
  }

  .auth-landing .landing-login .auth-panel-head h2 {
    font-size: 27px !important;
    line-height: 1.2;
  }

  .auth-landing .landing-login .auth-panel-head p {
    margin-top: 8px !important;
    color: #817b72 !important;
    font-size: 13px !important;
  }

  .auth-landing .unified-phone-form {
    gap: 18px !important;
    margin-top: 24px !important;
  }

  .auth-landing .field-with-icon {
    min-height: 60px !important;
    border-color: rgba(224, 213, 198, .95) !important;
    border-radius: 10px !important;
    background: rgba(255, 254, 251, .92) !important;
  }

  .auth-landing .field-with-icon:focus-within {
    border-color: rgba(171, 112, 27, .62) !important;
    box-shadow: 0 0 0 3px rgba(171, 112, 27, .08) !important;
  }

  .auth-landing .code-field button {
    height: 42px !important;
    border-color: rgba(191, 137, 56, .72) !important;
    background: rgba(255, 251, 244, .95) !important;
    font-size: 14px !important;
  }

  .auth-landing .landing-login .primary {
    height: 62px !important;
    margin-top: 6px !important;
    box-shadow: 0 12px 26px rgba(18, 19, 20, .18) !important;
  }

  .auth-landing .landing-consent {
    margin-top: 17px !important;
    color: #77716a !important;
  }
}

@media (max-width: 760px) {
  .auth-screen.auth-landing {
    padding-top: calc(40px + env(safe-area-inset-top, 0px)) !important;
  }

  .auth-landing .login-brand-title {
    margin-bottom: 16px !important;
  }

  .auth-landing .login-brand-mark {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }

  .auth-landing .login-brand-title h1 {
    font-size: 30px;
  }

  .auth-landing .landing-login {
    padding: 22px 18px 23px !important;
  }
}

@media (max-width: 380px) {
  .auth-landing .login-brand-tags {
    gap: 5px;
  }

  .auth-landing .login-brand-tags span {
    padding-inline: 6px;
    font-size: 10px;
  }
}

@media (max-width: 760px) {
  #flowPage4 .generation-layout {
    gap: 12px !important;
  }

  #flowPage4 .side-panel {
    padding: 12px !important;
  }

  #flowPage4 .side-panel-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 10px;
  }

  #flowPage4 .side-panel-head h3 {
    font-size: 18px;
    line-height: 1.25;
  }

  #flowPage4 .side-panel-head button {
    width: auto !important;
    min-width: 92px;
    min-height: 34px;
    padding: 0 12px !important;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
  }

  #flowPage4 .side-panel-head button.hidden {
    display: none !important;
  }

  #flowPage4 #workflowStats.stats {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-bottom: 10px;
  }

  #flowPage4 #workflowStats.stats div {
    min-height: 58px;
    display: grid;
    place-items: center;
    align-content: center;
    padding: 7px 8px;
    border-radius: 8px;
  }

  #flowPage4 #workflowStats.stats strong {
    font-size: 18px;
    line-height: 1.1;
  }

  #flowPage4 #workflowStats.stats span {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.2;
  }

  #flowPage4 #workflowStats.stats div:first-child {
    border-color: rgba(185, 133, 52, .38);
    background: #fffdfa;
  }

  #flowPage4 .job-list {
    max-height: none;
  }
}

@media (max-width: 360px) {
  #flowPage4 #workflowStats.stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

#flowPage4 .generation-layout {
  grid-template-columns: 1fr;
}

#flowPage4 .side-panel {
  overflow: hidden;
}

#flowPage4 .job-list {
  gap: 0;
  overflow: visible;
  max-height: none;
}

@media (max-width: 760px) {
  body.workflow-active .topbar {
    display: none !important;
  }

  #workflow {
    padding-bottom: 128px;
  }

  #workflow .workflow-mobile-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: -2px -14px 0;
    padding: 18px 20px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, .94);
  }

  #workflow .workflow-mobile-title h1 {
    margin: 0;
    color: #111827;
    font-size: 24px;
    line-height: 1.15;
    font-weight: 950;
  }

  #workflow .workflow-mobile-title button {
    min-width: 60px;
    min-height: 38px;
    border-color: rgba(185, 117, 18, .72);
    border-radius: 8px;
    background: #fffdfa;
    color: #a05f05;
    font-size: 15px;
    font-weight: 900;
  }

  #workflow .workflow-steps-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center;
    gap: 20px;
    margin: 0 -14px;
    padding: 20px 18px 18px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, .88);
    overflow: hidden;
  }

  #workflow #flowSteps.steps {
    display: grid !important;
    grid-template-columns: auto minmax(18px, 1fr) auto minmax(18px, 1fr) auto minmax(18px, 1fr) auto !important;
    align-items: start;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border-bottom: 0;
    background: transparent;
    overflow: visible;
  }

  #workflow #flowSteps.steps::before,
  #workflow #flowSteps.steps::after {
    content: none;
  }

  #workflow #flowSteps .step {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 7px;
    min-width: 0;
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #667085;
  }

  #workflow #flowSteps .step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: calc(100% + 8px);
    top: 16px;
    width: calc((100vw - 192px) / 3);
    height: 2px;
    background: #d0d5dd;
  }

  #workflow #flowSteps .step[data-step="4"]::after {
    content: none;
  }

  #workflow #flowSteps .preview-step {
    display: none;
  }

  #workflow .workflow-step-actions {
    display: flex;
    min-width: 78px;
  }

  #workflow .workflow-step-actions button {
    min-width: 70px !important;
    min-height: 38px !important;
    padding: 0 14px !important;
    border-radius: 8px;
    font-size: 16px;
  }

  #workflow .workflow-step-actions button.hidden {
    display: none !important;
  }

  #workflow #flowSteps .step strong {
    width: 34px;
    height: 34px;
    border: 1px solid #cfd6e2;
    background: #f8fafc;
    color: #111827;
    font-size: 16px;
  }

  #workflow #flowSteps .step span {
    color: #667085;
    font-size: 14px;
    font-weight: 800;
  }

  #workflow #flowSteps .step.active strong {
    border-color: #b87512;
    background: #202124;
    color: #fff;
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px #c47a0a;
  }

  #workflow #flowSteps .step.active span {
    color: #111827;
  }

  #flowPage1 {
    margin: 0 -14px;
    min-height: auto;
  }

  #flowPage1 .step-page-head {
    display: none !important;
  }

  #flowPage2 > .page-head,
  #flowPage3 > .page-head {
    display: none !important;
  }

  #flowPage1 .step1-panel {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  #flowPage1 .form-sections {
    gap: 0;
  }

  #flowPage1 .step1-section {
    padding: 18px 20px 22px;
    border-bottom: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, .9);
  }

  #flowPage1 .step1-section h3 {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    color: #111827 !important;
    font-size: 19px;
    line-height: 1.2;
    font-weight: 950;
  }

  #flowPage1 .step1-section h3::before {
    content: "";
    width: 4px;
    height: 21px;
    border-radius: 999px;
    background: #c47a0a;
  }

  #flowPage1 .step1-content-grid,
  #flowPage1 .step1-param-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  #flowPage1 .step1-param-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #flowPage1 .step1-param-grid label:nth-child(3) {
    grid-column: 1 / 2;
  }

  #flowPage1 label {
    display: grid;
    gap: 8px;
    color: #667085 !important;
    font-size: 15px;
    font-weight: 800;
  }

  #flowPage1 input,
  #flowPage1 select {
    min-height: 48px;
    padding: 0 14px;
    border-color: #d8dee8 !important;
    border-radius: 8px;
    background: #fff !important;
    color: #111827;
    font-size: 16px;
  }

  #flowPage1 .category-select-row span {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #flowPage1 #quickAddCategory {
    justify-self: start;
    min-height: 30px;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    color: #b66a00 !important;
    font-size: 16px;
    font-weight: 900;
    box-shadow: none !important;
  }

  #flowPage1 #quickAddCategory::before {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 21px;
    height: 21px;
    margin-right: 8px;
    border: 2px solid currentColor;
    border-radius: 999px;
    font-size: 15px;
    line-height: 1;
  }

  #flowPage1 #autopilotSection {
    padding: 20px;
  }

  #flowPage1 .advanced-options {
    margin: 0;
    border-bottom: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, .9);
  }

  #flowPage1 .advanced-options summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
    padding: 0 20px;
    color: #111827 !important;
    font-size: 18px;
    font-weight: 950;
    list-style: none;
  }

  #flowPage1 .advanced-options summary::-webkit-details-marker {
    display: none;
  }

  #flowPage1 .advanced-options summary::before {
    content: "⚙";
    margin-right: 12px;
    color: #111827;
    font-size: 24px;
  }

  #flowPage1 .advanced-options summary::after {
    content: "›";
    margin-left: auto;
    color: #667085;
    font-size: 34px;
    line-height: 1;
  }

  #flowPage1 .advanced-options[open] summary::after {
    transform: rotate(90deg);
  }

  #flowPage1 .advanced-grid,
  #flowPage1 .advanced-options .check {
    padding: 0 20px 18px;
  }

  #flowPage1 .flow-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(34px + env(safe-area-inset-bottom, 0px));
    z-index: 80;
    box-sizing: border-box;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -10px 30px rgba(15, 23, 42, .08);
  }

  #flowPage1 .flow-footer #step1Summary,
  #flowPage1 .flow-footer #quotaDock {
    display: none;
  }

  #flowPage1 .flow-footer-right {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
  }

  #flowPage1 .flow-footer-right button {
    width: 100%;
    min-height: 50px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 900;
  }

  #flowPage1 #step1Prev {
    border-color: #d8dee8;
    background: #fff;
    color: #98a2b3;
  }

  #flowPage1 #step1Next {
    color: #fff !important;
  }

  #flowPage4 {
    padding-bottom: 24px;
  }

  #flowPage4 .workflow-generate-head {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 18px;
  }

  #flowPage4 .workflow-generate-head h2 {
    font-size: 28px;
  }

  #flowPage4 .workflow-generate-head p {
    font-size: 16px;
  }

  #flowPage4 .workflow-head-actions button {
    min-width: 72px !important;
    min-height: 42px !important;
    padding: 0 14px !important;
    font-size: 18px;
  }

  #flowPage4 .workflow-stage-stepper {
    display: none !important;
    grid-template-columns: auto minmax(18px, 1fr) auto minmax(18px, 1fr) auto minmax(18px, 1fr) auto;
    gap: 6px;
    margin-bottom: 16px;
  }

  #flowPage4 .workflow-stage-stepper strong {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  #flowPage4 .workflow-stage-stepper em {
    font-size: 14px;
  }

  #flowPage4 .workflow-stage-stepper i {
    margin-top: 17px;
  }

  #flowPage4 .compact-timeline {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(136px, max-content);
    gap: 8px;
    margin-bottom: 12px;
  }

  #flowPage4 #workflowStats.stats {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 0 !important;
    margin: 0 0 10px !important;
    padding: 13px 0;
    overflow-x: auto;
  }

  #flowPage4 #workflowStats.stats div {
    display: inline-flex !important;
    min-width: 74px;
    min-height: auto !important;
    place-items: initial !important;
    align-content: initial !important;
    padding: 0 10px !important;
    border: 0;
    border-right: 1px solid #d0d5dd;
    border-radius: 0;
    background: transparent !important;
  }

  #flowPage4 #workflowStats.stats div:first-child {
    border-color: #d0d5dd;
    background: transparent !important;
  }

  #flowPage4 #workflowStats.stats strong {
    font-size: 18px;
  }

  #flowPage4 #workflowStats.stats span {
    margin-top: 0;
    font-size: 14px;
  }

  #flowPage4 .workflow-job-tabs {
    gap: 24px;
    padding-inline: 0;
  }

  #flowPage4 .workflow-job-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(116px, 140px);
    gap: 8px;
  }

  #flowPage4 .workflow-job-search {
    min-height: 40px;
    padding: 0 10px;
  }

  #flowPage4 #workflowJobStatusFilter {
    min-height: 40px;
    padding-inline: 10px;
    font-size: 14px;
  }

  #flowPage4 .workflow-job-header {
    display: none;
  }

  #flowPage4 .workflow-job-header span:nth-child(4) {
    display: none;
  }

  #flowPage4 .workflow-job-row {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    grid-template-areas:
      "info info info info"
      "meta status progress view";
    gap: 10px 10px;
    padding: 14px 0 15px;
  }

  #flowPage4 .workflow-job-row .job-info {
    grid-area: info;
    padding-left: 2px;
  }

  #flowPage4 .workflow-job-row strong {
    display: block;
    font-size: 16px;
    line-height: 1.45;
  }

  #flowPage4 .workflow-job-row .job-info span {
    display: inline-block;
    margin-top: 4px;
    font-size: 13px;
  }

  #flowPage4 .job-status-badge {
    grid-area: status;
    justify-self: start;
    align-self: center;
    padding: 5px 7px;
    font-size: 13px;
  }

  #flowPage4 .job-progress-cell {
    grid-area: progress;
    align-self: center;
    font-size: 13px;
  }

  #flowPage4 .job-progress-cell i {
    width: 64px;
  }

  #flowPage4 .workflow-job-row time {
    grid-area: meta;
    display: flex;
    flex-wrap: wrap;
    gap: 3px 0;
    justify-self: start;
    align-self: center;
    font-size: 13px;
  }

  #flowPage4 .job-view-button {
    grid-area: view;
    justify-self: end;
    align-self: center;
  }
}

/* Billing purchase layout */
#settingsTabBilling .billing-page {
  display: grid;
  gap: 12px;
  color: var(--ink);
}

#settingsModal:has(#settingsTabBilling.active) .settings-body {
  overflow: hidden;
}

#settingsTabBilling.active {
  height: 100%;
  overflow: hidden;
}

#settingsTabBilling .billing-page-title {
  text-align: center;
}

#settingsTabBilling .billing-page-title h2 {
  margin: 0;
  color: #111827;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
}

#settingsTabBilling .billing-plans-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#settingsTabBilling .billing-plans-panel .panel-title,
#settingsTabBilling .billing-plans-panel .billing-model-note,
#settingsTabBilling .billing-plans-panel #paymentStatus:empty {
  display: none;
}

#settingsTabBilling .payment-plans,
#settingsTabBilling.active .payment-plans {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

#settingsTabBilling .payment-plan,
#settingsTabBilling.active .payment-plan {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  min-height: 332px;
  padding: 22px 24px 20px;
  border: 1px solid #dfe5ee;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fffdf9);
  box-shadow: 0 20px 58px rgba(15, 23, 42, .07);
  transform: none;
}

#settingsTabBilling .payment-plan.recommended {
  border: 2px solid #1767ff;
  box-shadow: 0 24px 68px rgba(23, 103, 255, .14);
}

#settingsTabBilling .recommended-badge {
  position: absolute;
  top: 0;
  left: 50%;
  min-width: 106px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -1px);
  border-radius: 0 0 12px 12px;
  background: #1767ff;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

#settingsTabBilling .payment-plan:hover,
#settingsTabBilling.active .payment-plan:hover {
  transform: none;
}

#settingsTabBilling .plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

#settingsTabBilling .payment-plan h3,
#settingsTabBilling.active .payment-plan h3 {
  margin: 0;
  color: #111827;
  font-size: 20px;
  line-height: 1.2;
  white-space: normal;
}

#settingsTabBilling .plan-head p,
#settingsTabBilling.active .plan-head p {
  margin: 8px 0 0;
  color: #48566b;
  font-size: 15px;
  line-height: 1.45;
  white-space: normal;
}

#settingsTabBilling .plan-head > span {
  padding: 7px 13px;
  border: 1px solid #f2d3a6;
  border-radius: 999px;
  background: #fff7ec;
  color: #b27016;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

#settingsTabBilling .plan-price {
  margin-top: 18px;
}

#settingsTabBilling .plan-price strong,
#settingsTabBilling.active .plan-price strong {
  color: #111827;
  font-size: 36px;
  line-height: 1;
  letter-spacing: 0;
}

#settingsTabBilling .payment-plan.recommended .plan-price strong {
  color: #1767ff;
}

#settingsTabBilling .plan-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

#settingsTabBilling .plan-allowance,
#settingsTabBilling.active .plan-allowance,
#settingsTabBilling .plan-referral-tag {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 30px;
  padding: 0 14px;
  border: 1px solid #f0d2a4;
  border-radius: 999px;
  background: #fff7eb;
  color: #a86511;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

#settingsTabBilling .plan-referral-tag {
  border-color: #b8edcc;
  background: #edfff4;
  color: #0f8a47;
}

#settingsTabBilling .plan-features {
  display: grid;
  gap: 9px;
  margin: 16px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid #e6ebf2;
  list-style: none;
}

#settingsTabBilling .plan-features li {
  position: relative;
  padding-left: 30px;
  color: #253044;
  font-size: 14px;
  line-height: 1.45;
}

#settingsTabBilling .plan-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #1767ff;
  border-radius: 50%;
  color: #1767ff;
  font-size: 12px;
  font-weight: 900;
}

#settingsTabBilling .payment-plan button.primary,
#settingsTabBilling.active .payment-plan button.primary {
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
  border-radius: 8px;
  border-color: #111827;
  background: linear-gradient(180deg, #1e293b, #111827);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

#settingsTabBilling .payment-plan.recommended button.primary {
  border-color: #1767ff;
  background: #1767ff;
}

#settingsTabBilling .billing-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .85fr);
  gap: 16px;
}

#settingsTabBilling .referral-panel,
#settingsTabBilling .purchase-benefits-panel {
  padding: 0;
  min-width: 0;
  border-color: #dfe5ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 54px rgba(15, 23, 42, .06);
}

#settingsTabBilling .referral-program {
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  min-height: 158px;
  padding: 20px 22px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
}

#settingsTabBilling .referral-program.unsupported {
  filter: grayscale(.75);
  opacity: .52;
  background: linear-gradient(135deg, #f4f4f2, #fafafa);
}

#settingsTabBilling .referral-program.unsupported::before {
  opacity: .45;
}

#settingsTabBilling .referral-program.unsupported .referral-head span {
  background: #ececec;
  color: #777;
}

#settingsTabBilling .referral-program.unsupported .referral-stats div,
#settingsTabBilling .referral-program.unsupported .referral-link-row button {
  border-color: #d8d8d8;
  background: #f3f3f3;
  color: #8a8a8a;
  box-shadow: none;
}

#settingsTabBilling .referral-program.unsupported .referral-link-row button {
  cursor: not-allowed;
  pointer-events: none;
}

#settingsTabBilling .referral-program.unsupported .referral-link-row button:first-of-type {
  border-color: #d0d0d0;
  background: #e7e7e7;
  color: #888;
}

#settingsTabBilling .referral-program::before {
  content: "";
  width: 96px;
  height: 96px;
  grid-row: 1 / span 4;
  border-radius: 50%;
  background:
    radial-gradient(circle at 70% 72%, #ffd278 0 13px, transparent 14px),
    radial-gradient(circle at 62% 76%, #f2aa31 0 23px, transparent 24px),
    radial-gradient(circle at 42% 40%, transparent 0 18px, #c9840b 19px 25px, transparent 26px),
    #fff5df;
}

#settingsTabBilling .referral-head span {
  background: #fff1d9;
  color: #a86511;
}

#settingsTabBilling .referral-head h2 {
  font-size: 22px;
}

#settingsTabBilling .referral-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#settingsTabBilling .referral-link-row {
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto) minmax(170px, auto);
}

#settingsTabBilling .referral-link-row.locked {
  grid-template-columns: minmax(180px, 260px);
}

#settingsTabBilling .referral-locked {
  display: grid;
  gap: 4px;
  padding: 13px 16px;
  border: 1px solid #f0d2a4;
  border-radius: 10px;
  background: #fff7eb;
}

#settingsTabBilling .referral-locked strong {
  color: #a86511;
  font-size: 17px;
}

#settingsTabBilling .referral-locked span {
  color: #64748b;
  font-size: 13px;
}

#settingsTabBilling .purchase-benefits {
  padding: 22px 24px;
}

#settingsTabBilling .purchase-benefits h3 {
  margin: 0 0 14px;
  color: #111827;
  font-size: 20px;
}

#settingsTabBilling .benefit-list {
  display: grid;
  gap: 10px;
}

#settingsTabBilling .benefit-list div {
  min-height: 48px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border: 1px solid #e5eaf1;
  border-radius: 9px;
  background: #fff;
}

#settingsTabBilling .benefit-list span {
  color: #253044;
  font-size: 14px;
}

#settingsTabBilling .benefit-list strong {
  color: #111827;
  font-size: 18px;
}

#settingsTabBilling .benefit-list .benefit-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
}

#settingsTabBilling .benefit-icon.blue {
  background: #1767ff;
}

#settingsTabBilling .benefit-icon.gold {
  background: #c98204;
}

#settingsTabBilling .benefit-icon.green {
  background: #16a34a;
}

@media (max-width: 1280px) {
  #settingsTabBilling .payment-plans,
  #settingsTabBilling.active .payment-plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  #settingsTabBilling .billing-page-title h2 {
    font-size: 28px;
  }
  #settingsTabBilling .payment-plans,
  #settingsTabBilling.active .payment-plans,
  #settingsTabBilling .billing-bottom-grid,
  #settingsTabBilling .referral-program {
    grid-template-columns: 1fr;
  }
  #settingsTabBilling .referral-program::before {
    display: none;
  }
  #settingsTabBilling .referral-link-row {
    grid-template-columns: 1fr;
  }
}

/* Compact billing fit: keep the purchase page fully visible in one modal screen. */
#settingsTabBilling .billing-page {
  gap: 10px;
}

#settingsTabBilling .billing-page-title h2 {
  font-size: 26px;
}

#settingsTabBilling .payment-plans,
#settingsTabBilling.active .payment-plans {
  gap: 14px;
}

#settingsTabBilling .payment-plan,
#settingsTabBilling.active .payment-plan {
  min-height: 274px;
  padding: 16px 20px 16px;
}

#settingsTabBilling .recommended-badge {
  height: 24px;
  min-width: 92px;
  font-size: 12px;
}

#settingsTabBilling .payment-plan h3,
#settingsTabBilling.active .payment-plan h3 {
  font-size: 18px;
}

#settingsTabBilling .plan-head p,
#settingsTabBilling.active .plan-head p {
  margin-top: 5px;
  font-size: 13px;
}

#settingsTabBilling .plan-head > span {
  padding: 5px 10px;
  font-size: 12px;
}

#settingsTabBilling .plan-price {
  margin-top: 12px;
}

#settingsTabBilling .plan-price strong,
#settingsTabBilling.active .plan-price strong {
  font-size: 30px;
}

#settingsTabBilling .plan-tag-row {
  gap: 7px;
  margin-top: 10px;
}

#settingsTabBilling .plan-allowance,
#settingsTabBilling.active .plan-allowance,
#settingsTabBilling .plan-referral-tag {
  min-height: 26px;
  padding: 0 10px;
  font-size: 12px;
}

#settingsTabBilling .plan-features {
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
}

#settingsTabBilling .plan-features li {
  min-height: 18px;
  padding-left: 24px;
  font-size: 12px;
  line-height: 1.35;
}

#settingsTabBilling .plan-features li::before {
  width: 16px;
  height: 16px;
  font-size: 10px;
}

#settingsTabBilling .payment-plan button.primary,
#settingsTabBilling.active .payment-plan button.primary {
  min-height: 42px;
  margin-top: 10px;
  font-size: 14px;
}

#settingsTabBilling .billing-bottom-grid {
  gap: 14px;
}

#settingsTabBilling .referral-program {
  min-height: 134px;
  padding: 16px 20px;
}

#settingsTabBilling .referral-program::before {
  width: 76px;
  height: 76px;
}

#settingsTabBilling .referral-head h2 {
  margin-top: 5px;
  font-size: 18px;
}

#settingsTabBilling .referral-head p,
#settingsTabBilling .referral-program small {
  font-size: 12px;
  line-height: 1.4;
}

#settingsTabBilling .referral-locked {
  padding: 10px 12px;
}

#settingsTabBilling .purchase-benefits {
  padding: 16px 20px;
}

#settingsTabBilling .purchase-benefits h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

#settingsTabBilling .benefit-list {
  gap: 8px;
}

#settingsTabBilling .benefit-list div {
  min-height: 42px;
}

/* Black-gold interactive billing polish */
#settingsTabBilling .payment-plan,
#settingsTabBilling.active .payment-plan,
#settingsTabBilling .referral-panel,
#settingsTabBilling .purchase-benefits-panel,
#settingsTabBilling .referral-link-row button,
#settingsTabBilling .payment-plan button.primary {
  transition:
    transform .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease,
    color .18s ease;
}

#settingsTabBilling .payment-plan,
#settingsTabBilling.active .payment-plan {
  cursor: pointer;
}

#settingsTabBilling .payment-plan:hover,
#settingsTabBilling.active .payment-plan:hover {
  transform: translateY(-4px);
  border-color: #c9963a;
  box-shadow: 0 22px 58px rgba(43, 32, 18, .16);
}

#settingsTabBilling .payment-plan.selected,
#settingsTabBilling.active .payment-plan.selected,
#settingsTabBilling .payment-plan.recommended.selected {
  border: 2px solid #c9963a;
  box-shadow: 0 24px 66px rgba(147, 97, 23, .22);
}

#settingsTabBilling .payment-plan.recommended {
  border-color: #dfe5ee;
  box-shadow: 0 20px 58px rgba(15, 23, 42, .07);
}

#settingsTabBilling .recommended-badge {
  background: linear-gradient(180deg, #2b2117, #111827);
  color: #f5c96b;
}

#settingsTabBilling .payment-plan.recommended .plan-price strong,
#settingsTabBilling .payment-plan.selected .plan-price strong {
  color: #111827;
}

#settingsTabBilling .payment-plan.selected .plan-price strong {
  text-shadow: 0 8px 26px rgba(201, 150, 58, .16);
}

#settingsTabBilling .plan-features li::before {
  border-color: #c9963a;
  color: #9a661a;
  background: #fff8e9;
}

#settingsTabBilling .payment-plan button.primary,
#settingsTabBilling.active .payment-plan button.primary,
#settingsTabBilling .payment-plan.recommended button.primary {
  border-color: #111827;
  background: linear-gradient(180deg, #23201b, #11100e);
  color: #f5c96b;
  box-shadow: 0 12px 28px rgba(17, 16, 14, .18);
}

#settingsTabBilling .payment-plan button.primary:hover,
#settingsTabBilling.active .payment-plan button.primary:hover,
#settingsTabBilling .payment-plan.recommended button.primary:hover,
#settingsTabBilling .referral-link-row button:hover {
  transform: translateY(-2px);
  border-color: #c9963a;
  background: linear-gradient(180deg, #2d2418, #0f0e0c);
  color: #ffd978;
  box-shadow: 0 16px 32px rgba(39, 29, 16, .24);
}

#settingsTabBilling .payment-plan button.primary:active,
#settingsTabBilling .referral-link-row button:active {
  transform: translateY(0);
}

#settingsTabBilling .referral-panel:hover,
#settingsTabBilling .purchase-benefits-panel:hover {
  transform: translateY(-3px);
  border-color: #c9963a;
  box-shadow: 0 22px 56px rgba(43, 32, 18, .13);
}

#settingsTabBilling .referral-program {
  grid-template-columns: 132px minmax(0, 1fr);
}

#settingsTabBilling .referral-program::before {
  width: 106px;
  height: 106px;
  background:
    radial-gradient(circle at 70% 74%, #ffe19b 0 13px, transparent 14px),
    radial-gradient(circle at 72% 74%, #efaa29 0 22px, transparent 23px),
    radial-gradient(circle at 55% 84%, #ffd782 0 16px, transparent 17px),
    radial-gradient(circle at 55% 84%, #efaa29 0 25px, transparent 26px),
    radial-gradient(ellipse at 38% 43%, transparent 0 16px, #c68107 17px 23px, transparent 24px),
    radial-gradient(ellipse at 51% 31%, transparent 0 16px, #d89512 17px 23px, transparent 24px),
    #fff4df;
  box-shadow: inset 0 0 0 1px rgba(201, 150, 58, .12);
}

#settingsTabBilling .referral-link-row button:first-of-type,
#settingsTabBilling .referral-link-row button {
  border-color: #111827;
  background: linear-gradient(180deg, #23201b, #11100e);
  color: #f5c96b;
}

#settingsTabBilling .referral-link-row button:last-of-type {
  border-color: #cfc6b8;
  background: #fff;
  color: #111827;
  box-shadow: none;
}

#settingsTabBilling .referral-link-row button:last-of-type:hover {
  border-color: #c9963a;
  background: #fff8e9;
  color: #111827;
}

#settingsTabBilling .referral-program.unsupported,
#settingsTabBilling.active .referral-program.unsupported {
  filter: grayscale(.75);
  opacity: .52;
  background: linear-gradient(135deg, #f4f4f2, #fafafa);
}

#settingsTabBilling .referral-program.unsupported .referral-link-row button,
#settingsTabBilling.active .referral-program.unsupported .referral-link-row button,
#settingsTabBilling .referral-program.unsupported .referral-link-row button:first-of-type,
#settingsTabBilling.active .referral-program.unsupported .referral-link-row button:first-of-type,
#settingsTabBilling .referral-program.unsupported .referral-link-row button:last-of-type,
#settingsTabBilling.active .referral-program.unsupported .referral-link-row button:last-of-type {
  cursor: not-allowed;
  pointer-events: none;
  border-color: #d0d0d0;
  background: #e7e7e7;
  color: #888;
  box-shadow: none;
  transform: none;
}

#settingsTabBilling .benefit-list div {
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

#settingsTabBilling .benefit-list div:hover {
  transform: translateX(3px);
  border-color: #c9963a;
  box-shadow: 0 10px 24px rgba(43, 32, 18, .10);
}

#settingsTabBilling .benefit-list div:first-child strong {
  color: #c47a0a;
  text-shadow: 0 8px 22px rgba(196, 122, 10, .18);
}

#settingsTabBilling .benefit-icon.blue,
#settingsTabBilling .benefit-icon.gold,
#settingsTabBilling .benefit-icon.green {
  background: linear-gradient(180deg, #c9963a, #9a661a);
}

/* Billing frame refinement: match the narrower red-box composition. */
#settingsTabBilling .billing-page {
  width: min(1540px, calc(100% - 88px));
  margin: 0 auto;
}

#settingsTabBilling .payment-plan button.primary,
#settingsTabBilling.active .payment-plan button.primary {
  width: min(100%, 360px);
  justify-self: center;
}

#settingsTabBilling .referral-program {
  grid-template-columns: 132px minmax(0, 1fr);
}

#settingsTabBilling .referral-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

#settingsTabBilling .referral-stats div {
  min-height: 72px;
  display: grid;
  align-content: center;
  justify-items: center;
}

#settingsTabBilling .referral-stats span {
  margin: 0 0 6px;
  font-size: 13px;
}

#settingsTabBilling .referral-stats strong {
  color: #111827;
  font-size: 18px;
}

#settingsTabBilling .referral-stats div:first-child strong {
  color: #b27016;
}

#settingsTabBilling .referral-link-row,
#settingsTabBilling .referral-link-row.locked {
  grid-template-columns: minmax(0, 1fr) minmax(0, .92fr);
}

#settingsTabBilling .referral-link-row button,
#settingsTabBilling .referral-link-row button:first-of-type,
#settingsTabBilling .referral-link-row button:last-of-type {
  min-height: 44px;
}

@media (max-width: 1280px) {
  #settingsTabBilling .billing-page {
    width: min(100%, calc(100% - 32px));
  }
}

/* Final billing viewport fit: keep referral actions above the modal footer. */
#settingsTabBilling.active .billing-page {
  gap: 8px;
  height: 100%;
  align-content: start;
}

#settingsTabBilling.active .billing-page-title h2 {
  font-size: 24px;
  line-height: 1.08;
}

#settingsTabBilling.active .payment-plans {
  gap: 12px;
}

#settingsTabBilling.active .payment-plan {
  min-height: 248px;
  padding: 14px 18px 14px;
}

#settingsTabBilling.active .plan-price {
  margin-top: 8px;
}

#settingsTabBilling.active .plan-price strong {
  font-size: 28px;
}

#settingsTabBilling.active .plan-tag-row {
  margin-top: 8px;
}

#settingsTabBilling.active .plan-features {
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
}

#settingsTabBilling.active .plan-features li {
  min-height: 16px;
  font-size: 12px;
  line-height: 1.25;
}

#settingsTabBilling.active .payment-plan button.primary {
  min-height: 38px;
  margin-top: 8px;
}

#settingsTabBilling.active .billing-bottom-grid {
  gap: 12px;
}

#settingsTabBilling.active .referral-program {
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 124px;
  padding: 14px 18px 12px;
}

#settingsTabBilling.active .referral-program::before {
  width: 84px;
  height: 84px;
}

#settingsTabBilling.active .referral-head h2 {
  margin: 4px 0 2px;
  font-size: 17px;
  line-height: 1.18;
}

#settingsTabBilling.active .referral-head p,
#settingsTabBilling.active .referral-program small {
  font-size: 12px;
  line-height: 1.3;
}

#settingsTabBilling.active .referral-stats {
  gap: 8px;
}

#settingsTabBilling.active .referral-stats div {
  min-height: 58px;
  padding: 7px 10px;
}

#settingsTabBilling.active .referral-stats strong {
  font-size: 16px;
}

#settingsTabBilling.active .referral-stats span {
  margin-bottom: 3px;
  font-size: 12px;
}

#settingsTabBilling.active .referral-link-row,
#settingsTabBilling.active .referral-link-row.locked {
  gap: 10px;
}

#settingsTabBilling.active .referral-link-row button,
#settingsTabBilling.active .referral-link-row button:first-of-type,
#settingsTabBilling.active .referral-link-row button:last-of-type {
  min-height: 38px;
  padding: 0 14px;
}

#settingsTabBilling.active .purchase-benefits {
  padding: 14px 18px;
}

#settingsTabBilling.active .purchase-benefits h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

#settingsTabBilling.active .benefit-list {
  gap: 7px;
}

#settingsTabBilling.active .benefit-list div {
  min-height: 38px;
  padding: 0 14px;
}

#settingsTabBilling.active .benefit-list .benefit-icon {
  width: 28px;
  height: 28px;
}
