@font-face {
  font-family: "Y14.5 Symbols";
  src: url("/static/fonts/Y14.5-2018.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: "PingFang SC", "Microsoft YaHei", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101111;
  color: #e8ecee;
  --topbar-height: 86px;
  --side-panel-width: 388px;
  --green: #5aa7ff;
  --green-dark: #2f75c8;
  --acid: #72d7ff;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  background: #101111;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
}

button,
select,
input {
  font: inherit;
}

.app-frame {
  width: 100vw;
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-rows: var(--topbar-height) 0 1fr;
  overflow: hidden;
}

.app-frame.topbar-collapsed {
  grid-template-rows: 0 0 1fr;
}

.topbar {
  position: relative;
  z-index: 20;
  min-height: 0;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #343a3d;
  background: #202324;
  overflow: visible;
}

.app-frame.topbar-collapsed .topbar {
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom: 0;
  overflow: hidden;
}

.top-resizer {
  position: relative;
  z-index: 6;
  display: grid;
  place-items: center;
  height: 0;
  min-height: 0;
  background: transparent;
  user-select: none;
}

.top-resizer::before {
  display: none;
}

.top-collapse-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 12px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transform: translate(-50%, -100%);
  border: 1px solid #40484b;
  border-radius: 6px;
  background: #242829;
  color: #d5dde1;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
  white-space: nowrap;
}

.app-frame.topbar-collapsed .top-collapse-handle {
  transform: translate(-50%, 0);
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.brand-logo {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand-logo-light {
  display: none;
}

.brand-copy h1 {
  margin: 0;
  color: #f7f9fa;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
}

.brand-copy p {
  margin: 5px 0 0;
  color: #a7b2b8;
  font-size: 13px;
}

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

.utility-toggle {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #465156;
  border-radius: 7px;
  color: #dce3e6;
  background: #171a1b;
  cursor: pointer;
  font: 600 13px/1 system-ui, sans-serif;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.utility-toggle.language {
  width: 52px;
  grid-template-columns: 15px auto;
  gap: 3px;
}

.utility-toggle b {
  font-size: 10px;
}

.utility-toggle:hover {
  border-color: var(--green);
  color: var(--acid);
}

.theme-icon {
  width: 18px;
  height: 18px;
  display: none;
}

body.theme-light .theme-icon-moon { display: block; }
body.theme-dark .theme-icon-sun { display: block; }

.status-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(220px, 27vw, 380px);
  min-height: 42px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #3d464a;
  border-radius: 10px;
  background: #191d1f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 3px 10px rgba(0, 0, 0, 0.12);
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.status-banner:hover {
  border-color: #536066;
}

.status-indicator {
  position: relative;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #76848b;
  box-shadow: 0 0 0 3px rgba(118, 132, 139, 0.12);
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.status {
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  color: #e1e7ea;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  text-align: left;
  text-wrap: pretty;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.status-banner[data-state="processing"] {
  border-color: #35638f;
  background: #18232d;
}

.status-banner[data-state="processing"] .status-indicator {
  background: #5aa7ff;
  box-shadow: 0 0 0 3px rgba(90, 167, 255, 0.16);
  animation: status-pulse 1.8s ease-out infinite;
}

.status-banner[data-state="success"] {
  border-color: #386d4d;
  background: #19271f;
}

.status-banner[data-state="success"] .status-indicator {
  background: #4dcc82;
  box-shadow: 0 0 0 3px rgba(77, 204, 130, 0.14);
}

.status-banner[data-state="warning"] {
  border-color: #735d35;
  background: #292419;
}

.status-banner[data-state="warning"] .status-indicator {
  background: #e1b34f;
  box-shadow: 0 0 0 3px rgba(225, 179, 79, 0.14);
}

.status-banner[data-state="error"] {
  border-color: #7c4343;
  background: #2b1d1d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 3px 12px rgba(80, 16, 16, 0.16);
}

.status-banner[data-state="error"] .status-indicator {
  background: #ff7373;
  box-shadow: 0 0 0 3px rgba(255, 115, 115, 0.15);
}

@keyframes status-pulse {
  0% {
    box-shadow: 0 0 0 3px rgba(90, 167, 255, 0.2);
  }
  65%,
  100% {
    box-shadow: 0 0 0 8px rgba(90, 167, 255, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-banner[data-state="processing"] .status-indicator {
    animation: none;
  }
}

.auth-user {
  max-width: 160px;
  overflow: hidden;
  color: #c7d0d5;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.help-login-button,
.help-user-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #465156;
  border-radius: 7px;
  color: #dce3e6;
  background: #171a1b;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.help-user-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 150px;
}

.help-login-button:hover,
.help-user-button:hover {
  border-color: var(--green);
}

.auth-user-menu {
  position: relative;
}

.auth-user-dropdown {
  position: absolute;
  color: #72d7ff;
}

.help-user-button svg:first-child {
  flex-shrink: 0;
}

.help-user-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 120px;
  background: #1e2022;
  border: 1px solid #343a3d;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  overflow: hidden;
  z-index: 200;
}

.auth-dropdown-item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: #c7d0d5;
}

.auth-dropdown-item:hover {
  background: #2a2d2f;
}

.auth-dropdown-item.danger {
  color: #e05c5c;
}

.auth-dropdown-item.danger:hover {
  background: rgba(224,92,92,0.12);
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: auto;
  background: rgba(5, 7, 8, 0.76);
  backdrop-filter: blur(4px);
}

.auth-close-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  border-radius: 50%;
  color: #7a8a94;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.auth-close-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #c7d0d5;
}

.theme-light .auth-close-btn {
  color: #8f9ca2;
}

.theme-light .auth-close-btn:hover {
  background: rgba(0,0,0,0.06);
  color: #4a5560;
}

.auth-card {
  position: relative;
  width: min(360px, 100%);
  box-sizing: border-box;
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 28px 24px 20px;
  border: 1px solid #343a3d;
  border-radius: 14px;
  background: #181a1a;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.auth-brand {
  margin-bottom: 2px;
}

.auth-brand strong {
  display: block;
  color: #f7f9fa;
  font-size: 20px;
  font-weight: 700;
}

.auth-brand p {
  margin: 4px 0 0;
  color: #8a979e;
  font-size: 12px;
  line-height: 1.5;
}

.auth-method {
  width: min(280px, 100%);
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: 8px;
  background: #222526;
  color: #07c160;
  font-size: 14px;
  font-weight: 600;
}

.auth-qr-shell {
  position: relative;
  width: 230px;
  height: 210px;
  overflow: hidden;
  border: 1px solid #343a3d;
  border-radius: 12px;
  background: #fff;
  color: #52626d;
}

.auth-qr-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background-color: #f4f8fb;
  background-image:
    linear-gradient(rgba(47, 127, 209, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 127, 209, 0.07) 1px, transparent 1px),
    radial-gradient(circle at 50% 42%, rgba(34, 211, 238, 0.14), transparent 52%);
  background-size: 18px 18px, 18px 18px, 100% 100%;
  color: #425968;
}

.auth-qr-loading[hidden] {
  display: none;
}

.auth-qr-loading:not(.is-loading) .auth-qr-loader-visual {
  display: none;
}

.auth-qr-loader-visual {
  position: relative;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  border: 1px solid rgba(47, 127, 209, 0.32);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 12px 30px rgba(37, 99, 153, 0.12);
}

.auth-qr-loader-visual::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px solid #2f7fd1;
  border-block-color: transparent;
  border-radius: 10px;
  opacity: 0.58;
}

.auth-qr-loader-visual::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  top: 12px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #22b8cf 22%, #2f7fd1 50%, #22b8cf 78%, transparent);
  box-shadow: 0 0 10px rgba(34, 184, 207, 0.72);
  animation: auth-qr-scan 1.7s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
}

#auth-qr-placeholder {
  display: block;
  position: relative;
  text-align: center;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.auth-qr-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(47, 127, 209, 0.18);
  border-top-color: #2f7fd1;
  border-right-color: #22b8cf;
  border-radius: 50%;
  box-sizing: border-box;
  animation: auth-qr-spin 0.85s linear infinite;
}

.auth-qr-spinner[hidden] {
  display: none;
}

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

@keyframes auth-qr-scan {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(46px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-qr-spinner {
    animation-duration: 2.4s;
  }

  .auth-qr-loader-visual::after {
    animation: none;
    transform: translateY(23px);
  }
}

#wechat-qr-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 300px;
  height: 400px;
  transform: translate(-87px, -5px) scale(1.36);
  transform-origin: top left;
  z-index: 1;
}

#wechat-qr-container iframe {
  width: 300px;
  height: 400px;
  border: none;
  border-radius: 12px;
  background: #fff;
  display: block;
}

.auth-status {
  min-height: 18px;
  margin: 0;
  color: #8a979e;
  font-size: 12px;
  line-height: 1.6;
}

.auth-refresh {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5ea4e6;
  font-size: 12px;
  cursor: pointer;
}

.auth-refresh::before {
  content: "";
  position: absolute;
  inset: -12px -16px;
}

.auth-refresh:hover {
  color: #84bcf0;
  text-decoration: underline;
}

/* 二维码过期覆盖层 */
.qr-expired-overlay {
  position: absolute;
  inset: 0;
  background: rgba(24, 26, 26, 0.85);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}

.qr-expired-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #f7f9fa;
}

.qr-expired-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
}

.qr-expired-text {
  font-size: 16px;
  font-weight: 600;
  color: #f7f9fa;
}

.qr-expired-sub {
  font-size: 13px;
  color: #8a979e;
}

.theme-light .qr-expired-overlay {
  background: rgba(255, 255, 255, 0.85);
}

.theme-light .qr-expired-content {
  color: #1f2a30;
}

.theme-light .qr-expired-text {
  color: #1f2a30;
}

.theme-light .qr-expired-sub {
  color: #62707a;
}

@media (max-width: 430px) {
  .auth-card {
    padding-inline: 18px;
  }
}

.workspace {
  position: relative;
  height: 100%;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: var(--side-panel-width) 8px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  background: #101111;
}

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

.side-panel,
.data-panel {
  min-height: 0;
  overflow: auto;
  background: #181a1a;
}

.side-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border: 0;
  border-radius: 0;
  background: #101111;
  margin: 0 0 4px 4px;
  padding: 8px 0 0 0;
  min-width: 0;
  gap: 8px;
}

.workspace.side-collapsed .side-panel {
  overflow: hidden;
  padding: 0;
  margin: 0;
  border-right: 0;
}

.data-panel {
  grid-row: 3;
  border: 1px solid #303638;
  border-radius: 8px;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  background: #242625;
}

.data-panel[hidden] {
  display: none;
}

.panel-resizer {
  position: relative;
  z-index: 5;
  display: grid;
  place-items: center;
  min-width: 4px;
  background: transparent;
  cursor: col-resize;
  user-select: none;
}

.panel-resizer-left {
  border-left: 0;
}

.workspace.side-collapsed .panel-resizer-left {
  cursor: default;
}

.panel-resizer::before {
  content: "";
  height: 100%;
}

.panel-resizer:hover::before,
.panel-resizer.is-dragging::before {
  background: #5aa7ff;
  width: 2px;
}

.workspace.side-collapsed .panel-resizer-left .collapse-handle {
  color: #ffffff;
  background: #242829;
  border-color: #40484b;
}

.panel-resizer.is-dragging,
.panel-resizer:hover {
  background: rgba(90, 167, 255, 0.1);
}

.panel-resizer.is-dragging::before,
.panel-resizer:hover::before {
  background: #5aa7ff;
  width: 2px;
}

.collapse-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 6;
  width: 28px;
  height: 64px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transform: translate(-50%, -50%);
  border: 1px solid #40484b;
  border-radius: 8px;
  background: #242829;
  color: #d5dde1;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  pointer-events: auto;
}

.collapse-handle:hover {
  border-color: #5aa7ff;
  color: #ffffff;
}

body.resizing-panel {
  cursor: col-resize;
  user-select: none;
}

.workflow-card,
.control-section,
.summary-panel {
  border: 1px solid #333839;
  border-radius: 8px;
  background: #242625;
}

.workflow-card,
.control-section {
  padding: 14px;
}

.sidebar-idle-assist {
  grid-row: 3;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 18px 16px 16px;
  border: 1px solid #333d42;
  border-radius: 10px;
  background:
    radial-gradient(circle at 100% 0, rgba(52, 126, 218, 0.15), transparent 44%),
    #1c2021;
  color: #dce5e8;
  overflow: auto;
}

.recognition-active .sidebar-idle-assist,
.recognition-complete .sidebar-idle-assist {
  display: none;
}

.sidebar-idle-assist-heading {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.sidebar-idle-assist-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(105, 177, 255, 0.38);
  border-radius: 10px;
  background: rgba(57, 125, 207, 0.17);
  color: #79b9ff;
}

.sidebar-idle-assist-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-idle-assist-heading h2 {
  margin: 0;
  color: #f0f5f7;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
}

.sidebar-idle-assist-heading p {
  margin: 3px 0 0;
  color: #9eabb1;
  font-size: 12px;
  line-height: 1.45;
}

.sidebar-idle-assist-section {
  display: grid;
  gap: 8px;
}

.sidebar-idle-assist-label {
  color: #aebbc1;
  font-size: 12px;
  font-weight: 600;
}

.sidebar-idle-assist-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sidebar-idle-assist-tags span {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(123, 148, 162, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #c8d5da;
  font-size: 12px;
  line-height: 1;
}

.sidebar-idle-assist-checklist {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid rgba(157, 175, 184, 0.15);
  border-bottom: 1px solid rgba(157, 175, 184, 0.15);
  list-style: none;
}

.sidebar-idle-assist-checklist li {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  color: #b7c3c8;
  font-size: 12px;
  line-height: 1.5;
}

.sidebar-idle-assist-checklist li > span:first-child {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border-radius: 50%;
  background: rgba(42, 174, 102, 0.16);
  color: #61d792;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.sidebar-idle-assist-demo {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid rgba(85, 162, 248, 0.75);
  border-radius: 8px;
  background: #286db5;
  color: #ffffff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 14px rgba(5, 36, 71, 0.18);
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}

.sidebar-idle-assist-demo-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
}

.sidebar-idle-assist-demo-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-idle-assist-demo-arrow {
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
}

@media (hover: hover) and (pointer: fine) {
  .sidebar-idle-assist-demo:hover {
    border-color: #83c1ff;
    background: #357ac4;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 18px rgba(5, 36, 71, 0.26);
    transform: translateY(-1px);
  }
}

.sidebar-idle-assist-demo:active {
  transform: scale(0.98);
}

.sidebar-idle-assist-demo:disabled {
  cursor: wait;
  opacity: 0.68;
}

.sidebar-idle-assist-help {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--wb-line, rgba(56, 189, 248, 0.14));
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--wb-muted, #8296b0);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms cubic-bezier(0.23, 1, 0.32, 1);
}

.sidebar-idle-assist-help:hover {
  border-color: var(--wb-line-strong, rgba(56, 189, 248, 0.34));
  background: rgba(34, 211, 238, 0.05);
  color: var(--wb-cyan, #22d3ee);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.12);
  transform: translateY(-1px);
}

.sidebar-idle-assist-help:active {
  transform: scale(0.98);
}

.sidebar-idle-assist-help-icon {
  flex-shrink: 0;
  color: var(--wb-cyan, #22d3ee);
  transition: color 180ms ease;
}

.sidebar-idle-assist-help-arrow {
  margin-left: auto;
  font-size: 18px;
  font-weight: 700;
  color: var(--wb-muted, #5b6b82);
  transition: color 180ms ease, transform 180ms ease;
}

.sidebar-idle-assist-help:hover .sidebar-idle-assist-help-arrow {
  color: var(--wb-cyan, #22d3ee);
  transform: translateX(2px);
}

.sample-history-confirm-overlay {
  z-index: 1200;
  background: rgba(5, 12, 17, 0.64);
  backdrop-filter: blur(5px);
}

.sample-history-confirm-dialog {
  width: min(450px, calc(100vw - 32px));
  min-width: min(300px, calc(100vw - 32px));
  padding: 22px;
  border-color: #3c4b54;
  background: #242a2d;
  color: #eef4f6;
}

.sample-history-confirm-close {
  position: absolute;
  top: 12px;
  right: 14px;
}

.sample-history-confirm-copy {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 13px;
  padding-right: 22px;
}

.sample-history-confirm-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(111, 180, 255, 0.4);
  border-radius: 11px;
  background: rgba(53, 126, 212, 0.18);
  color: #83c2ff;
}

.sample-history-confirm-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sample-history-confirm-copy h2 {
  margin: 1px 0 8px;
  color: #f4f8fa;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.sample-history-confirm-copy p {
  margin: 0;
  color: #b8c5ca;
  font-size: 13px;
  line-height: 1.65;
}

.sample-history-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.sample-history-confirm-actions .pill-button {
  min-height: 36px;
}

.control-stack {
  display: grid;
  gap: 12px;
  margin-top: 0;
}

.recognition-active .control-stack,
.recognition-complete .control-stack,
.recognition-active .summary-panel {
  display: none;
}

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

.section-head > strong {
  color: #f0f3f4;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.section-head h2 {
  margin: 0;
  color: #f3f6f7;
  font-size: 15px;
  font-weight: 500;
}

.ghost-button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px dashed #a95f2b;
  border-radius: 6px;
  background: rgba(169, 95, 43, 0.12);
  color: #f1a15c;
  font-size: 12px;
  font-weight: 500;
}

.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
}

.steps::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 17px;
  height: 2px;
  background: #3a3f40;
}

