:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #0f172a;
  --green: #16a34a;
  --red: #ef4444;
  --yellow: #f59e0b;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 35%),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 64px);
  background: rgba(248, 250, 252, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: white;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav a {
  color: var(--muted);
  font-size: 14px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: white;
  background: var(--primary);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: #e0e7ff;
  color: #1e3a8a;
}

.btn-ghost {
  background: transparent;
  color: var(--secondary);
  border: 1px solid var(--line);
}

.btn-large {
  padding: 15px 24px;
  font-size: 16px;
}

.full {
  width: 100%;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
  padding: 72px clamp(18px, 5vw, 80px);
  min-height: 760px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.06em;
  margin-bottom: 24px;
}

.hero p {
  max-width: 620px;
  font-size: 19px;
  line-height: 1.7;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 34px 0;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trust-row span {
  padding: 8px 12px;
  border-radius: 999px;
  color: #334155;
  background: white;
  border: 1px solid var(--line);
  font-size: 13px;
}

.hero-card,
.panel,
.price-card,
.feature-card,
.usage-card,
.plan-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.hero-card {
  padding: 24px;
}

.card-top {
  display: flex;
  gap: 7px;
  margin-bottom: 22px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 99px;
  display: inline-block;
}

.dot.red { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.dot.green { background: var(--green); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.metric-grid div {
  padding: 16px;
  background: #f1f5f9;
  border-radius: 18px;
}

.metric-grid strong {
  display: block;
  font-size: 26px;
}

.metric-grid span {
  color: var(--muted);
  font-size: 13px;
}

.missing-list {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.missing-list div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.missing-list b,
.missing-list span {
  display: block;
}

.missing-list span {
  color: var(--muted);
  font-size: 14px;
}

.email-preview {
  padding: 16px;
  border-radius: 18px;
  background: #eff6ff;
}

.email-preview p {
  color: #334155;
  margin: 8px 0 0;
}

.section {
  padding: 80px clamp(18px, 5vw, 80px);
}

.section.alt {
  background: #0f172a;
  color: white;
}

.section.alt p,
.section.alt .check-list {
  color: #cbd5e1;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 34px;
}

.section-heading h2,
.section-heading h1 {
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 14px;
}

.section-heading p {
  color: var(--muted);
  font-size: 18px;
}

.feature-grid,
.pricing-grid,
.usage-grid,
.template-grid {
  display: grid;
  gap: 18px;
}

.feature-grid {
  grid-template-columns: repeat(3, 1fr);
}

.feature-card,
.price-card,
.usage-card,
.plan-card,
.panel {
  padding: 24px;
}

.feature-card p,
.price-card p,
.panel-heading p {
  color: var(--muted);
  line-height: 1.6;
}

.split {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 44px;
  align-items: center;
}

.check-list {
  display: grid;
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.check-list li::before {
  content: "✓";
  margin-right: 10px;
  color: #86efac;
  font-weight: 900;
}

.pricing-grid {
  grid-template-columns: repeat(5, 1fr);
}

.price-card {
  position: relative;
}

.price-card.featured {
  border-color: rgba(37, 99, 235, 0.45);
  transform: translateY(-8px);
}

.badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 10px;
  color: white;
  background: var(--primary);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.price {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.price span {
  color: var(--muted);
  font-size: 16px;
}

.annual-price {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 900;
}


.billing-action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 16px;
}

.billing-action-grid .btn {
  justify-content: center;
}

.price-card ul {
  margin: 18px 0 24px;
  padding-left: 20px;
  color: #334155;
}

.one-time {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.cta {
  margin: 40px clamp(18px, 5vw, 80px) 80px;
  padding: clamp(34px, 6vw, 70px);
  border-radius: 34px;
  color: white;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  text-align: center;
}

.cta h2 {
  font-size: clamp(32px, 5vw, 56px);
  margin-bottom: 12px;
}

.cta p {
  color: #dbeafe;
  font-size: 18px;
}

.footer {
  display: flex;
  justify-content: space-between;
  padding: 28px clamp(18px, 5vw, 80px);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(15, 23, 42, 0.55);
  z-index: 50;
  padding: 20px;
}

.modal.show {
  display: grid;
}

.modal-card {
  width: min(460px, 100%);
  position: relative;
  padding: 26px;
  border-radius: 28px;
  background: white;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: 0;
  background: transparent;
  font-size: 28px;
  cursor: pointer;
}

.overview-card-wide {
  grid-column: span 2;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.tab.active {
  color: white;
  background: var(--primary);
}

.auth-form,
.upload-form {
  display: grid;
  gap: 14px;
}

.auth-form input,
.auth-form textarea,
.auth-form select,
.upload-form input,
.upload-form select {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: white;
}

.auth-form input:focus,
.auth-form textarea:focus,
.auth-form select:focus,
.upload-form input:focus,
.upload-form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.hidden {
  display: none !important;
}


.btn-danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff1f2;
}

.btn-danger:hover:not(:disabled) {
  color: #991b1b;
  border-color: #fca5a5;
  background: #ffe4e6;
}

.history-panel-heading {
  align-items: flex-start;
}

.history-panel-heading .btn {
  flex-shrink: 0;
}

.form-message {
  color: var(--muted);
  margin: 0;
}

.form-message.error {
  color: var(--red);
}

.form-message.success {
  color: var(--green);
}

.form-message.warning {
  color: #b45309;
}

.email-verification-debug {
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed #93c5fd;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
  text-align: center;
}

.email-verification-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 22px;
  padding: 18px 20px;
  border: 1px solid #fbbf24;
  border-radius: 18px;
  background: #fffbeb;
  color: #78350f;
}

.email-verification-banner strong {
  display: block;
  margin-bottom: 4px;
}

.email-verification-banner p {
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 680px) {
  .email-verification-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .email-verification-banner .btn {
    width: 100%;
  }
}

.dashboard {
  padding: 36px clamp(18px, 5vw, 70px) 80px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}

.dashboard-hero h1 {
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: -0.05em;
  margin-bottom: 10px;
}

.dashboard-hero p {
  color: var(--muted);
}

.plan-card {
  display: grid;
  gap: 10px;
  align-content: center;
}

.plan-card span,
.usage-card span {
  color: var(--muted);
}

.plan-card strong,
.usage-card strong {
  font-size: 26px;
}

.usage-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 22px;
}

.panel {
  margin-bottom: 22px;
}

.panel-heading {
  margin-bottom: 22px;
}

.panel-heading h2 {
  margin-bottom: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.upload-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.file-drop {
  display: grid;
  place-items: center;
  min-height: 130px;
  padding: 24px;
  border: 2px dashed #cbd5e1;
  border-radius: 20px;
  cursor: pointer;
  background: #f8fafc;
}

.file-drop input {
  display: none;
}

.export-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.template-grid {
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 22px;
}

.template-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fafc;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
  color: #334155;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: #f1f5f9;
}

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

.history-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
}

.history-item span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.contact-page {
  min-height: calc(100vh - 76px);
  display: grid;
  place-items: center;
  padding: 40px 18px;
}

.contact-panel {
  width: min(720px, 100%);
}

@media (max-width: 980px) {
  .hero,
  .split,
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    min-height: auto;
  }

  .price-card.featured {
    transform: none;
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    gap: 16px;
  }

  .nav {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
  }

  .nav a {
    display: none;
  }

  .hero {
    padding-top: 42px;
  }

  .hero-actions,
  .one-time,
  .export-row {
    flex-direction: column;
  }

  .feature-grid,
  .pricing-grid,
  .usage-grid,
  .template-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .history-item {
    flex-direction: column;
  }
}
/* 文件上传选择状态增强 */
.file-drop {
  transition: 0.2s ease;
  text-align: center;
}

.file-drop-title {
  display: block;
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
}

.file-drop-hint {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 500;
}

.file-drop.has-file {
  border-color: #2563eb;
  background: #eff6ff;
}

.file-drop.has-file .file-drop-title {
  color: #1d4ed8;
}

.selected-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 16px;
}

.selected-file strong {
  display: block;
  color: #0f172a;
}

.selected-file span {
  display: block;
  margin-top: 4px;
  color: #475569;
  font-size: 14px;
}

.btn-small {
  padding: 8px 12px;
  font-size: 14px;
}
/* 文件名放入上传方框内部 */
.file-drop {
  transition: 0.2s ease;
  text-align: center;
}

.file-drop-title {
  display: block;
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
}

.file-drop-hint {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 500;
}

.file-drop.has-file {
  border-color: #2563eb;
  background: #eff6ff;
}

.file-drop.has-file .file-drop-title {
  color: #1d4ed8;
}

.file-drop-selected {
  margin: 16px auto 0;
  width: min(520px, 100%);
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  background: #ffffff;
  border-radius: 16px;
}

.file-drop-selected strong {
  display: block;
  max-width: 100%;
  color: #0f172a;
  font-size: 17px;
  word-break: break-all;
}

.file-drop-selected span {
  display: block;
  color: #475569;
  font-size: 14px;
}

.file-drop-selected.hidden {
  display: none !important;
}

.btn-small {
  padding: 8px 12px;
  font-size: 14px;
}
/* 上传框最终版：文件信息显示在方框内部，移除按钮可正常点击 */
.file-drop {
  display: grid;
  place-items: center;
  gap: 12px;
  transition: 0.2s ease;
  text-align: center;
}

.file-drop-label {
  display: grid;
  place-items: center;
  width: 100%;
  cursor: pointer;
}

.file-drop-label input {
  display: none;
}

.file-drop-title {
  display: block;
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
}

.file-drop-hint {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 500;
}

.file-drop.has-file {
  border-color: #2563eb;
  background: #eff6ff;
}

.file-drop.has-file .file-drop-title {
  color: #1d4ed8;
}

.file-drop-selected {
  margin: 4px auto 0;
  width: min(560px, 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  background: #ffffff;
  border-radius: 16px;
}

.file-drop-selected.hidden {
  display: none !important;
}

.file-drop-selected-text {
  min-width: 0;
  text-align: center;
}

.file-drop-selected strong {
  display: block;
  max-width: 100%;
  color: #0f172a;
  font-size: 17px;
  word-break: break-all;
}

.file-drop-selected span {
  display: block;
  margin-top: 4px;
  color: #475569;
  font-size: 14px;
}

.btn-small {
  padding: 8px 12px;
  font-size: 14px;
  white-space: nowrap;
}
/* 历史记录最终版：明显可点击 */
.history-item-button {
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.history-item-button:hover {
  border-color: #2563eb;
  background: #eff6ff;
  transform: translateY(-1px);
}

.history-item-button:focus-visible {
  outline: 4px solid rgba(37, 99, 235, 0.18);
  border-color: #2563eb;
}

.history-main {
  min-width: 0;
}

.history-item-right {
  text-align: right;
  margin-left: auto;
}

.history-open-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .history-open-badge {
    margin-left: 0;
    width: fit-content;
  }

  .history-item-right {
    text-align: left;
    margin-left: 0;
  }
}
/* 分析结果关闭按钮 */
.result-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.result-close-btn {
  flex-shrink: 0;
  color: #475569;
  background: #ffffff;
}

.result-close-btn:hover {
  color: #0f172a;
  border-color: #cbd5e1;
  background: #f8fafc;
}

/* 历史记录按钮优化版：避免“查看报告”变成过大的圆形按钮 */
.history-item-button {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  width: 100%;
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  background: #f8fafc;
}

.history-item-button:hover {
  border-color: #2563eb;
  background: #eff6ff;
  transform: translateY(-1px);
}

.history-main {
  min-width: 0;
}

.history-item-right {
  min-width: 96px;
  text-align: right;
  margin-left: 0 !important;
}

.history-open-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
  width: auto;
  height: auto;
  margin-left: 0 !important;
  padding: 7px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8 !important;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: none;
}

.history-item-button:hover .history-open-badge {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff !important;
}

@media (max-width: 720px) {
  .result-panel-heading {
    flex-direction: column;
  }

  .result-close-btn {
    width: 100%;
  }

  .history-item-button {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .history-item-right {
    text-align: left;
  }

  .history-open-badge {
    width: fit-content;
  }
}
/* 登录/注册弹窗关闭按钮修复：避免 X 压到“注册”标签 */
.modal-card {
  padding-top: 58px;
}

.modal-close {
  top: 16px;
  right: 18px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  font-size: 28px;
  line-height: 1;
  z-index: 3;
}

.modal-close:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.tabs {
  margin-top: 0;
}

@media (max-width: 520px) {
  .modal-card {
    padding-top: 56px;
  }

  .modal-close {
    top: 14px;
    right: 14px;
  }
}


/* 多语言列名识别提示 */
.column-mapping-notice {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  background: #eff6ff;
  color: #1e3a8a;
  white-space: pre-wrap;
  line-height: 1.6;
}

.column-mapping-notice.warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.column-mapping-notice.info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
}


/* 历史记录导航与报告关闭按钮增强 */
#historyPanel,
#resultPanel {
  scroll-margin-top: 96px;
}

.result-action-row {
  align-items: center;
}

.result-bottom-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.result-bottom-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 720px) {
  .result-bottom-actions {
    justify-content: stretch;
  }

  .result-bottom-actions .btn,
  .result-action-row .btn {
    width: 100%;
  }
}


