:root {
  color-scheme: light;
  --section-sticky-top: 132px;
  --ink: #172b4d;
  --muted: #6b778c;
  --line: #dfe1e6;
  --line-soft: #ebecf0;
  --surface: #ffffff;
  --selected-row-background: #eee8ff;
  --canvas: #f4f5f7;
  --primary: #0c66e4;
  --primary-hover: #0055cc;
  --green: #14892c;
  --red: #c9372c;
  --blue: #0c66e4;
  --purple: #654982;
  --orange: #b65c02;
  --shadow: 0 12px 36px rgba(9, 30, 66, 0.12);
  --sticky-gap-cover: color-mix(in srgb, var(--canvas) 86%, var(--surface));
  --table-scrollbar-track: #edf0f5;
  --table-scrollbar-thumb: #b7c0cf;
  --table-scrollbar-thumb-hover: #8994a8;
  --preview-surface: #ffffff;
  --preview-header: #f1f2f4;
  --preview-border: #c7cdd4;
  --preview-text: #172b4d;
}


:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e6edf7;
  --muted: #9fadbc;
  --line: #38485f;
  --line-soft: #2d3b50;
  --surface: #1d2635;
  --selected-row-background: #2b2d52;
  --canvas: #111827;
  --primary: #579dff;
  --primary-hover: #85b8ff;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.4);
  --sticky-gap-cover: color-mix(in srgb, var(--canvas) 84%, var(--surface));
  --table-scrollbar-track: #172131;
  --table-scrollbar-thumb: #44546f;
  --table-scrollbar-thumb-hover: #6b7a91;
  --preview-surface: #1d2635;
  --preview-header: #253247;
  --preview-border: #53647c;
  --preview-text: #e6edf7;
}

:root[data-theme="graphite"] {
  color-scheme: dark;
  --ink: #f3f5f7;
  --muted: #8e949d;
  --line: #363b43;
  --line-soft: #262a30;
  --surface: #1f2329;
  --selected-row-background: #34304d;
  --canvas: #17191d;
  --primary: #ef4444;
  --primary-hover: #ff5a5a;
  --green: #45d483;
  --red: #ff5a5f;
  --blue: #4f8cff;
  --purple: #b18cff;
  --orange: #ffb452;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  --sticky-gap-cover: color-mix(in srgb, var(--canvas) 82%, var(--surface));
  --table-scrollbar-track: #1b1f25;
  --table-scrollbar-thumb: #454b55;
  --table-scrollbar-thumb-hover: #68707c;
  --preview-surface: #1f2329;
  --preview-header: #262a30;
  --preview-border: #363b43;
  --preview-text: #f3f5f7;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--canvas);
}

body {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

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

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  z-index: 80;
  top: 0;
  height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.cloud-conflict-popover {
  position: fixed;
  z-index: 95;
  top: 84px;
  left: 50%;
  display: flex;
  min-width: min(620px, calc(100vw - 32px));
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border: 1px solid color-mix(in srgb, #ffab00 68%, var(--line));
  border-radius: 12px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  cursor: pointer;
  backdrop-filter: blur(16px) saturate(130%);
}

.cloud-conflict-popover[hidden] {
  display: none;
}

.cloud-conflict-popover > .ui-icon {
  width: 34px;
  height: 34px;
  color: #f18d13;
}

.cloud-conflict-popover span {
  display: grid;
  flex: 1 1 auto;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.cloud-conflict-popover strong {
  font-size: 16px;
}

.cloud-conflict-popover small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.cloud-conflict-popover b {
  min-width: max-content;
  padding: 9px 15px;
  border: 1px solid color-mix(in srgb, #ffab00 68%, transparent);
  border-radius: 8px;
  color: #b65c02;
  background: color-mix(in srgb, #ffab00 12%, transparent);
  font-size: 14px;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-brand-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 18px;
  overflow: visible;
}

.brand {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  flex: 0 0 auto;
  width: 72px;
  height: 44px;
  /* The source PNGs have transparent margins; frame the artwork without editing it. */
  background: url("/icons/brand-light.png?v=2") center / 155% auto no-repeat;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: #092653;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.save-state {
  display: flex;
  min-width: max-content;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.save-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #22a06b;
}

.save-state.saving .save-dot {
  background: #f5cd47;
}

.save-state.save-error .save-dot {
  background: #e34949;
}

.header-report-actions,
.header-integrations {
  display: flex;
  align-items: center;
}

.header-report-actions {
  min-width: 0;
  overflow-x: auto;
  justify-content: safe center;
  scrollbar-width: none;
  gap: 8px;
}

.header-integrations {
  justify-content: flex-end;
  gap: 8px;
}

.header-action-group {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
}

.header-action-group + .header-action-group {
  margin-left: 6px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.header-action,
.header-icon-button,
.header-dropdown-trigger {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #44546f;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.header-action:hover,
.header-icon-button:hover,
.header-dropdown-trigger:hover,
.header-dropdown.open .header-dropdown-trigger {
  border-color: var(--line);
  background: #f1f2f4;
}

.header-action:active,
.header-icon-button:active,
.header-dropdown-trigger:active,
.header-dropdown-item:active {
  background: #dfe1e6;
  transform: translateY(1px);
}

.header-icon-button {
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.header-action:focus-visible,
.header-icon-button:focus-visible,
.header-dropdown-trigger:focus-visible,
.header-dropdown-item:focus-visible,
.floating-help-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.header-action:disabled,
.header-icon-button:disabled,
.header-dropdown-item:disabled {
  cursor: default;
  opacity: 0.35;
  transform: none;
}

.theme-toggle {
  color: var(--muted);
}

.header-dropdown {
  position: relative;
  z-index: 90;
}

.header-dropdown-trigger {
  min-width: 86px;
  border-color: var(--line);
  background: var(--surface);
}

.jira-logo {
  width: 20px;
  height: 20px;
  stroke: none;
}

@media (min-width: 821px) {
  #jiraMenuButton > span { display: inline; }
}

.header-dropdown-trigger .chevron-icon {
  width: 15px;
  height: 15px;
  transition: transform 150ms ease;
}

.header-dropdown.open .chevron-icon {
  transform: rotate(180deg);
}

.header-dropdown-menu {
  position: absolute;
  z-index: 160;
  top: calc(100% + 8px);
  left: 0;
  width: max-content;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.header-dropdown-menu-right {
  right: 0;
  left: auto;
}

.header-dropdown-menu[hidden] {
  display: none;
}

.header-dropdown-item {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  font-weight: 600;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.header-dropdown-item .ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.header-dropdown-item:hover {
  background: var(--line-soft);
}

.header-dropdown-divider {
  height: 1px;
  margin: 5px 4px;
  background: var(--line);
}

.theme-selector {
  position: relative;
  z-index: 90;
}

.theme-menu {
  position: absolute;
  z-index: 160;
  top: calc(100% + 8px);
  left: 0;
  width: max-content;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.theme-menu[hidden] {
  display: none;
}

.theme-menu-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 10px;
  padding: 0 34px 0 10px;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.theme-menu-item:hover {
  background: var(--line-soft);
}

.theme-menu-item .ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke-width: 2;
}

.theme-menu-item span {
  line-height: 1;
}

.theme-menu-item.current {
  color: #0c66e4;
  background: #e9f2ff;
}

.theme-menu-item.current::after {
  content: "✓";
  position: absolute;
  right: 12px;
  top: 50%;
  color: currentColor;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  transform: translateY(-50%);
}

.floating-help-button {
  position: fixed;
  z-index: 45;
  right: 24px;
  bottom: 24px;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 28px rgba(12, 102, 228, 0.28);
  transition:
    transform 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.floating-help-button:hover {
  background: var(--primary-hover);
  box-shadow: 0 14px 34px rgba(12, 102, 228, 0.36);
  transform: translateY(-2px);
}

body.focus-mode-active .floating-help-button {
  bottom: 84px;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  font-weight: 600;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

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

.button-success {
  color: white;
  background: #1f845a;
}

.button-success:hover {
  background: #216e4e;
}

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

.button-danger:hover {
  background: #ae2e24;
}

.button-secondary {
  background: #e9f2ff;
  color: #0c66e4;
}

.button-ghost {
  background: transparent;
  color: #44546f;
}

.button-ghost:hover,
.button-secondary:hover {
  background: #dce8f8;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
  gap: 24px;
  width: min(1780px, calc(100% - 48px));
  margin: 24px auto 64px;
}

.report-card,
.summary-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(9, 30, 66, 0.04);
}

.report-card {
  min-width: 0;
  padding: 32px;
}

.report-heading {
  margin-bottom: 24px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.report-heading h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.metadata-grid {
  display: grid;
  grid-template-columns: minmax(340px, 620px) 220px 240px;
  justify-content: start;
  gap: 14px;
  margin-bottom: 18px;
}

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

.field[hidden] {
  display: none;
}

.field span {
  color: #44546f;
  font-size: 12px;
  font-weight: 650;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  border: 1px solid #b7bdc8;
  border-radius: 6px;
  outline: none;
  background: #fff;
}

.field input:focus,
.field select:focus,
.section-title:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(12, 102, 228, 0.16);
}

#overallStatus {
  font-weight: 800;
  border-color: transparent;
  transition:
    color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
}

.overall-status-field {
  width: 240px;
  max-width: 240px;
}

.overall-status-field #overallStatus.status-ok {
  color: #216e4e;
  background: #dcfff1;
}

.overall-status-field #overallStatus.status-fail {
  color: #ae2e24;
  background: #ffeceb;
}

.overall-status-field #overallStatus.status-almost {
  color: #0055cc;
  background: #e9f2ff;
}

.overall-status-field #overallStatus.status-unchecked {
  color: #5e4db2;
  background: #f3f0ff;
}

.overall-status-field #overallStatus.status-partial {
  color: #974f0c;
  background: #fff3eb;
}

.overall-status-field #overallStatus.status-clarification {
  color: #7f3f00;
  background: #fff0d5;
}

.editor-toolbar {
  position: sticky;
  z-index: 40;
  top: 72px;
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 3px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  background: #f7f8f9;
  box-shadow: 0 5px 12px rgba(9, 30, 66, 0.08);
}

.editor-toolbar::after,
.selection-toolbar::after {
  position: absolute;
  right: -1px;
  bottom: -13px;
  left: -1px;
  height: 13px;
  background: color-mix(in srgb, var(--sticky-gap-cover) 72%, transparent);
  backdrop-filter: blur(18px) saturate(135%);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

body.section-sticky-active .editor-toolbar::after {
  opacity: 1;
}

.editor-toolbar button,
.editor-toolbar select {
  height: 32px;
  border: 0;
  border-radius: 5px;
  color: var(--ink);
  background: transparent;
  transition:
    color 120ms ease,
    background-color 120ms ease,
    box-shadow 120ms ease,
    transform 80ms ease;
}

.editor-toolbar button {
  width: 32px;
  min-width: 32px;
  padding: 0;
  cursor: pointer;
}

.editor-toolbar button:hover,
.editor-toolbar select:hover {
  background-color: #e9ebee;
}

.editor-toolbar button:active {
  transform: translateY(1px);
}

.editor-toolbar button:focus-visible,
.editor-toolbar select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.editor-toolbar select {
  min-width: 172px;
  padding: 0 30px 0 10px;
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
  background-clip: padding-box;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 13px,
    calc(100% - 11px) 13px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.toolbar-icon-button {
  display: inline-flex;
  width: 32px;
  min-width: 32px;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

#linkButton.toolbar-icon-button {
  width: 38px;
  min-width: 38px;
}

.toolbar-icon-button .ui-icon {
  width: 18px;
  height: 18px;
}

.toolbar-text-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

.toolbar-italic {
  font-style: italic;
  font-weight: 750;
}

.toolbar-underline {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.toolbar-strike {
  text-decoration: line-through;
}

.toolbar-chevron {
  width: 10px;
  height: 10px;
}

.toolbar-color-wrap {
  position: relative;
}

.toolbar-color-button {
  display: inline-flex;
  width: 38px;
  min-width: 38px;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.toolbar-color-letter {
  position: relative;
  width: 18px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.toolbar-color-letter::after {
  position: absolute;
  right: -1px;
  bottom: -5px;
  left: -1px;
  height: 3px;
  border-radius: 999px;
  background: #57d9a3;
  content: "";
}

.toolbar-color-menu {
  position: absolute;
  z-index: 90;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 32px);
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toolbar-color-menu[hidden] {
  display: none;
}

.toolbar-color-menu button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 3px;
  background: var(--swatch);
}

.toolbar-color-menu button:hover,
.toolbar-color-menu button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.toolbar-divider {
  width: 1px;
  height: 28px;
  margin: 0 8px;
  background: var(--line);
}

.link-popover {
  position: fixed;
  z-index: 80;
  display: grid;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.link-popover[hidden],
.link-popover-action[hidden] { display: none; }

.link-popover-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.link-popover-heading strong { font-size: 13px; }

.link-popover-close,
.link-popover-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.link-popover-close { border-color: transparent; color: var(--muted); }
.link-popover .ui-icon { width: 16px; height: 16px; }
.link-popover-close:hover, .link-popover-action:hover { background: var(--line-soft); color: var(--ink); }
.link-popover-close:focus-visible, .link-popover-action:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.link-popover-action:disabled { opacity: .45; cursor: default; }
.link-popover-action.link-popover-apply { color: #fff; border-color: var(--primary); background: var(--primary); }
.link-popover-apply:hover { filter: brightness(.92); }

.link-popover label { display: grid; gap: 4px; }
.link-popover label span { color: var(--muted); font-size: 11px; font-weight: 650; }
.link-popover input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
}
.link-popover input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent); }
.link-popover-error { color: var(--red); font-size: 11px; }
.link-popover-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.link-popover-open { margin-right: auto; }
@media (pointer: coarse) {
  .link-popover-close, .link-popover-action { width: 36px; height: 36px; flex-basis: 36px; }
  .link-popover input { height: 36px; font-size: 16px; }
}

.intro-editor {
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  line-height: 1.55;
}

.intro-editor a,
.cell-editor a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.intro-editor:focus {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

[contenteditable="true"]:empty::before {
  color: #97a0af;
  content: attr(data-placeholder);
  pointer-events: none;
}

.sections {
  display: grid;
  min-width: 0;
  gap: 18px;
  margin-top: 28px;
}

.check-section {
  width: 100%;
  min-width: 0;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.section-sticky-block {
  position: sticky;
  z-index: 32;
  top: var(--section-sticky-top);
  overflow: hidden;
  border-radius: 9px 9px 0 0;
  background: color-mix(in srgb, var(--surface) 96%, var(--canvas));
  backdrop-filter: blur(18px) saturate(135%);
  box-shadow: 0 1px 0 var(--line), 0 8px 18px rgba(9, 30, 66, 0.08);
}

.section-sticky-block.is-stuck {
  box-shadow:
    0 -8px 12px color-mix(in srgb, var(--sticky-gap-cover) 52%, transparent),
    0 1px 0 var(--line),
    0 8px 18px rgba(9, 30, 66, 0.08);
}

.section-sticky-block.is-pushed-out {
  visibility: hidden;
}

.section-header {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.section-header-scroll {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.section-header-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
}

.check-section.collapsed .section-sticky-block {
  border-radius: 9px;
}

.check-section.collapsed .section-header {
  border-bottom: 0;
}

.check-section.collapsed .section-header-scroll {
  display: none;
}

.drag-handle {
  color: #97a0af;
  cursor: grab;
  font-weight: 700;
  letter-spacing: -3px;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.check-section.dragging {
  opacity: 0.5;
}

.check-section.drag-over {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.section-title {
  width: 100%;
  height: 36px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  outline: 0;
  background: transparent;
  font-size: 17px;
  font-weight: 700;
}

.section-actions {
  display: flex;
  gap: 4px;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #44546f;
  font-size: 20px;
}

.icon-button:hover {
  background: #e9ebee;
}

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

.check-section.collapsed .section-content {
  display: none;
}

.check-section.collapsed .collapse-section {
  transform: rotate(180deg);
}

.column-toolbar {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.column-toolbar > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.column-chips {
  display: flex;
  min-width: 0;
  flex: 1;
  gap: 6px;
  overflow-x: auto;
}

.column-chip {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f8f9;
}

.column-chip input {
  width: 150px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.column-chip input:focus {
  box-shadow: inset 0 0 0 2px var(--primary);
}

.column-chip button {
  width: 28px;
  height: 28px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 17px;
}

.column-chip button:hover {
  color: var(--red);
  background: #ffebe6;
}

.add-column-button {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  color: var(--primary);
  background: #e9f2ff;
  font-size: 12px;
  font-weight: 650;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-color: var(--table-scrollbar-thumb) var(--table-scrollbar-track);
  scrollbar-width: thin;
}

.table-scroll::-webkit-scrollbar {
  height: 12px;
}

.table-scroll::-webkit-scrollbar-track {
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: var(--table-scrollbar-track);
}

.table-scroll::-webkit-scrollbar-thumb {
  border: 3px solid var(--table-scrollbar-track);
  border-radius: 999px;
  background: var(--table-scrollbar-thumb);
}

.table-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--table-scrollbar-thumb-hover);
}

.check-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
}

.number-col {
  width: 52px;
}

.status-col {
  width: 164px;
}

.dynamic-col {
  min-width: 210px;
}

.actions-col {
  width: 40px;
}

.section-header-table th {
  height: 42px;
  padding: 8px 9px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, #f1f2f4 96%, transparent);
  color: #44546f;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
}

.editable-column-header,
.status-header {
  position: relative;
  padding: 4px 36px 4px 27px !important;
}

.column-drag-handle {
  position: absolute;
  top: 50%;
  left: 5px;
  width: 18px;
  transform: translateY(-50%);
  cursor: grab;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: -2px;
  text-align: center;
  user-select: none;
}

.column-drag-handle:active {
  cursor: grabbing;
}

.editable-column-header.column-dragging,
.section-header-table th.column-dragging {
  position: relative;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}

.check-table td.column-dragging,
.check-table td.column-drop-target,
.section-header-table th.column-drop-target {
  position: relative;
}

.check-table td.column-dragging {
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.section-header-table th.column-drop-target,
.check-table td.column-drop-target {
  background: color-mix(in srgb, var(--primary) 9%, transparent);
}

.section-header-table th.column-drop-before,
.check-table td.column-drop-before {
  box-shadow: inset 4px 0 0 var(--primary);
}

.section-header-table th.column-drop-after,
.check-table td.column-drop-after {
  box-shadow: inset -4px 0 0 var(--primary);
}

.column-drag-ghost {
  position: fixed;
  z-index: 99999;
  top: -1000px;
  left: -1000px;
  min-width: 220px;
  padding: 14px 18px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(9, 30, 66, 0.28);
  font-weight: 750;
}

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

.column-resizer::after {
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 4px;
  width: 1px;
  background: transparent;
  content: "";
}

.column-resizer:hover::after {
  background: var(--primary);
}

.editable-column-header input {
  width: 100%;
  height: 32px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  outline: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
}

.editable-column-header input:hover {
  border-color: #b7bdc8;
  background: var(--surface);
}

.editable-column-header input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 2px rgba(12, 102, 228, 0.16);
}

.status-header > span {
  display: block;
  padding: 8px 5px;
}

.column-menu-button {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  transform: translateY(-50%);
  background: transparent;
  color: var(--muted);
  letter-spacing: 1px;
}

.column-menu-button:hover {
  background: #dfe1e6;
  color: var(--ink);
}

.section-header-table th:last-child,
.check-table td:last-child {
  border-right: 0;
}

.check-table td {
  position: relative;
  min-height: 56px;
  padding: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.check-table td.editor-cell {
  height: 1px;
}

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

.row-number {
  position: relative;
  padding: 14px 8px 14px 20px !important;
  color: var(--muted);
  text-align: center;
  font-weight: 650;
}

.row-drag-handle {
  position: absolute;
  top: 50%;
  left: 5px;
  width: 14px;
  transform: translateY(-50%);
  cursor: grab;
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  font-size: 12px;
  letter-spacing: -2px;
  opacity: 0;
  user-select: none;
  transition:
    color 140ms ease,
    opacity 140ms ease;
}

.check-table tbody tr:hover .row-drag-handle,
.row-drag-handle:focus,
.row-drag-handle:active {
  opacity: 1;
}

.row-drag-handle:active {
  cursor: grabbing;
  color: var(--primary);
}

.row-number-text {
  display: inline-block;
}

.row-number-input {
  width: 100%;
  min-width: 0;
  padding: 5px 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: center;
}

.row-number-input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.check-table tbody tr.row-dragging > td {
  opacity: 0.42;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}

.check-table tbody tr.row-drop-before > td {
  box-shadow: inset 0 4px 0 var(--primary);
}

.check-table tbody tr.row-drop-after > td {
  box-shadow: inset 0 -4px 0 var(--primary);
}

.check-table tbody.row-drop-empty::after {
  display: block;
  margin: 8px;
  padding: 14px;
  border: 2px dashed color-mix(in srgb, var(--primary) 55%, var(--line));
  border-radius: 6px;
  color: var(--primary);
  content: "Перенести строку сюда";
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.cell-editor {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 58px;
  padding: 11px 10px;
  outline: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.cell-editor > p:empty,
.intro-editor > p:empty {
  min-height: 1.45em;
  margin: 3px 0;
}

.cell-editor:focus {
  box-shadow: none;
}

.editor-cell:focus-within {
  box-shadow: inset 0 0 0 2px var(--primary);
}

.status-select {
  width: calc(100% - 14px);
  min-height: 34px;
  margin: 10px 7px;
  padding: 0 24px 0 9px;
  border: 0;
  border-radius: 5px;
  outline: 0;
  font-size: 11px;
  font-weight: 800;
}

.status-select:focus {
  box-shadow: 0 0 0 2px rgba(12, 102, 228, 0.24);
}

.status-ok {
  color: #216e4e;
  background: #dcfff1;
}

.status-fail {
  color: #ae2e24;
  background: #ffeceb;
}

.status-almost {
  color: #0055cc;
  background: #e9f2ff;
}

.status-unchecked {
  color: #5e4db2;
  background: #f3f0ff;
}

.status-partial {
  color: #974f0c;
  background: #fff3eb;
}

.status-clarification {
  color: #7f3f00;
  background: #fff0d5;
}

.row-actions {
  padding-top: 8px !important;
  text-align: center;
}

.row-menu-button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  letter-spacing: 1px;
}

.row-menu-button:hover {
  background: #f1f2f4;
}

.floating-context-menu {
  position: fixed;
  z-index: 500;
  width: max-content;
  min-width: 190px;
  max-width: 260px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.floating-context-menu button {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.floating-context-menu button .ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.floating-context-menu button:hover,
.floating-context-menu button:focus-visible {
  background: #f1f2f4;
  outline: none;
}

.danger-text {
  color: var(--red);
}

.danger-text:hover,
.danger-text:focus-visible {
  background: color-mix(in srgb, var(--red) 10%, transparent) !important;
}

.add-row-button {
  width: 100%;
  height: 42px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  background: #fafbfc;
  color: var(--primary);
  font-weight: 650;
}

.add-row-button:hover {
  background: #e9f2ff;
}

.add-section-button {
  display: flex;
  width: 100%;
  height: 50px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  border: 1px dashed #8590a2;
  border-radius: 9px;
  background: transparent;
  color: #44546f;
  font-weight: 650;
}

.add-section-button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f4f8ff;
}

.required {
  color: var(--red);
}

.summary-card {
  position: sticky;
  top: 96px;
  padding: 20px;
}

.summary-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.summary-heading h2 {
  margin: 0;
  font-size: 18px;
}

.summary-total {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #0c66e4;
  background: #e9f2ff;
  font-weight: 800;
}

.summary-chart {
  display: flex;
  overflow: hidden;
  height: 10px;
  margin: 22px 0;
  border-radius: 99px;
  background: #ebecf0;
}

.chart-segment {
  transition: width 180ms ease;
}

.summary-list {
  display: grid;
  gap: 12px;
}

.summary-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 9px;
}

.summary-color {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.summary-label {
  color: #44546f;
  font-size: 12px;
}

.summary-count {
  font-weight: 750;
}

.summary-note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(9, 30, 66, 0.58);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(1400px, 96vw);
  height: min(880px, 92vh);
  overflow: hidden;
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(9, 30, 66, 0.38);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.import-modal {
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(920px, 94vw);
  height: min(720px, 88vh);
}

.settings-modal {
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(940px, 94vw);
  height: min(760px, 90vh);
}

.agent-setup-modal {
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(860px, 94vw);
  height: auto;
  max-height: min(840px, 92vh);
}

.agent-setup-body {
  display: grid;
  min-height: 0;
  gap: 18px;
  overflow: auto;
  padding: 22px;
}

.agent-setup-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.agent-setup-steps code {
  padding: 2px 5px;
  border-radius: 5px;
  color: var(--ink);
  background: var(--line-soft);
}

.agent-guide-intro {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid rgba(87, 157, 255, 0.45);
  border-radius: 10px;
  background: rgba(87, 157, 255, 0.09);
}

.agent-guide-intro span,
.agent-guide-heading small,
.agent-platform-card summary small,
.agent-platform-content,
.agent-auth-options span,
.agent-reconfigure-hint,
.agent-node-check small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.agent-guide-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.agent-guide-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.agent-guide-heading > span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.agent-guide-heading > div {
  display: grid;
  gap: 2px;
}

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

.agent-platform-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.agent-platform-card summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.agent-platform-card summary::-webkit-details-marker {
  display: none;
}

.agent-platform-card summary > span:nth-child(2) {
  display: grid;
  gap: 1px;
}

.agent-platform-card[open] summary {
  border-bottom: 1px solid var(--line);
}

.agent-platform-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: var(--ink);
  background: var(--line-soft);
  font-size: 17px;
  font-weight: 700;
}

.agent-summary-chevron {
  color: var(--muted);
  font-size: 24px;
  transition: transform 150ms ease;
}

.agent-platform-card[open] .agent-summary-chevron {
  transform: rotate(90deg);
}

.agent-platform-content {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.agent-platform-content ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 21px;
}

.agent-platform-content p,
.agent-reconfigure-hint {
  margin: 0;
}

.agent-platform-content code,
.agent-reconfigure-hint code {
  color: var(--ink);
}

.agent-platform-action {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.agent-platform-action > a:not(.button) {
  color: #579dff;
  font-weight: 650;
}

.agent-command {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #111318;
}

.agent-command pre {
  overflow: auto;
  margin: 0;
  padding: 42px 14px 14px;
  color: #d8dee9;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
}

.agent-command button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  padding: 5px 9px;
  border: 1px solid #3e4655;
  border-radius: 6px;
  color: #d8dee9;
  background: #252a33;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.agent-command-compact pre {
  padding-top: 38px;
}

.agent-node-check {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.agent-node-check code {
  padding: 3px 7px;
  border-radius: 5px;
  color: var(--ink);
  background: var(--line-soft);
}

.agent-node-check button {
  border: 0;
  color: #579dff;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.agent-node-check small {
  flex-basis: 100%;
}

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

.agent-copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

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

.agent-auth-options > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.agent-reset-wrap {
  min-width: 0;
}

.agent-reset-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.agent-reset-card summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  cursor: pointer;
  list-style: none;
}

.agent-reset-card summary::-webkit-details-marker {
  display: none;
}

.agent-reset-card summary > span:first-child {
  display: grid;
  gap: 2px;
}

.agent-reset-card summary small,
.agent-reset-content {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.agent-reset-card[open] summary {
  border-bottom: 1px solid var(--line);
}

.agent-reset-card[open] .agent-summary-chevron {
  transform: rotate(90deg);
}

.agent-reset-content {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
}

.agent-reset-content ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 21px;
}

.agent-reset-content p {
  margin: 0;
}

.agent-troubleshooting-item {
  display: grid;
  gap: 9px;
}

.agent-troubleshooting-item > strong {
  color: var(--ink);
}

.agent-troubleshooting-item code,
.agent-troubleshooting-list code {
  color: var(--ink);
}

.agent-troubleshooting-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px 0 0 21px;
  border-top: 1px solid var(--line);
}

.agent-pairing-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid #85b8ff;
  border-radius: 10px;
  background: #e9f2ff;
}

.agent-pairing-card > div {
  display: grid;
  gap: 3px;
}

.agent-pairing-card span,
.agent-pairing-card small,
.agent-version-label {
  color: var(--muted);
  font-size: 12px;
}

.agent-pairing-card strong {
  color: #0c66e4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 28px;
  letter-spacing: 0.16em;
}

.agent-connection-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.agent-state-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #f5cd47;
}

.agent-connection-state.connected .agent-state-dot {
  background: #22a06b;
  box-shadow: 0 0 0 4px rgba(34, 160, 107, 0.14);
}

.agent-connection-state > div {
  display: grid;
  gap: 2px;
}

.agent-connection-state small {
  color: var(--muted);
}

.agent-test-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.agent-security-note {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid #579dff;
  color: var(--muted);
  background: var(--line-soft);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 620px) {
  .agent-pairing-card,
  .agent-test-row,
  .agent-copy-field,
  .agent-auth-options {
    grid-template-columns: 1fr;
  }

  .agent-pairing-card {
    display: grid;
  }

  .agent-pairing-actions {
    justify-content: stretch;
  }

  .agent-pairing-actions .button {
    flex: 1 1 auto;
  }

  .agent-guide-section {
    padding: 14px;
  }
}

.publish-progress-backdrop {
  z-index: 140;
}

.publish-progress-modal {
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(560px, 94vw);
  height: auto;
  min-height: 360px;
}

.publish-scope-modal {
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(520px, 94vw);
  height: auto;
  max-height: min(680px, 88vh);
}

.publish-scope-body {
  display: grid;
  min-height: 0;
  gap: 12px;
  overflow: hidden;
  padding: 20px 22px 22px;
}

.publish-scope-hint {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.publish-scope-list {
  display: grid;
  min-height: 0;
  gap: 6px;
  overflow: auto;
  padding-right: 3px;
}

.publish-scope-option {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
}

.publish-scope-option:hover {
  background: var(--surface-raised);
}

.publish-scope-option:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent);
}

.publish-scope-option input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--primary);
}

.publish-scope-option span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 650;
}

.publish-scope-option-all {
  border-color: var(--line);
  background: var(--surface-raised);
}

.publish-scope-option-all span {
  font-weight: 800;
}

.publish-scope-modal .modal-footer > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.version-conflict-modal {
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1280px, 96vw);
  height: min(860px, 92vh);
}

.version-conflict-body {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
  padding: 22px;
}

.version-choice-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.version-choice-bar .button.active {
  border-color: var(--primary);
  color: white;
  background: var(--primary);
}

.version-compare-grid {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.version-compare-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  overflow: hidden;
}

.version-compare-panel.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 24%, transparent);
}

.version-compare-panel > header {
  padding: 14px 14px 0;
}

.version-summary-label {
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.version-compare-panel dl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 8px 0 0;
}

.version-compare-panel dl div {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.version-compare-panel dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.version-compare-panel dd {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.version-preview {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  scrollbar-color: var(--table-scrollbar-thumb) var(--table-scrollbar-track);
  scrollbar-width: thin;
}

.version-preview h1 {
  margin: 0 0 10px;
  font-size: 20px;
}

.version-preview h2 {
  margin: 18px 0 8px;
  font-size: 16px;
}

.version-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.version-preview th,
.version-preview td {
  padding: 8px;
  border: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.version-preview th {
  background: color-mix(in srgb, var(--surface) 82%, var(--line));
  font-weight: 800;
}

.version-diff-row {
  outline: 1px solid color-mix(in srgb, var(--primary) 52%, transparent);
  outline-offset: -1px;
}

.version-diff-cell,
.version-diff-changed {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 34%, transparent);
}

.version-copy-choice-modal {
  grid-template-rows: auto minmax(0, 1fr);
  width: min(520px, 92vw);
  height: auto;
}

.version-copy-choice-body {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.version-copy-choice-body p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.version-copy-choice-actions {
  display: grid;
  gap: 10px;
}

.publish-progress-body {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.publish-progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line-soft);
}

.publish-progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0c66e4, #36b37e);
  transition: width 180ms ease;
}

.publish-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.publish-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 650;
}

.publish-steps li::before {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  content: "";
}

.publish-steps li.active {
  color: var(--ink);
}

.publish-steps li.active::before {
  border-color: var(--primary);
  border-top-color: transparent;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  animation: publish-step-spin 780ms linear infinite;
}

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

.publish-steps li.done::before {
  border-color: #22a06b;
  color: #22a06b;
  content: "✓";
  font-size: 13px;
  font-weight: 800;
}

.publish-steps li.done.active::before {
  animation: none;
  background: transparent;
  transform: none;
}

.publish-steps li.error {
  color: var(--red);
}

.publish-steps li.error::before {
  border-color: var(--red);
  color: var(--red);
  content: "!";
  font-size: 13px;
  font-weight: 800;
}

.publish-status,
.publish-error {
  margin: 0;
  line-height: 1.45;
}

.publish-status {
  color: var(--ink);
  font-weight: 650;
}

.publish-error {
  padding: 12px 14px;
  border-radius: 8px;
  color: #ae2e24;
  background: #ffebe6;
}

.confirm-modal {
  grid-template-rows: auto auto auto;
  width: min(480px, 100%);
  min-width: 0;
  height: auto;
}

.confirm-modal-body {
  padding: 22px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.confirm-modal .modal-footer {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-modal {
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(760px, 94vw);
  height: min(760px, 90vh);
}

.feedback-body {
  display: grid;
  align-content: start;
  gap: 16px;
  overflow-y: auto;
  padding: 22px;
}

.feedback-hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.feedback-message-field textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.5;
}

.feedback-message-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent);
}

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

.feedback-attachments-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feedback-dropzone {
  display: grid;
  min-height: 92px;
  place-items: center;
  padding: 16px;
  border: 1px dashed var(--muted);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.feedback-dropzone.drag-over {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.feedback-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.feedback-preview-item {
  position: relative;
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--canvas);
}

.feedback-preview-item img {
  display: block;
  width: 100%;
  height: 92px;
  border-radius: 5px;
  object-fit: cover;
}

.feedback-preview-item span {
  display: block;
  overflow: hidden;
  padding: 6px 2px 1px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-preview-item button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: white;
  background: rgba(9, 30, 66, 0.78);
  font-size: 18px;
}

.feedback-report-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.feedback-error {
  padding: 9px 11px;
  border-radius: 6px;
  color: #ae2e24;
  background: #ffeceb;
  font-size: 12px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.settings-sidebar {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, var(--canvas));
}

.settings-nav-item {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
}

.settings-nav-item[hidden] {
  display: none;
}

.settings-nav-item:hover {
  background: var(--line-soft);
  color: var(--ink);
}

.settings-nav-item.active {
  background: #e9f2ff;
  color: var(--primary);
}

.settings-body {
  display: grid;
  min-width: 0;
  gap: 16px;
  padding: 22px;
  overflow-x: hidden;
  overflow-y: auto;
}

.settings-section {
  display: grid;
  gap: 16px;
}

.settings-section[hidden] {
  display: none;
}

.settings-note {
  padding: 12px 14px;
  border: 1px solid #85b8ff;
  border-radius: 7px;
  color: #0c66e4;
  background: #e9f2ff;
  font-size: 12px;
  line-height: 1.5;
}

.settings-tabs {
  display: flex;
  gap: 4px;
}

.settings-tab {
  padding: 8px 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.settings-tab.active {
  color: var(--primary);
  background: #e9f2ff;
}

.settings-pane {
  display: grid;
  gap: 16px;
}

.settings-pane[hidden] {
  display: none;
}

.settings-curl-input {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.settings-curl-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent);
}

.settings-curl-hint {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.settings-curl-state {
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--muted);
  background: #f1f2f4;
  font-size: 12px;
}

.settings-curl-state.success {
  color: #216e4e;
  background: #dcfff1;
}

.settings-curl-state.error {
  color: #ae2e24;
  background: #ffeceb;
}

.settings-section-actions {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.settings-footer {
  justify-content: flex-start;
}

.settings-save-check {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: #164b35;
  background: #dcfff1;
  font-size: 12px;
  font-weight: 900;
}

.settings-save-check[hidden] {
  display: none;
}

.button-primary.is-saved {
  background: #1f845a;
}

.button-primary.is-saved:hover {
  background: #216e4e;
}

.storage-grid {
  display: grid;
  gap: 14px;
}

.storage-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.storage-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
}

.settings-toggle-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.settings-toggle-card input {
  margin-top: 3px;
}

.settings-toggle-card span {
  display: grid;
  gap: 4px;
}

.settings-toggle-card strong {
  color: var(--ink);
  font-size: 14px;
}

.settings-toggle-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field input:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.connection-state {
  padding: 11px 13px;
  border-radius: 6px;
  color: var(--muted);
  background: #f1f2f4;
  font-size: 12px;
}

.connection-state.success {
  color: #216e4e;
  background: #dcfff1;
}

.connection-state.error {
  color: #ae2e24;
  background: #ffeceb;
}

.import-body {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 22px;
}

.import-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.import-textarea {
  width: 100%;
  min-height: 360px;
  resize: none;
  padding: 16px;
  border: 1px solid #b7bdc8;
  border-radius: 7px;
  outline: none;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}

.import-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(12, 102, 228, 0.16);
}

.import-warning {
  padding: 10px 12px;
  border-radius: 6px;
  color: #ae2e24;
  background: #ffeceb;
  font-size: 12px;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

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

.modal-save-button {
  color: var(--muted);
}

.modal-save-button:hover {
  color: var(--primary);
}

.preview-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 22px 0;
  border-bottom: 1px solid var(--line);
}

.preview-tab {
  padding: 9px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
}

.preview-tab.active {
  border-color: var(--primary);
  color: var(--primary);
}

.preview-body {
  overflow: auto;
  padding: 24px;
  background: color-mix(in srgb, var(--canvas) 74%, var(--surface));
}

#previewModal .modal-footer {
  gap: 16px;
}

#previewModal .modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

#previewModal .modal-actions .button {
  min-height: 36px;
  padding: 0 12px;
}

