:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-blue: #eef5ff;
  --ink: #102038;
  --ink-soft: #506077;
  --muted: #7b899d;
  --border: #dbe3ee;
  --border-strong: #c8d3e1;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #dbeafe;
  --accent-ink: #174ea6;
  --success: #15803d;
  --danger: #c0352b;
  --danger-soft: #fff0ee;
  --shadow-sm: 0 1px 2px rgba(15, 31, 54, 0.05), 0 8px 24px rgba(15, 31, 54, 0.05);
  --shadow-lg: 0 28px 70px rgba(29, 59, 102, 0.14), 0 4px 14px rgba(29, 59, 102, 0.08);
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --max-width: 1180px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
input:focus-visible,
.grid-scroll:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.25);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.icon {
  display: block;
  width: 18px;
  height: 18px;
}

.page-glow {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(4px);
  pointer-events: none;
}

.page-glow-one {
  top: -360px;
  right: -220px;
  width: 720px;
  height: 720px;
  background: radial-gradient(circle, rgba(182, 214, 255, 0.52), rgba(182, 214, 255, 0));
}

.page-glow-two {
  top: 440px;
  left: -360px;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(210, 228, 249, 0.45), rgba(210, 228, 249, 0));
}

.app-shell {
  min-height: 100vh;
}

.view {
  min-height: 100vh;
}

.site-header,
.site-footer,
.hero-section,
.tools-section {
  width: min(var(--max-width), calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
}

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

.brand-button {
  padding: 0;
  cursor: pointer;
  background: transparent;
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 8px 20px rgba(16, 32, 56, 0.16);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.08em;
}

.brand-mark-small {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 16px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-copy strong {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.brand-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}

.text-link {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.text-link:hover {
  color: var(--ink);
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 680;
  white-space: nowrap;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease,
    transform 150ms ease, box-shadow 150ms ease;
}

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

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

.button-primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.button-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.26);
}

.button-quiet {
  color: var(--ink-soft);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.72);
}

.button-quiet:hover {
  color: var(--ink);
  border-color: var(--border-strong);
  background: #fff;
}

.button-large {
  min-height: 50px;
  padding-inline: 21px;
  border-radius: 11px;
  font-size: 14px;
}

.button-compact {
  min-height: 34px;
  padding-inline: 11px;
  border-radius: 8px;
  font-size: 12px;
}

.button-danger {
  color: #fff;
  background: var(--danger);
}

.danger-hover:hover {
  color: var(--danger);
  border-color: #f1c0ba;
  background: var(--danger-soft);
}

.hero-section {
  display: grid;
  min-height: 570px;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(460px, 1fr);
  gap: 56px;
  padding: 64px 0 88px;
}

.hero-copy h1 {
  max-width: 610px;
  margin: 0;
  font-size: clamp(48px, 4.7vw, 64px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.hero-copy > p {
  max-width: 550px;
  margin: 28px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 34px;
}

.local-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.local-note .icon {
  width: 16px;
  height: 16px;
  color: var(--success);
}

.hero-preview {
  position: relative;
  overflow: hidden;
  min-height: 390px;
  padding: 18px;
  border: 1px solid rgba(198, 211, 228, 0.9);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-lg);
  transform: perspective(1200px) rotateY(-3deg) rotateX(1deg);
}

.hero-preview::before {
  position: absolute;
  top: -80px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(219, 234, 254, 0.75);
  content: "";
  filter: blur(18px);
}

.preview-topbar {
  position: relative;
  display: flex;
  height: 34px;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid #e8edf4;
}

.preview-topbar span {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: #d6deea;
}

.preview-topbar b {
  position: absolute;
  left: 50%;
  color: #506077;
  font-size: 10px;
  transform: translateX(-50%);
}

.preview-input {
  display: flex;
  min-height: 108px;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
  padding: 19px;
  border: 1px solid #e0e7f0;
  border-radius: 13px;
  background: #fbfcfe;
}

.preview-input i {
  display: block;
  width: 85%;
  height: 8px;
  border-radius: 99px;
  background: #e4eaf2;
}

.preview-input i.short {
  width: 66%;
}

.preview-table {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid #dce5ef;
  border-radius: 13px;
  background: #fff;
}

.preview-row {
  display: grid;
  min-height: 47px;
  align-items: center;
  grid-template-columns: 1fr 0.75fr 1.25fr 0.65fr;
  border-bottom: 1px solid #edf1f6;
  color: #66758a;
  font-size: 10px;
}

.preview-row:last-child {
  border-bottom: 0;
}

.preview-row span {
  overflow: hidden;
  padding-inline: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-row span + span {
  border-left: 1px solid #edf1f6;
}

.preview-row.preview-head {
  min-height: 38px;
  color: #42536a;
  background: #f5f8fb;
  font-weight: 720;
}

.preview-row.selected {
  color: #285397;
  background: #eaf2ff;
  box-shadow: inset 3px 0 var(--accent);
}

.tools-section {
  padding: 84px 0 110px;
  border-top: 1px solid rgba(206, 218, 232, 0.72);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.035em;
}

.section-heading p {
  margin: 7px 0 0;
  color: var(--muted);
}

.tool-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

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

.tool-card {
  display: grid;
  width: 100%;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.tool-card:hover {
  border-color: #b9cbe3;
  box-shadow: 0 18px 38px rgba(27, 55, 95, 0.1);
  transform: translateY(-2px);
}

.tool-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 17px;
  color: var(--accent);
  background: var(--accent-soft);
}

.tool-icon .icon {
  width: 25px;
  height: 25px;
}

.tool-card-ip .tool-icon {
  color: #087f73;
  background: #e5f8f5;
}

.tool-card-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.tool-card-copy strong {
  font-size: 18px;
  font-weight: 740;
}

.tool-card-copy > span {
  margin-top: 5px;
  overflow: hidden;
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

code,
kbd {
  border: 1px solid #d9e1ec;
  border-radius: 5px;
  color: #35506f;
  background: #f5f8fb;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

code {
  padding: 2px 5px;
}

kbd {
  padding: 2px 6px;
  box-shadow: 0 1px 0 #cdd7e4;
}

.tool-card-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 720;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0 38px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

/* Workspace */
.tool-view {
  background: #f3f6fa;
}

.workspace-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  min-height: 66px;
  align-items: center;
  grid-template-columns: 1fr auto 1fr;
  padding: 0 24px;
  border-bottom: 1px solid rgba(205, 216, 230, 0.85);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.workspace-header-center {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 13px;
}

.workspace-header-center .icon {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

.workspace-actions {
  justify-self: end;
  gap: 12px;
}

.cache-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.cache-status.is-saving .status-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.cache-status.is-error .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(192, 53, 43, 0.12);
}

.workspace-main {
  width: min(1480px, calc(100% - 40px));
  margin-inline: auto;
  padding: 28px 0 56px;
}

.input-panel,
.result-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(24, 45, 75, 0.035);
}

.input-panel {
  padding: 20px;
}

.panel-heading,
.result-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.panel-heading h2,
.result-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 740;
  letter-spacing: -0.015em;
}

.panel-heading p,
.result-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.textarea-wrap {
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: #fbfcfe;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.textarea-wrap:focus-within {
  border-color: #76a4f8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11);
}

.source-input {
  display: block;
  width: 100%;
  min-height: 162px;
  resize: vertical;
  padding: 16px 17px;
  border: 0;
  outline: 0;
  color: #1d2f48;
  background: transparent;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.7;
  tab-size: 2;
}

.source-input::placeholder {
  color: #9aa7b8;
}

.textarea-footer {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  border-top: 1px solid #e4eaf2;
  color: var(--muted);
  background: #f7f9fc;
  font-size: 11px;
}

.delimiter-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.delimiter-indicator .icon {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.parse-message {
  min-height: 0;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  transition: margin 150ms ease;
}

.parse-message:not(:empty) {
  margin-top: 11px;
}

.parse-message.is-warning {
  color: #a65d0a;
}

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

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

.result-panel {
  margin-top: 18px;
  overflow: hidden;
}

.result-heading {
  align-items: center;
  padding: 16px 18px;
}

.result-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
}

.segmented-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f5f7fa;
}

.segment {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 670;
}

.segment .icon {
  width: 14px;
  height: 14px;
}

.segment.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 3px rgba(22, 43, 72, 0.12);
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  margin: 0 2px;
  background: var(--border);
}

.selection-bar {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  background: #f8fafc;
  font-size: 11px;
}

.selection-bar > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.selection-bar .icon {
  width: 14px;
  height: 14px;
}

.selection-bar strong {
  color: var(--accent-ink);
  font-weight: 700;
}

.table-frame {
  border-top: 1px solid var(--border);
  background: #fff;
}

.grid-scroll {
  position: relative;
  overflow: auto;
  height: min(56vh, 610px);
  min-height: 330px;
  outline: 0;
  overscroll-behavior: contain;
  scrollbar-color: #c9d3df transparent;
  scrollbar-width: thin;
}

.grid-content {
  position: relative;
  min-width: 100%;
}

.grid-header,
.data-row {
  display: grid;
  align-items: stretch;
}

