:root {
  --desktop-ui-zoom: 1;
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-solid: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(29, 29, 31, 0.11);
  --line-strong: rgba(29, 29, 31, 0.18);
  --green: #217f52;
  --green-dark: #176c43;
  --green-soft: #e8f5ee;
  --blue: #246b8f;
  --blue-soft: #e7f1f6;
  --amber: #a86810;
  --amber-soft: #fff2d9;
  --red: #b74242;
  --red-soft: #fdeaea;
  --side: #173323;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.07);
  --focus-ring: 0 0 0 4px rgba(33, 127, 82, 0.16);
  --motion: cubic-bezier(0.2, 0.8, 0.2, 1);
  --word-export-head-top: 154px;
  --word-export-head-space: 76px;
}

/* 桌面端与移动端均保持原始尺寸，保障页面可读性。 */
@media (min-width: 981px) {
  html {
    zoom: var(--desktop-ui-zoom);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

.app-shell.auth-hidden,
.auth-hidden,
.auth-page.hidden,
.auth-panel.hidden {
  display: none;
}

.auth-page {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 1000;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: auto;
  background:
    linear-gradient(135deg, rgba(31, 122, 77, 0.08), rgba(36, 107, 143, 0.05)),
    var(--bg);
}

.auth-card {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 26px;
  box-shadow: 0 18px 45px rgba(32, 53, 42, 0.12);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.auth-brand strong,
.auth-brand span {
  display: block;
}

.auth-brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.auth-panel {
  display: grid;
  gap: 14px;
}

.auth-panel h1 {
  margin: 0 0 4px;
  font-size: 24px;
}

.auth-tip {
  margin: -4px 0 2px;
  color: var(--muted);
  line-height: 1.6;
}

.auth-main-button {
  width: 100%;
  min-height: 42px;
}

.auth-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-status.error {
  color: var(--red);
}

.auth-status.success {
  color: var(--green);
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.auth-links button {
  border: 0;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  padding: 0;
  font-weight: 700;
}

.site-filing-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.site-filing-footer a {
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}

.site-filing-footer a:hover {
  text-decoration: underline;
}

.filing-divider {
  color: rgba(29, 29, 31, 0.24);
}

.auth-filing-footer {
  position: fixed;
  right: 20px;
  bottom: 16px;
  left: 20px;
  z-index: 1001;
}

.app-filing-footer {
  padding: 0 28px 24px;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--side);
  color: #eef7f1;
  padding: 12px 22px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  margin-bottom: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e9f5ec;
  color: var(--side);
  font-weight: 800;
}

.brand span {
  display: block;
  margin-top: 3px;
  color: #b7c8bf;
  font-size: 12px;
}

.nav {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: thin;
}

.nav::-webkit-scrollbar {
  height: 6px;
}

.nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}

.nav-item {
  flex: 0 0 auto;
  width: auto;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d9e8df;
  text-align: center;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.nav-item.restricted-nav {
  color: rgba(217, 232, 223, 0.48);
}

.nav-item.restricted-nav::after {
  content: " 仅白名单";
  display: inline-block;
  margin-left: 6px;
  margin-top: 0;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(217, 232, 223, 0.72);
  font-size: 10px;
}

.main {
  min-width: 0;
  width: 100%;
  padding: 28px;
}

.project-toolbar {
  position: sticky;
  top: 70px;
  z-index: 45;
  margin: -6px -28px 18px;
  padding: 14px 28px 12px;
  background: rgba(245, 245, 247, 0.92);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(29, 29, 31, 0.06);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}

.project-toolbar.hidden-toolbar {
  display: none;
}

.managed-account-banner:not(.hidden) + .project-toolbar {
  top: 128px;
}

.managed-account-banner {
  position: sticky;
  top: 70px;
  z-index: 52;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -6px -28px 18px;
  padding: 12px 28px;
  border-bottom: 1px solid rgba(16, 94, 72, 0.18);
  background: rgba(231, 244, 238, 0.95);
  box-shadow: 0 8px 22px rgba(29, 29, 31, 0.06);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}

.managed-account-banner.hidden {
  display: none;
}

.managed-account-banner span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.managed-account-banner strong {
  color: var(--ink);
  font-size: 15px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-bottom: 20px;
}

.topbar.hidden-topbar {
  display: none;
}

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

.save-feedback {
  min-width: 92px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
  letter-spacing: 0;
}

.account {
  min-width: 178px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px 14px;
}

.account span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.account strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

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

.page-tabs.hidden-tabs {
  display: none;
}

.page-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  cursor: pointer;
}

.page-tab.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
  font-weight: 700;
}

.project-toolbar .topbar {
  gap: 16px;
  margin-bottom: 0;
  padding: 0;
}

.project-toolbar .project-context {
  flex: 0 1 auto;
  min-width: 0;
  max-width: clamp(220px, 24vw, 460px);
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.project-toolbar .eyebrow {
  flex: 0 0 auto;
  margin: 0;
  font-size: 22px;
  line-height: 1.22;
  font-weight: 700;
  white-space: nowrap;
}

.project-toolbar h1 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 22px;
  line-height: 1.22;
}

.project-toolbar .topbar-actions {
  flex: 0 0 auto;
}

.project-toolbar .secondary-button {
  min-height: 34px;
  padding: 0 14px;
}

.project-toolbar .save-project-button {
  min-height: 38px;
  padding: 0 20px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(33, 127, 82, 0.24);
}

.project-toolbar .page-tabs {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.project-toolbar .page-tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
}

.page-tab.utility-tab {
  color: var(--muted);
}

.page.hidden {
  display: none;
}

.app-loading-status {
  min-height: 34px;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  border: 1px solid #c8ddd0;
  border-radius: 6px;
  background: #f5fbf7;
  color: var(--green);
  padding: 0 12px;
  font-size: 13px;
}

.app-loading-status.hidden {
  display: none;
}

.app-loading-status.error {
  border-color: #f0b7b7;
  background: #fff7f7;
  color: var(--red);
}

.app-loading-status.success {
  border-color: #b8dcc4;
  background: #f2fbf5;
  color: var(--green);
}

.regulatory-admin-panel.hidden {
  display: none;
}

.status-item {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.status-item span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf0ed;
  color: var(--muted);
  font-weight: 700;
}

.status-item.done span {
  background: var(--green-soft);
  color: var(--green);
}

.status-item.warning span {
  background: var(--amber-soft);
  color: var(--amber);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(340px, 1fr);
  gap: 16px;
}

#formulaPage {
  grid-template-columns: minmax(300px, 0.72fr) minmax(580px, 1.28fr);
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.full-span {
  grid-column: 1 / -1;
}

.word-export-panel {
  padding-top: var(--word-export-head-space);
}

.word-export-head {
  position: fixed;
  top: var(--word-export-head-top);
  left: 28px;
  right: 28px;
  z-index: 44;
  min-height: 50px;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: rgba(255, 255, 255, 0.96);
  padding: 12px 16px;
  box-shadow: 0 10px 24px rgba(29, 29, 31, 0.08);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}

.ingredient-query-page {
  grid-template-columns: 1fr;
}

.ingredient-query-hero {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 54px 28px;
  text-align: center;
}

.ingredient-query-hero h2 {
  font-size: 32px;
  line-height: 1.25;
}

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

.ingredient-query-search {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1fr 132px;
  border: 2px solid var(--green);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.ingredient-query-search input {
  min-height: 56px;
  border: 0;
  padding: 0 20px;
  outline: none;
  font-size: 18px;
}

.ingredient-query-search button {
  min-height: 56px;
  border: 0;
  border-radius: 0;
  font-size: 18px;
  font-weight: 800;
}

.ingredient-query-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 14px;
}

.ingredient-query-results {
  display: grid;
  gap: 16px;
}

.query-empty-state {
  border: 1px dashed #9fc4ad;
  border-radius: 8px;
  background: #fbfdfb;
  padding: 34px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.query-result-card {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.query-card-summary {
  border-radius: 8px;
  background: #f7faf7;
  padding: 18px;
}

.query-card-summary h3 {
  margin: 0 0 16px;
  font-size: 20px;
  line-height: 1.4;
}

.query-card-summary dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.query-card-summary dt {
  color: var(--muted);
  font-weight: 800;
}

.query-card-summary dd {
  margin: 0;
  line-height: 1.55;
  word-break: break-word;
}

.query-source-chips,
.query-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.query-source-chips span,
.query-pill-row span {
  border: 1px solid #bfe2cb;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}

.query-card-detail {
  display: grid;
  gap: 14px;
}

.query-section {
  border-left: 4px solid #10b89d;
  background: #fcfefd;
  padding: 2px 0 0 14px;
}

.query-section h4 {
  margin: 0 0 10px;
  font-size: 16px;
}

.query-section p {
  margin: 5px 0;
  line-height: 1.65;
}

.query-two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.query-usage-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.query-usage-card h5 {
  margin: 0 0 10px;
  font-size: 14px;
}

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

.query-mini-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13px;
}

.query-mini-table.compact {
  min-width: 480px;
}

.query-mini-table th,
.query-mini-table td {
  border: 1px solid #d5eee5;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.query-mini-table th {
  background: #f3faf7;
  color: var(--ink);
}

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

.query-safety-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.query-safety-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 800;
}

.query-safety-grid p,
.query-mini-table td {
  white-space: pre-wrap;
}

.query-authority-groups {
  display: grid;
  gap: 10px;
}

.query-authority-groups > div {
  border-left: 3px solid #bfe2cb;
  padding-left: 10px;
}

.query-authority-groups strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 12px;
}

.query-authority-groups p {
  margin: 0;
}

.query-muted {
  color: var(--muted);
}

.ingredient-query-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  background: #eef2f0;
}

.ingredient-query-footer p {
  margin-top: 8px;
  color: var(--muted);
}

.query-contact-list {
  display: grid;
  gap: 8px;
  text-align: right;
}

.query-contact-list strong {
  font-size: 30px;
}