#previewModal .modal-actions .button-secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

#previewModal .modal-actions .button-secondary:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--line));
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

#previewModal .modal-actions .ui-icon {
  width: 17px;
  height: 17px;
}

.jira-preview {
  min-height: 100%;
  padding: 34px;
  border: 1px solid var(--preview-border);
  border-radius: 8px;
  color: var(--preview-text);
  background: var(--preview-surface);
}

.jira-preview h1 {
  margin: 0 0 16px;
  font-size: 24px;
}

.jira-preview h2 {
  margin: 28px 0 9px;
  font-size: 19px;
}

.jira-preview table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.jira-preview th,
.jira-preview td {
  padding: 9px;
  border: 1px solid var(--preview-border);
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
}

.jira-preview th {
  color: var(--preview-text);
  background: var(--preview-header);
}

.jira-preview td {
  color: var(--preview-text);
  background: var(--preview-surface);
}

.cell-code-block {
  display: block;
  position: relative;
  width: min(100%, 520px);
  min-width: min(280px, 100%);
  max-width: 100%;
  margin: 6px 0;
  padding: 42px 14px 14px;
  overflow: hidden;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  background: #f4f5f7;
  color: #172b4d;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
  tab-size: 2;
  cursor: grab;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.cell-code-block:hover,
.cell-code-block:focus,
.cell-image:hover,
.cell-image:focus,
.cell-file:hover,
.cell-file:focus {
  border-color: color-mix(in srgb, var(--primary) 62%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 12%, transparent);
  outline: none;
}

.cell-code-block.code-preview code {
  display: block;
  max-height: 9em;
  overflow: hidden;
  white-space: pre;
  mask-image: linear-gradient(to bottom, #000 75%, transparent 100%);
}

.code-preview-meta {
  position: absolute;
  top: 13px;
  left: 14px;
  color: #5e6c84;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.cell-code-block.code-selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.cell-code-block.code-selected::after {
  position: absolute;
  z-index: 3;
  right: -7px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--surface);
  border-radius: 3px;
  background: var(--primary);
  cursor: nwse-resize;
  content: "";
}

.cell-code-block.code-dragging {
  opacity: 0.42;
  cursor: grabbing;
}

.cell-editor.code-drop-target,
.intro-editor.code-drop-target {
  box-shadow: inset 0 0 0 3px var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.cell-code-block code,
.cell-code-block code * {
  padding: 0;
  background: transparent !important;
  font: inherit;
  white-space: pre;
}

.code-key {
  color: #0052cc;
}

.code-string {
  color: #006644;
}

.code-literal {
  color: #bf2600;
}

.code-number {
  color: #6554c0;
}

.object-action-panel {
  position: absolute;
  z-index: 4;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 5px 14px rgba(9, 30, 66, 0.12);
  opacity: 0;
  transform: translateY(-3px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
  pointer-events: none;
}

.cell-code-block:hover .object-action-panel,
.cell-code-block:focus .object-action-panel,
.cell-code-block:focus-within .object-action-panel,
.cell-image:hover .object-action-panel,
.cell-image:focus .object-action-panel,
.cell-image:focus-within .object-action-panel,
.cell-file:hover .object-action-panel,
.cell-file:focus .object-action-panel,
.cell-file:focus-within .object-action-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.object-action-button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: #44546f;
  background: transparent;
  cursor: pointer;
}

.object-action-button .ui-icon {
  width: 16px;
  height: 16px;
}

.object-action-button:hover {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.object-action-button:active {
  transform: translateY(1px);
}

.object-action-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.object-action-button.object-action-danger:hover {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 10%, transparent);
}

.cell-image {
  position: relative;
  display: block;
  width: min(100%, 520px);
  max-width: 100%;
  margin: 5px 0;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: grab;
  user-select: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.cell-image img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border: 0;
  border-radius: 5px;
  object-fit: contain;
}

.image-resize-hint {
  position: absolute;
  right: -1px;
  bottom: -1px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--surface) 70%, var(--line));
  border-radius: 8px 0 5px 0;
  color: var(--surface);
  background: color-mix(in srgb, #253041 88%, transparent);
  box-shadow: 0 6px 16px rgba(9, 30, 66, 0.16);
  cursor: nwse-resize;
  opacity: 0;
  pointer-events: none;
  transform: translate(2px, 2px) scale(0.92);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    background-color 140ms ease,
    color 140ms ease;
}

.image-resize-hint svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.cell-image:hover .image-resize-hint,
.cell-image:focus .image-resize-hint,
.cell-image:focus-within .image-resize-hint,
.cell-image.image-selected .image-resize-hint {
  opacity: 0.9;
  transform: translate(0, 0) scale(1);
}

.cell-image.image-selected .image-resize-hint,
body.resizing-image .cell-image.image-selected .image-resize-hint {
  border-color: var(--surface);
  color: #fff;
  background: var(--primary);
  opacity: 1;
}

.cell-image.image-dragging {
  opacity: 0.42;
  cursor: grabbing;
}

.cell-image[data-align="center"] {
  margin-right: auto;
  margin-left: auto;
}

.cell-image[data-align="right"] {
  margin-right: 0;
  margin-left: auto;
}

.cell-file {
  position: relative;
  display: grid;
  width: min(100%, 340px);
  max-width: 100%;
  min-height: 58px;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 6px 0;
  padding: 8px 94px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, var(--canvas));
  color: var(--ink);
  cursor: default;
  user-select: none;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.cell-file.file-selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.file-type-badge {
  display: grid;
  min-width: 44px;
  height: 40px;
  place-items: center;
  border-radius: 7px;
  background: color-mix(in srgb, var(--primary) 16%, var(--surface));
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.file-card-body {
  min-width: 0;
}

.file-card-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
}

.file-card-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.jira-preview [data-editor-ui] {
  display: none !important;
}

.jira-preview .cell-code-block,
.jira-preview .cell-image,
.jira-preview .cell-file {
  pointer-events: none;
}

.media-viewer-modal {
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1180px, 94vw);
  height: min(880px, 92vh);
}