.contact-direct,
.contact-help {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.contact-direct a {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.contact-direct a:hover {
  text-decoration: underline;
}

.auth-form select {
  appearance: none;
  cursor: pointer;
}


.contact-page .btn-secondary.full {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}




@media (max-width: 720px) {
  .demo-summary-grid,
  .demo-report-grid {
    grid-template-columns: 1fr;
  }

  .demo-actions .btn {
    width: 100%;
  }
}

/* 首页“查看示例”弹窗：尽量贴近实际仪表盘 */
.demo-dashboard-modal {
  width: min(1220px, calc(100vw - 28px));
  max-height: min(92vh, 980px);
  overflow: auto;
  padding: 0;
  background: #eef4ff;
}

.demo-browser-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.demo-brand {
  pointer-events: none;
}

.demo-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.demo-logout {
  color: #0f172a;
  font-weight: 800;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
}

.demo-dashboard-preview {
  padding: 28px;
}

.demo-dashboard-hero {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 22px;
  align-items: stretch;
  margin-bottom: 18px;
}

.demo-dashboard-hero h2 {
  font-size: clamp(32px, 5vw, 54px);
  letter-spacing: -0.05em;
  margin: 8px 0;
}

.demo-dashboard-hero p {
  color: var(--muted);
}

.demo-plan-card,
.demo-usage-grid > div,
.demo-panel {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.demo-plan-card {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 22px;
}

.demo-plan-card span,
.demo-plan-card small,
.demo-usage-grid span,
.demo-panel p {
  color: var(--muted);
}

.demo-plan-card strong {
  font-size: 28px;
}

.demo-usage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.demo-usage-grid > div {
  padding: 20px;
}

.demo-usage-grid strong {
  display: inline-block;
  margin-left: 8px;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.demo-panel {
  padding: 24px;
  margin-bottom: 18px;
}

.demo-panel h3 {
  margin-bottom: 8px;
}

.demo-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.demo-form-grid div {
  display: grid;
  gap: 6px;
}

.demo-form-grid span {
  display: block;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: #475569;
}

.demo-file-drop {
  display: grid;
  place-items: center;
  min-height: 100px;
  padding: 20px;
  margin-bottom: 14px;
  border: 2px dashed #cbd5e1;
  border-radius: 20px;
  background: #f8fafc;
  text-align: center;
}

.demo-file-drop span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.demo-history-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.demo-history-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
  text-align: left;
  cursor: pointer;
}

.demo-history-item b,
.demo-history-item small,
.demo-history-item strong {
  display: block;
}

.demo-history-item small {
  color: var(--muted);
  font-size: 13px;
}

.demo-history-item em {
  font-style: normal;
  color: var(--primary);
  font-weight: 900;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eff6ff;
}

.demo-report-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.demo-report-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 14px;
}

.demo-block {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fafc;
}

.demo-block h4 {
  margin-bottom: 12px;
}

.demo-email {
  white-space: pre-wrap;
  margin: 0;
  color: #334155;
  font-family: inherit;
  line-height: 1.65;
}

.demo-mini-table {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.demo-mini-table > div {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr 0.8fr 1.3fr;
}

.demo-mini-table b,
.demo-mini-table span {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.demo-mini-table b {
  background: #f1f5f9;
}

.demo-mini-table > div:last-child span {
  border-bottom: 0;
}

.demo-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  flex-wrap: wrap;
}

@media (max-width: 820px) {
  .demo-browser-header,
  .demo-dashboard-hero,
  .demo-report-heading {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .demo-nav {
    flex-wrap: wrap;
  }

  .demo-usage-grid,
  .demo-form-grid,
  .demo-report-grid {
    grid-template-columns: 1fr;
  }

  .demo-history-item {
    grid-template-columns: 1fr;
  }

  .demo-actions .btn {
    width: 100%;
  }
}

.price-card.plus-card { border-color: rgba(124, 58, 237, 0.35); }

@media (max-width: 1200px) {
  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


/* 仪表盘测试模式套餐切换 */
.test-plan-box {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.test-plan-box > span {
  color: #0f172a;
  font-weight: 900;
  font-size: 13px;
}

.test-plan-box small {
  color: var(--muted);
  line-height: 1.5;
}

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

.test-plan-grid .btn-small {
  padding: 8px 9px;
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .test-plan-grid {
    grid-template-columns: 1fr;
  }
}


/* 全站语言切换 */
.language-select {
  min-width: 118px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: #0f172a;
  font-weight: 800;
  cursor: pointer;
}

.language-select:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

@media (max-width: 720px) {
  .language-select {
    width: 100%;
  }
}


/* 输出结果区优化：更适合复制给客户、阅读邮件正文和复核原因 */
.output-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin: 8px 0 14px;
}

.output-section-heading h3 {
  margin: 0 0 4px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.output-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.template-grid-optimized {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.template-grid-optimized .output-card-email {
  grid-column: 1 / -1;
}

.output-card {
  min-width: 0;
}

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

.output-card-header h3 {
  margin: 0;
}

.copy-output-btn {
  flex: 0 0 auto;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.copy-output-btn:hover {
  background: #dbeafe;
}

.copy-output-btn.copied {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.copy-output-btn.copy-failed {
  border-color: #fecaca;
  background: #fee2e2;
  color: #b91c1c;
}

.output-pre {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.65;
  font-size: 14px;
  color: #334155;
}

.output-pre-subject {
  max-height: 90px;
  font-family: inherit;
  font-weight: 700;
}

.output-pre-email {
  max-height: 420px;
  padding-right: 6px;
}

.output-pre-small {
  max-height: 150px;
}

.missing-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 260px;
}

.missing-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 800;
}

.reason-preview {
  display: block;
  max-width: 520px;
  color: #475569;
  line-height: 1.6;
}

.result-action-row .btn {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .template-grid-optimized {
    grid-template-columns: 1fr;
  }

  .template-grid-optimized .output-card-email {
    grid-column: auto;
  }

  .output-card-header {
    align-items: flex-start;
  }

  .output-pre-email {
    max-height: 360px;
  }
}


/* 完整审计记录：状态流转 + 操作时间线 */
.audit-panel {
  margin: 0 0 20px;
  padding: 18px;
  border: 1px solid #c7d2fe;
  border-radius: 20px;
  background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
}

.audit-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 14px;
}

.audit-panel-header h3 {
  margin: 0 0 4px;
}

.audit-panel-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.audit-status-badge,
.history-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.audit-status-badge[data-status="sent"] {
  border-color: #93c5fd;
  background: #dbeafe;
  color: #1d4ed8;
}

.audit-status-badge[data-status="client_replied"] {
  border-color: #fde68a;
  background: #fef3c7;
  color: #92400e;
}

.audit-status-badge[data-status="completed"] {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.audit-status-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.audit-status-btn {
  border: 1px solid var(--line);
  background: white;
  color: #334155;
  border-radius: 999px;
  padding: 8px 13px;
  font-weight: 900;
  cursor: pointer;
}

.audit-status-btn:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.audit-status-btn.active {
  border-color: #2563eb;
  background: #2563eb;
  color: white;
}

.audit-timeline {
  display: grid;
  gap: 10px;
  max-height: 240px;
  overflow: auto;
  padding-right: 4px;
}

.audit-event {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  align-items: start;
}

.audit-event-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 0 0 4px #dbeafe;
}

.audit-event-body {
  padding-bottom: 10px;
  border-bottom: 1px dashed #cbd5e1;
}

.audit-event-body strong,
.audit-event-body span,
.audit-event-body small {
  display: block;
}

.audit-event-body strong {
  color: #0f172a;
  font-size: 14px;
}

.audit-event-body span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.audit-event-body small {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
  word-break: break-word;
}

.audit-empty {
  margin: 0;
  color: var(--muted);
}

.history-status-badge {
  margin-top: 6px;
  padding: 4px 9px;
  font-size: 12px;
}

@media (max-width: 720px) {
  .audit-panel-header {
    flex-direction: column;
  }

  .audit-status-actions {
    flex-direction: column;
  }

  .audit-status-btn {
    width: 100%;
  }
}


/* 交易级闭环复核工作台 */
.review-workbench {
  margin: 6px 0 16px;
  padding: 18px;
  border: 1px solid #dbeafe;
  border-radius: 20px;
  background: #f8fafc;
}

.review-workbench-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.review-workbench-header h3 {
  margin: 0 0 4px;
}

.review-workbench-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.review-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.review-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
}

.review-mode-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #1e3a8a;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  padding: 7px 12px;
  white-space: nowrap;
}

.review-mode-btn.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.normal-transaction-pill,
.normal-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.muted-cell {
  color: #64748b;
  font-weight: 700;
}

.review-summary {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.review-controls,
.bulk-review-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.review-controls input,
.review-controls select,
.bulk-review-bar select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  padding: 8px 13px;
  font: inherit;
}

.review-controls input {
  min-width: min(420px, 100%);
  flex: 1;
}

.selected-items-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.review-table {
  min-width: 1180px;
}

.select-col {
  width: 58px;
  text-align: center;
}

.item-review-status {
  min-width: 138px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  padding: 7px 10px;
  font-weight: 800;
}

.review-note-cell {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.item-review-note {
  min-height: 54px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  font: inherit;
  color: #334155;
  background: white;
}

.review-table tr[data-review-status="false_positive"],
.review-table tr[data-review-status="received"],
.review-table tr[data-review-status="completed"] {
  background: #f8fafc;
}

.review-table tr[data-review-status="false_positive"] .item-review-status {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.review-table tr[data-review-status="received"] .item-review-status,
.review-table tr[data-review-status="completed"] .item-review-status {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

@media (max-width: 720px) {
  .review-workbench-header,
  .review-controls,
  .bulk-review-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .review-controls input,
  .review-controls select,
  .bulk-review-bar select,
  .bulk-review-bar .btn {
    width: 100%;
  }
}


/* 五步工作台升级：汇总卡片、分页表格、异常高亮、可编辑跟进内容、分析进度 */
.analysis-progress {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 18px;
  background: #eff6ff;
}

.analysis-progress-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
  color: #1e3a8a;
}

.analysis-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: #dbeafe;
  overflow: hidden;
}

.analysis-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  transition: width 0.35s ease;
}

.analysis-progress-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.analysis-progress-steps li {
  padding: 8px 10px;
  border-radius: 999px;
  background: white;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.analysis-progress-steps li.active {
  color: #1d4ed8;
  background: #dbeafe;
}

.analysis-progress-steps li.done {
  color: #166534;
  background: #dcfce7;
}

.result-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.overview-card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #f8fafc;
  cursor: pointer;
}

.overview-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.overview-card strong {
  display: block;
  color: #0f172a;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.overview-card-danger strong {
  color: #dc2626;
}

.overview-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
}

.output-card-actions,
.output-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.output-card-footer {
  margin-top: 10px;
}

.output-editor {
  width: 100%;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: white;
  padding: 12px;
  resize: vertical;
  font: inherit;
}

.output-pre-email.output-editor {
  min-height: 300px;
}

.output-pre-small.output-editor {
  min-height: 130px;
}

.output-counter {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.output-counter.warning {
  color: #b45309;
}

.output-counter.error {
  color: #b91c1c;
}

.copy-output-btn-bottom {
  margin-left: 8px;
}

.risk-filter-btn {
  min-height: 40px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff1f2;
  color: #be123c;
  padding: 8px 13px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.risk-filter-btn.active {
  background: #dc2626;
  border-color: #dc2626;
  color: white;
}

.table-pagination {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 800;
}

.amount-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 800;
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.risk-high {
  border: 1px solid #fecaca;
  background: #fee2e2;
  color: #b91c1c;
}

.risk-medium {
  border: 1px solid #fed7aa;
  background: #ffedd5;
  color: #c2410c;
}

.risk-low {
  border: 1px solid #fde68a;
  background: #fef3c7;
  color: #a16207;
}

.risk-normal {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #64748b;
}

.review-table tr[data-risk="high"] {
  background: #fff1f2;
}

.review-table tr[data-risk="high"] td {
  border-bottom-color: #fecaca;
}

.review-table th:nth-child(5),
.review-table td:nth-child(5) {
  text-align: right;
}

@media (max-width: 980px) {
  .result-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-card-wide {
    grid-column: span 2;
  }

  .analysis-progress-steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .result-overview {
    grid-template-columns: 1fr;
  }

  .overview-card-wide {
    grid-column: span 1;
  }

  .output-card-actions,
  .output-card-footer,
  .table-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .output-card-actions .btn,
  .output-card-footer .btn,
  .copy-output-btn-bottom {
    width: 100%;
    margin-left: 0;
  }
}


/* 排序选项优化 */
#itemSortSelect {
  min-width: 170px;
}


/* 联系我们附件上传 */
.contact-attachment-box {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1.5px dashed #bfdbfe;
  border-radius: 18px;
  background: #eff6ff;
  color: #1e3a8a;
  cursor: pointer;
  font-weight: 900;
}

.contact-attachment-box small {
  color: #64748b;
  font-weight: 600;
  line-height: 1.5;
}

.contact-attachment-box .contact-file-input {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.contact-file-picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.contact-file-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #2563eb;
  color: white;
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 900;
}

.contact-file-count {
  color: #475569;
  font-size: 14px;
  font-weight: 800;
}

.contact-attachment-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: -4px;
}

.contact-attachment-card {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid #bfdbfe;
  background: #f8fafc;
  color: #334155;
  border-radius: 16px;
  padding: 10px 34px 10px 10px;
  min-width: 0;
}

.contact-file-preview-button {
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: zoom-in;
}

.contact-file-preview-button:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

.contact-file-preview {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  background: white;
  display: block;
}

.contact-file-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  background: white;
  font-size: 24px;
}

.contact-attachment-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.contact-attachment-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-attachment-meta span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.contact-remove-attachment {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 520px) {
  .contact-attachment-list {
    grid-template-columns: 1fr;
  }
}


/* 联系我们图片点击预览 */
.contact-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(15, 23, 42, 0.72);
}

.contact-preview-modal.hidden {
  display: none;
}

.contact-preview-modal img {
  max-width: min(960px, 94vw);
  max-height: 82vh;
  object-fit: contain;
  border-radius: 18px;
  background: white;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.contact-preview-modal p {
  margin: 14px 0 0;
  max-width: min(960px, 94vw);
  color: white;
  text-align: center;
  font-weight: 800;
  word-break: break-word;
}

.contact-preview-close {
  position: fixed;
  top: 22px;
  right: 22px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: white;
  color: #0f172a;
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
}

.contact-preview-close:hover {
  background: #fee2e2;
  color: #b91c1c;
}


/* 官网落地页转化优化 */
.centered {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.landing-hero {
  min-height: 820px;
  align-items: center;
}

.hero-trust-note {
  margin: -18px 0 22px;
  color: #1e40af !important;
  font-size: 15px !important;
  font-weight: 900;
}

.landing-preview-card {
  position: relative;
  overflow: hidden;
}

.landing-preview-card::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
}

.preview-heading {
  position: relative;
}

.preview-heading h3 {
  margin-bottom: 8px;
  font-size: 24px;
}

.preview-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.landing-metric-grid {
  grid-template-columns: repeat(2, 1fr);
}

.landing-metric-grid .metric-danger {
  background: #fee2e2;
}

.landing-metric-grid .metric-danger strong {
  color: #dc2626;
}

.landing-risk-list div {
  display: grid;
  gap: 4px;
}

.landing-email-preview {
  border: 1px solid #bfdbfe;
}

.landing-email-preview p {
  font-size: 14px;
  line-height: 1.7;
}

.landing-flow {
  background: #f8fafc;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  position: relative;
}

.flow-card {
  position: relative;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: white;
  box-shadow: 0 16px 50px rgba(15, 23, 42, 0.07);
}

.flow-card:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: -24px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  display: grid;
  place-items: center;
  font-weight: 900;
  z-index: 1;
}

.flow-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #eff6ff;
  font-size: 28px;
  margin-bottom: 18px;
}

.flow-card > span {
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.flow-card h3 {
  margin: 8px 0 10px;
}

.flow-card p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.landing-value .split {
  align-items: center;
}

.landing-check-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.landing-check-list li {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid rgba(226, 232, 240, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.landing-check-list li::before {
  display: none;
}

.landing-check-list b {
  color: white;
}

.landing-check-list span {
  color: #cbd5e1;
  line-height: 1.6;
}

.core-feature-grid,
.security-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.core-feature-card,
.security-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: white;
  box-shadow: 0 16px 45px rgba(15, 23, 42, 0.06);
}

.core-feature-card span {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: #eff6ff;
  font-size: 24px;
  margin-bottom: 14px;
}

.core-feature-card h3,
.security-card h3 {
  margin-bottom: 8px;
}

.core-feature-card p,
.security-card p,
.security-card li {
  color: var(--muted);
  line-height: 1.7;
}

.security-card ul {
  margin: 0;
  padding-left: 18px;
}

.landing-pricing-grid {
  align-items: stretch;
}

.price-card.featured-soft {
  border-color: #93c5fd;
  box-shadow: 0 16px 45px rgba(37, 99, 235, 0.13);
}

.pricing-compare-wrap {
  margin-top: 32px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
  box-shadow: 0 16px 45px rgba(15, 23, 42, 0.06);
}

.pricing-compare-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.pricing-compare-table th,
.pricing-compare-table td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.pricing-compare-table th {
  background: #eff6ff;
  color: #0f172a;
  font-weight: 900;
}

.pricing-compare-table tr:last-child td {
  border-bottom: 0;
}

.pricing-compare-table td:nth-child(2),
.pricing-compare-table td:nth-child(3),
.pricing-compare-table td:nth-child(4) {
  font-weight: 900;
  color: #0f172a;
}

.landing-security {
  background: #f8fafc;
}

.security-grid {
  grid-template-columns: 1.2fr repeat(3, minmax(0, 1fr));
}

.landing-final-cta {
  text-align: center;
  padding: 72px clamp(18px, 5vw, 80px);
}

.landing-final-cta .eyebrow {
  margin-bottom: 10px;
}

.landing-final-cta h2 {
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -0.05em;
}

.landing-final-cta p {
  color: #cbd5e1;
  font-size: 18px;
}

.footer {
  gap: 18px;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .landing-hero {
    min-height: auto;
  }

  .flow-grid,
  .core-feature-grid,
  .security-grid {
    grid-template-columns: 1fr;
  }

  .flow-card:not(:last-child)::after {
    content: "↓";
    top: auto;
    right: 50%;
    bottom: -24px;
    transform: translateX(50%);
  }

  .landing-metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .landing-metric-grid {
    grid-template-columns: 1fr;
  }

  .landing-final-cta {
    text-align: left;
  }
}



/* 官网模块小标题放大 v2：演示预览 / 三步流程 / 为什么会计团队需要它 / 核心功能 / 套餐定价 / 数据安全与适用场景 / 开始体验 */
.preview-heading .eyebrow,
.landing-flow .section-heading .eyebrow,
.landing-value .eyebrow,
.landing-core-features .section-heading .eyebrow,
#pricing .section-heading .eyebrow,
.landing-security .section-heading .eyebrow,
.landing-final-cta .eyebrow {
  display: inline-block;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.03em;
  text-transform: none;
  font-weight: 950;
  margin-bottom: 18px;
}

.preview-heading .eyebrow {
  display: block;
  margin-bottom: 14px;
}

.landing-flow .section-heading .eyebrow,
.landing-core-features .section-heading .eyebrow,
#pricing .section-heading .eyebrow,
.landing-security .section-heading .eyebrow {
  margin-bottom: 18px;
}

.landing-value .eyebrow {
  color: #93c5fd;
}

.landing-final-cta .eyebrow {
  color: rgba(255, 255, 255, 0.9);
}


/* 数据安全、保留时间、删除报告、法律说明页 */
.hero-security-note {
  margin: -12px 0 22px;
  color: #0f172a !important;
  font-size: 15px !important;
  font-weight: 900;
}

.security-retention-box,
.security-note-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 18px;
  padding: 16px;
  margin: 16px 0;
}

.security-retention-box p,
.security-note-box span {
  margin: 4px 0 0;
  color: #475569;
  line-height: 1.6;
}

.retention-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.retention-controls input,
.retention-controls select {
  min-width: 0;
}

.retention-result-note {
  margin: 6px 0 0;
  color: #1d4ed8;
  font-weight: 800;
}

.history-item-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 10px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
}

.history-item-open {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.history-delete-btn {
  align-self: center;
  margin-right: 12px;
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff1f2;
}

.contact-consent-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  padding: 12px 14px;
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
  line-height: 1.5;
}

.contact-consent-row input {
  width: auto;
  margin-top: 3px;
}

.cta-actions {
  display: inline-flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.legal-page {
  padding: 72px clamp(18px, 5vw, 80px);
  min-height: calc(100vh - 76px);
}

.legal-panel {
  max-width: 900px;
  margin: 0 auto;
  padding: 36px;
}

.legal-panel h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
  letter-spacing: -0.05em;
  margin-bottom: 18px;
}

.legal-panel h2 {
  margin-top: 30px;
  margin-bottom: 10px;
}

.legal-panel p,
.legal-panel li {
  color: var(--muted);
  line-height: 1.8;
}

@media (max-width: 720px) {
  .security-retention-box,
  .security-note-box,
  .history-item-card,
  .history-item-open {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .retention-controls {
    min-width: 0;
  }

  .history-delete-btn {
    margin: 0 12px 12px;
  }

  .cta-actions {
    display: grid;
  }
}


/* 演示窗口关闭按钮与演示套餐卡片清理 */
.demo-modal-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  padding: 10px 14px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.22);
}