.query-contact-list span {
  color: var(--muted);
  font-weight: 700;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title-action {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-title-action h2 {
  margin: 0;
}

.panel-head.slim-head {
  margin: 0 0 10px;
}

.primary-button,
.secondary-button,
.icon-button {
  min-height: 34px;
  border-radius: 6px;
  padding: 0 12px;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: white;
}

.secondary-button,
.icon-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.temp-library-toast {
  position: fixed;
  top: 72px;
  left: 50%;
  z-index: 2200;
  max-width: min(420px, calc(100vw - 40px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(25, 45, 34, 0.16);
  line-height: 1.55;
  font-weight: 700;
  text-align: center;
  transform: translateX(-50%);
}

.temp-library-toast.success {
  border-color: rgba(33, 127, 82, 0.28);
  background: var(--green-soft);
  color: var(--green-dark);
}

.temp-library-toast.warning {
  border-color: rgba(168, 104, 16, 0.28);
  background: var(--amber-soft);
  color: var(--amber);
}

.temp-library-toast.hiding {
  opacity: 0;
  transform: translate(-50%, -6px);
  transition: opacity 0.18s var(--motion), transform 0.18s var(--motion);
}

.temp-library-dialog-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 2150;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 28, 23, 0.36);
}

.temp-library-dialog {
  width: min(560px, 100%);
  max-height: min(680px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 22px 70px rgba(10, 24, 16, 0.24);
  overflow: hidden;
}

.temp-library-dialog-wide {
  width: min(920px, 100%);
}

.temp-library-dialog h2 {
  font-size: 18px;
  line-height: 1.35;
}

.temp-library-dialog-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-right: 4px;
}

.temp-library-dialog-message {
  color: var(--muted);
  line-height: 1.65;
  white-space: pre-wrap;
  margin: 0;
}

.temp-library-dialog-fields {
  display: grid;
  gap: 10px;
}

.temp-library-dialog-fields label {
  display: grid;
  gap: 6px;
}

.temp-library-dialog-fields span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.temp-library-dialog-fields input,
.temp-library-dialog-fields textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

.temp-library-dialog-fields textarea {
  min-height: 84px;
  resize: vertical;
}

.temp-library-choice-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.temp-library-choice {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.temp-library-choice:hover,
.temp-library-choice:focus {
  border-color: rgba(33, 127, 82, 0.42);
  background: var(--green-soft);
  outline: none;
}

.temp-library-choice strong,
.temp-library-choice span {
  display: block;
}

.temp-library-choice strong {
  line-height: 1.45;
}

.temp-library-choice span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.temp-library-choice-table-wrap {
  max-height: min(440px, calc(100vh - 260px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.temp-library-choice-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 13px;
}

.temp-library-choice-table th,
.temp-library-choice-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 9px 10px;
  vertical-align: top;
  line-height: 1.55;
  white-space: pre-wrap;
}

.temp-library-choice-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
  text-align: left;
}

.temp-library-choice-table th:first-child,
.temp-library-choice-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 88px;
  min-width: 88px;
  background: #fff;
}

.temp-library-choice-table th:first-child {
  z-index: 3;
  background: var(--surface);
}

.temp-library-choice-table tr:hover td {
  background: var(--green-soft);
}

.temp-library-choice-table .muted-cell {
  color: var(--muted);
}

.temp-library-choice-row-button {
  width: 68px;
  min-height: 34px;
  border: 1px solid rgba(33, 127, 82, 0.36);
  border-radius: 6px;
  background: #fff;
  color: var(--green);
  cursor: pointer;
  font-weight: 700;
}

.temp-library-choice-row-button:hover,
.temp-library-choice-row-button:focus {
  background: var(--green);
  color: #fff;
  outline: none;
}

.temp-library-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

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

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

.form-grid.compact-form-grid {
  align-items: end;
}

.form-grid.basic-form-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.form-grid.basic-form-grid > label {
  grid-column: span 3;
}

.form-grid.basic-form-grid > .basic-span-4 {
  grid-column: span 4;
}

.form-grid.basic-form-grid > .basic-span-9 {
  grid-column: span 9;
}

.form-grid.basic-form-grid > .basic-span-3 {
  grid-column: span 3;
}

.form-grid.basic-form-grid > .basic-span-2 {
  grid-column: span 2;
}

.full-field {
  grid-column: 1 / -1;
}

.hidden-field {
  display: none;
}

select[multiple] {
  height: auto;
  min-height: 128px;
  padding: 8px 10px;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.checkbox-line input {
  width: auto;
  height: auto;
}

.checkbox-line span {
  margin: 0;
}

textarea {
  width: 100%;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
  resize: vertical;
  font: inherit;
}

.check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 12px;
}

.check-group legend {
  color: var(--muted);
  font-size: 12px;
  padding: 0 6px;
}

.check-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.check-group label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.check-group input {
  width: auto;
  height: auto;
}

.check-group select,
.check-group input[type="number"] {
  width: auto;
  min-width: 92px;
  height: 34px;
  padding: 6px 8px;
}

.usage-reference-field textarea {
  min-height: 96px;
}

.efficacy-claim-field {
  align-content: start;
  min-height: 126px;
}

.efficacy-claim-options {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 14px;
  width: 100%;
}

.efficacy-claim-options label {
  min-width: 64px;
  white-space: nowrap;
}

.export-attachment-options {
  margin: 8px 0 14px;
}

.export-seal-position-options input[type="number"] {
  width: 82px;
}

.one-click-export-options {
  display: grid;
  gap: 8px;
}

.one-click-export-options .export-attachment-options {
  margin: 0;
}

.export-pdf-options.hidden-field {
  display: none;
}

.export-select-field {
  display: block;
  max-width: 760px;
  margin: 8px 0 14px;
}

.export-link-list {
  margin: 8px 0 0;
  padding-left: 20px;
}

.word-export-progress {
  display: grid;
  gap: 8px;
  width: min(100%, 760px);
  margin-top: 8px;
}

.word-export-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-weight: 700;
}

.word-export-progress-head span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.word-export-progress-head strong {
  flex: 0 0 auto;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.word-export-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eee8;
  box-shadow: inset 0 0 0 1px rgba(91, 132, 105, 0.14);
}

.word-export-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f9461, #7abb6e);
  transition: width 0.28s ease;
}

.word-export-progress.error .word-export-progress-head strong {
  color: #b42318;
}

.word-export-progress.error .word-export-progress-bar {
  background: linear-gradient(90deg, #d92d20, #f97066);
}

.word-export-progress.done .word-export-progress-bar {
  background: linear-gradient(90deg, #3e8f5a, #6fbf73);
}

.addable-field {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}

.addable-field.compact {
  margin-top: 8px;
}

.searchable-select {
  position: relative;
  min-width: 0;
}

.searchable-select-source {
  display: none;
}

.searchable-select-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.searchable-select.with-actions .searchable-select-control {
  grid-template-columns: minmax(0, 1fr) auto;
}

.searchable-select-input {
  padding-right: 30px;
}

.searchable-select.with-actions .searchable-select-input {
  padding-right: 10px;
}

.searchable-select-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.searchable-select-action {
  width: 34px;
  min-width: 34px;
  height: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--green);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.searchable-select-action:hover,
.searchable-select-action:focus-visible {
  border-color: rgba(33, 127, 82, 0.34);
  background: var(--green-soft);
  outline: none;
}

.searchable-select-action.danger {
  border-color: rgba(180, 35, 24, 0.24);
  color: #b42318;
}

.searchable-select-action.danger:hover,
.searchable-select-action.danger:focus-visible {
  border-color: rgba(180, 35, 24, 0.42);
  background: #fff1ec;
}

.searchable-select:not(.with-actions)::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}

.searchable-select.open:not(.with-actions)::after {
  top: 18px;
  transform: rotate(225deg);
}

.searchable-select-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.searchable-select-option {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  padding: 6px 8px;
  text-align: left;
  cursor: pointer;
}

.searchable-select-option:hover,
.searchable-select-option.active {
  background: var(--green-soft);
  color: var(--green);
}

.searchable-select-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-option-detail,
.searchable-select-empty {
  color: var(--muted);
  font-size: 12px;
}

.searchable-select-empty {
  padding: 8px;
}


label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.cosmetic-use-field {
  position: relative;
}

.cosmetic-use-field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.cosmetic-use-trigger {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 30px 0 10px;
  text-align: left;
  cursor: pointer;
  position: relative;
}

.cosmetic-use-trigger::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  opacity: 0.7;
}

.cosmetic-use-menu,
.cosmetic-use-submenu {
  display: none;
  position: absolute;
  z-index: 120;
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(20, 35, 27, 0.14);
  padding: 6px;
}

.cosmetic-use-menu {
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
}

.cosmetic-use-field.open .cosmetic-use-menu,
.cosmetic-use-field:hover .cosmetic-use-menu,
.cosmetic-use-item:hover .cosmetic-use-submenu,
.cosmetic-use-item.submenu-open .cosmetic-use-submenu {
  display: block;
}

.cosmetic-use-item {
  position: relative;
}

.cosmetic-use-submenu {
  top: -6px;
  left: calc(100% - 1px);
}

.cosmetic-use-submenu::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -10px;
  width: 10px;
}

.cosmetic-use-menu button,
.cosmetic-use-submenu button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 0 10px;
  cursor: pointer;
}

.cosmetic-use-menu button:hover,
.cosmetic-use-submenu button:hover {
  background: var(--green-soft);
  color: var(--green);
}

.cosmetic-use-item.has-submenu > button::after {
  content: ">";
  float: right;
  color: var(--muted);
}

input,
select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.upload-box {
  min-height: 86px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px dashed #9bb6a6;
  border-radius: 8px;
  background: #fbfdfb;
  cursor: pointer;
  margin-bottom: 14px;
}

.formula-import-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.formula-import-options .upload-box {
  margin-bottom: 0;
}

.formula-paste-box {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 86px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 10px;
  border: 1px dashed rgba(33, 127, 82, 0.45);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--ink);
  cursor: text;
  text-align: center;
  outline: none;
  transition:
    background-color 0.2s var(--motion),
    border-color 0.2s var(--motion),
    box-shadow 0.2s var(--motion),
    transform 0.2s var(--motion);
}

.formula-paste-box > * {
  position: relative;
  z-index: 1;
}

.formula-paste-box strong {
  color: var(--green);
}

.formula-paste-box span,
.formula-paste-box small {
  color: var(--muted);
  font-size: 13px;
}

.formula-paste-box small {
  display: block;
  min-height: 18px;
  font-size: 12px;
}

.formula-paste-progress {
  width: min(360px, 92%);
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--green);
}

.formula-paste-progress[hidden] {
  display: none;
}

.formula-paste-progress-track {
  height: 7px;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(33, 127, 82, 0.14);
  box-shadow: inset 0 0 0 1px rgba(33, 127, 82, 0.08);
}

.formula-paste-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #35a86f, var(--green));
  transition: width 0.28s var(--motion);
}

.formula-paste-progress b {
  min-width: 35px;
  color: currentColor;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.formula-paste-box:hover {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: var(--focus-ring);
}

.formula-paste-box.paste-active {
  border: 2px solid var(--green);
  background: linear-gradient(135deg, #eaf8f0 0%, #f8fdfa 72%);
  cursor: copy;
  box-shadow:
    0 0 0 4px rgba(33, 127, 82, 0.16),
    0 12px 28px rgba(33, 127, 82, 0.18);
  transform: translateY(-2px);
  animation: formula-paste-ready-pulse 1.05s ease-out 2;
}

.formula-paste-box.paste-active strong {
  color: #146c45;
}

.formula-paste-box.paste-active #formulaPasteHint,
.formula-paste-box.paste-active #formulaPasteStatus {
  color: #176b46;
  font-weight: 800;
}

.formula-paste-box.paste-active::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 42%;
  background: linear-gradient(
    105deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.72) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
  transform: translateX(-150%) skewX(-12deg);
  animation: formula-paste-ready-sweep 1.15s ease-out 1;
}

.formula-paste-box.paste-active::after {
  content: "✓ 已激活 · 可粘贴";
  position: absolute;
  z-index: 2;
  top: 7px;
  right: 9px;
  padding: 3px 8px;
  border: 1px solid rgba(33, 127, 82, 0.25);
  border-radius: 999px;
  background: #fff;
  color: #176b46;
  box-shadow: 0 3px 10px rgba(33, 127, 82, 0.12);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.4;
  pointer-events: none;
}

@keyframes formula-paste-ready-pulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(33, 127, 82, 0.38),
      0 8px 18px rgba(33, 127, 82, 0.12);
  }
  55% {
    box-shadow:
      0 0 0 9px rgba(33, 127, 82, 0.08),
      0 14px 32px rgba(33, 127, 82, 0.22);
  }
  100% {
    box-shadow:
      0 0 0 4px rgba(33, 127, 82, 0.16),
      0 12px 28px rgba(33, 127, 82, 0.18);
  }
}