.media-viewer-body {
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: auto;
  padding: 24px;
  background: var(--canvas);
}

.media-viewer-body img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 120px);
  border-radius: 8px;
  object-fit: contain;
  box-shadow: var(--shadow);
}

.code-editor-modal {
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1080px, 94vw);
  height: min(820px, 90vh);
}

.code-editor-body {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 20px 22px;
}

.code-editor-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.code-editor-meta strong {
  color: var(--primary);
}

.code-editor-input {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: 52px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f5f7;
}

.code-editor-line-numbers {
  min-height: 0;
  margin: 0;
  padding: 18px 12px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  color: #7a869a;
  background: #ebecf0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  text-align: right;
  user-select: none;
}

.code-editor-body textarea {
  width: 100%;
  min-height: 0;
  resize: none;
  padding: 18px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #172b4d;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  tab-size: 2;
  white-space: pre;
}

.code-editor-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(12, 102, 228, 0.16);
}

.code-save-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--primary);
  background: transparent;
}

.code-save-button:hover:not(:disabled) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.code-save-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.code-save-button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.cell-image.image-selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

body.resizing-image,
body.resizing-image *,
body.resizing-code,
body.resizing-code * {
  cursor: nwse-resize !important;
  user-select: none !important;
}

.import-source-tabs {
  display: flex;
  gap: 4px;
}

.import-source-tab {
  padding: 8px 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.import-source-tab.active {
  color: var(--primary);
  background: #e9f2ff;
}

.import-pane {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.import-pane[hidden] {
  display: none;
}

.import-summary {
  padding: 10px 12px;
  border-radius: 6px;
  color: #216e4e;
  background: #dcfff1;
  font-size: 12px;
}

.modal-actions {
  display: flex;
  gap: 8px;
}

.history-modal {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(980px, 94vw);
  height: min(760px, 88vh);
}

.history-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
}

.history-toolbar input {
  min-width: 200px;
  flex: 1;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}

.history-selection-toggle {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0;
  appearance: none;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.history-selection-toggle:hover:not(:disabled) {
  color: var(--ink);
  background: var(--line-soft);
  border-color: var(--muted);
}

.history-selection-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.history-selection-toggle:disabled {
  opacity: 0.5;
  cursor: default;
}

.history-selection-toggle[aria-pressed="true"] {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
}

.history-selection-toggle[aria-pressed="true"]:hover:not(:disabled) {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 18%, var(--surface));
  border-color: var(--primary);
}

.history-selection-toolbar {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.history-selection-toolbar[hidden],
#deleteSelectedHistoryButton[hidden] {
  display: none;
}

.history-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.history-toolbar #historySelectAll,
.history-select-checkbox {
  flex: 0 0 18px;
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.history-select-checkbox {
  align-self: center;
}

.history-select-checkbox:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

#historySelectionCount {
  white-space: normal;
}

#historySelectionExit {
  margin-left: auto;
}

.history-item.selected {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.history-project-filter,
.history-sort {
  width: 180px;
  min-width: 0;
  flex-shrink: 0;
  height: 38px;
  padding: 0 38px 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%237f8b9d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-size: 16px 16px;
  background-repeat: no-repeat;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-overflow: ellipsis;
}

.history-sort {
  width: 195px;
  margin-left: auto;
}

.history-project-filter:focus-visible,
.history-sort:focus-visible,
.project-settings-row input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.history-item-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin-bottom: 5px;
}

.history-item .history-item-heading h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.history-project-label {
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--project-color, var(--primary)) 22%, var(--line));
  border-radius: 5px;
  background: color-mix(in srgb, var(--project-color, var(--primary)) 8%, var(--surface));
  color: var(--primary);
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.history-project-label[style] {
  color: var(--ink);
}

.history-project-label[style]::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border: 1px solid color-mix(in srgb, var(--project-color) 70%, var(--ink));
  border-radius: 50%;
  background: var(--project-color);
  content: "";
}

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

.project-settings-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.project-settings-row code {
  flex: 0 1 90px;
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.project-settings-row input {
  flex: 1 1 180px;
  min-width: 0;
  max-width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.project-name-field {
  flex: 1 1 180px;
  min-width: 0;
}

.project-name-field input {
  width: 100%;
}

.project-color-field {
  flex: 0 1 196px;
  max-width: 100%;
  min-width: 0;
}

.project-color-caption {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.project-color-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.project-color-controls .project-color-picker {
  flex: 0 0 34px;
  width: 34px;
  padding: 3px;
  cursor: pointer;
}

.project-color-controls .project-color-code {
  flex: 1 1 80px;
  width: 80px;
  padding: 0 8px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}

.project-color-code[aria-invalid="true"] {
  border-color: var(--danger);
}

.project-color-reset {
  flex: 0 0 28px;
  width: 28px;
  height: 32px;
  color: var(--muted);
}

.project-settings-skeleton {
  min-height: 78px;
}

.project-skeleton-key {
  flex: 0 1 90px;
  height: 12px;
}

.project-skeleton-name {
  flex: 1 1 180px;
  height: 38px;
}

.project-skeleton-color {
  flex: 0 1 196px;
  height: 38px;
}

.history-toolbar span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.history-list {
  display: grid;
  align-content: start;
  gap: 9px;
  overflow-y: auto;
  padding: 18px 22px;
}

.history-empty {
  padding: 48px 20px;
  color: var(--muted);
  text-align: center;
}

.history-empty p {
  margin: 0 0 14px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 420px) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.history-loading-status {
  color: var(--muted);
  font-size: 13px;
  padding: 0 0 3px;
}

.history-skeleton-bar {
  border-radius: 5px;
  background: color-mix(in srgb, var(--muted) 16%, var(--surface));
  animation: history-skeleton-pulse 1.6s ease-in-out infinite;
}

.history-skeleton-title {
  width: 68%;
  height: 16px;
  margin-bottom: 9px;
}

.history-skeleton-meta {
  width: 88%;
  height: 11px;
}

.history-skeleton-comment {
  height: 58px;
}

.history-skeleton-action {
  width: 54px;
  height: 32px;
}

.history-skeleton-action-wide {
  width: 120px;
}

@keyframes history-skeleton-pulse {
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .history-skeleton-bar { animation: none; }
}

.history-item.current {
  border-color: var(--primary);
  box-shadow: inset 3px 0 0 var(--primary);
}

.history-item-info {
  min-width: 0;
}

.history-item h3 {
  margin: 0 0 5px;
  font-size: 14px;
}

.history-item p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.history-item-meta {
  display: grid;
  gap: 4px;
}

.history-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  line-height: 1.4;
}

.history-dates > span {
  white-space: nowrap;
}

.history-item code {
  color: var(--ink);
  font-size: 11px;
}

.history-source-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  margin-right: 2px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--primary);
  font-size: 12px;
  vertical-align: middle;
}

.history-comment-field {
  width: 100%;
  min-height: 58px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: color-mix(in srgb, var(--surface) 92%, var(--canvas));
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
}

.history-comment-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent);
}

.history-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.focus-exit-button {
  position: fixed;
  z-index: 90;
  right: 24px;
  bottom: 24px;
  padding: 10px 16px;
  border: 0;
  border-radius: 99px;
  color: white;
  background: var(--primary);
  box-shadow: var(--shadow);
  font-weight: 700;
}

.app-shell.focus-mode .workspace {
  display: block;
  width: calc(100% - 32px);
  max-width: none;
  margin: 16px auto 48px;
}

.app-shell.focus-mode .report-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.app-shell.focus-mode .report-heading,
.app-shell.focus-mode .metadata-grid,
.app-shell.focus-mode .intro-editor,
.app-shell.focus-mode .summary-card {
  display: none;
}

.app-shell.focus-mode .sections {
  margin-top: 16px;
}

.app-shell.focus-mode .editor-toolbar {
  top: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.app-shell.focus-mode .add-section-button {
  margin-bottom: 70px;
}

.markup-preview {
  width: 100%;
  min-height: 100%;
  resize: vertical;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, var(--canvas));
  color: var(--ink);
  caret-color: var(--primary);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  scrollbar-color: var(--table-scrollbar-thumb) var(--table-scrollbar-track);
  scrollbar-width: thin;
}

.markup-preview::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.markup-preview::-webkit-scrollbar-track {
  background: var(--table-scrollbar-track);
}

.markup-preview::-webkit-scrollbar-thumb {
  border: 3px solid var(--table-scrollbar-track);
  border-radius: 999px;
  background: var(--table-scrollbar-thumb);
}

.markup-preview::-webkit-scrollbar-thumb:hover {
  background: var(--table-scrollbar-thumb-hover);
}

.markup-preview:focus {
  border-color: var(--primary);
  outline: 2px solid color-mix(in srgb, var(--primary) 34%, transparent);
  outline-offset: 2px;
}

.modal-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 200;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 8px;
  color: white;
  background: #172b4d;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  pointer-events: none;
}

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

.draft-sync-banner {
  position: fixed;
  z-index: 150;
  right: 24px;
  bottom: 24px;
  display: flex;
  max-width: min(560px, calc(100vw - 32px));
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 36%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  backdrop-filter: blur(14px) saturate(130%);
}

.draft-sync-banner[hidden] {
  display: none;
}

.draft-sync-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.draft-sync-actions .button {
  min-height: 34px;
  padding: 0 12px;
}

@media (max-width: 1380px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0 16px;
  }

  .header-brand-group {
    gap: 12px;
  }

  .header-report-actions {
    min-width: 0;
    gap: 4px;
  }

  .header-action-group + .header-action-group {
    margin-left: 3px;
    padding-left: 5px;
  }

  .header-action {
    padding: 0 7px;
  }

  .header-dropdown-trigger {
    padding: 0 8px;
    font-size: 12px;
  }

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

  .report-card {
    padding: 24px;
  }
}

@media (max-width: 1180px) {
  .topbar {
    height: 64px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0 14px;
  }

  .save-state {
    display: none;
  }

  .brand small {
    display: none;
  }

  .brand-mark {
    width: 56px;
    height: 34px;
  }

  .header-report-actions {
    min-width: 0;
    overflow-x: auto;
    justify-content: safe center;
    scrollbar-width: none;
  }

  .header-report-actions::-webkit-scrollbar {
    display: none;
  }

  .header-action {
    width: 36px;
    min-width: 36px;
    justify-content: center;
    padding: 0;
  }

  .header-report-actions .header-action > span {
    display: none;
  }

  .header-dropdown-trigger {
    min-width: 40px;
  }

  .header-dropdown-trigger > span {
    display: none;
  }

  .workspace {
    width: min(100% - 24px, 1100px);
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-top: 14px;
  }

  .summary-card {
    position: static;
  }

  .editor-toolbar {
    top: 64px;
    flex-wrap: wrap;
    align-content: center;
  }

  .cloud-conflict-popover {
    top: 76px;
  }

  .app-shell.focus-mode .editor-toolbar {
    top: 64px;
  }

}

@media (max-width: 820px) {
  .topbar {
    grid-template-columns: auto minmax(96px, 1fr) auto;
    gap: 4px;
    padding: 0 8px;
  }

  .brand-copy,
  .theme-selector {
    display: none;
  }

  .header-brand-group {
    gap: 0;
  }

  .header-action-group {
    gap: 0;
  }

  .header-action-group + .header-action-group {
    margin-left: 1px;
    padding-left: 2px;
  }

  .header-report-actions #historyButton {
    display: none;
  }

  .header-integrations {
    gap: 3px;
  }

  .header-dropdown-trigger {
    width: 36px;
    min-width: 36px;
    padding: 0;
  }

  .header-dropdown-trigger .chevron-icon {
    display: none;
  }

  .header-dropdown-menu {
    position: fixed;
    top: 58px;
    right: 8px;
    left: auto;
  }

  #jiraSettingsModal { padding: 12px; }
  .settings-modal { width: calc(100vw - 24px); }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .cloud-conflict-popover {
    min-width: calc(100vw - 24px);
    gap: 10px;
    padding: 12px;
  }

  .cloud-conflict-popover small {
    display: none;
  }

  .cloud-conflict-popover b {
    padding: 8px 10px;
  }

  .version-choice-bar,
  .version-compare-grid {
    grid-template-columns: 1fr;
  }

  .version-conflict-modal .modal-footer {
    align-items: stretch;
    flex-direction: column-reverse;
    gap: 10px;
  }

  .version-conflict-modal .modal-footer > .button {
    width: 100%;
  }

  .publish-scope-modal .modal-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .publish-scope-modal .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .publish-scope-modal .modal-actions .button {
    width: 100%;
  }

  .history-toolbar {
    flex-wrap: wrap;
  }

  .history-project-filter {
    width: calc(100% - 50px);
  }

  .history-sort {
    width: 100%;
  }

  .history-toolbar input {
    min-width: 0;
    flex-basis: 100%;
  }

  .history-toolbar span {
    white-space: normal;
  }

  .history-toolbar span:empty {
    display: none;
  }

  .history-modal .modal-footer {
    flex-wrap: wrap;
    gap: 10px;
  }

  .history-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .history-item-actions {
    flex-wrap: wrap;
  }

  .settings-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .settings-nav-item {
    justify-content: center;
  }

  .floating-help-button {
    right: 14px;
    bottom: 14px;
  }

  .workspace,
  .app-shell.focus-mode .workspace {
    width: calc(100% - 12px);
    margin-top: 6px;
  }

  .report-card {
    padding: 14px;
  }

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

  .overall-status-field {
    width: min(100%, 240px);
    max-width: 240px;
  }

  .editor-toolbar {
    gap: 3px;
    padding: 4px;
  }

  .editor-toolbar button {
    width: 32px;
    min-width: 32px;
  }

  .editor-toolbar select {
    min-width: 148px;
  }

  .editor-toolbar #linkButton {
    width: 38px;
    min-width: 38px;
  }

  .section-header {
    grid-template-columns: 18px minmax(0, 1fr) auto;
    padding: 6px;
  }

  .section-actions {
    gap: 0;
  }

  .section-actions .icon-button {
    width: 29px;
    height: 29px;
    font-size: 17px;
  }

  .section-title {
    font-size: 14px;
  }
}

:root[data-theme="dark"] .topbar {
  background: rgba(29, 38, 53, 0.96);
}