.steps span {
  position: relative;
  min-height: 74px;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 6px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  color: #cfd5d7;
  text-align: center;
  background: transparent;
}

.steps span::before {
  content: attr(data-step);
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin-bottom: 2px;
  border: 2px solid #4b5051;
  border-radius: 50%;
  background: #3d4142;
  color: #9ca4a7;
  font-size: 14px;
  font-weight: 500;
}

.workflow-step strong {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.workflow-step small {
  min-height: 24px;
  color: #8a9194;
  font-size: 11px;
  line-height: 1.25;
}

.workflow-step.done::before {
  content: "✓";
  border-color: #1fa653;
  background: #1d6f3e;
  color: #bff4d4;
  font-size: 20px;
}

.workflow-step.done small {
  color: #36c36d;
}

.workflow-step.active::before {
  content: "...";
  border-color: #2e70e8;
  background: #374152;
  color: #79a8ff;
  font-size: 16px;
  box-shadow: 0 0 0 0 rgba(74, 156, 255, 0.42);
  animation: workflowPulse 1.5s ease-out infinite;
}

.workflow-step.active small,
.workflow-step.pending-accent small {
  color: #4e9df2;
}

.workflow-step.pending-accent strong {
  color: #5aa7ff;
}

.drop-zone {
  min-height: 56px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 1px dashed #5b6b72;
  border-radius: 8px;
  background: #1c1f20;
  color: #d4dcdf;
  cursor: pointer;
}

.drop-zone input {
  display: none;
}

.drop-zone:has(input:disabled) {
  cursor: wait;
  opacity: 0.62;
}

.run-button,
.icon-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: #2770c8;
  color: #ffffff;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.run-button {
  width: 100%;
  margin-top: 10px;
}

.icon-button[href="#"] {
  pointer-events: none;
  opacity: 0.45;
}

.icon-button.subtle {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #3d474b;
  background: #1b1f20;
  color: #cdd7dc;
  font-size: 12px;
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

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

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

.history-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid #343c3f;
  border-radius: 6px;
  background: #1c2021;
  color: #dce5e8;
  text-align: left;
  cursor: pointer;
}

.history-item strong,
.history-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item strong {
  font-size: 13px;
  font-weight: 500;
}

.history-item span {
  grid-column: 1 / -1;
  color: #93a0a7;
  font-size: 12px;
}

.history-item em {
  padding: 2px 7px;
  border-radius: 999px;
  background: #26313a;
  color: #80bfff;
  font-size: 11px;
  font-style: normal;
}

.history-item em[data-status="done"] {
  background: rgba(28, 133, 72, 0.2);
  color: #55d987;
}

.history-item em[data-status="failed"] {
  background: rgba(176, 45, 45, 0.22);
  color: #ff7777;
}

.history-empty {
  margin: 0;
  color: #8f9ca2;
  font-size: 13px;
}

.field-grid label {
  display: grid;
  gap: 6px;
  color: #aeb8bd;
  font-size: 12px;
  font-weight: 500;
}

select {
  width: 100%;
  min-height: 34px;
  border: 1px solid #465156;
  border-radius: 6px;
  padding: 0 10px;
  background: #171a1b;
  color: #f2f5f6;
}

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

.toggle-grid label,
.check-control {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cbd4d8;
  font-size: 12px;
  font-weight: 500;
}

.overlay-control {
  display: none;
}

.show-overlay-controls .overlay-control {
  display: flex;
}

.summary-panel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin-top: 12px;
  overflow: hidden;
}

.summary-panel[hidden] {
  display: none;
}

.summary-panel div {
  padding: 12px;
  border-right: 1px solid #383f42;
  border-bottom: 1px solid #383f42;
}

.summary-panel strong {
  display: block;
  color: #f7f9fa;
  font-size: 20px;
}

.summary-panel span {
  color: #9fa9ae;
  font-size: 12px;
  font-weight: 500;
}

.canvas-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  background: #666b69;
  overflow: hidden;
  border: 1px solid #343a3d;
  border-radius: 8px;
  margin: 4px 4px 4px 0;
}

.drawing-header {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid #303637;
  background: linear-gradient(#2f3130, #222423);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.drawing-header[hidden],
.canvas-toolbar[hidden] {
  display: none !important;
}

.drawing-file {
  min-width: 0;
  color: #cfd6d8;
  font-size: 16px;
  font-weight: 400;
}

.drawing-file strong {
  color: #e6ebed;
  font-weight: 400;
}

.drawing-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.save-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 5px;
  background: rgba(45, 177, 91, 0.18);
  color: #68d58c;
  font-size: 12px;
  font-weight: 500;
}

.save-status::before {
  content: "✓";
  margin-right: 4px;
}

.save-status.saving {
  background: rgba(47, 124, 255, 0.18);
  color: #74b3ff;
}

.save-status.saving::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid rgba(116, 179, 255, 0.3);
  border-top-color: #74b3ff;
  border-radius: 999px;
  animation: spin 820ms linear infinite;
}

.save-status.failed {
  background: rgba(224, 67, 54, 0.18);
  color: #ff8a80;
  cursor: pointer;
}

.save-status.failed::before {
  content: "!";
}

.pill-button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  border: 1px solid #d4d8da;
  border-radius: 14px;
  background: #f4f5f5;
  color: #202323;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

.local-library {
  cursor: pointer;
}

.canvas-toolbar {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-bottom: 1px solid #555958;
  background: linear-gradient(#767a79, #646867);
  align-self: stretch;
}

.segmented,
.zoom-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid #3f484c;
  border-radius: 7px;
  overflow: hidden;
  background: #2b3032;
}

.segmented button,
.zoom-control button {
  min-height: 28px;
  border: 0;
  border-right: 1px solid #3f484c;
  padding: 0 10px;
  background: transparent;
  color: #dce3e6;
  font-weight: 500;
  cursor: pointer;
}

.segmented button:last-child,
.zoom-control button:last-child {
  border-right: 0;
}

.segmented button.active {
  background: #2e7bd4;
  color: #ffffff;
}

.zoom-control span {
  min-width: 52px;
  text-align: center;
  color: #f3f6f7;
  font-size: 13px;
  font-weight: 500;
}

.bubble-controls {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 30px;
  padding: 2px;
  border-radius: 7px;
  background: rgba(128, 128, 128, 0.18);
}

.bubble-control-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.18);
}

.bubble-size-control {
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 5px;
  overflow: hidden;
  background: transparent;
}

.bubble-size-control .bubble-size-btn {
  min-height: 24px;
  min-width: 24px;
  border: 0;
  border-radius: 4px;
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 120ms, color 120ms;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bubble-size-control .bubble-size-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.95);
}

.bubble-size-control .bubble-size-btn:disabled {
  color: rgba(255, 255, 255, 0.32);
  cursor: default;
}

.bubble-size-control .bubble-size-btn:disabled:hover {
  background: transparent;
}

.bubble-size-control span {
  min-width: 30px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #f3f6f7;
  font-size: 12px;
  font-weight: 500;
}

.tool-icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.tool-icon-button:disabled {
  cursor: default;
}

.tool-icon-button svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.canvas-fixed-controls {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
}

.canvas-history-controls {
  position: absolute;
  top: 14px;
  left: 14px;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.show-overlay-controls .canvas-history-controls {
  display: flex;
}

.canvas-info-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: 34px;
  pointer-events: none;
}

.show-overlay-controls .canvas-info-controls {
  display: flex;
}

.drawing-info-button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 11px;
  padding: 0;
  background: #3d9b62;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.26);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.drawing-info-button:hover {
  background: #48ad70;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32);
  transform: translateY(-1px);
}

.drawing-info-button:active {
  transform: translateY(0);
}

.drawing-info-button:focus-visible {
  outline: 3px solid rgba(111, 169, 255, 0.72);
  outline-offset: 2px;
}

.raw-excel-button {
  background: #2a5fa8;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.78);
}

.raw-excel-button:hover {
  background: #356fc0;
}

.raw-excel-button[hidden] {
  display: none;
}

.drawing-info-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-icon-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 6px;
  padding: 0;
  background: #f4f5f5;
  color: #3b3f40;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  pointer-events: auto;
}

.history-icon-button:disabled {
  border-color: rgba(255, 255, 255, 0.18);
  background: #929695;
  color: rgba(47, 51, 52, 0.62);
  box-shadow: none;
  cursor: default;
}

.history-icon-button svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.manual-annotation-button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 0 8px;
  background: rgba(43, 48, 51, 0.82);
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.manual-annotation-button:hover {
  background: rgba(54, 61, 65, 0.92);
  color: #ffffff;
}

.manual-annotation-button.active {
  border-color: rgba(47, 124, 255, 0.8);
  background: #2f7cff;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(47, 124, 255, 0.18), 0 0 22px rgba(47, 124, 255, 0.28);
}

.manual-annotation-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.manual-annotation-button svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.manual-mode-banner {
  position: fixed;
  top: calc(var(--topbar-height) + 12px);
  left: 50%;
  z-index: 90;
  max-width: calc(100vw - 32px);
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px 7px 10px;
  border: 1px solid rgba(110, 181, 255, 0.72);
  border-radius: 9px;
  background: rgba(19, 44, 70, 0.96);
  color: #f4f9fc;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(47, 124, 255, 0.12);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}

.manual-mode-banner[hidden] {
  display: none;
}

.app-frame.topbar-collapsed .manual-mode-banner {
  top: 14px;
}

.manual-mode-symbol {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  border-radius: 7px;
  background: #2f7cff;
  box-shadow: 0 0 18px rgba(66, 145, 255, 0.48);
}

.manual-mode-symbol svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.manual-mode-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.manual-mode-copy strong {
  font-size: 13px;
  line-height: 1.2;
}

.manual-mode-copy small,
.manual-mode-exit-hint {
  color: #b8cce0;
  font-size: 11px;
  white-space: nowrap;
}

.manual-mode-banner kbd {
  min-width: 32px;
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(5, 13, 21, 0.36);
  color: #ffffff;
  font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
}

.manual-mode-banner > button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #c6d7e5;
  font-size: 21px;
  cursor: pointer;
}

.manual-mode-banner > button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

body.manual-annotation-active::after {
  content: "";
  position: fixed;
  inset: 4px;
  z-index: 85;
  border: 2px solid rgba(47, 124, 255, 0.72);
  border-radius: 10px;
  box-shadow: inset 0 0 34px rgba(47, 124, 255, 0.1), 0 0 24px rgba(47, 124, 255, 0.18);
  pointer-events: none;
  animation: manual-mode-frame-pulse 2.4s ease-in-out infinite;
}

.manual-annotation-active .canvas-panel {
  border-color: #4c96ff;
  box-shadow: inset 0 0 0 2px rgba(47, 124, 255, 0.28), 0 0 28px rgba(47, 124, 255, 0.16);
}

.manual-annotation-active .drawing-header {
  box-shadow: inset 0 -2px 0 rgba(47, 124, 255, 0.54);
}

@keyframes manual-mode-frame-pulse {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}

.toolbar-spacer {
  flex: 1 1 auto;
  min-width: 8px;
}

.export-menu {
  position: relative;
  display: none;
  align-items: center;
}

.recognition-complete .export-menu {
  display: inline-flex;
}

.export-bubble-button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 7px;
  padding: 0 10px;
  background: #f26a22;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.export-bubble-button:hover {
  background: #ff7a2f;
}

.export-bubble-button svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.export-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 104px;
  padding: 5px;
  border: 1px solid #3f484c;
  border-radius: 7px;
  background: #24292b;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32);
}

.export-options button {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 5px;
  padding: 0 10px;
  background: transparent;
  color: #e7ecef;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.export-options button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.theme-light .export-options {
  border-color: rgba(36, 44, 48, 0.16);
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(22, 28, 31, 0.18);
}

.theme-light .export-options button {
  color: #1f262a;
}

.theme-light .export-options button:hover {
  background: rgba(0, 0, 0, 0.06);
}

.theme-light .export-bubble-button {
  border-color: rgba(183, 82, 25, 0.24);
  background: #f26a22;
  color: #ffffff;
  box-shadow: 0 7px 16px rgba(85, 47, 20, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.theme-light .export-bubble-button:hover {
  background: #ff7a2f;
}

.toolbar-divider {
  width: 1px;
  height: 28px;
  background: #40484b;
}

.idle-state {
  align-self: stretch;
  justify-self: stretch;
  max-width: none;
  min-height: 0;
  display: grid;
  align-content: start;
  justify-items: stretch;
  gap: 18px;
  padding: 24px;
  color: #f1f5f6;
  grid-row: 3;
  overflow: auto;
  background: #202426;
}

.idle-hero {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: #2b3033;
  padding: 12px 26px 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.idle-kicker-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  color: #c7d0d5;
}

.idle-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: #f7fafc;
  color: #232b30;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
}

.idle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12);
}

.idle-kicker-note {
  color: #aab4ba;
  font-size: 13px;
}

.idle-hero h2 {
  margin: 0 0 8px;
  color: #f8fbfc;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
}

.idle-hero p {
  margin: 0;
  color: #c7d0d5;
  font-size: 13px;
  line-height: 1.45;
}

.idle-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.idle-feature-list > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: #f7fafc;
  color: #3f4b52;
  font-size: 13px;
  font-weight: 600;
}

.idle-feature-list svg,
.idle-guide-button svg,
.idle-action-icon svg,
.idle-upload-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.idle-upload-zone {
  min-height: 160px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 2px dashed rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: #eef3f5;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.idle-upload-zone:hover {
  border-color: #4ea1ff;
  background: rgba(78, 161, 255, 0.08);
}

.idle-upload-icon {
  width: 62px;
  height: 62px;
  color: #aeb7bc;
  stroke-width: 1.7;
}

.idle-upload-zone strong {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
}

.idle-upload-zone span {
  color: #b9c3c8;
  font-size: 13px;
  line-height: 1.4;
}

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

.idle-action-grid:has(.idle-action-card[hidden]) {
  grid-template-columns: 1fr;
}

.idle-action-card {
  width: 100%;
  min-height: 84px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: #2b3033;
  color: #edf3f5;
  padding: 10px 22px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.idle-action-card:hover {
  border-color: #4ea1ff;
  transform: translateY(-1px);
}

.idle-action-card:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.idle-action-card.primary {
  border-color: rgba(78, 161, 255, 0.42);
  background: rgba(42, 91, 150, 0.22);
}

.idle-action-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #dfe7eb;
}

.idle-action-card.primary .idle-action-icon {
  background: rgba(78, 161, 255, 0.18);
  color: #75b7ff;
}

.idle-action-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.idle-action-copy strong {
  color: inherit;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.22;
}

.idle-action-copy span {
  color: #b9c3c8;
  font-size: 13px;
  line-height: 1.35;
}

.idle-action-copy em {
  color: #75b7ff;
  font-style: normal;
  font-weight: 700;
}

.idle-action-arrow {
  color: #9fb0ba;
  font-size: 28px;
  line-height: 1;
}

.idle-guide-button {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(78, 161, 255, 0.7);
  border-radius: 8px;
  background: #202426;
  color: #eef3f5;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.idle-guide-panel {
  max-width: 760px;
  display: grid;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: #2b3033;
  padding: 16px 20px;
  color: #cad4d9;
}

.idle-guide-panel[hidden],
.idle-state[hidden] {
  display: none;
}

.idle-guide-copy {
  display: grid;
  gap: 4px;
}

.idle-guide-copy strong,
.idle-guide-tips strong {
  color: #f2f6f7;
  font-size: 15px;
}

.idle-guide-copy span,
.idle-guide-steps span,
.idle-guide-tips li {
  color: #b9c5ca;
  font-size: 13px;
  line-height: 1.5;
}

.idle-guide-steps {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
}

.idle-guide-steps li {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
}

.idle-guide-steps li > div {
  display: grid;
  gap: 3px;
}

.idle-guide-steps li strong {
  color: #e8eef0;
  font-size: 14px;
}

.idle-guide-step-number {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(74, 156, 255, 0.2);
  color: #91c6ff !important;
  font-weight: 700;
  line-height: 1 !important;
}

.idle-guide-tips {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-left: 2px solid #4a9cff;
  border-radius: 0 7px 7px 0;
  background: rgba(74, 156, 255, 0.08);
}

.idle-guide-tips ul {
  margin: 0;
  padding-left: 18px;
}

.idle-guide-tips li + li {
  margin-top: 3px;
}

