:root {
  --ink: #172033;
  --muted: #6f7888;
  --line: #dce1e8;
  --canvas: #edf0f3;
  --panel: #ffffff;
  --blue: #3157d5;
  --blue-dark: #2447bb;
  --blue-soft: #eef2ff;
  --red: #ed2834;
  --green: #17835c;
  --radius: 6px;
  --header-height: 68px;
  --sidebar-width: 360px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  display: grid;
  grid-template-rows: var(--header-height) minmax(0, 1fr);
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button,
a,
.drop-zone {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  min-height: 0;
  padding: 0 24px;
  border-bottom: 1px solid #d5dae1;
  background: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  filter: drop-shadow(0 5px 7px rgba(177, 22, 41, 0.2));
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand h1,
.brand p,
.section-heading h2,
.section-heading p,
.preview-toolbar h2,
.toolbar-kicker,
.empty-preview h3,
.empty-preview p,
.processing p {
  margin: 0;
}

.brand h1 {
  color: #202532;
  font-size: 16.5px;
  font-weight: 800;
  line-height: 1.3;
}

.brand h1 span {
  color: #e82437;
}

.brand p {
  margin-top: 2px;
  color: #7d6870;
  font-size: 9.5px;
  font-weight: 600;
}

.service-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 131, 92, 0.12);
}

.service-status:not(.is-ai-ready) .status-dot {
  background: #d8921b;
  box-shadow: 0 0 0 3px rgba(216, 146, 27, 0.13);
}

.service-status.is-offline .status-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(237, 40, 52, 0.12);
}

.workspace {
  display: grid;
  grid-template-columns: var(--sidebar-width) 6px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

.sidebar {
  min-width: 0;
  height: 100%;
  padding: 0 18px 22px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  border-right: 1px solid #d5dae1;
  background: #fff;
  transition: opacity 140ms ease, transform 180ms ease;
}

.sidebar-collapsed .workspace {
  grid-template-columns: 0 0 minmax(0, 1fr);
}

.workspace-resizer {
  position: relative;
  z-index: 6;
  width: 6px;
  cursor: col-resize;
  outline: 0;
  background: #e8ebef;
}

.workspace-resizer::after {
  position: absolute;
  inset: 0 2px;
  content: "";
  background: transparent;
  transition: background 120ms ease;
}

.workspace-resizer:hover::after,
.workspace-resizer:focus-visible::after,
.resizing-workspace .workspace-resizer::after {
  background: var(--blue);
}

.resizing-workspace,
.resizing-workspace * {
  cursor: col-resize !important;
  user-select: none !important;
}

.resizing-workspace .pdf-frame {
  pointer-events: none;
}

.sidebar-collapsed .sidebar {
  visibility: hidden;
  padding-right: 0;
  padding-left: 0;
  border-right: 0;
  opacity: 0;
  transform: translateX(-12px);
  pointer-events: none;
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  border: 2px solid #fff;
  border-radius: 8px;
  background: #c9cfd8;
}

.panel-section {
  padding-bottom: 18px;
  border-bottom: 1px solid #e6e9ee;
}

.panel-section:first-child {
  padding-top: 18px;
}

.panel-section + .panel-section {
  padding-top: 18px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 13px;
}

.section-heading.compact {
  margin-bottom: 12px;
}

.section-number {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 4px;
  color: #fff;
  background: var(--blue);
  font-size: 10px;
  font-weight: 800;
}

.section-heading h2 {
  font-size: 14px;
  line-height: 1.35;
}

.section-heading p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.drop-zone {
  display: grid;
  min-height: 110px;
  padding: 14px;
  place-items: center;
  align-content: center;
  border: 1px dashed #aab5c6;
  border-radius: var(--radius);
  cursor: pointer;
  background: #f9fafb;
  transition: border-color 140ms ease, background 140ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.upload-symbol {
  display: grid;
  width: 32px;
  height: 32px;
  margin-bottom: 7px;
  place-items: center;
  border: 1px solid #aeb9ca;
  border-radius: 50%;
  color: var(--blue);
  background: #fff;
  font-size: 22px;
  line-height: 1;
}

.drop-zone strong {
  font-size: 13px;
}

.drop-zone > span:last-child {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.file-summary {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 30px;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.file-icon {
  display: grid;
  width: 38px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: var(--red);
  font-size: 10px;
  font-weight: 800;
}

.file-copy {
  display: grid;
  min-width: 0;
}

.file-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-copy span {
  color: var(--muted);
  font-size: 10px;
}

.icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-size: 20px;
}

.icon-button:hover {
  color: var(--red);
  background: #fff0f1;
}

.field {
  display: grid;
  gap: 6px;
  margin-top: 11px;
  color: #49536a;
  font-size: 12px;
  font-weight: 700;
}

.input-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  height: 42px;
  overflow: hidden;
  border: 1px solid #bdc5d1;
  border-radius: 4px;
  background: #fff;
}

.input-box:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.1);
}