@keyframes formula-paste-ready-sweep {
  0% {
    transform: translateX(-150%) skewX(-12deg);
  }
  100% {
    transform: translateX(360%) skewX(-12deg);
  }
}

.formula-paste-box.paste-busy {
  cursor: progress;
  border-style: solid;
  background: #f5fbf7;
}

.formula-paste-box.paste-waiting {
  cursor: default;
  border-color: #c28a1a;
  background: #fffaf0;
}

.formula-paste-box.paste-waiting .formula-paste-progress {
  color: #9a6700;
}

.formula-paste-box.paste-waiting .formula-paste-progress-track {
  background: rgba(194, 138, 26, 0.15);
}

.formula-paste-box.paste-waiting .formula-paste-progress-track i {
  background: linear-gradient(90deg, #e8b449, #c28a1a);
}

.formula-paste-box.paste-complete .formula-paste-progress-track i {
  background: linear-gradient(90deg, #28a66b, #16784a);
}

.formula-paste-box.paste-error {
  border-color: #c2413b;
  background: #fff7f6;
}

.formula-paste-box.paste-error .formula-paste-progress {
  color: #b42318;
}

.formula-paste-box.paste-error .formula-paste-progress-track i {
  background: #c2413b;
}

@media (prefers-reduced-motion: reduce) {
  .formula-paste-box.paste-active,
  .formula-paste-box.paste-active::before {
    animation: none;
    transform: none;
  }

  .formula-paste-progress-track i {
    transition: none;
  }
}

.formula-paste-mapping-dialog {
  width: min(920px, calc(100vw - 32px));
}

.formula-paste-mapping-note,
.formula-paste-mapping-error {
  margin: 0;
  font-size: 13px;
}

.formula-paste-mapping-note {
  color: var(--muted);
}

.formula-paste-mapping-error {
  min-height: 20px;
  color: #b42318;
}

.formula-paste-mapping-wrap {
  max-height: min(56vh, 520px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.formula-paste-mapping-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.formula-paste-mapping-table th,
.formula-paste-mapping-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.formula-paste-mapping-table th:first-child,
.formula-paste-mapping-table td:first-child {
  width: 86px;
}

.formula-paste-mapping-table th:nth-child(2),
.formula-paste-mapping-table td:nth-child(2) {
  width: 230px;
}

.formula-paste-mapping-table select {
  width: 100%;
  min-width: 150px;
}

.formula-paste-column-samples {
  display: grid;
  gap: 3px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.formula-paste-column-samples span {
  display: block;
}

@media (max-width: 760px) {
  .formula-import-options {
    grid-template-columns: 1fr;
  }

  .formula-paste-mapping-table th:first-child,
  .formula-paste-mapping-table td:first-child {
    width: 64px;
  }

  .formula-paste-mapping-table th:nth-child(2),
  .formula-paste-mapping-table td:nth-child(2) {
    width: 160px;
  }
}

.upload-box.drag-over {
  border-color: var(--green);
  background: var(--green-soft);
}

.upload-box input {
  display: none;
}

.upload-box strong {
  color: var(--green);
}

.upload-box span,
.empty {
  color: var(--muted);
  font-size: 13px;
}

.project-list-table td:last-child {
  min-width: 180px;
}

.data-table.project-list-table {
  table-layout: fixed;
  font-family: inherit;
}

#revisionHistoryPage .data-table {
  font-family: inherit;
}

.project-list-table th {
  position: relative;
  user-select: none;
}

.resizable-data-table th {
  position: relative;
  user-select: none;
}

.project-column-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
  touch-action: none;
}

.data-column-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
  touch-action: none;
}

.project-column-resizer::after {
  content: "";
  position: absolute;
  top: 20%;
  right: 3px;
  width: 1px;
  height: 60%;
  background: transparent;
}

.data-column-resizer::after {
  content: "";
  position: absolute;
  top: 20%;
  right: 3px;
  width: 1px;
  height: 60%;
  background: transparent;
}

.project-list-table th:hover .project-column-resizer::after {
  background: var(--green);
}

.resizable-data-table th:hover .data-column-resizer::after {
  background: var(--green);
}

.project-list-table tr.current-project-row td {
  background: #def1e6;
  box-shadow:
    inset 0 2px 0 #3a9762,
    inset 0 -2px 0 #3a9762;
}

.project-list-table tr.current-project-row td:first-child {
  box-shadow:
    inset 4px 0 0 #247a4c,
    inset 0 2px 0 #3a9762,
    inset 0 -2px 0 #3a9762;
}

.project-list-table tr.current-project-row td:last-child {
  box-shadow:
    inset -2px 0 0 #3a9762,
    inset 0 2px 0 #3a9762,
    inset 0 -2px 0 #3a9762;
}

#projectListBody tr[data-project-id] {
  position: relative;
  transform: translateZ(0);
  transition:
    transform 0.18s var(--motion),
    filter 0.18s var(--motion);
}

#projectListBody tr[data-project-id] td {
  transition:
    background-color 0.18s var(--motion),
    box-shadow 0.18s var(--motion);
}

#projectListBody tr[data-project-id]:hover,
#projectListBody tr[data-project-id]:focus-within {
  z-index: 1;
  transform: translateY(-3px) scale(1.002);
  filter: drop-shadow(0 10px 12px rgba(23, 78, 49, 0.18));
}

#projectListBody tr[data-project-id]:hover td,
#projectListBody tr[data-project-id]:focus-within td {
  background: #eaf7ef;
  box-shadow:
    inset 0 2px 0 rgba(33, 127, 82, 0.42),
    inset 0 -2px 0 rgba(33, 127, 82, 0.32);
}

.project-name-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
}

.current-project-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  background: #1f7a4d;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 0 9px;
  box-shadow: 0 2px 6px rgba(23, 78, 49, 0.22);
}

.current-project-open-button {
  border-color: #247a4c;
  background: #fff;
  color: #1b6f45;
  font-weight: 700;
}

body.resizing-project-column,
body.resizing-data-column {
  cursor: col-resize;
  user-select: none;
}

.project-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 8px;
}

.project-search-bar {
  display: flex;
  margin: 12px 0 8px;
}

.project-search-field {
  display: grid;
  gap: 6px;
  width: min(520px, 100%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.project-search-field input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  padding: 0 12px;
  outline: none;
}

.project-search-field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.filter-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 14px;
  cursor: pointer;
}

.filter-chip.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
  font-weight: 700;
}

.project-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-list-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.project-list-actions .project-delete-button {
  border-color: rgba(183, 66, 66, 0.34);
  background: var(--red-soft);
  color: var(--red);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(183, 66, 66, 0.08);
}

.project-list-actions .project-delete-button:not(:disabled):hover {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  box-shadow: 0 5px 14px rgba(183, 66, 66, 0.22);
}

.project-list-actions .project-delete-button:not(:disabled):active {
  border-color: #993535;
  background: #993535;
  color: #fff;
}

.project-list-actions .project-delete-button:focus-visible {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(183, 66, 66, 0.16);
}

.project-list-actions .project-delete-button:disabled {
  border-color: rgba(183, 66, 66, 0.2);
  background: rgba(253, 234, 234, 0.66);
  color: rgba(183, 66, 66, 0.72);
}

.project-audit-cell {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.project-audit-badge {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 0 10px;
  cursor: pointer;
}

.project-audit-badge.passed {
  border-color: rgba(33, 127, 82, 0.28);
  background: var(--green-soft);
  color: var(--green);
}

.project-audit-badge.attention {
  border-color: rgba(178, 72, 45, 0.28);
  background: #fff1ec;
  color: #a83b26;
}

.project-audit-action {
  min-height: 30px;
  padding: 0 12px;
}

.project-audit-action.needs-basics:disabled {
  border-color: #d8c59d;
  background: #fff8e8;
  color: #7b5a18;
  cursor: not-allowed;
  opacity: 1;
}

.project-audit-requirement {
  color: #8a641c;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.project-import-time {
  display: grid;
  justify-items: center;
  gap: 4px;
  line-height: 1.35;
}

.project-import-time time {
  font-variant-numeric: tabular-nums;
}

.project-import-time span {
  color: var(--muted);
  font-size: 11px;
}

.project-import-audit-summary {
  width: 100%;
  min-width: 190px;
  display: grid;
  grid-template-columns: repeat(2, minmax(76px, 1fr));
  gap: 5px;
  border: 1px solid rgba(33, 127, 82, 0.18);
  border-radius: 9px;
  background: #f8fbf9;
  color: var(--ink);
  padding: 7px;
  font: inherit;
  cursor: pointer;
}

.project-import-audit-summary > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 25px;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
}

.project-import-audit-summary > span b {
  font-weight: 700;
}

.project-import-audit-summary > span.passed {
  background: rgba(33, 127, 82, 0.09);
  color: var(--green);
}

.project-import-audit-summary > span.has-issue {
  background: #fff0df;
  color: #9a5412;
}

.project-import-audit-summary.pending {
  display: inline-flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  color: var(--muted);
}

.project-import-audit-summary.pending strong {
  color: #765d28;
}

.project-import-audit-summary.pending span {
  min-height: 0;
  padding: 0;
  background: transparent;
  font-size: 11px;
}

.project-audit-progress {
  display: grid;
  gap: 6px;
  width: min(100%, 132px);
  min-width: 112px;
}

.project-audit-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.project-audit-progress-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-audit-progress-head strong {
  flex: 0 0 auto;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.project-audit-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eee8;
  box-shadow: inset 0 0 0 1px rgba(91, 132, 105, 0.14);
}

.project-audit-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f9461, #7abb6e);
  transition: width 0.22s ease;
}

.project-audit-progress.error .project-audit-progress-head strong {
  color: #b42318;
}