@media (max-width: 960px) {
  .idle-state {
    padding: 18px;
  }

  .idle-action-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .idle-guide-steps {
    grid-template-columns: 1fr;
  }

  .idle-hero {
    padding: 18px;
  }

  .idle-kicker-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .idle-hero h2 {
    font-size: 26px;
  }

  .idle-hero p,
  .idle-upload-zone span,
  .idle-action-copy span {
    font-size: 15px;
  }

  .idle-upload-zone {
    min-height: 190px;
    padding: 12px;
  }

  .idle-action-card {
    min-height: 96px;
    gap: 14px;
    padding: 16px;
  }

  .idle-action-icon {
    width: 50px;
    height: 50px;
  }

  .idle-action-copy strong {
    font-size: 18px;
  }
}

.canvas-panel.processing-canvas .result,
.canvas-panel.processing-canvas .idle-state {
  filter: blur(4px) grayscale(0.15);
  opacity: 0.42;
  transition: filter 160ms ease, opacity 160ms ease;
}

.result {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 0;
}

.result[hidden] {
  display: none;
}

.preview-list {
  display: grid;
  /* gap: 14px; */
  height: 100%;
  min-height: 0;
}

.preview-item {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
}

.preview-item h2 {
  display: none;
}

.drawing-figure-shell {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.drawing-figure {
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 0;
  max-height: none;
  display: block;
  border: 0;
  border-radius: 0;
  background: #686b6a;
  cursor: grab;
  overscroll-behavior: contain;
}

.drawing-figure.can-pan,
.canvas-space-down .drawing-figure {
  cursor: grab;
}

.drawing-figure.is-panning {
  cursor: grabbing;
}

.manual-select-ready .drawing-figure,
.manual-selecting .drawing-figure {
  cursor: crosshair !important;
}

.manual-select-ready .drawing-figure::after {
  content: "拖框新增标注";
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 12;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 5px;
  background: rgba(29, 32, 33, 0.82);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 500;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.drawing-stage {
  position: relative;
  width: calc(100% * var(--zoom, 1));
  min-width: 1px;
  transform: translate(var(--pan-x, 0px), var(--pan-y, 0px)) rotate(var(--rotation, 0deg));
  transform-origin: center center;
  transition: transform 140ms ease;
}

.drawing-figure img {
  width: 100%;
  height: auto;
  display: block;
  background: #ffffff;
  box-shadow: 0 0 0 1px #b8bebe, 0 12px 34px rgba(0, 0, 0, 0.36);
}

.bubble-callout {
  position: absolute;
  z-index: 3;
  width: calc(48px * var(--bubble-scale, 1));
  height: calc(48px * var(--bubble-scale, 1));
  pointer-events: auto;
  cursor: pointer;
}

.bubble-callout.is-dragging {
  cursor: grabbing;
  z-index: 10;
  opacity: 0.85;
}

.bubble-callout.is-dragging .bubble-pin {
  transform: scale(1.12);
  filter: drop-shadow(0 4px 12px rgba(217, 39, 39, 0.55));
}

/* Circular bubble style */
.bubble-callout.bubble-style-circle {
  /* width/height already 48px from .bubble-callout */
}

.bubble-callout.bubble-style-circle .bubble-pin circle {
  stroke-width: 2.5;
}

.bubble-callout.bubble-style-circle .bubble-pin text {
  fill: #d92727;
  font-size: 18px;
  font-weight: 600;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

/* Leader line SVG — positioned absolutely inside .drawing-stage */
.bubble-leader-svg {
  pointer-events: none;
}

/* Bubble style toggle buttons */
.bubble-style-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  background: transparent;
  border-radius: 5px;
  padding: 0;
}

.bubble-style-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0;
  transition: background 120ms, color 120ms;
}

.bubble-style-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.bubble-style-btn.active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.theme-light .bubble-style-btn {
  color: rgba(0, 0, 0, 0.45);
}

.theme-light .bubble-style-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.9);
}

.theme-light .bubble-style-btn.active {
  background: rgba(0, 0, 0, 0.12);
  color: #000;
}

.dimension-highlight {
  position: absolute;
  z-index: 2;
  display: block;
  border: 0;
  outline: 1px solid rgba(21, 181, 99, 0.9);
  outline-offset: 0;
  background: rgba(67, 224, 137, 0.13);
  pointer-events: auto;
  cursor: context-menu;
  transition: background 120ms ease, box-shadow 120ms ease, outline-color 120ms ease;
}

.dimension-highlight:hover,
.dimension-highlight.selected-highlight {
  outline-color: rgba(47, 124, 255, 0.98);
  background: rgba(47, 124, 255, 0.16);
  box-shadow: 0 0 0 1px rgba(47, 124, 255, 0.68), 0 0 10px rgba(47, 124, 255, 0.24);
}

.dimension-highlight.is-resizing-box {
  outline: 2px solid rgba(47, 124, 255, 0.98);
  background: rgba(47, 124, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85), 0 0 14px rgba(47, 124, 255, 0.3);
  z-index: 6;
}

.dimension-highlight.is-resize-dragging {
  cursor: grabbing;
}

.annotation-resize-handle {
  position: absolute;
  z-index: 7;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 2px;
  background: #2f7cff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.32);
  pointer-events: auto;
}

.annotation-resize-handle.handle-nw {
  left: -5px;
  top: -5px;
  cursor: nwse-resize;
}

.annotation-resize-handle.handle-n {
  left: 50%;
  top: -5px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.annotation-resize-handle.handle-ne {
  right: -5px;
  top: -5px;
  cursor: nesw-resize;
}

.annotation-resize-handle.handle-e {
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.annotation-resize-handle.handle-se {
  right: -5px;
  bottom: -5px;
  cursor: nwse-resize;
}

.annotation-resize-handle.handle-s {
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.annotation-resize-handle.handle-sw {
  left: -5px;
  bottom: -5px;
  cursor: nesw-resize;
}

.annotation-resize-handle.handle-w {
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.manual-selection-rect {
  position: absolute;
  z-index: 8;
  display: block;
  border: 1px solid rgba(47, 124, 255, 0.95);
  background: rgba(47, 124, 255, 0.14);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.32) inset;
  pointer-events: none;
}

.manual-region-loading {
  position: fixed;
  left: 50vw;
  top: 50vh;
  z-index: 9;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(29, 32, 33, 0.88);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 500;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.26);
}

.manual-region-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.26);
  border-top-color: #58a6ff;
  border-radius: 999px;
  animation: spin 820ms linear infinite;
}

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

.hide-bubbles .bubble-callout,
.hide-bubbles .bubble-leader-svg {
  display: none;
}

.hide-borders .dimension-highlight,
.hide-borders .highlight-canvas {
  display: none;
}

.bubble-pin {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 1px 3px rgba(25, 31, 35, 0.26));
  transition: transform 120ms ease, filter 120ms ease;
}

.selected-bubble .bubble-pin,
.bubble-callout:hover .bubble-pin {
  transform: scale(1.08);
  filter: drop-shadow(0 2px 8px rgba(217, 39, 39, 0.45));
}

.bubble-pin text {
  fill: #d92727;
  font-size: 18px;
  font-weight: 600;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.preview-item a {
  display: none;
}

.preview-diagnostics {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: min(760px, calc(100% - 28px));
  pointer-events: none;
}

.preview-diagnostics span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  background: rgba(22, 26, 28, 0.82);
  color: #e6edf0;
  font-size: 12px;
  line-height: 1.25;
}

.processing-placeholder {
  min-height: 420px;
  display: grid;
  place-items: center;
  border: 1px dashed #9aa4a9;
  border-radius: 4px;
  background: #f7f8f8;
  color: #344046;
  text-align: center;
}

.processing-placeholder strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.processing-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.processing-overlay[hidden] {
  display: none;
}

.processing-dialog {
  width: min(680px, 46vw);
  border: 1px solid #455158;
  border-radius: 8px;
  padding: 20px 22px;
  background: rgba(29, 31, 31, 0.95);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  color: #eef4f6;
}

.processing-head {
  display: grid;
  gap: 6px;
}

.processing-kicker {
  display: none;
  font-size: 12px;
  font-weight: 500;
}

.processing-head strong {
  font-size: 17px;
}

.processing-head p {
  margin: 0;
  color: #b7c2c8;
  font-size: 13px;
}

.processing-eta {
  min-height: 18px;
  color: #8edfec;
  font-size: 12px;
}

.progress-track {
  height: 10px;
  margin: 14px 0 12px;
  overflow: hidden;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.06) 50%, rgba(255, 255, 255, 0.06) 75%, transparent 75%),
    #111516;
  background-size: 28px 28px;
  animation: progressTrackFlow 1.1s linear infinite;
}

.progress-value {
  width: 0%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(90deg, #20b8ce, #38d3e7 48%, #72f2ff);
  transition: width 420ms ease;
}

.progress-value::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0%, transparent 34%, rgba(255, 255, 255, 0.55) 50%, transparent 66%, transparent 100%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.16) 0 8px, transparent 8px 16px);
  transform: translateX(-100%);
  animation: progressValueSweep 1.25s linear infinite;
}

@keyframes progressTrackFlow {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 28px 0;
  }
}

@keyframes progressValueSweep {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@keyframes workflowPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 156, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(74, 156, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(74, 156, 255, 0);
  }
}

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

.processing-steps li {
  min-width: 0;
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 10px 6px;
  border: 1px solid #3c464b;
  border-radius: 7px;
  color: #8f9aa0;
  background: #24292b;
  text-align: center;
}

.processing-steps span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #343c40;
  color: #c9d2d6;
  font-size: 12px;
  font-weight: 500;
}

.processing-steps strong {
  font-size: 12px;
}

.processing-steps li.done {
  border-color: rgba(84, 215, 139, 0.65);
  color: #d7f8e5;
}

.processing-steps li.done span {
  background: #268b54;
  color: #ffffff;
}

.processing-steps li.active {
  border-color: #4a9cff;
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(74, 156, 255, 0.25);
}

.processing-steps li.active span {
  background: #2e7bd4;
  color: #ffffff;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid #343a3d;
  background: #202324;
}

.tab-button {
  min-height: 46px;
  border: 0;
  border-right: 1px solid #343a3d;
  background: transparent;
  color: #aeb8bd;
  font-weight: 500;
  cursor: pointer;
}

.tab-button:last-child {
  border-right: 0;
}

.tab-button.active {
  color: #ffffff;
  background: #2a2f31;
  box-shadow: inset 0 -2px 0 #4a9cff;
}

.tab-page {
  grid-row: 2;
  display: none;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.tab-page.active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
}

.annotation-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: #f0f3f4;
}

.annotation-toolbar strong {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.annotation-toolbar span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 5px;
  background: #233f72;
  color: #7fb0ff;
  font-size: 12px;
  font-weight: 500;
}

.annotation-toolbar-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.annotation-tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #6fa7ff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.annotation-tool-button:hover:not(:disabled),
.annotation-tool-button.active {
  border-color: #72adff;
  background: rgba(74, 156, 255, 0.16);
  color: #9cc7ff;
}

.annotation-tool-button.purple {
  color: #b26dff;
}

.annotation-tool-button.orange {
  color: #f18a36;
}

.annotation-tool-button.muted {
  color: #9aa3a8;
}

.annotation-tool-button.excel {
  color: #3fcf79;
}

.annotation-tool-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.sort-rule-icon {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
  width: 18px;
  line-height: 1;
  font-size: 14px;
  letter-spacing: -2px;
}

.annotation-gage-menu {
  position: relative;
}

.annotation-toolbar-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 8px;
  width: 210px;
  padding: 10px;
  border: 1px solid #3b4246;
  border-radius: 8px;
  background: #202323;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.annotation-toolbar-popover[hidden] {
  display: none;
}

.annotation-toolbar-popover label {
  color: #c5d0d5;
  font-size: 12px;
}

.annotation-toolbar-popover select,
.annotation-toolbar-popover button {
  min-height: 30px;
}

.table-shell {
  min-height: 0;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: #242625;
}

.gdt-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
  line-height: 1.35;
}

.gdt-table th,
.gdt-table td {
  padding: 6px 4px;
  border-bottom: 1px solid #343a3d;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.gdt-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #242625;
  color: #c5d0d5;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
}

.gdt-table td {
  color: #e1e7ea;
  font-weight: 400;
}

.gdt-table td.bubble-cell {
  color: #55aaff;
  text-align: center;
  font-weight: 400;
}

.gdt-table th.select-cell,
.gdt-table td.select-cell {
  display: none;
  width: 28px;
  text-align: center;
}

.gdt-table.bulk-select-active th.select-cell,
.gdt-table.bulk-select-active td.select-cell {
  display: table-cell;
}

.gdt-table td.select-cell input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.gdt-table th:nth-child(2),
.gdt-table td.bubble-cell {
  width: 40px;
}

.gdt-table th:nth-child(3),
.gdt-table td.dimension-cell {
  width: 28%;
}

.gdt-table td.dimension-cell {
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gdt-table td.dimension-cell.gdt-expanded-dimension {
  width: auto;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.gdt-table td.gdt-expanded-dimension .gdt-control-frame {
  max-width: none;
}

.gdt-table th:nth-child(4),
.gdt-table td.upper-cell,
.gdt-table th:nth-child(5),
.gdt-table td.lower-cell {
  width: 48px;
}

.gdt-table th:nth-child(6),
.gdt-table td.gage-cell {
  width: 58px;
  text-align: center;
}

.gdt-table th:nth-child(7),
.gdt-table td.category-cell {
  width: 50px;
}

.gdt-table td.upper-cell {
  color: #35bf6d;
}

.gdt-table td.lower-cell {
  color: #e34a4a;
}

.gdt-table td.category-cell {
  color: #e6eaea;
  font-weight: 500;
}

.gdt-control-frame {
  display: inline-flex;
  max-width: 100%;
  border: 1px solid currentColor;
  color: inherit;
  vertical-align: middle;
  line-height: 1.1;
  white-space: nowrap;
}

.gdt-control-frame-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 22px;
  padding: 2px 7px;
  border-right: 1px solid currentColor;
  font-weight: 600;
}

.gdt-control-frame-cell:last-child {
  border-right: 0;
}

.gdt-symbol-font {
  font-family: "Y14.5 Symbols", "Segoe UI Symbol", "Noto Sans Symbols", sans-serif;
  font-weight: 400;
  font-style: normal;
  line-height: 1;
}

.gdt-control-frame-cell .gdt-symbol-font,
.gdt-table td.dimension-cell > .gdt-symbol-font {
  display: inline-flex;
  min-width: 1em;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  vertical-align: -0.08em;
}

.gdt-table th:last-child,
.gdt-table td.adjust-cell {
  width: 34px;
  text-align: center;
}

.adjust-cell {
  min-width: 34px;
  padding-left: 2px;
  padding-right: 2px;
  white-space: nowrap;
}

.adjust-order-button {
  width: 14px;
  height: 20px;
  min-height: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #2f7cff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.adjust-order-button:hover:not(:disabled) {
  background: rgba(47, 124, 255, 0.16);
  color: #6fa7ff;
}

.adjust-order-button:disabled {
  color: #7a8387;
  cursor: default;
  opacity: 0.45;
}

.gdt-table tbody tr {
  cursor: default;
}

.gdt-table tbody tr.selected-row {
  cursor: grab;
}

.gdt-table tbody tr.is-dragging {
  opacity: 0.46;
  cursor: grabbing;
}

.gdt-table tbody tr.drag-over-before td {
  box-shadow: inset 0 2px 0 #5aa7ff;
}

.gdt-table tbody tr.drag-over-after td {
  box-shadow: inset 0 -2px 0 #5aa7ff;
}

.theme-light .gdt-table tbody tr.drag-over-before td {
  box-shadow: inset 0 2px 0 #1f6fd8;
}

.theme-light .gdt-table tbody tr.drag-over-after td {
  box-shadow: inset 0 -2px 0 #1f6fd8;
}

@media (max-width: 768px) {
  .manual-mode-banner,
  .app-frame.topbar-collapsed .manual-mode-banner {
    top: auto;
    right: 12px;
    bottom: 14px;
    left: 12px;
    max-width: none;
    transform: none;
  }

  .manual-mode-exit-hint {
    display: none;
  }

  .manual-mode-copy {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.manual-annotation-active::after {
    animation: none;
  }
}

.gdt-table tbody tr:hover td {
  background: rgba(74, 156, 255, 0.12);
}

.gdt-table tr.selected-row td {
  background: rgba(74, 156, 255, 0.2);
  color: #ffffff;
}

.gdt-table tr.selected-row td.bubble-cell {
  color: #7dbbff;
  font-weight: 500;
}

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

.candidate-selected td:first-child {
  color: #49d28a;
  font-weight: 500;
}

.annotation-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding-top: 4px;
  border-top: 1px solid #343a3d;
  color: #8d9497;
  font-size: 13px;
}

.annotation-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 10px 6px;
  border-top: 1px solid #343a3d;
  overflow: visible;
}

.annotation-actions .annotation-quick-action {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 2px solid #f4f7f9;
  border-radius: 50%;
  background: #dfe5e9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  cursor: help;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.annotation-actions .annotation-quick-action svg {
  width: 14px;
  height: 14px;
}

.annotation-actions .annotation-quick-action.add {
  color: #12a965;
}

.annotation-actions .annotation-quick-action.edit {
  color: #347ff2;
}