.input-box input {
  min-width: 0;
  padding: 0 11px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 700;
}

.input-box input:disabled {
  cursor: not-allowed;
  color: #98a0ad;
  background: #f7f8fa;
}

.input-box input::placeholder {
  color: #a4abb6;
  font-weight: 400;
}

.input-box span {
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f2f4f7;
  font-weight: 400;
}

.calculated-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  margin-top: 14px;
  padding: 0 11px;
  border-left: 3px solid var(--red);
  border-radius: 2px;
  color: #49536a;
  background: #fff2f2;
  font-size: 12px;
  font-weight: 700;
}

.calculated-row output {
  color: var(--red);
  font-size: 16px;
}

.field-list {
  display: grid;
  gap: 11px;
}

.recognized-field {
  display: grid;
  gap: 6px;
}

.recognized-field-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.recognized-field-heading strong {
  min-width: 0;
  color: #49536a;
  font-size: 12px;
}

.recognized-field-heading small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  font-weight: 400;
}

.recognized-field input {
  width: 100%;
  height: 40px;
  min-width: 0;
  padding: 0 11px;
  border: 1px solid #bdc5d1;
  border-radius: 4px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  font-weight: 700;
}

.recognized-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.1);
}

.custom-field input,
.custom-field select {
  width: 100%;
  height: 40px;
  min-width: 0;
  padding: 0 11px;
  border: 1px solid #bdc5d1;
  border-radius: 4px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 600;
}

.custom-field input:focus,
.custom-field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.1);
}