.project-audit-progress.error .project-audit-progress-bar {
  background: linear-gradient(90deg, #d92d20, #f97066);
}

.project-audit-progress.done .project-audit-progress-bar {
  background: linear-gradient(90deg, #3e8f5a, #6fbf73);
}

.project-formula-file {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.project-formula-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-formula-actions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.project-material-cell {
  display: grid;
  gap: 8px;
  min-width: 260px;
}

.project-material-list {
  display: grid;
  gap: 8px;
}

.project-material-slot {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #fbfcfb;
}

.project-material-row,
.project-material-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
}

.project-material-input {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  font: inherit;
}

.project-material-files {
  display: grid;
  gap: 4px;
}

.project-material-file {
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}

.project-material-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-link-button {
  border: 0;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
}

.text-link-button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.55;
}

.project-status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.project-status.draft {
  background: var(--amber-soft);
  color: var(--amber);
}

.project-status.generated {
  background: var(--green-soft);
  color: var(--green);
}

.project-status.archived {
  background: #eef1ef;
  color: var(--muted);
}

.preset-note {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  padding: 10px 12px;
}

.assessment-note {
  margin-bottom: 14px;
}

.template-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

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

.template-summary.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.template-summary > div {
  position: relative;
  min-height: 76px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
}

.template-summary > div.copyable-summary {
  padding-right: 58px;
  padding-bottom: 34px;
}

.template-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.template-summary strong {
  display: block;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 700;
  white-space: pre-line;
  word-break: normal;
  overflow-wrap: anywhere;
}

.template-summary .summary-edit-area {
  width: 100%;
  min-height: 72px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #fffdf5;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  padding: 4px 6px 22px;
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.template-summary .summary-edit-area:focus {
  border-color: var(--green);
  outline: 2px solid rgba(46, 125, 89, 0.18);
}

.template-summary .summary-wide {
  grid-column: 1 / -1;
  max-height: 220px;
}

.account-license-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.account-license-detail {
  display: grid;
  gap: 14px;
}

.account-license-reminder {
  border: 1px solid #f1d38a;
  border-radius: 8px;
  background: #fff8e1;
  color: #7a5200;
  font-weight: 700;
  padding: 12px;
}

.account-license-reminder.urgent {
  border-color: #f2b8b5;
  background: #fff0ef;
  color: #9f1d18;
}

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

.account-license-grid > div,
.account-license-history {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.account-license-grid span,
.account-license-grid small {
  color: var(--muted);
  font-size: 12px;
}

.account-license-grid strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.3;
  margin: 5px 0;
}

.account-license-history h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.account-license-table {
  min-width: 760px;
}

.summary-subtitle {
  margin-top: 12px;
}

.formula-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.history-category-field {
  display: block;
  max-width: 360px;
  margin-bottom: 14px;
}

.formula-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.metric {
  display: block;
  color: var(--blue);
  font-size: 22px;
  font-weight: 800;
}

.formula-summary p,
.issue p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.lyophilized-basic-hint {
  grid-column: span 3;
  border: 1px solid #b9ddcd;
  border-radius: 8px;
  background: #f2faf6;
  padding: 9px 11px;
}

.lyophilized-basic-hint > span {
  display: block;
  color: #176e4a;
  font-size: 12px;
  margin-bottom: 4px;
}

.lyophilized-basic-hint p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.lyophilized-mix-panel {
  border: 1px solid #b9ddcd;
  border-radius: 8px;
  background: #f2faf6;
  margin: 0 0 14px;
  padding: 12px;
}

.lyophilized-mix-panel > strong {
  color: #176e4a;
  font-size: 14px;
}

.lyophilized-mix-panel > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 5px 0 8px;
}

.lyophilized-mix-status {
  border-top: 1px solid #d6eadf;
  color: #315b4a;
  font-size: 13px;
  line-height: 1.55;
  padding-top: 8px;
}

.lyophilized-mix-status.warning {
  color: #9a5b00;
}

.lyophilized-mix-status.error {
  color: var(--danger);
}

.lyophilized-formula-control {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 12px;
}

.lyophilized-input-group {
  display: grid;
  gap: 4px;
}

.lyophilized-input-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.lyophilized-input-line {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.lyophilized-formula-control input[type="number"] {
  width: 82px;
  min-width: 0;
  padding: 6px 7px;
}

.lyophilized-formula-control .density-input {
  width: 68px;
}

.lyophilized-role-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.lyophilized-mass-value {
  white-space: nowrap;
}

.mini-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

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

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

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

.tag,
.issue-mark {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
}

.tag.ok,
.issue-mark.ok {
  background: var(--green-soft);
  color: var(--green);
}

.tag.warn-tag {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.market-listed-tag {
  background: rgb(173, 216, 230);
  color: #1f5f80;
}

.tag.market-listed-info-tag {
  background: #eee7fb;
  color: #5b4b8a;
}

.tag.market-index-tag {
  background: rgb(144, 238, 144);
  color: #176c43;
}

.tag.database-match-tag {
  background: #f6ecd2;
  color: #6f5418;
}

.tag.danger-tag {
  background: #ffe4e4;
  color: #d01818;
}

.mini-action-button {
  display: block;
  min-height: 26px;
  margin: 6px auto 0;
  border: 1px solid var(--red);
  border-radius: 6px;
  background: #fff;
  color: var(--red);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.issue-mark.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.issue-mark.danger {
  background: var(--red-soft);
  color: var(--red);
}

.issue-mark.info {
  background: var(--blue-soft);
  color: var(--blue);
}

#smartSelectAuthorityButton,
#stripAuthorityPreambleButton {
  min-height: 40px;
  border-radius: 9px;
  padding: 0 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    filter 160ms ease;
}

#smartSelectAuthorityButton {
  border: 1px solid rgba(86, 72, 220, 0.26);
  background: linear-gradient(135deg, #6254e8 0%, #3b82f6 52%, #08a6b5 100%);
  box-shadow:
    0 7px 18px rgba(77, 91, 220, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  color: #fff;
}

#smartSelectAuthorityButton::before {
  content: "✦";
  display: inline-block;
  margin-right: 7px;
  color: #dffcff;
  font-size: 15px;
  line-height: 1;
  text-shadow: 0 0 9px rgba(223, 252, 255, 0.8);
}

#smartSelectAuthorityButton:hover {
  filter: saturate(1.08) brightness(1.04);
  transform: translateY(-2px);
  box-shadow:
    0 10px 24px rgba(77, 91, 220, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

#stripAuthorityPreambleButton {
  border: 1px solid rgba(188, 137, 33, 0.42);
  background: linear-gradient(180deg, #fffdf7 0%, #fff3d8 100%);
  box-shadow: 0 5px 13px rgba(150, 104, 20, 0.12);
  color: #76510c;
}

#stripAuthorityPreambleButton::before {
  content: "◇";
  display: inline-block;
  margin-right: 6px;
  color: #b27a15;
  font-size: 14px;
  line-height: 1;
}

#stripAuthorityPreambleButton:hover {
  border-color: rgba(174, 118, 17, 0.7);
  background: linear-gradient(180deg, #fffaf0 0%, #ffe9ba 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(150, 104, 20, 0.18);
}

#smartSelectAuthorityButton:active,
#stripAuthorityPreambleButton:active {
  transform: translateY(0);
}

#smartSelectAuthorityButton:focus-visible,
#stripAuthorityPreambleButton:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.28);
  outline-offset: 2px;
}

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

.issue-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.issue-column {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.issue-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #2c332f;
  font-size: 13px;
  font-weight: 800;
}

.issue-section-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.issue-section-title span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.issue-column-list {
  display: grid;
  gap: 6px;
  max-height: 286px;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-gutter: stable;
}

.issue {
  position: relative;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.audit-not-imported {
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  border-style: dashed;
  background: #f7faf8;
}

.audit-not-imported strong {
  display: block;
  color: #2c332f;
}

.audit-not-imported p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.compact-issue,
.audit-empty-issue {
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 7px;
  padding: 7px 50px 7px 9px;
}

.audit-empty-issue {
  padding-right: 9px;
}

.compact-issue strong,
.audit-empty-issue strong {
  font-size: 12px;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.compact-issue p {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.compact-issue .issue-mark,
.audit-empty-issue .issue-mark {
  min-height: 22px;
  padding: 0 6px;
  font-size: 11px;
}

.issue-more {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.copy-text-button {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-height: 22px;
  border: 1px solid rgba(46, 125, 89, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--green);
  padding: 0 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(25, 45, 34, 0.08);
}

.copy-text-button:hover,
.copy-text-button:focus-visible {
  border-color: rgba(46, 125, 89, 0.45);
  background: var(--green-soft);
  outline: none;
}

.copy-text-button.copied {
  border-color: rgba(33, 127, 82, 0.4);
  background: var(--green-soft);
  color: var(--green-dark);
}

.inline-copy-button {
  position: static;
  min-height: 21px;
  padding: 0 6px;
  box-shadow: none;
}

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

  .issue-column-list {
    max-height: 240px;
  }
}

.flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.flow-step {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.flow-step.complete {
  border-color: #b8d9c4;
  background: var(--green-soft);
  color: var(--green);
}

.flow-step.active {
  border-color: #b8d2df;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

.export-list {
  display: grid;
  gap: 8px;
}

.export-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}

.export-list span {
  color: var(--muted);
}

.tools-row {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(160px, 220px);
  gap: 12px;
  margin-bottom: 14px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.literature-sort-control {
  display: inline-flex;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.literature-sort-button {
  min-height: 28px;
  border-color: transparent;
  background: transparent;
}

.literature-sort-control .literature-sort-button.active {
  border-color: rgba(33, 127, 82, 0.28);
  background: var(--green-soft);
  color: var(--green);
  font-weight: 700;
}

.compact-select {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.compact-select span {
  color: var(--muted);
  font-size: 12px;
}

.compact-select select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
  font: inherit;
}

.inline-action-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.head-with-search {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  min-width: 0;
}

.head-search {
  min-width: 320px;
  max-width: 520px;
}

.temp-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(320px, 520px) minmax(160px, 240px);
  gap: 12px;
  margin-bottom: 14px;
}

.temp-table {
  min-width: 1280px;
}

.temp-table td[contenteditable="true"] {
  min-width: 120px;
}

.large-output {
  min-height: 260px;
  font-family: "Times New Roman", "SimSun", "宋体", serif;
  line-height: 1.7;
}

.resume-textarea {
  min-height: 180px;
}

.resume-table {
  min-width: 920px;
}

.signature-field > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

.seal-default-grid {
  margin-top: 10px;
}

.drag-upload-field > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

.drag-upload-zone {
  transition:
    background-color 0.2s var(--motion),
    border-color 0.2s var(--motion),
    box-shadow 0.2s var(--motion);
}

.drag-upload-zone.drag-over,
.drag-upload-zone:focus-visible {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: var(--focus-ring);
  outline: none;
}

.regulatory-file-dropzone {
  min-height: 76px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: #fffdfa;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
}

.regulatory-file-dropzone strong {
  color: var(--green);
}

.regulatory-file-dropzone span {
  color: var(--muted);
  font-size: 13px;
}

.signature-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.signature-preview {
  min-height: 82px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: #fffdfa;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
}

.signature-preview.drag-upload-zone {
  cursor: pointer;
}

.signature-preview img {
  max-width: 220px;
  max-height: 72px;
  object-fit: contain;
}

.resume-docx-preview {
  min-height: 58px;
  justify-content: flex-start;
  text-align: left;
  font-weight: 700;
}

.rich-output {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 14px;
  white-space: pre-wrap;
  outline: none;
}

.rich-output:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.rich-output .material-marker {
  font-weight: 700;
}

.rich-output sup {
  font-size: 70%;
  line-height: 0;
  vertical-align: super;
}

.readonly-output {
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.appendix-editor {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.appendix-output {
  min-height: 96px;
}

.appendix-table {
  min-width: 1480px;
}

.data-table.appendix-table td {
  padding-top: 5px;
  padding-bottom: 5px;
}

.appendix-table th:first-child,
.appendix-table td:first-child {
  width: 64px;
}

.appendix-table th:last-child,
.appendix-table td:last-child {
  width: 410px;
  white-space: nowrap;
}

.appendix-table th:nth-child(3),
.appendix-table td:nth-child(3) {
  width: 500px;
}

.appendix-file-cell,
.appendix-file-list {
  display: grid;
  gap: 8px;
}

.appendix-file-cell {
  position: relative;
  min-height: 0;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  transition:
    border-color 0.18s var(--motion),
    background 0.18s var(--motion),
    box-shadow 0.18s var(--motion);
}

.appendix-file-cell.is-file-drag-over {
  border-color: var(--green);
  background: #eef8f2;
  box-shadow: var(--focus-ring);
}

.appendix-file-cell.is-move-drag-over {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 4px rgba(36, 107, 143, 0.14);
}

.appendix-empty-upload,
.appendix-add-file-button {
  width: 100%;
  border: 1px dashed rgba(33, 127, 82, 0.42);
  border-radius: 8px;
  color: var(--green-dark);
  background: rgba(232, 245, 238, 0.46);
  cursor: pointer;
  transition:
    transform 0.16s var(--motion),
    border-color 0.16s var(--motion),
    background 0.16s var(--motion),
    box-shadow 0.16s var(--motion);
}

.appendix-empty-upload {
  min-height: 46px;
  display: grid;
  place-content: center;
  gap: 2px;
  padding: 4px 10px;
  text-align: center;
}

.appendix-empty-upload strong {
  font-size: 14px;
  font-weight: 650;
}

.appendix-empty-upload span,
.appendix-add-file-button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.appendix-empty-upload:hover,
.appendix-add-file-button:hover {
  border-color: var(--green);
  background: var(--green-soft);
  transform: translateY(-1px);
}

.appendix-empty-upload:active,
.appendix-add-file-button:active {
  transform: translateY(0) scale(0.995);
}

.appendix-empty-upload:disabled,
.appendix-add-file-button:disabled {
  border-color: var(--line);
  color: var(--muted);
  background: #f5f5f5;
  cursor: not-allowed;
  transform: none;
}

.appendix-empty-upload:focus-visible,
.appendix-add-file-button:focus-visible,
.appendix-upload-retry:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.appendix-add-file-button {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  font-weight: 600;
}

.appendix-file-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  cursor: grab;
  transition:
    border-color 0.16s var(--motion),
    background 0.16s var(--motion),
    box-shadow 0.16s var(--motion),
    transform 0.16s var(--motion);
}

.appendix-file-item.is-syncing {
  border-color: rgba(33, 127, 82, 0.42);
  background: #f2faf5;
  box-shadow: inset 3px 0 0 var(--green);
}

.appendix-file-item.is-drop-before::before,
.appendix-file-item.is-drop-after::after {
  content: "";
  position: absolute;
  right: 4px;
  left: 4px;
  z-index: 3;
  height: 3px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(33, 127, 82, 0.12);
}

.appendix-file-item.is-drop-before::before {
  top: -6px;
}

.appendix-file-item.is-drop-after::after {
  bottom: -6px;
}

.appendix-file-item:hover {
  border-color: rgba(33, 127, 82, 0.3);
  background: #f7fbf8;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.appendix-file-item.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
  transform: scale(0.99);
}

.appendix-file-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.appendix-file-type {
  flex: 0 0 auto;
  min-width: 42px;
  padding: 4px 6px;
  border-radius: 5px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.appendix-file-details {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.appendix-file-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.appendix-file-meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.appendix-file-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.appendix-file-actions .text-link-button {
  min-height: 32px;
  padding: 4px 7px;
  border-radius: 5px;
}

.appendix-file-actions .text-link-button:hover {
  background: var(--green-soft);
}

.appendix-file-actions .appendix-order-button {
  min-width: 27px;
  padding-right: 5px;
  padding-left: 5px;
  font-size: 16px;
  line-height: 1;
}

.appendix-file-actions .text-link-button:disabled {
  color: #a9b2ac;
  background: transparent;
  cursor: not-allowed;
}

.appendix-file-sync-status {
  position: absolute;
  top: 4px;
  right: 6px;
  padding: 1px 5px;
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(232, 245, 238, 0.94);
  font-size: 10px;
  pointer-events: none;
}

.appendix-file-actions .danger-link-button {
  color: var(--red);
}

.appendix-file-actions .danger-link-button:hover {
  background: var(--red-soft);
}

.appendix-upload-progress {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #d8eadf;
  border-radius: 8px;
  background: #f5fbf7;
}

.appendix-upload-progress.has-error {
  border-color: rgba(183, 66, 66, 0.28);
  background: #fff8f8;
}

.appendix-upload-progress.is-success {
  border-color: rgba(33, 127, 82, 0.3);
  background: var(--green-soft);
}

.appendix-upload-progress-title {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.appendix-upload-progress-item {
  display: grid;
  gap: 4px;
}

.appendix-upload-progress-item.has-error {
  padding-top: 2px;
}

.appendix-upload-progress-label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.appendix-upload-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appendix-upload-progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce8df;
}

.appendix-upload-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #62b77f);
  transition: width 0.18s ease;
}

.appendix-upload-progress-item.has-error .appendix-upload-progress-track span {
  background: var(--red);
}

.appendix-upload-error {
  color: var(--red);
  font-size: 12px;
  line-height: 1.45;
}

.appendix-upload-retry {
  justify-self: start;
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid rgba(183, 66, 66, 0.26);
  border-radius: 6px;
  color: var(--red);
  background: #fff;
  cursor: pointer;
}

.appendix-upload-retry:hover {
  background: var(--red-soft);
}

.appendix-drop-feedback {
  position: absolute;
  inset: 4px;
  z-index: 3;
  display: none;
  place-content: center;
  border: 1px dashed currentColor;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  font-size: 14px;
  font-weight: 650;
  text-align: center;
  pointer-events: none;
}

.appendix-file-cell.is-file-drag-over .appendix-drop-feedback,
.appendix-file-cell.is-move-drag-over .appendix-drop-feedback {
  display: grid;
}

.appendix-file-cell.is-file-drag-over .appendix-drop-feedback {
  color: var(--green-dark);
}

.appendix-file-cell.is-move-drag-over .appendix-drop-feedback {
  color: var(--blue);
}

.appendix-drop-feedback [data-appendix-file-drop-label],
.appendix-drop-feedback [data-appendix-move-drop-label] {
  display: none;
}

.appendix-file-cell.is-file-drag-over [data-appendix-file-drop-label],
.appendix-file-cell.is-move-drag-over [data-appendix-move-drop-label] {
  display: block;
}

.comprehensive-table {
  min-width: 1120px;
}

.comprehensive-table th:last-child,
.comprehensive-table td:last-child {
  width: 330px;
}

.appendix-name-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 8px;
  align-items: center;
}

.appendix-name-input,
.appendix-preset-select,
.comprehensive-content-input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  font: inherit;
  background: #fff;
}

.appendix-preset-select {
  color: var(--muted);
}

.comprehensive-content-input {
  height: 36px;
  min-height: 36px;
  resize: vertical;
  line-height: 1.4;
}

.deleted-row {
  color: var(--muted);
  background: #f7f7f5;
}

.deleted-row .appendix-name-input,
.deleted-row .comprehensive-content-input {
  text-decoration: line-through;
}

.result-tables {
  display: grid;
  gap: 16px;
}

.data-table-wrap {
  position: relative;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(104, 112, 106, 0.82) rgba(232, 235, 232, 0.96);
}

.data-table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.data-table-wrap::-webkit-scrollbar-track {
  background: rgba(232, 235, 232, 0.96);
  border-radius: 999px;
}

.data-table-wrap::-webkit-scrollbar-thumb {
  min-width: 72px;
  border: 3px solid rgba(232, 235, 232, 0.96);
  border-radius: 999px;
  background: rgba(104, 112, 106, 0.82);
}

.data-table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(73, 82, 76, 0.9);
}

.data-table-wrap::-webkit-scrollbar-corner {
  background: rgba(232, 235, 232, 0.96);
}

.persistent-table-scrollbar {
  position: sticky;
  left: 8px;
  bottom: 6px;
  z-index: 6;
  height: 14px;
  margin: 6px 8px 5px;
  border-radius: 999px;
  background: rgba(226, 229, 226, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(29, 29, 31, 0.08),
    0 1px 3px rgba(29, 29, 31, 0.08);
  cursor: pointer;
  user-select: none;
}

.persistent-table-scrollbar.hidden {
  display: none;
}

.persistent-table-scrollbar-thumb {
  width: var(--persistent-scroll-thumb-width, 80px);
  height: 100%;
  border: 3px solid rgba(226, 229, 226, 0.96);
  border-radius: 999px;
  background: rgba(103, 111, 105, 0.86);
  transform: translateX(var(--persistent-scroll-thumb-x, 0));
  transition: background-color 0.15s var(--motion);
}

.persistent-table-scrollbar:hover .persistent-table-scrollbar-thumb,
.persistent-table-scrollbar.dragging .persistent-table-scrollbar-thumb {
  background: rgba(70, 80, 73, 0.92);
}

table[data-cell-selection-table] :is(thead th, thead td, tbody th, tbody td) {
  cursor: cell;
  touch-action: manipulation;
}

table[data-cell-selection-table]:focus {
  outline: none;
}

table[data-cell-selection-table] tbody td[contenteditable="true"] {
  cursor: cell;
}

table[data-cell-selection-table] tbody td.table-cell-editing {
  cursor: text;
}

table[data-cell-selection-table] :is(thead th, thead td, tbody th, tbody td).table-cell-selected {
  box-shadow: inset 0 0 0 9999px rgba(33, 127, 82, 0.1);
}

table[data-cell-selection-table] :is(thead th, thead td, tbody th, tbody td).table-cell-active {
  box-shadow: inset 0 0 0 9999px rgba(33, 127, 82, 0.1);
}

table[data-cell-selection-table] tbody td.table-cell-editing {
  /* Keep the selected fill unchanged when editing starts: only the caret and
     inner border appear, avoiding the perceptible double-click flash. */
  background: transparent;
  caret-color: #217f52;
  box-shadow:
    inset 0 0 0 1.5px rgba(33, 127, 82, 0.96),
    inset 0 0 0 9999px rgba(33, 127, 82, 0.1);
  transition: none !important;
}

body.table-cell-selecting,
body.table-cell-selecting * {
  cursor: cell !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.table-selection-outline {
  position: absolute;
  z-index: 7;
  pointer-events: none;
  border: 2px solid rgba(33, 127, 82, 0.96);
  border-radius: 2px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.8),
    0 2px 8px rgba(20, 92, 57, 0.16);
}

.table-selection-status {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 1200;
  width: max-content;
  max-width: calc(100vw - 24px);
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(33, 127, 82, 0.26);
  border-radius: 999px;
  background: rgba(247, 252, 249, 0.96);
  color: #175e3c;
  box-shadow: 0 4px 14px rgba(20, 92, 57, 0.16);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.regulatory-page {
  align-items: start;
}

.regulatory-section-tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f3f6f4;
  box-shadow: var(--shadow-sm);
}

.regulatory-section-tab {
  min-height: 40px;
  flex: 1 1 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #59635d;
  cursor: pointer;
  font-weight: 800;
}

.regulatory-section-tab.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 2px 10px rgba(32, 53, 42, 0.08);
}

.regulatory-tab-panel {
  display: grid;
  gap: 18px;
}

.regulatory-tab-panel.hidden,
.regulatory-tab-panel[hidden] {
  display: none;
}

.regulatory-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border: 1px solid rgba(29, 29, 31, 0.09);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(232, 245, 238, 0.9), rgba(255, 255, 255, 0.94) 48%, rgba(231, 241, 246, 0.7)),
    var(--surface-solid);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.regulatory-kicker,
.regulatory-viewer-label {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.regulatory-hero h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
}

.regulatory-hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

.regulatory-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.regulatory-overview > div {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.regulatory-overview span {
  color: var(--muted);
  font-size: 12px;
}

.regulatory-overview strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
}

.regulatory-admin-panel {
  border-color: rgba(33, 127, 82, 0.2);
}

.regulatory-feed-shell {
  display: block;
}

.regulatory-browser,
.regulatory-intelligence-browser {
  min-width: 0;
  width: min(960px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.regulatory-browser,
.regulatory-intelligence-browser {
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.regulatory-browser-head,
.regulatory-viewer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  background: #f7f9f8;
  padding: 14px 16px;
}

.regulatory-browser-head h3,
.regulatory-viewer-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.35;
}

.regulatory-filter-count {
  min-width: 62px;
  min-height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(33, 127, 82, 0.18);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.regulatory-browser-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.regulatory-browser-actions .hidden,
.regulatory-browser-actions [hidden] {
  display: none;
}

.regulatory-toolbar {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.regulatory-search {
  display: grid;
  gap: 6px;
}

.regulatory-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.regulatory-search input {
  min-height: 38px;
}

.regulatory-type-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.regulatory-intelligence-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(130px, 0.75fr)) minmax(132px, 0.65fr) minmax(132px, 0.65fr);
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.regulatory-intelligence-toolbar label {
  display: grid;
  align-content: start;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.regulatory-intelligence-toolbar input,
.regulatory-intelligence-toolbar select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
}

.regulatory-intelligence-list {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  background: #fbfcfb;
}

.regulatory-intelligence-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  cursor: pointer;
  transition:
    border-color 0.18s var(--motion),
    box-shadow 0.18s var(--motion),
    transform 0.18s var(--motion);
}

.regulatory-intelligence-card:hover,
.regulatory-intelligence-card:focus-within {
  border-color: rgba(33, 127, 82, 0.34);
  box-shadow: 0 8px 22px rgba(32, 53, 42, 0.08);
}

.regulatory-intelligence-card-main {
  min-width: 0;
}

.regulatory-intelligence-card-meta,
.regulatory-intelligence-card-foot,
.regulatory-intelligence-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.regulatory-intelligence-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
}

.regulatory-intelligence-badge.authorized {
  background: #fff4d8;
  color: #805b12;
}

.regulatory-intelligence-badge.ai {
  background: #e8efff;
  color: #315fa7;
}

.regulatory-intelligence-card h4 {
  margin: 10px 0 7px;
  font-size: 16px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.regulatory-intelligence-card p {
  display: -webkit-box;
  margin: 0 0 12px;
  overflow: hidden;
  color: #4e5651;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.regulatory-intelligence-card-actions {
  display: grid;
  align-content: center;
}

.regulatory-list {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  background: #fbfcfb;
}

.regulatory-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  cursor: pointer;
  transition:
    border-color 0.18s var(--motion),
    box-shadow 0.18s var(--motion),
    transform 0.18s var(--motion);
}

.regulatory-item:hover,
.regulatory-item.active {
  border-color: rgba(33, 127, 82, 0.34);
  box-shadow: 0 8px 22px rgba(32, 53, 42, 0.08);
}

.regulatory-item.active {
  background: #f8fcfa;
}

.regulatory-item-main {
  min-width: 0;
}

.regulatory-item-meta,
.regulatory-item-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.regulatory-file-badge {
  color: var(--green);
  font-weight: 800;
}

.regulatory-item h4 {
  margin: 8px 0 6px;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.regulatory-item p {
  display: -webkit-box;
  margin: 0 0 10px;
  overflow: hidden;
  color: #4e5651;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.regulatory-item-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.regulatory-item-actions .mini-button {
  min-width: 58px;
}

.regulatory-official-action {
  color: #17633d;
  text-align: center;
  text-decoration: none;
}

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

.regulatory-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 24px;
}

.regulatory-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 24, 20, 0.58);
}

.regulatory-preview-dialog {
  position: relative;
  z-index: 1;
  width: min(1480px, 96vw);
  height: min(940px, 92vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.regulatory-preview-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.regulatory-preview-actions .hidden,
.regulatory-preview-actions [hidden] {
  display: none;
}

.regulatory-preview-actions .icon-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  font-size: 22px;
  line-height: 1;
}

.regulatory-viewer-head {
  align-items: center;
  padding: 18px 22px;
}

.regulatory-viewer-head > div {
  min-width: 0;
}

.regulatory-viewer-head h3 {
  font-size: 20px;
  overflow-wrap: anywhere;
}

.regulatory-viewer {
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 26px;
  background: #f4f6f5;
}

.regulatory-intelligence-detail {
  padding: 28px;
}

.regulatory-intelligence-article {
  width: min(980px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: clamp(20px, 4vw, 42px);
  box-shadow: var(--shadow-sm);
}

.regulatory-intelligence-article-cover {
  width: 100%;
  max-height: 360px;
  margin: 0 0 24px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--green-soft);
}

.regulatory-intelligence-article-section {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.regulatory-intelligence-article-section:first-of-type {
  margin-top: 22px;
}

.regulatory-intelligence-article-section h4 {
  margin: 0 0 10px;
  font-size: 17px;
}

.regulatory-intelligence-article-section p {
  margin: 0;
  color: #333b36;
  line-height: 1.85;
  white-space: pre-wrap;
}

.regulatory-intelligence-article-section ul {
  margin: 0;
  padding-left: 22px;
  color: #333b36;
  line-height: 1.8;
}

.regulatory-intelligence-restricted,
.regulatory-intelligence-unavailable {
  padding: 24px;
  border: 1px solid #ecd39d;
  border-radius: 9px;
  background: #fff8e8;
  color: #805b12;
  text-align: center;
}

.regulatory-intelligence-restricted strong,
.regulatory-intelligence-unavailable strong {
  display: block;
  margin-bottom: 6px;
}

.regulatory-intelligence-restricted p,
.regulatory-intelligence-unavailable p {
  margin: 0;
}

.regulatory-standalone-body {
  height: 100vh;
  margin: 0;
  overflow: hidden;
  background: #eef1ef;
  color: #202421;
  font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
}

.regulatory-standalone-shell {
  width: 100%;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.regulatory-standalone-head {
  align-items: center;
  padding: 16px 22px;
  background: #fff;
}

.regulatory-standalone-head h1 {
  margin: 3px 0 4px;
  font-size: 20px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.regulatory-standalone-viewer {
  height: auto;
  overflow: hidden;
  padding: 18px;
}

.regulatory-pdf-frame {
  display: block;
  width: 100%;
  height: calc(92vh - 112px);
  min-height: 620px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

.regulatory-doc-preview {
  width: min(794px, 100%);
  min-height: 1080px;
  margin: 0 auto;
  border: 1px solid #d3d3d3;
  border-radius: 1px;
  background: #fff;
  padding: 82px 76px;
  color: #202421;
  font-family: "Times New Roman", "SimSun", "宋体", serif;
  font-size: 12pt;
  line-height: 1.6;
  box-shadow: 0 3px 18px rgba(0, 0, 0, 0.16);
  transform-origin: top center;
}

.regulatory-word-paragraph {
  min-height: 1em;
  margin: 0 0 8pt;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.regulatory-word-page-break {
  margin-top: 42px !important;
  border-top: 1px dashed #b7b7b7;
  padding-top: 42px;
}

.regulatory-word-table-wrap {
  width: 100%;
  margin: 10pt 0;
  overflow-x: auto;
}

.regulatory-word-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.regulatory-word-table td {
  min-width: 56px;
  border: 1px solid #676767;
  padding: 5pt 7pt;
  vertical-align: top;
}

.regulatory-word-table td p {
  margin: 0;
  white-space: pre-wrap;
}

.regulatory-office-window {
  min-width: 0;
  height: 100%;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid #c9cecc;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 5px 22px rgba(22, 34, 28, 0.12);
  overflow: hidden;
}

.regulatory-office-titlebar {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: #185abd;
  color: #fff;
}

.regulatory-office-titlebar strong {
  font-size: 14px;
  letter-spacing: 0;
}

.regulatory-office-mark {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
}

.regulatory-office-readonly {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
}

.regulatory-office-ribbon {
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid #d6d9d7;
  padding: 0 15px;
  background: #fff;
  color: #303531;
  font-size: 12px;
  white-space: nowrap;
  overflow-x: auto;
}

.regulatory-office-ribbon span.active {
  align-self: stretch;
  display: flex;
  align-items: center;
  border-bottom: 3px solid #185abd;
  color: #185abd;
  font-weight: 700;
}

.regulatory-office-ribbon i {
  width: 1px;
  height: 24px;
  display: block;
  background: #d7dbd9;
}

.regulatory-office-ribbon b,
.regulatory-office-ribbon em,
.regulatory-office-ribbon u {
  min-width: 20px;
  color: #1f2421;
  font-family: Arial, sans-serif;
  font-size: 14px;
  text-align: center;
}

.regulatory-ribbon-font {
  border: 1px solid #cfd4d1;
  padding: 5px 9px;
  background: #fff;
}

.regulatory-word-canvas {
  min-height: 0;
  padding: 34px 28px 54px;
  background: #e6e6e6;
  overflow: auto;
}

.regulatory-office-statusbar,
.regulatory-excel-sheetbar {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-top: 1px solid #d0d5d2;
  padding: 0 12px;
  background: #f7f8f7;
  color: #525954;
  font-size: 12px;
}

.regulatory-office-spacer {
  flex: 1;
}

.regulatory-zoom-button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #38403b;
  cursor: pointer;
  font-size: 16px;
}

.regulatory-zoom-button:hover {
  background: #e3e7e5;
}

.regulatory-excel-window {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.regulatory-excel-titlebar {
  background: #107c41;
}

.regulatory-excel-ribbon span.active {
  border-bottom-color: #107c41;
  color: #107c41;
}

.regulatory-excel-formula-bar {
  min-height: 34px;
  display: grid;
  grid-template-columns: 82px 38px minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid #cfd4d1;
  background: #fff;
  color: #303531;
  font-size: 12px;
}

.regulatory-excel-formula-bar > * {
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  border-right: 1px solid #d8dcda;
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.regulatory-excel-formula-bar b {
  justify-content: center;
  color: #606862;
  font-family: Georgia, serif;
  font-style: italic;
}

#regulatoryExcelSheetViewport {
  min-height: 0;
  overflow: hidden;
}

.regulatory-excel-grid-wrap {
  width: 100%;
  height: 100%;
  min-height: 480px;
  overflow: auto;
  background: #fff;
}

.regulatory-excel-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: #202420;
  font-family: Calibri, "Microsoft YaHei", sans-serif;
  font-size: 11pt;
}

.regulatory-excel-row-column {
  width: 44px;
}

.regulatory-excel-grid th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 25px;
  border-right: 1px solid #bfc5c1;
  border-bottom: 1px solid #bfc5c1;
  background: #f2f3f2;
  color: #4e5651;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
}

.regulatory-excel-grid tbody th {
  left: 0;
  z-index: 1;
}

.regulatory-excel-grid td {
  position: relative;
  min-width: 58px;
  border-right: 1px solid #d8dcda;
  border-bottom: 1px solid #d8dcda;
  padding: 3px 6px;
  background-clip: padding-box;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  cursor: cell;
}

.regulatory-excel-grid td.selected {
  z-index: 1;
  overflow: visible;
  outline: 2px solid #107c41;
  outline-offset: -2px;
}

.regulatory-excel-grid td[rowspan],
.regulatory-excel-grid td[colspan] {
  text-align: center !important;
  vertical-align: middle !important;
}

.project-formula-preview-window {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.project-formula-preview-section {
  min-width: 0;
  padding: 16px;
  border: 1px solid #dfe7e1;
  border-radius: 8px;
  background: #fff;
}

.project-formula-preview-section h2 {
  margin: 0 0 12px;
  color: #26342c;
  font-size: 16px;
}

.project-formula-preview-table-wrap {
  overflow: auto;
}

.project-formula-preview-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  color: #273129;
  font-family: "Times New Roman", "SimSun", serif;
  font-size: 13px;
}

.project-formula-preview-table th,
.project-formula-preview-table td {
  border: 1px solid #dfe7e1;
  padding: 7px 9px;
  text-align: center;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.project-formula-preview-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f0f4f1;
  color: #5d6a62;
  font-weight: 600;
}

.project-formula-preview-table th:nth-child(1) {
  width: 64px;
}

.project-formula-preview-table th:nth-child(2) {
  width: 230px;
}

.project-formula-preview-table th:nth-child(3) {
  width: 300px;
}

.project-formula-preview-table th:nth-child(4),
.project-formula-preview-table th:nth-child(5),
.project-formula-preview-table th:nth-child(6) {
  width: 120px;
}

.project-formula-preview-table th:nth-child(7) {
  width: 130px;
}

.project-formula-preview-table th:nth-child(8) {
  width: 220px;
}

.project-formula-preview-table .project-formula-merged-cell {
  background: #fbfdfb;
  text-align: center;
  vertical-align: middle;
}

.regulatory-excel-grid td.has-formula::after {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 4px;
  height: 4px;
  background: #107c41;
  content: "";
}

.regulatory-excel-sheetbar {
  gap: 4px;
  padding-top: 3px;
  background: #f3f5f4;
}

.regulatory-excel-sheet-tab {
  min-width: 74px;
  height: 29px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #343a36;
  cursor: pointer;
  font-size: 12px;
}

.regulatory-excel-sheet-tab.active {
  border-bottom-color: #107c41;
  background: #fff;
  color: #107c41;
  font-weight: 700;
}

.regulatory-sheet-preview {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.regulatory-sheet-preview h4 {
  margin: 0;
  font-size: 15px;
}

.regulatory-preview-table-wrap {
  max-height: 520px;
}

.regulatory-preview-table {
  min-width: 680px;
}

.regulatory-preview-table td {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.table-title {
  margin: 0 0 8px;
  font-size: 14px;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
  font-family: "Times New Roman", "SimSun", "宋体", serif;
}

.editable-database-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.editable-database-table .resizable-column {
  white-space: pre-wrap;
}

.editable-database-table .database-filter-row th {
  background: #fff;
  padding: 6px 8px;
}

.editable-database-table .database-filter-row input {
  width: 100%;
  min-width: 88px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.editable-database-table .database-filter-row input:focus,
.editable-database-table .database-editable-cell:focus {
  outline: 2px solid rgba(33, 127, 82, 0.22);
  outline-offset: -2px;
}

.editable-database-table .database-editable-cell[contenteditable="true"] {
  background: #fffdf5;
  cursor: text;
}

.editable-database-table th,
.editable-database-table td {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
  line-height: 1.5;
}

.editable-database-table .dirty-cell {
  box-shadow: inset 0 0 0 9999px rgba(33, 127, 82, 0.1);
}

.public-database-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.public-database-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.public-database-pager:empty {
  display: none;
}

.pager-left,
.pager-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.public-database-pager select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 8px;
  font: inherit;
}

.compact-pager-button {
  min-height: 32px;
  padding: 0 10px;
}

.formula-template-table {
  min-width: 1540px;
  table-layout: fixed;
}

.actual-result-table {
  min-width: 1120px;
  table-layout: fixed;
}

.actual-result-table .actual-col-sequence {
  width: 8%;
}

.actual-result-table .actual-col-chinese {
  width: 24%;
}

.actual-result-table .actual-col-inci {
  width: 35%;
}

.actual-result-table .actual-col-percent {
  width: 24%;
}

.actual-result-table .actual-col-source {
  width: 9%;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 9px 10px;
  text-align: center;
  vertical-align: middle;
  word-break: break-word;
}

.data-table th {
  background: #f7f9f7;
  color: var(--muted);
}

.admin-accounts-table {
  min-width: 1340px;
}

.license-codes-table {
  min-width: 1320px;
}

.admin-accounts-table td {
  vertical-align: top;
}

.admin-note-input {
  width: 100%;
  min-width: 120px;
  max-width: 180px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.admin-note-input:focus {
  outline: 2px solid rgba(48, 107, 82, 0.18);
  border-color: var(--primary);
}

.saas-dashboard {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.admin-whitelist-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 14px;
  margin-bottom: 16px;
}

.admin-whitelist-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.admin-whitelist-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.admin-whitelist-form {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.admin-whitelist-form label {
  display: grid;
  gap: 6px;
}

.admin-whitelist-form input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0 10px;
}

.admin-whitelist-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.admin-whitelist-item {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-whitelist-item > div {
  display: grid;
  gap: 2px;
}

.admin-whitelist-item small {
  color: var(--muted);
}

.saas-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.saas-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  min-height: 92px;
  display: grid;
  align-content: space-between;
}

.saas-metric span,
.saas-metric small,
.saas-activity li span {
  color: var(--muted);
  font-size: 12px;
}

.saas-metric strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.saas-activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.saas-sales-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.saas-activity {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
}

.saas-sales-card {
  background: #fff;
}

.saas-activity h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.saas-activity ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 7px;
}

.saas-activity li {
  display: grid;
  gap: 2px;
}

.saas-backup-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.saas-backup-strip > div {
  display: grid;
  gap: 4px;
}

.saas-backup-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.saas-backup-strip span,
.saas-backup-strip small {
  color: var(--muted);
  font-size: 12px;
}

.saas-backup-strip strong {
  color: var(--ink);
}

.saas-backup-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.saas-backup-list button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
  padding: 7px 10px;
  display: grid;
  gap: 2px;
  cursor: pointer;
}

.saas-backup-list span {
  color: var(--muted);
  font-size: 12px;
}

.admin-license-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 14px;
  margin-bottom: 16px;
}

.admin-license-form {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(96px, 120px) minmax(180px, 1fr) minmax(110px, 140px) auto auto;
  gap: 10px;
  align-items: end;
}

.admin-license-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 160px) minmax(130px, 160px) auto;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}

.admin-license-form label,
.admin-license-filter label {
  display: grid;
  gap: 6px;
}

.admin-license-form input,
.admin-license-form select,
.admin-license-filter input,
.admin-license-filter select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  background: #eef2f0;
  color: var(--muted);
  font-weight: 700;
}

.status-pill.status-ok {
  background: #e6f4ec;
  color: var(--green);
}

.status-pill.status-warning {
  background: #fff4d8;
  color: #9a6a00;
}

.mini-button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  cursor: pointer;
}

.mini-button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.danger-mini-button {
  border-color: #f2c8c8;
  color: #b42318;
}

.admin-self-note {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
}

.muted-text {
  color: var(--muted);
  font-size: 12px;
}

.admin-account-detail {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 16px;
  color: var(--muted);
}

.admin-detail-head,
.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.admin-detail-head {
  margin-bottom: 12px;
}

.admin-detail-head > div,
.admin-detail-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.admin-detail-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.admin-detail-head strong,
.admin-detail-card h3 {
  color: var(--ink);
}

.admin-detail-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.admin-detail-card p {
  margin: 6px 0;
}

.admin-mini-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--ink);
}