.annotation-actions .annotation-quick-action.delete {
  color: #ff4f5e;
}

.annotation-actions .annotation-quick-action:hover,
.annotation-actions .annotation-quick-action:focus-visible,
.annotation-actions .annotation-quick-action.active {
  border-color: currentColor;
  background: #f4f7f9;
  transform: translateY(-2px);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.28);
  outline: none;
}

.annotation-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  z-index: 30;
  width: max-content;
  max-width: min(280px, calc(100vw - 40px));
  padding: 8px 10px;
  border: 1px solid #465156;
  border-radius: 7px;
  background: #111719;
  color: #e8eff2;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.annotation-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.annotation-actions .annotation-quick-action::after {
  content: "?";
  position: absolute;
  right: -3px;
  top: -4px;
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: #242a2d;
  color: currentColor;
  font-size: 10px;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.annotation-actions .annotation-quick-action:hover::before,
.annotation-actions .annotation-quick-action:focus-visible::before,
.annotation-actions .annotation-quick-action:hover::after,
.annotation-actions .annotation-quick-action:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.data-panel.annotation-row-action-pending .gdt-table tbody tr {
  cursor: crosshair;
}

.data-panel.annotation-row-action-pending .gdt-table tbody tr:hover td {
  background: rgba(74, 156, 255, 0.18);
}

.annotation-tool-button.danger {
  color: #ff7373;
}

.annotation-tool-button.danger:hover:not(:disabled) {
  border-color: #ff7373;
  background: rgba(255, 115, 115, 0.16);
  color: #ff9999;
}

.annotation-bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding-top: 4px;
  border-top: 1px solid #343a3d;
  color: #8d9497;
  font-size: 12px;
}

.annotation-bulk-bar[hidden] {
  display: none;
}

.annotation-bulk-bar button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #434b50;
  border-radius: 6px;
  background: #242827;
  color: #dfe6ea;
  font-size: 12px;
  cursor: pointer;
}

.annotation-bulk-bar button:hover:not(:disabled) {
  border-color: #6fa7ff;
  color: #ffffff;
}

.annotation-bulk-bar button.danger {
  border-color: rgba(235, 81, 104, 0.48);
  background: rgba(235, 81, 104, 0.14);
  color: #ff899b;
}

.annotation-bulk-bar button:disabled {
  cursor: default;
  opacity: 0.45;
}

.candidate-rejected td {
  color: #8f9aa0;
}

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

.ocr-raw-list details {
  border: 1px solid #383f42;
  border-radius: 8px;
  background: #25292b;
}

.ocr-raw-list summary {
  padding: 10px 12px;
  color: #f2f5f6;
  font-weight: 500;
  cursor: pointer;
}

.ocr-raw-list ol {
  max-height: none;
  margin: 0;
  padding: 0 16px 14px 34px;
  overflow: auto;
  color: #cbd4d8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.feedback-panel {
  display: grid;
  gap: 12px;
  margin: 16px 8px 8px;
  padding: 14px;
  border: 1px solid #343b3e;
  border-radius: 8px;
  background: #202426;
}

.feedback-copy {
  display: grid;
  gap: 4px;
}

.feedback-copy strong {
  color: #f2f5f6;
  font-size: 16px;
  font-weight: 600;
}

.feedback-copy span,
.feedback-status {
  color: #9da8ad;
  font-size: 13px;
}

.feedback-trigger {
  position: relative;
}

.feedback-unread-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border: 2px solid #202426;
  border-radius: 999px;
  background: #ef5656;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.feedback-unread-badge[hidden] {
  display: none;
}

.feedback-threads {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}

.feedback-thread {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #343f43;
  border-radius: 7px;
  background: #171c1e;
}

.feedback-thread-head,
.feedback-thread-reply-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.feedback-thread-status {
  color: #8ab4ff;
  font-size: 12px;
}

.feedback-thread-time {
  color: #7f8b91;
  font-size: 11px;
}

.feedback-thread-message {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #232a2d;
  color: #dce3e6;
  font-size: 13px;
  white-space: pre-wrap;
}

.feedback-thread-message.admin {
  border-left: 2px solid #8ab4ff;
  background: rgba(90, 167, 255, 0.1);
}

.feedback-thread-message small {
  color: #8d999f;
  font-size: 11px;
}

.feedback-thread-reply {
  width: 100%;
  min-height: 58px;
  padding: 8px 9px;
  resize: vertical;
  border: 1px solid #3c464a;
  border-radius: 6px;
  background: #111719;
  color: #eef3f5;
  font: inherit;
  font-size: 13px;
}

.feedback-form {
  display: grid;
  gap: 10px;
}

.feedback-rating,
.feedback-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.feedback-rating label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #d8dee2;
  font-size: 13px;
}

.feedback-form textarea,
.feedback-form input[type="text"] {
  width: 100%;
  border: 1px solid #3c464a;
  border-radius: 6px;
  background: #111719;
  color: #eef3f5;
  font: inherit;
  font-size: 13px;
  padding: 9px 10px;
}

.feedback-form textarea {
  resize: vertical;
  min-height: 72px;
}

.feedback-actions input[type="text"] {
  flex: 1 1 220px;
}

.feedback-attachments {
  display: grid;
  gap: 8px;
}

.feedback-attachments-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px dashed #4a555a;
  border-radius: 6px;
  background: rgba(90, 167, 255, 0.04);
  color: #c8d1d6;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.feedback-attachments-trigger:hover,
.feedback-attachments-trigger:focus-visible {
  border-color: var(--acid);
  background: rgba(90, 167, 255, 0.12);
  color: #eef3f5;
  outline: none;
}

.feedback-attachments-trigger svg {
  color: #8ab4ff;
}

.feedback-attachments-hint {
  color: #88939a;
  font-weight: 400;
  font-size: 11px;
}

.feedback-attachments-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-attachment-item {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #3c464a;
  background: #0d1011;
}

.feedback-attachment-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feedback-attachment-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.feedback-attachment-remove:hover,
.feedback-attachment-remove:focus-visible {
  background: #ff6b6b;
  outline: none;
}

.feedback-attachment-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 4px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feedback-attachment-error {
  color: #ff6b6b;
  font-size: 12px;
}

.feedback-status.success {
  color: #4fc47a;
}

.feedback-status.error {
  color: #ff6b6b;
}

body.theme-light {
  color-scheme: light;
  background: #eef2f5;
  color: #1f2a30;
}

.theme-light .topbar,
.theme-light .data-panel,
.theme-light .tabs {
  background: #ffffff;
}

.theme-light .workspace {
  background: #eef2f5;
  border: none;
}

.theme-light .side-panel {
  background: #eef2f5;
}

.theme-light .sidebar-idle-assist {
  border-color: #c8d4dc;
  background:
    radial-gradient(circle at 100% 0, rgba(72, 143, 219, 0.12), transparent 44%),
    #ffffff;
  color: #34434c;
}

.theme-light .sidebar-idle-assist-heading h2 {
  color: #1f2c33;
}

.theme-light .sidebar-idle-assist-heading p,
.theme-light .sidebar-idle-assist-label,
.theme-light .sidebar-idle-assist-checklist li {
  color: #63737d;
}

.theme-light .sidebar-idle-assist-icon {
  border-color: rgba(47, 122, 206, 0.32);
  background: rgba(63, 137, 220, 0.1);
  color: #2476cc;
}

.theme-light .sidebar-idle-assist-tags span {
  border-color: #d0dbe1;
  background: #f6f9fb;
  color: #53636d;
}

.theme-light .sidebar-idle-assist-checklist {
  border-color: #dce5ea;
}

.theme-light .sidebar-idle-assist-demo {
  border-color: #2778ce;
  background: #2e7bd4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 6px 14px rgba(38, 99, 163, 0.16);
}

@media (hover: hover) and (pointer: fine) {
  .theme-light .sidebar-idle-assist-demo:hover {
    border-color: #166bc0;
    background: #2271c5;
  }
}

.theme-light .sidebar-idle-assist-help {
  border-color: rgba(47, 122, 206, 0.42);
  background: #f0f7ff;
  color: #1768bd;
}

.theme-light .sidebar-idle-assist-help:hover {
  border-color: #2476cc;
  background: #e3f1ff;
  color: #135ca8;
}

.theme-light .sample-history-confirm-dialog {
  border-color: #cad6de;
  background: #ffffff;
  color: #26333a;
  box-shadow: 0 20px 60px rgba(20, 44, 62, 0.22);
}

.theme-light .sample-history-confirm-copy h2 {
  color: #1f2c33;
}

.theme-light .sample-history-confirm-copy p {
  color: #60717a;
}

.theme-light .topbar {
  border-bottom-color: #d6dee4;
  box-shadow: 0 1px 0 rgba(21, 35, 46, 0.04);
}

.theme-light .brand-mark {
  border: 0;
  background: transparent;
}

.theme-light .brand-logo-dark {
  display: none;
}

.theme-light .brand-logo-light {
  display: block;
}

.theme-light .brand-copy h1,
.theme-light .section-head > strong,
.theme-light .section-head h2,
.theme-light .summary-panel strong,
.theme-light .preview-item h2,
.theme-light .ocr-raw-list summary {
  color: #1f2a30;
}

.theme-light .brand-copy p,
.theme-light .auth-user,
.theme-light .field-grid label,
.theme-light .summary-panel span,
.theme-light .idle-state span,
.theme-light .tab-button,
.theme-light .candidate-rejected td {
  color: #62707a;
}

.theme-light .status-banner {
  border-color: #d4dde3;
  background: #f6f8f9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 3px 10px rgba(31, 42, 48, 0.06);
}

.theme-light .status-banner:hover {
  border-color: #b9c6ce;
}

.theme-light .status {
  color: #34434b;
}

.theme-light .status-banner[data-state="processing"] {
  border-color: #9fc4eb;
  background: #edf5fd;
}

.theme-light .status-banner[data-state="success"] {
  border-color: #a6d5b8;
  background: #eef8f2;
}

.theme-light .status-banner[data-state="warning"] {
  border-color: #dcc58e;
  background: #fbf7ed;
}

.theme-light .status-banner[data-state="error"] {
  border-color: #e2aaaa;
  background: #fdf1f1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 3px 10px rgba(126, 40, 40, 0.07);
}

.theme-light .auth-gate {
  background: rgba(238, 242, 245, 0.86);
}

.theme-light .auth-card {
  border-color: #d7e0e6;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(31, 42, 48, 0.16);
}

.theme-light .auth-card strong {
  color: #1f2a30;
}

.theme-light .auth-card p,
.theme-light .auth-status {
  color: #62707a;
}

.theme-light .auth-method {
  background: #f0f3f5;
}

.theme-light .auth-qr-shell {
  border-color: #d7e0e6;
  background: #ffffff;
}

.theme-light .help-user-button {
  border-color: #c7d4db;
  color: #334951;
  background: #ffffff;
}

.theme-light .help-user-button:hover {
  border-color: var(--green);
}

.theme-light .auth-user-dropdown {
  background: #ffffff;
  border-color: #d0d8de;
  box-shadow: 0 8px 24px rgba(31,42,48,0.14);
}

.theme-light .auth-dropdown-item {
  color: #4a5560;
}

.theme-light .auth-dropdown-item:hover {
  background: #f0f4f7;
}

.theme-light .auth-dropdown-item.danger {
  color: #c0392b;
}

.theme-light .auth-dropdown-item.danger:hover {
  background: rgba(192,57,43,0.08);
}

.theme-light .top-resizer,
.theme-light .panel-resizer {
  background: transparent;
}

.theme-light .top-resizer::before,
.theme-light .panel-resizer::before {
  background: #d0d8de;
}

.theme-light .panel-resizer:hover,
.theme-light .panel-resizer.is-dragging {
  background: rgba(46, 123, 212, 0.1);
}

.theme-light .panel-resizer:hover::before,
.theme-light .panel-resizer.is-dragging::before {
  background: #2e7bd4;
}

.theme-light .top-collapse-handle,
.theme-light .collapse-handle {
  border-color: #c6d2dc;
  background: #ffffff;
  color: #52626d;
  box-shadow: 0 2px 6px rgba(31, 42, 48, 0.08);
}

.theme-light .workspace.side-collapsed .panel-resizer-left .collapse-handle {
  background: #ffffff;
  border-color: #c6d2dc;
  color: #52626d;
}

.theme-light .workflow-card,
.theme-light .control-section,
.theme-light .summary-panel,
.theme-light .ocr-raw-list details,
.theme-light .table-shell {
  border-color: #d7e0e6;
  background: #ffffff;
}

.theme-light .steps span,
.theme-light .drop-zone {
  border-color: #d7e0e6;
  background: #f7fafc;
  color: #43515b;
}

.theme-light .steps span::before {
  background: #e5f0ff;
  color: #1d6fd1;
}

.theme-light .ghost-button {
  border-color: #df8c43;
  background: #fff6ed;
  color: #b95d13;
}

.theme-light select {
  border-color: #c9d5de;
  background: #ffffff;
  color: #1f2a30;
}

.theme-light .annotation-tool-button {
  color: #1f6fd8;
}

.theme-light .annotation-tool-button:hover:not(:disabled),
.theme-light .annotation-tool-button.active {
  border-color: #82bbff;
  background: #eaf4ff;
  color: #155db7;
}

.theme-light .annotation-tool-button.purple {
  color: #8c4ad8;
}

.theme-light .annotation-tool-button.orange {
  color: #e66f16;
}

.theme-light .annotation-tool-button.muted {
  color: #6b7880;
}

.theme-light .annotation-tool-button.excel {
  color: #138b4d;
}

.theme-light .annotation-actions {
  border-top-color: #d6e0e6;
}

.theme-light .annotation-actions .annotation-quick-action {
  border-color: #ffffff;
  background: #e6ebef;
  box-shadow: 0 2px 8px rgba(33, 57, 70, 0.18);
}

.theme-light .annotation-actions .annotation-quick-action:hover,
.theme-light .annotation-actions .annotation-quick-action:focus-visible,
.theme-light .annotation-actions .annotation-quick-action.active {
  border-color: currentColor;
  background: #ffffff;
}

.theme-light .annotation-actions .annotation-quick-action::before {
  border-color: #cad6dc;
  background: #ffffff;
  color: #26373f;
  box-shadow: 0 10px 24px rgba(33, 57, 70, 0.18);
}

.theme-light .annotation-actions .annotation-quick-action::after {
  background: #ffffff;
}

.theme-light .annotation-toolbar-popover {
  border-color: #d7e0e6;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(31, 42, 48, 0.14);
}

.theme-light .annotation-toolbar-popover label {
  color: #52626d;
}

.theme-light .annotation-bulk-bar {
  border-top-color: #d7e0e6;
  color: #62707a;
}

.theme-light .annotation-bulk-bar button {
  border-color: #cfd9e1;
  background: #ffffff;
  color: #34434d;
}

.theme-light .annotation-bulk-bar button.danger {
  border-color: #f4a4b1;
  background: #fff0f3;
  color: #d82548;
}

.theme-light .toggle-grid label,
.theme-light .check-control {
  color: #52626d;
}

.theme-light .summary-panel div,
.theme-light .tabs,
.theme-light .tab-button,
.theme-light .gdt-table th,
.theme-light .gdt-table td,
.theme-light .data-panel,
.theme-light .side-panel {
  border-color: #d7e0e6;
}

.theme-light .canvas-panel {
  background: #d7dde2;
  border-color: #c4ced6;
}