.demo-modal-close-btn:hover {
  background: #1d4ed8;
}

.demo-plan-card {
  align-content: center;
}

@media (max-width: 720px) {
  .demo-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .demo-modal-close-btn {
    width: 100%;
  }
}


/* 独立历史记录页面 */
.history-page {
  padding-top: 36px;
}

.history-hero {
  align-items: stretch;
}

.history-action-card {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.08);
  padding: 24px;
  overflow: hidden;
}

.history-action-card strong,
.history-action-card p,
.history-action-card a,
.history-action-card .btn {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.history-action-card p {
  color: var(--muted);
  margin: 0;
}

.history-action-card .btn.full {
  width: 100%;
  justify-content: center;
  text-align: center;
  white-space: normal;
}

.nav a[aria-current="page"] {
  color: #1d4ed8;
  font-weight: 950;
}


/* 从历史记录打开报告时，只显示分析结果区域 */
.report-view-mode .dashboard-hero,
.report-view-mode #usageGrid,
.report-view-mode #uploadPanel {
  display: none !important;
}

.report-view-mode .dashboard {
  padding-top: 36px;
}

.report-view-mode #resultPanel {
  margin-top: 0;
}


/* 顶部导航当前页面高亮 */
.nav a[aria-current="page"] {
  color: #1d4ed8;
  font-weight: 950;
  background: #eff6ff;
  border-color: #bfdbfe;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}


/* 独立套餐定价页面 */
.pricing-page {
  padding-top: 36px;
}

.pricing-page #pricing {
  padding-top: 72px;
}

.pricing-page .section-heading {
  max-width: 820px;
}


/* 通知中心与个人中心 */
.center-page {
  padding-top: 36px;
}

.center-hero {
  align-items: stretch;
}

.notification-list {
  display: grid;
  gap: 14px;
}

.notification-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fafc;
  padding: 18px;
}

.notification-card strong {
  display: block;
  color: #0f172a;
  margin-bottom: 6px;
}

.notification-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.notification-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.notification-warning {
  border-color: #fed7aa;
  background: #fff7ed;
}

.notification-info {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 18px;
}

.profile-panel:last-child {
  grid-column: 1 / -1;
}

.profile-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.profile-list div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.profile-list dt {
  color: var(--muted);
  font-weight: 800;
}

.profile-list dd {
  margin: 0;
  color: #0f172a;
  font-weight: 950;
}


.profile-plan-meta {
  display: grid;
  gap: 8px;
  margin: 12px 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.profile-plan-meta span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.profile-plan-meta b {
  color: #0f172a;
  font-weight: 900;
  text-align: right;
}

.profile-usage-grid {
  display: grid;
  gap: 12px;
}

.profile-usage-grid div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
}

.profile-usage-grid span {
  color: var(--muted);
  font-weight: 800;
}

.profile-usage-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  color: #0f172a;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 900px) {
  .notification-card {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }
}


/* 官方通知区 */
.official-notice-panel {
  border-color: #bfdbfe;
}

.official-notice-list {
  display: grid;
  gap: 14px;
}

.official-notice-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 18px;
  background: #eff6ff;
  padding: 18px;
}

.official-notice-card strong {
  display: block;
  color: #0f172a;
  margin: 8px 0 6px;
  font-size: 18px;
}

.official-notice-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.official-notice-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 950;
}

.official-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.official-warning {
  border-color: #fed7aa;
  background: #fff7ed;
}

.official-danger {
  border-color: #fecaca;
  background: #fff1f2;
}

@media (max-width: 900px) {
  .official-notice-card {
    align-items: stretch;
    flex-direction: column;
  }
}


/* 通知中心分栏按钮与未读红点 */
.notice-tabs-panel {
  padding: 0;
  overflow: hidden;
}

.notice-tabs-header {
  display: grid;
  gap: 12px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.8);
}

.notice-tab-buttons {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
}

.notice-tab {
  position: relative;
  border: 1px solid #dbeafe;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 950;
  cursor: pointer;
}

.notice-tab.active {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.notice-tab-panel {
  padding: 24px;
}

.notice-badge,
.nav-notice-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 0 0 3px #fff;
}

.notice-badge {
  position: absolute;
  top: -8px;
  right: -6px;
}

.nav a[data-nav-notifications] {
  position: relative;
}

.nav-notice-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  font-size: 11px;
}

.hidden.notice-badge,
.hidden.nav-notice-badge {
  display: none;
}


/* 法律与说明页面返回按钮 */
.legal-back-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 22px;
}

.legal-back-row-standalone {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.legal-back-btn {
  width: auto;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 950;
}

@media (max-width: 720px) {
  .legal-back-row {
    margin-bottom: 18px;
  }

  .legal-back-btn {
    width: 100%;
    justify-content: center;
  }
}


/* 返回按钮作为链接时保持按钮手感 */
.legal-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* 导出文件排序与风险高亮控制 */
.export-format-picker {
  position: relative;
  display: inline-flex;
  z-index: 20;
}

.export-format-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 240px;
  justify-content: flex-start;
}

.export-format-btn strong {
  font-weight: 900;
  color: #0f172a;
}

.export-format-caret {
  margin-left: auto;
  transition: transform 0.18s ease;
}

.export-format-btn[aria-expanded="true"] .export-format-caret {
  transform: rotate(180deg);
}

.export-format-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 250px;
  padding: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.export-format-option {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.export-format-option:hover,
.export-format-option.active {
  background: #e2e8f0;
}

.export-format-option.active {
  color: #1d4ed8;
}

@media (max-width: 720px) {
  .export-format-picker,
  .export-format-btn {
    width: 100%;
  }

  .export-format-menu {
    width: 100%;
    min-width: 0;
  }
}


/* Restore patch: client follow-up contact actions */
.client-contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 22px;
  align-items: stretch;
  margin: 22px 0 28px;
  padding: 24px;
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 24px;
  background: #eff6ff;
}

.client-contact-panel.hidden,
.client-contact-card.hidden {
  display: none !important;
}

.client-contact-copy h3 {
  margin: 0 0 8px;
  font-size: 22px;
  color: #0f172a;
}

.client-contact-copy p {
  margin: 0;
  color: #64748b;
  line-height: 1.7;
  font-weight: 700;
}

.client-contact-actions {
  display: grid;
  gap: 12px;
}

.client-contact-card {
  padding: 18px 20px;
  border: 1px solid rgba(147, 197, 253, 0.7);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.client-contact-card span {
  display: block;
  color: #64748b;
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 8px;
}

.client-contact-card strong {
  display: block;
  color: #0f172a;
  font-size: 18px;
  overflow-wrap: anywhere;
  margin-bottom: 14px;
}

.client-contact-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.client-contact-hint {
  margin: 12px 0 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.client-contact-hint.hidden {
  display: none !important;
}

/* Restore patch: right-bottom duplicate copy buttons should not reappear from cached HTML. */
.copy-output-btn-bottom {
  display: none !important;
}

@media (max-width: 860px) {
  .client-contact-panel {
    grid-template-columns: 1fr;
  }
}

.logout-confirm-card {
  width: min(380px, 100%);
  text-align: center;
}

.logout-confirm-card h3 {
  margin: 4px 0 22px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.logout-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.logout-confirm-actions .btn {
  min-width: 108px;
}

/* 多文件上传：可追加选择、单个移除、全部移除 */
.file-drop-selected {
  width: min(720px, 100%);
  display: block;
  text-align: left;
}

.file-drop-selected-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.file-drop-selected-text {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.file-drop-file-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}

.file-drop-file-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #f8fbff;
}

.file-drop-file-icon {
  width: 46px;
  height: 52px;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.file-drop-file-svg {
  width: 46px;
  height: 52px;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.08));
}

.file-icon-page {
  fill: #ffffff;
  stroke: #dbeafe;
  stroke-width: 1.5;
}

.file-icon-fold {
  fill: #dbeafe;
}

.file-icon-band {
  fill: transparent;
}

.file-drop-file-glyph {
  position: absolute;
  left: 50%;
  top: 37px;
  transform: translate(-50%, -50%);
  min-width: 42px;
  width: auto;
  height: 18px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #2563eb;
  color: #ffffff !important;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1;
  text-shadow: none;
  pointer-events: none;
  z-index: 2;
}

.file-drop-file-icon-excel .file-icon-page {
  stroke: #bbf7d0;
}

.file-drop-file-icon-excel .file-icon-fold {
  fill: #dcfce7;
}

.file-drop-file-icon-excel .file-drop-file-glyph {
  background: #1d4ed8;
  box-shadow: 0 3px 8px rgba(29, 78, 216, 0.22);
}

.file-drop-file-icon-csv .file-icon-page {
  stroke: #bfdbfe;
}

.file-drop-file-icon-csv .file-icon-fold {
  fill: #dbeafe;
}

.file-drop-file-icon-csv .file-drop-file-glyph {
  background: #1d4ed8;
  box-shadow: 0 3px 8px rgba(29, 78, 216, 0.22);
}

.file-drop-file-icon-file .file-icon-page {
  stroke: #e2e8f0;
}

.file-drop-file-icon-file .file-icon-fold {
  fill: #f1f5f9;
}

.file-drop-file-icon-file .file-drop-file-glyph {
  background: #475569;
  box-shadow: 0 3px 8px rgba(71, 85, 105, 0.22);
}

.file-drop-file-info {
  min-width: 0;
}

.file-drop-file-info strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.file-drop-file-info small {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-weight: 600;
}

.btn-mini {
  padding: 7px 10px;
  font-size: 13px;
  border-radius: 999px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .file-drop-selected-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .file-drop-file-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .file-drop-file-item .btn-mini {
    grid-column: 1 / -1;
    justify-self: end;
  }
}


/* Restore: static amount cards allow embedded help buttons without nested button markup. */
.overview-card-static { cursor: default; }
.overview-card-static:hover { border-color: var(--line); box-shadow: none; transform: none; }


/* BEGIN LEDGERCHASE_EXPORT_FORMAT_AND_AMOUNT_HELP_FIX_V6_CSS */
.overview-label-with-help {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.lc-amount-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1.6px solid #2563eb;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}

.lc-amount-help-btn:hover {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #1d4ed8;
}

.lc-amount-help-btn:focus {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

.lc-amount-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
}

.lc-amount-help-modal {
  width: min(580px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.28);
}

.lc-amount-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px 8px;
}

.lc-amount-help-title {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.35;
}

.lc-amount-help-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.lc-amount-help-close:hover {
  background: #e2e8f0;
}

.lc-amount-help-body {
  padding: 4px 22px 22px;
  color: #334155;
  font-size: 15px;
  line-height: 1.75;
}

.lc-amount-help-body p {
  margin: 10px 0;
}

.lc-amount-help-highlight {
  margin-top: 12px !important;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 750;
}

@media (max-width: 640px) {
  .lc-amount-help-modal {
    width: min(100%, calc(100vw - 28px));
    border-radius: 16px;
  }

  .lc-amount-help-head,
  .lc-amount-help-body {
    padding-left: 18px;
    padding-right: 18px;
  }
}
/* END LEDGERCHASE_EXPORT_FORMAT_AND_AMOUNT_HELP_FIX_V6_CSS */


/* quota-cycle-upgrade-1: pricing current plan, half-off and top-up states */
.price-card.current-plan-card {
  border-color: rgba(37, 99, 235, 0.75);
  box-shadow: 0 22px 60px rgba(37, 99, 235, 0.16);
}

.current-plan-marker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 900;
}

.current-plan-marker[hidden],
.topup-btn.hidden,
.topup-note.hidden {
  display: none !important;
}

.first-half-badge {
  display: inline-flex;
  width: fit-content;
  margin: 8px 0 4px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.1);
  color: #be123c;
  font-size: 12px;
  font-weight: 900;
}

.current-plan-button,
.current-plan-button:disabled {
  cursor: not-allowed;
  opacity: 0.88;
  background: #e0ecff !important;
  color: #1d4ed8 !important;
  border-color: rgba(37, 99, 235, 0.28) !important;
}

.topup-btn {
  margin-top: 12px;
}

.topup-note {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: #64748b;
}

/* 个人中心：套餐切换后的原套餐权益展示 */
.profile-retained-entitlements {
  display: grid;
  gap: 10px;
  margin: 6px 0 16px;
}

.profile-retained-entitlements.hidden {
  display: none !important;
}

.retained-entitlement-heading {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
}

.retained-entitlement-heading span {
  color: #1e3a8a;
  font-weight: 950;
}

.retained-entitlement-heading small {
  color: #475569;
  line-height: 1.45;
}

.retained-entitlement-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #bbf7d0;
  border-radius: 16px;
  background: #f0fdf4;
}

.retained-entitlement-card strong {
  color: #166534;
  font-size: 14px;
}

.retained-entitlement-card p {
  margin: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.6;
}

.retained-entitlement-card dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.retained-entitlement-card dl div {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
}