.admin-mini-list li {
  margin: 4px 0;
}

.admin-detail-subsection {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.admin-detail-subsection h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
}

.admin-json-preview {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9f7;
  color: var(--ink);
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  white-space: pre-wrap;
}

.admin-account-detail details {
  margin-top: 8px;
  color: var(--ink);
}

.admin-account-detail summary {
  cursor: pointer;
  color: var(--green);
  font-weight: 700;
}

.admin-data-table input {
  width: 100%;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px 9px;
}

.material-update-table {
  min-width: 980px;
}

.formula-template-table th:nth-child(1),
.formula-template-table td:nth-child(1) {
  width: 54px;
  text-align: center;
}

.formula-template-table th:nth-child(2),
.formula-template-table td:nth-child(2) {
  width: 150px;
}

.formula-template-table th:nth-child(3),
.formula-template-table td:nth-child(3) {
  width: 190px;
}

.formula-template-table th:nth-child(4),
.formula-template-table td:nth-child(4),
.formula-template-table th:nth-child(5),
.formula-template-table td:nth-child(5),
.formula-template-table th:nth-child(6),
.formula-template-table td:nth-child(6) {
  width: 96px;
  text-align: center;
}

.formula-template-table th:nth-child(7),
.formula-template-table td:nth-child(7) {
  width: 104px;
  text-align: center;
}