.grid-header {
  position: sticky;
  z-index: 12;
  top: 0;
  min-height: 48px;
  border-bottom: 1px solid var(--border-strong);
  background: #f5f8fb;
  box-shadow: 0 2px 5px rgba(18, 38, 66, 0.05);
}

.grid-body {
  position: relative;
}

.grid-rows {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  will-change: transform;
}

.data-row {
  position: relative;
  height: 42px;
  border-bottom: 1px solid #e9eef4;
  background: #fff;
}

.data-row:hover {
  background: #f9fbfd;
}

.grid-cell,
.grid-header-cell,
.row-number-cell,
.row-action-cell,
.corner-cell,
.header-action-cell {
  min-width: 0;
  border-right: 1px solid #e7edf4;
}

.grid-cell {
  position: relative;
  overflow: hidden;
  padding: 10px 12px;
  cursor: cell;
  color: #24364e;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 21px;
  text-overflow: ellipsis;
  user-select: none;
  white-space: nowrap;
}

.grid-cell.is-selected {
  color: #174b9d;
  background: #e6f0ff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.grid-cell.is-selection-edge {
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.row-number-cell,
.corner-cell {
  position: sticky;
  z-index: 4;
  left: 0;
  display: grid;
  place-items: center;
  color: #8794a6;
  background: #f8fafc;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.corner-cell {
  z-index: 15;
  cursor: pointer;
  background: #f1f5f9;
}

.row-number-cell {
  cursor: pointer;
}

.row-number-cell:hover,
.corner-cell:hover {
  color: var(--accent);
  background: #eaf2ff;
}

.grid-header-cell {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  padding: 6px 7px;
  color: #52647a;
  background: #f5f8fb;
}

.grid-header-cell.is-dragging {
  opacity: 0.46;
}

.grid-header-cell.is-drop-target {
  box-shadow: inset 3px 0 var(--accent);
}

.column-grip,
.column-delete,
.row-delete {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 6px;
  cursor: pointer;
  color: #9aa7b8;
  background: transparent;
}

.column-grip {
  width: 22px;
  height: 28px;
  cursor: grab;
}

.column-grip .icon {
  width: 15px;
  height: 15px;
}

.column-grip:hover {
  color: var(--accent);
  background: #e7effd;
}

.column-name-input {
  min-width: 0;
  flex: 1;
  padding: 5px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  outline: 0;
  color: #40536c;
  background: transparent;
  font-size: 11px;
  font-weight: 720;
}

.column-name-input:hover {
  border-color: #d8e1ec;
  background: rgba(255, 255, 255, 0.7);
}

.column-name-input:focus {
  border-color: #8fb2f7;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.column-delete,
.row-delete {
  width: 26px;
  height: 26px;
}

.column-delete .icon,
.row-delete .icon {
  width: 14px;
  height: 14px;
}

.column-delete:hover,
.row-delete:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.row-action-cell,
.header-action-cell {
  display: grid;
  place-items: center;
  background: #fbfcfd;
}

.header-action-cell {
  color: #a0acbb;
  background: #f1f5f9;
}

.empty-result {
  display: flex;
  min-height: 290px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding: 34px;
  border: 1px dashed #cbd6e4;
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid #dce5ef;
  border-radius: 15px;
  color: #6f85a1;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.empty-icon .icon {
  width: 23px;
  height: 23px;
}

.empty-result h2 {
  margin: 18px 0 0;
  color: #44566d;
  font-size: 16px;
}

.empty-result p {
  max-width: 480px;
  margin: 7px 0 0;
  font-size: 12px;
}

.confirm-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 31, 54, 0.24);
}

.confirm-dialog::backdrop {
  background: rgba(12, 24, 42, 0.42);
  backdrop-filter: blur(3px);
}

.confirm-dialog form {
  padding: 28px;
}

.dialog-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  color: var(--danger);
  background: var(--danger-soft);
}

.confirm-dialog h2 {
  margin: 18px 0 0;
  font-size: 20px;
}

.confirm-dialog p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.monitor-settings-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
  overflow: auto;
}

.monitor-settings-dialog form {
  width: 100%;
  max-width: none;
  text-align: left;
  align-items: stretch;
}