.retained-entitlement-card dt {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.retained-entitlement-card dd {
  margin: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
}

/* ============================================================
   Team workbench v3: polished dashboard + tabbed workflow
   ============================================================ */
.team-page {
  background: #f8fafc;
}

.team-page .site-header {
  background: rgba(248, 250, 252, 0.98);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.team-page .dashboard,
.team-workbench {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.team-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 20px;
  overflow: hidden;
  position: relative;
}

.team-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  pointer-events: none;
}

.team-hero h1 {
  margin: 8px 0 10px;
  max-width: 760px;
}

.team-hero p {
  max-width: 760px;
  color: var(--muted, #64748b);
}

.team-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.team-role-card {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  padding: 20px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.team-role-card span,
.team-kpi-card span {
  display: block;
  color: var(--muted, #64748b);
  font-size: 0.86rem;
  margin-bottom: 8px;
}

.team-role-card strong {
  display: block;
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.team-role-card p {
  font-size: 0.9rem;
  margin: 0;
}

.team-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.team-kpi-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.team-kpi-card:hover,
.team-kpi-card:focus {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.1);
  outline: none;
}

.team-kpi-card strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
  color: #0f172a;
}

.team-kpi-card small {
  display: block;
  color: var(--muted, #64748b);
  margin-top: 8px;
}

.team-kpi-card.danger strong {
  color: #b91c1c;
}

.team-command-center {
  padding: 0;
  overflow: hidden;
}

.team-tabs {
  display: flex;
  gap: 4px;
  padding: 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  overflow-x: auto;
}

.team-tab {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: transparent;
  color: #475569;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.team-tab:hover {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.team-tab.active {
  background: #0f172a;
  color: #fff;
}

.team-tab-panel {
  display: none;
  padding: 24px;
}

.team-tab-panel.active {
  display: block;
}

.team-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.team-section-heading h2 {
  margin: 0 0 6px;
}

.team-section-heading p,
.muted {
  color: var(--muted, #64748b);
  margin: 0;
}

.team-filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.team-filter-row input,
.team-filter-row select,
.team-form-inline input,
.team-form-inline select,
.assignment-grid select,
.review-grid select,
.task-actions select,
.member-card select,
.team-form-stack input,
.team-form-stack select,
.client-card textarea,
.review-card textarea {
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  font: inherit;
}

.team-filter-row input {
  min-width: 240px;
}

.team-overview-grid,
.member-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.member-layout {
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
}

.team-mini-panel {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.team-mini-panel h3 {
  margin: 0 0 12px;
}

.compact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compact-item {
  display: flex;
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px;
  text-align: left;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.compact-item:hover {
  border-color: rgba(37, 99, 235, 0.24);
  background: #eff6ff;
}

.compact-item span {
  color: var(--muted, #64748b);
  font-size: 0.88rem;
}

.client-board,
.task-board,
.review-board {
  display: grid;
  gap: 16px;
}

.client-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-card,
.task-card,
.review-card,
.member-card,
.audit-row {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.client-card-head,
.review-main {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.client-card h3,
.task-card h3,
.review-card h3 {
  margin: 8px 0 6px;
}

.client-card p,
.task-card p,
.review-card p,
.audit-row p {
  color: var(--muted, #64748b);
  margin: 0;
}

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

.client-metrics span {
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px;
  color: #475569;
}

.client-metrics strong {
  color: #0f172a;
}

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

.assignment-grid label,
.review-grid label,
.team-form-stack label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 700;
}

.client-card textarea,
.review-card textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  margin-bottom: 12px;
}

.client-actions,
.review-actions,
.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.client-card-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
  color: var(--muted, #64748b);
  font-size: 0.9rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.82rem;
  font-weight: 800;
}

.priority-urgent {
  background: #fef2f2;
  color: #b91c1c;
}

.priority-high {
  background: #fff7ed;
  color: #c2410c;
}

.priority-normal {
  background: #eff6ff;
  color: #1d4ed8;
}

.priority-low {
  background: #f0fdf4;
  color: #15803d;
}

.review-approved,
.review-client_replied {
  background: #f0fdf4;
  color: #15803d;
}

.review-needs_changes,
.review-rejected {
  background: #fef2f2;
  color: #b91c1c;
}

.review-sent,
.review-in_review {
  background: #fff7ed;
  color: #c2410c;
}

.team-form-inline {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px 140px 160px auto;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr) auto;
  gap: 16px;
  align-items: center;
}

.task-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted, #64748b);
  font-size: 0.9rem;
}

.task-actions {
  justify-content: flex-end;
}

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

.member-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 140px 120px auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
}

.member-card strong,
.member-card span {
  display: block;
}

.member-card span {
  color: var(--muted, #64748b);
  font-size: 0.9rem;
}

.team-form-stack {
  display: grid;
  gap: 12px;
}

.invite-result {
  margin-top: 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 12px;
  overflow-x: auto;
}

.invite-result code {
  display: block;
  margin: 8px 0;
  color: #0f172a;
  white-space: nowrap;
}

.invitation-history-panel {
  margin-top: 16px;
}

.audit-disclosure {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
}

.audit-disclosure summary {
  cursor: pointer;
  font-weight: 800;
  margin-bottom: 12px;
}

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

.audit-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px;
}

.audit-row span {
  display: block;
  color: var(--muted, #64748b);
  font-size: 0.88rem;
  margin-top: 4px;
}

.team-pagination {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  gap: 14px;
  align-items: center;
  color: var(--muted, #64748b);
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: #f8fafc;
}

.team-pagination:empty {
  display: none;
}

.audit-disclosure .team-pagination {
  margin: 16px 0 0;
}

.team-pagination-summary {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.team-pagination-controls,
.team-pagination-pages,
.team-page-size {
  display: flex;
  align-items: center;
}

.team-pagination-controls {
  justify-content: center;
  gap: 8px;
}

.team-pagination-pages {
  gap: 6px;
}

.team-page-number {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-weight: 800;
}

.team-page-number:hover {
  border-color: rgba(37, 99, 235, 0.34);
  color: #1d4ed8;
}

.team-page-number.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.team-page-ellipsis {
  min-width: 18px;
  text-align: center;
}

.team-page-size {
  justify-self: end;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.team-page-size select {
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 10px;
  padding: 8px 30px 8px 10px;
  background: #fff;
  color: #0f172a;
}

.team-empty {
  border: 1px dashed rgba(15, 23, 42, 0.16);
  background: #f8fafc;
  border-radius: 16px;
  padding: 18px;
  color: #475569;
}

.team-empty strong {
  color: #0f172a;
}

.team-empty p {
  margin: 6px 0 0;
  color: var(--muted, #64748b);
}

.team-toast {
  margin: 16px 24px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid rgba(4, 120, 87, 0.2);
  font-weight: 700;
}

.team-toast.error {
  background: #fef2f2;
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.2);
}

.disabled-block {
  opacity: 0.58;
}

/* Team workbench v4 performance and rendering controls */
.team-command-center {
  contain: layout style;
}

.team-tab-panel.active {
  contain: layout style;
}

.client-card,
.task-card,
.review-card,
.member-card,
.audit-row,
.team-mini-panel {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.045);
}

.client-board.is-loading,
.task-board.is-loading,
.review-board.is-loading {
  opacity: 0.62;
  pointer-events: none;
}

.team-loading-state {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed rgba(37, 99, 235, 0.2);
  border-radius: 16px;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
}

.team-loading-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #2563eb;
  animation: team-loading-pulse 0.9s ease-in-out infinite alternate;
}

@keyframes team-loading-pulse {
  from { opacity: 0.35; transform: scale(0.82); }
  to { opacity: 1; transform: scale(1); }
}

@supports (content-visibility: auto) {
  .client-card,
  .task-card,
  .review-card,
  .member-card,
  .audit-row {
    content-visibility: auto;
    contain-intrinsic-size: 320px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-loading-dot {
    animation: none;
  }
}

/* Client material portal */
.client-portal-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #eff6ff, #f8fafc 48%, #ecfdf5);
  margin: 0;
}

.client-portal-shell {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.client-portal-card {
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.14);
  padding: 32px;
}

.client-portal-card h1 {
  margin: 10px 0 12px;
}

.client-portal-card p {
  color: var(--muted, #64748b);
}

.portal-missing-list {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.portal-missing-item {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: #f8fafc;
  padding: 14px;
}

.portal-missing-item strong,
.portal-missing-item span {
  display: block;
}

.portal-missing-item span {
  color: var(--muted, #64748b);
  margin-top: 4px;
  font-size: 0.9rem;
}

.portal-missing-item p {
  margin: 8px 0 0;
}

.client-portal-form {
  display: grid;
  gap: 14px;
}

.client-portal-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #475569;
  font-weight: 800;
}

.client-portal-form input,
.client-portal-form textarea {
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
}

@media (max-width: 1080px) {
  .team-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .client-board,
  .team-overview-grid,
  .member-layout {
    grid-template-columns: 1fr;
  }
  .task-card,
  .team-form-inline {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .team-workbench {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }
  .team-hero {
    grid-template-columns: 1fr;
  }
  .team-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .team-tab-panel {
    padding: 16px;
  }
  .team-section-heading,
  .client-card-head,
  .review-main,
  .audit-row {
    flex-direction: column;
  }
  .assignment-grid,
  .review-grid,
  .client-metrics,
  .member-card {
    grid-template-columns: 1fr;
  }
  .team-filter-row input {
    min-width: 0;
    width: 100%;
  }
  .team-pagination {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 10px;
  }
  .team-pagination-summary {
    text-align: center;
  }
  .team-pagination-controls {
    flex-wrap: wrap;
  }
  .team-pagination-pages {
    order: 3;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  .team-page-size {
    justify-self: center;
  }
}

/* LEDGERCHASE_MULTI_CLIENT_MODE_B_PATCH_V5 */
.upload-mode-card {
  border: 1px solid rgba(78, 102, 255, 0.16);
  border-radius: 24px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(236, 241, 255, 0.92), rgba(255, 255, 255, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.upload-mode-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.upload-mode-header strong {
  color: #0f1b35;
  font-size: 1rem;
}

.upload-mode-header p,
.upload-mode-description {
  margin: 4px 0 0;
  color: #66738d;
  font-size: 0.92rem;
  line-height: 1.55;
}

.upload-mode-switch {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(78, 102, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  flex-shrink: 0;
}

.upload-mode-option {
  border: 0;
  border-radius: 14px;
  padding: 10px 16px;
  background: transparent;
  color: #526078;
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.upload-mode-option span {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  opacity: 0.78;
}

.upload-mode-option strong {
  display: block;
  margin-top: 2px;
  color: inherit;
  font-size: 0.95rem;
}

.upload-mode-option:hover {
  transform: translateY(-1px);
}

.upload-mode-option.active {
  background: #245cf4;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(36, 92, 244, 0.24);
}

.upload-mode-description {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(78, 102, 255, 0.12);
}

.multi-client-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.multi-client-stat-card,
.multi-client-card {
  border: 1px solid #e6ebf5;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 27, 53, 0.06);
}

.multi-client-stat-card {
  padding: 16px;
}

.multi-client-stat-card span,
.multi-client-stat-card small,
.multi-client-card-kicker,
.multi-client-muted {
  color: #6b7890;
  font-size: 0.86rem;
}

.multi-client-stat-card strong {
  display: block;
  margin-top: 5px;
  color: #0f1b35;
  font-size: 1.55rem;
}

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

.multi-client-card {
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.multi-client-card.needs-followup::before,
.multi-client-card.clean::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #f6a700;
}

.multi-client-card.clean::before {
  background: #1fbf75;
}

.multi-client-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.multi-client-card h3 {
  margin: 4px 0 0;
  color: #0f1b35;
  font-size: 1.08rem;
}

.multi-client-status {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.multi-client-status.needs-followup {
  background: #fff5d9;
  color: #916300;
}

.multi-client-status.clean {
  background: #e8f9f0;
  color: #087344;
}

.multi-client-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.multi-client-card-metrics span {
  padding: 10px;
  border-radius: 14px;
  background: #f7f9fc;
  color: #66738d;
  font-size: 0.85rem;
}

.multi-client-card-metrics strong {
  display: block;
  color: #0f1b35;
  font-size: 1.05rem;
}

.multi-client-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.multi-client-warning {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #ffe2a8;
  border-radius: 16px;
  background: #fff8e8;
  color: #7a5300;
}

.multi-client-warning p {
  margin: 0;
}

@media (max-width: 860px) {
  .upload-mode-header {
    flex-direction: column;
  }

  .upload-mode-switch,
  .upload-mode-option {
    width: 100%;
  }

  .multi-client-stats,
  .multi-client-card-grid {
    grid-template-columns: 1fr;
  }
}
/* END LEDGERCHASE_MULTI_CLIENT_MODE_B_PATCH_V5 */

/* Report footer actions: hide the history return button on the feature page,
   but keep it visible when a report is opened from the History page. */
.history-return-link {
  display: none !important;
}

.report-view-mode .history-return-link {
  display: inline-flex !important;
}

/* The source-aware report navigator owns the hidden state. Keep the native
   hidden contract stronger than legacy report-mode display rules. */
html body .history-return-link[hidden] {
  display: none !important;
}


/* BEGIN LEDGERCHASE_MODE_B_COMPOSITE_HISTORY_V8 */
body.mode-b-history-view .dashboard > .dashboard-hero,
body.mode-b-history-view .dashboard > .usage-grid,
body.mode-b-history-view #uploadPanel {
  display: none !important;
}

body.mode-b-history-view .dashboard {
  padding-top: 32px;
}

body.mode-b-history-view #multiClientBatchPanel {
  display: block;
}

body.mode-b-history-view #multiClientBatchPanel.hidden {
  display: block !important;
}

.history-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.history-mode-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  background: #e8f0ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.history-mode-badge.mode-b {
  background: #eef2ff;
  color: #3730a3;
  border-color: #c7d2fe;
}

.history-mode-badge.mode-a {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

.history-mode-meta {
  color: #475569;
  font-weight: 700;
}

.history-item-card.mode-b {
  border-color: #c7d2fe;
  box-shadow: 0 16px 34px rgba(79, 70, 229, 0.08);
}

body.mode-b-history-view .history-return-link {
  display: inline-flex !important;
}
/* END LEDGERCHASE_MODE_B_COMPOSITE_HISTORY_V8 */

/* BEGIN LEDGERCHASE_CUSTOM_OUTPUT_TEMPLATES_RESTORE_V10_CSS */
.custom-template-panel {
  margin: 16px 0 18px;
  padding: 18px 20px;
  border: 1px solid #dbeafe;
  border-radius: 24px;
  background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  box-shadow: 0 10px 28px rgba(30, 64, 175, 0.08);
}

.custom-template-panel h3 {
  margin: 0 0 6px;
  color: #0f172a;
}

.custom-template-panel p {
  margin: 0;
  color: #64748b;
  line-height: 1.55;
}

.custom-template-panel-actions,
.custom-template-existing-row,
.custom-template-modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.custom-template-panel-actions select,
.custom-template-existing-row select,
.custom-template-part-select {
  min-height: 38px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 0 36px 0 14px;
  background-color: #fff;
  color: #0f172a;
  font-weight: 700;
}

.custom-template-panel-actions select {
  min-width: 220px;
}

.custom-template-part-select {
  max-width: 180px;
  font-size: 13px;
}

.custom-template-modal-card {
  width: min(960px, 96vw);
  max-height: 92vh;
  overflow: auto;
}

.custom-template-modal-head {
  padding-right: 44px;
}

.custom-template-modal-head h3 {
  margin: 0 0 6px;
}

.custom-template-modal-head p {
  margin: 0 0 16px;
  color: #64748b;
  line-height: 1.6;
}

.custom-template-existing-row {
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: #f8fbff;
  margin-bottom: 14px;
}

.custom-template-existing-row select {
  flex: 1 1 260px;
  border-radius: 14px;
}

.custom-template-guide {
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: #fff;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.custom-template-guide summary {
  cursor: pointer;
  font-weight: 900;
  color: #1d4ed8;
}

.custom-template-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin-top: 12px;
}

.custom-template-guide p {
  margin: 0;
  color: #334155;
  line-height: 1.55;
}

.custom-template-guide code {
  border-radius: 6px;
  background: #eff6ff;
  padding: 2px 5px;
  color: #1d4ed8;
  font-weight: 800;
}

.custom-template-variable-line {
  margin-top: 12px !important;
  padding-top: 10px;
  border-top: 1px dashed #bfdbfe;
  font-size: 14px;
}

.custom-template-form {
  display: grid;
  gap: 14px;
}

.custom-template-form label {
  display: grid;
  gap: 6px;
  color: #0f172a;
  font-weight: 900;
}

.custom-template-form label span {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.custom-template-form input,
.custom-template-form textarea {
  width: 100%;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
  color: #0f172a;
}

.custom-template-form textarea {
  resize: vertical;
  line-height: 1.55;
}

@media (max-width: 860px) {
  .custom-template-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .custom-template-panel-actions select,
  .custom-template-panel-actions .btn,
  .custom-template-existing-row select,
  .custom-template-existing-row .btn,
  .custom-template-modal-actions .btn {
    width: 100%;
  }

  .custom-template-guide-grid {
    grid-template-columns: 1fr;
  }

  .custom-template-part-select {
    max-width: none;
    width: 100%;
  }
}
/* END LEDGERCHASE_CUSTOM_OUTPUT_TEMPLATES */


/* BEGIN LEDGERCHASE_CUSTOM_TEMPLATE_SCROLL_FIX */
html.custom-template-scroll-locked,
body.custom-template-scroll-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

body.custom-template-scroll-locked {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}

#customTemplateModal {
  overscroll-behavior: contain;
}

#customTemplateModal.show {
  overflow: hidden;
}

.custom-template-modal-card {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
/* END LEDGERCHASE_CUSTOM_TEMPLATE_SCROLL_FIX */


/* BEGIN LEDGERCHASE_CUSTOM_TEMPLATE_UNDO_STYLES */
.custom-template-undo-btn {
  white-space: nowrap;
}

.output-card-actions .custom-template-undo-btn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.output-card-actions .custom-template-undo-btn:hover {
  background: #ffedd5;
}

.custom-template-panel-actions #undoCustomTemplateSetBtn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}
/* END LEDGERCHASE_CUSTOM_TEMPLATE_UNDO_STYLES */


/* BEGIN LEDGERCHASE_CUSTOM_TEMPLATE_SAVE_FEEDBACK_STYLES */
#saveCustomTemplateBtn {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

#saveCustomTemplateBtn.is-saving {
  opacity: 0.82;
  cursor: wait;
}

#saveCustomTemplateBtn.is-saved {
  background: #16a34a;
  box-shadow: 0 12px 26px rgba(22, 163, 74, 0.28);
  transform: translateY(-1px);
}

#customTemplateMessage.success {
  font-weight: 900;
}
/* END LEDGERCHASE_CUSTOM_TEMPLATE_SAVE_FEEDBACK_STYLES_RESTORE_V10 */

/* Keep custom template controls tidy in the latest dashboard card headers. */
.output-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.output-card-actions .custom-template-part-select {
  flex: 0 1 180px;
}

@media (max-width: 720px) {
  .output-card-actions .custom-template-part-select,
  .output-card-actions .copy-output-btn,
  .output-card-actions .btn {
    width: 100%;
  }
}
/* END LEDGERCHASE_CUSTOM_OUTPUT_TEMPLATES_RESTORE_V10_CSS */


/* 正式版官方通知系统：用户端已读/未读与管理员后台 */
.official-notice-card {
  position: relative;
}

.official-notice-card.official-unread {
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.08);
}

.official-unread-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 8px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
  vertical-align: middle;
}

.official-notice-meta {
  display: block;
  margin-top: 10px;
  color: #64748b;
  font-weight: 800;
}

.admin-notices-page {
  padding-top: 36px;
}

.admin-notices-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}

.admin-notice-form,
.admin-notice-list-panel {
  display: grid;
  gap: 16px;
}

.admin-notice-form label {
  display: grid;
  gap: 8px;
  color: #0f172a;
  font-weight: 900;
}

.admin-notice-form input,
.admin-notice-form select,
.admin-notice-form textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 12px 14px;
  color: #0f172a;
  background: #ffffff;
  font: inherit;
  outline: none;
}

.admin-notice-form textarea {
  resize: vertical;
  min-height: 150px;
}

.admin-notice-form input:focus,
.admin-notice-form select:focus,
.admin-notice-form textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

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

.admin-notice-toggle {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #eff6ff;
}

.admin-notice-toggle input {
  width: auto;
}

.admin-notice-list {
  display: grid;
  gap: 14px;
}

.admin-notice-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 18px;
  border: 1px solid #bfdbfe;
  border-radius: 18px;
  background: #eff6ff;
}

.admin-notice-card.is-inactive {
  border-color: #e2e8f0;
  background: #f8fafc;
  opacity: 0.86;
}

.admin-notice-card h3 {
  margin: 10px 0 8px;
  color: #0f172a;
  font-size: 18px;
}

.admin-notice-card p {
  margin: 0 0 10px;
  color: #475569;
  line-height: 1.65;
  white-space: pre-wrap;
}

.admin-notice-card small {
  display: block;
  color: #64748b;
  line-height: 1.6;
}

.admin-notice-card a {
  display: inline-flex;
  margin-top: 10px;
  color: #1d4ed8;
  font-weight: 900;
}

.admin-notice-card-top,
.admin-notice-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-notice-card-actions {
  align-content: flex-start;
  justify-content: flex-end;
}

.admin-notice-status,
.admin-notice-audience {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 950;
}

.admin-notice-status.active {
  color: #166534;
  background: #dcfce7;
}

.admin-notice-status.inactive {
  color: #64748b;
  background: #e2e8f0;
}

.admin-notice-audience {
  color: #334155;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.btn.danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff1f2;
}

@media (max-width: 980px) {
  .admin-notices-layout {
    grid-template-columns: 1fr;
  }

  .admin-notice-card {
    grid-template-columns: 1fr;
  }

  .admin-notice-card-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .admin-notice-form-grid {
    grid-template-columns: 1fr;
  }
}


/* Strict permission gate for the official notice admin page. */
.admin-notices-access-panel,
.admin-notices-access-panel * {
  box-sizing: border-box;
}

.admin-notices-access-panel {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(560px, calc(100vw - 40px));
  max-width: 100%;
  margin: 28px auto 36px;
  padding: 32px;
  border: 1px solid #dbeafe;
  border-radius: 28px;
  background:
    radial-gradient(circle at 16% 12%, rgba(37, 99, 235, 0.10), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 58%, #eef5ff 100%);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.10);
  overflow: hidden;
}

.admin-notices-access-panel::before {
  content: "🔒";
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 2px;
  border: 1px solid #bfdbfe;
  border-radius: 18px;
  background: #eff6ff;
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.12);
  font-size: 23px;
}

.admin-notices-access-panel .eyebrow {
  color: #2563eb;
}

.admin-notices-access-panel h2 {
  max-width: 100%;
  margin: 0;
  color: #0f172a;
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.admin-notices-access-panel p {
  max-width: 100%;
  margin: 0;
  color: #475569;
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: break-word;
}

.admin-notices-access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  max-width: 100%;
}

.admin-notices-access-actions .btn {
  width: auto;
  max-width: 100%;
  min-width: 0;
  justify-content: center;
  white-space: normal;
  text-align: center;
}

.admin-notices-body:not(.admin-notices-verified) .admin-notices-layout {
  display: none;
}

.admin-notices-body.admin-notices-verified .admin-notices-access-panel {
  display: none;
}

.admin-notices-body.admin-notices-denied .admin-notices-access-panel {
  border-color: #dbeafe;
  background:
    radial-gradient(circle at 16% 12%, rgba(37, 99, 235, 0.10), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 58%, #eef5ff 100%);
}

.admin-notices-body.admin-notices-denied .notice-admin-summary-card,
.admin-notices-body.admin-notices-denied .history-action-card {
  border-color: #dbeafe;
  background: #ffffff;
}

.admin-notices-body.admin-notices-denied #adminNoticeStatus {
  color: #475569;
}

@media (max-width: 720px) {
  .admin-notices-access-panel {
    width: min(100%, calc(100vw - 28px));
    margin: 18px auto 24px;
    padding: 24px 20px;
    border-radius: 24px;
  }

  .admin-notices-access-actions,
  .admin-notices-access-actions .btn {
    width: 100%;
  }
}



/* BEGIN OFFICIAL_NOTICE_CMS_V1 */
.admin-notices-hero {
  align-items: stretch;
}

.admin-notices-hero > * {
  min-width: 0;
}

.admin-notices-hero .history-action-card,
#adminNoticeStatus {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-notices-layout {
  grid-template-columns: minmax(420px, 1fr) minmax(520px, 1.25fr);
}

.admin-rich-editor-fieldset {
  display: grid;
  gap: 0;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.admin-rich-editor-fieldset legend {
  width: 100%;
  padding: 0 0 8px;
  color: #0f172a;
  font-weight: 900;
}

.admin-rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.admin-rich-toolbar button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  color: #0f172a;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.admin-rich-toolbar button:hover,
.admin-rich-toolbar button:focus-visible {
  border-color: #2563eb;
  color: #1d4ed8;
}

.admin-rich-editor {
  min-height: 250px;
  max-height: 560px;
  padding: 16px;
  overflow: auto;
  color: #0f172a;
  line-height: 1.7;
  outline: none;
}

.admin-rich-editor:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}

.admin-rich-editor:focus {
  box-shadow: inset 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.admin-rich-editor img,
.official-notice-richtext img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 14px 0;
  border-radius: 14px;
}

.admin-rich-editor blockquote,
.official-notice-richtext blockquote {
  margin: 14px 0;
  padding: 10px 14px;
  border-left: 4px solid #60a5fa;
  background: rgba(239, 246, 255, 0.8);
  color: #334155;
}

.admin-rich-editor pre,
.official-notice-richtext pre {
  max-width: 100%;
  padding: 12px;
  overflow-x: auto;
  border-radius: 10px;
  background: #0f172a;
  color: #f8fafc;
}

.admin-rich-editor a,
.official-notice-richtext a {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.admin-rich-editor ul,
.admin-rich-editor ol,
.official-notice-richtext ul,
.official-notice-richtext ol {
  padding-left: 1.5rem;
}

.admin-rich-editor h2,
.admin-rich-editor h3,
.official-notice-richtext h2,
.official-notice-richtext h3 {
  margin: 18px 0 8px;
  color: #0f172a;
  line-height: 1.25;
}

.admin-notice-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.admin-upload-hint {
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.admin-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 9px 7px 12px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
}

.admin-attachment-chip a {
  min-width: 0;
  max-width: 310px;
  overflow: hidden;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-attachment-chip button {
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e3a8a;
  cursor: pointer;
}

.admin-notice-form-grid label small {
  color: #64748b;
  font-weight: 600;
  line-height: 1.45;
}

.admin-notice-form-actions {
  flex-wrap: wrap;
}

.admin-notice-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #f8fafc;
}

.admin-notice-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.admin-notice-filters label > span {
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.admin-notice-filters input,
.admin-notice-filters select {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  background: #fff;
  font: inherit;
}

.admin-notice-search-field {
  grid-column: span 2;
}

.admin-notice-filter-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.admin-notice-list-summary {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  font-weight: 750;
}

.admin-notice-card {
  min-width: 0;
}

.admin-notice-card.status-draft {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.admin-notice-card.status-archived {
  border-color: #e2e8f0;
  background: #f1f5f9;
  opacity: 0.82;
}

.admin-notice-richtext {
  max-height: 300px;
  margin: 8px 0 12px;
  overflow: auto;
  color: #475569;
  line-height: 1.65;
}

.admin-notice-richtext > :first-child,
.official-notice-richtext > :first-child {
  margin-top: 0;
}

.admin-notice-richtext > :last-child,
.official-notice-richtext > :last-child {
  margin-bottom: 0;
}

.admin-empty-notice-body {
  color: #94a3b8;
  font-style: italic;
}

.admin-notice-pinned,
.official-notice-pinned-badge,
.admin-notice-priority,
.admin-notice-timing,
.admin-notice-attachment-count {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 900;
}

.admin-notice-pinned,
.official-notice-pinned-badge {
  color: #7c2d12;
  background: #ffedd5;
}

.admin-notice-priority {
  color: #475569;
  background: #e2e8f0;
}

.admin-notice-priority.priority-50 {
  color: #92400e;
  background: #fef3c7;
}

.admin-notice-priority.priority-100 {
  color: #991b1b;
  background: #fee2e2;
}

.admin-notice-timing {
  color: #075985;
  background: #e0f2fe;
}

.admin-notice-status.draft {
  color: #475569;
  background: #e2e8f0;
}

.admin-notice-status.published {
  color: #166534;
  background: #dcfce7;
}

.admin-notice-status.archived {
  color: #5b21b6;
  background: #ede9fe;
}

.admin-notice-attachment-count {
  margin-top: 10px;
  color: #334155;
  background: #e2e8f0;
}

.admin-notice-preview-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(840px, calc(100vh - 32px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  box-shadow: 0 32px 90px rgba(15, 23, 42, 0.28);
}

.admin-notice-preview-dialog::backdrop {
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
}

.admin-notice-preview-shell {
  display: grid;
  gap: 18px;
  padding: 24px;
  background: #fff;
}

.official-notice-preview-main,
.official-notice-card > div:first-child {
  min-width: 0;
}

.official-notice-preview-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.official-notice-richtext {
  min-width: 0;
  color: #475569;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.official-notice-richtext p {
  margin: 0 0 10px;
  white-space: normal;
}

.official-notice-richtext strong {
  display: inline;
  margin: 0;
  font-size: inherit;
  letter-spacing: inherit;
}

.admin-notice-richtext a {
  display: inline;
  margin-top: 0;
  font-weight: inherit;
}

.official-notice-richtext iframe,
.official-notice-richtext script,
.official-notice-richtext style {
  display: none !important;
}

@media (max-width: 1180px) {
  .admin-notices-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .admin-notice-filters {
    grid-template-columns: 1fr;
  }

  .admin-notice-search-field {
    grid-column: auto;
  }

  .admin-notice-filter-actions,
  .admin-notice-filter-actions .btn {
    width: 100%;
  }

  .admin-notice-preview-shell {
    padding: 18px;
  }
}
/* END OFFICIAL_NOTICE_CMS_V1 */

/* Official notice operations, governance and delivery channels */
.admin-notice-ops-fieldset,.admin-targeting-panel{border:1px solid #dbeafe;border-radius:16px;padding:14px;background:#f8fbff}.admin-channel-grid{display:flex;flex-wrap:wrap;gap:12px}.admin-channel-grid label{display:flex!important;grid-template-columns:none!important;align-items:center;gap:6px}.admin-channel-grid input{width:auto}.admin-ops-dashboard{margin-top:20px;display:grid;gap:16px}.admin-batch-bar{display:flex;flex-wrap:wrap;align-items:center;gap:9px}.admin-stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.admin-stat-grid strong,.admin-version-row,.admin-audit-row{padding:12px;border:1px solid #e2e8f0;border-radius:12px;background:#fff}.admin-version-row,.admin-audit-row{display:flex;justify-content:space-between;gap:12px;align-items:center}.admin-audit-list{display:grid;gap:8px;max-height:420px;overflow:auto}.admin-card-select{display:inline-flex!important;grid-template-columns:none!important;align-items:center;gap:5px;font-size:12px}.admin-card-select input{width:auto}.official-global-banner{position:sticky;top:0;z-index:10000;display:flex;justify-content:center;align-items:center;gap:16px;padding:12px 20px;background:#eff6ff;border-bottom:1px solid #bfdbfe}.official-global-banner>div{display:flex;flex-wrap:wrap;gap:8px}.official-global-banner button{border:0;background:transparent;font-weight:900;cursor:pointer}.official-global-popup{position:fixed;inset:0;z-index:10001;display:grid;place-items:center;padding:20px;background:rgba(15,23,42,.48)}.official-global-popup-card{position:relative;width:min(620px,100%);max-height:85vh;overflow:auto;padding:26px;border-radius:22px;background:#fff;box-shadow:0 30px 90px rgba(15,23,42,.3)}.official-global-popup-card>strong{display:block;font-size:24px;margin-bottom:14px}.official-popup-close{position:absolute;right:12px;top:10px;border:0;background:transparent;font-size:24px;cursor:pointer}@media(max-width:720px){.admin-stat-grid{grid-template-columns:1fr}.admin-version-row,.admin-audit-row{align-items:flex-start;flex-direction:column}.official-global-banner{align-items:flex-start;flex-direction:column}}

/* BEGIN OFFICIAL_NOTICE_ADMIN_UI_V3 */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.admin-notices-page {
  width: min(1600px, calc(100% - 40px));
  padding-top: 28px;
}

.admin-notices-hero {
  grid-template-columns: minmax(0, 1fr) minmax(270px, 330px);
  gap: 22px;
  padding: 28px 30px;
}

.admin-notices-hero h1 {
  max-width: 820px;
}

.admin-notices-hero .history-action-card {
  align-self: stretch;
  padding: 20px;
  border-radius: 20px;
}

.admin-notices-layout {
  grid-template-columns: minmax(390px, 0.82fr) minmax(0, 1.55fr);
  gap: 24px;
  margin-top: 24px;
}

.admin-notice-form,
.admin-notice-list-panel,
.admin-ops-dashboard {
  min-width: 0;
  border-radius: 24px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.06);
}

.admin-notice-form {
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 102px);
  padding: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.admin-notice-list-panel {
  padding: 22px;
}

.admin-section-hint {
  max-width: 720px;
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.admin-rich-editor {
  min-height: 210px;
  max-height: 430px;
}

.admin-notice-ops-fieldset,
.admin-targeting-panel {
  padding: 15px;
  border-color: #dbe3ef;
  background: #f8fafc;
}

.admin-notice-ops-fieldset legend,
.admin-targeting-panel summary {
  color: #0f172a;
  font-weight: 900;
}

.admin-targeting-panel summary {
  cursor: pointer;
  list-style-position: inside;
}

.admin-targeting-panel[open] summary {
  margin-bottom: 14px;
}

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

.admin-channel-grid label {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.admin-notice-filters {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
}

.admin-notice-search-field {
  grid-column: span 2;
}

.admin-list-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.admin-selected-count {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 900;
}

.admin-list-batch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fbff, #eff6ff);
}

.admin-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-select-all input {
  width: 17px;
  height: 17px;
  margin: 0;
}

.admin-list-batch-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.admin-notice-list {
  gap: 16px;
}

.admin-notice-card {
  display: block;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
  opacity: 1;
}

.admin-notice-card.status-draft {
  border-color: #d5dde8;
  background: #fff;
}

.admin-notice-card.status-archived {
  border-color: #d8dee8;
  background: #f8fafc;
  opacity: 1;
}

.admin-notice-card-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 17px 18px 14px;
  border-bottom: 1px solid #edf1f6;
}

.admin-card-select {
  display: grid !important;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-top: 1px;
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  background: #f8fafc;
}

.admin-card-select input {
  width: 17px;
  height: 17px;
  margin: 0;
}

.admin-notice-card-heading {
  min-width: 0;
}

.admin-notice-card-heading h3 {
  margin: 8px 0 3px;
  color: #0f172a;
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.admin-notice-card-top {
  gap: 6px;
}

.admin-notice-card-top > span {
  min-height: 25px;
  padding: 4px 8px;
  font-size: 11px;
}

.admin-approval-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 950;
}

.admin-approval-status.draft {
  color: #475569;
  background: #e2e8f0;
}

.admin-approval-status.pending {
  color: #92400e;
  background: #fef3c7;
}

.admin-approval-status.approved {
  color: #166534;
  background: #dcfce7;
}

.admin-approval-status.rejected {
  color: #991b1b;
  background: #fee2e2;
}

.admin-notice-target-summary {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.admin-notice-quick-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.admin-notice-card-content {
  position: relative;
  padding: 15px 18px 10px;
}

.admin-notice-card-content.is-collapsible:not(.is-expanded)::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 38px;
  left: 18px;
  height: 46px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 86%);
}

.admin-notice-card.status-archived .admin-notice-card-content.is-collapsible:not(.is-expanded)::after {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0), #f8fafc 86%);
}

.admin-notice-richtext {
  max-height: 155px;
  margin: 0;
  overflow: hidden;
  color: #334155;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: normal;
}

.admin-notice-card-content.is-expanded .admin-notice-richtext {
  max-height: none;
  overflow: visible;
}

.admin-notice-card-content.is-expanded::after {
  display: none;
}

.admin-notice-expand-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 0;
  border: 0;
  color: #1d4ed8;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.admin-notice-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0 18px 14px;
  overflow: hidden;
  border: 1px solid #e8edf4;
  border-radius: 12px;
  background: #f8fafc;
}

.admin-notice-meta-grid > div {
  min-width: 0;
  padding: 10px 11px;
  border-right: 1px solid #e8edf4;
  border-bottom: 1px solid #e8edf4;
}

.admin-notice-meta-grid > div:nth-child(3n) {
  border-right: 0;
}

.admin-notice-meta-grid > div:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.admin-notice-meta-grid span,
.admin-notice-meta-grid strong {
  display: block;
  min-width: 0;
}

.admin-notice-meta-grid span {
  margin-bottom: 3px;
  color: #64748b;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.03em;
}

.admin-notice-meta-grid strong {
  color: #1e293b;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.admin-review-note {
  display: flex;
  gap: 9px;
  margin: 0 18px 14px;
  padding: 10px 12px;
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
  color: #78350f;
  background: #fffbeb;
  font-size: 12px;
  line-height: 1.5;
}

.admin-notice-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid #edf1f6;
  background: #fbfdff;
}

.admin-notice-workflow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-notice-more-menu {
  position: relative;
  flex: 0 0 auto;
}

.admin-notice-more-menu summary {
  padding: 7px 11px;
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  color: #334155;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.admin-notice-more-menu summary::-webkit-details-marker {
  display: none;
}

.admin-notice-more-menu summary::after {
  content: "⌄";
  margin-left: 7px;
}

.admin-notice-more-menu[open] summary::after {
  content: "⌃";
}

.admin-notice-more-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 9px;
}

.admin-notice-attachment-count {
  display: inline-flex;
  margin: 0;
  align-items: center;
}

.admin-list-empty-state {
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 30px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  color: #64748b;
  background: #f8fafc;
  text-align: center;
}

.admin-list-empty-state strong {
  color: #0f172a;
  font-size: 17px;
}

.admin-list-empty-state p {
  margin: 6px 0 0;
}

.admin-ops-dashboard {
  margin-top: 24px;
  padding: 22px;
}

.admin-governance-heading {
  margin-bottom: 16px;
}

.admin-governance-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(320px, 1.2fr);
  gap: 14px;
  align-items: start;
}

.admin-governance-card {
  min-width: 0;
  min-height: 180px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
}

.admin-governance-card-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-governance-icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 17px;
  font-weight: 950;
}

.admin-governance-card-heading strong,
.admin-governance-card-heading small {
  display: block;
}

.admin-governance-card-heading strong {
  color: #0f172a;
  font-size: 14px;
}

.admin-governance-card-heading small {
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
}

.admin-empty-state {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.admin-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-stat-grid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #fff;
}

.admin-stat-grid span,
.admin-stat-grid strong,
.admin-stat-grid small {
  display: block;
}

.admin-stat-grid span {
  color: #64748b;
  font-size: 10px;
  font-weight: 850;
}

.admin-stat-grid strong {
  margin: 5px 0 2px;
  color: #0f172a;
  font-size: 24px;
  line-height: 1;
}

.admin-stat-grid small {
  color: #64748b;
  font-size: 10px;
}

.admin-version-list,
.admin-audit-list {
  display: grid;
  gap: 8px;
}

.admin-version-list {
  max-height: 310px;
  overflow: auto;
}

.admin-version-row,
.admin-audit-row {
  padding: 10px 11px;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  background: #fff;
}

.admin-version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-version-row strong,
.admin-version-row small,
.admin-audit-row strong,
.admin-audit-row small {
  display: block;
}

.admin-version-row small,
.admin-audit-row small {
  margin-top: 3px;
  color: #64748b;
  font-size: 10px;
}

.admin-audit-card {
  min-height: 260px;
}

.admin-audit-list {
  max-height: 340px;
  overflow: auto;
}

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

.admin-audit-action {
  display: inline-flex;
  width: fit-content;
  padding: 4px 7px;
  border-radius: 7px;
  color: #1e3a8a;
  background: #eff6ff;
  font-size: 10px;
  font-weight: 900;
}

.admin-governance-card.is-loading {
  opacity: 0.58;
  pointer-events: none;
}

@media (max-width: 1260px) {
  .admin-notices-layout {
    grid-template-columns: 1fr;
  }

  .admin-notice-form {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .admin-governance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-audit-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .admin-notices-page {
    width: min(100% - 24px, 760px);
  }

  .admin-notices-hero {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .admin-notice-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-notice-search-field {
    grid-column: 1 / -1;
  }

  .admin-notice-card-header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .admin-notice-quick-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .admin-notice-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-notice-meta-grid > div:nth-child(3n) {
    border-right: 1px solid #e8edf4;
  }

  .admin-notice-meta-grid > div:nth-child(2n) {
    border-right: 0;
  }

  .admin-notice-meta-grid > div:nth-last-child(-n + 3) {
    border-bottom: 1px solid #e8edf4;
  }

  .admin-notice-meta-grid > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (max-width: 680px) {
  .admin-notice-form,
  .admin-notice-list-panel,
  .admin-ops-dashboard {
    padding: 17px;
    border-radius: 19px;
  }

  .admin-notice-filters,
  .admin-notice-form-grid,
  .admin-channel-grid,
  .admin-governance-grid,
  .admin-stat-grid {
    grid-template-columns: 1fr;
  }

  .admin-audit-card {
    grid-column: auto;
  }

  .admin-list-status-row,
  .admin-list-batch-toolbar,
  .admin-notice-card-footer,
  .admin-version-row {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-list-batch-actions,
  .admin-notice-workflow-actions,
  .admin-notice-more-actions,
  .admin-notice-quick-actions {
    width: 100%;
  }

  .admin-list-batch-actions .btn,
  .admin-notice-workflow-actions .btn,
  .admin-notice-more-actions .btn,
  .admin-notice-quick-actions .btn {
    flex: 1 1 auto;
  }

  .admin-notice-card-header {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 15px;
  }

  .admin-notice-card-content {
    padding-right: 15px;
    padding-left: 15px;
  }

  .admin-notice-meta-grid {
    grid-template-columns: 1fr;
    margin-right: 15px;
    margin-left: 15px;
  }

  .admin-notice-meta-grid > div,
  .admin-notice-meta-grid > div:nth-child(2n),
  .admin-notice-meta-grid > div:nth-child(3n),
  .admin-notice-meta-grid > div:nth-last-child(-n + 2),
  .admin-notice-meta-grid > div:nth-last-child(-n + 3) {
    border-right: 0;
    border-bottom: 1px solid #e8edf4;
  }

  .admin-notice-meta-grid > div:last-child {
    border-bottom: 0;
  }

  .admin-notice-card-footer {
    padding: 12px 15px;
  }

  .admin-notice-more-menu,
  .admin-notice-more-menu summary {
    width: 100%;
  }

  .admin-notice-more-menu summary {
    text-align: center;
  }

  .admin-audit-row {
    grid-template-columns: 1fr;
  }
}
/* END OFFICIAL_NOTICE_ADMIN_UI_V3 */


/* BEGIN OFFICIAL_NOTICE_PRECISE_READ_UX_V1 */
.notice-tabs-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.notice-read-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.notice-read-feedback {
  min-height: 20px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.notice-read-feedback.success {
  color: #166534;
}

.notice-read-feedback.error {
  color: #b91c1c;
}

#officialMarkAllReadBtn:disabled {
  cursor: default;
  opacity: 0.62;
}

.official-notice-card {
  display: block;
  padding: 20px;
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.official-notice-card.official-unread {
  border-color: #93c5fd;
  box-shadow: inset 4px 0 0 #2563eb, 0 16px 34px rgba(37, 99, 235, 0.08);
}

.official-notice-card.official-read {
  border-color: #e2e8f0;
  background: #ffffff;
}

.official-notice-card-main {
  min-width: 0;
}

.official-read-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.official-read-state.is-unread {
  color: #1d4ed8;
  background: #dbeafe;
}

.official-read-state.is-read {
  color: #64748b;
  background: #e2e8f0;
}

.official-notice-title-button {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 10px 0 0;
  padding: 0;
  border: 0;
  color: #0f172a;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.official-notice-title-button span {
  display: block;
  font-size: 19px;
  font-weight: 950;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.official-notice-title-button:hover span,
.official-notice-title-button:focus-visible span {
  color: #1d4ed8;
}

.official-notice-title-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 5px;
  border-radius: 8px;
}

.official-notice-excerpt {
  display: -webkit-box;
  margin: 8px 0 0 !important;
  overflow: hidden;
  color: #475569 !important;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.official-notice-card.is-expanded .official-notice-excerpt {
  display: none;
}

.official-notice-card-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.official-notice-details {
  margin-top: 16px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.32);
}

.official-notice-details .official-notice-richtext > :last-child {
  margin-bottom: 0;
}

.official-notice-action-link {
  margin-top: 0 !important;
}

@media (max-width: 720px) {
  .notice-tabs-heading-row,
  .notice-read-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .notice-read-actions {
    width: 100%;
  }

  .notice-read-feedback {
    text-align: left;
  }

  #officialMarkAllReadBtn,
  .official-notice-card-controls .btn {
    width: 100%;
    justify-content: center;
  }
}
/* END OFFICIAL_NOTICE_PRECISE_READ_UX_V1 */

/* Official notice phase 1: pagination, recycle bin, timezone and safety UX. */
.admin-list-heading-actions,
.admin-pagination,
.notice-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-list-heading-actions {
  justify-content: flex-end;
}

.admin-pagination,
.notice-pagination {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  color: #475569;
  font-weight: 800;
}

.admin-pagination label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-pagination select {
  min-width: 76px;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
}

#adminNoticeRecycleBtn[aria-pressed="true"] {
  color: #fff;
  border-color: #334155;
  background: #334155;
}

.admin-notice-filters.is-disabled-for-recycle > :not(.admin-notice-search-field) {
  opacity: 0.45;
  pointer-events: none;
}

.admin-notice-trash-card {
  border-color: #cbd5e1;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
}

.admin-notice-trash-card .admin-notice-card-content {
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
}

.admin-notice-form small,
.profile-field small {
  line-height: 1.5;
}

.official-notice-list[aria-busy="true"] {
  opacity: 0.62;
  pointer-events: none;
}

@media (max-width: 720px) {
  .admin-list-heading-actions,
  .admin-pagination,
  .notice-pagination,
  .admin-pagination .btn,
  .notice-pagination .btn {
    width: 100%;
  }

  .admin-pagination label {
    justify-content: center;
  }
}

/* Official notice phase 2: analytics, preferences, snooze and frequency UX. */
.notice-preferences-panel {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.notice-preferences-heading {
  align-items: flex-start;
}

.notice-preferences-heading h2 {
  margin: 4px 0 6px;
}

.notice-preferences-heading p {
  max-width: 760px;
  margin: 0;
  color: #64748b;
  line-height: 1.65;
}

.notice-preference-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  color: #1e3a8a;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 850;
}

.notice-preference-form {
  display: grid;
  gap: 16px;
}

.notice-preference-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: #f8fbff;
}

.notice-preference-form legend {
  padding: 0 8px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
}

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

.notice-preference-channel-grid legend {
  grid-column: 1 / -1;
}

.notice-preference-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

.notice-preference-option input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.notice-preference-option span,
.notice-preference-option strong,
.notice-preference-option small {
  display: block;
  min-width: 0;
}

.notice-preference-option strong {
  color: #0f172a;
  font-size: 14px;
}

.notice-preference-option small {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.notice-quiet-hours-card,
.notice-popup-frequency-card {
  display: grid;
  gap: 12px;
}

.notice-quiet-toggle {
  max-width: 520px;
}

.notice-preference-time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  transition: opacity 160ms ease;
}

.notice-popup-frequency-card .notice-preference-time-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.notice-preference-time-grid.is-disabled {
  opacity: 0.5;
}

.notice-preference-time-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
}

.notice-preference-time-grid input {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  color: #0f172a;
  background: #fff;
  font: inherit;
}

.notice-preference-time-grid small {
  color: #64748b;
  font-weight: 500;
}

.notice-preference-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.notice-preference-actions .form-message {
  margin: 0;
}

.official-global-banner {
  position: sticky;
  top: 0;
  z-index: 10000;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 48px 12px 20px;
}

.official-global-banner-copy {
  display: grid !important;
  gap: 3px !important;
  min-width: 0;
}

.official-global-banner-copy strong,
.official-global-banner-copy span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.official-global-banner-actions,
.official-popup-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.official-global-banner .btn,
.official-global-popup .btn {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 8px 13px;
  background: #fff;
  font-size: 12px;
  font-weight: 850;
}

.official-global-banner .btn-primary,
.official-global-popup .btn-primary {
  color: #fff;
  border-color: #2563eb;
  background: #2563eb;
}

.official-global-banner-close {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 30px;
  height: 30px;
  transform: translateY(-50%);
  border-radius: 999px !important;
  font-size: 19px;
}

.official-popup-actions {
  margin-top: 18px;
}

.admin-stats-heading {
  align-items: flex-start;
}

.admin-stats-heading > div:nth-child(2) {
  min-width: 0;
  flex: 1 1 auto;
}

.admin-stats-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.admin-stats-toolbar label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.admin-stats-toolbar select {
  padding: 7px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
}

.admin-stat-grid-expanded {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-stats-section {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.admin-stats-section h3 {
  margin: 0;
  color: #0f172a;
  font-size: 13px;
}

.admin-stats-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.admin-daily-stats-wrap {
  max-height: 300px;
}

.admin-stats-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  font-size: 11px;
}

.admin-stats-table th,
.admin-stats-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}

.admin-stats-table th {
  position: sticky;
  top: 0;
  color: #475569;
  background: #f8fafc;
  font-weight: 900;
}

.admin-stats-table tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 900px) {
  .notice-preference-channel-grid,
  .notice-preference-time-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notice-timezone-field {
    grid-column: 1 / -1;
  }

  .official-global-banner {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding-right: 48px;
  }

  .official-global-banner-actions {
    justify-content: flex-start;
  }

  .official-global-banner-close {
    top: 14px;
    transform: none;
  }
}

@media (max-width: 620px) {
  .notice-preference-channel-grid,
  .notice-preference-time-grid,
  .notice-popup-frequency-card .notice-preference-time-grid,
  .admin-stat-grid-expanded {
    grid-template-columns: 1fr;
  }

  .notice-preference-actions,
  .notice-preference-actions .btn {
    width: 100%;
  }

  .admin-stats-heading,
  .admin-stats-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-stats-toolbar {
    width: 100%;
    margin-left: 0;
  }
}

/* Official notice phase 3: reliable delivery controls */
.admin-delivery-panel {
  grid-column: 1 / -1;
}

.admin-queue-health {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #dbe3ef;
  border-radius: 13px;
  background: #fff;
}

.admin-queue-health span,
.admin-queue-health small {
  display: block;
}

.admin-queue-health span {
  font-weight: 900;
}

.admin-queue-health small {
  color: #64748b;
  text-align: right;
}

.admin-queue-health.is-online span {
  color: #15803d;
}

.admin-queue-health.is-offline {
  border-color: #fecaca;
  background: #fff7f7;
}

.admin-queue-health.is-offline span {
  color: #b91c1c;
}

.admin-delivery-campaign-list {
  display: grid;
  gap: 12px;
}

.admin-delivery-campaign {
  padding: 15px;
  border: 1px solid #dbe3ef;
  border-radius: 15px;
  background: #fff;
}

.admin-delivery-campaign > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-delivery-campaign > header > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.admin-delivery-campaign > header small {
  color: #64748b;
  text-align: right;
}

.admin-campaign-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #e2e8f0;
}