.formula-template-table th:nth-child(8),
.formula-template-table td:nth-child(8) {
  width: 150px;
}

.formula-template-table th:nth-child(9),
.formula-template-table td:nth-child(9) {
  width: 210px;
}

.formula-template-table th:nth-child(10),
.formula-template-table td:nth-child(10) {
  width: 120px;
}

.formula-template-table th:nth-child(11),
.formula-template-table td:nth-child(11) {
  width: 300px;
}

[contenteditable="true"] {
  background: #fffdf5;
  outline-color: var(--amber);
}

.template-summary [contenteditable="true"] {
  min-height: 42px;
  border-radius: 6px;
  padding: 4px 6px;
}

.danger-row td {
  color: #d01818;
}

.pending-row td {
  background: #fffaf0;
}

.no-data-row td {
  background: #fff5f5;
}

.temp-missing-row td {
  background: rgb(255, 255, 0);
}

.assessment-table td.temp-import-cell,
.assessment-table td.temp-import-cell[contenteditable="true"],
.formula-template-table td.temp-import-cell,
.formula-template-table td.temp-import-cell[contenteditable="true"],
.formula-template-table td[data-temp1-match="true"] {
  background: rgb(176, 224, 230) !important;
}

.assessment-table td.market-listed-cell,
.assessment-table td.market-listed-cell[contenteditable="true"] {
  background: rgb(173, 216, 230);
}