.monitor-settings-header,
.monitor-settings-row,
.monitor-live-statuses {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.monitor-settings-header h2,
.monitor-settings-section h3 {
  margin: 0;
}

.monitor-settings-header p,
.monitor-settings-section p {
  margin: 4px 0 0;
}

.monitor-settings-section {
  display: grid;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

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

.monitor-settings-section label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.monitor-settings-section input[type="text"],
.monitor-settings-section input[type="url"],
.monitor-settings-section input[type="number"] {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.monitor-settings-section .monitor-settings-check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
}

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

.monitor-settings-row {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}

.monitor-settings-row > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.monitor-settings-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitor-settings-empty {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
}

[data-role="monitor-settings-status"].is-error {
  color: var(--danger);
}

@media (max-width: 640px) {
  .monitor-settings-grid {
    grid-template-columns: 1fr;
  }

  .monitor-settings-row {
    align-items: flex-start;
  }
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 25px;
}

.toast {
  position: fixed;
  z-index: 60;
  right: 22px;
  bottom: 22px;
  max-width: min(390px, calc(100% - 32px));
  padding: 11px 15px;
  border: 1px solid rgba(179, 197, 219, 0.82);
  border-radius: 10px;
  opacity: 0;
  color: #fff;
  background: #172942;
  box-shadow: 0 12px 32px rgba(15, 31, 54, 0.22);
  font-size: 12px;
  font-weight: 620;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .hero-section {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 48px;
    padding-top: 72px;
  }

  .hero-copy {
    max-width: 720px;
  }

  .hero-preview {
    min-height: 350px;
    transform: none;
  }

  .workspace-header {
    grid-template-columns: 1fr auto;
  }

  .workspace-header-center {
    display: none;
  }

  .result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-toolbar {
    width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 680px) {
  .site-header,
  .site-footer,
  .hero-section,
  .tools-section {
    width: min(100% - 28px, var(--max-width));
  }

  .site-header {
    min-height: 70px;
  }

  .site-header .text-link,
  .site-header .button-quiet .icon,
  .site-header .button-quiet {
    font-size: 0;
  }

  .site-header .button-quiet {
    width: 40px;
    padding: 0;
  }

  .site-header .button-quiet .icon {
    width: 18px;
    height: 18px;
  }

  .header-actions {
    gap: 8px;
  }

  .hero-section {
    gap: 34px;
    padding: 48px 0 70px;
  }

  .hero-copy h1 {
    font-size: clamp(41px, 12vw, 56px);
  }

  .hero-copy > p {
    margin-top: 22px;
    font-size: 15px;
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .hero-preview {
    min-height: 315px;
    padding: 12px;
    border-radius: 19px;
  }

  .preview-row {
    grid-template-columns: 1fr 0.8fr 1.1fr;
  }

  .preview-row span:last-child {
    display: none;
  }

  .tools-section {
    padding: 65px 0 78px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .tool-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
  }

  .tool-icon {
    width: 48px;
    height: 48px;
  }

  .tool-card-copy > span {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .tool-card-action {
    display: none;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .workspace-header {
    min-height: 60px;
    padding: 0 14px;
  }

  .workspace-brand-copy span,
  .cache-status,
  .workspace-actions .button-quiet .icon {
    display: none;
  }

  .workspace-actions .button-quiet {
    min-height: 34px;
    padding-inline: 10px;
    font-size: 11px;
  }

  .workspace-main {
    width: calc(100% - 20px);
    padding-top: 12px;
  }

  .input-panel {
    padding: 14px;
  }

  .panel-heading p {
    display: none;
  }

  .source-input {
    min-height: 175px;
    font-size: 12px;
  }

  .textarea-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding-block: 7px;
  }

  .result-heading {
    padding: 14px;
  }

  .result-toolbar {
    gap: 5px;
  }

  .toolbar-divider,
  #clearDataButton {
    display: none;
  }

  .result-toolbar .button-compact,
  .segment {
    padding-inline: 8px;
  }

  .selection-bar {
    min-height: 42px;
    padding: 0 12px;
  }

  .selection-bar > span {
    display: none;
  }

  .grid-scroll {
    height: 52vh;
    min-height: 310px;
  }

  .empty-result {
    min-height: 250px;
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---- 自建账号工作台 ---- */

.tool-card-workbench .tool-icon {
  color: #9a4e09;
  background: #fff0d8;
}

.workbench-view {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: #f4f7fb;
}

.workbench-header {
  position: sticky;
  z-index: 30;
  top: 0;
  flex: 0 0 auto;
  max-width: none;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.workbench-main {
  width: calc(100% - 32px);
  max-width: 1800px;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 auto;
  padding: 16px 0 92px;
  overflow: auto;
}

.workbench-auth-panel {
  display: grid;
  max-width: 920px;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 28px;
  margin: 48px auto 0;
}

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

.workbench-command,
.workbench-primary-actions,
.workbench-tabs,
.workbench-filters,
.workbench-pagination,
.workbench-page-actions,
.workbench-selection-bar,
.workbench-selection-bar > div {
  display: flex;
  align-items: center;
}

.workbench-command {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.workbench-tabs,
.workbench-primary-actions,
.workbench-page-actions,
.workbench-selection-bar > div {
  gap: 7px;
}

.workbench-selection-bar > div {
  flex-wrap: wrap;
  overflow: visible;
}

.workbench-tabs {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.workbench-tab {
  display: inline-flex;
  height: 34px;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: transparent;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.workbench-tab:hover,
.workbench-tab.is-active {
  border-color: #b9cff5;
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.workbench-tab span {
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 999px;
  color: inherit;
  background: rgba(255, 255, 255, 0.56);
  font-size: 11px;
  text-align: center;
}

.workbench-filters {
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--surface);
}

.workbench-filters select,
.workbench-search {
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--ink-soft);
  background: #fbfcfe;
  font-size: 12px;
}

.workbench-filters select {
  max-width: 150px;
  padding: 0 25px 0 9px;
}

.workbench-search {
  display: flex;
  min-width: 290px;
  align-items: center;
  flex: 1 1 340px;
  gap: 7px;
  padding: 0 10px;
}

.workbench-search .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.workbench-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.workbench-status {
  min-height: 0;
  margin: 7px 2px;
}

.workbench-table-shell {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.workbench-table-scroll {
  min-height: 360px;
  overflow-x: auto;
}

.workbench-table {
  width: 100%;
  min-width: 1480px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  table-layout: fixed;
}

.workbench-table th,
.workbench-table td {
  height: 39px;
  padding: 6px 9px;
  overflow: hidden;
  border-bottom: 1px solid #e8edf4;
  color: var(--ink-soft);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-table th {
  position: sticky;
  z-index: 5;
  top: 0;
  height: 37px;
  color: #415269;
  background: #f4f7fb;
  font-size: 11px;
  font-weight: 780;
}

.workbench-table tbody tr:hover td {
  background: #f8fbff;
}

.workbench-table th:nth-child(1),
.workbench-table td:nth-child(1) {
  width: 46px;
}

.workbench-table th:nth-child(2),
.workbench-table td:nth-child(2) {
  width: 210px;
}

.workbench-table th:nth-child(3),
.workbench-table td:nth-child(3) { width: 165px; }
.workbench-table th:nth-child(4),
.workbench-table td:nth-child(4) { width: 105px; }
.workbench-table th:nth-child(5),
.workbench-table td:nth-child(5),
.workbench-table th:nth-child(6),
.workbench-table td:nth-child(6) { width: 86px; }
.workbench-table th:nth-child(7),
.workbench-table td:nth-child(7) { width: 170px; }
.workbench-table th:nth-child(8),
.workbench-table td:nth-child(8) { width: 100px; }
.workbench-table th:nth-child(9),
.workbench-table td:nth-child(9) { width: 160px; }
.workbench-table th:nth-child(10),
.workbench-table td:nth-child(10) { width: 210px; }
.workbench-table th:nth-child(11),
.workbench-table td:nth-child(11) { width: 220px; }
.workbench-table th:nth-child(12),
.workbench-table td:nth-child(12) { width: 220px; }

.workbench-table th:nth-child(1),
.workbench-table td:nth-child(1),
.workbench-table th:nth-child(2),
.workbench-table td:nth-child(2) {
  position: sticky;
  background: var(--surface);
}

.workbench-table th:nth-child(1),
.workbench-table td:nth-child(1) { z-index: 7; left: 0; }
.workbench-table th:nth-child(2),
.workbench-table td:nth-child(2) {
  z-index: 6;
  left: 46px;
  box-shadow: 1px 0 0 var(--border), 8px 0 15px rgba(15, 31, 54, 0.04);
}
.workbench-table th:nth-child(1),
.workbench-table th:nth-child(2) { z-index: 10; background: #f4f7fb; }

.workbench-account-cell {
  color: var(--ink) !important;
  font-weight: 700;
}

.workbench-select-cell {
  text-align: center !important;
}

.workbench-select-cell input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.workbench-table code {
  color: #334e72;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.workbench-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  color: #536176;
  background: #eef1f6;
  font-size: 11px;
  font-weight: 720;
}

.workbench-badge.is-passed,
.workbench-badge.is-sold { color: #126234; background: #e1f5e8; }
.workbench-badge.is-waiting,
.workbench-badge.is-reviewing { color: #845a00; background: #fff2c7; }
.workbench-badge.is-failed,
.workbench-badge.is-banned,
.workbench-badge.is-invalid,
.workbench-badge.is-unknown { color: #9b2c24; background: var(--danger-soft); }

.workbench-empty {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
}

.workbench-empty .icon { width: 28px; height: 28px; }
.workbench-empty strong { color: var(--ink-soft); }

.workbench-pagination {
  min-height: 48px;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.workbench-selection-bar {
  position: fixed;
  z-index: 40;
  right: 20px;
  bottom: 18px;
  left: 20px;
  min-height: 58px;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px 10px 18px;
  border: 1px solid #a9c4f3;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 48px rgba(25, 57, 106, 0.2);
}

.workbench-selection-bar strong {
  color: var(--accent-ink);
  font-size: 13px;
}

.workbench-dialog {
  width: min(520px, calc(100% - 30px));
  padding: 0;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.workbench-dialog::backdrop { background: rgba(15, 31, 54, 0.38); }
.workbench-dialog form { display: grid; gap: 13px; padding: 20px; }
.workbench-dialog header,
.workbench-dialog footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.workbench-dialog h2 { margin: 0; font-size: 19px; }
.workbench-dialog header p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.workbench-dialog label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 12px; font-weight: 680; }
.workbench-dialog textarea {
  min-height: 78px;
  padding: 9px 11px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
}
.workbench-import-dialog { width: min(720px, calc(100% - 30px)); }
.workbench-import-text { min-height: 260px !important; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.workbench-import-summary { min-height: 22px; color: var(--accent-ink); font-size: 13px; }
.workbench-reset-warning { margin: -3px 0 0; padding: 8px 10px; border-radius: 8px; color: #845a00; background: #fff5d6; font-size: 12px; }

@media (max-width: 900px) {
  .workbench-command { align-items: flex-start; flex-direction: column; }
  .workbench-primary-actions { flex-wrap: wrap; }
  .workbench-auth-panel { grid-template-columns: minmax(0, 1fr); }
  .workbench-selection-bar { align-items: flex-start; flex-direction: column; }
  .workbench-selection-bar > div { width: 100%; overflow: visible; }
}

@media (max-width: 700px) {
  .workbench-main { width: calc(100% - 20px); padding-top: 10px; }
  .workbench-search { min-width: 100%; }
  .workbench-filters select { flex: 1 1 130px; max-width: none; }
  .workbench-pagination { align-items: stretch; flex-wrap: wrap; }
  .workbench-pagination > span:nth-child(2) { order: -1; width: 100%; }
  .workbench-selection-bar { right: 8px; bottom: 8px; left: 8px; }
}

/* ---- Mail.com 批量登录 ---- */

.tool-card-mail .tool-icon {
  color: #7c3aed;
  background: #f3ecff;
}

.mail-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mail-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 16px;
  align-items: start;
}

.mail-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-top: 14px;
}

.mail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.mail-input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.mail-input:focus {
  border-color: #76a4f8;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11);
}

.mail-input-narrow {
  width: 72px;
}

.mail-results,
.mail-inbox-panel,
.mail-search-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(24, 45, 75, 0.035);
}

.mail-results {
  overflow: hidden;
}

.mail-account-list {
  display: flex;
  max-height: 420px;
  flex-direction: column;
  gap: 6px;
  padding: 0 16px 16px;
  overflow: auto;
}

.mail-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.mail-account-row:hover {
  border-color: var(--border-strong);
  background: #f3f7fc;
}

.mail-account-main {
  min-width: 0;
}

.mail-account-main strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-account-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.mail-pill {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.mail-pill.is-alive {
  color: var(--success);
  background: #e8f7ee;
}

.mail-pill.is-dead {
  color: var(--danger);
  background: var(--danger-soft);
}

.mail-pill.is-blocked {
  color: #b45309;
  background: #fff4e5;
}

.mail-pill.is-error,
.mail-pill.is-pending {
  color: var(--ink-soft);
  background: #eef1f6;
}

.mail-pill.is-refund {
  color: #0b7a3b;
  background: #d9f5e3;
  font-weight: 750;
}

.mail-pill.is-norefund {
  color: var(--muted);
  background: #eef1f6;
}

.text-refund {
  color: var(--success);
}

.messages-keywords {
  margin-left: 6px;
  padding: 1px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef1f6;
  font-size: 11px;
  font-weight: 700;
}

.messages-keywords.is-refund {
  color: #0b7a3b;
  background: #d9f5e3;
}

.mail-message-row.is-matched {
  border-color: #7fd3a3;
  background: #f0fbf4;
}

.mail-message-row.is-matched:hover {
  border-color: var(--success);
}

.mail-message-head {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.mail-message-head strong {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-tag-refund,
.mail-tag-nobody {
  flex: 0 0 auto;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.mail-tag-refund {
  color: #0b7a3b;
  background: #d9f5e3;
}

.mail-tag-nobody {
  color: var(--muted);
  background: #eef1f6;
}

.mail-empty {
  padding: 20px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.mail-inbox-panel {
  padding: 16px;
}

.mail-inbox-split {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: 12px;
  margin-top: 14px;
}

.mail-message-list {
  display: flex;
  max-height: 480px;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
}

.mail-message-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  cursor: pointer;
  text-align: left;
}

.mail-message-row:hover {
  border-color: var(--border-strong);
}

.mail-message-row.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.mail-message-row strong,
.mail-message-row span,
.mail-message-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-message-row strong {
  font-size: 13px;
}

.mail-message-row span,
.mail-message-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.mail-message-detail {
  min-height: 380px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.mail-preview {
  display: block;
  width: 100%;
  height: 480px;
  border: 0;
}

.mail-search-panel {
  padding: 16px;
}

.mail-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.mail-search-email {
  flex: 2 1 220px;
}

.mail-search-keyword,
.mail-search-regex {
  flex: 1 1 140px;
}

.mail-search-result {
  min-height: 24px;
  margin-top: 12px;
  font-size: 14px;
}

.mail-search-hit {
  color: var(--success);
}

.mail-search-miss {
  color: var(--muted);
}

.mail-search-hit code {
  margin-left: 6px;
  padding: 3px 10px;
  border: 0;
  color: #174ea6;
  background: var(--accent-soft);
  font-size: 14px;
  font-weight: 700;
}

/* 关键词徽章 */
.mail-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 9px;
  border-radius: 999px;
  color: #174ea6;
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
}

.mail-badge-refund {
  color: var(--success);
  background: #e8f7ee;
}

.mail-input-keywords {
  width: 150px;
}

/* 添加账号面板 */
.mail-add-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.mail-add-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mail-add-title {
  font-size: 13px;
  font-weight: 700;
}

.mail-add-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.mail-add-body .mail-input[data-role="add-email"] {
  flex: 2 1 200px;
}

.mail-add-body .mail-input[data-role="add-password"] {
  flex: 1 1 160px;
}

.mail-add-textarea {
  min-height: 76px;
}

.mail-add-panel .parse-message {
  margin-top: 8px;
}

/* 状态图例 */
.mail-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 10px 16px 14px;
  color: var(--muted);
  font-size: 11px;
}

.mail-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.legend-dot.is-refund {
  background: #0b7a3b;
}

.legend-dot.is-norefund {
  background: #b8c2cf;
}

.legend-dot.is-dead {
  background: var(--danger);
}

.legend-dot.is-blocked {
  background: #d97706;
}

.legend-dot.is-ratelimited {
  background: #f59e0b;
}

.legend-dot.is-error {
  background: var(--muted);
}

@media (max-width: 900px) {
  .mail-layout,
  .mail-inbox-split {
    grid-template-columns: 1fr;
  }
}

/* ---- 账号监控 ---- */

.tool-card-monitor .tool-icon {
  color: #a65309;
  background: #fff1dc;
}

[data-tool="account-monitor"] {
  --monitor-label: #526178;
}

.monitor-workspace,
.monitor-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
}

.monitor-auth-panel {
  width: min(620px, 100%);
  margin: 8vh auto 0;
  padding: 28px;
}

.monitor-auth-copy {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.monitor-auth-copy h2,
.monitor-empty h3 {
  margin: 0;
}

.monitor-auth-copy p,
.monitor-empty p {
  margin: 6px 0 0;
  color: var(--monitor-label);
}

.monitor-auth-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  color: var(--accent);
  background: var(--accent-soft);
}

.monitor-login-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 24px;
}

.monitor-login-form label {
  font-size: 12px;
  font-weight: 720;
}

.monitor-login-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.monitor-login-controls .mail-input {
  min-width: 0;
}

.monitor-login-message {
  min-height: 22px;
}

.monitor-connection-status {
  color: var(--monitor-label);
}

.monitor-connection-status[data-connection="connecting"] .status-dot,
.monitor-connection-status[data-connection="reconnecting"] .status-dot {
  background: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.14);
}

.monitor-connection-status[data-connection="offline"] .status-dot {
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.14);
}

.monitor-overview-panel {
  padding: 16px 18px;
}

.monitor-section-heading {
  padding: 0;
}

.monitor-section-heading p,
.monitor-records-heading p {
  color: var(--monitor-label);
}

.monitor-sync-status {
  max-width: 320px;
  color: var(--monitor-label);
  font-size: 11px;
  text-align: right;
}

.monitor-live-statuses {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

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

.monitor-daily-summary {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(30, 64, 175, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(37, 99, 235, 0.06);
}

.monitor-daily-total {
  flex: 0 0 auto;
  color: #153e8a;
  font-size: 17px;
}

.monitor-daily-cutoff {
  flex: 0 0 auto;
  color: var(--monitor-label);
  font-size: 10px;
}

.monitor-person-counts {
  display: flex;
  min-width: 0;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.monitor-person-count {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(30, 64, 175, 0.09);
  color: #173b79;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.monitor-overview-item,
.monitor-overview-empty {
  min-width: 0;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.monitor-overview-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.monitor-overview-item span {
  color: var(--monitor-label);
  font-size: 11px;
}

.monitor-overview-item strong {
  overflow-wrap: anywhere;
  font-size: 16px;
}

.monitor-overview-empty {
  grid-column: 1 / -1;
  color: var(--monitor-label);
}

.monitor-unread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #b9d0f2;
  border-radius: var(--radius-sm);
  color: #174ea6;
  background: #edf5ff;
  font-weight: 700;
}

.monitor-records {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(24, 45, 75, 0.035);
}

.monitor-records-heading {
  align-items: center;
}

.monitor-page-label {
  flex: 0 0 auto;
  color: var(--monitor-label);
  font-size: 12px;
  font-weight: 720;
}

.monitor-action-status {
  min-height: 0;
  margin-inline: 18px;
}

.monitor-error {
  margin: 0 18px 18px;
  padding: 12px 14px;
  border: 1px solid #efbbb5;
  border-radius: var(--radius-sm);
  color: #9b2c24;
  background: var(--danger-soft);
}

.monitor-empty {
  display: flex;
  min-height: 230px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 28px;
  text-align: center;
}

.monitor-card-list {
  display: grid;
  min-width: 0;
  align-items: start;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px 18px;
}

.monitor-card {
  display: grid;
  min-width: 0;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.monitor-card.is-in-use {
  border-color: #d6a100;
  background: #fff3bf;
}

.monitor-card.is-completed {
  border-color: #dc4c2f;
  background: #ffe0d5;
}

.monitor-card.is-archived {
  border-color: #69ad7d;
  background: #e5f6ea;
}

.monitor-card.is-refund-pending {
  border-color: #d6a100;
  background: #fff3bf;
}

.monitor-card.is-refund-refunded {
  border-color: #69ad7d;
  background: #e5f6ea;
}

.monitor-card-header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  grid-column: 1 / -1;
  gap: 10px;
}

.monitor-card-identity {
  min-width: 0;
}

.monitor-card-header h3 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #123f78;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.2;
}

.monitor-card-identity p {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: #44556d;
  font-size: 13px;
  font-weight: 700;
}

.monitor-status-badge {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: #455468;
  background: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 800;
}

.monitor-status-badge.is-in-use {
  color: #745b00;
}

.monitor-status-badge.is-completed {
  color: #8a4600;
}

.monitor-status-badge.is-archived {
  color: #176433;
}

.monitor-status-badge.is-refund-pending {
  color: #694f00;
}

.monitor-status-badge.is-refund-refunded {
  color: #185b30;
}

.monitor-card-meta {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-self: end;
  grid-column: 1;
  gap: 4px 10px;
  margin: 0;
}

.monitor-card-meta > div {
  min-width: 0;
}

.monitor-card-meta > div:nth-child(n + 3) {
  display: none;
}

.monitor-card-meta dt {
  color: var(--monitor-label);
  font-size: 11px;
  font-weight: 750;
}

.monitor-card-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 650;
}

.monitor-card-primary {
  display: grid;
  min-width: 0;
  align-items: stretch;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.monitor-card-primary > :only-child {
  grid-column: 1 / -1;
}

.monitor-card-primary:has(> .monitor-five-hour:nth-child(2):last-child) .monitor-usage-elapsed {
  grid-column: 1 / -1;
}

.monitor-usage-elapsed {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.68);
}

.monitor-usage-elapsed > div {
  display: flex;
  height: 100%;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.monitor-usage-elapsed dt {
  color: #3f5066;
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

.monitor-usage-elapsed dd {
  margin: 0;
  color: #163d7a;
  font-size: clamp(20px, 1.5vw, 26px);
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1;
}

.monitor-five-hour {
  order: -1;
  grid-column: 1 / -1;
  padding: 8px 10px;
  border: 1px solid rgba(99, 115, 137, 0.2);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.7);
}

.monitor-five-hour-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-direction: row;
  gap: 10px;
}

.monitor-five-hour-heading > span:first-child {
  color: var(--monitor-label);
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

.monitor-five-hour-heading strong {
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.monitor-five-hour-progress {
  height: 12px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #c7d2e0;
  box-shadow: inset 0 0 0 1px rgba(30, 64, 175, 0.12);
}

.monitor-five-hour-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #1d4ed8;
  transition: width 240ms ease, background 180ms ease;
}

.monitor-usage-windows {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  color: var(--monitor-label);
  font-size: 11px;
  font-weight: 750;
}

.monitor-session-key {
  display: grid;
  min-width: 0;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid rgba(99, 115, 137, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.66);
}

.monitor-card-footer {
  display: grid;
  min-width: 0;
  align-items: center;
  align-self: end;
  grid-column: 2;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.monitor-card .monitor-session-key {
  display: none;
}

.monitor-card-footer:not(:has(.monitor-card-actions)) {
  display: none;
}

.monitor-card-footer:has(.monitor-card-actions) {
  grid-template-columns: auto;
}

.monitor-card-footer:has(.monitor-card-actions) .monitor-card-actions {
  grid-column: 1;
}

.monitor-card:not(:has(.monitor-card-actions)) .monitor-card-meta {
  grid-column: 1 / -1;
}

.monitor-card-footer > :only-child {
  grid-column: 1 / -1;
}

.monitor-session-key > span:first-child {
  color: var(--monitor-label);
  font-size: 10px;
  font-weight: 720;
}

.monitor-session-key code {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.monitor-session-actions,
.monitor-card-actions,
.monitor-pagination {
  display: flex;
  align-items: center;
  gap: 7px;
}

.monitor-card-actions {
  justify-content: flex-end;
}

.monitor-sentinel {
  padding: 2px 18px 18px;
  text-align: center;
}

.monitor-pagination {
  justify-content: flex-end;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

/* PC 数据大屏：强化远距离扫读，同时保持基础卡片规则可复用。 */
[data-tool="account-monitor"] .monitor-card {
  gap: 7px 10px;
  padding: 10px;
}

[data-tool="account-monitor"] .monitor-card-header h3 {
  font-size: 24px;
}

[data-tool="account-monitor"] .monitor-usage-elapsed dd {
  font-size: clamp(24px, 1.65vw, 28px);
}

[data-tool="account-monitor"] .monitor-five-hour-heading strong {
  font-size: 34px;
}

[data-tool="account-monitor"] .monitor-five-hour-progress {
  height: 14px;
  margin-top: 5px;
}

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

@media (max-width: 700px) {
  .monitor-connection-status {
    display: inline-flex;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .monitor-auth-panel {
    margin-top: 18px;
  }

  .monitor-login-controls,
  .monitor-card-list,
  .monitor-card-meta,
  .monitor-card-primary,
  .monitor-card-footer,
  .monitor-overview {
    grid-template-columns: minmax(0, 1fr);
  }

  .monitor-section-heading,
  .monitor-unread {
    align-items: flex-start;
    flex-direction: column;
  }

  .monitor-sync-status {
    text-align: left;
  }

  .monitor-card-list {
    padding-inline: 12px;
  }

  .monitor-session-key {
    align-items: flex-start;
    grid-template-columns: minmax(0, 1fr);
  }

  .monitor-session-actions {
    flex-wrap: wrap;
  }

  .monitor-pagination {
    justify-content: stretch;
  }

  .monitor-pagination .button {
    flex: 1 1 0;
  }
}

/* Account workbench: focused data entry and persistent extraction batches. */
.workbench-flow-hint { margin: 4px 0 12px; color: var(--ink-soft); font-size: 13px; }
.workbench-missing-toggle { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; }
.workbench-missing-toggle input { accent-color: var(--accent); }
.workbench-copy-source { display: block; margin-top: 5px; padding: 0; color: var(--accent-ink); background: transparent; font-size: 12px; cursor: pointer; }
.workbench-sk-entry { display: flex; align-items: center; gap: 6px; min-width: 260px; }
.workbench-sk-entry input { width: 205px; height: 34px; border: 1px solid var(--border); border-radius: 7px; padding: 0 9px; background: var(--surface); font-size: 12px; }
.workbench-sk-entry input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.workbench-flow-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px 16px; margin: 12px 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.workbench-flow-tools > div { display: grid; gap: 5px; margin-right: auto; }
.workbench-flow-tools strong { font-size: 14px; }
.workbench-flow-tools span { font-size: 12px; color: var(--ink-soft); }
.workbench-flow-tools label { font-size: 13px; }
.workbench-flow-tools input { width: 82px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; }
.workbench-batch-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 4px; }
.workbench-batch-tab { display: grid; gap: 5px; min-width: 138px; text-align: left; padding: 10px 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); cursor: pointer; }
.workbench-batch-tab strong { font-size: 13px; }
.workbench-batch-tab span { color: var(--ink-soft); font-size: 12px; }
.workbench-batch-tab.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.workbench-batch-summary { color: var(--ink-soft); font-size: 12px; margin: 10px 0; }
.workbench-extraction-dialog { padding: 20px; width: min(760px, calc(100vw - 28px)); overflow: visible; }
.workbench-extraction-dialog > header, .workbench-extraction-dialog > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; overflow: visible; }
.workbench-extraction-dialog > header { margin-bottom: 18px; }
.workbench-extraction-dialog > footer { justify-content: flex-end; margin-top: 16px; position: relative; z-index: 2; }
.workbench-combo {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
}
.workbench-combo input,
.workbench-combo .workbench-inline-field,
.workbench-combo .mail-input,
.workbench-combo .workbench-extraction-label {
  min-width: 0;
  min-height: 34px;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0 4px 0 10px;
}
.workbench-combo-filter { min-height: 34px; background: #fbfcfe; }
.workbench-combo-filter input { width: 118px; min-height: 32px; font-size: 12px; color: var(--ink-soft); }
.workbench-combo-maker input,
.workbench-combo-maker .workbench-inline-field { width: 168px; }
.workbench-combo-label { width: 176px; }
.workbench-combo-label input { width: 100%; }
.workbench-combo-toggle {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-right: 4px;
  border: 0;
  border-radius: 6px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%235b6b82' d='M4.3 6.3a1 1 0 0 1 1.4 0L8 8.6l2.3-2.3a1 1 0 1 1 1.4 1.4l-3 3a1 1 0 0 1-1.4 0l-3-3a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E") center no-repeat;
  background-size: 16px;
  cursor: pointer;
}
.workbench-combo.is-open { border-color: #9bb6e3; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.workbench-combo-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 31, 54, 0.14);
}
.workbench-combo.is-drop-up .workbench-combo-menu,
.workbench-dialog .workbench-combo-menu {
  top: auto;
  bottom: calc(100% + 6px);
}
.workbench-combo-float {
  z-index: 80;
}
.workbench-combo-inline {
  width: 100%;
  min-height: 32px;
  border-color: transparent;
  background: transparent;
}
.workbench-combo-inline input,
.workbench-combo-inline .workbench-inline-field {
  width: 100%;
  min-height: 30px;
  padding-left: 6px;
}
.workbench-combo-inline.is-open,
.workbench-combo-inline:focus-within {
  border-color: #9bb6e3;
  background: #fff;
}
.workbench-source-editor .workbench-combo {
  width: 100%;
}
.workbench-combo-menu button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 7px;
  padding: 8px 10px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.workbench-combo-menu button:hover,
.workbench-combo-menu button.is-active { background: #eef4fb; color: var(--accent-ink); }
.workbench-combo-menu .is-empty,
.workbench-combo-menu .is-create {
  color: var(--muted);
  font-size: 12px;
}
.workbench-selection-bar [data-role="workbench-bulk-maker"] { width: 168px; background: transparent; }
.workbench-extraction-dialog > label, .workbench-extraction-body > label { display: grid; gap: 8px; margin-top: 16px; font-size: 13px; }
.workbench-sale-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 12px;
}
.workbench-sale-options label {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  color: #5b6b82;
}
.workbench-sale-options select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  padding: 0 8px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.workbench-sale-options .workbench-combo { width: 100%; background: #fff; }
.workbench-sale-options .workbench-combo input { width: 100%; font-size: 13px; }
@media (max-width: 720px) {
  .workbench-sale-options { grid-template-columns: 1fr; }
}
.workbench-dialog .workbench-extraction-text { width: 100%; min-height: 270px; resize: vertical; white-space: pre; overflow: auto; font: 12px/1.8 ui-monospace, monospace; }

.workbench-details-dialog { padding: 20px; width: min(680px, calc(100% - 30px)); }
.workbench-details-dialog > header { margin-bottom: 16px; }
.workbench-details-dialog > footer { margin-top: 16px; }
.workbench-exception-dialog { width: min(460px, calc(100% - 30px)); overflow: hidden; }
.workbench-exception-body { display: grid; gap: 12px; min-width: 0; }
.workbench-exception-body label,
.workbench-exception-body select,
.workbench-exception-note { min-width: 0; width: 100%; box-sizing: border-box; }
.workbench-exception-note { min-height: 88px; }
.workbench-exception-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.workbench-exception-dialog footer { justify-content: flex-end; align-items: center; }
.workbench-source-field { padding: 10px 0; border-bottom: 1px solid var(--border); }
.workbench-source-field:last-child { border-bottom: 0; }
.workbench-source-line, .workbench-source-totp { display: flex; align-items: center; gap: 12px; }
.workbench-source-value { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, monospace; }
.workbench-source-totp { flex-wrap: wrap; margin-top: 12px; color: var(--muted); }
.workbench-source-totp strong { color: var(--ink); font: 700 25px ui-monospace, monospace; letter-spacing: 3px; }

.workbench-inline-field { width: 100%; min-width: 0; border: 1px solid transparent; border-radius: 5px; background: transparent; padding: 7px 5px; color: inherit; font: inherit; }
.workbench-inline-field:hover { border-color: var(--border); background: var(--surface); }
.workbench-inline-field:focus { border-color: var(--accent); background: var(--surface); outline: none; }

/* Account workflow: keep daily production fields together. */
.workbench-table { min-width: 1080px; table-layout: fixed; }
.workbench-table th:nth-child(n), .workbench-table td:nth-child(n) { width: auto; }
.workbench-table th:nth-child(1), .workbench-table td:nth-child(1) { width: 38px; }
.workbench-table th:nth-child(2), .workbench-table td:nth-child(2) { width: 210px; left: 38px; }
.workbench-table th:nth-child(3), .workbench-table td:nth-child(3) { width: 220px; }
.workbench-table th:nth-child(4), .workbench-table td:nth-child(4) { width: 160px; }
.workbench-table th:nth-child(5), .workbench-table td:nth-child(5) { width: 190px; }
.workbench-table th:nth-child(6), .workbench-table td:nth-child(6) { width: 110px; }
.workbench-table th:nth-child(7), .workbench-table td:nth-child(7) { width: 100px; }
.workbench-table th:nth-child(8), .workbench-table td:nth-child(8) { width: 140px; }
.workbench-account-cell strong { display:block; overflow-wrap:anywhere; }
.workbench-account-id { display:block; color:#718096; font-size:11px; }
.workbench-row-actions { display:flex; flex-wrap:wrap; gap:3px; }
.workbench-row-actions .button { padding:5px; }
.workbench-field-status { display:block; border:0; padding:3px 0; background:none; color:#64748b; font-size:11px; text-align:left; min-height:18px; }
.workbench-field-status:empty { min-height:0; padding:0; }
.workbench-field-status[data-kind="success"] { color:#28704f; }
.workbench-field-status[data-kind="error"] { color:#b43b38; cursor:pointer; }
.workbench-row-details summary, .workbench-more-filters summary { cursor:pointer; white-space:nowrap; color:#475569; }
.workbench-row-details dl { font-size:12px; white-space:normal; }
.workbench-row-details dd { margin:0 0 7px; overflow-wrap:anywhere; }
.workbench-more-filters { position:relative; }
.workbench-more-filters > div { position:absolute; top:32px; right:0; z-index:30; width:260px; padding:14px; display:grid; gap:8px; border:1px solid #dce3ee; border-radius:12px; background:white; box-shadow:0 12px 30px #14274c20; }
.workbench-filters { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.workbench-sold-dates {
  display: none;
  align-items: center;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 8px;
}
.workbench-sold-dates:not([hidden]) { display: flex; }
.workbench-sold-date-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.workbench-sold-date-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
}
.workbench-sold-date-tag span { color: var(--muted); font-size: 12px; }
.workbench-sold-date-tag.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.workbench-sold-date-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.workbench-sold-date-range select { max-width: 168px; }
.workbench-stats { display: none; gap: 14px; padding: 4px 0 16px; }
.workbench-stats:not([hidden]) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.workbench-stats-block {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}
.workbench-stats-block:hover,
.workbench-stats-block:focus-visible { border-color: var(--accent); }
.workbench-stats-open { margin: 0 0 8px; color: var(--accent-ink); font-size: 12px; }
.workbench-stats-block header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.workbench-stats-block h3 { margin: 0; font-size: 15px; }
.workbench-stats-block header span { color: var(--muted); font-size: 12px; }
.workbench-stats-block ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.workbench-stats-block li { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.workbench-stats-empty { margin: 0; color: var(--muted); font-size: 13px; }
.workbench-maker-cell { position: relative; overflow: visible; }
.workbench-maker-crowns {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 2;
}
.workbench-stats-block .workbench-maker-crowns { position: static; transform: none; margin-left: 4px; vertical-align: middle; }
.workbench-maker-crown {
  display: block;
  width: 12px;
  height: 12px;
  background-repeat: no-repeat;
  background-size: 12px 12px;
}
.workbench-maker-crown.is-gold {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23E3B341' d='M2.2 12.2h11.6L12.8 6.4 10 8.8 8 3.6 6 8.8 3.2 6.4z'/%3E%3C/svg%3E");
}
.workbench-maker-crown.is-silver {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23B8C0CC' d='M2.2 12.2h11.6L12.8 6.4 10 8.8 8 3.6 6 8.8 3.2 6.4z'/%3E%3C/svg%3E");
}
@media (max-width: 1200px) {
  .workbench-stats:not([hidden]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .workbench-stats:not([hidden]) { grid-template-columns: 1fr; }
}
.workbench-report-dialog { width: min(1100px, calc(100% - 24px)); max-height: calc(100vh - 24px); padding: 0; }
.workbench-report-dialog header { padding: 16px 18px 10px; }
.workbench-report-actions { display: flex; align-items: center; gap: 8px; }
.workbench-report-drag {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f4f7fb;
  cursor: grab;
}
.workbench-report-download { display: inline-flex; align-items: center; gap: 6px; }
.workbench-report-viewport {
  overflow: hidden;
  height: min(72vh, 820px);
  margin: 0 18px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #eef2f7;
  cursor: grab;
  touch-action: none;
}
.workbench-report-viewport.is-panning { cursor: grabbing; }
.workbench-report-viewport img {
  display: block;
  max-width: none;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
}
.workbench-search { flex:1 1 240px; }
.workbench-filters > select { width:auto; max-width:180px; }
.workbench-flow-tools select { min-height:36px; border:1px solid #dce3ee; border-radius:8px; padding:7px; background:white; }
.workbench-selection-bar [data-role="workbench-bulk-maker"] { width:168px; background:transparent; }
[data-role="workbench-source-dialog"] { width:min(950px,calc(100vw - 32px)); }
.workbench-source-hint { margin:0 0 8px; color:var(--muted); font-size:12px; }
.workbench-source-workspace { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(240px,1fr); gap:16px; align-items:start; }
.workbench-source-workspace > [data-role="workbench-source-fields"] { min-width:0; padding:4px 12px; border:1px solid #e4ebf3; border-radius:12px; background:#fff; }
.workbench-source-editor { display:grid; align-content:start; gap:12px; min-width:0; padding:14px; background:#f5f7fb; border:1px solid #e4ebf3; border-radius:12px; }
.workbench-source-editor label { display:grid; gap:6px; font-size:13px; font-weight:600; }
.workbench-source-editor textarea { min-height:72px; width:100%; box-sizing:border-box; }
.workbench-confirm-results { max-height:240px; overflow:auto; border:1px solid #eed3ac; border-radius:10px; padding:12px; }
.workbench-confirm-results p { margin:0 0 12px; }
.workbench-confirm-results span { display:block; color:#8c5c24; font-size:12px; margin-top:4px; }
[data-role="workbench-extraction-dialog"]:has(.workbench-confirm-results:not([hidden])) .workbench-extraction-text { height:70px; min-height:70px; }
@media(max-width:700px) {
 .workbench-source-workspace { grid-template-columns:1fr; gap:12px; }
 .workbench-source-editor { padding:12px; }
 .workbench-more-filters > div { left:0; right:auto; }
 .workbench-table th:nth-child(2), .workbench-table td:nth-child(2) { width:175px; }
 .workbench-flow-tools { gap:8px; }
}

/* Fill the available window and keep account work comfortably readable. */
.workbench-main { width:calc(100% - 24px); max-width:none; }
.workbench-selection-bar { left:12px; right:12px; max-width:none; width:auto; transform:none; }
.workbench-table { min-width:1200px; font-size:14px; }
.workbench-table th { font-size:13px; }
.workbench-table code { font-size:13px; }
.workbench-table th:nth-child(n), .workbench-table td:nth-child(n) { width:auto; }
.workbench-table th:nth-child(1), .workbench-table td:nth-child(1) { width:40px; }
.workbench-table th:nth-child(2), .workbench-table td:nth-child(2) { width:210px; left:40px; }
.workbench-table th:nth-child(3), .workbench-table td:nth-child(3) { width:96px; }
.workbench-table th:nth-child(5), .workbench-table td:nth-child(5) { width:150px; }
.workbench-table th:nth-child(6), .workbench-table td:nth-child(6) { width:180px; }
.workbench-table th:nth-child(7), .workbench-table td:nth-child(7) { width:96px; }
.workbench-table th:nth-child(8), .workbench-table td:nth-child(8) { width:84px; }
.workbench-table th:nth-child(9), .workbench-table td:nth-child(9) { width:90px; }
.workbench-table th:nth-child(10), .workbench-table td:nth-child(10) { width:125px; }
.workbench-sk-value { display:block; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.6; user-select:text; }
.workbench-account-type { color:#47638b; background:#edf3fb; border-radius:5px; padding:3px 6px; font-size:13px; }
.workbench-view .workbench-inline-field, .workbench-view .workbench-sk-entry input { font-size:14px; }
.workbench-view .workbench-tab, .workbench-view .workbench-filters select, .workbench-view .workbench-search input { font-size:14px; }
.workbench-view .button-compact, .workbench-flow-hint, .workbench-field-status, .workbench-pagination { font-size:13px; }
.workbench-view .workbench-source-editor label { font-size:14px; }
.workbench-view .workbench-source-editor input, .workbench-view .workbench-source-editor textarea { font-size:14px; }
.workbench-account-id { font-size:12px; }
@media(max-width:700px) {
 .workbench-main { width:calc(100% - 16px); }
 .workbench-selection-bar { left:8px; right:8px; }
 .workbench-table th:nth-child(2), .workbench-table td:nth-child(2) { width:175px; }
}

/* Compact workbench rows: full keys stay selectable without wrapping. */
.workbench-table { min-width:1400px; }
.workbench-table th:nth-child(4), .workbench-table td:nth-child(4) { width:280px; }
.workbench-table th:nth-child(6), .workbench-table td:nth-child(6) { width:auto; min-width:180px; }
.workbench-sk-display { display:flex; align-items:center; gap:8px; min-width:0; }
.workbench-sk-display > .button { flex:none; }
.workbench-table .workbench-sk-value { flex:1; min-width:0; max-width:100%; white-space:nowrap; overflow-wrap:normal; overflow-x:auto; line-height:24px; scrollbar-width:thin; }
.workbench-sk-entry { min-width:0; }
.workbench-sk-entry input { width:0; min-width:0; flex:1; }
.workbench-sk-entry .button { flex:none; }
.workbench-account-cell strong { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.workbench-account-id { display:inline; margin-right:6px; }
.workbench-account-cell .workbench-copy-source { display:inline-flex; align-items:center; justify-content:center; min-height:30px; margin-top:4px; padding:4px 10px; border:1px solid #c5d8ee; border-radius:7px; background:#eaf2fc; color:#245c99; font-size:13px; font-weight:600; }
.workbench-account-cell .workbench-copy-source:hover { background:#dceafb; border-color:#91b4df; }
.workbench-table tbody tr:nth-child(odd) td { background:#fff; }
.workbench-table tbody tr:nth-child(even) td { background:#f0f4f9; }
.workbench-table tbody tr:hover td { background:#e6eef9; }
.workbench-sync-status { font-size:12px; color:#526882; }

.workbench-account-heading { display:flex; align-items:center; gap:4px; min-width:0; }
.workbench-account-heading .workbench-account-id { flex:none; }
.workbench-account-heading strong { min-width:0; }
.workbench-table th:nth-child(10), .workbench-table td:nth-child(10) { width:150px; }

/* Balance widths across daily account work; notes no longer absorb spare space. */
.workbench-table th:nth-child(1), .workbench-table td:nth-child(1) { width:3%; }
.workbench-table th:nth-child(2), .workbench-table td:nth-child(2) { width:20%; left:42px; }
.workbench-table th:nth-child(3), .workbench-table td:nth-child(3) { width:7%; }
.workbench-table th:nth-child(4), .workbench-table td:nth-child(4) { width:18%; }
.workbench-table th:nth-child(5), .workbench-table td:nth-child(5) { width:8%; }
.workbench-table th:nth-child(6), .workbench-table td:nth-child(6) { width:10%; min-width:0; }
.workbench-table th:nth-child(7), .workbench-table td:nth-child(7) { width:16%; }
.workbench-table th:nth-child(8), .workbench-table td:nth-child(8) { width:6%; }
.workbench-table th:nth-child(9), .workbench-table td:nth-child(9) { width:8%; }
.workbench-table th:nth-child(10), .workbench-table td:nth-child(10) { width:14%; }
.workbench-stage-cell { white-space:nowrap !important; overflow:hidden; }
.workbench-table[data-stage="exception"] .workbench-stage-cell { white-space:normal !important; }
.workbench-stage-cell .workbench-badge { white-space:nowrap; line-height:1.5; font-size:13px; padding:5px 9px; }
.workbench-badge.is-waiting { color:#936005; background:#fff0c8; }
.workbench-badge.is-reviewing { color:#235ab0; background:#e5efff; }
.workbench-badge.is-passed { color:#19633e; background:#dff4e7; }
.workbench-badge.is-failed, .workbench-badge.is-banned, .workbench-badge.is-invalid { color:#ab3232; background:#fde5e5; }
.workbench-badge.is-unknown, .workbench-badge.is-unchecked { color:#546071; background:#e9edf2; }

.workbench-table th:nth-child(1), .workbench-table td:nth-child(1) { width:40px; }
.workbench-table th:nth-child(2), .workbench-table td:nth-child(2) { left:40px; }
.workbench-badge.is-exception { color:#ad3535; background:#fce3e3; overflow-wrap:anywhere; }

/* All accounts is a single-line editing surface, including exceptions. */
.workbench-account-open { width:100%; border:0; background:transparent; color:inherit; text-align:left; padding:0; cursor:pointer; font:inherit; }
.workbench-account-open:hover strong { color:var(--accent); text-decoration:underline; }
.workbench-account-open:focus-visible { outline:2px solid var(--accent); outline-offset:3px; border-radius:3px; }
.workbench-account-heading .workbench-account-id { font-size:15px; font-weight:800; color:#334e72; }
.workbench-table[data-stage="all"] td { height:48px; padding-top:5px; padding-bottom:5px; position:relative; white-space:nowrap !important; }
.workbench-table[data-stage="all"] td:nth-child(1), .workbench-table[data-stage="all"] td:nth-child(2) { position:sticky; }
.workbench-table[data-stage="all"] .workbench-row-actions { flex-wrap:nowrap; gap:3px; }
.workbench-table[data-stage="all"] .workbench-row-actions .button { flex:none; padding:5px 6px; }
.workbench-table[data-stage="all"] .workbench-stage-cell .workbench-badge { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.workbench-table[data-stage="all"] .workbench-field-status { position:absolute; right:3px; top:calc(50% - 4px); width:8px; height:8px; min-height:0; padding:0; overflow:hidden; font-size:0; border-radius:50%; background:#7a8ca3; }
.workbench-table[data-stage="all"] .workbench-field-status:empty { display:none; }
.workbench-table[data-stage="all"] .workbench-field-status[data-kind="success"] { background:#329466; }
.workbench-table[data-stage="all"] .workbench-field-status[data-kind="error"] { background:#d04949; cursor:pointer; }
.workbench-table[data-stage="all"] .workbench-remark-cell { overflow:hidden; text-overflow:ellipsis; }
.workbench-kyc-progress { display:flex; align-items:center; gap:12px; margin:10px 0; font-size:13px; color:#265ca4; }
.workbench-kyc-progress[hidden] { display:none; }
.workbench-kyc-progress progress { width:min(320px,40%); height:10px; accent-color:#2563eb; }
.workbench-kyc-row-progress { display:block; color:#2563eb; font-size:12px; margin-top:3px; white-space:nowrap; }
.workbench-kyc-status { display:inline-flex; align-items:center; gap:6px; max-width:100%; vertical-align:middle; }
.workbench-kyc-status > * { flex:none; }
.workbench-kyc-link-open {
  flex:none;
  height:24px;
  padding:0 8px;
  border:0;
  border-radius:999px;
  background:#dff4e7;
  color:#19633e;
  font:inherit;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}
.workbench-kyc-link-open:hover { color:#11492c; background:#c8ecd6; }
.workbench-kyc-card-tag {
  flex:none;
  height:24px;
  padding:0 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  line-height:24px;
  white-space:nowrap;
}
.workbench-kyc-card-tag.is-none { background:#e8f1ff; color:#1d4f91; }
.workbench-kyc-card-tag.is-card { background:#fff3d6; color:#8a5a00; }
.workbench-table[data-pay-ui-column="true"] { min-width:1680px; }
.workbench-table[data-pay-ui-column="true"] th:nth-child(7),
.workbench-table[data-pay-ui-column="true"] td:nth-child(7) {
  width: 248px;
  min-width: 248px;
  overflow: hidden;
}
.workbench-kyc-row-progress[hidden] { display:none; }
.button.is-loading::before, .is-kyc-running .workbench-kyc-row-progress::before { content:''; display:inline-block; width:12px; height:12px; margin-right:6px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; vertical-align:-2px; animation:workbench-spin .8s linear infinite; }
.workbench-table tbody tr.is-kyc-running td { background:#e9f1ff; }
@keyframes workbench-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .button.is-loading::before, .is-kyc-running .workbench-kyc-row-progress::before { animation:none; } }
.workbench-table[data-stage="all"] .workbench-details-cell { overflow:visible; }
.workbench-table th.workbench-forward-heading,
.workbench-table td.workbench-forward-cell {
  width: 210px;
  min-width: 210px;
  overflow: visible;
  text-overflow: clip;
}
.workbench-forward-cell .button { margin-left: 6px; }
.workbench-table[data-stage="all"] .workbench-row-details[open] dl { position:absolute; right:0; top:100%; z-index:20; width:240px; margin:0; padding:12px; border:1px solid #d4deed; border-radius:8px; background:white; box-shadow:0 8px 24px #172c5026; }

/* Keep payment layout visible on KYC and sales tabs without changing other tabs. */
.workbench-table[data-pay-ui-column="true"] th:nth-child(2), .workbench-table[data-pay-ui-column="true"] td:nth-child(2) { width:18%; }
.workbench-table[data-pay-ui-column="true"] th:nth-child(6), .workbench-table[data-pay-ui-column="true"] td:nth-child(6) { width:8%; }
.workbench-table[data-pay-ui-column="true"] th.workbench-forward-heading,
.workbench-table[data-pay-ui-column="true"] td.workbench-forward-cell {
  width: 210px;
  min-width: 210px;
  overflow: visible;
  text-overflow: clip;
}
.workbench-table[data-pay-ui-column="true"] th:nth-child(9), .workbench-table[data-pay-ui-column="true"] td:nth-child(9) { width:6%; white-space:nowrap; }
.workbench-table[data-pay-ui-column="true"] th:nth-child(10), .workbench-table[data-pay-ui-column="true"] td:nth-child(10) { width:8%; }
.workbench-table[data-pay-ui-column="true"] th:nth-child(11), .workbench-table[data-pay-ui-column="true"] td:nth-child(11) { width:14%; }

.workbench-pay-ui-badge { display:inline-block; padding:3px 9px; border-radius:6px; font-size:12px; font-weight:600; line-height:20px; white-space:nowrap; }
.workbench-pay-ui-badge.is-single { color:#235ab0; background:#e5efff; }
.workbench-pay-ui-badge.is-dual { color:#7640a6; background:#f1e7fc; }
.workbench-pay-ui-badge.is-unknown { color:#546071; background:#e9edf2; }

/* A sale is one collapsible group, including confirmations sent in chunks. */
.workbench-sale-batch > td { background: var(--surface-2, #f5f6f8); padding: 14px 16px; }
.workbench-sale-batch-content { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.workbench-sale-batch-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 1; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; padding: 4px; font: inherit; }
.workbench-sale-batch-toggle > span:last-child, .workbench-sale-batch small { font-size: 12px; color: var(--text-muted, #64748b); }
.workbench-sale-batch-toggle:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; border-radius: 4px; }
@media (max-width: 640px) { .workbench-sale-batch-content { align-items: flex-start; } .workbench-sale-batch-toggle { gap: 6px; } }

.workbench-tabs { max-width: 100%; }
.workbench-table .workbench-sale-batch > td { white-space: normal; }
.workbench-sale-batch-content { max-width: calc(100vw - 64px); }
.workbench-sale-batch-content > .button { flex-shrink: 0; }
.workbench-sale-batch-toggle { min-width: 0; }
.workbench-selection-bar .workbench-combo:has([data-role="workbench-bulk-maker"][hidden]) { display: none; }
@media (max-width: 640px) {
  .workbench-sale-batch-content { flex-wrap: wrap; }
  .workbench-sale-batch-toggle { flex-basis: 100%; }
  .workbench-more-filters > div { left: auto; right: 0; max-width: calc(100vw - 40px); }
}

.workbench-source-edit { width:100%; padding:8px 10px; border:1px solid #cad6e5; border-radius:6px; background:#fff; color:inherit; font-size:14px; }
.workbench-source-edit:focus { outline:2px solid #9cc4fb; outline-offset:1px; }

.workbench-exclude-preview { max-height:280px; overflow:auto; margin:12px 0; overflow-wrap:anywhere; }
.workbench-exclude-match { padding:8px; border-bottom:1px solid #e0e6ef; }
.workbench-exclude-match:nth-child(even) { background:#f0f4f9; }
.workbench-exclude-match span { color:#687991; margin-left:10px; }

.workbench-source-raw { margin:8px 0 12px; }
.workbench-source-links { display:grid; gap:6px; margin:8px 0 10px; padding:8px 10px; border:1px solid #dce6f0; border-radius:8px; background:#f7f9fc; }
.workbench-source-links:not(:has(.workbench-source-link:not([hidden]))) { display:none; }
.workbench-source-link { display:grid; grid-template-columns:36px minmax(0,1fr) auto; align-items:center; gap:8px; min-width:0; }
.workbench-source-link-actions { display:flex; flex:none; gap:6px; }
.workbench-source-link[hidden] { display:none; }
.workbench-source-link b { color:#4a5d73; font-size:12px; font-weight:700; }
.workbench-source-link code { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; font-weight:600; color:#1f334d; }
.workbench-source-link[data-role="workbench-source-forward"] code { color:#145c38; }
.workbench-source-link[data-role="workbench-source-mail"] code { color:#163a66; }
.workbench-forward { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:6px; padding:4px 0; }
.workbench-forward code { font-size:12px; color:#3d6b4f; word-break:break-all; }
.workbench-source-sms { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin:12px 0; padding:12px; border-radius:8px; background:#eef5ff; }
.workbench-source-sms[hidden] { display:none; }
.workbench-source-sms output { font-size:18px; font-weight:700; color:#245c99; }

.workbench-presence:not([hidden]) { display:inline-block; flex:none; white-space:nowrap; padding:1px 5px; margin-right:4px; border-radius:5px; color:#17624b; background:#e3f3ec; font-size:11px; line-height:18px; }

.workbench-delivery-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #e4f2e9; color: #236a42; font-size: 12px; white-space: nowrap; }
.workbench-delivery-badge.is-replacement { background: #fff0d9; color: #8c590c; }

.workbench-makers-dialog { width: min(560px, calc(100% - 30px)); }
.workbench-makers-dialog header,
.workbench-makers-dialog .workbench-makers-add,
.workbench-makers-dialog .parse-message { padding: 16px 20px 0; }
.workbench-makers-dialog .parse-message { padding-bottom: 16px; }
.workbench-makers-add {
  display: flex;
  align-items: end;
  gap: 8px;
}
.workbench-makers-add label { flex: 1; }
.workbench-makers-add .button { margin-bottom: 1px; }
.workbench-makers-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  margin: 12px 0 0;
  padding: 0 20px 8px;
  overflow: auto;
  list-style: none;
}
.workbench-makers-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}
.workbench-makers-row span,
.workbench-makers-row input { flex: 1; min-width: 0; }
.workbench-makers-empty {
  color: var(--muted);
  padding: 12px 10px;
  font-size: 13px;
}

/* Keep sale actions visible while the preview scrolls within the viewport. */
[data-role="workbench-extraction-dialog"] {
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  overflow: hidden;
}
[data-role="workbench-extraction-dialog"][open] { display: flex; flex-direction: column; }
[data-role="workbench-extraction-dialog"] > header { flex-shrink: 0; }
.workbench-extraction-body { min-height: 0; overflow: auto; overscroll-behavior: contain; }
[data-role="workbench-extraction-dialog"] > footer { flex-shrink: 0; flex-wrap: wrap; }
@media (max-width: 720px) {
  [data-role="workbench-extraction-dialog"] { padding: 14px; }
  [data-role="workbench-extraction-dialog"] > header { margin-bottom: 12px; align-items: flex-start; }
  [data-role="workbench-extraction-dialog"] > header > div { min-width: 0; }
  [data-role="workbench-extraction-dialog"] > header > button { flex-shrink: 0; }
  [data-role="workbench-extraction-dialog"] > footer { gap: 8px; margin-top: 12px; padding-bottom: env(safe-area-inset-bottom, 0px); }
  [data-role="workbench-extraction-dialog"] > footer > .button { flex: 1 1 100px; min-height: 44px; white-space: normal; }
  [data-role="workbench-extraction-dialog"] > footer > .workbench-combo { flex: 1 1 100%; min-width: 0; }
  [data-role="workbench-extraction-dialog"] .workbench-extraction-label { width: 100%; min-width: 0; }
  [data-role="workbench-extraction-dialog"] .workbench-extraction-text { height: 150px; min-height: 120px; }
  [data-role="workbench-sale-rules"] { height: 110px; min-height: 78px; }
}

.workbench-proxy-binding { display: block; max-width: 100%; margin-top: 6px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; color: var(--accent-ink); background: var(--accent-soft); cursor: pointer; font-size: 12px; overflow-wrap: anywhere; text-align: left; }
.workbench-proxy-dialog { width: min(650px, calc(100% - 28px)); max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); overflow: auto; }
.workbench-proxy-dialog footer { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.workbench-proxy-dialog .monitor-settings-check { display: flex; align-items: center; gap: 8px; }
.workbench-proxy-dialog small, .workbench-proxy-history p { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.workbench-proxy-history h3 { margin: 12px 0 4px; font-size: 14px; }
.workbench-proxy-history-entry { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 720px) { .workbench-proxy-dialog footer > button { flex: 1 1 90px; min-height: 44px; } }