:root[data-theme="graphite"] .topbar {
  border-color: rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(ellipse 220px 100% at 50% 0, rgba(31, 35, 41, 0.98) 0, rgba(31, 35, 41, 0.96) 52%, transparent 100%),
    linear-gradient(to bottom, rgba(31, 35, 41, 0.98) 0, rgba(31, 35, 41, 0.92) 58%, rgba(23, 25, 29, 0.82) 100%);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

:root[data-theme="dark"] .brand-mark,
:root[data-theme="graphite"] .brand-mark {
  background-image: url("/icons/brand-dark.png");
  background-size: 122% auto;
}

:root[data-theme="dark"] .brand strong,
:root[data-theme="graphite"] .brand strong {
  color: #f5f8ff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.16);
}

:root[data-theme="dark"] .link-popover {
  background: var(--surface);
}

:root[data-theme="dark"] .button-ghost,
:root[data-theme="dark"] .header-action,
:root[data-theme="dark"] .header-icon-button,
:root[data-theme="dark"] .header-dropdown-trigger,
:root[data-theme="dark"] .field span,
:root[data-theme="dark"] .summary-label {
  color: #c7d1e0;
}

:root[data-theme="graphite"] .button-ghost,
:root[data-theme="graphite"] .header-action,
:root[data-theme="graphite"] .header-icon-button,
:root[data-theme="graphite"] .header-dropdown-trigger,
:root[data-theme="graphite"] .field span,
:root[data-theme="graphite"] .summary-label {
  color: #d7dbe0;
}

:root[data-theme="dark"] .button-secondary,
:root[data-theme="dark"] .add-column-button {
  background: #243b5a;
  color: #85b8ff;
}

:root[data-theme="dark"] .theme-menu-item.current {
  color: #85b8ff;
  background: #243b5a;
}

:root[data-theme="graphite"] .button-secondary,
:root[data-theme="graphite"] .add-column-button {
  background: #2a1f22;
  color: #ff6b6b;
}

:root[data-theme="graphite"] .theme-menu-item.current {
  color: #f3f5f7;
  background: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .settings-note {
  color: #85b8ff;
  background: #123263;
}

:root[data-theme="graphite"] .settings-note {
  border-color: #345b8f;
  color: #9fc7ff;
  background: #17253a;
}

:root[data-theme="dark"] .connection-state {
  background: #2d3b50;
}

:root[data-theme="graphite"] .connection-state {
  background: #262a30;
}

:root[data-theme="dark"] .connection-state.success {
  color: #7ee2b8;
  background: #164b35;
}

:root[data-theme="graphite"] .connection-state.success {
  color: #45d483;
  background: #193326;
}

:root[data-theme="dark"] .connection-state.error,
:root[data-theme="graphite"] .connection-state.error {
  color: #ff9a9d;
  background: #441c20;
}

:root[data-theme="dark"] .cell-code-block,
:root[data-theme="graphite"] .cell-code-block {
  border-color: #363b43;
  color: #e9f2ff;
  background: #111317;
}

:root[data-theme="dark"] .cell-file,
:root[data-theme="graphite"] .cell-file {
  border-color: #363b43;
  background: #1b2027;
}

:root[data-theme="dark"] .file-type-badge,
:root[data-theme="graphite"] .file-type-badge {
  background: rgba(76, 154, 255, 0.16);
}

:root[data-theme="dark"] .object-action-panel,
:root[data-theme="graphite"] .object-action-panel {
  border-color: #434851;
  background: rgba(31, 35, 41, 0.94);
}

:root[data-theme="dark"] .object-action-button,
:root[data-theme="graphite"] .object-action-button {
  color: #d7dbe0;
  background: transparent;
}

:root[data-theme="dark"] .code-preview-meta,
:root[data-theme="graphite"] .code-preview-meta {
  color: #ff8f8f;
}

:root[data-theme="dark"] .code-key,
:root[data-theme="graphite"] .code-key {
  color: #79c0ff;
}

:root[data-theme="dark"] .code-string,
:root[data-theme="graphite"] .code-string {
  color: #a5d6ff;
}

:root[data-theme="dark"] .code-literal,
:root[data-theme="graphite"] .code-literal {
  color: #ff7b72;
}

:root[data-theme="dark"] .code-number,
:root[data-theme="graphite"] .code-number {
  color: #d2a8ff;
}

:root[data-theme="dark"] .button-ghost:hover,
:root[data-theme="dark"] .button-secondary:hover,
:root[data-theme="dark"] .header-action:hover,
:root[data-theme="dark"] .header-icon-button:hover,
:root[data-theme="dark"] .header-dropdown-trigger:hover,
:root[data-theme="dark"] .header-dropdown.open .header-dropdown-trigger,
:root[data-theme="dark"] .header-dropdown-item:hover,
:root[data-theme="dark"] .icon-button:hover,
:root[data-theme="dark"] .editor-toolbar button:hover,
:root[data-theme="dark"] .editor-toolbar select:hover,
:root[data-theme="dark"] .row-menu-button:hover,
:root[data-theme="dark"] .floating-context-menu button:hover {
  background: #2d3b50;
}

:root[data-theme="graphite"] .button-ghost:hover,
:root[data-theme="graphite"] .button-secondary:hover,
:root[data-theme="graphite"] .header-action:hover,
:root[data-theme="graphite"] .header-icon-button:hover,
:root[data-theme="graphite"] .header-dropdown-trigger:hover,
:root[data-theme="graphite"] .header-dropdown.open .header-dropdown-trigger,
:root[data-theme="graphite"] .header-dropdown-item:hover,
:root[data-theme="graphite"] .icon-button:hover,
:root[data-theme="graphite"] .editor-toolbar button:hover,
:root[data-theme="graphite"] .editor-toolbar select:hover,
:root[data-theme="graphite"] .row-menu-button:hover,
:root[data-theme="graphite"] .floating-context-menu button:hover {
  background: #2b3037;
}

:root[data-theme="dark"] .editor-toolbar button:hover {
  background-color: #2d3b50 !important;
}

:root[data-theme="dark"] .editor-toolbar select:hover,
:root[data-theme="dark"] .editor-toolbar select:focus {
  background: #2d3b50 !important;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  box-shadow: inset 0 0 0 999px #2d3b50;
  -webkit-text-fill-color: var(--ink);
}

:root[data-theme="dark"] #blockFormat {
  color-scheme: dark;
  background-color: #222e3f;
}

:root[data-theme="dark"] .editor-toolbar select option {
  color: var(--ink);
  background: #222e3f;
}

:root[data-theme="graphite"] .editor-toolbar button:hover {
  background-color: #2b3037 !important;
}

:root[data-theme="graphite"] .editor-toolbar select:hover,
:root[data-theme="graphite"] .editor-toolbar select:focus {
  background: #2b3037 !important;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  box-shadow: inset 0 0 0 999px #2b3037;
  -webkit-text-fill-color: var(--ink);
}

:root[data-theme="graphite"] #blockFormat {
  color-scheme: dark;
  background-color: #262a30;
}

:root[data-theme="graphite"] .editor-toolbar select option {
  color: var(--ink);
  background: #262a30;
}

:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .editor-toolbar,
:root[data-theme="dark"] .section-sticky-block,
:root[data-theme="dark"] .add-row-button,
:root[data-theme="dark"] .section-header-table th,
:root[data-theme="dark"] .preview-body,
:root[data-theme="dark"] .import-textarea {
  background: #222e3f;
  color: var(--ink);
}

:root[data-theme="graphite"] .field input,
:root[data-theme="graphite"] .field select,
:root[data-theme="graphite"] .editor-toolbar,
:root[data-theme="graphite"] .section-sticky-block,
:root[data-theme="graphite"] .add-row-button,
:root[data-theme="graphite"] .section-header-table th,
:root[data-theme="graphite"] .preview-body,
:root[data-theme="graphite"] .import-textarea {
  border-color: #363b43;
  background: #262a30;
  color: var(--ink);
}

:root[data-theme="graphite"] .intro-editor,
:root[data-theme="graphite"] .editable-column-header input:hover,
:root[data-theme="graphite"] .editable-column-header input:focus,
:root[data-theme="graphite"] .jira-preview {
  background: var(--surface);
  color: var(--ink);
}

:root[data-theme="dark"] .intro-editor,
:root[data-theme="dark"] .editable-column-header input:hover,
:root[data-theme="dark"] .editable-column-header input:focus,
:root[data-theme="dark"] .jira-preview {
  background: var(--surface);
  color: var(--ink);
}

:root[data-theme="dark"] .check-table td {
  background: #1d2635;
}

:root[data-theme="graphite"] .check-table td {
  background: #1f2329;
}

:root[data-theme="dark"] .column-menu-button:hover {
  background: #38485f;
  color: var(--ink);
}

:root[data-theme="graphite"] .column-menu-button:hover {
  background: #2b3037;
  color: var(--ink);
}

:root[data-theme="dark"] .status-ok,
:root[data-theme="graphite"] .status-ok {
  color: #8af0b1;
  background: #193326;
}

:root[data-theme="graphite"] .status-ok {
  color: #45d483;
}

:root[data-theme="dark"] .status-fail,
:root[data-theme="graphite"] .status-fail {
  color: #ff9a9d;
  background: #441c20;
}

:root[data-theme="dark"] .status-almost,
:root[data-theme="graphite"] .status-almost {
  color: #92bbff;
  background: #1a2e4b;
}

:root[data-theme="dark"] .status-unchecked,
:root[data-theme="graphite"] .status-unchecked {
  color: #b8acf6;
  background: #352c63;
}

:root[data-theme="dark"] .status-partial,
:root[data-theme="graphite"] .status-partial {
  color: #ffc776;
  background: #4a3217;
}

:root[data-theme="dark"] .status-clarification,
:root[data-theme="graphite"] .status-clarification {
  color: #ffd294;
  background: #5b3410;
}

:root[data-theme="dark"] .overall-status-field #overallStatus.status-ok,
:root[data-theme="graphite"] .overall-status-field #overallStatus.status-ok {
  color: #7ee2b8;
  background: #164b35;
}

:root[data-theme="graphite"] .overall-status-field #overallStatus.status-ok {
  color: #45d483;
}

:root[data-theme="dark"] .overall-status-field #overallStatus.status-fail,
:root[data-theme="graphite"] .overall-status-field #overallStatus.status-fail {
  color: #ff9a9d;
  background: #441c20;
}

:root[data-theme="dark"] .overall-status-field #overallStatus.status-almost,
:root[data-theme="graphite"] .overall-status-field #overallStatus.status-almost {
  color: #92bbff;
  background: #1a2e4b;
}

:root[data-theme="dark"] .overall-status-field #overallStatus.status-unchecked,
:root[data-theme="graphite"] .overall-status-field #overallStatus.status-unchecked {
  color: #b8acf6;
  background: #352c63;
}

:root[data-theme="dark"] .overall-status-field #overallStatus.status-partial,
:root[data-theme="graphite"] .overall-status-field #overallStatus.status-partial {
  color: #ffc776;
  background: #4a3217;
}

:root[data-theme="dark"] .overall-status-field #overallStatus.status-clarification,
:root[data-theme="graphite"] .overall-status-field #overallStatus.status-clarification {
  color: #ffd294;
  background: #5b3410;
}

:root[data-theme="dark"] .code-editor-input,
:root[data-theme="graphite"] .code-editor-input {
  border-color: #363b43;
  background: #111317;
}

:root[data-theme="dark"] .code-editor-line-numbers,
:root[data-theme="graphite"] .code-editor-line-numbers {
  border-color: #363b43;
  color: #7f8fa5;
  background: #191c21;
}

:root[data-theme="dark"] .code-editor-body textarea,
:root[data-theme="graphite"] .code-editor-body textarea {
  color: #e9f2ff;
}

:root[data-theme="dark"] .modal-backdrop,
:root[data-theme="graphite"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.72);
}

:root[data-theme="graphite"] .modal-header,
:root[data-theme="graphite"] .modal-footer,
:root[data-theme="graphite"] .import-body,
:root[data-theme="graphite"] .settings-body {
  color: var(--ink);
  background: var(--surface);
}

:root[data-theme="graphite"] .import-body p,
:root[data-theme="graphite"] .modal-footer {
  color: var(--muted);
}

:root[data-theme="dark"] .modal-header,
:root[data-theme="dark"] .modal-footer,
:root[data-theme="dark"] .import-body,
:root[data-theme="dark"] .settings-body {
  color: var(--ink);
  background: var(--surface);
}

:root[data-theme="dark"] .import-body p,
:root[data-theme="dark"] .modal-footer {
  color: var(--muted);
}

:root[data-theme="dark"] .import-source-tab.active {
  color: #85b8ff;
  background: #243b5a;
}

:root[data-theme="dark"] .settings-tab.active {
  color: #85b8ff;
  background: #243b5a;
}

:root[data-theme="dark"] .settings-nav-item.active {
  color: #85b8ff;
  background: #243b5a;
}

:root[data-theme="graphite"] .import-source-tab.active {
  color: #ff8f8f;
  background: #2a1f22;
}

:root[data-theme="graphite"] .settings-tab.active {
  color: #ff8f8f;
  background: #2a1f22;
}

:root[data-theme="graphite"] .settings-nav-item.active {
  color: #ff8f8f;
  background: #2a1f22;
}

:root[data-theme="dark"] .import-summary {
  color: #7ee2b8;
  background: #164b35;
}

:root[data-theme="graphite"] .import-summary {
  color: #45d483;
  background: #193326;
}

:root[data-theme="dark"] .connection-state.error {
  color: #ff9c8f;
  background: #5d1f1a;
}

:root[data-theme="dark"] .cell-code-block {
  border-color: #3d506b;
  color: #e9f2ff;
  background: #101722;
}

:root[data-theme="dark"] .object-action-panel {
  border-color: #526581;
  background: color-mix(in srgb, #243247 94%, transparent);
}

:root[data-theme="dark"] .object-action-button {
  color: #c7d1e0;
  background: transparent;
}

:root[data-theme="dark"] .code-preview-meta {
  color: #85b8ff;
}

:root[data-theme="dark"] .status-ok,
:root[data-theme="dark"] .overall-status-field #overallStatus.status-ok {
  color: #7ee2b8;
  background: #164b35;
}

:root[data-theme="dark"] .status-fail,
:root[data-theme="dark"] .overall-status-field #overallStatus.status-fail {
  color: #ff9c8f;
  background: #5d1f1a;
}

:root[data-theme="dark"] .status-almost,
:root[data-theme="dark"] .overall-status-field #overallStatus.status-almost {
  color: #85b8ff;
  background: #123263;
}

:root[data-theme="dark"] .status-partial,
:root[data-theme="dark"] .overall-status-field #overallStatus.status-partial {
  color: #fec57b;
  background: #5f3811;
}

:root[data-theme="dark"] .code-editor-input {
  border-color: #3d506b;
  background: #101722;
}

:root[data-theme="dark"] .code-editor-line-numbers {
  border-color: #3d506b;
  color: #7f8fa5;
  background: #172130;
}

:root[data-theme="dark"] .settings-curl-state.success {
  color: #7ee2b8;
  background: #164b35;
}

:root[data-theme="graphite"] .settings-curl-state.success {
  color: #45d483;
  background: #193326;
}

:root[data-theme="dark"] .settings-curl-state.error {
  color: #ff9c8f;
  background: #5d1f1a;
}

:root[data-theme="graphite"] .settings-curl-state.error {
  color: #ff9a9d;
  background: #441c20;
}

/* Bulk row selection shares the editor toolbar's sticky stack. */
.selection-toolbar {
  --selection-accent: #7050c9;
  position: sticky;
  top: 132px;
  z-index: 41;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-bottom: 12px;
  padding: 7px 52px 7px 10px;
  border: 1px solid var(--selection-accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, var(--selection-accent));
  box-shadow: 0 5px 12px rgba(9, 30, 66, 0.08);
  color: var(--ink);
}
/* Match the 8px sticky gaps without painting over either panel's border. */
body.selection-mode .editor-toolbar::after,
.selection-toolbar::after {
  top: calc(100% + 1px);
  bottom: auto;
  height: 8px;
  z-index: -1;
}
body.selection-mode .editor-toolbar.is-stuck::after,
.selection-toolbar.is-stuck::after {
  opacity: 1;
}
.selection-toolbar[hidden], .selection-menu[hidden], #selectionCreateForm[hidden] { display: none; }
.selection-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--selection-accent) 50%, var(--line));
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.selection-toolbar button:hover:not(:disabled) { background: color-mix(in srgb, var(--surface) 88%, var(--selection-accent)); }
.selection-toolbar button:disabled { opacity: .45; cursor: default; }
.selection-toolbar button:focus-visible, .selection-toolbar input:focus-visible,
.selection-checkbox:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.selection-all { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; font-size: 13px; font-weight: 600; }
.selection-checkbox, #selectionAll { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: #7950dc; cursor: pointer; }
.selection-count { border-left: 1px solid var(--line); padding: 0 12px; font-size: 13px; white-space: nowrap; }
.selection-menu-wrap { position: relative; }
.selection-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 310px;
  max-width: calc(100vw - 48px);
  max-height: calc(100dvh - 24px);
  overflow: visible;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
}
.selection-menu strong { display: block; margin: 0 0 8px; }
#selectionStatusOptions label { display: flex; align-items: center; gap: 10px; padding: 9px 2px; cursor: pointer; }
.selection-menu:not([hidden]) { display: flex; flex-direction: column; }
.selection-move-menu > :not(.selection-destinations) { flex-shrink: 0; }
#selectionStatusOptions { min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
.selection-menu strong, .selection-menu-footer { flex-shrink: 0; }
.selection-menu-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--line); }
.selection-menu-footer span, .selection-menu small { color: var(--muted); }
.selection-toolbar .button-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.selection-toolbar .button-primary:hover:not(:disabled) { background: var(--primary-hover); }
.selection-toolbar .selection-delete { color: var(--red); }
.selection-toolbar .selection-exit {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 34px;
  min-height: 34px;
  padding: 0;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}
.selection-transfer-options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.selection-transfer-options legend { margin-bottom: 8px; padding: 0; font-weight: 600; }
.selection-transfer-options label { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.selection-transfer-options label:has(input:checked) { border-color: var(--selection-accent); background: color-mix(in srgb, var(--surface) 88%, var(--selection-accent)); }
.selection-transfer-options label:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.selection-transfer-options input { margin: 0; accent-color: var(--selection-accent); }
.selection-transfer-hint { display: block; margin: 8px 0 14px; line-height: 1.4; }
.selection-search-label { display: block; margin-bottom: 12px; }
.selection-menu input[type="search"], .selection-menu input[type="text"] {
  width: 100%; min-height: 36px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--canvas); color: var(--ink); font: inherit;
}
.selection-destinations { display: grid; flex-shrink: 1; min-height: 0; gap: 3px; max-height: 220px; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; margin: 12px 0; }
.selection-destinations button { display: flex; align-items: flex-start; justify-content: flex-start; gap: 10px; text-align: left; border-color: transparent; overflow-wrap: anywhere; }
.selection-destinations button::before { content: ""; flex: 0 0 5px; height: 5px; margin-top: 6px; border-radius: 50%; background: currentColor; opacity: .65; }
.selection-destinations p { margin: 8px 0; color: var(--muted); }
#selectionNewSection { width: 100%; justify-content: flex-start; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
#selectionCreateForm { display: grid; gap: 12px; margin-top: 14px; }
#selectionToggle[aria-pressed="true"] { background: color-mix(in srgb, var(--surface) 80%, #7950dc); color: #7950dc; box-shadow: inset 0 0 0 1px #7950dc; }
.check-table .selection-cell, .section-header-table .selection-cell { width: 44px; padding: 12px 8px; text-align: center; }
/* Keep selection above the theme-specific backgrounds of every table cell. */
:root .check-table tr.row-selected > td { background: var(--selected-row-background); }
.selection-mode .check-section { scroll-margin-top: calc(var(--section-sticky-top) + 8px); }
@media (max-width: 820px) {
  .selection-toolbar { gap: 6px; padding: 7px 48px 7px 7px; }
  .selection-count { padding: 0 7px; }
  .selection-menu-wrap { position: static; }
  .selection-menu { left: 0; top: calc(100% + 6px); }
  .selection-toolbar .selection-exit { right: 6px; }
}