.assessment-table td.market-listed-info-cell,
.assessment-table td.market-listed-info-cell[contenteditable="true"] {
  background: #eee7fb;
  color: #5b4b8a;
}

.assessment-table td.market-listed-info-index-cell,
.assessment-table td.market-listed-info-index-cell[contenteditable="true"] {
  background: #dcd1f7;
  color: #4f3f7f;
}

.assessment-table td.market-index-cell,
.assessment-table td.market-index-cell[contenteditable="true"] {
  background: rgb(144, 238, 144);
}

.assessment-table td.amount-ok-cell {
  background: rgb(198, 239, 206);
}

.assessment-table td.amount-danger-cell {
  background: rgb(255, 192, 192);
}

.assessment-table {
  min-width: 1850px;
  table-layout: fixed;
}

.assessment-table td,
.risk-table td {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.55;
  vertical-align: middle;
}

.assessment-table th:nth-child(1),
.assessment-table td:nth-child(1) {
  width: 54px;
  text-align: center;
}

.assessment-table th:nth-child(2),
.assessment-table td:nth-child(2) {
  width: 150px;
}

.assessment-table th:nth-child(3),
.assessment-table td:nth-child(3) {
  width: 190px;
}

.assessment-table th:nth-child(4),
.assessment-table td:nth-child(4) {
  width: 86px;
  text-align: center;
}