.custom-replacement-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.custom-replacement {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.custom-replacement-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.custom-replacement-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-replacement-copy input {
  width: 100%;
  height: 34px;
  min-width: 0;
  padding: 0 9px;
  border: 1px solid #c7ced8;
  border-radius: 3px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}

.custom-replacement-copy input:focus {
  border-color: var(--blue);
}

.field-help {
  margin: 14px 0 0;
  padding-left: 9px;
  border-left: 2px solid #d2d8e1;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.secondary-button,
.primary-button,
.download-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.secondary-button {
  gap: 7px;
  margin-top: 12px;
  border: 1px solid #c7ced8;
  color: var(--ink);
  background: #fff;
}

.secondary-button:hover {
  background: #f3f5f7;
}

.secondary-button:disabled {
  cursor: not-allowed;
  color: #949caa;
  background: #f5f6f8;
  opacity: 0.7;
}

.secondary-button span {
  color: var(--blue);
  font-size: 18px;
}

.detection-empty {
  padding: 12px;
  color: var(--muted);
  background: #f5f6f8;
  font-size: 11px;
  text-align: center;
}

.detection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.detection-grid div {
  padding: 9px 10px;
  background: #fff;
}

.detection-grid dt {
  color: var(--muted);
  font-size: 10px;
}

.detection-grid dd {
  overflow: hidden;
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 104px;
  gap: 8px;
  margin-top: 0;
}

.sidebar-footer {
  position: sticky;
  z-index: 4;
  bottom: -22px;
  margin: 0 -18px -22px;
  padding: 14px 18px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 18px rgba(23, 32, 51, 0.06);
  backdrop-filter: blur(8px);
}

.primary-button {
  border: 0;
  color: #fff;
  background: var(--blue);
}

.primary-button:hover:not(:disabled) {
  background: var(--blue-dark);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.download-button {
  color: var(--blue);
  border: 1px solid var(--blue);
  background: #fff;
}

.download-button:hover:not(.is-disabled) {
  background: var(--blue-soft);
}

.download-button.is-disabled {
  pointer-events: none;
  color: #939baa;
  border-color: #cbd1da;
}

.message {
  min-height: 0;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

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

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

.message:empty {
  display: none;
}

.preview-panel {
  display: grid;
  grid-template-rows: 46px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 10px 12px 12px;
  overflow: hidden;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: #fff;
}

.preview-toolbar-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.preview-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-command-button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #b9c3d2;
  border-radius: 4px;
  cursor: pointer;
  color: #33415b;
  background: #fff;
  font-size: 10px;
  font-weight: 700;
}

.toolbar-command-button:hover,
.toolbar-command-button.is-active {
  color: var(--blue);
  border-color: #9eafe9;
  background: var(--blue-soft);
}

.compare-pdf-button {
  position: relative;
  min-width: 126px;
  height: 32px;
  padding: 0 12px 0 32px;
  overflow: visible;
  color: #fff;
  border-color: #d20f20;
  background: var(--red);
  box-shadow: 0 3px 9px rgba(218, 20, 37, 0.24);
  font-size: 11px;
}

.compare-pdf-button::before {
  position: absolute;
  left: 11px;
  content: "⇄";
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.compare-pdf-button:hover,
.compare-pdf-button.is-comparing {
  color: #fff;
  border-color: #a90f1c;
  background: #c41020;
  box-shadow: 0 4px 12px rgba(196, 16, 32, 0.32);
}

.compare-pdf-button:focus-visible {
  outline: 3px solid rgba(240, 20, 35, 0.2);
  outline-offset: 2px;
}

.compare-pdf-button.is-comparing {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(87, 0, 9, 0.24);
}

.toolbar-command-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.toolbar-icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  color: #4b5669;
  background: #fff;
}

.toolbar-icon-button:hover {
  color: var(--blue);
  border-color: #b8c4ee;
  background: var(--blue-soft);
}

.toolbar-icon-button span {
  font-size: 22px;
  line-height: 1;
  transform: translateY(-1px);
}

.toolbar-kicker {
  color: var(--blue);
  font-size: 9px;
  font-weight: 800;
}

.preview-toolbar h2 {
  font-size: 14px;
}

.preview-state {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: 10px;
}

.preview-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0 0 5px 5px;
  background: #cfd4da;
}

.empty-preview,
.processing {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 24px;
  text-align: center;
}

.empty-document {
  display: grid;
  width: 88px;
  height: 112px;
  margin-bottom: 18px;
  place-items: end center;
  padding-bottom: 15px;
  border: 1px solid #aeb5bf;
  color: var(--red);
  background: #fff;
  box-shadow: 0 10px 26px rgba(23, 32, 51, 0.12);
  font-size: 13px;
  font-weight: 800;
}

.empty-preview h3,
.processing strong {
  font-size: 14px;
}

.empty-preview p,
.processing p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.pdf-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

.pdf-viewer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: row;
  min-height: 0;
  background: #cfd4da;
}

.pdf-viewer-thumbnails {
  width: 112px;
  min-width: 112px;
  overflow-y: auto;
  padding: 10px 8px;
  background: #e6e9ee;
  border-right: 1px solid #d5dae1;
  overscroll-behavior: contain;
}

.pdf-thumbnail {
  display: block;
  margin: 0 auto 10px;
  padding: 0;
  border: 1px solid #c3c9d2;
  border-radius: 2px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 1px 4px rgba(23, 32, 51, 0.2);
}

.pdf-thumbnail canvas {
  display: block;
}

.pdf-thumbnail-label {
  display: block;
  padding: 2px 0 3px;
  color: var(--muted);
  font-size: 9px;
}

.pdf-thumbnail.is-active {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
}

.pdf-viewer-scroll {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.pdf-viewer-pages {
  position: relative;
  width: 100%;
}

.pdf-page-canvas {
  position: absolute;
  background: #fff;
  box-shadow: 0 2px 10px rgba(23, 32, 51, 0.25);
}

.pdf-zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 6px;
}

.pdf-zoom-value {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
}

.pdf-zoom-value input {
  width: 52px;
  padding: 3px 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  font-size: 11px;
  text-align: right;
}

.pdf-page-indicator {
  position: absolute;
  z-index: 3;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(23, 32, 51, 0.82);
  color: #fff;
  font-size: 11px;
  pointer-events: none;
  white-space: nowrap;
}

.comparison-pdf-frame {
  position: absolute;
  z-index: 2;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

canvas.comparison-pdf-frame {
  inset: auto;
  background: #fff;
  box-shadow: 0 2px 10px rgba(23, 32, 51, 0.35);
}

.comparison-pdf-frame.is-comparing {
  visibility: visible;
  opacity: 1;
}

.text-selection-viewer {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: auto;
  padding: 20px;
  background: #292a2c;
  overscroll-behavior: contain;
}

.text-selection-pages {
  display: grid;
  gap: 20px;
  width: min(100%, 920px);
  margin: 0 auto;
}

.text-selection-page {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
}

.text-selection-page::before {
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 8px;
  padding: 3px 6px;
  border-radius: 3px;
  content: attr(data-page-label);
  color: #fff;
  background: rgba(24, 31, 44, 0.72);
  font-size: 9px;
  pointer-events: none;
}

.text-selection-page img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  pointer-events: none;
}

.text-selection-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.text-selection-word {
  position: absolute;
  display: block;
  overflow: hidden;
  color: transparent;
  white-space: pre;
  line-height: 1;
  user-select: none;
}

.text-selection-word.is-picked {
  background: rgba(49, 87, 213, 0.38);
  outline: 1px solid rgba(49, 87, 213, 0.28);
}

.processing {
  z-index: 2;
  background: rgba(237, 240, 243, 0.94);
}

.spinner {
  width: 34px;
  height: 34px;
  margin-bottom: 15px;
  border: 3px solid #cbd2dd;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.is-hidden {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 320px;
  }

  .workspace {
    grid-template-columns: var(--sidebar-width) 6px minmax(0, 1fr);
  }

  .sidebar {
    padding-right: 14px;
    padding-left: 14px;
  }

  .sidebar-footer {
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (max-width: 720px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow: visible;
  }

  body {
    display: block;
  }

  .topbar {
    height: 64px;
    padding: 0 16px;
  }

  .service-status {
    display: none;
  }

  .workspace {
    display: block;
    height: auto;
    overflow: visible;
  }

  .workspace-resizer {
    display: none;
  }

  .sidebar {
    height: auto;
    padding-bottom: 0;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid #d5dae1;
  }

  .sidebar-collapsed .sidebar {
    visibility: visible;
    padding-right: 14px;
    padding-left: 14px;
    border-bottom: 1px solid #d5dae1;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .sidebar-footer {
    position: static;
    margin-bottom: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .toolbar-icon-button {
    display: none;
  }

  .preview-panel {
    height: 720px;
    min-height: 720px;
    padding: 12px;
  }

  .preview-stage,
  .pdf-frame,
  .pdf-viewer {
    min-height: 640px;
  }

  .pdf-viewer-thumbnails {
    display: none;
  }
}

/* ---------- 模式切换与通用表单编辑 ---------- */

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 14px 0 0;
}

.mode-tab {
  height: 38px;
  border: 1px solid #c7ced8;
  border-radius: 6px;
  color: #49536a;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.mode-tab:hover {
  background: #f3f5f7;
}

.mode-tab.is-active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

body.form-mode .report-mode-only {
  display: none;
}

.form-section .drop-zone {
  margin-top: 12px;
}

.form-field-list {
  margin-top: 2px;
}

.form-field input[type="text"],
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #bdc5d1;
  border-radius: 4px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  font-weight: 600;
}

.form-field input[type="text"]:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.1);
}

.form-field textarea {
  resize: vertical;
  font-family: inherit;
}

.form-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.form-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.form-radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #49536a;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.form-radio-group input[type="radio"] {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
}

.form-field-hint {
  color: #7b8598;
  font-size: 11px;
  font-weight: 500;
}

.form-field-readonly {
  color: #7b8598;
  font-size: 12px;
  font-weight: 500;
}

.form-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.form-actions .primary-button,
.form-actions .secondary-button {
  width: 100%;
  margin-top: 0;
}