.numbering-settings { display: grid; align-content: start; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.numbering-settings legend { padding: 0; margin-bottom: 14px; color: var(--ink); font-size: 18px; font-weight: 700; }
.numbering-settings .settings-note { margin: 0 0 4px; }
.numbering-option { transition: border-color 120ms ease, background 120ms ease; }
.numbering-option:hover { border-color: var(--muted); }
.numbering-option:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--surface) 94%, var(--primary)); }
.numbering-option:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.numbering-option input { flex: 0 0 auto; width: 16px; height: 16px; accent-color: var(--primary); }
.numbering-option .numbering-example { margin-top: 5px; color: var(--ink); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.row-number-text { white-space: nowrap; font-variant-numeric: tabular-nums; }

.settings-nav-parent { color: var(--ink); }
.settings-nav-parent.group-active { color: var(--primary); }
.settings-subnav { display: grid; gap: 4px; margin: 0 0 8px 18px; padding-left: 8px; border-left: 1px solid var(--line); }
.settings-subnav .settings-nav-item { min-height: 36px; padding: 8px; font-size: 12px; line-height: 1.4; }
.pinning-option:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--surface) 94%, var(--primary)); }
.pinning-option:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.pinning-option input { flex: 0 0 auto; width: 16px; height: 16px; accent-color: var(--primary); }
.pinning-hint { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Freeze only the requested service columns, in both synchronized tables. */
body.pin-number-columns .check-table .row-number,
body.pin-number-columns .section-header-table .number-header {
  position: sticky;
  left: var(--pinned-number-left, 0px);
  z-index: 3;
}
body.pin-number-columns .check-table .selection-cell,
body.pin-number-columns .section-header-table .selection-cell {
  position: sticky;
  left: 0;
  z-index: 3;
}
body.pin-status-columns .check-table .status-cell,
body.pin-status-columns .section-header-table .status-header {
  position: sticky;
  right: var(--pinned-status-right, 40px);
  z-index: 3;
}
body.pin-number-columns .check-table .row-number,
body.pin-number-columns .check-table .selection-cell,
body.pin-status-columns .check-table .status-cell { background: var(--surface); }
/* Solid header fills prevent moving text from showing through frozen cells. */
body.pin-number-columns .section-header-table .number-header,
body.pin-number-columns .section-header-table .selection-cell,
body.pin-status-columns .section-header-table .status-header { background: var(--pinned-header-background, #f1f2f4); }
:root[data-theme="dark"] { --pinned-header-background: #222e3f; }
:root[data-theme="graphite"] { --pinned-header-background: #262a30; }
body.pin-number-columns .check-table tr.row-selected > .row-number,
body.pin-number-columns .check-table tr.row-selected > .selection-cell,
body.pin-status-columns .check-table tr.row-selected > .status-cell { background: var(--selected-row-background); }
@media (max-width: 820px) {
  .settings-sidebar .settings-nav-parent,
  .settings-sidebar .settings-subnav { grid-column: 1 / -1; }
  .settings-subnav { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 6px; padding: 0; border: 0; }
}

/* Draw frozen-column boundaries inside the cells: collapsed table borders and
   outer cell shadows alone can disappear when a sticky cell overlaps its peers. */
:root {
  --pinned-column-divider: color-mix(in srgb, var(--line) 90%, var(--ink));
  --pinned-column-shadow: rgba(9, 30, 66, .1);
}
:root[data-theme="dark"], :root[data-theme="graphite"] {
  --pinned-column-shadow: rgba(0, 0, 0, .18);
}
body.pin-number-columns .check-table .row-number::after,
body.pin-number-columns .section-header-table .number-header::after,
body.pin-status-columns .check-table .status-cell::after,
body.pin-status-columns .section-header-table .status-header::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  z-index: 4;
  background: var(--pinned-column-divider);
  pointer-events: none;
}
body.pin-number-columns .check-table .row-number::after,
body.pin-number-columns .section-header-table .number-header::after {
  right: 0;
  box-shadow: 2px 0 5px var(--pinned-column-shadow);
}
body.pin-status-columns .check-table .status-cell::after,
body.pin-status-columns .section-header-table .status-header::after {
  left: 0;
  box-shadow: -2px 0 5px var(--pinned-column-shadow);
}

/* Row actions always occupy the outermost frozen column. */
.check-table .row-actions,
.section-header-table .actions-header {
  position: sticky;
  right: 0;
  z-index: 4;
  padding-left: 4px;
  padding-right: 4px;
  background: var(--surface);
}
.section-header-table .actions-header {
  background: var(--pinned-header-background, #f1f2f4);
}
.check-table tr.row-selected > .row-actions {
  background: var(--selected-row-background);
}
body:not(.pin-status-columns) .check-table .row-actions::after,
body:not(.pin-status-columns) .section-header-table .actions-header::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  background: var(--pinned-column-divider);
  box-shadow: -2px 0 5px var(--pinned-column-shadow);
  pointer-events: none;
}

/* Collapsed borders leave a narrow unpainted seam between sticky cells.
   Cover it with the cell's opaque fill, including the selected-row color. */
body.pin-number-columns .check-table .row-number::before,
body.pin-number-columns .section-header-table .number-header::before,
.check-table .row-actions::before,
.section-header-table .actions-header::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  background: inherit;
  box-shadow: inset 1px 0 var(--line);
  pointer-events: none;
}

.publish-scope-body { display: block; overflow-y: auto; }
.publish-scope-body > * + * { margin-top: 12px; }
.publish-scope-list { overflow: visible; }
.publish-scope-heading { margin-bottom: 0; font-size: 14px; }
.publish-status-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.publish-status-list .publish-scope-option { padding: 7px; }
.publish-status-list .publish-scope-option span { font-size: 12px; }
@media (max-width: 420px) { .publish-status-list { grid-template-columns: 1fr; } }

.section-title-group { display: flex; align-items: center; min-width: 0; gap: 4px; }
.section-number { flex: 0 0 auto; padding-left: 8px; color: var(--ink); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.section-title-group .section-title { min-width: 0; padding-left: 0; }

.whats-new-button { position: relative; }
.whats-new-dot { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 2px var(--surface); }
.whats-new-modal { width: min(660px, 100%); height: auto; max-height: 88vh; grid-template-rows: auto minmax(0, 1fr); }
.whats-new-modal .modal-header h2 { margin: 0; font-size: 22px; }
.whats-new-body { min-height: 0; overflow-y: auto; padding: 22px; line-height: 1.55; }
.release-entry h3 { margin: 0; font-size: 19px; }
.release-entry time { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 3px; }
.release-entry h4 { margin: 20px 0 8px; font-size: 14px; }
.release-entry ul { margin: 0; padding-left: 20px; font-size: 14px; }
.release-entry li + li { margin-top: 7px; }
.release-entry + .release-entry { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; }
.release-entry summary { cursor: pointer; font-weight: 700; border-radius: 4px; }
.release-entry summary time { margin-left: 17px; }
.release-entry summary:hover { color: var(--primary); }
.release-entry summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }

#installAppButton[hidden] { display: none; }

/* Update stays beside release notes, without covering the editor or taking focus. */
.pwa-update-button { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line)); border-radius: 9px; background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--ink); cursor: pointer; }
.pwa-update-button[hidden] { display: none; }
.pwa-update-button:hover { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); }
.pwa-update-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.pwa-update-button:disabled { cursor: wait; opacity: .7; }
.pwa-update-dot { position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.pwa-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Compact report actions before their labels can crowd integrations. */
@media (max-width: 1540px) {
  .header-report-actions .header-action > span { display: none; }
  .header-report-actions .header-action { width: 36px; min-width: 36px; padding: 0; }
}
@media (max-width: 820px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
}

.agent-setup-modal { width: min(640px, calc(100vw - 32px)); }
.agent-desktop-setup { display: grid; gap: 12px; }
.agent-desktop-setup .agent-pairing-actions { justify-content: flex-start; flex-wrap: wrap; }
.agent-brand { display: flex; align-items: center; gap: 10px; font-size: 24px; }
.agent-brand .brand-mark { width: 42px; height: 42px; flex-shrink: 0; }
.agent-connection-state > div { min-width: 0; overflow-wrap: anywhere; }
.agent-short-hint { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.agent-installation { border-top: 1px solid var(--line); padding-top: 16px; }
.agent-installation > summary { cursor: pointer; font-weight: 600; }
.agent-installation-content { display: grid; gap: 12px; padding-top: 16px; }
#desktopAgentDownloads { display: flex; gap: 8px; min-width: 0; }
#desktopAgentDownloads select { min-width: 0; flex: 1; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
#desktopAgentPairingActions[hidden],
#prepareDesktopAgentButton[hidden],
#launchDesktopAgentLink[hidden] { display: none; }
@media (max-width: 540px) {
  .agent-brand { font-size: 21px; }
  #desktopAgentDownloads { flex-direction: column; }
}

/* Keep the palette above bulk selection while respecting modal/header layers. */
.editor-toolbar:has(.toolbar-color-menu:not([hidden])) { z-index: 42; }
:root .editor-toolbar .toolbar-color-menu button[data-color],
:root .editor-toolbar .toolbar-color-menu button[data-color]:hover,
:root .editor-toolbar .toolbar-color-menu button[data-color]:focus-visible {
  background: var(--swatch);
  filter: none;
  opacity: 1;
}

/* Default columns editor mirrors the card and callout patterns used by the other settings. */
.default-columns-editor {
  display: grid;
  min-width: 0;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 96%, var(--canvas));
}

.settings-section[data-settings-panel="columns"] {
  min-width: 0;
}

.default-columns-editor-heading {
  display: grid;
  gap: 3px;
}

.default-columns-editor-heading strong {
  color: var(--ink);
  font-size: 14px;
}

.default-columns-editor-heading small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.default-columns-list {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  padding: 12px 8px 16px;
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.default-column-card {
  position: relative;
  flex: 0 0 200px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    opacity 120ms ease;
}

.default-column-card.locked {
  flex: 0 0 64px;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.default-column-card.locked .ui-icon {
  width: 15px;
  height: 15px;
}

.default-column-card input {
  width: 100%;
  box-sizing: border-box;
  margin: 6px 0 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  color: var(--ink);
  background: var(--surface);
}

.default-column-card input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent);
}

.default-column-handle {
  display: inline-grid;
  width: 28px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  cursor: grab;
}

.default-column-handle:hover,
.default-column-handle:focus-visible {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.default-column-handle:active {
  cursor: grabbing;
}

.default-column-handle .ui-icon {
  width: 17px;
  height: 17px;
}

.default-column-actions,
.default-columns-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.default-column-actions .object-action-button {
  color: var(--muted);
}

.default-column-actions .object-action-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.default-columns-tools {
  padding-top: 2px;
}

.default-columns-tools .ui-icon {
  width: 16px;
  height: 16px;
}

.default-column-card.drop-before::before,
.default-column-card.drop-after::after {
  position: absolute;
  z-index: 3;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 16%, transparent);
  content: "";
  pointer-events: none;
}

.default-column-card.drop-before::before {
  left: -7px;
}

.default-column-card.drop-after::after {
  right: -7px;
}

.default-column-card.is-dragging {
  opacity: 0.42;
}

.default-column-card.just-moved {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
  animation: default-column-highlight 900ms ease-out;
}

@keyframes default-column-highlight {
  from { background: color-mix(in srgb, var(--surface) 76%, var(--primary)); }
  to { background: var(--surface); }
}

.default-columns-save-note {
  margin-top: 2px;
}

.floating-context-menu button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.row-drag-handle[hidden] { display:none !important; }

.local-import-option { display: flex; align-items: center; gap: 10px; margin: 16px 0; font-size: 14px; }
#localImportButton {
  --ai-receiver-color: #ef4444;
  --ai-receiver-label: #c9372c;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  min-width: 40px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: #44546f;
  box-shadow: none;
  transform: none;
  transition: none;
  animation: none;
}
:root[data-theme="dark"] #localImportButton,
:root[data-theme="graphite"] #localImportButton {
  --ai-receiver-label: var(--ai-receiver-color);
  color: #fff;
}
#localImportButton .ai-receiver-icon {
  width: 28px;
  height: 28px;
  stroke-width: 1.8;
  filter: none;
}
.local-import-indicator {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 14px;
  padding: 0;
  color: var(--ai-receiver-label);
  background: transparent;
  font-size: 6.5px;
  font-weight: 800;
  line-height: 8px;
  letter-spacing: -.15px;
  text-align: center;
  pointer-events: none;
}
#localImportButton.local-import-active {
  --ai-receiver-color: #22c55e;
  --ai-receiver-label: #1f845a;
  border-color: var(--ai-receiver-color);
  animation: aiReceiverPulse 2.4s ease-in-out infinite;
}
#localImportButton.local-import-active .ai-receiver-icon {
  filter: drop-shadow(0 0 3px rgba(34, 197, 94, 0.7));
  animation: aiReceiverIconPulse 2.4s ease-in-out infinite;
}
@keyframes aiReceiverPulse {
  0%, 100% {
    box-shadow:
      0 0 4px rgba(34, 197, 94, 0.35),
      0 0 8px rgba(34, 197, 94, 0.18);
  }
  50% {
    box-shadow:
      0 0 8px rgba(34, 197, 94, 0.65),
      0 0 16px rgba(34, 197, 94, 0.35);
  }
}
@keyframes aiReceiverIconPulse {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(34, 197, 94, 0.35)); }
  50% { filter: drop-shadow(0 0 3px rgba(34, 197, 94, 0.7)); }
}
@media (prefers-reduced-motion: reduce) {
  #localImportButton.local-import-active {
    animation: none;
    box-shadow:
      0 0 4px rgba(34, 197, 94, 0.35),
      0 0 8px rgba(34, 197, 94, 0.18);
  }
  #localImportButton.local-import-active .ai-receiver-icon {
    animation: none;
    filter: drop-shadow(0 0 2px rgba(34, 197, 94, 0.35));
  }
}
.attachment-import-error { color: var(--danger, #c9372c); }
#localImportModal .modal-actions { flex-wrap: wrap; }
#localImportStatus { overflow-wrap: anywhere; }

#localImportModal .import-modal { width: min(680px, calc(100vw - 32px)); height: auto; min-height: 0; }
#localImportModal .import-body { display: block; min-height: 0; }
#localImportModal .import-body p { margin: 0 0 14px; }
#localImportModal .button { border: 1px solid transparent; }
#localImportModal .button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
#copyLocalImport:enabled { color: #fff; background: #1f845a; }
#copyLocalImport:enabled:hover { background: #216e4e; }
#stopLocalImport:enabled {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 55%, var(--line));
  background: color-mix(in srgb, var(--red) 10%, var(--surface));
}
:root[data-theme="dark"] #stopLocalImport:enabled { color: #ff9c8f; }
#stopLocalImport:enabled:hover { background: color-mix(in srgb, var(--red) 18%, var(--surface)); }
#localImportModal .button:disabled {
  color: var(--muted);
  background: var(--line-soft);
  border-color: var(--line);
  opacity: .6;
  cursor: default;
}
#localImportModal[data-state="off"] #localImportStatus { color: var(--muted); background: var(--line-soft); }

/* Jira import: prominent attachment option and a separate loading state. */
#importModal .import-modal { width: min(920px, calc(100vw - 48px)); height: auto; max-height: min(860px, calc(100dvh - 48px)); }
#importModal .import-body { display: flex; flex-direction: column; gap: 20px; overflow: auto; }
#importModal .import-body > * { flex-shrink: 0; }
#importModal .import-textarea { min-height: clamp(160px, 32vh, 360px); }
#importModal .local-import-option {
  gap: 14px; min-height: 68px; margin: 0; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  background: var(--surface); line-height: 1.4;
}
#importModal .local-import-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--line));
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}
#importModal .local-import-option:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 3px; }
#importModal .local-import-option input { width: 24px; height: 24px; flex: 0 0 24px; margin: 0; accent-color: var(--primary); cursor: inherit; }
.import-option-copy { display: grid; gap: 3px; }
.import-option-copy strong { color: var(--ink); font-size: 15px; font-weight: 600; }
.import-option-copy small { color: var(--muted); font-size: 13px; }
#importModal .modal-footer { gap: 24px; }
#importModal .modal-footer > span { min-width: 0; line-height: 1.5; }
#importModal .modal-actions { flex: 0 0 auto; }
#applyImportButton { min-width: 170px; min-height: 44px; white-space: nowrap; }
#applyImportButton:disabled { cursor: wait; }
#importModal input:disabled, #importModal textarea:disabled, #importModal button:disabled { cursor: wait; }
#applyImportButton .button-spinner { width: 16px; height: 16px; flex: 0 0 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: publish-step-spin .8s linear infinite; }
#applyImportButton .button-spinner[hidden], .import-progress[hidden] { display: none; }
.import-progress { display: grid; gap: 10px; padding: 2px 0; }
.import-progress-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; color: var(--ink); font-size: 14px; line-height: 1.4; }
#importProgressCount { flex: 0 0 auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.import-progress-bar { height: 7px; overflow: hidden; border-radius: 99px; background: var(--line-soft); }
.import-progress-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width .2s ease; }
.import-progress-bar.is-indeterminate > span { width: 35%; animation: import-progress-slide 1.4s ease-in-out infinite; }
@keyframes import-progress-slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@media (max-width: 600px) {
  #importModal { padding: 12px; }
  #importModal .import-modal { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
  #importModal .import-body { padding: 18px; gap: 16px; }
  #importModal .modal-footer { flex-direction: column-reverse; align-items: stretch; gap: 12px; padding: 16px 18px; }
  #importModal .modal-actions, #applyImportButton { width: 100%; }
  #importModal .local-import-option { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  #applyImportButton .button-spinner, .import-progress-bar.is-indeterminate > span { animation: none; }
  .import-progress-bar > span { transition: none; }
}