.assessment-table th:nth-child(5),
.assessment-table td:nth-child(5),
.assessment-table th:nth-child(6),
.assessment-table td:nth-child(6),
.assessment-table th:nth-child(8),
.assessment-table td:nth-child(8),
.assessment-table th:nth-child(9),
.assessment-table td:nth-child(9),
.assessment-table th:nth-child(10),
.assessment-table td:nth-child(10) {
  width: 220px;
}

.assessment-table th:nth-child(7),
.assessment-table td:nth-child(7) {
  width: 170px;
}

.assessment-table th:nth-child(11),
.assessment-table td:nth-child(11) {
  width: 150px;
  text-align: center;
}

@media (max-width: 980px) {
  .sidebar {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .brand {
    width: 100%;
    min-width: 0;
  }

  .nav {
    width: 100%;
  }

  .topbar,
  .status-strip,
  .workspace {
    grid-template-columns: 1fr;
  }

  #formulaPage {
    grid-template-columns: 1fr;
  }

  .query-result-card,
  .query-two-columns,
  .query-safety-grid,
  .saas-metric-grid,
  .saas-activity-grid,
  .account-license-grid,
  .admin-whitelist-form,
  .admin-license-form,
  .admin-license-filter {
    grid-template-columns: 1fr;
  }

  .saas-backup-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .ingredient-query-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .query-contact-list {
    text-align: left;
  }

  .topbar {
    align-items: stretch;
  }

  .project-toolbar .topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 12px;
  }

  .project-toolbar .project-context {
    flex: 1 1 0;
    max-width: none;
  }

  .project-toolbar .topbar-actions {
    order: 2;
  }

  .project-toolbar .page-tabs {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    padding-bottom: 2px;
  }

  .regulatory-viewer {
    max-height: none;
  }

  .regulatory-intelligence-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .regulatory-intelligence-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .sidebar {
    padding: 10px 12px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand span {
    display: none;
  }

  .nav-item {
    min-height: 34px;
    padding: 0 10px;
  }

  .ingredient-query-hero {
    padding: 34px 16px;
  }

  .ingredient-query-hero h2 {
    font-size: 24px;
  }

  .ingredient-query-search {
    grid-template-columns: 1fr;
  }

  .regulatory-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .regulatory-overview {
    grid-template-columns: 1fr;
  }

  .regulatory-intelligence-toolbar {
    grid-template-columns: 1fr;
  }

  .regulatory-intelligence-card {
    grid-template-columns: 1fr;
  }

  .regulatory-intelligence-card-actions {
    justify-items: start;
  }

  .regulatory-browser-head,
  .regulatory-item {
    grid-template-columns: 1fr;
  }

  .regulatory-browser-head {
    flex-direction: column;
  }

  .regulatory-item-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .regulatory-preview-modal {
    padding: 6px;
  }

  .regulatory-preview-dialog {
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
  }

  .regulatory-viewer-head {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .regulatory-preview-actions {
    justify-content: flex-start;
  }

  .regulatory-viewer {
    min-height: 0;
    padding: 14px;
  }

  .regulatory-standalone-head {
    align-items: flex-start;
    flex-direction: row;
    padding: 12px 14px;
  }

  .regulatory-standalone-head h1 {
    font-size: 17px;
  }

  .regulatory-standalone-viewer {
    padding: 8px;
  }

  .regulatory-pdf-frame {
    height: calc(100vh - 174px);
    min-height: 420px;
  }

  .regulatory-doc-preview {
    width: 100%;
    min-height: 760px;
    padding: 42px 28px;
    font-size: 11pt;
  }

  .regulatory-word-canvas {
    padding: 16px 10px 28px;
  }

  .regulatory-office-ribbon {
    gap: 14px;
  }

  .regulatory-office-ribbon span:nth-of-type(n + 5),
  .regulatory-ribbon-font {
    display: none;
  }

  .regulatory-office-statusbar {
    gap: 10px;
  }

  .regulatory-excel-grid-wrap {
    min-height: 420px;
  }

  .query-contact-list strong {
    font-size: 24px;
  }

  .main {
    padding: 16px;
  }

  .project-toolbar {
    top: 58px;
    margin: -4px -16px 14px;
    padding: 10px 16px;
  }

  .managed-account-banner:not(.hidden) + .project-toolbar {
    top: 136px;
  }

  .managed-account-banner {
    top: 58px;
    margin: -4px -16px 14px;
    padding: 10px 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .project-toolbar .topbar {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0;
  }

  .project-toolbar .project-context {
    width: 100%;
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .project-toolbar .topbar-actions {
    width: 100%;
  }

  .project-toolbar .eyebrow {
    font-size: 19px;
  }

  .project-toolbar h1 {
    max-width: 100%;
    font-size: 19px;
  }

  .project-toolbar .page-tabs {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .project-toolbar .page-tab {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 12px;
  }

  .word-export-head {
    left: 16px;
    right: 16px;
  }

  .form-grid,
  .form-grid.wide,
  .form-grid.basic-form-grid,
  .formula-summary,
  .template-summary,
  .template-summary.four,
  .template-summary.five,
  .flow,
  .tools-row {
    grid-template-columns: 1fr;
  }

  .form-grid.basic-form-grid > label,
  .form-grid.basic-form-grid > fieldset,
  .form-grid.basic-form-grid > div {
    grid-column: 1 / -1;
  }

  .lyophilized-formula-control {
    align-items: flex-start;
    flex-direction: column;
  }

  .lyophilized-formula-control input[type="number"] {
    width: 96px;
  }

  h1 {
    font-size: 21px;
  }
}

/* Apple-inspired visual polish layer */
html {
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  letter-spacing: 0;
}

button,
input,
select,
textarea,
[contenteditable="true"] {
  letter-spacing: 0;
}

::selection {
  background: rgba(33, 127, 82, 0.18);
}

@keyframes pageFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page:not(.hidden),
.panel,
.query-result-card,
.auth-card {
  animation: pageFadeUp 0.24s var(--motion) both;
}

#wordPage:not(.hidden),
.word-export-panel {
  animation: none;
  transform: none;
}

.sidebar {
  background: rgba(23, 51, 35, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 30px rgba(23, 51, 35, 0.14);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}

.brand-mark {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(23, 51, 35, 0.08);
}

.nav-item,
.page-tab,
.primary-button,
.secondary-button,
.icon-button,
.mini-button,
.mini-action-button,
.filter-chip,
.text-link-button,
.compact-pager-button,
.auth-links button {
  transition:
    background-color 0.18s var(--motion),
    border-color 0.18s var(--motion),
    color 0.18s var(--motion),
    box-shadow 0.18s var(--motion),
    transform 0.14s var(--motion),
    opacity 0.18s var(--motion);
}

button:not(:disabled):active,
.filter-chip:not(:disabled):active,
.text-link-button:not(:disabled):active {
  transform: scale(0.985);
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.main {
  padding: clamp(18px, 2.4vw, 32px);
}

.topbar {
  padding: 2px 0 4px;
}

.topbar h1,
.ingredient-query-hero h2 {
  color: #111513;
  font-weight: 750;
}

.eyebrow,
label span,
.compact-select span,
.auth-tip,
.ingredient-query-hero p,
.ingredient-query-status,
.muted-text {
  color: var(--muted);
}

.panel,
.account,
.status-item,
.query-result-card,
.query-usage-card,
.query-safety-grid > div,
.issue,
.export-list div,
.preset-note,
.template-summary > div,
.formula-summary > div,
.admin-account-detail,
.admin-detail-head > div,
.admin-detail-card,
.auth-card,
.readonly-output,
.rich-output,
.data-table-wrap {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.panel,
.query-result-card,
.auth-card {
  transition:
    box-shadow 0.2s var(--motion),
    border-color 0.2s var(--motion),
    transform 0.2s var(--motion);
}

.panel:hover,
.query-result-card:hover,
.auth-card:hover {
  border-color: rgba(29, 29, 31, 0.15);
  box-shadow: var(--shadow-md);
}

.auth-page {
  background: #f5f5f7;
}

.auth-card {
  border-radius: 8px;
}

input,
select,
textarea,
.rich-output,
.project-material-input,
.editable-database-table .database-filter-row input,
.admin-data-table input {
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition:
    border-color 0.18s var(--motion),
    box-shadow 0.18s var(--motion),
    background-color 0.18s var(--motion);
}

input:hover,
select:hover,
textarea:hover,
.rich-output:hover,
[contenteditable="true"]:hover {
  border-color: rgba(33, 127, 82, 0.34);
}

input:focus,
select:focus,
textarea:focus,
.rich-output:focus,
[contenteditable="true"]:focus {
  border-color: rgba(33, 127, 82, 0.72);
  box-shadow: var(--focus-ring);
  outline: none;
}

.primary-button,
.auth-main-button,
.ingredient-query-search button {
  background: linear-gradient(180deg, var(--green), var(--green-dark));
  border-color: var(--green-dark);
  box-shadow: 0 8px 18px rgba(33, 127, 82, 0.18);
}

.primary-button:hover,
.auth-main-button:hover,
.ingredient-query-search button:hover {
  box-shadow: 0 10px 24px rgba(33, 127, 82, 0.24);
}

.secondary-button:hover,
.icon-button:hover,
.mini-button:hover,
.compact-pager-button:hover,
.page-tab:hover {
  border-color: rgba(33, 127, 82, 0.35);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.page-tab.active,
.filter-chip.active {
  box-shadow: inset 0 0 0 1px rgba(33, 127, 82, 0.06);
}

.upload-box {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(33, 127, 82, 0.32);
  transition:
    background-color 0.2s var(--motion),
    border-color 0.2s var(--motion),
    box-shadow 0.2s var(--motion);
}

.upload-box:hover,
.upload-box.drag-over {
  background: rgba(232, 245, 238, 0.75);
  box-shadow: var(--focus-ring);
}

.ingredient-query-search {
  border-width: 1px;
  box-shadow: 0 12px 34px rgba(33, 127, 82, 0.09);
}

.ingredient-query-search input {
  background: #ffffff;
}

.ingredient-query-footer {
  background: #eef1f0;
}

.query-card-summary,
.query-section,
.query-mini-table th,
.data-table th,
.editable-database-table .database-filter-row th {
  background: #f7f9f8;
}

.data-table {
  font-size: 13px;
}

.data-table th {
  color: #59635d;
  font-weight: 700;
}

.data-table td {
  color: #202421;
}

.data-table-wrap {
  background: #fff;
}

.status-pill,
.project-status,
.tag,
.issue-mark,
.query-source-chips span,
.query-pill-row span {
  box-shadow: inset 0 0 0 1px rgba(29, 29, 31, 0.04);
}

[contenteditable="true"] {
  border-radius: 6px;
  transition:
    background-color 0.18s var(--motion),
    box-shadow 0.18s var(--motion);
}

[contenteditable="true"]:focus {
  background: #fffef8;
}

.save-feedback {
  transition: opacity 0.18s var(--motion);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  #projectListBody tr[data-project-id]:hover,
  #projectListBody tr[data-project-id]:focus-within {
    transform: none;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 14px;
  }

  .auth-filing-footer {
    right: 12px;
    bottom: 10px;
    left: 12px;
    font-size: 12px;
  }

  .app-filing-footer {
    padding: 0 14px 18px;
    font-size: 12px;
  }

  .panel,
  .query-result-card,
  .auth-card {
    animation: none;
  }
}