.theme-light .canvas-toolbar {
  border-bottom-color: #c4ced6;
  background: linear-gradient(#f5f7f9, #e4e9ed);
}

.theme-light .drawing-header {
  border-bottom-color: #c4ced6;
  background: linear-gradient(#f5f7f9, #e4e9ed);
  box-shadow: 0 12px 32px rgba(31, 42, 48, 0.12);
}

.theme-light .drawing-file {
  color: #1f2a30;
}

.theme-light .drawing-file strong {
  color: #1f2a30;
}

.theme-light .segmented,
.theme-light .zoom-control,
.theme-light .utility-toggle {
  border-color: #c7d4db;
  color: #334951;
  background: #ffffff;
}

.theme-light .help-login-button,
.theme-light .help-user-button {
  border-color: #c7d4db;
  color: #334951;
  background: #ffffff;
}

.theme-light .segmented button,
.theme-light .zoom-control button {
  border-right-color: #c9d5de;
  color: #46545f;
}

.theme-light .segmented button.active {
  background: #2e7bd4;
  color: #ffffff;
}

.theme-light .zoom-control span,
.theme-light .idle-state {
  color: #1f2a30;
}

.theme-light .idle-state {
  background: #ffffff;
}

.theme-light .idle-hero {
  border-color: #ccd6df;
  background: #f4f7fb;
  box-shadow: none;
}

.theme-light .idle-kicker-row,
.theme-light .idle-hero p,
.theme-light .idle-upload-zone span,
.theme-light .idle-action-copy span {
  color: #64727d;
}

.theme-light .idle-kicker {
  border-color: #d3dbe3;
  background: #ffffff;
  color: #2a3237;
}

.theme-light .idle-hero h2,
.theme-light .idle-upload-zone strong,
.theme-light .idle-action-copy strong {
  color: #1f2a30;
}

.theme-light .idle-feature-list > span {
  border-color: #cbd6df;
  background: #ffffff;
  color: #46545f;
  box-shadow: 0 2px 6px rgba(20, 35, 45, 0.12);
}

.theme-light .idle-upload-zone {
  border-color: #d2d7dc;
  background: #ffffff;
  color: #1f2a30;
}

.theme-light .idle-upload-zone:hover {
  border-color: #2f80d9;
  background: #f1f7ff;
}

.theme-light .idle-upload-icon {
  color: #9a9fa4;
}

.theme-light .idle-action-card {
  border-color: #cfd9e2;
  background: #ffffff;
  color: #1f2a30;
  box-shadow: 0 2px 8px rgba(20, 35, 45, 0.12);
}

.theme-light .idle-action-card.primary {
  border-color: #a9cff8;
  background: #eef6ff;
}

.theme-light .idle-action-icon {
  background: #eef2f6;
  color: #3f4b52;
}

.theme-light .idle-action-card.primary .idle-action-icon {
  background: #dbeeff;
  color: #156ee8;
}

.theme-light .idle-action-copy em,
.theme-light .idle-action-card.primary .idle-action-arrow {
  color: #156ee8;
}

.theme-light .idle-guide-button {
  border-color: #086ad8;
  background: #ffffff;
  color: #1f2a30;
}

.theme-light .idle-guide-panel {
  border-color: #cfd9e2;
  background: #ffffff;
  color: #46545f;
}

.theme-light .idle-guide-copy strong,
.theme-light .idle-guide-tips strong {
  color: #1f2a30;
}

.theme-light .idle-guide-copy span,
.theme-light .idle-guide-steps span,
.theme-light .idle-guide-tips li {
  color: #5f6d76;
}

.theme-light .idle-guide-steps li {
  border-color: #dbe3e8;
  background: #f7f9fa;
}

.theme-light .idle-guide-steps li strong {
  color: #26343c;
}

.theme-light .idle-guide-step-number {
  background: #dcecff;
  color: #1d6fd1 !important;
}

.theme-light .idle-guide-tips {
  border-left-color: #2f6fec;
  background: #edf5ff;
}

.theme-light .bubble-controls {
  background: rgba(0, 0, 0, 0.08);
}

.theme-light .bubble-control-divider {
  background: rgba(0, 0, 0, 0.16);
}

.theme-light .bubble-size-control .bubble-size-btn {
  color: rgba(0, 0, 0, 0.55);
}

.theme-light .bubble-size-control .bubble-size-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.9);
}

.theme-light .bubble-size-control span {
  color: rgba(0, 0, 0, 0.78);
}

.theme-light .manual-annotation-button {
  border-color: #c9d5de;
  background: #ffffff;
  color: #46545f;
}

.theme-light .manual-annotation-button:hover {
  background: #eef3f6;
  color: #1f2a30;
}

.theme-light .manual-annotation-button.active {
  border-color: #2e7bd4;
  background: #2e7bd4;
  color: #ffffff;
}

.theme-light .manual-mode-banner {
  border-color: #78aff0;
  background: rgba(244, 249, 253, 0.97);
  color: #1c3444;
  box-shadow: 0 12px 32px rgba(35, 69, 91, 0.2), 0 0 0 1px rgba(47, 124, 255, 0.08);
}

.theme-light .manual-mode-copy small,
.theme-light .manual-mode-exit-hint {
  color: #5d7586;
}

.theme-light .manual-mode-banner kbd {
  border-color: #9eb3c1;
  background: #ffffff;
  color: #2a4353;
}

.theme-light .manual-mode-banner > button {
  color: #5e7584;
}

.theme-light .manual-mode-banner > button:hover {
  background: #e4eef5;
  color: #1f3d50;
}

.theme-light.manual-annotation-active .canvas-panel {
  border-color: #3984e8;
  box-shadow: inset 0 0 0 2px rgba(47, 124, 255, 0.2), 0 0 24px rgba(47, 124, 255, 0.13);
}

.theme-light .toolbar-divider {
  background: #c9d5de;
}

.theme-light .drawing-figure {
  border-color: #c8d3db;
  background: #ffffff;
}

.theme-light.manual-select-ready .drawing-figure::after {
  border-color: rgba(0, 0, 0, 0.16);
  background: rgba(255, 255, 255, 0.9);
  color: rgba(31, 42, 48, 0.92);
}

.theme-light .preview-item a {
  color: #1d6fd1;
}

.theme-light .processing-dialog {
  border-color: #c7d4dd;
  background: rgba(255, 255, 255, 0.96);
  color: #1f2a30;
  box-shadow: 0 24px 70px rgba(31, 42, 48, 0.22);
}

.theme-light .processing-kicker {
  color: #1d6fd1;
}

.theme-light .processing-head p {
  color: #62707a;
}

.theme-light .processing-eta {
  color: #168399;
}

.theme-light .progress-track {
  background: #e2e9ee;
}

.theme-light .processing-steps li {
  border-color: #d7e0e6;
  background: #f7fafc;
  color: #687782;
}

.theme-light .processing-steps span {
  background: #e5edf3;
  color: #52626d;
}

.theme-light .processing-steps li.done {
  border-color: rgba(34, 150, 89, 0.45);
  color: #187345;
}

.theme-light .processing-steps li.active {
  border-color: #2e7bd4;
  color: #1f2a30;
}

.theme-light .tab-button.active {
  color: #1f2a30;
  background: #eef4fa;
}

.theme-light .gdt-table th {
  background: #f3f7fa;
  color: #52626d;
}

.theme-light .gdt-table td {
  color: #26343c;
}

.theme-light .gdt-table td.upper-cell {
  color: #148a45;
}

.theme-light .gdt-table td.lower-cell {
  color: #d32f2f;
}

.theme-light .gdt-table tbody tr:hover td {
  background: rgba(46, 123, 212, 0.1);
}

.theme-light .gdt-table tr.selected-row td {
  background: rgba(46, 123, 212, 0.16);
  color: #102538;
}

.theme-light .gdt-table tr.selected-row td.bubble-cell {
  color: #1d6fd1;
}

.theme-light .candidate-selected td:first-child {
  color: #13804b;
}

.theme-light .ocr-raw-list ol {
  color: #52626d;
}

/* Modal Dialog - Light Theme */
.theme-light .modal-overlay {
  background: rgba(0, 0, 0, 0.45);
}

.theme-light .history-library-overlay {
  background: rgba(0, 0, 0, 0.46);
}

.theme-light .bubble-sort-overlay {
  background: rgba(0, 0, 0, 0.42);
}

.theme-light .bubble-sort-dialog {
  border-color: #cdd5da;
  background: #ffffff;
  color: #1f2a30;
}

.theme-light .bubble-sort-dialog .modal-header p,
.theme-light .bubble-sort-preview-summary span {
  color: #6f7d86;
}

.theme-light .bubble-sort-body h4,
.theme-light .bubble-sort-rule-item strong {
  color: #1f2a30;
}

.theme-light .bubble-sort-rule-item {
  border-color: #b7d6ff;
  background: #edf5ff;
}

.theme-light .bubble-sort-preview-summary,
.theme-light .bubble-sort-preview-table-shell {
  border-color: #d8e0e6;
  background: #ffffff;
  color: #1f2a30;
}

.theme-light .bubble-sort-preview-table th {
  background: #f3f6f9;
  color: #52626d;
}

.theme-light .bubble-sort-preview-table th,
.theme-light .bubble-sort-preview-table td {
  border-bottom-color: #e1e7ec;
}

.theme-light .category-filter-overlay {
  background: rgba(0, 0, 0, 0.42);
}

.theme-light .category-filter-dialog {
  border-color: #cdd5da;
  background: #ffffff;
  color: #1f2a30;
}

.theme-light .category-filter-hint {
  color: #7a8790;
}

.theme-light .category-filter-dialog .modal-header p,
.theme-light .category-filter-summary span,
.theme-light .category-filter-hidden {
  color: #6f7d86;
}

.theme-light .category-filter-summary strong,
.theme-light .category-filter-text strong {
  color: #1f2a30;
}

.theme-light .category-filter-card {
  border-color: #d8e0e6;
  background: #ffffff;
}

.theme-light .category-filter-card:hover {
  border-color: #9dcaff;
  background: #f8fbff;
}

.theme-light .category-filter-card.is-hidden {
  border-color: #9da7ad;
  background: #f4f6f8;
}

.theme-light .category-filter-symbol {
  border-color: #dbe1e6;
  color: #8a959d;
}

.theme-light .category-filter-text small {
  color: #7a8790;
}

.theme-light .category-filter-count {
  color: #7a8790;
}

.theme-light .category-filter-hidden-chip,
.theme-light .category-filter-hidden-empty {
  background: #2f363b;
  color: #ffffff;
}

.theme-light .category-filter-footer {
  border-top-color: #e2e8ec;
}

.theme-light .history-library-dialog {
  border-color: #d1d8df;
  background: #ffffff;
  color: #1f2a30;
  box-shadow: 0 24px 70px rgba(20, 35, 45, 0.28);
}

.theme-light .history-library-count,
.theme-light .history-library-id,
.theme-light .history-library-meta,
.theme-light .history-library-empty,
.theme-light .history-library-footnote {
  color: #7a8790;
}

.theme-light .history-library-header,
.theme-light .history-library-toolbar,
.theme-light .history-library-footer {
  border-color: #d8e0e7;
}

.theme-light .history-library-icon-button {
  color: #89949b;
}

.theme-light .history-library-icon-button:hover {
  background: #eef3f7;
  color: #2f3b43;
}

.theme-light .history-library-search,
.theme-light .history-library-filter {
  border-color: #cbd5df;
  background: #ffffff;
  color: #5c6872;
  box-shadow: 0 2px 8px rgba(20, 35, 45, 0.09);
}

.theme-light .history-library-search input,
.theme-light .history-library-filter {
  color: #1f2a30;
}

.theme-light .history-library-search input::placeholder {
  color: #8c98a1;
}

.theme-light .history-library-sort {
  background: #e6ebf1;
}

.theme-light .history-library-sort button {
  color: #7a8790;
}

.theme-light .history-library-sort button.active {
  background: #ffffff;
  color: #315de8;
  box-shadow: 0 2px 8px rgba(20, 35, 45, 0.13);
}

.theme-light .history-library-item {
  border-color: #d9e1e8;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(20, 35, 45, 0.11);
}

.theme-light .history-library-date-header {
  border-bottom-color: #d9e1e8;
}

.theme-light .history-library-date-header strong {
  background: #eef2f6;
  color: #1f2a30;
}

.theme-light .history-library-date-header span {
  color: #8c98a1;
}

.theme-light .history-library-item.selected {
  border-color: #ff8aa0;
  background: #fff5f7;
  box-shadow: 0 0 0 2px rgba(255, 91, 120, 0.18), 0 2px 10px rgba(20, 35, 45, 0.11);
}

.theme-light .history-library-item-content strong {
  color: #1f2a30;
}

.theme-light .history-library-tag {
  background: #eef0ff;
  color: #5660d9;
}

.theme-light .history-library-tag[data-status="done"] {
  background: #eafaf1;
  color: #208552;
}

.theme-light .history-library-tag[data-status="failed"] {
  background: #fff0f0;
  color: #d64242;
}

.theme-light .history-library-selected-count {
  color: #e61848;
}

.theme-light .pill-button.danger-outline {
  border-color: #ff9bad;
  background: #fff2f5;
  color: #df1748;
}

.theme-light .pill-button.danger-solid {
  border-color: #e61848;
  background: #e61848;
  color: #ffffff;
}

.theme-light .modal-dialog {
  --bg-secondary: #ffffff;
  --border-color: #d7e0e6;
  --text-color: #1f2a30;
  --text-muted: #62707a;
  background: #ffffff;
  border-color: #d7e0e6;
  box-shadow: 0 24px 70px rgba(31, 42, 48, 0.22);
}

.theme-light .modal-header {
  border-bottom-color: #d7e0e6;
}

.theme-light .modal-header h3 {
  color: #1f2a30;
}

.theme-light .modal-close {
  color: #62707a;
}

.theme-light .modal-close:hover {
  color: #1f2a30;
}

.theme-light .modal-footer {
  border-top-color: #d7e0e6;
}

.theme-light .modal-body {
  background: #ffffff;
}

.theme-light .drawing-info-hint {
  color: #6f7d86;
}

.theme-light .drawing-info-ai-badge {
  background: #efe7ff;
  color: #6941a5;
}

.theme-light .drawing-info-field input {
  border-color: #cbd5dc;
  background: #ffffff;
  color: #1f2a30;
}

.theme-light .drawing-info-field input::placeholder {
  color: #9aa5ad;
}

.theme-light .drawing-info-field input:hover {
  border-color: #aebcc6;
}

.theme-light .drawing-info-field input:focus {
  border-color: #2f78e9;
  background: #ffffff;
}

.theme-light .drawing-info-field input[type="date"] {
  color-scheme: light;
}

.theme-light .drawing-info-footer .pill-button.primary,
.theme-light .drawing-info-footer .pill-button.primary:hover {
  border-color: #2f6fec;
  background: #2f6fec;
  color: #ffffff;
}

.theme-light .candidate-item {
  --border-color: #d7e0e6;
  border-color: #d7e0e6;
  background: #f7fafc;
}

.theme-light .candidate-item:hover {
  border-color: #2e7bd4;
  background: #eef4fa;
}

.theme-light .candidate-text {
  --text-color: #1f2a30;
  color: #1f2a30;
}

.theme-light .candidate-category {
  --text-muted: #62707a;
  color: #62707a;
}

.theme-light .candidate-hint {
  --text-muted: #62707a;
  color: #62707a;
}

.theme-light .field-hint {
  --text-muted: #62707a;
  color: #62707a;
}

.theme-light .manual-entry-hint {
  border-color: #c6d2dc;
  background: #eef3f6;
  color: #46545f;
}

.theme-light .form-row-group.datums-group {
  --border-color: #d7e0e6;
  border-color: #d7e0e6;
  background: #f7fafc;
}

.theme-light .datums-header {
  --text-muted: #62707a;
  color: #62707a;
}

.theme-light .form-row.datums-row label {
  --text-muted: #62707a;
  color: #62707a;
}

.theme-light .form-row.datums-row input::placeholder {
  color: #9aa4a9;
}

.theme-light .form-row label {
  --text-muted: #62707a;
  color: #62707a;
}

.theme-light .form-row-group-header {
  --text-muted: #62707a;
  color: #62707a;
}

.theme-light .form-row input,
.theme-light .form-row select {
  --border-color: #c9d5de;
  --bg-primary: #ffffff;
  --text-color: #1f2a30;
  border-color: #c9d5de;
  background: #ffffff;
  color: #1f2a30;
}

.theme-light .form-row input:focus,
.theme-light .form-row select:focus {
  --accent-color: #2e7bd4;
  border-color: #2e7bd4;
}

.theme-light .form-row .input-like-check-control {
  --border-color: #c9d5de;
  --bg-primary: #ffffff;
  --text-color: #1f2a30;
  border-color: #c9d5de;
  background: #ffffff;
  color: #1f2a30;
}

.theme-light .form-row .input-like-check-control:focus-within {
  --accent-color: #2e7bd4;
  border-color: #2e7bd4;
}

.theme-light .symbol-quick-input {
  --border-color: #d7e0e6;
  border-color: #d7e0e6;
  background: #f7fafc;
}

.theme-light .symbol-quick-input-header:hover {
  background: #eef3f6;
}

.theme-light .symbol-quick-input-label {
  --text-muted: #62707a;
  color: #62707a;
}

.theme-light .symbol-quick-input-toggle {
  --text-muted: #62707a;
  color: #62707a;
}

.theme-light .symbol-category-label {
  --text-muted: #62707a;
  color: #62707a;
}

.theme-light .symbol-btn {
  --bg-secondary: #eef3f6;
  --text-color: #1f2a30;
  --bg-hover: #d7e0e6;
  background: #eef3f6;
  color: #1f2a30;
}

.theme-light .symbol-btn:hover {
  background: #d7e0e6;
}

.theme-light .row-tooltip {
  --bg-secondary: #ffffff;
  --border-color: #d7e0e6;
  --text-color: #1f2a30;
  --text-muted: #62707a;
  background: #ffffff;
  border-color: #d7e0e6;
  color: #1f2a30;
  box-shadow: 0 8px 24px rgba(31, 42, 48, 0.16);
}

.theme-light .row-tooltip .tooltip-label {
  --text-muted: #62707a;
  color: #62707a;
}

.theme-light .row-tooltip .tooltip-value {
  --text-color: #1f2a30;
  color: #1f2a30;
}

.theme-light .context-menu {
  --bg-secondary: #ffffff;
  --border-color: #d7e0e6;
  --text-color: #1f2a30;
  background: #ffffff;
  border-color: #d7e0e6;
  box-shadow: 0 8px 24px rgba(31, 42, 48, 0.16);
}

.theme-light .context-menu-item {
  --text-color: #1f2a30;
  color: #1f2a30;
}