/* Attachment selection follows the import dialog's existing spacing and colors. */
.import-preview-meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.import-preview-meta[hidden], .import-attachment-choices[hidden], .publish-attachment-summary[hidden] { display: none; }
.import-attachment-choices { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.import-choices-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
#importSelectionCount { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
#importColumnList { padding: 0 16px; }
.import-column-group { min-width: 0; margin: 0; padding: 8px 0; border: 0; }
.import-column-group + .import-column-group { border-top: 1px solid var(--line); }
.import-column-group legend { padding: 12px 0 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.import-column-choice { display: flex; align-items: center; gap: 12px; margin: 2px -6px; padding: 10px 6px; border-radius: 6px; cursor: pointer; }
.import-column-choice:hover { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.import-column-choice:has(input:disabled) { cursor: default; color: var(--muted); }
.import-column-choice input { flex: 0 0 20px; width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
.import-column-copy { display: grid; min-width: 0; gap: 4px; flex: 1; }
.import-column-copy strong { font-size: 14px; font-weight: 500; }
.import-column-copy small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-column-count { min-width: 26px; padding: 3px 6px; border-radius: 5px; background: var(--line-soft); color: var(--muted); text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
#importModal .import-column-hint { border-top: 1px solid var(--line); padding: 12px 16px; font-size: 12px; }
#importModal:has(#importAttachmentChoices:not([hidden])) .import-body { gap: 14px; }
.jira-attachment-reference { border-style: dashed; }
.jira-attachment-reference .file-type-badge { background: var(--line-soft); color: var(--muted); }
.jira-attachment-reference.is-loading { opacity: .65; pointer-events: none; }
.publish-attachment-summary { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
@media (max-width:600px) {
  .import-choices-heading { padding: 12px; }
  #importColumnList { padding: 0 12px; }
  #importModal .import-column-hint { padding: 12px; }
}

#importModal.has-import-preview .import-source-tabs,
#importModal.has-import-preview .import-pane { display: none; }
.import-source-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 14px; }
.import-source-summary[hidden] { display: none; }
#importSourceTitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
#changeImportSource { flex-shrink: 0; padding: 6px 0; border: 0; background: transparent; color: var(--primary); cursor: pointer; }
#importModal .import-column-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center; }
#importModal .import-column-choice { margin-right: 0; }
.import-files-toggle { min-width: 42px; min-height: 36px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; font-variant-numeric: tabular-nums; }
.import-files-toggle:hover, .import-files-toggle[aria-expanded="true"] { color: var(--ink); background: var(--line-soft); }
.import-file-list { grid-column: 1 / -1; margin: 0 0 10px 32px; padding: 10px 12px; list-style: none; border-left: 2px solid var(--line); color: var(--muted); font-size: 12px; }
.import-file-list[hidden] { display: none; }
.import-file-list li { padding: 4px 0; overflow-wrap: anywhere; }

#importModal .import-modal { grid-template-rows: auto minmax(0, 1fr) auto auto; }
#importModal .import-progress { margin: 0 22px; padding: 14px 0; border-top: 1px solid var(--line); }
#importModal .import-column-choice:has(input[data-unavailable="true"]) input { cursor: default; }

.import-source-copy { display: grid; gap: 6px; min-width: 0; }

#importModal .local-import-option[hidden] { display: none; }

/* References keep their Jira syntax without pretending to be downloaded files. */
.jira-image-placeholder, .jira-file-placeholder {
  display: inline-block; max-width: 100%; margin: 3px 0; padding: 5px 8px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--line-soft);
  color: var(--ink); font-size: 13px; line-height: 1.5; vertical-align: baseline;
  overflow-wrap: anywhere;
}
.jira-image-placeholder::before, .jira-file-placeholder::before {
  content: "JIRA"; margin-right: 7px; color: var(--muted); font-size: 10px;
  font-weight: 700; letter-spacing: .04em;
}
.import-column-choice.is-reference-only { cursor: default; }
.import-column-choice.is-reference-only:hover { background: transparent; }
.import-column-item:has(.is-reference-only) .import-file-list { margin-left: 0; }

/* The leading edge places the native text caret before an editor object. */
.cell-editor .cell-image::before, .intro-editor .cell-image::before,
.cell-editor .cell-code-block::before, .intro-editor .cell-code-block::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 12px;
  cursor: text; z-index: 1;
}

.attachment-limits-hint {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.jira-extra-header{border:1px solid var(--border);border-radius:12px;padding:16px;margin:4px 0 16px;min-width:0}.jira-extra-header legend{padding:0 6px;font-weight:600}.jira-extra-header .field+.field{margin-top:12px}

#alternativeConfirmButton[hidden] { display: none; }

/* Import configuration uses the editor's controls, colors and disclosure pattern. */
#importConfigurator { display: grid; gap: 16px; min-width: 0; }
#importConfigurator[hidden], .import-config-panel[hidden] { display: none; }
.import-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.import-preset { display: grid; align-content: start; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.import-preset strong { font-size: 14px; }
.import-preset small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.import-preset[aria-pressed="true"] { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.import-preset:hover { border-color: var(--primary); }
.import-config-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); }
.import-config-tab { padding: 12px 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; }
.import-config-tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.import-config-panel { display: grid; gap: 14px; min-width: 0; }
#importConfigurator :is(button, select, summary):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
#importConfigurator input[type="checkbox"] { width: 18px; height: 18px; margin: 0; flex: 0 0 18px; accent-color: var(--primary); cursor: pointer; }
.import-check { display: flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; font-size: 14px; }
.import-check > span { overflow-wrap: anywhere; }
.import-inline-heading, .import-row-tools, .import-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.import-inline-heading { font-size: 13px; }
#importConfigurator .button-ghost { min-height: 32px; padding: 6px 8px; font-size: 12px; color: var(--primary); }
.import-status-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.import-status-chip { display: inline-flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 12px; }
.import-status-chip:has(input:checked) { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.import-row-tools { justify-content: flex-end; flex-wrap: wrap; gap: 4px 8px; }
.import-row-tools > span { margin-right: auto; }
.import-section-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.import-section-heading { padding: 10px 14px; background: var(--canvas); }
.import-section-heading .import-check { font-weight: 600; flex: 1; }
.import-count { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.import-disclosure { min-width: 0; border: 1px solid var(--line); border-radius: 8px; }
.import-disclosure > summary { padding: 12px 14px; color: var(--ink); font-size: 13px; cursor: pointer; overflow-wrap: anywhere; }
.import-disclosure > summary:hover { background: var(--canvas); }
.import-disclosure-body { padding: 0 14px 14px; display: grid; gap: 12px; min-width: 0; }
.import-disclosure:not([open]) > .import-disclosure-body { display: none; }
.import-section-card > .import-disclosure { border: 0; }
.import-section-card .import-disclosure-body { gap: 0; padding: 0 8px 8px; }
.import-row-choice { display: flex; align-items: center; gap: 10px; padding: 11px 6px; border-top: 1px solid var(--line); cursor: pointer; }
.import-row-choice:hover { background: var(--canvas); }
.import-row-copy { display: grid; grid-template-columns: minmax(24px, auto) minmax(0, 1fr) auto; align-items: baseline; gap: 10px; flex: 1; min-width: 0; }
.import-row-number { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; max-width: 90px; }
.import-row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.import-row-status { color: var(--muted); font-size: 11px; text-align: right; }
#importModal .import-help { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; }
.import-setting { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 42%); gap: 12px; align-items: center; min-width: 0; }
.import-setting-copy { display: grid; gap: 5px; overflow-wrap: anywhere; }
.import-setting-copy strong { font-size: 13px; font-weight: 500; }
.import-setting-copy small { font-size: 12px; color: var(--muted); line-height: 1.5; }
#importConfigurator .import-select { width: 100%; min-width: 0; min-height: 38px; padding: 8px 28px 8px 10px; border: 1px solid var(--line); border-radius: 7px; background-color: var(--surface); color: var(--ink); font: inherit; font-size: 12px; text-overflow: ellipsis; }
.import-data-column { display: grid; gap: 10px; }
.import-data-column + .import-data-column { border-top: 1px solid var(--line); padding-top: 14px; }
.import-data-column .import-disclosure, .import-file-setting { border-left: 2px solid var(--line); border-top: 0; border-bottom: 0; border-right: 0; border-radius: 0; }
.import-file-setting { padding-left: 12px; }
.import-plan-summary { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 16px; }
.import-plan-summary strong { font-size: 14px; }
.import-plan-summary small { font-size: 12px; color: var(--muted); line-height: 1.5; }
#importModal .import-validation { font-size: 13px; color: var(--orange); margin: 0; }
.import-disclosure.needs-mapping { border-color: var(--orange); }
#importModal .import-empty { padding: 18px; margin: 0; text-align: center; color: var(--muted); font-size: 13px; background: var(--canvas); border-radius: 8px; }
.import-preview-scroll { overflow: auto; max-height: 360px; border: 1px solid var(--line); border-radius: 6px; }
.import-result-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.import-result-table :is(th, td) { padding: 10px; text-align: left; border: 1px solid var(--line); min-width: 100px; max-width: 340px; overflow-wrap: anywhere; white-space: normal; }
.import-result-table th { background: var(--canvas); position: sticky; top: 0; }
.import-preview-title { font-size: 13px; }
#importModal input:disabled, #importModal select:disabled, #importModal button:disabled { cursor: not-allowed; }
#applyImportButton[aria-busy="true"] { cursor: wait; }
@media (max-width: 600px) {
  .import-presets { gap: 8px; }
  .import-preset { padding: 12px; }
  .import-config-tabs { gap: 16px; }
  .import-config-tab { font-size: 12px; }
  .import-setting { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .import-row-copy { grid-template-columns: 30px minmax(0, 1fr); gap: 4px 8px; }
  .import-row-status { grid-column: 2; text-align: left; }
  .import-status-chip { padding: 8px; font-size: 11px; }
  #importModal .modal-actions, #applyImportButton { min-width: 0; }
}

#importModal #applyImportButton:disabled { opacity: .5; }

.import-filter-shortcuts { display: flex; flex-wrap: wrap; gap: 2px 6px; justify-content: flex-end; }
#importModal .modal-footer > .import-footer-warning { color: var(--orange); }

/* Import destinations expand only the settings needed for the selected action. */
.import-destination { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); }
.import-destination .import-disclosure { background: var(--surface); }
.toast.visible:has(button) { pointer-events: auto; }
.toast:not(.visible) button { visibility: hidden; }
.toast button { display: inline-block; margin-left: 12px; padding: 4px 0; border: 0; background: transparent; color: white; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.toast button:focus-visible { outline: 2px solid white; outline-offset: 3px; }
tr.import-added > td { animation: import-row-highlight 3.5s ease-out; }
@keyframes import-row-highlight { from { background-color: color-mix(in srgb, var(--primary) 18%, var(--surface)); } }
@media (prefers-reduced-motion: reduce) { tr.import-added > td { animation: none; outline: 1px solid var(--primary); } }

/* Portable report progress and failures remain readable on narrow screens. */
#reportFileModal .modal { width: min(560px, 100%); min-width: 0; max-height: calc(100dvh - 48px); }
#reportFileModal .publish-progress-body { min-height: 0; overflow: auto; overflow-wrap: anywhere; }
#reportFileModal .modal-footer { gap: 16px; }
#reportFileModal .modal-footer > span { min-width: 0; }
#reportFileModal .modal-footer > button { flex-shrink: 0; }
#reportFileModal { backdrop-filter: blur(5px); }
#reportFileModal .modal { border: 1px solid var(--line); }
#reportFileModal .modal-footer { justify-content: flex-end; }
#reportFileModal [hidden] { display: none; }
#reportFileModal.is-success .modal { width: min(540px, 100%); min-height: 0; border-radius: 11px; }
#reportFileModal.is-success .modal-header { padding: 20px 24px; gap: 16px; }
#reportFileModal.is-success .modal-header h2 { font-size: 22px; line-height: 1.2; font-weight: 700; }
#reportFileModal.is-success .modal-header .icon-button { flex-shrink: 0; width: 24px; height: 24px; padding: 0; color: var(--muted); background: transparent; border: 0; }
#reportFileModal.is-success .modal-header .ui-icon { width: 24px; height: 24px; }
#reportFileModal.is-success .publish-progress-body { display: flex; flex-direction: column; gap: 24px; padding: 26px 24px; }
#reportFileModal.is-success .report-file-result { display: flex; align-items: flex-start; gap: 20px; }
.report-file-success-icon { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; color: var(--green); background: color-mix(in srgb, var(--green) 20%, transparent); }
.report-file-success-icon .ui-icon { width: 25px; height: 25px; }
#reportFileModal.is-success .publish-status { padding-top: 1px; font-size: 16px; font-weight: 500; line-height: 1.4; white-space: pre-line; }
.report-file-dismiss { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; line-height: 1.4; cursor: pointer; }
.report-file-dismiss input { flex: 0 0 20px; width: 20px; height: 20px; margin: 0; accent-color: var(--primary); cursor: pointer; }
#reportFileModal.is-success .modal-footer { padding: 16px 24px; }
#reportFileModal.is-success #closeReportFileButton { min-height: 40px; padding: 9px 20px; border: 0; border-radius: 9px; color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, var(--surface)); font-size: 16px; font-weight: 600; }
#reportFileModal.is-success #closeReportFileButton:hover { background: color-mix(in srgb, var(--primary) 23%, var(--surface)); }
#reportFileModal :is(button, input):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.report-file-dismiss input:not(:checked) { appearance: none; border: 1.5px solid var(--muted); border-radius: 4px; background: transparent; }
@media (max-width: 600px) {
  #reportFileModal { padding: 16px; }
  #reportFileModal .modal { max-height: calc(100dvh - 32px); min-height: 0; }
  #reportFileModal.is-success .modal-header { padding: 20px; }
  #reportFileModal.is-success .modal-header h2 { font-size: 20px; }
  #reportFileModal.is-success .publish-progress-body { padding: 24px 20px; gap: 24px; }
  #reportFileModal.is-success .report-file-result { gap: 16px; }
  #reportFileModal.is-success .publish-status { padding: 0; font-size: 16px; white-space: normal; }
  .report-file-success-icon { flex-basis: 40px; width: 40px; height: 40px; }
  .report-file-dismiss { font-size: 14px; gap: 12px; }
  #reportFileModal.is-success .modal-footer { padding: 16px 20px; }
  #reportFileModal.is-success #closeReportFileButton { font-size: 16px; min-height: 40px; }
}

#reportFileProgress { width: 100%; accent-color: var(--primary); }
#reportFileError { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Import sources share a compact, stable shell; only the content area scrolls. */
#importModal .import-modal { display: flex; flex-direction: column; width: min(720px, calc(100vw - 48px)); height: min(480px, calc(100dvh - 48px)); max-height: calc(100dvh - 48px); }
#importModal .modal-header, #importModal .import-source-tabs, #importModal .import-progress { flex: 0 0 auto; }
#importModal .modal-header { padding: 16px 22px; }
#importModal .import-source-tabs { padding: 12px 22px 0; flex-wrap: nowrap; }
#importModal .import-source-tab { flex: 1; min-width: 0; white-space: nowrap; font-size: 13px; font-weight: 600; }
#importModal .import-source-tab.active { color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
#importModal .import-source-tab:hover { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
#importModal .import-source-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
#importModal .import-body { flex: 1; min-height: 0; padding: 18px 22px; gap: 16px; overflow: auto; }
#importModal .import-body p { font-size: 13px; }
#importModal:not(.has-import-preview) .import-pane { flex: 0 0 auto; }
#importModal:not(.has-import-preview) #markupImportPane { flex: 1 1 0; min-height: 0; grid-template-rows: auto minmax(0, 1fr); gap: 10px; }
#importModal .import-textarea { height: 100%; min-height: 0; padding: 12px; overflow: auto; resize: none; border-color: var(--line); color: var(--ink); background: var(--surface); }
#importModal #commentImportPane { align-content: start; grid-template-rows: auto auto; gap: 8px; }
#importModal .local-import-option { min-height: 0; padding: 10px 12px; gap: 10px; border-radius: 8px; }
#importModal .local-import-option input { width: 18px; height: 18px; flex-basis: 18px; }
#importModal .import-option-copy { gap: 2px; }
#importModal .import-option-copy strong { font-size: 13px; }
#importModal .import-option-copy small { font-size: 12px; }
#importModal #reportImportPane { display: flex; flex-direction: column; gap: 12px; }
#importModal #reportImportPane[hidden], #importModal.has-import-preview #reportImportPane { display: none; }
#importModal .modal-footer { flex: 0 0 76px; min-height: 76px; padding: 14px 22px; gap: 16px; }
#importModal .modal-footer > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
#importModal .modal-actions { min-width: 170px; justify-content: flex-end; }
.report-drop-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 226px; padding: 20px; border: 1px dashed var(--line); border-radius: 10px; background: var(--canvas); cursor: pointer; }
.report-drop-zone:hover, .report-drop-zone.is-dragover, .report-drop-zone:focus-within { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--canvas)); }
.report-file-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.report-file-empty[hidden], .report-selected-file[hidden] { display: none; }
.report-file-empty strong { font-size: 14px; font-weight: 600; }
.report-file-empty > span, .report-file-format, .report-selected-file small { color: var(--muted); font-size: 12px; }
.report-file-picker { flex: 0 0 auto; min-height: 36px; font-size: 13px; }
.report-file-picker:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.report-upload-icon { width: 26px; height: 26px; margin-bottom: 4px; color: var(--primary); }
.report-selected-file { display: flex; align-items: center; width: 100%; min-width: 0; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: default; }
.report-selected-file > .ui-icon { flex-shrink: 0; color: var(--primary); }
.report-selected-file > span { flex: 1; min-width: 0; display: grid; gap: 4px; }
.report-selected-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.report-selected-file .icon-button { flex-shrink: 0; }
.report-drop-zone.has-file { cursor: default; border-style: solid; }
.report-drop-zone.has-file .report-file-picker { border-color: transparent; color: var(--primary); background: transparent; }
.report-drop-zone.has-file .report-file-format { display: none; }
#importModal #reportImportError { flex: 0 0 auto; color: var(--orange); overflow-wrap: anywhere; }
@media (max-width: 600px) {
  #importModal .import-modal { width: calc(100vw - 24px); height: min(480px, calc(100dvh - 24px)); max-height: calc(100dvh - 24px); }
  #importModal .modal-header { padding: 14px 16px; }
  #importModal .import-source-tabs { padding: 10px 12px 0; gap: 2px; }
  #importModal .import-source-tab { padding: 8px 4px; font-size: 12px; }
  #importModal .import-body { padding: 16px; }
  #importModal .modal-footer { flex-basis: 106px; min-height: 106px; padding: 12px 16px; gap: 8px; justify-content: center; }
  #importModal .modal-footer > span { font-size: 12px; }
  .report-drop-zone { padding: 16px; min-height: 210px; }
}

@media (max-width: 400px) {
  #importModal .import-source-tab { padding-inline: 2px; font-size: 11px; }
  #importModal #importSource-comment { flex-grow: 1.35; }
}

/* Compact header: one visual language across all themes. */
.topbar {
  height: 72px;
  gap: 14px;
  padding: 0 24px;
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
}
.topbar .header-brand-group { gap: 12px; }
.topbar .header-report-actions { justify-content: center; gap: 12px; overflow: visible; }
.topbar .header-action-group { gap: 8px; }
.topbar .header-action-group + .header-action-group { margin-left: 0; padding-left: 12px; }
.topbar .header-integrations { gap: 10px; }
.topbar .header-action,
.topbar .header-icon-button,
.topbar .header-dropdown-trigger {
  height: 42px; min-height: 42px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); gap: 9px;
  font-size: 13px; font-weight: 600;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.topbar .header-action { width: auto; }
.topbar .header-action > span, .topbar .header-dropdown-trigger > span { display: inline; }
.topbar .header-icon-button { width: 42px; min-width: 42px; padding: 0; }
.topbar .header-action:hover:not(:disabled),
.topbar .header-icon-button:hover:not(:disabled),
.topbar .header-dropdown-trigger:hover,
.topbar .header-dropdown.open .header-dropdown-trigger {
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
}
.topbar button:active:not(:disabled) { transform: translateY(1px); }
.topbar button:focus-visible, .save-state:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.topbar .header-action:disabled, .topbar .header-icon-button:disabled { opacity: .4; }
.topbar #reportMenuButton { width: auto; min-width: 0; flex-shrink: 0; padding: 0; border-color: transparent; background: transparent; gap: 9px; }
.topbar #reportMenuButton:hover, .topbar .report-switcher.open #reportMenuButton { background: var(--line-soft); }
.topbar .brand-mark { width: 60px; height: 38px; }
.topbar .brand strong { font-size: 20px; font-weight: 700; letter-spacing: -.04em; color: var(--ink); }
.topbar #reportMenuButton .chevron-icon { display: block; margin-right: 5px; }
.topbar .save-state { position: relative; display: flex; justify-content: center; min-width: 20px; height: 32px; }
.topbar .save-dot { width: 12px; height: 12px; background: #15b889; box-shadow: 0 0 0 3px color-mix(in srgb, #15b889 10%, transparent); }
.topbar .save-state.saving .save-dot { background: #8995b6; box-shadow: none; }
.topbar .save-state.save-dirty .save-dot { background: #ffba33; box-shadow: none; }
.topbar .save-state.save-error .save-dot { background: #f04452; box-shadow: none; }
.topbar .save-state > span:last-child {
  position: absolute; top: calc(100% + 9px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 260px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  font-size: 12px; font-weight: 500; pointer-events: none;
  opacity: 0; visibility: hidden;
}
.topbar .save-state:hover > span:last-child, .topbar .save-state:focus-visible > span:last-child { opacity: 1; visibility: visible; }
.topbar #localImportButton {
  display: inline-flex; flex: 0 0 auto; width: auto; min-width: 86px; height: 42px;
  padding: 0 12px; gap: 8px; color: var(--ink); border-color: var(--line);
  background: var(--surface); animation: none; box-shadow: none;
}
.topbar #localImportButton .ai-receiver-icon { width: 23px; height: 23px; filter: none; animation: none; }
.topbar #localImportButton .local-import-indicator {
  position: static; display: block; width: 9px; height: 9px; flex: 0 0 9px;
  border-radius: 50%; background: #98a3bf; padding: 0;
}
.topbar #localImportButton.local-import-active .local-import-indicator { background: #15b889; }
.topbar #localImportButton:hover { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
.topbar .header-dropdown-menu { min-width: 265px; padding: 10px; border-radius: 12px; }
.topbar .report-switcher .header-dropdown-menu { min-width: 210px; padding: 6px; }
.topbar .report-switcher .current-app { justify-content: flex-start; }
.topbar .report-switcher .current-app .ui-icon { color: var(--ink); }
.topbar .report-switcher .current-app .report-menu-current-mark { margin-left: auto; color: var(--primary); }
.bug-context-required { margin-left: 10px; color: var(--muted); font-weight: 400; }
.topbar .current-app { justify-content: space-between; }
.topbar .current-app .ui-icon { color: var(--primary); }
.header-menu-title { padding: 4px 10px 10px; color: var(--ink); font-size: 18px; font-weight: 700; }
.header-menu-label { padding: 8px 10px 4px; color: var(--muted); font-size: 12px; font-weight: 650; }
.topbar .header-dropdown-item { min-height: 42px; gap: 14px; font-weight: 500; }
.topbar .header-dropdown-item:hover, .topbar .header-dropdown-item:focus-visible { background: color-mix(in srgb, var(--primary) 9%, var(--surface)); }
.topbar .header-dropdown-divider { margin: 7px 8px; }
.header-update { position: relative; padding-left: 12px; border-left: 1px solid var(--line); }
.header-update[hidden] { display: none; }
.pwa-update-dot, .whats-new-dot { width: 8px; height: 8px; top: -3px; right: -3px; background: #f04452; box-shadow: 0 0 0 3px var(--surface); }
.header-update-popover {
  display: none; position: absolute; z-index: 160; top: 100%; right: -8px;
  width: 260px; padding: 18px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  font-size: 13px; line-height: 1.5;
}
.header-update:hover .header-update-popover, .header-update:focus-within .header-update-popover { display: block; }
.header-update-popover strong { font-size: 14px; }
.header-update-popover p { margin: 8px 0 14px; color: var(--muted); }
.settings-section .theme-selector { display: block; }
.settings-section .theme-toggle { display: none; }
.settings-section .theme-menu { display: grid; position: static; width: 100%; box-shadow: none; gap: 8px; padding: 8px; }
.settings-section .theme-menu-item { min-height: 48px; }
.settings-section .agent-setup-body { padding: 0; overflow: visible; max-height: none; }
.settings-section .agent-brand { margin-bottom: 16px; }
@media (max-width: 1500px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
}
@media (max-width: 1250px) {
  .topbar { gap: 10px; padding: 0 16px; }
  .topbar .header-report-actions, .topbar .header-integrations { gap: 7px; }
  .topbar .header-action-group { gap: 5px; }
  .topbar .header-action-group + .header-action-group { padding-left: 7px; }
  .topbar .header-action { padding: 0 10px; }
}
@media (min-width: 901px) and (max-width: 1320px) {
  .topbar { height: 64px; }
  .topbar .header-report-actions .header-action { width: 38px; min-width: 38px; padding: 0; }
  .topbar .header-report-actions .header-action > span { display: none; }
  .topbar .header-icon-button { width: 38px; min-width: 38px; }
  .topbar .header-report-actions #historyButton { display: inline-flex; }
  .topbar #copyMenuButton { width: auto; min-width: auto; }
}
@media (max-width: 900px) {
  .topbar { height: 112px; padding: 10px 12px; gap: 8px; grid-template-columns: auto 1fr; grid-template-rows: 42px 42px; }
  .topbar .header-brand-group { gap: 5px; }
  .topbar .brand-mark { width: 42px; height: 32px; }
  .topbar .brand strong { font-size: 17px; }
  .topbar .header-integrations { gap: 5px; }
  .topbar .header-integrations .header-icon-button { width: 34px; min-width: 34px; height: 38px; min-height: 38px; }
  .topbar .header-report-actions { grid-row: 2; grid-column: 1 / -1; justify-content: space-between; overflow: visible; }
  .topbar .header-report-actions #historyButton { display: inline-flex; }
  .topbar .header-report-actions .header-action { width: auto; min-width: 36px; padding: 0 9px; }
  .topbar .header-report-actions .header-action > span { display: none; }
  .topbar .header-report-actions #clearButton > span { display: inline; }
  .topbar .header-action-group { gap: 5px; }
  .topbar .header-action-group + .header-action-group { padding-left: 7px; }
  .topbar #localImportButton { min-width: 34px; padding: 0 5px; gap: 4px; }
  .topbar #localImportButton .ai-label { display: none; }
  .topbar #localImportButton .ai-receiver-icon { width: 20px; height: 20px; }
  .topbar #localImportButton .local-import-indicator { width: 6px; height: 6px; flex-basis: 6px; }
  .topbar #copyMenuButton { width: 34px; min-width: 34px; height: 38px; min-height: 38px; padding: 0; }
  .topbar #copyMenuButton > span, .topbar #copyMenuButton .chevron-icon { display: none; }
  .topbar .header-dropdown-menu { position: fixed; top: 58px; right: 12px; left: auto; max-width: calc(100vw - 24px); max-height: calc(100dvh - 76px); overflow-y: auto; }
  .topbar .report-switcher .header-dropdown-menu { left: 12px; right: auto; }
  .header-update { padding-left: 0; border: 0; }
  .header-update-popover { position: fixed; top: 58px; right: 12px; }
  .editor-toolbar, .app-shell.focus-mode .editor-toolbar { top: 112px; }
  .cloud-conflict-popover { top: 124px; }
}
@media (prefers-reduced-motion: reduce) {
  .topbar button { transition: none; }
}

@media (min-width: 901px) and (max-width: 1180px) { .topbar { height: 64px; } }

@media (max-width: 900px) {
  .topbar .header-report-actions .header-icon-button { width: 36px; min-width: 36px; }
  .topbar .save-state > span:last-child { left: 0; transform: none; max-width: calc(100vw - 180px); white-space: normal; }
}
@media (max-width: 380px) {
  .topbar .brand strong { display: none; }
  .topbar .header-report-actions #clearButton > span { display: none; }
}

@media (max-width: 900px) {
  .topbar:has(#installAppButton:not([hidden])):has(.header-update:not([hidden])) .brand strong { display: none; }
}
@media (max-width: 380px) {
  .topbar { padding-inline: 8px; }
  .topbar .header-brand-group { gap: 2px; }
  .topbar .header-integrations { gap: 3px; }
  .topbar .header-integrations .header-icon-button, .topbar #copyMenuButton { width: 30px; min-width: 30px; }
  .topbar #localImportButton { width: 34px; min-width: 34px; padding: 3px; gap: 2px; }
  .topbar #localImportButton .ai-receiver-icon { width: 18px; height: 18px; }
  .topbar .header-report-actions { gap: 4px; }
  .topbar .header-action-group { gap: 4px; }
  .topbar .header-action-group + .header-action-group { padding-left: 5px; }
  .topbar .header-report-actions .header-action, .topbar .header-report-actions .header-icon-button { width: 34px; min-width: 34px; padding: 0; }
}

.html-copy-scope-modal { width: min(520px, 100%); }
.html-copy-scope-footer { flex-wrap: wrap; gap: 10px; }
.html-copy-scope-footer > div { flex: 1 1 100%; color: var(--muted); font-size: 12px; font-weight: 650; }
.html-copy-scope-footer .button { margin-left: auto; white-space: normal; }
#htmlCopyScopeFeedback { margin: 6px 0 0; color: var(--ink); }
@media (max-width: 820px) {
  .html-copy-scope-footer > div { flex: 0 1 auto; }
  .html-copy-scope-footer .button { margin-left: 0; width: 100%; }
}

/* Native dialog keeps keyboard focus inside the local attachment viewer. */
.file-viewer-modal {
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1080px, 94vw);
  height: min(820px, 90dvh);
  max-width: 94vw;
  max-height: 90dvh;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
}
.file-viewer-modal:not([open]) { display: none; }
.file-viewer-modal::backdrop { background: rgba(9, 30, 66, 0.58); }
.file-viewer-heading { min-width: 0; }
.file-viewer-heading h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-viewer-modal .modal-header { gap: 16px; }
.file-viewer-modal .modal-header > button { flex-shrink: 0; }
.file-viewer-meta { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.file-viewer-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  gap: 14px;
  padding: 18px 22px;
}
.file-viewer-options { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; color: var(--muted); font-size: 13px; }
.file-viewer-options label { display: flex; align-items: center; gap: 8px; }
.file-viewer-options select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); }
#fileViewerText {
  flex: 1;
  width: 100%;
  min-height: 0;
  min-width: 0;
  resize: none;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--canvas);
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  tab-size: 2;
}
#fileViewerText[wrap="off"] { white-space: pre; overflow-wrap: normal; }
#fileViewerText[wrap="soft"] { white-space: pre-wrap; overflow-wrap: anywhere; }
#fileViewerText:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.file-viewer-message { margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--canvas); line-height: 1.6; }
.file-viewer-modal [hidden] { display: none; }
.cell-file[data-data-url^="data:"] { cursor: pointer; }
@media (max-width: 600px) {
  .file-viewer-modal { width: 96vw; max-width: 96vw; height: 94dvh; max-height: 94dvh; }
  .file-viewer-modal .modal-header, .file-viewer-modal .modal-footer, .file-viewer-body { padding: 14px; }
  .file-viewer-modal .modal-footer { flex-wrap: wrap; gap: 12px; }
  .file-viewer-modal .modal-actions { width: 100%; }
  .file-viewer-modal .modal-actions .button { flex: 1; padding-inline: 10px; }
}

.section-numbering-settings { margin-bottom: 24px; }
.section-number-input { flex: 0 0 64px; width: 64px; min-width: 0; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--canvas); color: var(--ink); font: inherit; font-size: 17px; font-weight: 700; text-align: center; }
.section-number-input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.selection-copy-options-modal { width: min(620px, 100%); height: auto; max-height: 88dvh; grid-template-rows: auto minmax(0, 1fr) auto; }
.selection-copy-options-modal .modal-header { align-items: flex-start; gap: 16px; }
.selection-copy-options-modal .modal-header > div { min-width: 0; }
.selection-copy-options-modal .modal-header h2 { margin: 4px 0 0; font-size: 22px; line-height: 1.25; }
.selection-copy-options-modal .modal-header .icon-button { flex-shrink: 0; color: var(--muted); }
.selection-copy-summary { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.selection-copy-options-body { overflow-y: auto; min-height: 0; display: grid; gap: 24px; padding: 22px; }
.selection-copy-options-body [hidden] { display: none; }
.selection-copy-options-body fieldset { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.selection-copy-options-body legend { margin-bottom: 6px; padding: 0; font-size: 16px; font-weight: 700; }
.selection-copy-help { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.selection-copy-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.selection-copy-choice { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.selection-copy-choice:hover { border-color: var(--muted); }
.selection-copy-choice:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--surface) 94%, var(--primary)); box-shadow: inset 0 0 0 1px var(--primary); }
.selection-copy-choice:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 3px; }
.selection-copy-options-body input:is([type="radio"], [type="checkbox"]) { width: 18px; height: 18px; flex: 0 0 18px; margin: 1px 0 0; accent-color: var(--primary); cursor: pointer; }
.selection-copy-options-body :is(.selection-copy-choice, .selection-copy-number-option) > span { display: grid; gap: 5px; min-width: 0; }
.selection-copy-options-body :is(.selection-copy-choice, .selection-copy-number-option) strong { color: var(--ink); font-size: 14px; font-weight: 650; line-height: 1.4; }
.selection-copy-options-body :is(.selection-copy-choice, .selection-copy-number-option) small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.selection-copy-number-options { border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); }
.selection-copy-number-option { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 12px 14px; cursor: pointer; }
.selection-copy-number-option + .selection-copy-number-option { border-top: 1px solid var(--line); }
.selection-copy-options-modal .modal-footer { justify-content: flex-end; gap: 8px; }
.selection-copy-options-modal :is(button, input):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.selection-copy-title { display: grid; gap: 8px; font-size: 14px; font-weight: 600; }
.selection-copy-title input { min-width: 0; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--canvas); color: var(--ink); font: inherit; }
@media (max-width: 540px) {
  .selection-copy-choices { grid-template-columns: minmax(0, 1fr); }
  .selection-copy-options-modal .modal-header, .selection-copy-options-modal .modal-footer, .selection-copy-options-body { padding: 18px; }
  .selection-copy-options-modal .modal-header h2 { font-size: 20px; }
}