.admin-campaign-metrics > div {
  min-width: 0;
  padding: 11px;
  background: #f8fafc;
}

.admin-campaign-metrics span,
.admin-campaign-metrics strong {
  display: block;
}

.admin-campaign-metrics span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.admin-campaign-metrics strong {
  margin-top: 3px;
  color: #0f172a;
  font-size: 18px;
}

.admin-campaign-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

@media (max-width: 900px) {
  .admin-campaign-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .admin-queue-health,
  .admin-delivery-campaign > header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-queue-health small,
  .admin-delivery-campaign > header small {
    text-align: left;
  }

  .admin-campaign-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-campaign-actions .btn {
    width: 100%;
  }
}

.admin-queue-health.is-degraded {
  border-color: #fde68a;
  background: #fffbeb;
}

.admin-queue-health.is-degraded span {
  color: #a16207;
}

.admin-campaign-delivery-details {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.admin-campaign-delivery-toolbar,
.admin-campaign-delivery-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-campaign-delivery-toolbar > div strong,
.admin-campaign-delivery-toolbar > div small {
  display: block;
}

.admin-campaign-delivery-toolbar > div small {
  margin-top: 3px;
  color: #64748b;
}

.admin-campaign-delivery-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.admin-campaign-delivery-toolbar select {
  min-width: 140px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
}

.admin-delivery-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.admin-delivery-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  background: #fff;
}