.theme-light .context-menu-item:hover {
  --bg-hover: #eef3f6;
  background: #eef3f6;
}

.theme-light .context-menu-item.danger {
  color: #c62828;
}

.theme-light .context-menu-item.danger:hover {
  background: #ffebee;
}

/* Additional Light Theme Fixes */
.theme-light .preview-diagnostics span {
  border-color: rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.88);
  color: #1f2a30;
}

.theme-light .save-status {
  background: rgba(45, 177, 91, 0.15);
  color: #1e7a43;
}

.theme-light .save-status.saving {
  background: rgba(47, 124, 255, 0.12);
  color: #1d5fc7;
}

.theme-light .save-status.failed {
  background: rgba(224, 67, 54, 0.12);
  color: #c62828;
}

.theme-light .pill-button {
  border-color: #c9d5de;
  background: #ffffff;
  color: #46545f;
  box-shadow: 0 1px 4px rgba(31, 42, 48, 0.1);
}

.theme-light .pill-button:hover {
  background: #eef3f6;
}

.theme-light #workflow-new-drawing {
  border-color: #2770c8;
  background: #2770c8;
  color: #ffffff;
  box-shadow: none;
}

.theme-light #workflow-new-drawing:hover {
  border-color: #2770c8;
  background: #2770c8;
  color: #ffffff;
}

.theme-light .local-library {
  color: #1d6fd1;
}

.theme-light .history-icon-button {
  border-color: rgba(0, 0, 0, 0.15);
  background: #ffffff;
  color: #46545f;
  box-shadow: 0 1px 3px rgba(31, 42, 48, 0.1);
}

.theme-light .history-icon-button:disabled {
  border-color: rgba(0, 0, 0, 0.08);
  background: #d7dde2;
  color: rgba(31, 42, 48, 0.38);
  box-shadow: none;
}

.theme-light .manual-region-loading {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: #1f2a30;
  box-shadow: 0 10px 22px rgba(31, 42, 48, 0.15);
}

.theme-light .manual-region-loading::before {
  border-color: rgba(46, 123, 212, 0.26);
  border-top-color: #2e7bd4;
}

.theme-light .feedback-overlay {
  background: rgba(0, 0, 0, 0.45);
}

.theme-light .feedback-panel {
  border-color: #d7e0e6;
  background: #ffffff;
  color: #1f2a30;
  box-shadow: 0 24px 70px rgba(31, 42, 48, 0.22);
}

.theme-light .feedback-copy strong {
  color: #1f2a30;
}

.theme-light .feedback-copy span,
.theme-light .feedback-status {
  color: #6f7d86;
}

.theme-light .feedback-unread-badge {
  border-color: #fff;
}

.theme-light .feedback-thread {
  border-color: #d7e0e6;
  background: #f6f8fa;
}

.theme-light .feedback-thread-message {
  background: #fff;
  color: #26343c;
}

.theme-light .feedback-thread-message.admin {
  background: rgba(47, 120, 233, 0.08);
}

.theme-light .feedback-thread-reply {
  border-color: #c9d5de;
  background: #fff;
  color: #1f2a30;
}

.theme-light .feedback-rating label {
  color: #34434c;
}

.theme-light .feedback-rating input[type="radio"] {
  accent-color: #2f6fec;
}

.theme-light .feedback-form textarea,
.theme-light .feedback-form input[type="text"] {
  border-color: #c9d5de;
  background: #ffffff;
  color: #1f2a30;
}

.theme-light .feedback-form textarea::placeholder,
.theme-light .feedback-form input[type="text"]::placeholder {
  color: #8a979f;
}

.theme-light .feedback-form textarea:focus,
.theme-light .feedback-form input[type="text"]:focus {
  border-color: #2f78e9;
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 120, 233, 0.16);
}

.theme-light #feedback-submit,
.theme-light #feedback-submit:hover {
  border-color: #2f6fec;
  background: #2f6fec;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(47, 111, 236, 0.22);
}

.theme-light .feedback-status.success {
  color: #187345;
}

.theme-light .feedback-status.error,
.theme-light .feedback-attachment-error {
  color: #c62828;
}

.theme-light .feedback-attachments-trigger {
  border-color: #c7d4db;
  background: rgba(46, 123, 212, 0.04);
  color: #2a3a44;
}

.theme-light .feedback-attachments-trigger:hover,
.theme-light .feedback-attachments-trigger:focus-visible {
  border-color: #2e7bd4;
  background: rgba(46, 123, 212, 0.1);
  color: #0f2738;
}

.theme-light .feedback-attachments-hint {
  color: #62707a;
}

.theme-light .feedback-attachment-item {
  border-color: #c7d4db;
  background: #f0f4f7;
}

.theme-light .feedback-attachment-remove {
  background: rgba(0, 0, 0, 0.55);
}

@media (max-width: 1120px) {
  .brand-copy {
    max-width: calc(38.5vw - 106px);
  }

  .brand-copy p {
    display: none;
  }

  .status-banner {
    width: clamp(180px, 23vw, 260px);
  }

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

  .workspace.side-collapsed .side-panel {
    display: none;
  }

  .data-panel {
    border-left: 0;
  }

}

@media (min-width: 1121px) and (max-width: 1400px) {
  .brand-copy {
    max-width: calc(36.5vw - 106px);
  }

  .brand-copy p {
    display: none;
  }
}

@media (max-width: 768px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body {
    min-height: 100vh;
  }

  .app-frame,
  .app-frame.topbar-collapsed {
    width: 100%;
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto 0 auto;
    overflow: visible;
  }

  .topbar {
    height: auto;
    min-height: var(--topbar-height);
    grid-template-columns: auto 1fr;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .status-banner {
    position: static;
    width: 100%;
    flex: 1 0 100%;
    order: -1;
    transform: none;
  }

  .workspace,
  .workspace.side-collapsed {
    width: 100%;
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .side-panel,
  .workspace.side-collapsed .side-panel {
    width: 100%;
    height: auto;
    max-height: none;
    display: flex;
    flex-direction: column;
    margin: 8px 0 0;
    padding: 8px;
    overflow: visible;
  }

  .data-panel {
    width: 100%;
    height: auto;
    max-height: none;
    grid-template-rows: auto auto;
    overflow: visible;
  }

  .data-panel .tab-page {
    overflow: visible;
  }

  .data-panel .table-shell {
    overflow-x: auto;
    overflow-y: visible;
  }

  .panel-resizer-left {
    display: none;
  }

  .canvas-panel {
    width: 100%;
    height: auto;
    min-height: 620px;
    grid-template-rows: auto auto minmax(620px, auto);
    margin: 4px 0 0;
  }

  .idle-state {
    overflow: visible;
  }

  .result,
  .preview-list,
  .preview-item,
  .drawing-figure {
    height: auto;
    min-height: 620px;
  }

  .canvas-toolbar {
    flex-wrap: wrap;
  }

  .drawing-actions {
    display: none;
  }

  .steps span {
    min-height: 76px;
  }

  .workflow-step strong,
  .workflow-step small,
  .gdt-table {
    font-size: 11px;
  }
}

@media (max-width: 560px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 8px;
  }

  .steps::before {
    display: none;
  }

  .steps span {
    min-height: 64px;
    justify-items: start;
    text-align: left;
    padding: 0 6px;
  }

  .steps span::before {
    margin-bottom: 0;
  }

  .workflow-step strong {
    font-size: 11.5px;
  }

  .workflow-step small {
    min-height: 0;
    font-size: 10.5px;
  }

  .topbar {
    padding: 8px 10px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .utility-toggle,
  .help-login-button,
  .help-user-button {
    padding: 4px 8px;
    font-size: 11px;
  }
}

/* Modal Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay[hidden] {
  display: none !important;
}

.feedback-overlay {
  z-index: 1100;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(4px);
}

.feedback-overlay .feedback-panel {
  position: relative;
  margin: 0;
}

.feedback-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: none;
}

@media (min-width: 769px) {
  .feedback-overlay .feedback-panel {
    width: min(560px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    overflow: auto;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  }

  .feedback-overlay .feedback-copy {
    padding-right: 34px;
  }

  .feedback-close {
    display: grid;
  }
}

@media (max-width: 768px) {
  .feedback-overlay {
    position: static;
    display: block;
    background: transparent;
    backdrop-filter: none;
  }
}

.history-library-overlay {
  z-index: 1050;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(4px);
}

.history-library-dialog {
  width: min(1120px, calc(100vw - 64px));
  max-height: min(760px, calc(100vh - 72px));
  display: grid;
  grid-template-rows: auto auto minmax(220px, 1fr) auto;
  overflow: hidden;
  border: 1px solid #343f45;
  border-radius: 10px;
  background: #222628;
  color: #edf3f5;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.48);
}

.history-library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 30px 18px;
}

.history-library-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.history-library-title-row h3 {
  margin: 0;
  font-size: 25px;
  line-height: 1.2;
}

.history-library-count {
  color: #aeb8bd;
  font-size: 15px;
  font-weight: 600;
}

.history-library-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-library-icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #aeb8bd;
  cursor: pointer;
}

.history-library-icon-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f5f7f8;
}

.history-library-icon-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.history-library-icon-button svg,
.history-library-search svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-library-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px auto;
  gap: 14px;
  align-items: center;
  padding: 0 30px 22px;
  border-bottom: 1px solid #343f45;
}

.history-library-search {
  min-height: 46px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid #465158;
  border-radius: 8px;
  background: #1b1f21;
  color: #aeb8bd;
}

.history-library-search input,
.history-library-filter {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #edf3f5;
  font: inherit;
}

.history-library-search input::placeholder {
  color: #7f8a90;
}

.history-library-filter {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #465158;
  border-radius: 8px;
  background: #1b1f21;
}

.history-library-sort {
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: 10px;
  background: #333a3e;
}

.history-library-sort button {
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #aeb8bd;
  font-weight: 700;
  cursor: pointer;
}

.history-library-sort button.active {
  background: #f7fafc;
  color: #315de8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.history-library-body {
  overflow: auto;
  padding: 28px 30px 34px;
}

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

.history-library-date-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 0 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid #3c464b;
}

.history-library-date-header strong {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: #32383c;
  color: #f7fafc;
  font-size: 17px;
}

.history-library-date-header span {
  color: #aeb8bd;
  font-size: 15px;
}

.history-library-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 22px;
  border: 1px solid #3c464b;
  border-radius: 10px;
  background: #1d2123;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.history-library-item.selecting {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.history-library-item.selected {
  border-color: #ff7b91;
  background: rgba(255, 91, 120, 0.08);
  box-shadow: 0 0 0 2px rgba(255, 91, 120, 0.18), 0 6px 20px rgba(0, 0, 0, 0.18);
}

.history-library-select {
  display: grid;
  place-items: center;
}

.history-library-select input {
  width: 22px;
  height: 22px;
  accent-color: #1677ff;
  cursor: pointer;
}

.history-library-item-content {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.history-library-item-content strong {
  color: #f7fafc;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.history-library-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.history-library-title-row strong {
  flex: 0 1 auto;
  min-width: 0;
}

.history-library-title-row .history-library-tag {
  flex: 0 0 auto;
}

.history-library-id {
  color: #9faab0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.history-library-tags,
.history-library-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  align-items: center;
}

.history-library-tag {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(143, 151, 255, 0.12);
  color: #bfc5ff;
  font-size: 13px;
  font-weight: 700;
}

.history-library-tag[data-status="done"] {
  background: rgba(78, 216, 143, 0.12);
  color: #86e7b3;
}

.history-library-tag[data-status="failed"] {
  background: rgba(255, 101, 101, 0.12);
  color: #ff9a9a;
}

.history-library-meta {
  color: #aeb8bd;
  font-size: 14px;
}

.history-library-item-actions {
  display: flex;
  align-items: center;
}

.history-library-empty {
  margin: 42px 0;
  color: #aeb8bd;
  text-align: center;
  font-size: 16px;
}

.history-library-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 30px;
  border-top: 1px solid #343f45;
}

.history-library-footer .pill-button:disabled {
  opacity: 0.56;
}

.history-library-selected-count {
  color: #ff4b6a;
  font-weight: 700;
}

.pill-button.danger-outline {
  border-color: rgba(255, 75, 106, 0.55);
  background: rgba(255, 75, 106, 0.08);
  color: #ff8da0;
}

.pill-button.danger-solid {
  border-color: #e61848;
  background: #e61848;
  color: #ffffff;
}

.pill-button.danger-solid:hover {
  background: #f02858;
}

.history-library-footnote {
  margin-left: auto;
  color: #8f9aa0;
  font-size: 14px;
}

@media (max-width: 760px) {
  .bubble-sort-dialog {
    width: calc(100vw - 24px);
  }

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

  .bubble-sort-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .bubble-sort-footer .modal-footer-right {
    justify-content: flex-end;
  }

  .category-filter-dialog {
    width: calc(100vw - 24px);
  }

  .category-filter-list {
    grid-template-columns: 1fr;
  }

  .category-filter-summary,
  .category-filter-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .category-filter-footer .modal-footer-right {
    justify-content: flex-end;
  }

  .history-library-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .history-library-header,
  .history-library-toolbar,
  .history-library-body,
  .history-library-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .history-library-toolbar {
    grid-template-columns: 1fr;
  }

  .history-library-sort {
    width: fit-content;
  }

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

  .history-library-item-actions {
    justify-content: flex-start;
  }

  .history-library-footer {
    flex-wrap: wrap;
  }

  .history-library-footnote {
    width: 100%;
    margin-left: 0;
  }
}

.modal-dialog {
  background: var(--bg-secondary, #1e1e1e);
  border: 1px solid var(--border-color, #3a3a3a);
  border-radius: 10px;
  width: min(420px, calc(100vw - 32px));
  min-width: min(280px, calc(100vw - 32px));
  max-width: 90vw;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  position: fixed;
}

/* Draggable modal header cursor */
.modal-header {
  cursor: grab;
}

.modal-header:active {
  cursor: grabbing;
}

.candidate-dialog {
  width: min(520px, calc(100vw - 32px));
}

.drawing-info-overlay {
  z-index: 1120;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(4px);
}

.drawing-info-dialog {
  width: min(860px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  border-radius: 16px;
}

.drawing-info-dialog .modal-header {
  cursor: default;
}

.drawing-info-header {
  padding: 22px 28px;
}

.drawing-info-header h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
}

.drawing-info-title-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #4389f6;
  color: #ffffff;
  flex: 0 0 auto;
}

.drawing-info-title-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drawing-info-form {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.drawing-info-body {
  gap: 20px;
  padding: 26px 34px 30px;
}

.drawing-info-hint {
  margin: 0;
  color: #aab2b7;
  font-size: 14px;
  line-height: 1.6;
}

.drawing-info-ai-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  margin: 0 5px;
  padding: 0 8px;
  border-radius: 6px;
  background: #4c2a82;
  color: #cdb5ff;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}

.drawing-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
}

.drawing-info-field {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.drawing-info-field-wide {
  grid-column: 1 / -1;
}

.drawing-info-field > span {
  min-height: 22px;
  display: flex;
  align-items: center;
  color: var(--text-color, #e0e0e0);
  font-size: 15px;
  font-weight: 600;
}

.drawing-info-field > span .drawing-info-ai-badge {
  min-height: 20px;
  margin-left: 8px;
  padding: 0 7px;
  font-size: 11px;
}

.drawing-info-field input {
  width: 100%;
  min-width: 0;
  height: 46px;
  box-sizing: border-box;
  border: 1px solid #52585b;
  border-radius: 9px;
  padding: 0 14px;
  background: #333637;
  color: #f0f3f4;
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.drawing-info-field input::placeholder {
  color: #737a7e;
}

.drawing-info-field input:hover {
  border-color: #697175;
}

.drawing-info-field input:focus {
  border-color: #4389f6;
  box-shadow: 0 0 0 3px rgba(67, 137, 246, 0.18);
  background: #383c3e;
}

.drawing-info-field input[type="date"] {
  color-scheme: dark;
}

.drawing-info-footer {
  gap: 16px;
  padding: 20px 34px 24px;
}

.drawing-info-footer .pill-button {
  min-width: 150px;
  min-height: 44px;
  justify-content: center;
  border-radius: 9px;
  box-shadow: none;
}

.drawing-info-footer .pill-button.primary {
  border-color: #2f6fec;
  background: #2f6fec;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(47, 111, 236, 0.26);
}

.drawing-info-footer .pill-button.primary:hover {
  background: #3e7cf0;
}

.export-template-overlay {
  z-index: 1115;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(3px);
}

.export-template-dialog {
  width: min(540px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  border-radius: 16px;
}

.export-template-header {
  padding: 22px 26px 16px;
}

.export-template-header h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  margin: 0;
}

.export-template-title-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #2f6fec;
  color: #ffffff;
  flex: 0 0 auto;
}

.export-template-title-icon svg {
  width: 18px;
  height: 18px;
}

.export-template-body {
  padding: 8px 26px 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.export-template-hint {
  margin: 0;
  color: #aab2b7;
  font-size: 13px;
  line-height: 1.6;
}

.export-template-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 4px 0 0;
  padding: 0;
}

.export-template-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.export-template-option:hover {
  border-color: rgba(47, 111, 236, 0.45);
  background: rgba(47, 111, 236, 0.08);
}

.export-template-option input[type="radio"] {
  margin-top: 4px;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: #2f6fec;
}

.export-template-option:has(input[type="radio"]:checked) {
  border-color: #2f6fec;
  background: rgba(47, 111, 236, 0.12);
  box-shadow: 0 8px 18px rgba(47, 111, 236, 0.18);
}

.export-template-option-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.export-template-option-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-color, #e6e8eb);
}

.export-template-option-desc {
  font-size: 13px;
  line-height: 1.5;
  color: #98a1a9;
}

.export-template-preview {
  margin: 4px 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(47, 111, 236, 0.08);
  border: 1px dashed rgba(47, 111, 236, 0.4);
  font-size: 13px;
  line-height: 1.55;
  color: #cdd6e0;
  word-break: break-all;
}

.export-template-preview strong {
  color: #ffffff;
  font-weight: 600;
}

.theme-light .export-template-preview {
  border-color: rgba(47, 111, 236, 0.4);
  background: #edf4ff;
  color: #5f6d76;
}

.theme-light .export-template-preview strong {
  color: #1d5fc7;
}

.export-template-footer {
  gap: 14px;
  padding: 18px 26px 22px;
}

.export-template-footer .pill-button {
  min-width: 140px;
  min-height: 42px;
  justify-content: center;
  border-radius: 9px;
  box-shadow: none;
}

.export-template-footer .pill-button.primary {
  border-color: #2f6fec;
  background: #2f6fec;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(47, 111, 236, 0.26);
}

.export-template-footer .pill-button.primary:hover {
  background: #3e7cf0;
}

.export-template-footer .pill-button.primary:disabled {
  background: #2a3a52;
  border-color: #2a3a52;
  color: #7e8a9a;
  box-shadow: none;
  cursor: not-allowed;
}

.pdf-page-dialog {
  width: min(1040px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
}

.pdf-page-body {
  min-height: 280px;
  overflow: auto;
}

.pdf-page-file-row,
.pdf-page-footer {
  display: flex;
  align-items: center;
}

.pdf-page-file-row {
  justify-content: space-between;
  gap: 16px;
}

.pdf-page-file-row .pill-button {
  min-height: 34px;
  padding: 7px 14px;
  flex: 0 0 auto;
}

.pdf-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  padding: 4px 0 16px;
}

.pdf-page-option {
  position: relative;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-color, #e6e8eb);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.pdf-page-option:hover {
  border-color: rgba(47, 111, 236, 0.55);
}

.pdf-page-option.selected {
  border-color: #2f6fec;
  background: rgba(47, 111, 236, 0.12);
  box-shadow: 0 8px 20px rgba(47, 111, 236, 0.18);
}

.pdf-page-option img {
  width: 100%;
  height: 190px;
  object-fit: contain;
  border-radius: 7px;
  background: #ffffff;
}

.pdf-page-option-label {
  font-size: 14px;
  font-weight: 600;
}

.pdf-page-option-check {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  background: rgba(24, 27, 31, 0.72);
  color: transparent;
  font-weight: 800;
}

.pdf-page-option.selected .pdf-page-option-check {
  border-color: #ffffff;
  background: #2f6fec;
  color: #ffffff;
}

.pdf-page-summary {
  margin: 0 auto 0 0;
  color: #aab2b7;
  font-size: 13px;
}

.theme-light .pdf-page-option {
  border-color: #d7dee5;
  background: #f7f9fb;
  color: #1f2a30;
}

.theme-light .pdf-page-option:hover,
.theme-light .pdf-page-option.selected {
  border-color: #2f6fec;
  background: #edf4ff;
}

.theme-light .pdf-page-summary {
  color: #5f6d76;
}

.preview-list.has-page-tabs {
  grid-template-rows: auto minmax(0, 1fr);
}

.workbench-page-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(20, 22, 24, 0.88);
}

.workbench-page-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 10px 5px 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #d9dfe4;
  white-space: nowrap;
  cursor: pointer;
}