.bug-report-modal { width: min(860px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
.bug-report-body { overflow-y: auto; min-height: 0; }
.bug-target-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }
.bug-type-row, .bug-ai-row { display: flex; align-items: end; gap: 16px; margin-top: 20px; }
.bug-type-row .field, .bug-ai-row .field { flex: 1; min-width: 0; }
.bug-field-mapping, .bug-optional-fields { margin: 20px 0; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.bug-field-mapping summary, .bug-optional-fields summary { cursor: pointer; font-weight: 600; }
.bug-jira-fields { display: grid; gap: 16px; margin-top: 18px; }
.bug-jira-field textarea, #bugSystemPrompt { resize: vertical; min-height: 100px; line-height: 1.5; }
.bug-user-search { display: flex; gap: 8px; }
.bug-user-search input { min-width: 0; flex: 1; }
.bug-field-error input, .bug-field-error select, .bug-field-error textarea { border-color: var(--red); }
.bug-error-text { color: var(--red); }
.bug-attachments { border: 1px solid var(--line); border-radius: 12px; margin: 20px 0; padding: 14px 16px; }
.bug-attachment-option { display: flex; align-items: center; gap: 10px; padding: 6px 0; overflow-wrap: anywhere; }
.bug-attachment-option input { width: 18px; height: 18px; flex: 0 0 auto; }
.bug-created-result { background: color-mix(in srgb, var(--green) 10%, var(--surface)); padding: 16px; border: 1px solid var(--green); border-radius: 12px; margin: 16px 0; }
@media (max-width: 640px) { .bug-target-grid { grid-template-columns: 1fr; } .bug-type-row, .bug-ai-row { flex-direction: column; align-items: stretch; } .bug-report-modal .modal-footer { flex-wrap: wrap; gap: 10px; } }

.modal.bug-report-modal { width: min(860px, calc(100vw - 32px)); min-width: 0; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); }
.bug-report-body { padding: 20px 24px; }
.bug-report-body > .settings-note { margin-top: 0; padding: 0; background: none; border: 0; }
.bug-report-modal .modal-header, .bug-report-modal .modal-footer { flex: 0 0 auto; }
.bug-jira-field textarea, #bugSystemPrompt { width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.bug-jira-field textarea:focus, #bugSystemPrompt:focus { outline: 2px solid color-mix(in srgb, var(--primary) 20%, transparent); border-color: var(--primary); }
.bug-error-text[hidden] { display: none; }
@media (max-width: 640px) { .bug-report-body { padding: 16px; } .bug-report-modal .modal-header { padding: 16px; } .bug-report-modal .modal-footer { padding: 12px 16px; } .bug-report-modal .modal-actions { width: 100%; justify-content: flex-end; } }

#bugReportModal { padding: 16px; }
.bug-target-section > summary { cursor: pointer; font-weight: 650; color: var(--ink); padding: 10px 0; }
.bug-target-section > .bug-target-grid { margin-top: 12px; }
.bug-jira-field select[multiple] { height: auto; min-height: 76px; padding: 6px 8px; }

.bug-steps { display: flex; gap: 24px; padding: 0; margin: 0 0 18px; list-style: none; color: var(--muted); font-size: 13px; }
.bug-steps li { display: flex; align-items: center; gap: 8px; }
.bug-steps li > span { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 50%; }
.bug-steps [aria-current="step"] { color: var(--ink); font-weight: 650; }
.bug-steps [aria-current="step"] > span { color: #fff; background: var(--primary); border-color: var(--primary); }
.bug-steps .complete > span { color: var(--green); border-color: var(--green); }
.bug-state { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 14px; line-height: 1.45; }
.bug-state.loading { position: sticky; top: -20px; z-index: 2; background: var(--surface); border-color: var(--primary); box-shadow: 0 3px 12px #0001; }
.bug-state.error { border-color: var(--red); color: var(--red); }
.bug-spinner { width: 20px; height: 20px; flex: 0 0 auto; border: 2px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: bug-spin .8s linear infinite; }
.bug-field-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.bug-required-badge, .bug-optional-badge { font-size: 11px; font-weight: 500; padding: 2px 6px; border-radius: 5px; }
.bug-required-badge { color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.bug-optional-badge { color: var(--muted); }
.bug-required-note { color: var(--muted); font-size: 12px; margin: 18px 0 0; }
.bug-target-section > .bug-type-row { margin-top: 16px; }
.bug-target-section #loadBugContext { grid-column: 1 / -1; justify-self: end; min-width: 160px; }
.bug-target-section .bug-target-grid { grid-template-columns: minmax(0, 1fr); }
.bug-creation-mode { margin: 0; padding: 0; border: 0; min-width: 0; }
.bug-creation-mode legend { padding: 0; margin-bottom: 8px; color: var(--ink); font-size: 14px; font-weight: 600; }
.bug-creation-mode > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bug-creation-mode label { display: flex; align-items: center; gap: 10px; padding: 14px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--ink); font-size: 14px; }
.bug-creation-mode label:has(input:checked) { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); border-color: var(--primary); }
.bug-creation-mode label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.bug-creation-mode:disabled label { cursor: default; opacity: 0.65; }
.bug-creation-mode input { width: 16px; height: 16px; margin: 0; flex-shrink: 0; accent-color: var(--primary); }
@media (max-width: 640px) { .bug-creation-mode > div { grid-template-columns: minmax(0, 1fr); } }
.bug-ai-panel { margin-top: 12px; padding: 14px; background: color-mix(in srgb, var(--primary) 5%, var(--surface)); border: 1px solid var(--line); border-radius: 12px; }
.bug-ai-panel .bug-ai-row { margin-top: 0; }
.bug-ai-images { margin-top: 14px; }
.bug-ai-images label { display: flex; align-items: center; gap: 9px; font-size: 13px; cursor: pointer; }
.bug-ai-images input { width: 16px; height: 16px; margin: 0; flex-shrink: 0; accent-color: var(--primary); }
.bug-ai-images p { margin: 6px 0 0 25px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.bug-ai-images details { margin: 10px 0 0 25px; font-size: 12px; }
.bug-ai-images summary, .bug-analysis-receipt summary { cursor: pointer; color: var(--primary); }
#bugAiAttachmentList { display: grid; gap: 8px; margin-top: 10px; }
#bugAiAttachmentList label { align-items: start; overflow-wrap: anywhere; }
#bugAiAttachmentList input { margin-top: 2px; }
#bugAiAttachmentList label:has(input:disabled) { color: var(--muted); }
.bug-analysis-receipt { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; }
.bug-analysis-receipt ul { display: grid; gap: 8px; padding-left: 20px; line-height: 1.5; overflow-wrap: anywhere; }
.bug-ai-review { margin: 18px 0; padding: 16px; border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: 12px; background: var(--surface); }
.bug-ai-review h3 { margin: 0; font-size: 14px; color: var(--ink); }
.bug-ai-review p { margin: 6px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.bug-ai-review ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.bug-ai-review details { margin-top: 10px; }
.bug-ai-review summary { color: var(--primary); cursor: pointer; font-size: 12px; }
.bug-ai-review details ul { margin-top: 10px; }
.bug-report-body #bugAiHint, .bug-report-body #bugAttachmentHint { padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; }
.bug-created-result { display: grid; gap: 12px; }
.bug-created-result strong { font-size: 18px; }
.bug-created-result p { margin: 0; font-size: 14px; }
.bug-created-result p:empty { display: none; }
@keyframes bug-spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) { .bug-state.loading { top: -16px; } .bug-steps { gap: 14px; font-size: 12px; } .bug-target-section #loadBugContext { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .bug-spinner { animation: none; } }
#bugReportModal [hidden] { display: none; }
.modal.bug-report-modal { height: auto; }
.bug-report-modal select:not([multiple]) { appearance: none; padding-right: 42px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%237f8b9d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-position: right 14px center; background-size: 16px 16px; background-repeat: no-repeat; }
.floating-menu-separator { height: 1px; background: var(--line); margin: 5px 4px; }
.bug-people, .bug-field-group { border: 1px solid var(--line); border-radius: 12px; margin: 20px 0; padding: 14px 16px; min-width: 0; }
.bug-field-group > .bug-jira-fields { margin-top: 0; }
.bug-people > legend, .bug-field-group > legend, .bug-attachments > legend { padding: 0 6px; font-size: 14px; font-weight: 650; color: var(--ink); }
.bug-people-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.bug-people-fields .field { min-width: 0; }
.bug-common-fields { grid-template-columns: minmax(0, 1fr); align-items: start; }
.bug-common-fields [data-bug-field="environment"] { grid-column: 1 / -1; }
.bug-user-picker { display: grid; gap: 6px; min-width: 0; }
.bug-user-entry { position: relative; }
.bug-user-entry input { width: 100%; padding-right: 36px; }
.bug-user-entry input::-webkit-search-cancel-button { appearance: none; }
.bug-user-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; font-size: 20px; }
.bug-user-hint { font-size: 12px; color: var(--muted); font-weight: 400; line-height: 1.4; }
.bug-user-hint:empty { display: none; }
.bug-user-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 4; overflow-y: auto; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px #0002; }
.bug-user-results.above { top: auto; bottom: calc(100% + 6px); }
.bug-user-results button { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 5px; background: none; color: var(--ink); text-align: left; font: inherit; font-size: 14px; cursor: pointer; overflow-wrap: anywhere; }
.bug-user-results button:hover, .bug-user-results button.active, .bug-user-results button[aria-selected="true"] { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); }
.bug-user-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bug-user-chips > span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 8px; border-radius: 6px; background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.bug-user-chips button { border: 0; border-radius: 4px; background: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.bug-user-picker button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
@media (max-width: 640px) { .bug-people-fields, .bug-common-fields { grid-template-columns: minmax(0, 1fr); } }

.bug-extra-context { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 16px 0; }
.bug-extra-context summary { cursor: pointer; font-weight: 650; }
.bug-extra-context .field { margin-bottom: 8px; }
.bug-context-entry { position: relative; width: 100%; }
.bug-context-entry textarea { display: block; font: inherit; line-height: 1.55; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; width: 100%; min-height: 130px; max-width: 100%; resize: vertical; padding-bottom: 54px; }
.bug-context-tools { position: absolute; bottom: 12px; right: 16px; display: flex; gap: 6px; }
.bug-context-tools .icon-button { width: 36px; height: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.bug-context-tools .icon-button[aria-pressed="true"] { background: var(--primary); color: #fff; border-color: var(--primary); }
.bug-voice-hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 9px 0 0; }
.bug-voice-hint[data-state="error"] { color: var(--primary); }
.bug-extra-files { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.bug-extra-file { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); padding: 8px 10px; border-radius: 8px; }
.bug-extra-file span { min-width: 0; flex: 1; overflow-wrap: anywhere; font-size: 12px; }
.bug-extra-file button { flex-shrink: 0; }

#bugExtraContext .settings-note { border: 0; background: none; padding: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.bug-context-entry textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

/* Recording controls share the context field's footer, without covering its text. */
.bug-context-entry[data-voice-active="true"] textarea { padding-bottom: 86px; }
.bug-context-entry[data-voice-active="true"] .bug-context-tools { display: none; }
.bug-voice-panel { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.bug-voice-action { flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; }
.bug-voice-action:hover { border-color: var(--primary); }
.bug-voice-action:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.bug-voice-stop { background: var(--primary); color: #fff; border-color: var(--primary); }
.bug-voice-stop:disabled { opacity: .45; cursor: default; }
.bug-voice-activity { flex: 1; min-width: 0; }
.bug-voice-caption { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); line-height: 1.4; }
#bugVoiceStatus { display: flex; align-items: center; gap: 6px; min-width: 0; }
#bugVoiceTime { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.bug-voice-wave { display: block; width: 100%; height: 28px; color: var(--ink); }
.bug-voice-panel[data-phase="recording"] #bugVoiceStatus { color: var(--ink); }
.bug-voice-panel[data-phase="recording"] #bugVoiceStatus::before { content: ""; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--primary); }
.bug-voice-panel:is([data-phase="starting"], [data-phase="stopping"], [data-phase="transcribing"], [data-phase="processing"]) #bugVoiceStatus::before { content: ""; width: 10px; height: 10px; flex-shrink: 0; border: 2px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: bug-spin .8s linear infinite; }
.bug-voice-panel:not([data-phase="recording"]) .bug-voice-wave { opacity: .4; }
@media (max-width: 520px) { .bug-voice-panel { gap: 8px; left: 8px; right: 8px; padding: 8px; } .bug-voice-caption { flex-wrap: wrap; gap: 0 8px; } .bug-context-entry[data-voice-active="true"] textarea { padding-bottom: 104px; } }
@media (prefers-reduced-motion: reduce) { .bug-voice-panel #bugVoiceStatus::before { animation: none; } }

/* Settings reuses the editor's themes and controls inside one fixed dialog. */
#jiraSettingsModal { padding: 32px; }
#jiraSettingsModal .settings-modal {
  width: min(1440px, calc(100vw - 64px));
  height: min(900px, calc(100dvh - 64px));
  min-height: min(640px, calc(100dvh - 64px));
  grid-template-rows: auto minmax(0, 1fr) auto;
}
#jiraSettingsModal .settings-header { gap: 20px; padding: 22px 28px; background: var(--surface); }
#jiraSettingsModal .settings-header h2 { margin: 0; font-size: 26px; line-height: 1.2; }
#jiraSettingsModal .settings-description { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
#jiraSettingsModal .settings-layout { grid-template-columns: 270px minmax(0, 1fr); min-width: 0; }
#jiraSettingsModal .settings-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  min-width: 0;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: color-mix(in srgb, var(--surface) 82%, var(--canvas));
}
#jiraSettingsModal .settings-nav-group { display: grid; flex: 0 0 auto; gap: 4px; }
#jiraSettingsModal .settings-nav-heading { padding: 0 12px 4px; color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1.3; text-transform: uppercase; letter-spacing: .04em; }
#jiraSettingsModal .settings-nav-item {
  position: relative;
  min-height: 40px;
  width: 100%;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted);
}
#jiraSettingsModal .settings-nav-item .ui-icon { width: 20px; height: 20px; flex: 0 0 auto; }
#jiraSettingsModal .settings-nav-item:hover { color: var(--ink); background: var(--line-soft); }
#jiraSettingsModal .settings-nav-item.active { color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }
#jiraSettingsModal .settings-nav-item.active::before { position: absolute; top: 8px; bottom: 8px; left: 0; width: 3px; border-radius: 3px; background: var(--primary); content: ""; }
#jiraSettingsModal .settings-body {
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 28px;
  background: var(--surface);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
#jiraSettingsModal .settings-section { min-width: 0; align-content: start; gap: 20px; }
#jiraSettingsModal .settings-page-header { display: grid; gap: 6px; margin-bottom: 4px; }
#jiraSettingsModal .settings-page-header h3 { margin: 0; color: var(--ink); font-size: 28px; line-height: 1.25; }
#jiraSettingsModal .settings-page-header p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
#jiraSettingsModal .settings-note { padding: 0; margin: 0; border: 0; border-radius: 0; color: var(--muted); background: transparent; font-size: 13px; line-height: 1.5; }
#jiraSettingsModal .settings-curl-hint { margin: 0; }
#jiraSettingsModal .section-numbering-settings { margin-bottom: 4px; }
#jiraSettingsModal #settingsPinningSection { margin-top: 4px; padding-top: 20px; border-top: 1px solid var(--line); }
#jiraSettingsModal .agent-setup-body { padding: 0; overflow: visible; max-height: none; }
#jiraSettingsModal .agent-test-row { min-width: 0; }
#jiraSettingsModal .agent-test-row .field { min-width: 0; }
#jiraSettingsModal .field :is(input, select, textarea) { min-width: 0; max-width: 100%; color: var(--ink); background: var(--surface); border-color: var(--line); }
#jiraSettingsModal .field textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; line-height: 1.5; resize: vertical; }
#jiraSettingsModal .settings-footer { justify-content: flex-end; min-height: 74px; padding: 16px 28px; border-top: 1px solid var(--line); border-bottom: 0; background: var(--surface); }
#jiraSettingsModal #saveJiraSettingsButton { min-width: 132px; justify-content: center; }
#jiraSettingsModal :is(button, input, select, textarea):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
#jiraSettingsModal :is(.settings-body, .settings-sidebar) { scrollbar-width: thin; scrollbar-color: var(--table-scrollbar-thumb) var(--table-scrollbar-track); }
#jiraSettingsModal :is(.settings-body, .settings-sidebar)::-webkit-scrollbar { width: 8px; }
#jiraSettingsModal :is(.settings-body, .settings-sidebar)::-webkit-scrollbar-track { background: var(--table-scrollbar-track); }
#jiraSettingsModal :is(.settings-body, .settings-sidebar)::-webkit-scrollbar-thumb { border-radius: 8px; background: var(--table-scrollbar-thumb); }
#jiraSettingsModal :is(.settings-body, .settings-sidebar)::-webkit-scrollbar-thumb:hover { background: var(--table-scrollbar-thumb-hover); }
@media (max-height: 800px) {
  #jiraSettingsModal .settings-header { padding: 16px 24px; }
  #jiraSettingsModal .settings-sidebar { gap: 10px; padding: 16px 12px; }
  #jiraSettingsModal .settings-nav-item { min-height: 34px; padding-top: 6px; padding-bottom: 6px; }
  #jiraSettingsModal .settings-footer { min-height: 64px; padding: 12px 24px; }
}
@media (max-height: 700px) {
  #jiraSettingsModal .settings-sidebar { gap: 6px; padding: 10px 12px; }
  #jiraSettingsModal .settings-nav-group { gap: 2px; }
  #jiraSettingsModal .settings-nav-heading { padding-bottom: 2px; font-size: 10px; }
  #jiraSettingsModal .settings-nav-item { min-height: 30px; padding-top: 4px; padding-bottom: 4px; font-size: 12px; }
}
@media (max-width: 820px) {
  #jiraSettingsModal { padding: 12px; }
  #jiraSettingsModal .settings-modal { width: calc(100vw - 24px); height: calc(100dvh - 24px); min-height: 0; }
  #jiraSettingsModal .settings-layout { grid-template-columns: 210px minmax(0, 1fr); }
  #jiraSettingsModal .settings-body { padding: 20px; }
  #jiraSettingsModal .settings-page-header h3 { font-size: 24px; }
}
@media (max-width: 520px) {
  #jiraSettingsModal .settings-layout { grid-template-columns: 132px minmax(0, 1fr); }
  #jiraSettingsModal .settings-header { padding: 14px; gap: 8px; }
  #jiraSettingsModal .settings-header h2 { font-size: 22px; }
  #jiraSettingsModal .settings-description { font-size: 12px; }
  #jiraSettingsModal .settings-sidebar { padding: 14px 6px; gap: 12px; }
  #jiraSettingsModal .settings-nav-heading { padding-left: 6px; font-size: 10px; }
  #jiraSettingsModal .settings-nav-item { padding: 6px; gap: 6px; min-height: 40px; font-size: 12px; overflow-wrap: anywhere; }
  #jiraSettingsModal .settings-nav-item .ui-icon { width: 16px; height: 16px; }
  #jiraSettingsModal .settings-body { padding: 14px; }
  #jiraSettingsModal .settings-page-header h3 { font-size: 21px; overflow-wrap: anywhere; }
  #jiraSettingsModal .settings-footer { padding: 12px 14px; }
  #jiraSettingsModal .agent-test-row { display: grid; grid-template-columns: minmax(0, 1fr); }
  #jiraSettingsModal .theme-menu { min-width: 0; width: 100%; }
}

/* Dictation shares the editor toolbar. */
.dictation-tools { display:flex; align-items:center; gap:7px; margin-left:auto; min-width:0; }
.dictation-caption { display:flex; flex-direction:column; min-width:0; max-width:210px; font-size:11px; line-height:1.45; color:var(--muted); }
#dictationStatus { overflow-wrap:anywhere; }
.editor-toolbar .dictation-button { color:#0052cc; background:color-mix(in srgb, #0052cc 8%, transparent); border:1px solid color-mix(in srgb, #0052cc 22%, transparent); flex-shrink:0; }
.dictation-icon-stop, .dictation-icon-spinner { display:none; }
[data-dictation-phase="recording"] .dictation-icon-mic { display:none; }
[data-dictation-phase="recording"] .dictation-icon-stop { display:block; }
[data-dictation-phase="recording"] .dictation-button, [data-dictation-phase="recording"] #dictationStatus { color:#de350b; }
[data-dictation-phase="recording"] #dictationStatus::before { content:""; display:inline-block; width:6px; height:6px; margin-right:5px; border-radius:50%; background:currentColor; animation:dictation-pulse 1.2s ease-in-out infinite; }
:is([data-dictation-phase="starting"], [data-dictation-phase="stopping"], [data-dictation-phase="transcribing"], [data-dictation-phase="processing"]) .dictation-icon-mic { display:none; }
:is([data-dictation-phase="starting"], [data-dictation-phase="stopping"], [data-dictation-phase="transcribing"], [data-dictation-phase="processing"]) .dictation-icon-spinner { display:block; animation:dictation-spin 1s linear infinite; }
[data-dictation-phase="error"] #dictationStatus { color:#de350b; }
.dictation-target { outline:2px solid #4c9aff; outline-offset:2px; }
.dictation-recovery { padding:12px; margin:0 0 12px; border:1px solid var(--line); border-radius:8px; background:var(--surface); }
#dictationResult { width:100%; resize:vertical; min-height:72px; padding:8px; color:var(--text); background:var(--surface); border:1px solid var(--line); border-radius:6px; font:inherit; }
.editor-toolbar .dictation-setup { font-size:11px; padding:5px; }
@keyframes dictation-pulse { 50% { opacity:.3; } }
@keyframes dictation-spin { to { transform:rotate(360deg); } }
@media(max-width:700px) { .editor-toolbar { flex-wrap:wrap; } .dictation-tools { flex-basis:100%; justify-content:flex-end; padding-top:4px; border-top:1px solid var(--line); } .dictation-caption { max-width:none; flex:1; } }
@media(prefers-reduced-motion:reduce) { .dictation-icon-spinner, #dictationStatus::before { animation:none !important; } }

.dictation-tools [hidden], .dictation-recovery[hidden], #dictationConnectLaunch[hidden] { display:none !important; }
.editor-toolbar[data-dictation-phase="recording"] .dictation-button { color:#de350b; background:color-mix(in srgb, #de350b 10%, transparent); }
:root:is([data-theme="dark"], [data-theme="graphite"]) .editor-toolbar .dictation-button { color:#8fbcff; background:color-mix(in srgb, #4c9aff 14%, transparent); }
:root:is([data-theme="dark"], [data-theme="graphite"]) .editor-toolbar[data-dictation-phase="recording"] .dictation-button { color:#ff9d8a; }

/* Environment preferences use the shared settings cards, fields and buttons. */
.environment-settings-editor { display: grid; gap: 16px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--surface) 96%, var(--canvas)); }
.environment-settings-list { display: grid; gap: 10px; min-width: 0; }
.environment-settings-row { display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: center; gap: 8px; min-width: 0; }
.environment-settings-row input { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); font: inherit; }
.environment-remove { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 8px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; cursor: pointer; }
.environment-remove:hover { color: var(--danger, #c9372c); background: color-mix(in srgb, var(--danger, #c9372c) 8%, transparent); }
.environment-remove .ui-icon { width: 18px; height: 18px; }
.environment-add-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); min-width: 0; }
.environment-add-row .field { min-width: 0; }
.environment-add-row .button { min-height: 40px; justify-content: center; gap: 6px; }
.environment-settings-error { margin: 0; color: var(--danger, #c9372c); font-size: 13px; line-height: 1.5; }
.environment-settings-error[hidden] { display: none; }
.environment-settings-editor input[aria-invalid="true"] { border-color: var(--danger, #c9372c); }
@media (max-width: 600px) {
  .environment-settings-editor { padding: 12px; }
  .environment-add-row { grid-template-columns: minmax(0, 1fr); }
}

@media (max-height: 620px) and (min-width: 521px) {
  #jiraSettingsModal .settings-sidebar { gap: 3px; padding: 6px 12px; }
  #jiraSettingsModal .settings-nav-group { gap: 0; }
  #jiraSettingsModal .settings-nav-heading { padding: 0 8px 2px; }
  #jiraSettingsModal .settings-nav-item { min-height: 28px; padding: 4px 8px; gap: 8px; line-height: 1.3; }
  #jiraSettingsModal .settings-nav-item .ui-icon { width: 16px; height: 16px; }
}

/* The environment combobox keeps manual input and opens all choices from its arrow. */
.environment-field > label { font-size: 12px; }
.environment-input { position: relative; min-width: 0; }
.environment-input #environment { padding-right: 42px; }
.environment-toggle { position: absolute; top: 1px; right: 1px; bottom: 1px; display: flex; align-items: center; justify-content: center; width: 38px; padding: 0; border: 0; border-radius: 0 5px 5px 0; color: var(--muted); background: transparent; cursor: pointer; }
.environment-toggle:hover, .environment-toggle[aria-expanded="true"] { color: var(--ink); background: var(--line-soft); }
.environment-toggle .ui-icon { width: 16px; height: 16px; }
.environment-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.environment-options { position: fixed; z-index: 80; min-width: 0; margin: 0; padding: 4px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.environment-options[hidden] { display: none; }
.environment-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px; padding: 9px 10px; border-radius: 5px; cursor: pointer; }
.environment-field .environment-option-label { min-width: 0; color: inherit; font-size: 14px; line-height: 1.4; font-weight: 400; overflow-wrap: anywhere; }
.environment-option[aria-selected="true"] { color: var(--primary); font-weight: 600; }
.environment-option[aria-selected="true"] .environment-option-label { font-weight: 600; }
.environment-option:hover, .environment-option.is-active { background: var(--line-soft); }
.environment-option .ui-icon { flex: 0 0 16px; width: 16px; height: 16px; }
.environment-options-empty { padding: 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* Required report metadata is checked when the user attempts publication. */
.metadata-grid { align-items: start; }
.overall-status-input { position: relative; min-width: 0; }
.overall-status-input #overallStatus { appearance: none; -webkit-appearance: none; padding-right: 40px; }
.overall-status-input #overallStatus:not([class*="status-"]) { color: var(--muted); font-weight: 400; border-color: var(--line); background: var(--surface); }
.overall-status-chevron { position: absolute; top: 50%; right: 12px; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.metadata-grid .field-error { margin: 0; color: var(--red); font-size: 12px; line-height: 1.4; }
.metadata-grid #issueUrl[aria-invalid="true"],
.metadata-grid #environment[aria-invalid="true"],
.metadata-grid #overallStatus[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }

/* Keep publication menus above metadata, inside the report and below sticky toolbars. */
.report-heading { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.report-publication { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: 100%; }
.report-publication-buttons {
  display: flex; position: relative; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(28, 33, 42, .76);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.report-publication-buttons > #publishButton {
  min-height: 40px; border-radius: 7px 0 0 7px;
  background: transparent; color: #f4f6f9; box-shadow: none;
}
:root .report-publication-buttons .publication-menu-trigger {
  min-height: 40px; min-width: 38px; padding: 10px;
  background: transparent; color: #f4f6f9; border-radius: 0 7px 7px 0;
  border-left: 1px solid rgba(255, 255, 255, .12); box-shadow: none;
}
.report-publication-buttons > #publishButton:hover:not(:disabled),
:root .report-publication-buttons .publication-menu-trigger:hover:not(:disabled),
:root .report-publication-buttons.header-dropdown.open .publication-menu-trigger { background: rgba(255, 255, 255, .09); }
.report-publication-buttons > button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.report-publication-buttons .header-dropdown-menu { position: absolute; top: calc(100% + 6px); right: 0; left: auto; }
.publication-info { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 10px; color: var(--muted); font-size: 11px; max-width: 100%; }
.publication-info[hidden] { display: none; }
.publication-info a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.publication-info time { white-space: nowrap; }
.history-publication-info { justify-content: flex-start; margin-top: 6px; }
.publication-incomplete { color: var(--warning, var(--muted)); }
@media (max-width: 600px) {
  .report-publication { width: 100%; align-items: flex-start; }
  .publication-info { justify-content: flex-start; }
}

/* Align metadata labels and controls even when validation hints are visible. */
.metadata-grid .field > label,
.metadata-grid .field > span { display: block; font-size: 12px; line-height: 1.4; }
.metadata-grid .field input,
.metadata-grid .field select { display: block; }

/* History actions use the same compact icons and corners as the toolbar. */
.history-item { grid-template-columns: minmax(200px, 1fr) minmax(170px, .85fr) auto; }
.history-item-actions { flex-wrap: nowrap; }
.history-item-actions .history-action {
  display: grid; grid-template: 22px 33px / 1fr; justify-items: center; align-content: center; gap: 6px;
  width: 70px; min-height: 73px; padding: 6px 4px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink); font-size: 12px; font-weight: 500; line-height: 1.35;
}
.history-item-actions .history-action:nth-child(2) { width: 90px; }
.history-item-actions .history-action .ui-icon { width: 22px; height: 22px; }
.history-more { border-left: 1px solid var(--line); padding-left: 8px; }
.history-more-button {
  display: grid; place-items: center; width: 40px; min-height: 73px; padding: 6px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer;
}
.history-more-button .ui-icon { width: 24px; height: 24px; }
.history-item-actions .history-action:hover:not(:disabled),
.history-more-button:hover:not(:disabled),
.history-menu-item:hover:not(:disabled) { background: var(--line-soft); }
.history-action:focus-visible, .history-more-button:focus-visible,
.history-menu-item:focus-visible, .history-publication-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.history-action-menu {
  position: fixed; inset: auto; margin: 0; min-width: 160px; max-width: calc(100vw - 16px);
  padding: 6px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); box-shadow: 0 8px 28px rgba(0, 0, 0, .22);
}
.history-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 8px;
  border: 0; border-radius: 6px; background: transparent; color: var(--red);
  font: inherit; font-size: 12px; font-weight: 500; cursor: pointer;
}
.history-menu-item .ui-icon { width: 18px; height: 18px; }
.history-item.published > .history-item-actions { grid-column: 3; grid-row: 1 / 3; }
.history-item .history-publication-info {
  grid-column: 1 / 3; justify-content: flex-start; align-items: center; gap: 8px 16px;
  padding-top: 10px; margin-top: 0; border-top: 1px solid var(--line); font-size: 11px;
}
.history-publication-links { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.publication-info .history-publication-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--ink);
  font-size: 12px; line-height: 1.35; text-decoration: none;
}
.history-publication-link .ui-icon { width: 16px; height: 16px; flex: 0 0 auto; }
.publication-info .history-publication-link:hover { background: var(--line-soft); }
.history-publication-dates { display: grid; gap: 3px; min-width: 0; line-height: 1.4; }
@media (max-width: 1100px) {
  .history-item { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .history-item > .history-item-actions,
  .history-item.published > .history-item-actions { grid-column: 1 / -1; grid-row: auto; justify-content: flex-end; }
  .history-item.published > .history-item-actions { grid-row: 3; }
  .history-item .history-publication-info { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 600px) {
  .history-item { grid-template-columns: minmax(0, 1fr); }
  .history-item.published > .history-item-actions { grid-row: 4; }
  .history-item .history-publication-info { grid-row: 3; }
  .history-item-actions .history-action,
  .history-item-actions .history-action:nth-child(2) { flex: 1; min-width: 0; width: auto; }
  .history-more { flex: 0 0 auto; }
}

/* Light glass publication controls follow the light toolbar palette. */
:root[data-theme="light"] .report-publication-buttons { border-color: var(--line); background: rgba(255, 255, 255, .72); }
:root[data-theme="light"] .report-publication-buttons > #publishButton,
:root[data-theme="light"] .report-publication-buttons .publication-menu-trigger { color: var(--ink); }
:root[data-theme="light"] .report-publication-buttons .publication-menu-trigger { border-left-color: var(--line); }
:root[data-theme="light"] .report-publication-buttons > #publishButton:hover:not(:disabled),
:root[data-theme="light"] .report-publication-buttons .publication-menu-trigger:hover:not(:disabled),
:root[data-theme="light"] .report-publication-buttons.header-dropdown.open .publication-menu-trigger { background: color-mix(in srgb, var(--ink) 6%, transparent); }