.admin-delivery-table th,
.admin-delivery-table td {
  padding: 10px 11px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}

.admin-delivery-table th {
  color: #475569;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-delivery-table td {
  color: #334155;
  font-size: 13px;
}

.admin-delivery-table td strong,
.admin-delivery-table td small {
  display: block;
}

.admin-delivery-table td small {
  margin-top: 3px;
  color: #64748b;
  line-height: 1.5;
}

.admin-delivery-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-delivery-error {
  max-width: 280px;
  overflow-wrap: anywhere;
  color: #991b1b !important;
}

.admin-campaign-delivery-pagination {
  justify-content: flex-end;
  margin-top: 12px;
}

.admin-campaign-delivery-pagination span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 680px) {
  .admin-campaign-delivery-toolbar,
  .admin-campaign-delivery-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-campaign-delivery-toolbar label,
  .admin-campaign-delivery-toolbar select,
  .admin-campaign-delivery-pagination .btn {
    width: 100%;
  }
}

/* BEGIN OFFICIAL NOTICE ENTERPRISE PHASE 4 */
.notice-enterprise-page { padding-top: 36px; padding-bottom: 72px; }
.notice-enterprise-hero { align-items: stretch; }
.notice-enterprise-hero > * { min-width: 0; }
.enterprise-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; padding: 8px; border: 1px solid #dbeafe; border-radius: 20px; background: rgba(255,255,255,.92); position: sticky; top: 10px; z-index: 20; box-shadow: 0 14px 36px rgba(15,23,42,.07); }
.enterprise-tabs button { border: 0; border-radius: 14px; padding: 11px 15px; background: transparent; color: #475569; font-weight: 900; cursor: pointer; }
.enterprise-tabs button.active { color: #fff; background: #2563eb; box-shadow: 0 8px 20px rgba(37,99,235,.22); }
.enterprise-tab-panel { display: grid; gap: 20px; }
.enterprise-two-column { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; align-items: start; }
.enterprise-grid-three { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; align-items: start; }
.enterprise-card { display: grid; gap: 16px; padding: 24px; min-width: 0; }
.enterprise-card h2 { margin: 0; }
.enterprise-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.enterprise-form-grid label { display: grid; gap: 7px; min-width: 0; color: #0f172a; font-weight: 850; }
.enterprise-form-grid input,.enterprise-form-grid select,.enterprise-form-grid textarea,.enterprise-notice-selector select,.enterprise-card > label select { width: 100%; min-width: 0; border: 1px solid #cbd5e1; border-radius: 13px; padding: 11px 12px; background: #fff; color: #0f172a; font: inherit; }
.enterprise-form-grid textarea { resize: vertical; font-family: inherit; }
.enterprise-form-grid textarea[spellcheck="false"],.enterprise-result { font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size: 13px; }
.enterprise-wide { grid-column: 1 / -1; }
.enterprise-check { grid-template-columns: auto 1fr !important; align-items: center; padding: 12px; background: #eff6ff; border-radius: 13px; }
.enterprise-check input { width: 18px; height: 18px; }
.enterprise-form-actions,.enterprise-item-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.enterprise-list { display: grid; gap: 10px; max-height: 620px; overflow: auto; }
.enterprise-list.compact { margin-top: 10px; max-height: 270px; }
.enterprise-list-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid #e2e8f0; border-radius: 15px; background: #f8fafc; min-width: 0; }
.enterprise-list-item > div:first-child { min-width: 0; }
.enterprise-list-item strong,.enterprise-list-item p,.enterprise-list-item small { overflow-wrap: anywhere; }
.enterprise-list-item p { margin: 5px 0; color: #475569; }
.enterprise-list-item small { color: #64748b; }
.enterprise-mini-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 11px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
.enterprise-policy-summary,.enterprise-callout,.enterprise-preview { padding: 16px; border: 1px solid #bfdbfe; border-radius: 16px; background: #eff6ff; }
.enterprise-policy-summary p,.enterprise-callout p { margin-bottom: 0; color: #475569; line-height: 1.65; }
.enterprise-notice-selector { display: grid; gap: 8px; }
.enterprise-result { min-height: 90px; padding: 14px; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 14px; background: #0f172a; color: #e2e8f0; }
.admin-approval-status.pending_first,.admin-approval-status.pending_second { color: #92400e; background: #fef3c7; }

.profile-mfa-card { display: grid; gap: 15px; padding: 20px; border: 1px solid #bfdbfe; border-radius: 20px; background: linear-gradient(135deg,#fff,#eff6ff); }
.profile-mfa-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-mfa-setup { display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 18px; align-items: start; padding: 16px; border: 1px solid #dbeafe; border-radius: 16px; background: #fff; }
.profile-mfa-setup img { width: 180px; max-width: 100%; border-radius: 12px; border: 1px solid #e2e8f0; }
.profile-mfa-setup label,.profile-mfa-disable label { display: grid; gap: 7px; margin-bottom: 10px; font-weight: 850; }
.profile-mfa-setup input,.profile-mfa-disable input { width: 100%; padding: 11px 12px; border: 1px solid #cbd5e1; border-radius: 12px; }
.profile-mfa-disable,.profile-mfa-recovery { padding: 16px; border: 1px solid #fecaca; border-radius: 16px; background: #fff; }
.profile-mfa-recovery { border-color: #bbf7d0; background: #f0fdf4; }
.profile-mfa-recovery pre { padding: 12px; border-radius: 12px; background: #0f172a; color: #fff; white-space: pre-wrap; }

@media (max-width: 1100px) { .enterprise-grid-three { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .enterprise-two-column,.enterprise-form-grid { grid-template-columns: 1fr; } .enterprise-wide { grid-column: auto; } .enterprise-tabs { position: static; } .profile-mfa-setup { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .enterprise-card { padding: 18px; } .enterprise-list-item { flex-direction: column; } .enterprise-item-actions,.enterprise-item-actions .btn { width: 100%; } }
/* END OFFICIAL NOTICE ENTERPRISE PHASE 4 */


/* Official notice infrastructure diagnostics */
.infrastructure-summary { display:flex; flex-wrap:wrap; gap:10px; margin:14px 0 18px; }
.infrastructure-summary span { padding:8px 12px; border-radius:999px; background:#f1f5f9; font-weight:900; }
.infrastructure-service-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.infrastructure-service-card { border:1px solid #e2e8f0; border-radius:18px; padding:16px; background:#fff; min-width:0; }
.infrastructure-service-card h3 { margin:0 0 8px; font-size:17px; }
.infrastructure-service-card p { margin:0; color:#475569; line-height:1.6; overflow-wrap:anywhere; }
.infrastructure-service-card small { display:block; margin-top:10px; color:#64748b; }
.infrastructure-service-card.status-healthy { border-color:#86efac; background:#f0fdf4; }
.infrastructure-service-card.status-unavailable { border-color:#fca5a5; background:#fff1f2; }
.infrastructure-service-card.status-unconfigured { border-color:#fcd34d; background:#fffbeb; }
.infrastructure-status-badge { display:inline-flex; margin-bottom:9px; padding:4px 9px; border-radius:999px; font-size:12px; font-weight:950; background:#e2e8f0; }
.infrastructure-test-grid { margin-top:18px; }
@media (max-width:980px){.infrastructure-service-grid{grid-template-columns:1fr 1fr;}}
@media (max-width:640px){.infrastructure-service-grid{grid-template-columns:1fr;}}

/* BEGIN LEDGERCHASE_CUSTOM_TEMPLATE_EDITOR_V8 */
.custom-template-modal-card {
  width: min(1220px, 97vw);
  max-height: 94vh;
  padding: 24px;
}

.custom-template-toolbar {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(260px, 1.4fr) repeat(4, auto);
  gap: 10px;
  align-items: center;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: #f8fbff;
}

.custom-template-toolbar input,
.custom-template-toolbar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #fff;
  padding: 0 12px;
  color: #0f172a;
  font: inherit;
  font-weight: 700;
}

.custom-template-toolbar .danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff7f7;
}

.custom-template-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.custom-template-draft-status {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.custom-template-draft-status[data-state="saving"] { color: #1d4ed8; background: #eff6ff; }
.custom-template-draft-status[data-state="saved"] { color: #15803d; background: #f0fdf4; }
.custom-template-draft-status[data-state="error"] { color: #b91c1c; background: #fef2f2; }

.custom-template-variable-palette,
.custom-template-condition-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #dbeafe;
  background: #f8fbff;
}

.custom-template-condition-palette {
  border-color: #e9d5ff;
  background: #faf5ff;
}

.custom-template-variable-palette > span,
.custom-template-condition-palette > span {
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}

.custom-template-variable-palette button,
.custom-template-condition-palette button {
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #fff;
  color: #1d4ed8;
  padding: 5px 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.custom-template-condition-palette button {
  border-color: #d8b4fe;
  color: #7e22ce;
}

.custom-template-variable-palette button:hover,
.custom-template-condition-palette button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(30, 64, 175, 0.12);
}

.custom-template-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: #eef2ff;
  width: fit-content;
}

.custom-template-tabs button {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #475569;
  padding: 8px 18px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.custom-template-tabs button.active {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.12);
}

.custom-template-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 18px;
  align-items: start;
}

.custom-template-editor-pane,
.custom-template-preview-pane {
  min-width: 0;
}

.custom-template-tab-panel {
  display: grid;
  gap: 14px;
}

.custom-template-tab-panel[hidden] { display: none !important; }

.custom-template-preview-pane {
  position: sticky;
  top: 0;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
  overflow: hidden;
}

.custom-template-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #dbeafe;
  background: #eff6ff;
}

.custom-template-preview-head > div {
  display: grid;
  gap: 3px;
}

.custom-template-preview-head strong { color: #0f172a; }
.custom-template-preview-head span { color: #64748b; font-size: 12px; font-weight: 700; }

.custom-template-preview {
  min-height: 330px;
  max-height: 520px;
  overflow: auto;
  padding: 18px;
}

.custom-template-preview h4 {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  font-size: 18px;
}

.custom-template-preview-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #334155;
  line-height: 1.65;
  font-weight: 600;
}

.custom-template-validation {
  margin: 0 16px 16px;
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
}

.custom-template-validation.ok {
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.custom-template-validation.error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.custom-template-validation ul {
  margin: 7px 0 0 18px;
  padding: 0;
}

.custom-template-modal-actions {
  position: sticky;
  bottom: -24px;
  z-index: 3;
  margin: 4px -24px -24px;
  padding: 14px 24px;
  border-top: 1px solid #dbeafe;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

@media (max-width: 1040px) {
  .custom-template-toolbar {
    grid-template-columns: 1fr 1fr repeat(2, auto);
  }
  .custom-template-workspace {
    grid-template-columns: 1fr;
  }
  .custom-template-preview-pane {
    position: static;
  }
}

@media (max-width: 720px) {
  .custom-template-modal-card { padding: 18px; }
  .custom-template-toolbar { grid-template-columns: 1fr; }
  .custom-template-toolbar .btn { width: 100%; }
  .custom-template-name-row { grid-template-columns: 1fr; }
  .custom-template-draft-status { white-space: normal; }
  .custom-template-tabs { width: 100%; }
  .custom-template-tabs button { flex: 1; padding-inline: 8px; }
  .custom-template-preview-head { align-items: stretch; flex-direction: column; }
  .custom-template-preview-head .btn { width: 100%; }
  .custom-template-modal-actions {
    bottom: -18px;
    margin: 4px -18px -18px;
    padding: 12px 18px;
  }
}
/* END LEDGERCHASE_CUSTOM_TEMPLATE_EDITOR_V8 */

/* BEGIN LEDGERCHASE_TEMPLATE_EDITOR_VISUAL_V9_2 */
.custom-template-guide-friendly code {
  font-family: inherit;
}

.custom-template-editor-mode {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #f8fbff;
}

.custom-template-editor-mode > span {
  color: #334155;
  font-weight: 900;
}

.custom-template-editor-mode button {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 7px 13px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.custom-template-editor-mode button.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 6px 15px rgba(37, 99, 235, 0.18);
}

.custom-template-editor-mode small {
  flex: 1 1 260px;
  color: #64748b;
  line-height: 1.45;
  font-weight: 700;
}

html[data-template-editor-mode="simple"] .custom-template-form textarea {
  font-family: inherit;
}

html[data-template-editor-mode="advanced"] .custom-template-form textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
}

.custom-template-footer-message {
  min-height: 24px;
  margin: 4px 2px 0;
  padding: 8px 10px;
  border-radius: 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.custom-template-footer-message:empty {
  display: none;
}

.custom-template-footer-message.success {
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.custom-template-footer-message.error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.custom-template-modal-actions {
  bottom: 0;
  margin-bottom: -24px;
}

.custom-template-form {
  padding-bottom: 10px;
}

@media (max-width: 720px) {
  .custom-template-editor-mode {
    align-items: stretch;
  }
  .custom-template-editor-mode button {
    flex: 1 1 140px;
  }
  .custom-template-modal-actions {
    bottom: 0;
    margin-bottom: -18px;
  }
}
/* END LEDGERCHASE_TEMPLATE_EDITOR_VISUAL_V9_2 */
/* Template Studio UI v9.3 */
.custom-template-studio-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px;border:1px solid #d8e5ff;border-radius:18px;background:linear-gradient(135deg,#f8fbff,#eef5ff);margin:14px 0}.custom-template-studio-title{display:flex;flex-direction:column}.custom-template-studio-title span{color:#64748b;font-size:.86rem}.custom-template-studio-actions{display:flex;gap:8px}.custom-template-studio-workspace{grid-template-columns:220px minmax(0,1fr) minmax(340px,.9fr)!important;align-items:start}.custom-template-variable-tree{position:sticky;top:0;max-height:68vh;overflow:auto;border:1px solid #dbe6f7;border-radius:18px;background:#fbfdff;padding:12px}.custom-template-sidebar-head{display:grid;gap:8px;margin-bottom:10px}.custom-template-sidebar-head input{width:100%;padding:9px 10px;border:1px solid #d6e1f2;border-radius:11px}.custom-template-variable-tree details{border-top:1px solid #e7edf7;padding:8px 0}.custom-template-variable-tree summary{font-weight:800;cursor:pointer;margin-bottom:6px}.custom-template-variable-tree button{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:2px;border:0;background:transparent;border-radius:10px;padding:8px;text-align:left;cursor:pointer}.custom-template-variable-tree button:hover{background:#eaf2ff}.custom-template-variable-tree button span{font-weight:700}.custom-template-variable-tree button small{color:#718096}.custom-template-preview-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.custom-template-preview-clients{display:flex;border:1px solid #d9e4f4;border-radius:999px;padding:3px;background:#f8fafc}.custom-template-preview-clients button{border:0;background:transparent;border-radius:999px;padding:6px 9px;font-weight:700;cursor:pointer}.custom-template-preview-clients button.active{background:#2563eb;color:#fff}.custom-template-preview[data-client="outlook"]{font-family:"Segoe UI",Arial,sans-serif;background:#f3f6f8}.custom-template-preview[data-client="qq"]{font-family:Arial,"Microsoft YaHei",sans-serif;background:#f4f8fc}.custom-template-preview[data-client="apple"]{font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",sans-serif;background:#f7f7f7}.custom-template-version-drawer{margin:14px 0;padding:14px;border:1px solid #dbe6f7;border-radius:18px;background:#fff}.custom-template-version-head{display:flex;justify-content:space-between;align-items:center}.custom-template-version-head>div{display:flex;flex-direction:column}.custom-template-version-head span{color:#64748b;font-size:.85rem}.custom-template-version-list{display:grid;gap:8px;margin-top:12px;max-height:220px;overflow:auto}.custom-template-version-list article{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 12px;border:1px solid #e3eaf5;border-radius:12px}.custom-template-version-list article>div:first-child{display:flex;flex-direction:column}.custom-template-version-list article span{font-size:.82rem;color:#64748b}.custom-template-version-list button{border:0;border-radius:9px;padding:6px 10px;margin-left:6px;cursor:pointer}.custom-template-version-list .empty{color:#64748b;text-align:center}.custom-template-modal-card{max-width:1500px!important}
@media(max-width:1180px){.custom-template-studio-workspace{grid-template-columns:190px minmax(0,1fr)!important}.custom-template-preview-pane{grid-column:1/-1}.custom-template-variable-tree{position:relative;max-height:none}}
@media(max-width:760px){.custom-template-studio-workspace{grid-template-columns:1fr!important}.custom-template-variable-tree{display:grid;grid-template-columns:1fr 1fr;gap:8px}.custom-template-sidebar-head{grid-column:1/-1}.custom-template-studio-bar,.custom-template-version-head{align-items:flex-start;flex-direction:column}.custom-template-preview-controls{align-items:flex-start;flex-direction:column}}


/* LedgerChase Template Studio v10 — secure visual editor */
.custom-template-access-badge{display:inline-flex;align-items:center;gap:.35rem;margin-left:auto;padding:.28rem .62rem;border-radius:999px;background:#eef7f1;color:#17633b;font-size:.76rem;font-weight:700;border:1px solid #cde8d7}
.custom-template-access-badge[data-access="admin"]{background:#f3efff;color:#5a36a3;border-color:#ddd1ff}
.custom-template-editor-mode [data-template-admin-only][hidden]{display:none!important}
.custom-template-studio-workspace{border:1px solid rgba(15,23,42,.09);box-shadow:0 18px 48px rgba(15,23,42,.08);border-radius:18px;overflow:hidden}
.custom-template-variable-tree button:focus-visible,.custom-template-editor-mode button:focus-visible,[data-preview-client]:focus-visible{outline:3px solid rgba(37,99,235,.25);outline-offset:2px}
.custom-template-preview-pane{background:linear-gradient(180deg,#fbfdff 0%,#f7f9fc 100%)}
.custom-template-validation.ok{border-left:4px solid #22a06b}
.custom-template-validation.error{border-left:4px solid #d92d20}
@media (max-width:980px){.custom-template-studio-workspace{grid-template-columns:1fr!important}.custom-template-variable-tree,.custom-template-preview-pane{max-height:none}.custom-template-access-badge{margin-left:0}}
@media (prefers-reduced-motion:reduce){.custom-template-studio-workspace *{scroll-behavior:auto!important;transition:none!important}}

/* LedgerChase Template Studio v11 Final */
.custom-template-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.custom-template-steps li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border-color, #dfe4ea);
  border-radius: 12px;
  background: var(--surface, #fff);
  opacity: .72;
}
.custom-template-steps li > span {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eef2f7;
  font-weight: 800;
}
.custom-template-steps li b { font-size: .9rem; }
.custom-template-steps li small { color: var(--text-muted, #667085); line-height: 1.3; }
.custom-template-steps li.active { opacity: 1; border-color: #8bb5ff; box-shadow: 0 0 0 3px rgba(39, 110, 241, .08); }
.custom-template-steps li.active > span { background: #276ef1; color: #fff; }
.custom-template-steps li.complete { opacity: 1; border-color: #a9dcc1; background: #f3fbf6; }
.custom-template-steps li.complete > span { background: #168a4b; color: #fff; }
.custom-template-editor-mode #customTemplateAdminModeSlot:empty { display: none; }
.custom-template-editor-mode [data-template-editor-mode="advanced"] { border-color: #7f56d9; color: #6941c6; }
.custom-template-access-badge[data-access="admin"] { background: #f4ebff; color: #6941c6; border-color: #d6bbfb; }
.custom-template-variable-tree button:focus-visible,
.custom-template-preview-clients button:focus-visible,
.custom-template-tabs button:focus-visible { outline: 3px solid rgba(39, 110, 241, .28); outline-offset: 2px; }
.custom-template-variable-tree button[hidden] { display: none !important; }
@media (max-width: 760px) {
  .custom-template-steps { grid-template-columns: 1fr; }
  .custom-template-steps li { padding: 10px; }
}


/* LedgerChase Template Studio user-facing cleanup v11.1 */
.custom-template-guide-grid.custom-template-guide-friendly {
  gap: 12px 18px;
}

.custom-template-guide-grid.custom-template-guide-friendly p {
  padding: 10px 12px;
  border: 1px solid #e5edf8;
  border-radius: 12px;
  background: #fbfdff;
}

.custom-template-modal-actions {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.custom-template-modal-action-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 1 auto;
}

.custom-template-modal-actions .custom-template-footer-message {
  flex: 1 1 320px;
  max-width: 620px;
  min-height: 0;
  margin: 0 0 0 auto;
  padding: 8px 10px;
  text-align: right;
}

.custom-template-modal-actions .custom-template-footer-message:empty {
  display: none;
}

@media (max-width: 760px) {
  .custom-template-guide-grid.custom-template-guide-friendly {
    grid-template-columns: 1fr;
  }

  .custom-template-modal-action-buttons {
    width: 100%;
  }

  .custom-template-modal-action-buttons .btn {
    flex: 1 1 150px;
  }

  .custom-template-modal-actions .custom-template-footer-message {
    flex-basis: 100%;
    max-width: none;
    margin-left: 0;
    text-align: left;
  }
}

/* LedgerChase standard password eye v3 */
.auth-password-field {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.auth-password-input-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.auth-password-input-wrap > input {
  display: block;
  width: 100%;
  padding-right: 52px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 9px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transform: translateY(-50%);
  appearance: none;
  -webkit-appearance: none;
}

.auth-password-toggle[hidden] {
  display: none !important;
}

.auth-password-toggle:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.auth-password-toggle:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 1px;
}

.auth-password-toggle svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.auth-password-toggle .auth-eye-off {
  display: none;
}

.auth-password-toggle[aria-pressed="true"] .auth-eye-on {
  display: none;
}

.auth-password-toggle[aria-pressed="true"] .auth-eye-off {
  display: block;
}

.auth-password-feedback {
  min-height: 0;
  margin: 0 2px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.auth-password-feedback:empty {
  display: none;
}

.auth-password-feedback.is-warning { color: #b45309; }
.auth-password-feedback.is-error { color: #b91c1c; }
.auth-password-feedback.is-success { color: #15803d; }

.auth-password-strength {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 2px 2px 0;
}

.auth-password-strength span {
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
}

.auth-password-strength[data-score="1"] span:nth-child(-n+1),
.auth-password-strength[data-score="2"] span:nth-child(-n+2) { background: #f59e0b; }
.auth-password-strength[data-score="3"] span:nth-child(-n+3),
.auth-password-strength[data-score="4"] span:nth-child(-n+4) { background: #16a34a; }


/* History pagination: keep controls above the records and make them easy to scan. */
.history-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
}

.history-pagination.hidden {
  display: none !important;
}

.history-pagination-info {
  color: var(--muted);
  font-weight: 750;
  white-space: nowrap;
}

.history-pagination-actions,
.history-page-navigation,
.history-page-numbers,
.history-page-size-label {
  display: flex;
  align-items: center;
}

.history-pagination-actions {
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
}

.history-page-navigation {
  gap: 8px;
}

.history-page-numbers {
  gap: 6px;
}

.history-page-number {
  min-width: 38px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid #cbd8ea;
  border-radius: 10px;
  background: #fff;
  color: #17345f;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.history-page-number:hover {
  border-color: #8db4ff;
  background: #eef5ff;
}

.history-page-number.is-active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.history-page-ellipsis {
  padding: 0 2px;
  color: var(--muted);
  font-weight: 800;
}

.history-page-size-label {
  gap: 8px;
  color: var(--muted);
  font-weight: 750;
  white-space: nowrap;
}

.history-page-size {
  min-height: 38px;
  padding: 6px 32px 6px 10px;
  border: 1px solid #cbd8ea;
  border-radius: 10px;
  background: #fff;
  color: #17345f;
  font: inherit;
  font-weight: 750;
}

@media (max-width: 820px) {
  .history-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .history-pagination-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .history-page-navigation {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .history-page-numbers {
    justify-content: center;
    flex: 1 1 auto;
    flex-wrap: wrap;
  }

  .history-page-size-label {
    justify-content: flex-end;
  }
}

@media (max-width: 520px) {
  .history-page-navigation .btn {
    flex: 1 1 42%;
  }

  .history-page-numbers {
    order: 3;
    flex-basis: 100%;
  }

  .history-page-size-label {
    justify-content: space-between;
  }
}

/* LedgerChase Template Studio smart content and email preview v12 */
.custom-template-priority-settings {
  display: grid;
  gap: 9px;
  margin: 8px 0 2px;
  padding: 11px;
  border: 1px solid #d8e5f7;
  border-radius: 13px;
  background: #f7faff;
}

.custom-template-priority-settings > strong {
  color: #173b72;
  font-size: .86rem;
}

.custom-template-priority-settings label {
  display: grid;
  gap: 5px;
  color: #53657d;
  font-size: .77rem;
  font-weight: 800;
}

.custom-template-priority-settings select,
.custom-template-priority-settings input {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid #cdd9eb;
  border-radius: 9px;
  background: #fff;
  color: #172033;
  font: inherit;
}

.custom-template-priority-settings small {
  color: #66758b;
  line-height: 1.45;
}

.custom-template-variable-tree .custom-template-priority-settings .custom-template-priority-insert-btn {
  border: 1px solid #b9d0ff;
  background: #eaf2ff;
  color: #174da6;
}

.custom-template-variable-tree .custom-template-priority-settings .custom-template-priority-insert-btn:hover {
  background: #dceaff;
}

.custom-template-variable-tree .custom-template-priority-settings .custom-template-priority-insert-btn:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.custom-template-studio-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.custom-template-preview-head {
  align-items: flex-start;
  flex-direction: column;
}

.custom-template-preview-heading {
  width: 100%;
}

.custom-template-preview-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  align-items: end;
  gap: 10px 12px;
  width: 100%;
}

.custom-template-preview-control-group {
  display: grid;
  gap: 5px;
}

.custom-template-preview-control-group > span {
  color: #52637a;
  font-size: .73rem;
  font-weight: 800;
}

.custom-template-preview-clients,
.custom-template-preview-segment {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 3px;
  border: 1px solid #d9e4f4;
  border-radius: 11px;
  background: #f8fafc;
}

.custom-template-preview-clients button,
.custom-template-preview-segment button {
  border: 0;
  border-radius: 8px;
  padding: 6px 9px;
  background: transparent;
  color: #475569;
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}

.custom-template-preview-clients button.active,
.custom-template-preview-segment button.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 7px rgba(37, 99, 235, .22);
}

.custom-template-preview-status {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 9px;
  border-radius: 9px;
  background: #e8f0ff;
  color: #174ea6;
  font-size: .78rem;
}

.custom-template-preview-disclaimer {
  margin: 0;
  padding: 10px 16px 12px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: .76rem;
  line-height: 1.5;
}

.custom-template-preview {
  padding: 0;
  background: #e9edf3;
  transition: background .2s ease;
}

.custom-template-preview.is-plain-preview {
  padding: 18px;
  background: #fff;
}

.custom-template-email-stage {
  display: flex;
  justify-content: center;
  min-height: 390px;
  padding: 22px;
  overflow: auto;
}

.custom-template-email-canvas {
  width: min(100%, 680px);
  min-height: 340px;
  border: 1px solid #dce1e8;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .12);
  color: #202124;
  overflow: hidden;
  transition: width .2s ease, max-width .2s ease, background .2s ease, color .2s ease;
}

.custom-template-email-toolbar {
  display: flex;
  gap: 18px;
  padding: 10px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8f9fa;
  color: #5f6368;
  font-size: .78rem;
}

.custom-template-email-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 17px 20px 8px;
}

.custom-template-email-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: .76rem;
  font-weight: 900;
}

.custom-template-email-identity {
  display: grid;
  min-width: 0;
}

.custom-template-email-identity strong {
  color: inherit;
  font-size: .88rem;
}

.custom-template-email-identity span {
  color: #6b7280;
  font-size: .75rem;
}

.custom-template-preview .custom-template-email-subject {
  margin: 0;
  padding: 10px 20px 15px;
  border-bottom: 1px solid #eceff3;
  color: inherit;
  font-size: 1.08rem;
  line-height: 1.4;
}

.custom-template-email-body {
  padding: 19px 20px 8px;
  color: inherit;
  font-weight: 400;
  line-height: 1.65;
}

.custom-template-email-body p {
  margin: 0 0 11px;
}

.custom-template-email-body ul {
  margin: 0 0 12px 20px;
  padding: 0;
}

.custom-template-email-body li {
  margin: 5px 0;
}

.custom-template-preview-spacer {
  height: 9px;
}

.custom-template-email-body blockquote {
  margin: 12px 0;
  padding: 9px 12px;
  border-left: 3px solid #9aa0a6;
  background: #f8f9fa;
  color: #5f6368;
}

.custom-template-email-body a {
  color: #1a73e8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.custom-template-email-action-row {
  padding: 5px 20px 17px;
}

.custom-template-preview-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 16px;
  border-radius: 18px;
  background: #1a73e8;
  color: #fff;
  font-size: .8rem;
  font-weight: 800;
}

.custom-template-email-attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 20px 20px;
  padding: 10px 12px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #fff;
}

.custom-template-email-attachment-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #e8f0fe;
  color: #1967d2;
  font-size: .65rem;
  font-weight: 900;
}

.custom-template-email-attachment > div {
  display: grid;
  min-width: 0;
}

.custom-template-email-attachment strong {
  overflow: hidden;
  color: inherit;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-template-email-attachment span:last-child {
  color: #6b7280;
  font-size: .7rem;
}

.custom-template-preview[data-device="mobile"] .custom-template-email-stage {
  padding: 16px 10px;
}

.custom-template-preview[data-device="mobile"] .custom-template-email-canvas {
  width: min(100%, 360px);
  border-radius: 18px;
}

.custom-template-preview[data-device="mobile"] .custom-template-email-toolbar {
  gap: 12px;
  padding-inline: 13px;
  font-size: .7rem;
}

.custom-template-preview[data-device="mobile"] .custom-template-email-header,
.custom-template-preview[data-device="mobile"] .custom-template-email-body,
.custom-template-preview[data-device="mobile"] .custom-template-email-subject {
  padding-inline: 15px;
}

.custom-template-preview[data-device="mobile"] .custom-template-email-action-row {
  padding-inline: 15px;
}

.custom-template-preview[data-device="mobile"] .custom-template-email-attachment {
  margin-inline: 15px;
}

/* Gmail */
.custom-template-preview[data-client="gmail"] .custom-template-email-canvas {
  font-family: Arial, "Noto Sans SC", sans-serif;
}

/* Outlook */
.custom-template-preview[data-client="outlook"] {
  background: #e7edf2;
}

.custom-template-preview[data-client="outlook"] .custom-template-email-canvas {
  width: min(100%, 720px);
  border-radius: 2px;
  font-family: "Segoe UI", Arial, sans-serif;
}

.custom-template-preview[data-client="outlook"] .custom-template-email-toolbar {
  background: #f3f6f8;
  color: #334155;
}

.custom-template-preview[data-client="outlook"] .custom-template-email-body {
  line-height: 1.5;
}

.custom-template-preview[data-client="outlook"] .custom-template-preview-action {
  border-radius: 2px;
  background: #0078d4;
}

.custom-template-preview[data-client="outlook"] .custom-template-email-body a {
  color: #0563c1;
}

.custom-template-preview[data-client="outlook"] .custom-template-email-body blockquote {
  border-left-color: #0078d4;
  background: #f2f6fa;
}

.custom-template-preview[data-client="outlook"] .custom-template-email-attachment {
  border-radius: 2px;
  background: #f8fafc;
}

/* QQ Mail */
.custom-template-preview[data-client="qq"] {
  background: #eaf2f8;
}

.custom-template-preview[data-client="qq"] .custom-template-email-canvas {
  width: min(100%, 700px);
  border-color: #cbddeb;
  border-radius: 6px;
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.custom-template-preview[data-client="qq"] .custom-template-email-toolbar {
  background: #edf6fc;
  color: #3c6683;
}

.custom-template-preview[data-client="qq"] .custom-template-email-body {
  line-height: 1.8;
}

.custom-template-preview[data-client="qq"] .custom-template-preview-action {
  border-radius: 5px;
  background: #1593d1;
}

.custom-template-preview[data-client="qq"] .custom-template-email-body a {
  color: #0b76b7;
}

.custom-template-preview[data-client="qq"] .custom-template-email-body blockquote {
  border-left-color: #69a9d0;
  background: #f2f8fc;
}

.custom-template-preview[data-client="qq"] .custom-template-email-attachment {
  border-color: #c8ddea;
  background: #f7fbfe;
}

/* Apple Mail */
.custom-template-preview[data-client="apple"] {
  background: #ececec;
}

.custom-template-preview[data-client="apple"] .custom-template-email-canvas {
  width: min(100%, 640px);
  border-radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
}

.custom-template-preview[data-client="apple"] .custom-template-email-toolbar {
  justify-content: flex-end;
  background: #f5f5f7;
  color: #6e6e73;
}

.custom-template-preview[data-client="apple"] .custom-template-email-body {
  line-height: 1.7;
}

.custom-template-preview[data-client="apple"] .custom-template-preview-action {
  border-radius: 10px;
  background: #007aff;
}

.custom-template-preview[data-client="apple"] .custom-template-email-body a {
  color: #007aff;
}

.custom-template-preview[data-client="apple"] .custom-template-email-body blockquote {
  border-left-color: #8e8e93;
  background: #f5f5f7;
}

.custom-template-preview[data-client="apple"] .custom-template-email-attachment {
  border-radius: 10px;
  background: #f9f9fb;
}

/* Dark mode */
.custom-template-preview[data-theme="dark"] {
  background: #111827;
}

.custom-template-preview[data-theme="dark"] .custom-template-email-canvas {
  border-color: #374151;
  background: #1f2937;
  color: #f3f4f6;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .36);
}

.custom-template-preview[data-theme="dark"] .custom-template-email-toolbar,
.custom-template-preview[data-theme="dark"] .custom-template-email-body blockquote,
.custom-template-preview[data-theme="dark"] .custom-template-email-attachment {
  border-color: #374151;
  background: #111827;
  color: #d1d5db;
}

.custom-template-preview[data-theme="dark"] .custom-template-email-header,
.custom-template-preview[data-theme="dark"] .custom-template-email-subject {
  border-color: #374151;
}

.custom-template-preview[data-theme="dark"] .custom-template-email-identity span,
.custom-template-preview[data-theme="dark"] .custom-template-email-attachment span:last-child {
  color: #9ca3af;
}

.custom-template-preview[data-theme="dark"] .custom-template-email-body a {
  color: #7cb8ff;
}

.custom-template-preview[data-theme="dark"] .custom-template-email-attachment-icon {
  background: #233a61;
  color: #9ec5ff;
}

@media (max-width: 1100px) {
  .custom-template-preview-controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .custom-template-preview-controls {
    grid-template-columns: 1fr;
  }
  .custom-template-preview-clients,
  .custom-template-preview-segment {
    width: 100%;
  }
  .custom-template-preview-clients button,
  .custom-template-preview-segment button {
    flex: 1 1 auto;
  }
  .custom-template-studio-actions {
    width: 100%;
  }
  .custom-template-studio-actions .btn {
    flex: 1 1 180px;
  }
}
/* END LedgerChase Template Studio smart content and email preview v12 */

/* v12 responsive and visibility safeguards */
.custom-template-preview-controls[hidden],
.custom-template-preview-disclaimer[hidden] {
  display: none !important;
}

.custom-template-preview[data-device="mobile"] .custom-template-email-canvas {
  width: min(100%, 360px) !important;
  max-width: 360px;
}
/* END v12 responsive and visibility safeguards */

/* Accessible legal-document reacceptance dialog. */
body.legal-reaccept-open {
  overflow: hidden;
}

.legal-reaccept-modal {
  z-index: 120;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(3px);
}

.legal-reaccept-card {
  width: min(620px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 28px;
}

.legal-reaccept-card:focus {
  outline: none;
}

.legal-reaccept-card h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.15;
}

.legal-reaccept-intro {
  margin: 14px 0 20px;
  color: #475569;
  line-height: 1.55;
}

.legal-reaccept-options {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
}

.legal-reaccept-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #dbe4f0;
  border-radius: 15px;
  background: #f8fafc;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.legal-reaccept-option:focus-within {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.legal-reaccept-option input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: #2563eb;
  cursor: pointer;
}

.legal-reaccept-option a {
  color: #1d4ed8;
  font-weight: 700;
  line-height: 1.45;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.legal-reaccept-option a::after {
  content: "↗";
  display: inline-block;
  margin-left: 0.35em;
  font-size: 0.82em;
  text-decoration: none;
}

.legal-reaccept-option a:hover {
  color: #1e40af;
}

.legal-reaccept-message {
  min-height: 1.5em;
  margin: 8px 0 14px;
  color: #64748b;
  line-height: 1.45;
}

.legal-reaccept-message[data-state="error"] {
  color: #b91c1c;
}

.legal-reaccept-card [data-accept]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

@media (max-width: 520px) {
  .legal-reaccept-modal {
    padding: 12px;
  }

  .legal-reaccept-card {
    max-height: calc(100dvh - 24px);
    padding: 22px 18px;
    border-radius: 22px;
  }

  .legal-reaccept-card h2 {
    font-size: 1.65rem;
  }

  .legal-reaccept-option {
    padding: 13px;
  }
}