.workbench-page-tab img {
  width: 30px;
  height: 24px;
  object-fit: cover;
  border-radius: 3px;
  background: #ffffff;
}

.workbench-page-tab.active {
  border-color: #2f6fec;
  background: rgba(47, 111, 236, 0.18);
  color: #ffffff;
}

.theme-light .workbench-page-tabs {
  border-bottom-color: #dce3e8;
  background: #f5f7f9;
}

.theme-light .workbench-page-tab {
  border-color: #d2dae0;
  background: #ffffff;
  color: #43525b;
}

.theme-light .workbench-page-tab.active {
  border-color: #2f6fec;
  background: #edf4ff;
  color: #1d5fc7;
}

@media (max-width: 640px) {
  .pdf-page-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

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

  .pdf-page-option img {
    height: 140px;
  }

  .pdf-page-footer {
    flex-wrap: wrap;
  }

  .pdf-page-summary {
    width: 100%;
  }
}

/* Bubble Sort Modal */
.bubble-sort-overlay {
  z-index: 1110;
}

.bubble-sort-dialog {
  width: min(980px, calc(100vw - 48px));
  max-height: calc(100vh - 64px);
  border-radius: 12px;
}

.bubble-sort-dialog .modal-header {
  align-items: flex-start;
  padding: 22px 28px 18px;
}

.bubble-sort-dialog .modal-header h3 {
  font-size: 22px;
}

.bubble-sort-dialog .modal-header p {
  margin: 8px 0 0;
  color: #a8b0b4;
  font-size: 14px;
  line-height: 1.5;
}

/* ------------------------------------------------------------------ */
/* Bulk-set-gage modal                                                */
/* ------------------------------------------------------------------ */

.bulk-gage-overlay {
  z-index: 1118;
  background: rgba(4, 6, 7, 0.78);
  backdrop-filter: blur(5px);
}

.bulk-gage-dialog {
  width: min(720px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid #3b4246;
  border-top: 2px solid #dc8a35;
  border-radius: 12px;
  background: #171a1c;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.68), 0 0 0 1px rgba(255, 255, 255, 0.025);
  display: flex;
  flex-direction: column;
}

.bulk-gage-header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid #30363a;
  background: #1b1e20;
}

.bulk-gage-title-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(220, 138, 53, 0.48);
  border-radius: 7px;
  background: rgba(220, 138, 53, 0.1);
  color: #f0a24e;
}

.bulk-gage-title-icon svg {
  width: 24px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bulk-gage-header-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.bulk-gage-header-text h3 {
  margin: 0;
  color: #f3f5f6;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.bulk-gage-subtitle {
  margin: 0;
  color: #929ba1;
  font-size: 12px;
  line-height: 1.5;
}

.bulk-gage-subtitle-divider {
  margin: 0 4px;
  opacity: 0.55;
}

#bulk-gage-progress #bulk-gage-progress-set {
  color: #f0a24e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
}

.bulk-gage-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.bulk-gage-manage {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #42494d;
  border-radius: 6px;
  background: #202427;
  color: #c6ccd0;
  font-size: 12px;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

.bulk-gage-manage:hover {
  border-color: #626b70;
  background: #292e31;
  color: #ffffff;
}

.bulk-gage-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 22px 0;
  overflow: auto;
}

.bulk-gage-hint {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid #30363a;
  border-radius: 6px;
  background: #131618;
  color: #aeb6bb;
  font-size: 12px;
  line-height: 1.55;
}

.bulk-gage-hint > span:first-child {
  color: #f0a24e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
}

.bulk-gage-empty {
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(255, 165, 70, 0.08);
  border: 1px solid rgba(255, 165, 70, 0.28);
  color: #f1c086;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.bulk-gage-empty-link {
  background: none;
  border: none;
  color: #ffb347;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.bulk-gage-empty-link:hover {
  text-decoration: underline;
}

.bulk-gage-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  border: 1px solid #30363a;
  border-radius: 8px;
  background: #141719;
}

.bulk-gage-row {
  display: grid;
  grid-template-columns: 32px minmax(140px, 1fr) minmax(190px, 220px) 64px;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 9px 12px;
  border-bottom: 1px solid #292e31;
  background: transparent;
  transition: background 100ms ease;
}

.bulk-gage-row:last-child {
  border-bottom: 0;
}

.bulk-gage-row:hover {
  background: #1b1f21;
}

.bulk-gage-row.is-configured {
  background: rgba(76, 130, 91, 0.045);
}

.bulk-gage-row-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #383f43;
  border-radius: 6px;
  background: #202427;
  color: #d99145;
}

.bulk-gage-row-icon svg {
  width: 20px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bulk-gage-row-body {
  display: contents;
}

.bulk-gage-row-title {
  display: flex;
  align-items: center;
  min-width: 0;
  color: #e6eaec;
  font-size: 13px;
  font-weight: 600;
}

.bulk-gage-row-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
  color: #b88957;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.bulk-gage-row-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(184, 137, 87, 0.1);
}

.bulk-gage-row.is-configured .bulk-gage-row-status {
  background: transparent;
  color: #70b984;
}

.bulk-gage-row.is-configured .bulk-gage-row-status::before {
  box-shadow: 0 0 0 3px rgba(112, 185, 132, 0.1);
}

.bulk-gage-row select {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #41494d;
  border-radius: 6px;
  background-color: #1d2123;
  color: #e2e6e8;
  font-size: 12px;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #b6bdc4 50%),
    linear-gradient(135deg, #b6bdc4 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 11px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

.bulk-gage-row select:focus {
  outline: none;
  border-color: #4389f6;
  box-shadow: 0 0 0 2px rgba(67, 137, 246, 0.18);
}

.bulk-gage-row-status-tag {
  display: flex;
  align-items: center;
}

.bulk-gage-footer {
  gap: 10px;
  margin-top: 16px;
  padding: 15px 22px 18px;
  border-top: 1px solid #30363a;
  background: #1b1e20;
}

.bulk-gage-footer .pill-button {
  min-width: 116px;
  min-height: 38px;
  justify-content: center;
  border-radius: 7px;
  box-shadow: none;
}

.bulk-gage-footer .pill-button:not(.primary) {
  border-color: #42494d;
  background: #202427;
  color: #d4d9dc;
}

.bulk-gage-footer .pill-button:not(.primary):hover {
  border-color: #626b70;
  background: #292e31;
  color: #ffffff;
}

.bulk-gage-footer .pill-button.primary {
  border-color: #2f6fec;
  background: #2f6fec;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(47, 111, 236, 0.22);
}

.bulk-gage-footer .pill-button.primary:hover {
  background: #3e7cf0;
}

.bulk-gage-footer .pill-button.primary:disabled {
  background: #2a3a52;
  border-color: #2a3a52;
  color: #7e8a9a;
  box-shadow: none;
  cursor: not-allowed;
}

.theme-light .bulk-gage-overlay {
  background: rgba(31, 42, 48, 0.4);
}

.theme-light .bulk-gage-dialog {
  border-color: #cbd5dc;
  border-top-color: #d47a24;
  background: #ffffff;
  color: #1f2a30;
  box-shadow: 0 28px 80px rgba(31, 42, 48, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.theme-light .bulk-gage-header,
.theme-light .bulk-gage-footer {
  border-color: #dbe3e8;
  background: #f7f9fa;
}

.theme-light .bulk-gage-title-icon {
  border-color: #edc294;
  background: #fff4e8;
  color: #b96418;
}

.theme-light .bulk-gage-header-text h3 {
  color: #1f2a30;
}

.theme-light .bulk-gage-subtitle {
  color: #6b7881;
}

.theme-light #bulk-gage-progress #bulk-gage-progress-set,
.theme-light .bulk-gage-hint > span:first-child {
  color: #b96418;
}

.theme-light .bulk-gage-manage {
  border-color: #cbd5dc;
  background: #ffffff;
  color: #52616b;
}

.theme-light .bulk-gage-manage:hover {
  border-color: #aebbc4;
  background: #eef3f6;
  color: #1f2a30;
}

.theme-light .bulk-gage-body {
  background: #ffffff;
}

.theme-light .bulk-gage-hint {
  border-color: #d9e1e6;
  background: #f7f9fa;
  color: #5d6b74;
}

.theme-light .bulk-gage-empty {
  border-color: #e8bf8c;
  background: #fff8ef;
  color: #88521e;
}

.theme-light .bulk-gage-empty-link {
  color: #ad5b15;
}

.theme-light .bulk-gage-list {
  border-color: #d7e0e6;
  background: #ffffff;
}

.theme-light .bulk-gage-row {
  border-bottom-color: #e5ebef;
  background: transparent;
}

.theme-light .bulk-gage-row:hover {
  background: #f5f8fa;
}

.theme-light .bulk-gage-row.is-configured {
  background: #f6faf7;
}

.theme-light .bulk-gage-row-icon {
  border-color: #e4c39f;
  background: #fff8f0;
  color: #b96820;
}

.theme-light .bulk-gage-row-title {
  color: #26343c;
}

.theme-light .bulk-gage-row-status {
  color: #a56c31;
}

.theme-light .bulk-gage-row.is-configured .bulk-gage-row-status {
  color: #398052;
}

.theme-light .bulk-gage-row select {
  border-color: #c8d3da;
  background-color: #ffffff;
  color: #26343c;
  color-scheme: light;
}

.theme-light .bulk-gage-row select:hover {
  border-color: #aebcc5;
}

.theme-light .bulk-gage-row select:focus {
  border-color: #2f78e9;
  box-shadow: 0 0 0 2px rgba(47, 120, 233, 0.16);
}

.theme-light .bulk-gage-footer .pill-button:not(.primary) {
  border-color: #c8d3da;
  background: #ffffff;
  color: #45535c;
}

.theme-light .bulk-gage-footer .pill-button:not(.primary):hover {
  border-color: #aebbc4;
  background: #eef3f6;
  color: #1f2a30;
}

.theme-light .bulk-gage-footer .pill-button.primary,
.theme-light .bulk-gage-footer .pill-button.primary:hover {
  border-color: #2f6fec;
  background: #2f6fec;
  color: #ffffff;
}

@media (max-width: 700px) {
  .bulk-gage-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .bulk-gage-header {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    padding: 15px 16px;
  }

  .bulk-gage-manage {
    display: none;
  }

  .bulk-gage-body {
    padding: 14px 14px 0;
  }

  .bulk-gage-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .bulk-gage-row select {
    grid-column: 2 / -1;
    grid-row: 2;
  }

  .bulk-gage-row-status-tag {
    grid-column: 3;
    grid-row: 1;
  }

  .bulk-gage-footer {
    padding: 14px;
  }
}

.bubble-sort-body {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 1fr);
  gap: 24px;
  padding: 24px 28px;
  overflow: auto;
}

.bubble-sort-body h4 {
  margin: 0 0 14px;
  color: #f0f3f4;
  font-size: 16px;
}

.bubble-sort-rule-list {
  display: grid;
  gap: 10px;
}

.bubble-sort-rule-item {
  display: grid;
  grid-template-columns: auto 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 9px 12px;
  border: 1px solid #5d94d8;
  border-radius: 8px;
  background: rgba(74, 156, 255, 0.12);
  cursor: grab;
  transition: border-color 120ms ease, background 120ms ease, opacity 120ms ease;
}

.bubble-sort-rule-item:active {
  cursor: grabbing;
}

.bubble-sort-rule-item.is-dragging {
  opacity: 0.48;
}

.bubble-sort-rule-item.drag-over {
  border-color: #2f7cff;
  background: rgba(47, 124, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(47, 124, 255, 0.4);
}

.bubble-sort-rule-grip {
  color: #72adff;
  font-size: 20px;
  letter-spacing: -2px;
  cursor: grab;
}

.bubble-sort-rule-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #2f7cff;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.bubble-sort-rule-item strong {
  color: #f0f3f4;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bubble-sort-rule-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bubble-sort-rule-actions button {
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #2f7cff;
  font-size: 18px;
  cursor: pointer;
}

.bubble-sort-rule-actions button:hover:not(:disabled) {
  background: rgba(47, 124, 255, 0.14);
}

.bubble-sort-rule-actions button:disabled {
  color: #8e989d;
  cursor: default;
  opacity: 0.55;
}

.bubble-sort-preview-summary {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #3f474c;
  border-radius: 8px;
  background: #242625;
  color: #dce3e7;
}

.bubble-sort-preview-summary span {
  color: #a8b0b4;
}

.bubble-sort-preview-table-shell {
  overflow: auto;
  border: 1px solid #3f474c;
  border-radius: 8px;
}

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

.bubble-sort-preview-table th,
.bubble-sort-preview-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #343a3d;
  text-align: left;
  white-space: nowrap;
}

.bubble-sort-preview-table th {
  background: #242625;
  color: #c5d0d5;
  font-weight: 600;
}

.bubble-sort-preview-table tr:last-child td {
  border-bottom: 0;
}

.bubble-sort-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
}

.bubble-sort-footer .modal-footer-right {
  display: flex;
  gap: 8px;
}

/* Category Filter Modal */
.category-filter-overlay {
  z-index: 1100;
}

.category-filter-dialog {
  width: min(980px, calc(100vw - 48px));
  max-height: calc(100vh - 64px);
  border-radius: 12px;
}

.category-filter-body {
  padding: 24px 28px;
  overflow: auto;
}

.category-filter-dialog .modal-header {
  align-items: flex-start;
  padding: 22px 28px 18px;
}

.category-filter-dialog .modal-header h3 {
  font-size: 22px;
}

.category-filter-dialog .modal-header p {
  margin: 8px 0 0;
  color: #a8b0b4;
  font-size: 14px;
  line-height: 1.5;
}

.category-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.category-filter-summary strong {
  display: block;
  color: #f0f3f4;
  font-size: 16px;
}

.category-filter-summary span {
  display: block;
  margin-top: 4px;
  color: #a1a9ad;
  font-size: 13px;
}

.category-filter-quick-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.category-filter-quick-actions button {
  border: 0;
  background: transparent;
  color: #7ea7ff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.category-filter-quick-actions button:last-child {
  color: #ff6380;
}

.category-filter-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 20px;
}

.category-filter-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 14px;
  border: 1px solid #3f474c;
  border-radius: 10px;
  background: #242625;
  cursor: pointer;
  user-select: none;
}

.category-filter-card:hover {
  border-color: #6fa7ff;
  background: #282c2d;
}

.category-filter-card input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2f6fec;
  cursor: pointer;
  flex-shrink: 0;
}

.category-filter-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border: 2px solid #d7dce0;
  border-radius: 999px;
  color: #7c8790;
  font-size: 18px;
  font-weight: 700;
}

.category-filter-text {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.category-filter-text strong {
  color: #f0f3f4;
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-filter-text small {
  color: #a3aaaf;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-filter-count {
  color: #aeb6ba;
  font-size: 13px;
  flex-shrink: 0;
}

.category-filter-hidden-badge {
  display: none;
  position: absolute;
  right: 42px;
  top: 16px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #676d70;
  color: #ffffff;
  font-size: 12px;
}

.category-filter-card.is-hidden {
  border-style: dashed;
  border-color: #8a8f93;
  background: rgba(255, 255, 255, 0.03);
  opacity: 0.62;
}

.category-filter-card.is-hidden .category-filter-hidden-badge {
  display: inline-flex;
}

.category-filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-top: 1px solid var(--border-color, #3a3a3a);
}

.category-filter-hidden {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #a8b0b4;
  font-size: 14px;
}

.category-filter-hidden > div {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.category-filter-hidden-chip,
.category-filter-hidden-empty {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #3a3f42;
  color: #ffffff;
  font-size: 12px;
}

.category-filter-footer .modal-footer-right {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Match the annotation modals to the Excel export modal shell and controls. */
.modal-overlay.bubble-sort-overlay,
.modal-overlay.bulk-gage-overlay,
.modal-overlay.category-filter-overlay {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(3px);
}

.modal-dialog.bubble-sort-dialog,
.modal-dialog.bulk-gage-dialog,
.modal-dialog.category-filter-dialog {
  border: 1px solid var(--border-color, #3a3a3a);
  border-radius: 16px;
  background: var(--bg-secondary, #1e1e1e);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.bubble-sort-dialog .modal-header,
.category-filter-dialog .modal-header,
.bulk-gage-dialog .bulk-gage-header {
  padding: 22px 26px 16px;
  border-bottom: 1px solid var(--border-color, #3a3a3a);
  background: transparent;
}

.bubble-sort-dialog .modal-header h3,
.category-filter-dialog .modal-header h3,
.bulk-gage-header-text h3 {
  color: var(--text-color, #e6e8eb);
  font-size: 20px;
  font-weight: 600;
}

.bubble-sort-dialog .modal-header h3,
.category-filter-dialog .modal-header h3 {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bubble-sort-dialog .modal-header p,
.category-filter-dialog .modal-header p {
  margin: 7px 0 0 42px;
  color: #aab2b7;
  font-size: 13px;
}

.reference-modal-title-icon,
.bulk-gage-title-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: #2f6fec;
  color: #ffffff;
}

.reference-modal-title-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bulk-gage-title-icon svg {
  width: 21px;
  height: 16px;
}

.bulk-gage-dialog {
  border-top-width: 1px;
}

.bulk-gage-subtitle {
  color: #aab2b7;
  font-size: 13px;
}

#bulk-gage-progress #bulk-gage-progress-set,
.bulk-gage-hint > span:first-child {
  color: #6fa0ff;
}

.bulk-gage-body {
  gap: 14px;
  padding: 18px 26px 4px;
  background: transparent;
}

.bulk-gage-hint {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.bulk-gage-row-icon {
  border-color: rgba(47, 111, 236, 0.42);
  background: rgba(47, 111, 236, 0.1);
  color: #76a4ff;
}

.bubble-sort-body,
.category-filter-body {
  padding-right: 26px;
  padding-left: 26px;
}

.modal-footer.bubble-sort-footer,
.modal-footer.bulk-gage-footer,
.modal-footer.category-filter-footer {
  gap: 14px;
  margin-top: 0;
  padding: 18px 26px 22px;
  border-top: 1px solid var(--border-color, #3a3a3a);
  background: transparent;
}

.bubble-sort-footer .modal-footer-right,
.category-filter-footer .modal-footer-right {
  gap: 14px;
}

.bubble-sort-footer .pill-button,
.bulk-gage-footer .pill-button,
.category-filter-footer .pill-button {
  min-width: 140px;
  min-height: 42px;
  justify-content: center;
  border-radius: 9px;
  box-shadow: none;
}

.bubble-sort-footer .pill-button:not(.primary),
.bulk-gage-footer .pill-button:not(.primary),
.category-filter-footer .pill-button:not(.primary) {
  border-color: #d4d8da;
  background: #f4f5f5;
  color: #202323;
}

.bubble-sort-footer .pill-button:not(.primary):hover,
.bulk-gage-footer .pill-button:not(.primary):hover,
.category-filter-footer .pill-button:not(.primary):hover {
  border-color: #ffffff;
  background: #ffffff;
  color: #111414;
}

.bubble-sort-footer .pill-button.primary,
.bulk-gage-footer .pill-button.primary,
.category-filter-footer .pill-button.primary {
  border-color: #2f6fec;
  background: #2f6fec;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(47, 111, 236, 0.26);
}

.bubble-sort-footer .pill-button.primary:hover,
.bulk-gage-footer .pill-button.primary:hover,
.category-filter-footer .pill-button.primary:hover {
  background: #3e7cf0;
}

.theme-light .modal-overlay.bubble-sort-overlay,
.theme-light .modal-overlay.bulk-gage-overlay,
.theme-light .modal-overlay.category-filter-overlay {
  background: rgba(0, 0, 0, 0.45);
}

.theme-light .modal-dialog.bubble-sort-dialog,
.theme-light .modal-dialog.bulk-gage-dialog,
.theme-light .modal-dialog.category-filter-dialog {
  border-color: #d7e0e6;
  background: #ffffff;
  color: #1f2a30;
  box-shadow: 0 24px 70px rgba(31, 42, 48, 0.22);
}

.theme-light .bubble-sort-dialog .modal-header,
.theme-light .category-filter-dialog .modal-header,
.theme-light .bulk-gage-dialog .bulk-gage-header,
.theme-light .modal-footer.bubble-sort-footer,
.theme-light .modal-footer.bulk-gage-footer,
.theme-light .modal-footer.category-filter-footer {
  border-color: #d7e0e6;
  background: transparent;
}

.theme-light .bubble-sort-dialog .modal-header h3,
.theme-light .category-filter-dialog .modal-header h3,
.theme-light .bulk-gage-header-text h3 {
  color: #1f2a30;
}

.theme-light .bubble-sort-dialog .modal-header p,
.theme-light .category-filter-dialog .modal-header p,
.theme-light .bulk-gage-subtitle {
  color: #6f7d86;
}

.theme-light .reference-modal-title-icon,
.theme-light .bulk-gage-title-icon {
  border: 0;
  background: #2f6fec;
  color: #ffffff;
}

.theme-light #bulk-gage-progress #bulk-gage-progress-set,
.theme-light .bulk-gage-hint > span:first-child {
  color: #2f6fec;
}

.theme-light .bulk-gage-body {
  background: transparent;
}

.theme-light .bulk-gage-hint {
  border-color: #d8e0e6;
  background: #f7f9fb;
}

.theme-light .bulk-gage-row-icon {
  border-color: #bdd1f5;
  background: #edf4ff;
  color: #2f6fec;
}

.theme-light .bubble-sort-footer .pill-button:not(.primary),
.theme-light .bulk-gage-footer .pill-button:not(.primary),
.theme-light .category-filter-footer .pill-button:not(.primary) {
  border-color: #c9d5de;
  background: #ffffff;
  color: #46545f;
  box-shadow: 0 1px 4px rgba(31, 42, 48, 0.1);
}

.theme-light .bubble-sort-footer .pill-button:not(.primary):hover,
.theme-light .bulk-gage-footer .pill-button:not(.primary):hover,
.theme-light .category-filter-footer .pill-button:not(.primary):hover {
  border-color: #c9d5de;
  background: #eef3f6;
  color: #1f2a30;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #3a3a3a);
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted, #888);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-color, #e0e0e0);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
}

.generated-text-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.field-hint {
  margin: 6px 0 0;
  color: var(--text-muted, #9aa4a9);
  font-size: 12px;
  line-height: 1.45;
}

.annotation-field-group[hidden] {
  display: none !important;
}

.manual-entry-hint {
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #3b464b;
  border-radius: 6px;
  background: rgba(47, 124, 255, 0.1);
  color: #cdd8de;
  font-size: 13px;
  line-height: 1.45;
}

.candidate-hint {
  margin: 0;
  color: var(--text-muted, #9aa4a9);
  font-size: 13px;
  line-height: 1.5;
}

.candidate-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.candidate-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #3a3a3a);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.candidate-item:hover {
  border-color: rgba(74, 158, 255, 0.72);
  background: rgba(74, 158, 255, 0.1);
}

.candidate-text {
  min-width: 0;
  color: var(--text-color, #e0e0e0);
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-category {
  color: var(--text-muted, #9aa4a9);
  font-size: 12px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.form-row-group .form-row {
  flex: 1 1 180px;
}

/* 分组标题 */
.form-row-group-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #888);
  padding: 8px 0 4px;
  margin: 0;
}

/* 同行显示：公差值和单位 */
.form-row-group.inline-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  align-items: flex-end;
}

.form-row-group.inline-row .form-row {
  flex: 0 1 auto;
  min-width: 120px;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.form-row-group.inline-row .form-row label {
  white-space: nowrap;
}

.form-row-group.inline-row.gdt-nominal-row {
  flex-wrap: nowrap;
  align-items: stretch;
}

.form-row-group.inline-row.gdt-nominal-row .form-row {
  flex: 0 1 auto;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.form-row-group.inline-row.gdt-nominal-row .form-row label {
  white-space: normal;
}

.form-row-group.inline-row.gdt-nominal-row .dimension-unit-row {
  flex-basis: 150px;
}

.form-row-group.inline-row.gdt-nominal-row .tolerance-offset-row {
  flex-basis: 86px;
}

.form-row-group.inline-row.gdt-symmetric-row {
  flex-wrap: nowrap;
  align-items: stretch;
}

.form-row-group.inline-row.gdt-symmetric-row .form-row {
  flex: 0 1 160px;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

#gdt-category-placeholder {
  display: inline-block;
  vertical-align: bottom;
}

#gdt-category-placeholder .form-row {
  flex: 0 1 auto;
  min-width: 140px;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.form-row-group.datums-group {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 88px;
  gap: 10px 12px;
  align-items: center;
  padding: 12px;
  margin: 4px 0 10px;
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--border-color, #3a3a3a);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  box-sizing: border-box;
}

.datums-header {
  grid-column: 1 / -1;
  padding: 0 0 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #888);
}

.form-row.datums-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 88px;
  grid-column: 1 / -1;
  align-items: center;
  gap: inherit;
  padding: 0;
  border-bottom: 0;
  margin: 0;
}

.form-row.datums-row:last-child {
  border-bottom: none;
}

.form-row.datums-row label {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted, #888);
}

.form-row.datums-row input {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.form-row.datums-row input::placeholder {
  color: #a8adb5;
}

.datum-modifier-select {
  width: 100%;
  min-width: 0;
  margin: 0;
}

@media (max-width: 560px) {
  .canvas-info-controls {
    top: 10px;
    right: 10px;
  }

  .canvas-history-controls {
    top: 10px;
    left: 10px;
  }

  .drawing-info-button {
    width: 38px;
    height: 38px;
  }

  .drawing-info-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 12px;
  }

  .drawing-info-header {
    padding: 18px 18px;
  }

  .drawing-info-header h3 {
    gap: 9px;
    font-size: 18px;
  }

  .drawing-info-title-icon {
    width: 26px;
    height: 26px;
  }

  .drawing-info-body {
    padding: 20px 18px 24px;
  }

  .drawing-info-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .drawing-info-field-wide {
    grid-column: auto;
  }

  .drawing-info-footer {
    padding: 16px 18px 18px;
  }

  .drawing-info-footer .pill-button {
    min-width: 0;
    flex: 1;
  }

  .form-row-group.datums-group {
    grid-template-columns: 32px minmax(0, 1fr) 76px;
    gap: 10px;
  }

  .form-row.datums-row {
    grid-template-columns: 32px minmax(0, 1fr) 76px;
  }

  .form-row.datums-row input,
  .datum-modifier-select {
    font-size: 14px;
  }
}

/* 符号快捷输入按钮分类 */
.symbol-quick-input {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: 1px solid var(--border-color, #3a3a3a);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.symbol-quick-input-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}

.symbol-quick-input-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.symbol-quick-input-label {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted, #888);
}

.symbol-quick-input-toggle {
  font-size: 12px;
  color: var(--text-muted, #888);
  transition: transform 0.2s;
}

.symbol-quick-input.expanded .symbol-quick-input-toggle {
  transform: rotate(90deg);
}

.symbol-categories {
  display: none;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px 12px;
  padding: 0 12px 12px;
}

.symbol-quick-input.expanded .symbol-categories {
  display: grid;
}

.symbol-category {
  display: contents;
}

.symbol-category-label {
  padding-top: 8px;
  font-size: 13px;
  color: var(--text-muted, #888);
  white-space: nowrap;
}

.symbol-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 34px));
  gap: 4px;
  align-items: start;
}

.symbol-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  background: var(--bg-secondary, #2d2d2d);
  border: 0;
  border-radius: 7px;
  color: var(--text-color, #e0e0e0);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.symbol-btn.gdt-symbol-font {
  font-size: 21px;
}

#edit-category.gdt-symbol-select {
  font-family: inherit;
  font-size: 16px;
}

.symbol-btn:hover {
  background: var(--bg-hover, #3a3a3a);
}

@media (max-width: 560px) {
  .symbol-categories {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
  }

  .symbol-buttons {
    grid-template-columns: repeat(auto-fill, minmax(30px, 30px));
    gap: 4px;
  }

  .symbol-btn {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }
}

.form-row label {
  font-size: 12px;
  color: var(--text-muted, #888);
}

.form-row input,
.form-row select {
  padding: 8px 12px;
  border: 1px solid var(--border-color, #3a3a3a);
  border-radius: 6px;
  background: var(--bg-primary, #252526);
  color: var(--text-color, #e0e0e0);
  font-size: 14px;
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--accent-color, #4a9eff);
}

.form-row .input-like-check-control {
  display: flex;
  align-items: center;
  min-height: 37px;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #3a3a3a);
  border-radius: 6px;
  background: var(--bg-primary, #252526);
  color: var(--text-color, #e0e0e0);
  box-sizing: border-box;
}

.form-row .input-like-check-control:focus-within {
  border-color: var(--accent-color, #4a9eff);
}

.form-row input[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color, #3a3a3a);
}

/* Row Tooltip */
.row-tooltip {
  position: fixed;
  background: var(--bg-secondary, #1e1e1e);
  border: 1px solid var(--border-color, #3a3a3a);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12px;
  max-width: 300px;
  z-index: 999;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  line-height: 1.5;
}

.row-tooltip[hidden] {
  display: none !important;
}

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

.row-tooltip .tooltip-label {
  color: var(--text-muted, #888);
  white-space: nowrap;
}

.row-tooltip .tooltip-value {
  color: var(--text-color, #e0e0e0);
  word-break: break-all;
}

/* Table row hover */
.gdt-table tbody tr {
  cursor: default;
}

/* Context Menu */
.context-menu {
  position: fixed;
  background: var(--bg-secondary, #1e1e1e);
  border: 1px solid var(--border-color, #3a3a3a);
  border-radius: 8px;
  padding: 6px 0;
  min-width: 140px;
  z-index: 10000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.context-menu[hidden] {
  display: none !important;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text-color, #e0e0e0);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.context-menu-item:hover {
  background: var(--bg-hover, #2a2a2a);
}

.context-menu-item.danger {
  color: #e53935;
}

.context-menu-item.danger:hover {
  background: rgba(229, 57, 53, 0.15);
}

.context-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  width: 20px;
  text-align: center;
}

.context-menu-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
